This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
:total="pagination.total"
|
||||
:marginTop="10"
|
||||
:actions="getActions"
|
||||
:actionsWidth="120"
|
||||
:actionsWidth="180"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
@@ -237,6 +237,7 @@
|
||||
import { StorageService } from '@/api/modules/storage'
|
||||
import { generatePackageCode } from '@/utils/codeGenerator'
|
||||
import { RoutesAlias } from '@/router/routesAlias'
|
||||
import { CardCategory } from '@/types/api/card'
|
||||
import type { IotCardImportTask, IotCardImportTaskStatus } from '@/types/api/card'
|
||||
import type { Carrier } from '@/types/api'
|
||||
|
||||
@@ -253,7 +254,7 @@
|
||||
const uploading = ref(false)
|
||||
const importDialogVisible = ref(false)
|
||||
const selectedCarrierId = ref<number>()
|
||||
const selectedCardCategory = ref<'normal' | 'industry'>('normal') // 默认普通卡
|
||||
const selectedCardCategory = ref<CardCategory>(CardCategory.NORMAL) // 默认普通卡
|
||||
const carrierList = ref<Carrier[]>([])
|
||||
const carrierLoading = ref(false)
|
||||
const failDataDialogVisible = ref(false)
|
||||
@@ -697,7 +698,7 @@
|
||||
// 取消导入
|
||||
const handleCancelImport = () => {
|
||||
clearFiles()
|
||||
selectedCardCategory.value = 'normal'
|
||||
selectedCardCategory.value = CardCategory.NORMAL
|
||||
importForm.batch_no = ''
|
||||
importForm.realname_policy = ''
|
||||
importDialogVisible.value = false
|
||||
@@ -797,9 +798,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
const downloadTaskFile = async (row: IotCardImportTask) => {
|
||||
const fileKey = row.file_name?.trim()
|
||||
if (!fileKey) {
|
||||
ElMessage.warning('当前任务没有可下载的原始文件')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await StorageService.downloadFileByKey(fileKey)
|
||||
ElMessage.success('原始文件下载已开始')
|
||||
} catch (error) {
|
||||
console.error('下载原始文件失败:', error)
|
||||
ElMessage.error('下载原始文件失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 获取操作按钮
|
||||
const getActions = (row: IotCardImportTask) => {
|
||||
const actions: any[] = []
|
||||
const showDownloadFileAction = false
|
||||
|
||||
if (showDownloadFileAction && row.file_name?.trim() && hasAuth('iot_card_task:download_file')) {
|
||||
actions.push({
|
||||
label: '下载文件',
|
||||
handler: () => downloadTaskFile(row),
|
||||
type: 'primary'
|
||||
})
|
||||
}
|
||||
|
||||
if (row.fail_count > 0 && hasAuth('iot_card_task:download_fail_data')) {
|
||||
actions.push({
|
||||
|
||||
Reference in New Issue
Block a user