ADD: 修改数据合并逻辑,新增 event-source-polyfill包,实现长连接通信,展示合并进度
This commit is contained in:
@@ -62,21 +62,12 @@
|
||||
>
|
||||
数据下载
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="planFormContent && planFormContent?.children.length > 0"
|
||||
v-auth.plan="'add_subplan'"
|
||||
icon="Upload"
|
||||
type="primary"
|
||||
@click="importSubCheckDataClick"
|
||||
>
|
||||
导入检测结果
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!isTabPlanFather && planFormContent && planFormContent?.children.length > 0"
|
||||
v-auth.plan="'add_subplan'"
|
||||
icon="Box"
|
||||
type="primary"
|
||||
@click="mergeSubCheckDataClick"
|
||||
@click="importAndMergePlanCheckDataClick"
|
||||
>
|
||||
数据合并
|
||||
</el-button>
|
||||
@@ -181,17 +172,16 @@ import { reactive, ref } from 'vue'
|
||||
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
|
||||
import { Plan } from '@/api/plan/interface'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface'
|
||||
import type { ColumnProps, ProTableInstance, SearchRenderScope } from '@/components/ProTable/interface'
|
||||
import {
|
||||
deletePlan,
|
||||
exportPlanCheckData,
|
||||
exportSubPlan,
|
||||
getDevListByPlanId,
|
||||
importSubPlanCheckData,
|
||||
mergeSubPlanCheckData,
|
||||
importAndMergePlanCheckData,
|
||||
subPlanBindDev
|
||||
} from '@/api/plan/plan'
|
||||
import { Device } from '@/api/device/interface/device'
|
||||
import { type Device } from '@/api/device/interface/device'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
@@ -667,11 +657,14 @@ const exportPlanCheckResultData = async (selectedListIds: string[]) => {
|
||||
})
|
||||
}
|
||||
|
||||
const importSubCheckDataClick = () => {
|
||||
const importAndMergePlanCheckDataClick = () => {
|
||||
const params = {
|
||||
title: '导入计划检测结果',
|
||||
title: '合并检测计划检测结果',
|
||||
confirmMessage: `确定合并【${planFormContent.value?.name}】的检测数据吗`,
|
||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
||||
importApi: importSubPlanCheckData
|
||||
importApi: importAndMergePlanCheckData,
|
||||
progressBar: true,
|
||||
planId: planId.value
|
||||
}
|
||||
planCheckDataImportZip.value?.acceptParams(params)
|
||||
}
|
||||
@@ -682,22 +675,6 @@ const importResult = async (success: boolean | undefined) => {
|
||||
}
|
||||
}
|
||||
|
||||
const mergeSubCheckDataClick = () => {
|
||||
ElMessageBox.confirm(`确定合并【${planFormContent.value?.name}】的检测数据吗`, '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
const params = {
|
||||
id: planFormContent.value?.id
|
||||
}
|
||||
mergeSubPlanCheckData(params).then(res => {
|
||||
ElMessage.success('合并成功')
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
defineExpose({ open, handleTableDataUpdate })
|
||||
|
||||
interface ChildrenPlanProps {
|
||||
|
||||
Reference in New Issue
Block a user