This commit is contained in:
sjl
2025-01-15 20:23:05 +08:00
parent c2b63a7a3f
commit d02f85cea5
7 changed files with 92 additions and 54 deletions

View File

@@ -10,7 +10,8 @@
<template #tableHeader='scope'>
<el-button v-auth.device="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
<el-button v-auth.device="'export'" type='primary' :icon='Upload' plain @click='downloadFile()'>导出</el-button>
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click='importFile()' v-if='modeStore.currentMode === "比对式"'>导入</el-button>
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('')" v-if='modeStore.currentMode != "比对式"'>导入</el-button>
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('比对式')" v-if='modeStore.currentMode === "比对式"'>导入</el-button>
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'>
删除
@@ -52,8 +53,6 @@ const appSceneStore = useAppSceneStore()
// ProTable 实例
const proTable = ref<ProTableInstance>()
const devicePopup = ref()
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
// 存储设备类型选项
const devTypeOptions = ref<Device.ResDev[]>([])
@@ -205,15 +204,28 @@ const downloadFile = async () => {
//导入设备
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
const importFile = async () => {
const params = {
title: '被检设备',
showCover: false,
tempApi: downloadTemplate,
importApi: importPqDev,
getTableList: proTable.value?.getTableList,
const importFile = async (pattern:string) => {
if(pattern === '比对式'){
const params = {
title: '被检设备',
showCover: false,
tempApi: downloadTemplate,
importApi: importPqDev,
getTableList: proTable.value?.getTableList,
}
deviceImportExcel.value?.acceptParams(params)
}else{
const params = {
title: '被检设备',
showCover: false,
tempApi: downloadTemplate,
getTableList: proTable.value?.getTableList,
}
deviceImportExcel.value?.acceptParams(params)
}
deviceImportExcel.value?.acceptParams(params)
}
onBeforeMount(async () => {