diff --git a/package.json b/package.json index 17e0ea6..fe073c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gy-calibration", - "version": "1.0.9", + "version": "1.0.10", "description": "谷云开发部开发的断路器标定软件", "main": "./out/main/index.js", "author": "example.com", diff --git a/resources/service/data.db b/resources/service/data.db index 43b8283..d821840 100644 Binary files a/resources/service/data.db and b/resources/service/data.db differ diff --git a/src/renderer/src/assets/iconfont/iconfont.css b/src/renderer/src/assets/iconfont/iconfont.css index 5a75e74..f432182 100644 --- a/src/renderer/src/assets/iconfont/iconfont.css +++ b/src/renderer/src/assets/iconfont/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4622943 */ - src: url('iconfont.woff2?t=1752478848997') format('woff2'), - url('iconfont.woff?t=1752478848997') format('woff'), - url('iconfont.ttf?t=1752478848997') format('truetype'); + src: url('iconfont.woff2?t=1753694081375') format('woff2'), + url('iconfont.woff?t=1753694081375') format('woff'), + url('iconfont.ttf?t=1753694081375') format('truetype'); } .iconfont { @@ -13,6 +13,14 @@ -moz-osx-font-smoothing: grayscale; } +.icon-zhakai:before { + content: "\e797"; +} + +.icon-zhahe:before { + content: "\e798"; +} + .icon-kuaijiejian:before { content: "\e603"; } diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf deleted file mode 100644 index 0f03c50..0000000 Binary files a/src/renderer/src/assets/iconfont/iconfont.ttf and /dev/null differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff b/src/renderer/src/assets/iconfont/iconfont.woff index ee8d680..beaeffd 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff and b/src/renderer/src/assets/iconfont/iconfont.woff differ diff --git a/src/renderer/src/assets/iconfont/iconfont.woff2 b/src/renderer/src/assets/iconfont/iconfont.woff2 index 152ba20..5c2b970 100644 Binary files a/src/renderer/src/assets/iconfont/iconfont.woff2 and b/src/renderer/src/assets/iconfont/iconfont.woff2 differ diff --git a/src/renderer/src/views/calibration/index.vue b/src/renderer/src/views/calibration/index.vue index ad35691..dd42a7b 100644 --- a/src/renderer/src/views/calibration/index.vue +++ b/src/renderer/src/views/calibration/index.vue @@ -8,7 +8,10 @@ 开始执行 停止 操作员编号: - + +
+ 生产总数/合格数/不合格次数: {{ equipmentStatistics.totalDevice }}/{{ equipmentStatistics.successDevice }}/{{ equipmentStatistics.failCount }} +
刷新列表 @@ -65,15 +68,14 @@ v-if="device.connectStatus === 1" :class="[ 'iconfont', - 'icon-icon_duanluqi2', 'circuit-breaker', - device.switch === 0 ? 'upsideDown' : '', + device.switch === 0 ? 'icon-zhahe' : 'icon-zhakai', device.result === 1 ? 'color-green' : device.result === -1 ? 'color-red' : device.result === 2 ? 'color-orange' : '' ]" >

芯片ID: @@ -552,6 +554,12 @@ const schemeDetailVisible = ref(false); const schemeList = ref([]); const activeScheme = ref(); +const equipmentStatistics = ref({ + totalDevice: 0, + successDevice: 0, + failCount: 0 +}); + const accuracyType = ref({ voltage: '电压', current: '电流', @@ -837,6 +845,7 @@ const getSocketMeassage = message => { if (msg.msgType === 'calibrate_finish') { playState.value = false; ElMessage.success('标定完成'); + getQquipmentStatistics(); } // 批量更新日志数组 @@ -886,24 +895,6 @@ const socketStatus = computed(() => { return webSocketStore.socket_open; }); -onMounted(() => { - logBoxRef.value = document.querySelector('#log-box-main'); - initSocket(); - if (window.electron && typeof window.electron.getAppVersion === 'function') { - window.electron.getAppVersion().then(v => { - version.value = v; - }); - } - - // generateMockDevices(); - getSchemeDefaultConf(); - getSchemeDefaultProp(); - generateDeviceList(); - loadSchemes(); - - // 添加键盘快捷键监听 - document.addEventListener('keydown', handleKeydown); -}); // 键盘快捷键处理 const handleKeydown = event => { @@ -935,13 +926,6 @@ const handleKeydown = event => { } }; -onUnmounted(() => { - if (webSocketStore) { - webSocketStore.close(); - } - // 移除键盘快捷键监听 - document.removeEventListener('keydown', handleKeydown); -}); const toggleIsScroll = () => { isScroll.value = !isScroll.value; @@ -949,11 +933,11 @@ const toggleIsScroll = () => { const startExecution = () => { if (selectedScheme.value === '') { - ElMessage.error('请先选择方案'); + ElMessage.error({message:'请先选择方案'}); return; } if (operatorCode.value.trim() === '') { - ElMessage.error('请先输入操作员编号'); + ElMessage.error({message:'请先输入操作员编号',duration:1000,showClose: true}); return; } // 开始标定之前重新连接socket @@ -963,6 +947,7 @@ const startExecution = () => { ElMessage.success('开始执行方案: ' + scheme[0].schemeName); playState.value = true; playCalibration(); + getQquipmentStatistics(); // Add actual start logic here }; @@ -1067,7 +1052,7 @@ const loadSchemes = async () => { selectedScheme.value = ''; activeScheme.value = {}; } - ElMessage.success('获取方案列表成功'); + ElMessage.success({message: '获取方案列表成功', duration: 1000}); } else { ElMessage.error(response.data.message || '获取方案列表失败'); } @@ -1545,6 +1530,19 @@ const handleExportProd = async () => { showExportProdDialog.value = false; }; +const getQquipmentStatistics = () => { + axios.get(config.url + '/master/calibrate/stat').then(response => { + if(response.data.code === 0 && response.data.data.state){ + equipmentStatistics.value = response.data.data.state; + }else{ + ElMessage.error(response.data.message); + } + }).catch(error => { + ElMessage.error(error); + }); + +}; + // 监听日志变化滚到到底部 watch( logs, @@ -1559,6 +1557,35 @@ watch( deep: true } ); + + +onMounted(() => { + logBoxRef.value = document.querySelector('#log-box-main'); + initSocket(); + if (window.electron && typeof window.electron.getAppVersion === 'function') { + window.electron.getAppVersion().then(v => { + version.value = v; + }); + } + + // generateMockDevices(); + getSchemeDefaultConf(); + getSchemeDefaultProp(); + generateDeviceList(); + loadSchemes(); + getQquipmentStatistics(); + + // 添加键盘快捷键监听 + document.addEventListener('keydown', handleKeydown); +}); + +onUnmounted(() => { + if (webSocketStore) { + webSocketStore.close(); + } + // 移除键盘快捷键监听 + document.removeEventListener('keydown', handleKeydown); +});