引入store存放检测设备的相关信息
This commit is contained in:
@@ -1,96 +1,104 @@
|
|||||||
export interface DataCheck {
|
export namespace CheckData {
|
||||||
testScriptName: string,
|
export interface DataCheck {
|
||||||
errorSysName: string,
|
testScriptName: string,
|
||||||
dataRule: string,
|
errorSysName: string,
|
||||||
deviceName: string,
|
dataRule: string,
|
||||||
monitorIdx: string,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用于定义 查看(设备)通道检测结果 类型
|
|
||||||
*/
|
|
||||||
export interface CheckResult {
|
|
||||||
chnNum: string,
|
|
||||||
standardValue: number,
|
|
||||||
L1: number,
|
|
||||||
L1_errValue: number,
|
|
||||||
L2: number,
|
|
||||||
L2_errValue: number,
|
|
||||||
L3: number,
|
|
||||||
L3_errValue: number,
|
|
||||||
maxErrVaule: number,
|
|
||||||
result: string,
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用于定义 具体通道的原始数据类型
|
|
||||||
*/
|
|
||||||
export interface RawDataItem {
|
|
||||||
updateTime: string,
|
|
||||||
L1: number,
|
|
||||||
L2: number,
|
|
||||||
L3: number
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 用来描述检测脚本类型
|
|
||||||
export interface ScriptItem {
|
|
||||||
id: string,
|
|
||||||
scriptItemName: string,
|
|
||||||
children?: ScriptItem[]
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用来描述 通道检测结果
|
|
||||||
export enum ChnCheckResultEnum {
|
|
||||||
UNKNOWN = -1,
|
|
||||||
FAIL = 0,
|
|
||||||
SUCCESS = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
//用来描述 某个脚本测试项对所有通道的检测结果
|
|
||||||
export interface ScriptChnItem {
|
|
||||||
scriptID: string
|
|
||||||
scriptItemName: string
|
|
||||||
|
|
||||||
// 设备
|
|
||||||
devices: Array<{
|
|
||||||
deviceID: string,
|
|
||||||
deviceName: string,
|
deviceName: string,
|
||||||
chnResult: ChnCheckResultEnum[] //通道检测结果
|
monitorIdx: string,
|
||||||
}>
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于描述 (设备)通道检测结果展示的按钮类型
|
* 用于定义 查看(设备)通道检测结果 类型
|
||||||
*/
|
*/
|
||||||
export interface ButtonResult {
|
export interface CheckResult {
|
||||||
resultType: 'info' | 'success' | 'danger',
|
chnNum: string,
|
||||||
resultValue: '-' | '√' | '×'
|
standardValue: number,
|
||||||
}
|
L1: number,
|
||||||
|
L1_errValue: number,
|
||||||
|
L2: number,
|
||||||
|
L2_errValue: number,
|
||||||
|
L3: number,
|
||||||
|
L3_errValue: number,
|
||||||
|
maxErrVaule: number,
|
||||||
|
result: string,
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于描述 脚本检测结果展示的按钮类型
|
* 用于定义 具体通道的原始数据类型
|
||||||
*/
|
*/
|
||||||
export interface ScriptChnViewItem {
|
export interface RawDataItem {
|
||||||
scriptID: string,
|
updateTime: string,
|
||||||
scriptItemName: string //脚本项名称
|
L1: number,
|
||||||
|
L2: number,
|
||||||
|
L3: number
|
||||||
|
}
|
||||||
|
|
||||||
// 设备
|
export interface Device {
|
||||||
devices:Array<{
|
deviceID: string; //装置序号ID
|
||||||
deviceID: string,
|
deviceName: string; //设备名称
|
||||||
deviceName: string,
|
chnNum: number; //设备通道数
|
||||||
chnResult: ButtonResult[],
|
}
|
||||||
}>
|
|
||||||
}
|
// 用来描述检测脚本类型
|
||||||
|
export interface ScriptItem {
|
||||||
|
id: string,
|
||||||
|
scriptItemName: string,
|
||||||
|
children?: ScriptItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用来描述 通道检测结果
|
||||||
|
export enum ChnCheckResultEnum {
|
||||||
|
UNKNOWN = -1,
|
||||||
|
FAIL = 0,
|
||||||
|
SUCCESS = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
//用来描述 某个脚本测试项对所有通道的检测结果
|
||||||
|
export interface ScriptChnItem {
|
||||||
|
scriptID: string
|
||||||
|
scriptItemName: string
|
||||||
|
|
||||||
|
// 设备
|
||||||
|
devices: Array<{
|
||||||
|
deviceID: string,
|
||||||
|
deviceName: string,
|
||||||
|
chnResult: ChnCheckResultEnum[] //通道检测结果
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于描述 (设备)通道检测结果展示的按钮类型
|
||||||
|
*/
|
||||||
|
export interface ButtonResult {
|
||||||
|
resultType: 'info' | 'success' | 'danger',
|
||||||
|
resultValue: '-' | '√' | '×'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于描述 脚本检测结果展示的按钮类型
|
||||||
|
*/
|
||||||
|
export interface ScriptChnViewItem {
|
||||||
|
scriptID: string,
|
||||||
|
scriptItemName: string //脚本项名称
|
||||||
|
|
||||||
|
// 设备
|
||||||
|
devices: Array<{
|
||||||
|
deviceID: string,
|
||||||
|
deviceName: string,
|
||||||
|
chnResult: ButtonResult[],
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定义检测日志类型
|
* 定义检测日志类型
|
||||||
*/
|
*/
|
||||||
export interface LogItem {
|
export interface LogItem {
|
||||||
type: 'info' | 'error'
|
type: 'info' | 'error'
|
||||||
log: string
|
log: string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ export const USER_STORE_KEY = "cn-user";
|
|||||||
// pinia中dict store的key
|
// pinia中dict store的key
|
||||||
export const DICT_STORE_KEY = "cn-dictData";
|
export const DICT_STORE_KEY = "cn-dictData";
|
||||||
|
|
||||||
|
export const CHECK_STORE_KEY = "cn-check";
|
||||||
|
|
||||||
|
|||||||
24
frontend/src/stores/modules/check.ts
Normal file
24
frontend/src/stores/modules/check.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import {defineStore} from "pinia";
|
||||||
|
import {CHECK_STORE_KEY} from "@/stores/constant";
|
||||||
|
import type {CheckData} from "@/api/check/interface";
|
||||||
|
|
||||||
|
|
||||||
|
export const useCheckStore = defineStore("check", {
|
||||||
|
id: CHECK_STORE_KEY,
|
||||||
|
|
||||||
|
state: () => ({
|
||||||
|
devices: Array<CheckData.Device>()
|
||||||
|
}),
|
||||||
|
|
||||||
|
getters: {},
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
addDevices(device: CheckData.Device[]) {
|
||||||
|
this.devices.push(...device);
|
||||||
|
},
|
||||||
|
|
||||||
|
clearDevices() {
|
||||||
|
this.devices = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -255,8 +255,11 @@ import { onMounted, reactive, ref, watch } from "vue";
|
|||||||
import { useDictStore } from '@/stores/modules/dict'
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
import ChannelsTest from './channelsTest.vue'
|
import ChannelsTest from './channelsTest.vue'
|
||||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||||
|
import {useCheckStore} from '@/stores/modules/check'
|
||||||
|
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
|
const checkStore = useCheckStore()
|
||||||
|
|
||||||
let devNum = 0;//当前选取的被检设备数量
|
let devNum = 0;//当前选取的被检设备数量
|
||||||
let devChannelsNum = 0;//当前选择的被检设备通道总数
|
let devChannelsNum = 0;//当前选择的被检设备通道总数
|
||||||
let devTestedNum = 0;//当前选择的已完成检测的被检设备数量
|
let devTestedNum = 0;//当前选择的已完成检测的被检设备数量
|
||||||
@@ -555,6 +558,16 @@ const handleSelectionChange = (selection: any[]) => {
|
|||||||
{
|
{
|
||||||
testType= "reTest";
|
testType= "reTest";
|
||||||
}
|
}
|
||||||
|
let devices: Check.Device[] = selection.map((item: any) => {
|
||||||
|
return {
|
||||||
|
deviceId: item.id,
|
||||||
|
deviceName: item.name,
|
||||||
|
deviceType: item.devType,
|
||||||
|
chnNum: item.devChns,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkStore.clearDevices()
|
||||||
|
checkStore.addDevices(devices)
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询
|
//查询
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
<el-button type="success" v-if="activeIndex >= TEST_TOTAL" :icon="Check" disabled>检测完成</el-button>
|
<el-button type="success" v-if="activeIndex >= TEST_TOTAL" :icon="Check" disabled>检测完成</el-button>
|
||||||
|
|
||||||
|
|
||||||
<el-button type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
v-if="isPause && activeIndex < TEST_TOTAL"
|
v-if="isPause && activeIndex < TEST_TOTAL"
|
||||||
@@ -25,6 +23,7 @@
|
|||||||
@click="handlePauseOrContinue"
|
@click="handlePauseOrContinue"
|
||||||
>继续检测
|
>继续检测
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
|
||||||
<!-- <el-button
|
<!-- <el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
v-if="activeIndex >= TEST_TOTAL"
|
v-if="activeIndex >= TEST_TOTAL"
|
||||||
@@ -46,9 +45,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<template v-if="chnSum<=MAX_CHN_SUM">
|
<template v-if="chnSum<=MAX_CHN_SUM">
|
||||||
<el-table-column v-for="(item,index1) in monitorList" :key="item.deviceID" :label="item.deviceName"
|
<el-table-column v-for="(item,index1) in deviceList" :key="item.deviceID" :label="item.deviceName"
|
||||||
:min-width="110" align="center">
|
:min-width="110" align="center">
|
||||||
<el-table-column v-for="(chnItem,index2) in item.chnNum" :key="item.deviceID+chnItem"
|
<el-table-column v-for="(chnItem,index2) in item.chnNum" :key="`${item.deviceID}${chnItem}`"
|
||||||
:label="'通道'+chnItem" align="center">
|
:label="'通道'+chnItem" align="center">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
@@ -69,7 +68,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-table-column v-for="(item,index) in monitorList" :key="item.deviceID" :label="item.deviceName"
|
<el-table-column v-for="(item,index) in deviceList" :key="item.deviceID" :label="item.deviceName"
|
||||||
:min-width="110" align="center">
|
:min-width="110" align="center">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
<el-tooltip :content="row.devices[index].chnResult[0].resultType==='info' ? '暂无数据' : '点击查看详情'"
|
<el-tooltip :content="row.devices[index].chnResult[0].resultType==='info' ? '暂无数据' : '点击查看详情'"
|
||||||
@@ -108,19 +107,15 @@
|
|||||||
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="tsx" setup name="test">
|
<script lang="tsx" setup name="test">
|
||||||
import {Check, Refresh, VideoPause} from '@element-plus/icons-vue'
|
import {Check, Refresh, VideoPause,InfoFilled} from '@element-plus/icons-vue'
|
||||||
import resultPopup from './resultPopup.vue'
|
import resultPopup from './resultPopup.vue'
|
||||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||||
import {reactive, ref} from "vue";
|
import {reactive, ref} from "vue";
|
||||||
import {dialogBig} from "@/utils/elementBind";
|
import {dialogBig} from "@/utils/elementBind";
|
||||||
import {
|
import {CheckData} from "@/api/check/interface"
|
||||||
ButtonResult,
|
import {useCheckStore} from "@/stores/modules/check";
|
||||||
ChnCheckResultEnum,
|
|
||||||
LogItem,
|
const checkStore = useCheckStore()
|
||||||
ScriptChnItem,
|
|
||||||
ScriptChnViewItem,
|
|
||||||
ScriptItem
|
|
||||||
} from "@/api/check/interface"
|
|
||||||
|
|
||||||
const drawer = ref(false)
|
const drawer = ref(false)
|
||||||
const showTestLog = () =>{
|
const showTestLog = () =>{
|
||||||
@@ -128,7 +123,6 @@ const showTestLog = () =>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 总测试项数
|
// 总测试项数
|
||||||
const TEST_TOTAL = 12
|
const TEST_TOTAL = 12
|
||||||
// 最大通道数
|
// 最大通道数
|
||||||
@@ -149,46 +143,45 @@ const dataCheckSingleChannelSingleTestPopupRef = ref();
|
|||||||
// const currentRow = ref(null); // 用于存储当前选中的行
|
// const currentRow = ref(null); // 用于存储当前选中的行
|
||||||
|
|
||||||
|
|
||||||
|
const deviceList = reactive<CheckData.Device[]>([
|
||||||
const monitorList = reactive([
|
// {
|
||||||
{
|
// deviceID: '1',
|
||||||
deviceID: '1',
|
// deviceName: '240001',
|
||||||
deviceName: '240001',
|
// chnNum: 1,
|
||||||
chnNum: 1,
|
// monitorIdx: 1,
|
||||||
monitorIdx: 1,
|
// label: '240001',
|
||||||
label: '240001',
|
// prop: 'Result1',
|
||||||
prop: 'Result1',
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// deviceID: '2',
|
||||||
deviceID: '2',
|
// deviceName: '240002',
|
||||||
deviceName: '240002',
|
// chnNum: 1,
|
||||||
chnNum: 1,
|
// monitorIdx: 2,
|
||||||
monitorIdx: 2,
|
// label: '240002',
|
||||||
label: '240002',
|
// prop: 'Result2',
|
||||||
prop: 'Result2',
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// deviceID: '3',
|
||||||
deviceID: '3',
|
// deviceName: '240003',
|
||||||
deviceName: '240003',
|
// chnNum: 2,
|
||||||
chnNum: 2,
|
// monitorIdx: 1,
|
||||||
monitorIdx: 1,
|
// label: '240003',
|
||||||
label: '240003',
|
// prop: 'Result3',
|
||||||
prop: 'Result3',
|
// },
|
||||||
},
|
// {
|
||||||
{
|
// deviceID: '4',
|
||||||
deviceID: '4',
|
// deviceName: '240004',
|
||||||
deviceName: '240004',
|
// chnNum: 4,
|
||||||
chnNum: 4,
|
// monitorIdx: 2,
|
||||||
monitorIdx: 2,
|
// label: '240004',
|
||||||
label: '240004',
|
// prop: 'Result4',
|
||||||
prop: 'Result4',
|
// }
|
||||||
}
|
|
||||||
])
|
])
|
||||||
|
|
||||||
// 总通道数
|
// 总通道数
|
||||||
const chnSum = computed(() => {
|
const chnSum = computed(() => {
|
||||||
let sum = 0
|
let sum = 0
|
||||||
monitorList.forEach((item) => {
|
deviceList.forEach((item) => {
|
||||||
sum += item.chnNum
|
sum += item.chnNum
|
||||||
})
|
})
|
||||||
return sum
|
return sum
|
||||||
@@ -196,11 +189,12 @@ const chnSum = computed(() => {
|
|||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
initScriptData()
|
initScriptData()
|
||||||
|
initDeviceList()
|
||||||
initCheckResult()
|
initCheckResult()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 检测脚本数据
|
// 检测脚本数据
|
||||||
const scriptData = reactive<ScriptItem[]>([])
|
const scriptData = reactive<CheckData.ScriptItem[]>([])
|
||||||
// 初始化检测脚本数据
|
// 初始化检测脚本数据
|
||||||
const initScriptData = () => {
|
const initScriptData = () => {
|
||||||
Object.assign(scriptData, [
|
Object.assign(scriptData, [
|
||||||
@@ -393,26 +387,35 @@ const initScriptData = () => {
|
|||||||
// },
|
// },
|
||||||
// ])
|
// ])
|
||||||
}
|
}
|
||||||
|
// 初始化设备列表
|
||||||
|
const initDeviceList = () => {
|
||||||
|
checkStore.devices.forEach(item => {
|
||||||
|
deviceList.push({
|
||||||
|
deviceID: item.deviceID,
|
||||||
|
deviceName: item.deviceName,
|
||||||
|
chnNum: item.chnNum,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
// 真正的检测结果(详细到通道)
|
// 真正的检测结果(详细到通道)
|
||||||
const checkResult = reactive<ScriptChnItem[]>([])
|
const checkResult = reactive<CheckData.ScriptChnItem[]>([])
|
||||||
// 初始化检测结果 (详细到通道)
|
// 初始化检测结果 (详细到通道)
|
||||||
const initCheckResult = () => {
|
const initCheckResult = () => {
|
||||||
scriptData.forEach(item => {
|
scriptData.forEach(item => {
|
||||||
// 处理当前节点的数据
|
// 处理当前节点的数据
|
||||||
let temp: ScriptChnItem = {
|
let temp: CheckData.ScriptChnItem = {
|
||||||
scriptID: item.id,
|
scriptID: item.id,
|
||||||
scriptItemName: item.scriptItemName,
|
scriptItemName: item.scriptItemName,
|
||||||
devices: []
|
devices: []
|
||||||
}
|
}
|
||||||
for (let i = 0; i < monitorList?.length; i++) {
|
for (let i = 0; i < deviceList?.length; i++) {
|
||||||
let tempChnResult: ChnCheckResultEnum[] = []
|
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
||||||
for (let j = 0; j < monitorList[i].chnNum; j++) {
|
for (let j = 0; j < deviceList[i].chnNum; j++) {
|
||||||
tempChnResult.push(ChnCheckResultEnum.UNKNOWN)
|
tempChnResult.push(CheckData.ChnCheckResultEnum.UNKNOWN)
|
||||||
}
|
}
|
||||||
temp.devices.push({
|
temp.devices.push({
|
||||||
deviceID: monitorList[i].deviceID,
|
deviceID: deviceList[i].deviceID,
|
||||||
deviceName: monitorList[i].deviceName,
|
deviceName: deviceList[i].deviceName,
|
||||||
chnResult: tempChnResult
|
chnResult: tempChnResult
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -420,7 +423,7 @@ const initCheckResult = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 更新检测结果(详细到通道)
|
// 更新检测结果(详细到通道)
|
||||||
const updateCheckResult = (data: ScriptChnItem) => {
|
const updateCheckResult = (data: CheckData.ScriptChnItem) => {
|
||||||
const {scriptID} = {...data}
|
const {scriptID} = {...data}
|
||||||
|
|
||||||
checkResult.forEach(item => {
|
checkResult.forEach(item => {
|
||||||
@@ -435,34 +438,34 @@ const updateCheckResult = (data: ScriptChnItem) => {
|
|||||||
// 用来展示的检测结果
|
// 用来展示的检测结果
|
||||||
const checkResultView = computed(() => {
|
const checkResultView = computed(() => {
|
||||||
|
|
||||||
let result: ScriptChnViewItem[] = checkResult.map(item => {
|
let result: CheckData.ScriptChnViewItem[] = checkResult.map(item => {
|
||||||
let temp: ScriptChnViewItem = {
|
let temp: CheckData.ScriptChnViewItem = {
|
||||||
scriptID: item.scriptID,
|
scriptID: item.scriptID,
|
||||||
scriptItemName: item.scriptItemName,
|
scriptItemName: item.scriptItemName,
|
||||||
devices: []
|
devices: []
|
||||||
}
|
}
|
||||||
|
|
||||||
item.devices.forEach(device => {
|
item.devices.forEach(device => {
|
||||||
let tempChnBtnResult: ButtonResult[] = []
|
let tempChnBtnResult: CheckData.ButtonResult[] = []
|
||||||
|
|
||||||
if (chnSum.value <= MAX_CHN_SUM) {
|
if (chnSum.value <= MAX_CHN_SUM) {
|
||||||
for (let j = 0; j < device.chnResult.length; j++) {
|
for (let j = 0; j < device.chnResult.length; j++) {
|
||||||
if (device.chnResult[j] == ChnCheckResultEnum.UNKNOWN) {
|
if (device.chnResult[j] == CheckData.ChnCheckResultEnum.UNKNOWN) {
|
||||||
tempChnBtnResult.push({resultType: 'info', resultValue: '-'})
|
tempChnBtnResult.push({resultType: 'info', resultValue: '-'})
|
||||||
} else if (device.chnResult[j] == ChnCheckResultEnum.FAIL) {
|
} else if (device.chnResult[j] == CheckData.ChnCheckResultEnum.FAIL) {
|
||||||
tempChnBtnResult.push({resultType: 'danger', resultValue: '×'})
|
tempChnBtnResult.push({resultType: 'danger', resultValue: '×'})
|
||||||
} else {
|
} else {
|
||||||
tempChnBtnResult.push({resultType: 'success', resultValue: '√'})
|
tempChnBtnResult.push({resultType: 'success', resultValue: '√'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let tempChnResult: ChnCheckResultEnum = device.chnResult[0]
|
let tempChnResult: CheckData.ChnCheckResultEnum = device.chnResult[0]
|
||||||
if (device.chnResult.some(item => item == ChnCheckResultEnum.FAIL)) {
|
if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.FAIL)) {
|
||||||
tempChnResult = ChnCheckResultEnum.FAIL
|
tempChnResult = CheckData.ChnCheckResultEnum.FAIL
|
||||||
}
|
}
|
||||||
if (tempChnResult == ChnCheckResultEnum.UNKNOWN) {
|
if (tempChnResult == CheckData.ChnCheckResultEnum.UNKNOWN) {
|
||||||
tempChnBtnResult.push({resultType: 'info', resultValue: '-'})
|
tempChnBtnResult.push({resultType: 'info', resultValue: '-'})
|
||||||
} else if (tempChnResult == ChnCheckResultEnum.FAIL) {
|
} else if (tempChnResult == CheckData.ChnCheckResultEnum.FAIL) {
|
||||||
tempChnBtnResult.push({resultType: 'danger', resultValue: '×'})
|
tempChnBtnResult.push({resultType: 'danger', resultValue: '×'})
|
||||||
} else {
|
} else {
|
||||||
tempChnBtnResult.push({resultType: 'success', resultValue: '√'})
|
tempChnBtnResult.push({resultType: 'success', resultValue: '√'})
|
||||||
@@ -529,7 +532,7 @@ function getTimeDifference(timeDifference: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 用来存放检测日志
|
// 用来存放检测日志
|
||||||
const testLogList = ref<LogItem[]>([{type: 'info', log: '暂无数据,等待检测开始'}])
|
const testLogList = ref<CheckData.LogItem[]>([{type: 'info', log: '暂无数据,等待检测开始'}])
|
||||||
|
|
||||||
// 更新日志
|
// 更新日志
|
||||||
const updateLog = () => {
|
const updateLog = () => {
|
||||||
@@ -797,17 +800,17 @@ const updateCheckResultView = (scriptID: string) => {
|
|||||||
const simulateCheck = (scriptID: string) => {
|
const simulateCheck = (scriptID: string) => {
|
||||||
let devices = []
|
let devices = []
|
||||||
|
|
||||||
devices = monitorList.map(item => {
|
devices = deviceList.map(item => {
|
||||||
|
|
||||||
let tempChnResult: ChnCheckResultEnum[] = []
|
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
||||||
for (let i = 0; i < item.chnNum; i++) {
|
for (let i = 0; i < item.chnNum; i++) {
|
||||||
tempChnResult.push(ChnCheckResultEnum.SUCCESS)
|
tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS)
|
||||||
}
|
}
|
||||||
|
|
||||||
let randomNum = getRandomInt(item.chnNum * 2)
|
let randomNum = getRandomInt(item.chnNum * 2)
|
||||||
if (activeIndex.value >= 4 && activeIndex.value <= 6) {
|
if (activeIndex.value >= 4 && activeIndex.value <= 6) {
|
||||||
if (randomNum <= item.chnNum) {
|
if (randomNum <= item.chnNum) {
|
||||||
tempChnResult[randomNum] = ChnCheckResultEnum.FAIL
|
tempChnResult[randomNum] = CheckData.ChnCheckResultEnum.FAIL
|
||||||
|
|
||||||
errorCheckItem.push(scriptID)
|
errorCheckItem.push(scriptID)
|
||||||
}
|
}
|
||||||
@@ -820,7 +823,7 @@ const simulateCheck = (scriptID: string) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let tempScriptChnItem: ScriptChnItem = {
|
let tempScriptChnItem: CheckData.ScriptChnItem = {
|
||||||
scriptID,
|
scriptID,
|
||||||
devices,
|
devices,
|
||||||
}
|
}
|
||||||
@@ -839,7 +842,7 @@ const handleReCheck = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 用来保存定时器
|
// 用来保存定时器
|
||||||
const timer = ref("");
|
const timer:any = ref("");
|
||||||
|
|
||||||
// 处理暂停、继续按钮点击事件
|
// 处理暂停、继续按钮点击事件
|
||||||
const handlePauseOrContinue = () => {
|
const handlePauseOrContinue = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user