diff --git a/frontend/src/views/authority/role/components/roleResourcePopup.vue b/frontend/src/views/authority/role/components/roleResourcePopup.vue index b02f31f..46ffa85 100644 --- a/frontend/src/views/authority/role/components/roleResourcePopup.vue +++ b/frontend/src/views/authority/role/components/roleResourcePopup.vue @@ -11,7 +11,8 @@ show-checkbox :default-checked-keys="checkedKeysRef" ref="treeRef" - > + > + @@ -209,4 +210,4 @@ const getAllIds = (functions: Function.ResFunction[]): string[] => { refreshTable: (() => Promise) | undefined; }>() - \ No newline at end of file + diff --git a/frontend/src/views/home/components/channelPairing.vue b/frontend/src/views/home/components/channelPairing.vue index a89731f..1f1394f 100644 --- a/frontend/src/views/home/components/channelPairing.vue +++ b/frontend/src/views/home/components/channelPairing.vue @@ -35,6 +35,7 @@ import { ElMessage, stepProps } from 'element-plus' import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件 import { jwtUtil } from '@/utils/jwtUtil' import { useCheckStore } from '@/stores/modules/check' +import { ipc } from '@/utils/ipcRenderer' const vueFlowElement = ref(442) const checkStore = useCheckStore() const dialogVisible = ref(false) @@ -79,7 +80,8 @@ const onPaneReady = () => { } // 提取公共的label渲染函数 -const createLabel = (text: string, type: string, Key: number) => { +const createLabel = (device:any, Key: number) => { + console.log('-=-=',device) return h( 'div', { @@ -117,7 +119,13 @@ const createLabel = (text: string, type: string, Key: number) => { // filter: 'invert(35%) sepia(65%) saturate(300%) hue-rotate(210deg)' } }), - h('div', { style: { textAlign: 'left' } }, ['设备名称:' + text, h('br'), '设备类型:' + type]) + h('div', { style: { textAlign: 'left' } }, ['设备名称:' + device.name, + h('br'), + '设备类型:' + device.deviceType, + h('br'), + 'Ip地址:' + device.ip, + + ]) // h('div', null, '设备名称:' + text), // h('div', null, '设备类型:' + type) ] @@ -211,10 +219,10 @@ const standardDevIds = ref() const open = async () => { edges.value = [] + devIds.value = prop.devIdList.map(d => d.id) standardDevIds.value = prop.pqStandardDevList.map(d => d.id) planId.value = prop.planIdKey - nodes.value = createNodes(prop.devIdList, prop.pqStandardDevList, prop.deviceMonitor) dialogVisible.value = true onPaneReady() @@ -368,9 +376,12 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP id: d.id, name: d.name, type: 'normal', - deviceType: d.devType + deviceType: d.devType, + ip: d.ip, + monitorResults:d.monitorResults })) + const channelCounts2: Record = {} standardDev.forEach(dev => { const channelList = dev.inspectChannel ? dev.inspectChannel.split(',') : [] @@ -381,7 +392,8 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP id: d.id, name: d.name, type: 'normal', - deviceType: d.devType + deviceType: d.devType, + ip: d.ip })) const newNodes: any[] = [] @@ -413,6 +425,12 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP Object.entries(channelCounts).forEach(([deviceId, count]) => { // 从deviceMonitor中获取实际通道信息 let actualChannels = []; // 存储实际的通道号 + let deviceMonitorResults: number[] = []; // 存储该设备的监控结果 + // 获取该设备的monitorResults + const deviceInfo = inspectionDevices.find(d => d.id === deviceId); + if (deviceInfo && deviceInfo.monitorResults) { + deviceMonitorResults = deviceInfo.monitorResults; + } // 如果deviceMonitor中有该设备的数据,则使用实际监测点信息 if (deviceMonitor.has(deviceId)) { @@ -429,13 +447,24 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP // 遍历实际通道号而不是连续的数字 actualChannels.forEach((channelNum, index) => { const channelId = `被检通道-${deviceId}-${channelNum}`; + const channelResult = deviceMonitorResults[index] + + let statusText = ''; + if (channelResult === 0) { + statusText = '(不符合)'; + } else if (channelResult === 1) { + statusText = '(符合)'; + } else if (channelResult === 2) { + statusText = '(未检)'; + } + newNodes.push({ id: channelId, type: 'input', - data: { label: createLabel3(`被检通道${channelNum}`) }, + data: { label: createLabel3(`被检通道${channelNum}`+ statusText) }, position: { x: inputChannelX, y: yPosition + index * 50 }, sourcePosition: 'right', - style: { width: '120px', border: 'none', boxShadow: 'none' } + style: { width: '160px', border: 'none', boxShadow: 'none' } }); deviceChannelGroups.push({ @@ -508,7 +537,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP const deviceCenterY = deviceCurrentYPosition + (actualChannelCount * 50) / 2 - 50 newNodes.push({ id: device.id, - data: { label: createLabel(device.name, device.deviceType, 1) }, + data: { label: createLabel(device, 1) }, position: { x: deviceWidth, y: deviceCenterY }, class: 'no-handle-node', style: { width: '300px', border: 'none', boxShadow: 'none' } @@ -539,7 +568,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP const deviceCenterY = standardDeviceCurrentYPosition + (channelCount * 50) / 2 - 50 newNodes.push({ id: device.id, - data: { label: createLabel(device.name, device.deviceType, 2) }, + data: { label: createLabel(device, 2) }, position: { x: standardWidth, y: deviceCenterY }, class: 'no-handle-node', style: { width: '300px', border: 'none', boxShadow: 'none' } diff --git a/frontend/src/views/home/components/comparePreTest.vue b/frontend/src/views/home/components/comparePreTest.vue index c684c76..5114f490 100644 --- a/frontend/src/views/home/components/comparePreTest.vue +++ b/frontend/src/views/home/components/comparePreTest.vue @@ -282,6 +282,7 @@ watch(webMsgSend, function (newValue, oldValue) { type: 'error', log: '录波校验时,设备连接异常!', }); + step1.value = 'error' ts.value = 'error' step5.value = 'error' @@ -291,10 +292,12 @@ watch(webMsgSend, function (newValue, oldValue) { type: 'error', log: newValue.data, }) + } else if (newValue.code == 25003) { //最终失败 step1.value = 'error' ts.value = 'error' step5.value = 'error' + } break; case 'yjc_mxyzxjy': diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index 63e49cb..741f735 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -285,7 +285,7 @@ watch(testStatus, function (newValue, oldValue) { startData.value = new Date() timeDifference.value = 0 } else if (newValue == 'error') { - stopTimeCount() + stopTimeCount(0) } }) @@ -300,13 +300,14 @@ watch( break case 25002: setLogList('error', newValue.data) + stopTimeCount(0) break case 25003: - ElMessageBox.alert('录波数据异常!', { + ElMessageBox.alert('录波数据异常!','检测失败',{ confirmButtonText: '确定', type: 'error' }) - stopTimeCount() + stopTimeCount(0) break case 25001: { // 当录波校验完成时,更新录波项目的按钮状态 @@ -345,7 +346,7 @@ watch( } // 触发响应式更新 checkResult.splice(0, 0) - stopTimeCount() + stopTimeCount(1) updatePercentage() break } @@ -355,13 +356,14 @@ watch( switch (newValue.code) { case 25002: setLogList('error', newValue.data) + stopTimeCount(0) break case 25003: - ElMessageBox.alert('闪变收集失败!', { + ElMessageBox.alert('闪变收集失败!','检测失败', { confirmButtonText: '确定', type: 'error' }) - stopTimeCount() + stopTimeCount(0) break case 25001: { // 当录波校验完成时,更新录波项目的按钮状态 @@ -394,7 +396,7 @@ watch( } // 触发响应式更新 checkResult.splice(0, 0) - stopTimeCount() + stopTimeCount(1) updatePercentage() break } @@ -412,18 +414,19 @@ watch( device.chnResult.fill(CheckData.ChnCheckResultEnum.UNKNOWN) }) } - stopTimeCount() + stopTimeCount(0) break } case 'connect': switch (newValue.operateCode) { case 'Contrast_Dev': setLogList('error', '设备服务端连接失败!') - stopTimeCount() + stopTimeCount(0) break } break case 'unknown_operate': + stopTimeCount(0) break case 'error_flow_end': ElMessageBox.alert(`当前流程存在异常结束!`, '检测失败', { @@ -431,7 +434,7 @@ watch( type: 'error' }) setLogList('error', '当前流程存在异常结束!') - stopTimeCount() + stopTimeCount(0) break case 'socket_timeout': ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', { @@ -439,7 +442,7 @@ watch( type: 'error' }) setLogList('error', '设备连接异常,请检查设备连接情况!') - stopTimeCount() + stopTimeCount(0) break case 'server_error': ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', { @@ -447,7 +450,7 @@ watch( type: 'error' }) setLogList('error', '服务端主动关闭连接!') - stopTimeCount() + stopTimeCount(0) break case 'device_error': ElMessageBox.alert('设备主动关闭连接!', '初始化失败', { @@ -455,12 +458,12 @@ watch( type: 'error' }) setLogList('error', '设备主动关闭连接!') - stopTimeCount() + stopTimeCount(0) break case 'yjc_xyjy' : if(newValue.code == 10550){ setLogList('error', '协议校验时,设备连接异常!') - stopTimeCount() + stopTimeCount(0) } if (newValue.code == 10552) { ElMessageBox.alert('重复的初始化操作!', '检测失败', { @@ -468,7 +471,7 @@ watch( type: 'error', }) setLogList('error', '重复的初始化操作!') - stopTimeCount() + stopTimeCount(0) } break; case 'yjc_sbtxjy' : @@ -478,7 +481,7 @@ watch( type: 'error', }) setLogList('error', '重复的初始化操作!') - stopTimeCount() + stopTimeCount(0) } break; } @@ -509,15 +512,12 @@ watch( // 失败 if (newValue.data != undefined) return setLogList('error', str + '失败!') - emit('update:testStatus', 'error') - stopTimeCount() + stopTimeCount(0) if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!') break case 10550: setLogList('error', str +'时,设备连接异常!') - - emit('update:testStatus', 'error') - stopTimeCount() + stopTimeCount(0) break } @@ -621,7 +621,7 @@ watch( if (newValue.code == 25001) { setLogList('info', '检测完成!') - stopTimeCount() + stopTimeCount(1) updatePercentage() } if(newValue.code == 25005){ @@ -634,12 +634,12 @@ watch( } case 25003: setLogList('error', '检测失败!') - stopTimeCount() + stopTimeCount(0) updatePercentage() break case 10550: setLogList('error', '设备连接异常!') - stopTimeCount() + stopTimeCount(0) updatePercentage() break default: @@ -682,7 +682,7 @@ const updatePercentage = async () => { // planCode: checkStore.plan.code + '' // }) } - stopTimeCount() + stopTimeCount(1) ElMessageBox.alert( '检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', @@ -712,10 +712,14 @@ const startTimeCount = () => { } // 停止计时 -const stopTimeCount = () => { +const stopTimeCount = (type: number) => { if (timer) { clearInterval(timer) timer = null + if(type === 0){ + emit('update:testStatus', 'error') + } + } } @@ -977,9 +981,7 @@ defineExpose({ transform: rotate(360deg); } } - - diff --git a/frontend/src/views/home/components/deviceConnectionPopup.vue b/frontend/src/views/home/components/deviceConnectionPopup.vue index 4243a40..e8b9bd3 100644 --- a/frontend/src/views/home/components/deviceConnectionPopup.vue +++ b/frontend/src/views/home/components/deviceConnectionPopup.vue @@ -226,6 +226,7 @@ const open = async ( planIsOnlyWave.value = isOnlyWave CompareTestVisible.value = false devIdList.value = device + devIdList.value = device pqStandardDevList.value = standardDev planIdKey.value = fatherPlanId deviceMonitor.value = DeviceMonitoringMap diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 34d3b20..c43e338 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -845,7 +845,7 @@ const handleTest2 = async (val: string) => { // 检查数组长度是否为1且唯一元素是'wave_data' const isOnlyWave = targetPlan.datasourceIds.length === 1 && targetPlan.datasourceIds[0] === 'wave_data' - + deviceConnectionPopupRef.value?.open( filteredChannelsSelection, pqStandardDevList.value, diff --git a/frontend/src/views/home/components/tree.vue b/frontend/src/views/home/components/tree.vue index da1fe5c..64cc7d1 100644 --- a/frontend/src/views/home/components/tree.vue +++ b/frontend/src/views/home/components/tree.vue @@ -29,7 +29,7 @@ @node-click="handleNodeClick" >