fix: 修复数据转换页面类型检查错误
- statusTag 返回类型改用 TagProps['type'],修复 el-tag type 属性 TS 报错 - handleDelete 参数加 DataConvertTask 类型断言,修复 DefaultRow 类型不匹配 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Plus, Delete, Refresh } from '@element-plus/icons-vue'
|
||||
import type { UploadRequestOptions } from 'element-plus'
|
||||
import type { TagProps, UploadRequestOptions } from 'element-plus'
|
||||
import PageCard from '@/components/PageCard.vue'
|
||||
import {
|
||||
getDataConvertTasks,
|
||||
@@ -80,7 +80,7 @@ async function handleDelete(task: DataConvertTask) {
|
||||
}
|
||||
|
||||
function statusTag(status: string) {
|
||||
const map: Record<string, { type: string; label: string }> = {
|
||||
const map: Record<string, { type: TagProps['type']; label: string }> = {
|
||||
pending: { type: 'info', label: '待上传' },
|
||||
uploaded: { type: 'warning', label: '已上传' },
|
||||
running: { type: 'warning', label: '转换中' },
|
||||
@@ -131,7 +131,7 @@ onMounted(load)
|
||||
>
|
||||
<el-button link type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
<el-button link type="danger" :icon="Delete" @click="handleDelete(row)">删除</el-button>
|
||||
<el-button link type="danger" :icon="Delete" @click="handleDelete(row as DataConvertTask)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
Reference in New Issue
Block a user