diff --git a/frontend/src/api/device/testScript/index.ts b/frontend/src/api/device/testScript/index.ts index 55bf0a3..383e733 100644 --- a/frontend/src/api/device/testScript/index.ts +++ b/frontend/src/api/device/testScript/index.ts @@ -45,7 +45,7 @@ export const updateDtls = (params: any) => { } // 根据通讯参数生成装置下发原始数据公式 export const scriptDtlsCheckDataList = (params: any) => { - return http.post(`/pqScript/scriptDtlsCheckDataList`, params) + return http.post(`/pqScript/scriptDtlsCheckDataList`, params,{loading: false}) } // 通讯脚本回显 export const checkDataList = (params: any) => { diff --git a/frontend/src/views/machine/testScript/components/testScriptDetail.vue b/frontend/src/views/machine/testScript/components/testScriptDetail.vue index 2265221..44843a7 100644 --- a/frontend/src/views/machine/testScript/components/testScriptDetail.vue +++ b/frontend/src/views/machine/testScript/components/testScriptDetail.vue @@ -200,7 +200,7 @@ import { type PropType, ref, nextTick } from 'vue' import Tree from './tree.vue' import Commun from './communication.vue' -import type { CascaderOption } from 'element-plus' +import {type CascaderOption, ElMessageBox} from 'element-plus' import { getTreeData } from '@/api/check/test' import { CirclePlus, Delete, Check, CopyDocument, View, EditPen } from '@element-plus/icons-vue' import type { TestScript } from '@/api/device/interface/testScript' @@ -355,33 +355,40 @@ const openDialog = (titleType: string, row: Partial = } // 复制 const copyRow = async (row: any) => { + ElMessageBox.confirm('是否复制当前检测项目?', '提示', { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: 'warning', + draggable: true + }).then(async () => { let checkDataList: any = [] await communRef.value[0]?.getData().forEach((item: any) => { - item.children.forEach((k: any) => { - if (k.enable != 0 || k.errorFlag != 0) { - checkDataList.push({ - pid: k.pid, - valueType: k.id, - dataType: k.dataType, - enable: k.enable, - errorFlag: k.errorFlag - }) - } - }) + item.children.forEach((k: any) => { + if (k.enable != 0 || k.errorFlag != 0) { + checkDataList.push({ + pid: k.pid, + valueType: k.id, + dataType: k.dataType, + enable: k.enable, + errorFlag: k.errorFlag + }) + } + }) }) let { data } = await scriptDtlsCheckDataList({ checkDataList: checkDataList, ...row, retryCompute: true }) let copyRow = JSON.parse(JSON.stringify(row)) delete copyRow.index await addScriptDtls({ ...copyRow, scriptType: activeName.value, checkDataList: data }).then(res => { - if (res.code === 'A0000') { - ElMessage.success({ - message: '复制成功!', - type: 'success' - }) - getTree() - } + if (res.code === 'A0000') { + ElMessage.success({ + message: '复制成功!', + type: 'success' + }) + getTree() + } }) + }) } // 查看 const view = (row: Partial = {}) => {