This commit is contained in:
sjl
2025-10-21 10:43:27 +08:00
parent f1b76376c6
commit b2db5622bc
8 changed files with 96 additions and 47 deletions

View File

@@ -11,7 +11,8 @@
show-checkbox show-checkbox
:default-checked-keys="checkedKeysRef" :default-checked-keys="checkedKeysRef"
ref="treeRef" ref="treeRef"
> >
</el-tree> </el-tree>
</el-form> </el-form>
@@ -209,4 +210,4 @@ const getAllIds = (functions: Function.ResFunction[]): string[] => {
refreshTable: (() => Promise<void>) | undefined; refreshTable: (() => Promise<void>) | undefined;
}>() }>()
</script> </script>

View File

@@ -35,6 +35,7 @@ import { ElMessage, stepProps } from 'element-plus'
import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件 import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件
import { jwtUtil } from '@/utils/jwtUtil' import { jwtUtil } from '@/utils/jwtUtil'
import { useCheckStore } from '@/stores/modules/check' import { useCheckStore } from '@/stores/modules/check'
import { ipc } from '@/utils/ipcRenderer'
const vueFlowElement = ref(442) const vueFlowElement = ref(442)
const checkStore = useCheckStore() const checkStore = useCheckStore()
const dialogVisible = ref(false) const dialogVisible = ref(false)
@@ -79,7 +80,8 @@ const onPaneReady = () => {
} }
// 提取公共的label渲染函数 // 提取公共的label渲染函数
const createLabel = (text: string, type: string, Key: number) => { const createLabel = (device:any, Key: number) => {
console.log('-=-=',device)
return h( return h(
'div', 'div',
{ {
@@ -117,7 +119,13 @@ const createLabel = (text: string, type: string, Key: number) => {
// filter: 'invert(35%) sepia(65%) saturate(300%) hue-rotate(210deg)' // 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, '设备名称:' + text),
// h('div', null, '设备类型:' + type) // h('div', null, '设备类型:' + type)
] ]
@@ -211,10 +219,10 @@ const standardDevIds = ref<string[]>()
const open = async () => { const open = async () => {
edges.value = [] edges.value = []
devIds.value = prop.devIdList.map(d => d.id) devIds.value = prop.devIdList.map(d => d.id)
standardDevIds.value = prop.pqStandardDevList.map(d => d.id) standardDevIds.value = prop.pqStandardDevList.map(d => d.id)
planId.value = prop.planIdKey planId.value = prop.planIdKey
nodes.value = createNodes(prop.devIdList, prop.pqStandardDevList, prop.deviceMonitor) nodes.value = createNodes(prop.devIdList, prop.pqStandardDevList, prop.deviceMonitor)
dialogVisible.value = true dialogVisible.value = true
onPaneReady() onPaneReady()
@@ -368,9 +376,12 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
id: d.id, id: d.id,
name: d.name, name: d.name,
type: 'normal', type: 'normal',
deviceType: d.devType deviceType: d.devType,
ip: d.ip,
monitorResults:d.monitorResults
})) }))
const channelCounts2: Record<string, number> = {} const channelCounts2: Record<string, number> = {}
standardDev.forEach(dev => { standardDev.forEach(dev => {
const channelList = dev.inspectChannel ? dev.inspectChannel.split(',') : [] const channelList = dev.inspectChannel ? dev.inspectChannel.split(',') : []
@@ -381,7 +392,8 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
id: d.id, id: d.id,
name: d.name, name: d.name,
type: 'normal', type: 'normal',
deviceType: d.devType deviceType: d.devType,
ip: d.ip
})) }))
const newNodes: any[] = [] const newNodes: any[] = []
@@ -413,6 +425,12 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
Object.entries(channelCounts).forEach(([deviceId, count]) => { Object.entries(channelCounts).forEach(([deviceId, count]) => {
// 从deviceMonitor中获取实际通道信息 // 从deviceMonitor中获取实际通道信息
let actualChannels = []; // 存储实际的通道号 let actualChannels = []; // 存储实际的通道号
let deviceMonitorResults: number[] = []; // 存储该设备的监控结果
// 获取该设备的monitorResults
const deviceInfo = inspectionDevices.find(d => d.id === deviceId);
if (deviceInfo && deviceInfo.monitorResults) {
deviceMonitorResults = deviceInfo.monitorResults;
}
// 如果deviceMonitor中有该设备的数据则使用实际监测点信息 // 如果deviceMonitor中有该设备的数据则使用实际监测点信息
if (deviceMonitor.has(deviceId)) { if (deviceMonitor.has(deviceId)) {
@@ -429,13 +447,24 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
// 遍历实际通道号而不是连续的数字 // 遍历实际通道号而不是连续的数字
actualChannels.forEach((channelNum, index) => { actualChannels.forEach((channelNum, index) => {
const channelId = `被检通道-${deviceId}-${channelNum}`; 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({ newNodes.push({
id: channelId, id: channelId,
type: 'input', type: 'input',
data: { label: createLabel3(`被检通道${channelNum}`) }, data: { label: createLabel3(`被检通道${channelNum}`+ statusText) },
position: { x: inputChannelX, y: yPosition + index * 50 }, position: { x: inputChannelX, y: yPosition + index * 50 },
sourcePosition: 'right', sourcePosition: 'right',
style: { width: '120px', border: 'none', boxShadow: 'none' } style: { width: '160px', border: 'none', boxShadow: 'none' }
}); });
deviceChannelGroups.push({ deviceChannelGroups.push({
@@ -508,7 +537,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
const deviceCenterY = deviceCurrentYPosition + (actualChannelCount * 50) / 2 - 50 const deviceCenterY = deviceCurrentYPosition + (actualChannelCount * 50) / 2 - 50
newNodes.push({ newNodes.push({
id: device.id, id: device.id,
data: { label: createLabel(device.name, device.deviceType, 1) }, data: { label: createLabel(device, 1) },
position: { x: deviceWidth, y: deviceCenterY }, position: { x: deviceWidth, y: deviceCenterY },
class: 'no-handle-node', class: 'no-handle-node',
style: { width: '300px', border: 'none', boxShadow: 'none' } 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 const deviceCenterY = standardDeviceCurrentYPosition + (channelCount * 50) / 2 - 50
newNodes.push({ newNodes.push({
id: device.id, id: device.id,
data: { label: createLabel(device.name, device.deviceType, 2) }, data: { label: createLabel(device, 2) },
position: { x: standardWidth, y: deviceCenterY }, position: { x: standardWidth, y: deviceCenterY },
class: 'no-handle-node', class: 'no-handle-node',
style: { width: '300px', border: 'none', boxShadow: 'none' } style: { width: '300px', border: 'none', boxShadow: 'none' }

View File

@@ -282,6 +282,7 @@ watch(webMsgSend, function (newValue, oldValue) {
type: 'error', type: 'error',
log: '录波校验时,设备连接异常!', log: '录波校验时,设备连接异常!',
}); });
step1.value = 'error' step1.value = 'error'
ts.value = 'error' ts.value = 'error'
step5.value = 'error' step5.value = 'error'
@@ -291,10 +292,12 @@ watch(webMsgSend, function (newValue, oldValue) {
type: 'error', type: 'error',
log: newValue.data, log: newValue.data,
}) })
} else if (newValue.code == 25003) { //最终失败 } else if (newValue.code == 25003) { //最终失败
step1.value = 'error' step1.value = 'error'
ts.value = 'error' ts.value = 'error'
step5.value = 'error' step5.value = 'error'
} }
break; break;
case 'yjc_mxyzxjy': case 'yjc_mxyzxjy':

View File

@@ -285,7 +285,7 @@ watch(testStatus, function (newValue, oldValue) {
startData.value = new Date() startData.value = new Date()
timeDifference.value = 0 timeDifference.value = 0
} else if (newValue == 'error') { } else if (newValue == 'error') {
stopTimeCount() stopTimeCount(0)
} }
}) })
@@ -300,13 +300,14 @@ watch(
break break
case 25002: case 25002:
setLogList('error', newValue.data) setLogList('error', newValue.data)
stopTimeCount(0)
break break
case 25003: case 25003:
ElMessageBox.alert('录波数据异常!', { ElMessageBox.alert('录波数据异常!','检测失败',{
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'error' type: 'error'
}) })
stopTimeCount() stopTimeCount(0)
break break
case 25001: { case 25001: {
// 当录波校验完成时,更新录波项目的按钮状态 // 当录波校验完成时,更新录波项目的按钮状态
@@ -345,7 +346,7 @@ watch(
} }
// 触发响应式更新 // 触发响应式更新
checkResult.splice(0, 0) checkResult.splice(0, 0)
stopTimeCount() stopTimeCount(1)
updatePercentage() updatePercentage()
break break
} }
@@ -355,13 +356,14 @@ watch(
switch (newValue.code) { switch (newValue.code) {
case 25002: case 25002:
setLogList('error', newValue.data) setLogList('error', newValue.data)
stopTimeCount(0)
break break
case 25003: case 25003:
ElMessageBox.alert('闪变收集失败!', { ElMessageBox.alert('闪变收集失败!','检测失败', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'error' type: 'error'
}) })
stopTimeCount() stopTimeCount(0)
break break
case 25001: { case 25001: {
// 当录波校验完成时,更新录波项目的按钮状态 // 当录波校验完成时,更新录波项目的按钮状态
@@ -394,7 +396,7 @@ watch(
} }
// 触发响应式更新 // 触发响应式更新
checkResult.splice(0, 0) checkResult.splice(0, 0)
stopTimeCount() stopTimeCount(1)
updatePercentage() updatePercentage()
break break
} }
@@ -412,18 +414,19 @@ watch(
device.chnResult.fill(CheckData.ChnCheckResultEnum.UNKNOWN) device.chnResult.fill(CheckData.ChnCheckResultEnum.UNKNOWN)
}) })
} }
stopTimeCount() stopTimeCount(0)
break break
} }
case 'connect': case 'connect':
switch (newValue.operateCode) { switch (newValue.operateCode) {
case 'Contrast_Dev': case 'Contrast_Dev':
setLogList('error', '设备服务端连接失败!') setLogList('error', '设备服务端连接失败!')
stopTimeCount() stopTimeCount(0)
break break
} }
break break
case 'unknown_operate': case 'unknown_operate':
stopTimeCount(0)
break break
case 'error_flow_end': case 'error_flow_end':
ElMessageBox.alert(`当前流程存在异常结束!`, '检测失败', { ElMessageBox.alert(`当前流程存在异常结束!`, '检测失败', {
@@ -431,7 +434,7 @@ watch(
type: 'error' type: 'error'
}) })
setLogList('error', '当前流程存在异常结束!') setLogList('error', '当前流程存在异常结束!')
stopTimeCount() stopTimeCount(0)
break break
case 'socket_timeout': case 'socket_timeout':
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', { ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
@@ -439,7 +442,7 @@ watch(
type: 'error' type: 'error'
}) })
setLogList('error', '设备连接异常,请检查设备连接情况!') setLogList('error', '设备连接异常,请检查设备连接情况!')
stopTimeCount() stopTimeCount(0)
break break
case 'server_error': case 'server_error':
ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', { ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', {
@@ -447,7 +450,7 @@ watch(
type: 'error' type: 'error'
}) })
setLogList('error', '服务端主动关闭连接!') setLogList('error', '服务端主动关闭连接!')
stopTimeCount() stopTimeCount(0)
break break
case 'device_error': case 'device_error':
ElMessageBox.alert('设备主动关闭连接!', '初始化失败', { ElMessageBox.alert('设备主动关闭连接!', '初始化失败', {
@@ -455,12 +458,12 @@ watch(
type: 'error' type: 'error'
}) })
setLogList('error', '设备主动关闭连接!') setLogList('error', '设备主动关闭连接!')
stopTimeCount() stopTimeCount(0)
break break
case 'yjc_xyjy' : case 'yjc_xyjy' :
if(newValue.code == 10550){ if(newValue.code == 10550){
setLogList('error', '协议校验时,设备连接异常!') setLogList('error', '协议校验时,设备连接异常!')
stopTimeCount() stopTimeCount(0)
} }
if (newValue.code == 10552) { if (newValue.code == 10552) {
ElMessageBox.alert('重复的初始化操作!', '检测失败', { ElMessageBox.alert('重复的初始化操作!', '检测失败', {
@@ -468,7 +471,7 @@ watch(
type: 'error', type: 'error',
}) })
setLogList('error', '重复的初始化操作!') setLogList('error', '重复的初始化操作!')
stopTimeCount() stopTimeCount(0)
} }
break; break;
case 'yjc_sbtxjy' : case 'yjc_sbtxjy' :
@@ -478,7 +481,7 @@ watch(
type: 'error', type: 'error',
}) })
setLogList('error', '重复的初始化操作!') setLogList('error', '重复的初始化操作!')
stopTimeCount() stopTimeCount(0)
} }
break; break;
} }
@@ -509,15 +512,12 @@ watch(
// 失败 // 失败
if (newValue.data != undefined) return if (newValue.data != undefined) return
setLogList('error', str + '失败!') setLogList('error', str + '失败!')
emit('update:testStatus', 'error') stopTimeCount(0)
stopTimeCount()
if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!') if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!')
break break
case 10550: case 10550:
setLogList('error', str +'时,设备连接异常!') setLogList('error', str +'时,设备连接异常!')
stopTimeCount(0)
emit('update:testStatus', 'error')
stopTimeCount()
break break
} }
@@ -621,7 +621,7 @@ watch(
if (newValue.code == 25001) { if (newValue.code == 25001) {
setLogList('info', '检测完成!') setLogList('info', '检测完成!')
stopTimeCount() stopTimeCount(1)
updatePercentage() updatePercentage()
} }
if(newValue.code == 25005){ if(newValue.code == 25005){
@@ -634,12 +634,12 @@ watch(
} }
case 25003: case 25003:
setLogList('error', '检测失败!') setLogList('error', '检测失败!')
stopTimeCount() stopTimeCount(0)
updatePercentage() updatePercentage()
break break
case 10550: case 10550:
setLogList('error', '设备连接异常!') setLogList('error', '设备连接异常!')
stopTimeCount() stopTimeCount(0)
updatePercentage() updatePercentage()
break break
default: default:
@@ -682,7 +682,7 @@ const updatePercentage = async () => {
// planCode: checkStore.plan.code + '' // planCode: checkStore.plan.code + ''
// }) // })
} }
stopTimeCount() stopTimeCount(1)
ElMessageBox.alert( ElMessageBox.alert(
'检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作',
'检测完成', '检测完成',
@@ -712,10 +712,14 @@ const startTimeCount = () => {
} }
// 停止计时 // 停止计时
const stopTimeCount = () => { const stopTimeCount = (type: number) => {
if (timer) { if (timer) {
clearInterval(timer) clearInterval(timer)
timer = null timer = null
if(type === 0){
emit('update:testStatus', 'error')
}
} }
} }
@@ -977,9 +981,7 @@ defineExpose({
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
</style>
<style lang="scss" scoped>
:deep(.el-button--small) { :deep(.el-button--small) {
height: 20px !important; height: 20px !important;
width: 20px !important; width: 20px !important;

View File

@@ -9,6 +9,7 @@
:draggable="false" :draggable="false"
width="1400px" width="1400px"
> >
<div class="data-check-dialog"> <div class="data-check-dialog">
<div class="data-check-head"> <div class="data-check-head">
<el-form :model="formContent" label-width="auto" class="form-three"> <el-form :model="formContent" label-width="auto" class="form-three">
@@ -73,6 +74,7 @@
class="custom-tree" class="custom-tree"
ref="treeRef" ref="treeRef"
> >
<template #default="{ node, data }"> <template #default="{ node, data }">
<el-tooltip effect="dark" :content="data.scriptTypeName" placement="right"> <el-tooltip effect="dark" :content="data.scriptTypeName" placement="right">
<span <span
@@ -137,6 +139,9 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { dialogBig } from '@/utils/elementBind' import { dialogBig } from '@/utils/elementBind'
@@ -161,7 +166,7 @@ import { ResultEnum } from '@/enums/httpEnum'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { useDictStore } from '@/stores/modules/dict' import { useDictStore } from '@/stores/modules/dict'
import { useModeStore } from '@/stores/modules/mode' import { useModeStore } from '@/stores/modules/mode'
import { CircleClose, Warning, SuccessFilled } from '@element-plus/icons-vue'
const dictStore = useDictStore() const dictStore = useDictStore()
const modeStore = useModeStore() const modeStore = useModeStore()
@@ -183,6 +188,8 @@ watch(searchValue, val => {
treeRef.value!.filter(val) treeRef.value!.filter(val)
}) })
// 格式化数字 // 格式化数字
const fixed = 4 const fixed = 4
@@ -816,6 +823,10 @@ defineExpose({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog { .dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -856,11 +867,11 @@ defineExpose({
height: 100%; height: 100%;
margin-top: 10px; margin-top: 10px;
.custom-tree-node { // .custom-tree-node {
overflow-x: hidden !important; // overflow-x: hidden !important;
white-space: nowrap !important; // white-space: nowrap !important;
text-overflow: ellipsis !important; // text-overflow: ellipsis !important;
} // }
} }
} }
@@ -904,6 +915,8 @@ defineExpose({
} }
} }
} }
</style> </style>
<!--<style lang="scss">--> <!--<style lang="scss">-->
<!--.el-popover.popover-class {--> <!--.el-popover.popover-class {-->

View File

@@ -226,6 +226,7 @@ const open = async (
planIsOnlyWave.value = isOnlyWave planIsOnlyWave.value = isOnlyWave
CompareTestVisible.value = false CompareTestVisible.value = false
devIdList.value = device devIdList.value = device
devIdList.value = device
pqStandardDevList.value = standardDev pqStandardDevList.value = standardDev
planIdKey.value = fatherPlanId planIdKey.value = fatherPlanId
deviceMonitor.value = DeviceMonitoringMap deviceMonitor.value = DeviceMonitoringMap

View File

@@ -845,7 +845,7 @@ const handleTest2 = async (val: string) => {
// 检查数组长度是否为1且唯一元素是'wave_data' // 检查数组长度是否为1且唯一元素是'wave_data'
const isOnlyWave = targetPlan.datasourceIds.length === 1 && targetPlan.datasourceIds[0] === 'wave_data' const isOnlyWave = targetPlan.datasourceIds.length === 1 && targetPlan.datasourceIds[0] === 'wave_data'
deviceConnectionPopupRef.value?.open( deviceConnectionPopupRef.value?.open(
filteredChannelsSelection, filteredChannelsSelection,
pqStandardDevList.value, pqStandardDevList.value,

View File

@@ -29,7 +29,7 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
> >
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node" style="display: flex; align-items: center"> <span class="custom-tree-node" style="display: flex; align-items: center;">
<!-- 父节点图标 --> <!-- 父节点图标 -->
<Platform <Platform
v-if="!data.pid" v-if="!data.pid"