This commit is contained in:
caozehui
2025-01-08 09:46:47 +08:00
parent 87c46e8477
commit de5548bbbd
2 changed files with 30 additions and 24 deletions

View File

@@ -249,9 +249,9 @@ const defaultOperate = () => {
currentDesc.value = node.sourceDesc currentDesc.value = node.sourceDesc
checkIndex.value = node.index checkIndex.value = node.index
defaultExpandedKeys = [node.index] defaultExpandedKeys = [node.index]
// nextTick(() => {
// treeRef.value?.setCurrentKey(node.index); treeRef.value?.setCurrentKey(node.index);
// });
} else { } else {
currentScriptTypeName.value = '' currentScriptTypeName.value = ''
currentDesc.value = '' currentDesc.value = ''

View File

@@ -70,7 +70,7 @@
:disabled="row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.INFO || row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.LOADING" :disabled="row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.INFO || row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.LOADING"
:color="row.devices[index1].chnResult[index2].color" :color="row.devices[index1].chnResult[index2].color"
size="small" size="small"
@click="handleClick(item,chnItem+'',row.scriptType)" @click="handleClick(item,chnItem,row.scriptType)"
style="align-self: center;" style="align-self: center;"
> >
<el-icon v-if="row.devices[index1].chnResult[index2].icon==='Loading'" class="loading-box" <el-icon v-if="row.devices[index1].chnResult[index2].icon==='Loading'" class="loading-box"
@@ -98,7 +98,7 @@
:disabled="row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.INFO || row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.LOADING" :disabled="row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.INFO || row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.LOADING"
:color="row.devices[index1].chnResult[0].color" :color="row.devices[index1].chnResult[0].color"
size="small" size="small"
@click="handleClick(item,'-1',row.scriptType)" @click="handleClick(item,-1,row.scriptType)"
> >
<el-icon v-if="row.devices[index1].chnResult[0].icon==='Loading'" class="loading-box" <el-icon v-if="row.devices[index1].chnResult[0].icon==='Loading'" class="loading-box"
style="color: #fff"> style="color: #fff">
@@ -794,18 +794,18 @@ const setErrorCheckItem = (scriptType: string, devices: any) => {
} }
} }
const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any = null) => { const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any[] = []) => {
let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id
// devices = [{ // devices = [{
// chnResult: [2, 2], // chnResult: [1, 1],
// deviceId: "80b4b4f52a4c4064a18319525f8ac13c", // deviceId: "80b4b4f52a4c4064a18319525f8ac13c",
// deviceName: "240002" // deviceName: "240002"
// }] // }]
setErrorCheckItem(scriptType, devices)
let temp = null let temp = null
if (isStart) { if (isStart) {
temp = getLoadingResult(scriptType) temp = getLoadingResult(scriptType)
} else { } else {
setErrorCheckItem(scriptType, devices)
temp = { temp = {
scriptType, scriptType,
devices devices
@@ -902,11 +902,14 @@ const getCheckResult = (scriptType: string) => {
} }
// 点击查看设备通道检测详情。参数1设备信息参数2通道号-1代表查看全部通道 // 点击查看设备通道检测详情。参数1设备信息参数2通道号-1代表查看全部通道
const handleClick = (item: any, chnNum: string, scriptType: string) => { const handleClick = (item: any, chnNum: number, scriptType: string) => {
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType) let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
let chnResult = checkResultItem?.devices.find(obj => obj.deviceId === item.deviceId)?.chnResult
let flag = -1 let flag = -1
if (chnNum === '-1') { if (checkResultItem) {
let device = checkResultItem.devices.find(obj => obj.deviceId === item.deviceId)
if (device) {
let chnResult = device.chnResult
if (chnNum === -1) {
if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.UNCONNECTED) !== -1) { if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.UNCONNECTED) !== -1) {
flag = 0 flag = 0
} }
@@ -921,6 +924,9 @@ const handleClick = (item: any, chnNum: string, scriptType: string) => {
flag = 1 flag = 1
} }
} }
}
}
if (flag === 0) { if (flag === 0) {
ElMessageBox.alert('设备通讯中断,请检查设备通讯是否正常', '通讯中断', { ElMessageBox.alert('设备通讯中断,请检查设备通讯是否正常', '通讯中断', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -934,7 +940,7 @@ const handleClick = (item: any, chnNum: string, scriptType: string) => {
}) })
} }
if (flag === -1) { if (flag === -1) {
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum, scriptType); dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType);
} }
}; };