This commit is contained in:
guanj
2025-08-22 15:34:07 +08:00
2 changed files with 30 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
import type { Plan } from './interface'
import type {Plan} from './interface'
import http from '@/api'
import type { ErrorSystem } from '../device/interface/error'
import type { Device } from '../device/interface/device'
import type {ErrorSystem} from '../device/interface/error'
import type {Device} from '../device/interface/device'
/**
* @name 检测计划管理模块
@@ -132,4 +132,10 @@ export const exportSubPlan = (params: Plan.ResPlan) => {
// 导入子检测计划
export const importSubPlan = (params: Device.ReqPqDevParams) => {
return http.upload(`/adPlan/importSubPlan`, params)
}
// 导出计划检测结果数据
export const exportPlanCheckData = (params: Plan.ResPlan) => {
return http.download(`/adPlan/exportPlanCheckData?planId=${params.id}`)
}

View File

@@ -53,8 +53,18 @@
>
导出子计划元信息
</el-button>
<el-button type="primary" icon="Upload">导入检测结果</el-button>
<el-button type="primary" icon="Box" v-if="!isTabPlanFather">数据合并</el-button>
<el-button
type="primary"
icon="Download"
v-auth.plan="'import_subplan'"
@click="exportPlanCheckResultData"
>
导出检测结果
</el-button>
<el-button type="primary" icon="Upload" v-auth.plan="'add_subplan'">导入检测结果</el-button>
<el-button type="primary" icon="Box" v-auth.plan="'add_subplan'" v-if="!isTabPlanFather">
数据合并
</el-button>
<el-button
type="danger"
icon="Delete"
@@ -156,7 +166,7 @@ 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 { deletePlan, exportSubPlan, getDevListByPlanId, subPlanBindDev } from '@/api/plan/plan'
import { deletePlan, exportPlanCheckData, exportSubPlan, getDevListByPlanId, subPlanBindDev } from '@/api/plan/plan'
import { Device } from '@/api/device/interface/device'
import { useDictStore } from '@/stores/modules/dict'
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
@@ -583,6 +593,14 @@ const exportPlan = async () => {
useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip')
)
}
const exportPlanCheckResultData = async () => {
const params = {
id: planFormContent.value.id
}
ElMessageBox.confirm(`确认导出${planFormContent.value.name}计划检测结果?`, '温馨提示', { type: 'warning' }).then(
() => useDownload(exportPlanCheckData, `${planFormContent.value.name}_计划检测结果`, params, false, '.zip')
)
}
defineExpose({ open, handleTableDataUpdate })
interface ChildrenPlanProps {