From 5da07d863183b3e36e048c6c6f47b80f301cb357 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Mon, 16 Dec 2024 15:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/table.vue | 73 ++++++------------- frontend/src/views/home/tabs/dashboard.vue | 8 +- .../components/errorSystemPopup.vue | 7 +- 3 files changed, 32 insertions(+), 56 deletions(-) diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 4c98b9e..4ac6878 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -3,16 +3,14 @@ @@ -285,24 +283,7 @@ const shouldShowOption = (item) => { return !item.disabled; }; - - -const plan_devicedata = [ - { - id: '1', //装置序号ID - name: '240001', //设备名称 - dev_Type: 'PQS-882B4',//设备类型 - dev_Chns: 4, //设备通道数 - check_Result: '未检', //检测结果 - report_State: '未生成', //报告状态 - document_State: '未归档', //归档状态 - check_State:'未检',//检测状态 - reCheck_Num: 0, //复检次数 - }] - -//console.log(window.innerHeight, "+++++++++"); tableHeight.value = window.innerHeight - 600; -//const deviceData = deviceDataList.plan_devicedata const deviceData = ref([]); deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档") const operationShow = ref(false); @@ -344,8 +325,8 @@ let checkStatusList = reactive([ ]); //检测报告状态数据 let checkReportStatusList = reactive([ -{ - label: "未检", + { + label: "已生成", value: 0, disabled: false, }, @@ -354,26 +335,21 @@ let checkReportStatusList = reactive([ value: 1, disabled: false, }, - { - label: "已生成", - value: 2, - disabled: false, - }, ]); //检测结果数组 let checkResultList = reactive([ { - label: "未检", + label: "不符合", value: 0, disabled: false, }, { - label: "不符合", + label: "符合", value: 1, disabled: false, }, { - label: "符合", + label: "未检", value: 2, disabled: false, }, @@ -415,24 +391,11 @@ const dataCallback = (data: any) => { total: data.length || data.total, //total }; }; -// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口 -// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList" -// const getTableList = (params: any) => { -// console.log('11111111111111111',props.id); -// let newParams = JSON.parse(JSON.stringify(params)); -// newParams.createTime && (newParams.startTime = newParams.createTime[0]); -// newParams.createTime && (newParams.endTime = newParams.createTime[1]); -// delete newParams.createTime; -// return getPlanList(newParams); -// }; + const boundPqDevList=ref([])//根据检测计划id查询出所有已绑定的设备 const getTableList = async (params: any) => { - - deviceData.value = plan_devicedata.filter((item) => item.document_State === "未归档") - - const pqDevList_Result2 = await getBoundPqDevList({'planId': props.id, 'checkStateList':[0,1,2]}); boundPqDevList.value = pqDevList_Result2.data as Device.ReqPqDevParams[]; console.log('qwe',boundPqDevList.value) @@ -482,6 +445,11 @@ const columns = reactive[]>([ minWidth: 100, sortable:true, isShow:checkStateShow, + render: scope => { + return ( + scope.row.checkState === 0 ? '未检' : scope.row.checkState === 1 ? '检测中' : '检测完成' + ) + }, }, { prop: 'checkResult', @@ -489,14 +457,12 @@ const columns = reactive[]>([ minWidth: 100, sortable:true, render: (scope) => { - if (scope.row.checkResult === 2) + if (scope.row.checkResult === 0) { - return ({ scope.row.checkResult }) - } - else - { - return ({ scope.row.checkResult }) - } + return 不符合 + }else{ + return scope.row.checkState === 1 ? '符合' : '未检' + } }, }, { @@ -504,6 +470,11 @@ const columns = reactive[]>([ label: '报告状态', minWidth: 100, sortable:true, + render: scope => { + return ( + scope.row.checkState === 0 ? '已生成' : '未生成' + ) + }, }, { prop: 'documentState', diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index 33d7749..e0df5ac 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -42,7 +42,7 @@ :legendData="{ icon: 'circle', left: 'left', - top: 'middle', + top: 'bottom', }" :chartsData="chartsData1" ref="pieRef1" @@ -57,7 +57,7 @@ :legendData="{ icon: 'circle', left: 'left', - top: 'middle', + top: 'bottom', }" :chartsData="chartsData2" ref="pieRef2" @@ -77,7 +77,7 @@ :legendData="{ icon: 'circle', left: 'left', - top: 'middle', + top: 'bottom', }" :chartsData="chartsData3" ref="pieRef3" @@ -346,7 +346,7 @@ const planDetail = () => { }; //功能选择css切换 const handleCheckFunction = (val: any) => { - +console.log('点击了css切换'); editableTabsValue.value = '0'; form.value.activeChildTabs = 0; tabsList.value.map((item: any, index: any) => { diff --git a/frontend/src/views/machine/errorSystem/components/errorSystemPopup.vue b/frontend/src/views/machine/errorSystem/components/errorSystemPopup.vue index 8485de1..910d23d 100644 --- a/frontend/src/views/machine/errorSystem/components/errorSystemPopup.vue +++ b/frontend/src/views/machine/errorSystem/components/errorSystemPopup.vue @@ -125,7 +125,12 @@ try { dialogFormRef.value?.validate(async (valid: boolean) => { if (valid) { - + // 确保 standardTime 是 Date 对象 + if (formContent.value.standardTime) { + const date = new Date(formContent.value.standardTime); + formContent.value.standardTime = date.getFullYear().toString(); + } + formContent.value.pqErrSysDtlsList = tableData.value if (formContent.value.id) { await updatePqErrSys(formContent.value);