From 92df9274537cc147b65ee1989731efdcd1612588 Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Thu, 5 Dec 2024 11:07:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/styles/element.scss | 20 +- .../views/home/components/channelsTest.vue | 8 +- .../src/views/home/components/preTest.vue | 289 +++++++++--------- .../src/views/home/components/timeTest.vue | 5 +- frontend/src/views/home/tabs/dashboard.vue | 14 +- 5 files changed, 185 insertions(+), 151 deletions(-) diff --git a/frontend/src/styles/element.scss b/frontend/src/styles/element.scss index 1435e59..71a9d53 100644 --- a/frontend/src/styles/element.scss +++ b/frontend/src/styles/element.scss @@ -489,4 +489,22 @@ font-size: 12px !important; // color: var(--ba-bg-color-overlay) !important; } -} \ No newline at end of file +} +.el-message-box{ + padding: 0px !important; + .el-message-box__header{ + background-color: var(--el-color-primary); + .el-message-box__title{ + color: #fff; + padding: 10px 10px 0; + } + + } + .el-message-box__content{ + padding: 10px ; + border-bottom: 1px solid #cccccc; + } + .el-message-box__btns { + + padding: 10px;} + } \ No newline at end of file diff --git a/frontend/src/views/home/components/channelsTest.vue b/frontend/src/views/home/components/channelsTest.vue index c7f2ba0..6e6da25 100644 --- a/frontend/src/views/home/components/channelsTest.vue +++ b/frontend/src/views/home/components/channelsTest.vue @@ -346,7 +346,7 @@ emit('update:testStatus',ts.value) margin-bottom: 10px; } .right-content{ - max-height: 400px; + /* max-height: 400px; */ } .custom-tabs-label .el-icon { @@ -356,4 +356,10 @@ emit('update:testStatus',ts.value) vertical-align: middle; margin-left: 4px; } +.dialog-content{ + height: 472px; +} +.el-tabs--border-card { + height: 435px; +} diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index 88a1f9d..366fdf5 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -1,131 +1,130 @@ - diff --git a/frontend/src/views/home/components/timeTest.vue b/frontend/src/views/home/components/timeTest.vue index 709ce3e..1cc2daa 100644 --- a/frontend/src/views/home/components/timeTest.vue +++ b/frontend/src/views/home/components/timeTest.vue @@ -224,8 +224,9 @@ watch(ts, function (newValue, oldValue) { display: flex; flex-direction: row; /* 横向排列 */ - margin-top: 20px; - min-height: 300px; + /* margin-top: 20px; */ + /* min-height: 300px; */ + height: 472px; /* .dialog-left{ margin-right: 20px; } */ diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index 5ea7397..470f4bd 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -353,9 +353,9 @@ const resizeObserver = new ResizeObserver(entries => { chartsWidth.value = entry.contentRect.width; console.log('Charts Info Width:', chartsWidth.value); - pieRef1.value.reSize(chartsWidth.value * 0.95,145,true); - pieRef2.value.reSize(chartsWidth.value * 0.95,145,true); - pieRef3.value.reSize(chartsWidth.value * 0.95,145,true); + pieRef1.value.reSize(chartsWidth.value * 0.95,180,true); + pieRef2.value.reSize(chartsWidth.value * 0.95,180,true); + pieRef3.value.reSize(chartsWidth.value * 0.95,180,true); } }); @@ -631,4 +631,12 @@ onUnmounted(() => { } } } +:deep(.el-collapse-item__conten){ + // background-color:#f6f6f6; + padding-bottom: 0px !important; +} +:deep(.el-collapse-item__content ){ + // background-color:#f6f6f6; + padding-bottom: 0px !important; +} From 63a1e9ec56d9d7dde28d1aba7374782759b519ed Mon Sep 17 00:00:00 2001 From: GYYM <704080176@qq.com> Date: Thu, 5 Dec 2024 11:21:10 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/system/dictionary/dictData.ts | 4 +-- frontend/src/views/home/components/table.vue | 25 ++++++++----------- .../src/views/home/components/timeTest.vue | 15 +++++++---- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/frontend/src/api/system/dictionary/dictData.ts b/frontend/src/api/system/dictionary/dictData.ts index 18ac6c1..b971a51 100644 --- a/frontend/src/api/system/dictionary/dictData.ts +++ b/frontend/src/api/system/dictionary/dictData.ts @@ -216,7 +216,7 @@ const dictData: Dict[] = [ children: [ { id: "0", - label: 'FLUKE6100A电能功率标准源', + label: 'FLUKE.6100A电能功率标准源', code: 0, }, { @@ -236,7 +236,7 @@ const dictData: Dict[] = [ }, { id: "4", - label: 'PQV-520电能质量检测装置', + label: 'PQV-520便携式电能质量监测装置', code: 4, }, ], diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 53ccd42..0f9f915 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -631,6 +631,7 @@ let testType = "test";//检测还是复检 const handleSelectionChange = (selection: any[]) => { devNum = selection.length; + devChannelsNum = 0; for (let i = 0; i < selection.length; i++) { devChannelsNum += selection[i].dev_Chns; } @@ -923,19 +924,15 @@ const handleTest = (val:string) => { }, ) .then(() => { - ElMessage.success(val); - dialogTitle.value = val; - dialogFormVisible.value = true; // 打开对话框 + ElMessage.success('不合格项复检'); + dialogTitle.value = val; + dialogFormVisible.value = true; // 打开对话框 + }) + .catch((action: Action) => { + ElMessage.success('全部复检'); + dialogTitle.value = val; + dialogFormVisible.value = true; // 打开对话框 }) - // .catch((action: Action) => { - // ElMessage({ - // type: 'info', - // message: - // action === 'cancel' - // ? '以当前数据为主完成数据覆盖' - // : '取消本次导入操作', - // }) - // }) } else { @@ -966,7 +963,7 @@ const handleTest = (val:string) => { return } - if(val==='归档') + if(val==='批量归档') { const loading = ElLoading.service({ lock: true, @@ -975,7 +972,7 @@ const handleTest = (val:string) => { }) setTimeout(() => { loading.close() - ElMessage.success("批量归档成功"); + ElMessage.success("归档成功"); }, 2000) } }; diff --git a/frontend/src/views/home/components/timeTest.vue b/frontend/src/views/home/components/timeTest.vue index 709ce3e..4f8c1a3 100644 --- a/frontend/src/views/home/components/timeTest.vue +++ b/frontend/src/views/home/components/timeTest.vue @@ -3,11 +3,11 @@
- - - - - + + + + +
@@ -77,25 +87,25 @@ const activities = ref([ const deviceOperatorData = ref([ { - deviceName: '被检设备1', + deviceName: '240001', updataTime: '—', ErrorValue:'—', Result: '—', }, { - deviceName: '被检设备2', + deviceName: '240002', updataTime: '—', ErrorValue:'—', Result: '—', }, { - deviceName: '被检设备3', + deviceName: '240003', updataTime: '—', ErrorValue:'—', Result: '—', }, { - deviceName: '被检设备4', + deviceName: '240004', updataTime: '—', ErrorValue:'—', Result: '—', @@ -104,26 +114,26 @@ const deviceOperatorData = ref([ const deviceData = ref([ { - deviceName: '被检设备1', - updataTime: '10:30:08.136', + deviceName: '240001', + updataTime: '2024-12-05 10:30:08.136', ErrorValue:'148', Result: '合格', }, { - deviceName: '被检设备2', - updataTime: '10:30:08.136', + deviceName: '240002', + updataTime: '2024-12-05 10:30:08.136', ErrorValue:'136', Result: '合格', }, { - deviceName: '被检设备3', - updataTime: '10:30:09.006', + deviceName: '240003', + updataTime: '2024-12-05 10:30:09.006', ErrorValue:'1006', Result: '不合格', }, { - deviceName: '被检设备4', - updataTime: '10:30:08.736', + deviceName: '240004', + updataTime: '2024-12-05 10:30:08.736', ErrorValue:'736', Result: '合格', }, @@ -138,6 +148,44 @@ const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process }) const testStatus = toRef(props, 'testStatus'); const ts = ref(''); + +// 表格配置项 +const columns = reactive([ + { type: 'index', fixed: 'left', width: 70, label: '序号' }, + { + prop: 'deviceName', + label: '设备名称', + }, + { + prop: 'updataTime', + label: '上送时刻', + width: 230, + }, + { + prop: 'ErrorValue', + label: '守时误差', + width: 100, + }, + { + prop: 'Result', + label: '检测结果', + width: 100, + render: (scope) => { + if(scope.row.Result === '不合格') + { + return ( + { scope.row.Result } + ) + } + else + { + return ( + { scope.row.Result } + ) + } + }, + }, +]) //监听testStatus的变化 watch(testStatus, function (newValue, oldValue) { ts.value = props.testStatus; @@ -161,58 +209,77 @@ watch(testStatus, function (newValue, oldValue) { }, 1000); } }) + +function formatDateTime(date) { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + const milliseconds = String(date.getMilliseconds()).padStart(3, '0'); + + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`; +} + watch(activeIndex, function (newValue, oldValue) { if(activeIndex.value === 1) { - activities.value.length = 0; - activities.value.push({ - content: '开始检测', - timestamp: '2018-04-12 20:46', - size: 'large', - color: '#0bbd87', - icon: SuccessFilled, - }); + startTime.value = formatDateTime(new Date()); + + // activities.value.length = 0; + // activities.value.push({ + // content: '开始检测', + // timestamp: '2018-04-12 20:46', + // size: 'large', + // color: '#0bbd87', + // icon: SuccessFilled, + // }); } if(activeIndex.value === 2) { - activities.value.push({ - content: 'GPS上送时刻', - timestamp: '2018-04-03 20:46', - color: '#0bbd87', - icon: SuccessFilled, - size: 'large', - }); + gpsTime.value = formatDateTime(new Date()); + // activities.value.push({ + // content: 'GPS上送时刻', + // timestamp: '2018-04-03 20:46', + // color: '#0bbd87', + // icon: SuccessFilled, + // size: 'large', + // }); } if(activeIndex.value === 3) { - activities.value.push({ - content: '设备最早上送时刻', - timestamp: '2018-04-03 20:46', - color: '#0bbd87', - icon: SuccessFilled, - size: 'large', - }); - + // activities.value.push({ + // content: '设备最早上送时刻', + // timestamp: '2018-04-03 20:46', + // color: '#0bbd87', + // icon: SuccessFilled, + // size: 'large', + // }); + devStartTime.value = formatDateTime(new Date()); deviceOperatorData.value.length = 0; deviceOperatorData.value = deviceData.value; } if(activeIndex.value > 3) { - activities.value.push({ - content: '设备最晚上送时刻', - timestamp: '2018-04-03 20:46', - color: '#0bbd87', - icon: SuccessFilled, - size: 'large', - }); - activities.value.push({ - content: '检测结束', - timestamp: '2018-04-03 20:46', - color: '#0bbd87', - icon: SuccessFilled, - size: 'large', - }); + devEndTime.value = formatDateTime(new Date()); + finishTime.value = formatDateTime(new Date()); + + // activities.value.push({ + // content: '设备最晚上送时刻', + // timestamp: '2018-04-03 20:46', + // color: '#0bbd87', + // icon: SuccessFilled, + // size: 'large', + // }); + // activities.value.push({ + // content: '检测结束', + // timestamp: '2018-04-03 20:46', + // color: '#0bbd87', + // icon: SuccessFilled, + // size: 'large', + // }); } }) const emit = defineEmits(['update:testStatus']);