From 08cffa42562235928e835a86a3ca4c0863da30d3 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Tue, 8 Apr 2025 09:43:12 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/index.ts | 8 +- frontend/src/api/plan/plan.ts | 4 +- frontend/src/components/ImportExcel/index.vue | 2 +- .../resource/components/resourcePopup.vue | 2 + .../src/views/home/components/preTest.vue | 26 +- frontend/src/views/home/components/table.vue | 9 +- .../src/views/home/components/testPopup.vue | 2 +- .../machine/device/components/devicePopup.vue | 7 +- .../testSource/components/parameterPopup.vue | 4 +- .../plan/planList/components/planPopup.vue | 8 +- frontend/src/views/plan/planList/index.vue | 4 +- frontend/src/views/system/base/index.vue | 614 +++++++++--------- .../template/components/reportPopup.vue | 4 +- 13 files changed, 368 insertions(+), 326 deletions(-) diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 670dd06..cfd1fc1 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -100,10 +100,14 @@ class RequestHttp { // 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错) if (data.code && data.code !== ResultEnum.SUCCESS) { if(data.message.includes('&')){ - const formattedMessage = data.message.split('&').join('
'); + let formattedMessage = data.message.split('&').join('
'); + if (data.message.includes(':')) { + formattedMessage = formattedMessage.replace(':', '') + } ElMessage.error({ message: formattedMessage, dangerouslyUseHTMLString: true }); return Promise.reject(data) - } + } + ElMessage.error(data.message) return Promise.reject(data) } diff --git a/frontend/src/api/plan/plan.ts b/frontend/src/api/plan/plan.ts index 8440fe3..727af12 100644 --- a/frontend/src/api/plan/plan.ts +++ b/frontend/src/api/plan/plan.ts @@ -68,8 +68,8 @@ export const exportPlan = (params: Device.ReqPqDevParams) => { } // 下载模板 -export const downloadTemplate = () => { - return http.download(`/adPlan/downloadTemplate`) +export const downloadTemplate = (params: { patternId: string }) => { + return http.download(`/adPlan/downloadTemplate`, params) } // 导入检测计划 export const importPlan = (params: Device.ReqPqDevParams) => { diff --git a/frontend/src/components/ImportExcel/index.vue b/frontend/src/components/ImportExcel/index.vue index 06f6460..fe01d5f 100644 --- a/frontend/src/components/ImportExcel/index.vue +++ b/frontend/src/components/ImportExcel/index.vue @@ -77,7 +77,7 @@ const acceptParams = (params: ExcelParameterProps) => { // Excel 导入模板下载 const downloadTemp = () => { if (!parameter.value.tempApi) return - useDownload(parameter.value.tempApi, `${parameter.value.title}模板`, {}, false) + useDownload(parameter.value.tempApi, `${parameter.value.title}模板`, {'patternId':parameter.value.patternId}, false) } // 文件上传 diff --git a/frontend/src/views/authority/resource/components/resourcePopup.vue b/frontend/src/views/authority/resource/components/resourcePopup.vue index 17b9c08..1565f18 100644 --- a/frontend/src/views/authority/resource/components/resourcePopup.vue +++ b/frontend/src/views/authority/resource/components/resourcePopup.vue @@ -199,6 +199,8 @@ const displayPid = computed({ functionList.value = response.data as unknown as Function.ResFunction[] titleType.value = sign dialogVisible.value = true + rules.value.path = [{ required: true, trigger: 'blur', message: '路由地址必填!' }]; + rules.value.component = [{ required: true, trigger: 'blur', message: '组件地址必填!' }]; if (formContent.value.pid ==='0') { formContent.value.pid = ''; diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index c7fcf3e..b0a86fd 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -4,8 +4,7 @@
- + :label="item.name" disabled>
@@ -18,7 +17,7 @@ - +
@@ -258,9 +257,11 @@ watch(webMsgSend, function (newValue, oldValue) { ElMessage.error(newValue.code) step1.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 10523) { step1.value = 'error' ts.value = 'error' + step5.value = 'error' step1InitLog.value = [{ type: 'error', log: '源连接失败!', @@ -268,6 +269,7 @@ watch(webMsgSend, function (newValue, oldValue) { } else if (newValue.code == -1) { step1.value = 'error' ts.value = 'error' + step5.value = 'error' step1InitLog.value = [{ type: 'error', log: '源未知异常!', @@ -301,6 +303,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step2.value = 'error' // ts.value = 'error' + // step5.value = 'error' } else if (newValue.code == 10551) { step2InitLog.value.push({ type: 'error', @@ -308,6 +311,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step2.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 10552) { //ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") step2InitLog.value = [{ @@ -316,6 +320,7 @@ watch(webMsgSend, function (newValue, oldValue) { }]; step2.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 25001) { activeIndex.value = 2 step2.value = 'success' @@ -347,6 +352,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step3.value = 'error' // ts.value = 'error' + // step5.value = 'error' } else if (newValue.code == 10551) { step3InitLog.value.push({ type: 'error', @@ -354,6 +360,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step3.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 10552) { step3.value = 'error' //ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") @@ -362,6 +369,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!', }]; ts.value = 'error' + step5.value = 'error' } break; case 'INIT_GATHER$02': @@ -384,6 +392,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step3.value = 'error' // ts.value = 'error' + // step5.value = 'error' } else if (newValue.code == 10551) { step3InitLog.value.push({ type: 'error', @@ -391,6 +400,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step3.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 10552) { step3.value = 'error' //ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") @@ -399,6 +409,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!', }]; ts.value = 'error' + step5.value = 'error' } break; case 'INIT_GATHER$03': @@ -417,6 +428,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step3.value = 'error' // ts.value = 'error' + // step5.value = 'error' } else if (newValue.code == 10551) { step3InitLog.value.push({ type: 'error', @@ -424,6 +436,7 @@ watch(webMsgSend, function (newValue, oldValue) { }) step3.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 10552) { //ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!") step3.value = 'error' @@ -432,6 +445,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!', }]; ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 25001) { activeIndex.value = 3 step3.value = 'success' @@ -460,6 +474,7 @@ watch(webMsgSend, function (newValue, oldValue) { ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") step4.value = 'error' ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 10520) { step4.value = 'error' step4InitLog.value.push({ @@ -467,6 +482,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '解析报文异常', }) ts.value = 'error' + step5.value = 'error' } break; @@ -496,6 +512,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '相序校验未通过!', }) ts.value = 'error' + step5.value = 'error' } else if (newValue.code == 25001) { step4.value = 'success' step5.value = 'success' @@ -522,6 +539,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '源服务端连接失败!', }]; ts.value = 'error' + step5.value = 'error' break; case "Dev": step2.value = 'error' @@ -530,6 +548,7 @@ watch(webMsgSend, function (newValue, oldValue) { log: '设备服务端连接失败!', }]; ts.value = 'error' + step5.value = 'error' break; } break; @@ -542,6 +561,7 @@ watch(webMsgSend, function (newValue, oldValue) { type: 'error', }) ts.value = 'error' + step5.value = 'error' break; } diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 2fa37d7..c891f7c 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -958,11 +958,14 @@ const handleTest = async (val: string) => { selectTestItemPopupRef.value?.open() }) .catch((action: Action) => { - ElMessage.success('全部复检') - checkStore.setReCheckType(1) - selectTestItemPopupRef.value?.open() + if(action === 'cancel'){ + ElMessage.success('全部复检') + checkStore.setReCheckType(1) + selectTestItemPopupRef.value?.open() + } }) } else { + checkStore.setReCheckType(1) selectTestItemPopupRef.value?.open() } } else if (val === '系数校准') { diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index fafe423..d9cf8ed 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -299,7 +299,7 @@ watch(TestStatus, function (newValue, oldValue) { watch(ActiveStatue, function (newValue, oldValue) { if (newValue === 'error') { - // stepsActiveIndex.value = stepsTotalNum.value + 2 + stepsActiveIndex.value = stepsTotalNum.value + 1 nextStepText.value = '检测失败' } if (newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 1) { diff --git a/frontend/src/views/machine/device/components/devicePopup.vue b/frontend/src/views/machine/device/components/devicePopup.vue index 50b2cda..a2fa33c 100644 --- a/frontend/src/views/machine/device/components/devicePopup.vue +++ b/frontend/src/views/machine/device/components/devicePopup.vue @@ -157,7 +157,9 @@ import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue' // 使用 dayjs 库格式化 import dayjs from 'dayjs' import MonitorTable from '@/views/machine/device/components/monitorTab.vue'; +import {useAppSceneStore} from "@/stores/modules/mode"; +const AppSceneStore = useAppSceneStore() const MonIsShow = ref(false) const DevIsShow = ref(false) // 存储设备类型选项 @@ -322,7 +324,10 @@ const rules = computed(() => { } if (valid) { formContent.value.createDate = dayjs(formContent.value.createDate).format('YYYY-MM-DD'); - formContent.value.name = formContent.value.createId + if (AppSceneStore.currentScene === '1') { + formContent.value.name = formContent.value.createId + } + if (formContent.value.arrivedDate) { formContent.value.arrivedDate = dayjs(formContent.value.arrivedDate).format('YYYY-MM-DD'); diff --git a/frontend/src/views/machine/testSource/components/parameterPopup.vue b/frontend/src/views/machine/testSource/components/parameterPopup.vue index 2b15c38..44bc5bb 100644 --- a/frontend/src/views/machine/testSource/components/parameterPopup.vue +++ b/frontend/src/views/machine/testSource/components/parameterPopup.vue @@ -93,8 +93,8 @@ function useMetaInfo() { } const rules: reactive>> = reactive({ - desc: [{required: true, message: '源参数描述必填!', trigger: 'blur'}], - type: [{required: true, message: '源参数类型必填!', trigger: 'blur'}], + desc: [{required: true, message: '源参数描述必填!', trigger: 'blur'},{min: 1, max: 32, message: '长度为1~32个字符', trigger: 'blur'}], + type: [{required: true, message: '源参数类型必填!', trigger: 'blur'},{min: 1, max: 32, message: '长度为1~32个字符', trigger: 'blur'}], sort: [{required: true, message: '排序必填!', trigger: 'blur'}] }) diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index d7e9d58..fb27dfc 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -9,7 +9,7 @@ - + - + - + - + ([]); const getTableList = async(params: any) => { let newParams = JSON.parse(JSON.stringify(params)) const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id - newParams.pattern = patternId + newParams.patternId = patternId try { const result = await getPlanList(newParams); @@ -356,7 +356,7 @@ const exportClick = () => { ElMessageBox.confirm('确认导出检测计划?', '温馨提示', { type: 'warning' }).then(() =>{ const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id - useDownload(exportPlan,'检测计划导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx') + useDownload(exportPlan,'检测计划导出数据', {...proTable.value?.searchParam,patternId:patternId}, false,'.xlsx') }) } diff --git a/frontend/src/views/system/base/index.vue b/frontend/src/views/system/base/index.vue index bfaa5b6..75494ee 100644 --- a/frontend/src/views/system/base/index.vue +++ b/frontend/src/views/system/base/index.vue @@ -1,317 +1,323 @@ - - - \ No newline at end of file + return baseRules; +}) + + +const submitForm = async () => { + try { + testConfigFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + await updateTestConfig(TestConfigForm.value); + + dialogFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + //await updateTestConfig(TestConfigForm.value); + + // 提取并传递 4 个参数 + const {id, waveRecord, realTime, statistics, flicker} = RegResForm.value + RegResForm2.value = {id, waveRecord, realTime, statistics, flicker} + + if (RegResForm.value.waveRecord == null) { + RegResForm2.value.waveRecord = -1 + } + await updateRegRes(RegResForm2.value); + + ElMessage.success({message: `保存配置成功!`}) + } + }) + } + }) + + + } catch (err) { + console.error('验证过程中出现错误', err) + } +} + + + \ No newline at end of file diff --git a/frontend/src/views/system/template/components/reportPopup.vue b/frontend/src/views/system/template/components/reportPopup.vue index ae5376f..950d138 100644 --- a/frontend/src/views/system/template/components/reportPopup.vue +++ b/frontend/src/views/system/template/components/reportPopup.vue @@ -17,6 +17,7 @@ :on-exceed="BaseHandleExceed" :on-remove="BaseHandleRemove" style="width: 100% !important;" + accept=".docx" class="upload-container" > 选择文件 @@ -33,6 +34,7 @@ :on-exceed="DataHandleExceed" :on-remove="DataHandleRemove" style="width: 100% !important;" + accept=".docx" class="upload-container" > 选择文件 @@ -254,7 +256,7 @@ const BaseHandleChange = async(param : UploadFile) => { baseFileName.value = param.name; baseFileUrl.value = URL.createObjectURL(param.raw as Blob); excelFormData.append('baseFile', param.raw as Blob, param.name); - + formContent.value.baseFile = param.name; };