预见测
This commit is contained in:
@@ -35,8 +35,9 @@
|
||||
: row.devices[index1].chnResult[index2].icon==='WarnTriangleFilled' ? '数据异常'
|
||||
: row.devices[index1].chnResult[index2].icon==='Loading'? '检测中':'连接中断'"
|
||||
placement="right">
|
||||
<!-- :disabled="row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.INFO || row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.LOADING" -->
|
||||
<el-button
|
||||
: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"
|
||||
size="small"
|
||||
@click="handleClick(item,chnItem,row.scriptType)"
|
||||
@@ -72,13 +73,13 @@
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
||||
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
||||
<CompareDataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="tsx" setup name="test">
|
||||
import {InfoFilled, Loading} from '@element-plus/icons-vue'
|
||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||
import {computed, reactive, ref, toRef, watch} from "vue";
|
||||
import CompareDataCheckSingleChannelSingleTestPopup from './compareDataCheckSingleChannelSingleTestPopup.vue'
|
||||
import {computed, onBeforeMount, reactive, ref, toRef, watch} from "vue";
|
||||
import {dialogBig} from "@/utils/elementBind";
|
||||
import {CheckData} from "@/api/check/interface"
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
@@ -942,40 +943,40 @@ const getResult = (devices: CheckData.DeviceCheckResult[] = []) => {
|
||||
|
||||
// 点击查看(设备)通道检测详情。参数1:设备信息,参数2:通道号,-1:代表查看全部通道
|
||||
const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
||||
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
|
||||
let flag = -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.TIMEOUT) !== -1) {
|
||||
flag = 0
|
||||
}
|
||||
if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.ERRORDATA) !== -1) {
|
||||
flag = 1
|
||||
}
|
||||
} else {
|
||||
if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.TIMEOUT) {
|
||||
flag = 0
|
||||
}
|
||||
if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.ERRORDATA) {
|
||||
flag = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
|
||||
// let flag = -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.TIMEOUT) !== -1) {
|
||||
// flag = 0
|
||||
// }
|
||||
// if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.ERRORDATA) !== -1) {
|
||||
// flag = 1
|
||||
// }
|
||||
// } else {
|
||||
// if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.TIMEOUT) {
|
||||
// flag = 0
|
||||
// }
|
||||
// if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.ERRORDATA) {
|
||||
// flag = 1
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (flag === 0) {
|
||||
ElMessageBox.alert('连接超时,请检查设备通讯是否正常', '连接超时', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
if (flag === -1 || flag === 1) {
|
||||
checkStore.setShowDetailType(2)
|
||||
// if (flag === 0) {
|
||||
// ElMessageBox.alert('连接超时,请检查设备通讯是否正常', '连接超时', {
|
||||
// confirmButtonText: '确定',
|
||||
// type: 'warning',
|
||||
// })
|
||||
// }
|
||||
// if (flag === -1 || flag === 1) {
|
||||
// checkStore.setShowDetailType(2)
|
||||
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType);
|
||||
}
|
||||
//}
|
||||
};
|
||||
|
||||
// todo 可移除
|
||||
|
||||
Reference in New Issue
Block a user