This commit is contained in:
caozehui
2025-01-03 11:27:36 +08:00
parent 8a5bcca901
commit 938b9054d3
7 changed files with 356 additions and 250 deletions

View File

@@ -4,7 +4,7 @@ export namespace CheckData {
errorSysName: string, errorSysName: string,
dataRule: string, dataRule: string,
deviceName: string, deviceName: string,
monitorIdx: string, chnNum: string,
} }
/** /**
@@ -46,7 +46,7 @@ export namespace CheckData {
export interface ScriptItem{ export interface ScriptItem{
scriptName: string, scriptName: string,
scriptType?: string, scriptType?: string,
children?: ScriptItem1[] children?: ScriptItem[]
} }
// 用来描述 通道检测结果 // 用来描述 通道检测结果
export enum ChnCheckResultEnum { export enum ChnCheckResultEnum {

View File

@@ -1,4 +1,5 @@
import http from "@/api"; import http from "@/api";
import {CheckData} from "@/api/check/interface";
export const getBigTestItem = (planId: string) => { export const getBigTestItem = (planId: string) => {
return http.get(`/adPlan/getBigTestItem?planId=${planId}`, {loading: false}); return http.get(`/adPlan/getBigTestItem?planId=${planId}`, {loading: false});
@@ -28,7 +29,7 @@ export const getTreeData = (params: {
scriptType: string | null, scriptType: string | null,
code: string code: string
}) => { }) => {
return http.post("/result/treeData/", params, {loading: false}); return http.post<CheckData.ScriptItem[]>("/result/treeData/", params, {loading: true});
} }
/** /**

View File

@@ -11,6 +11,7 @@ export const useCheckStore = defineStore("check", {
planId: String(""), planId: String(""),
planCode: String(""), planCode: String(""),
scriptId: String(""), scriptId: String(""),
errorSysId: String(""),
}), }),
getters: {}, getters: {},
@@ -34,6 +35,10 @@ export const useCheckStore = defineStore("check", {
setScriptId(scriptId: string) { setScriptId(scriptId: string) {
this.scriptId = scriptId this.scriptId = scriptId
},
setErrorSysId(errorSysId: string) {
this.errorSysId = errorSysId
} }
} }
}); });

View File

@@ -121,8 +121,9 @@ const checkedScriptType = ref<string>('')
const currentScriptDsc = ref(''); const currentScriptDsc = ref('');
// 右侧Tab选中项 // 右侧Tab选中项
const activeTab = ref<string>('resultTab') const activeTab = ref<string>('resultTab')
// 检测结果表格数据 // 检测结果表格数据
let checkResultTableData: CheckData.CheckResult = [] let checkResultTableData: CheckData.CheckResult[] = []
// 原始数据表格数据 // 原始数据表格数据
let rawTableData: CheckData.RawDataItem[] = [] let rawTableData: CheckData.RawDataItem[] = []
@@ -147,60 +148,21 @@ const handleNodeClick = async (data: any) => {
watch(() => formContent.chnNum, async (newVal, oldVal) => { watch(() => formContent.chnNum, async (newVal, oldVal) => {
console.log("通道号", newVal); console.log("通道号", newVal);
switchItem.value = 0 if (newVal) {
await handleSwitchChange(0)
})
const handleSwitchChange = async (data: any) => {
console.log("切换不合格测试项、全部测试项", data);
if (data === 0) {
// 发起请求,查询该测试项的检测结果 // 发起请求,查询该测试项的检测结果
const {data: treeDataTemp} = await getTreeData({ const {data: resTreeDataTemp}: { data: CheckData.ScriptItem[] } = await getTreeData({
scriptId: checkStore.scriptId, scriptId: checkStore.scriptId,
deviceId, deviceId,
devNum: formContent.chnNum + '', devNum: formContent.chnNum + '',
scriptType, scriptType,
code: checkStore.planCode code: checkStore.planCode
}) })
treeDataUnqualified = [] treeDataAll = resTreeDataTemp
//filterTree(treeDataTemp,2)
//treeDataUnqualified=treeDataTemp let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll))
// treeDataUnqualified = [{ filterTree(treeDataTemp, 2)
// "scriptName": "频率准确度检测", treeDataUnqualified = treeDataTemp
// "children": [
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '2346adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '1246adaafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2136ada3fdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '234246adafdf'
// }
// ]
// }
// ]
// }]
} else {
// 发起请求,查询该测试项的检测结果
// const {data:treeDataAll} = await getTreeData({scriptId:checkStore.scriptId,deviceId, devNum: formContent.chnNum+'', scriptType,code:checkStore.planCode})
treeDataAll = []
// treeDataAll = [ // treeDataAll = [
// { // {
// "scriptName": "频率准确度检测", // "scriptName": "频率准确度检测",
@@ -251,7 +213,139 @@ const handleSwitchChange = async (data: any) => {
// ] // ]
// } // }
// ] // ]
// treeDataUnqualified = [{
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '2346adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '1246adaafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2136ada3fdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '234246adafdf'
// }
// ]
// }
// ]
// }]
switchItem.value = 0
await handleSwitchChange(0)
} }
})
const handleSwitchChange = async (data: any) => {
console.log("切换不合格测试项、全部测试项", data);
// let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll))
// if (data === 0) {
// filterTree(treeDataTemp, 2)
// treeDataUnqualified = treeDataTemp
// treeDataUnqualified=[]
//treeDataUnqualified=treeDataTemp
// treeDataUnqualified = [{
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '2346adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '1246adaafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2136ada3fdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '234246adafdf'
// }
// ]
// }
// ]
// }]
// }
// else {
// treeDataAll = treeDataTemp
// treeDataAll = []
// treeDataAll = [
// {
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "额定工作条件下的检测",
// "children": [
// {
// "scriptName": "输入:频率 42.5Hz...",
// "scriptType": '2246ada2fdf'
// },
// {
// "scriptName": "输入:频率 50.0Hz...",
// "scriptType": '2246a3dafdf'
// },
// {
// "scriptName": "输入:频率 50.05Hz....",
// "scriptType": '22246adafdf'
// }
// ]
// },
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '224a6adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '2246aadafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2246adaffdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '2246aadafdf'
// }
// ]
// }
// ]
// }
// ]
// }
defaultOperate() defaultOperate()
await updateTableData() await updateTableData()
@@ -278,144 +372,146 @@ const defaultOperate = () => {
const updateTableData = async () => { const updateTableData = async () => {
console.log("左侧树被选中的叶子节点scriptType", checkedScriptType.value); console.log("左侧树被选中的叶子节点scriptType", checkedScriptType.value);
// 发起请求,查询该测试项的检测结果 if (checkedScriptType.value) {
// const result = await getTableData({checkStore.scriptId,deviceId, formContent.chnNum, scriptType}) // 发起请求,查询该测试项的检测结果
// const result = await getTableData({checkStore.scriptId,deviceId, formContent.chnNum, scriptType})
checkResultTableData = [{ checkResultTableData = [{
chnNum: '1', chnNum: '1',
standardValue: 57.74, standardValue: 57.74,
A: 57.73, A: 57.73,
A_errValue: 0.01, A_errValue: 0.01,
B: 57.73, B: 57.73,
B_errValue: 0.01, B_errValue: 0.01,
C: 57.73, C: 57.73,
C_errValue: 0.01, C_errValue: 0.01,
maxErrVaule: 0.05774, maxErrVaule: 0.05774,
result: '合格', result: '合格',
}] }]
rawTableData = [ rawTableData = [
{ {
updateTime: "2024-10-10 09:30:00", updateTime: "2024-10-10 09:30:00",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:03", updateTime: "2024-10-10 09:30:03",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:06", updateTime: "2024-10-10 09:30:06",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:09", updateTime: "2024-10-10 09:30:09",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:12", updateTime: "2024-10-10 09:30:12",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:15", updateTime: "2024-10-10 09:30:15",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:18", updateTime: "2024-10-10 09:30:18",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:21", updateTime: "2024-10-10 09:30:21",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:24", updateTime: "2024-10-10 09:30:24",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:27", updateTime: "2024-10-10 09:30:27",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:30", updateTime: "2024-10-10 09:30:30",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:33", updateTime: "2024-10-10 09:30:33",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:36", updateTime: "2024-10-10 09:30:36",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:39", updateTime: "2024-10-10 09:30:39",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:42", updateTime: "2024-10-10 09:30:42",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:45", updateTime: "2024-10-10 09:30:45",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:48", updateTime: "2024-10-10 09:30:48",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:51", updateTime: "2024-10-10 09:30:51",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:54", updateTime: "2024-10-10 09:30:54",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
}, },
{ {
updateTime: "2024-10-10 09:30:57", updateTime: "2024-10-10 09:30:57",
A: 57.73, A: 57.73,
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
} }
] ]
}
} }
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => { const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
@@ -424,7 +520,12 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul
scriptType = _scriptType scriptType = _scriptType
// 发起后端请求,查询详细信息 当chnNum为-1时查询所有通道号 // 发起后端请求,查询详细信息 当chnNum为-1时查询所有通道号
const {data: resFormContent} = await getFormData({planId: checkStore.planId, deviceId, chnNum, scriptType}) const {data: resFormContent}: { data: any } = await getFormData({
planId: checkStore.planId,
deviceId,
chnNum,
scriptType
})
// 数据处理 // 数据处理
// let resFormContent = { // let resFormContent = {
@@ -439,7 +540,7 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul
// {value: '4', label: '0'}], // {value: '4', label: '0'}],
// } // }
chnList = resFormContent.chnList.map(item => ({ chnList = resFormContent.chnList.map((item: { value: string, label: string }) => ({
value: item.value, value: item.value,
label: item.label == '1' ? `${item.value}` : `${item.value}(不符合)` label: item.label == '1' ? `${item.value}` : `${item.value}(不符合)`
})) }))
@@ -449,13 +550,11 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul
Object.assign(formContent, { Object.assign(formContent, {
...resFormContent, ...resFormContent,
dataRule: dataRuleName, dataRule: dataRuleName,
chnNum: chnList[0].value chnNum: chnList.length > 0 ? chnList[0].value : '',
}) })
visible.value = true; visible.value = true;
// console.log(filterTree(treeD, 1))
} }
const close = () => { const close = () => {

View File

@@ -11,7 +11,7 @@
v-if="testStatus=='process' && activeIndex < checkTotal" v-if="testStatus=='process' && activeIndex < checkTotal"
:disabled="activeIndex===0" :disabled="activeIndex===0"
:icon="VideoPause" :icon="VideoPause"
@click="handlePauseTest">停止检测 @click="emit('sendPause')">停止检测
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
@@ -33,7 +33,7 @@
type="warning" type="warning"
v-if="testStatus=='paused' && activeIndex < checkTotal" v-if="testStatus=='paused' && activeIndex < checkTotal"
:icon="Refresh" :icon="Refresh"
@click="handleResumeTest" @click="emit('sendResume')"
>继续检测 >继续检测
</el-button> </el-button>
<el-button type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button> <el-button type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
@@ -298,13 +298,13 @@ watch(testStatus, function (newValue, oldValue) {
startTimer() // todo 可移除 startTimer() // todo 可移除
//emit('update:testStatus', 'process') // todo 可移除 //emit('update:testStatus', 'process') // todo 可移除
} }
if (newValue == 'paused' && oldValue == 'process') { // if (newValue == 'paused' && oldValue == 'process') {
handlePauseOrContinue() // handlePauseTest()
} // }
if (newValue === 'process' && oldValue == 'paused') { // if (newValue === 'process' && oldValue == 'paused') {
activeIndex++ //activeIndex++
handlePauseOrContinue() //handleResumeTest()
} // }
}) })
watch(webMsgSend, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) {
@@ -388,6 +388,7 @@ watch(webMsgSend, function (newValue, oldValue) {
case 'Pause_Success': case 'Pause_Success':
ElMessage.success('暂停成功') ElMessage.success('暂停成功')
emit('update:testStatus', 'paused') emit('update:testStatus', 'paused')
handlePauseTest()
break; break;
case 'Pause_Fail': case 'Pause_Fail':
ElMessage.error('暂停失败') ElMessage.error('暂停失败')
@@ -395,6 +396,7 @@ watch(webMsgSend, function (newValue, oldValue) {
case 'Resume_Success': case 'Resume_Success':
ElMessage.success('开始继续检测') ElMessage.success('开始继续检测')
emit('update:testStatus', 'process') emit('update:testStatus', 'process')
handleResumeTest()
break; break;
case 'Resume_Fail': case 'Resume_Fail':
ElMessage.error('无法继续检测') ElMessage.error('无法继续检测')
@@ -573,8 +575,6 @@ const updatePercentage = () => {
emit('update:testStatus', 'success') emit('update:testStatus', 'success')
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', { ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
clear(); clear();
@@ -767,7 +767,6 @@ const updateLog = (isStart: boolean) => {
// } // }
const updateCheckResultView = (scriptCode: string, isStart: boolean) => { const updateCheckResultView = (scriptCode: string, isStart: boolean) => {
// debugger
let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id
let temp = null let temp = null
if (isStart) { if (isStart) {
@@ -804,7 +803,6 @@ const getLoadingResult = (scriptType: string) => {
return tempScriptChnItem return tempScriptChnItem
} }
// 模拟检测 todo 可移除 // 模拟检测 todo 可移除
const getCheckResult = (scriptType: string) => { const getCheckResult = (scriptType: string) => {
// debugger // debugger
@@ -866,32 +864,6 @@ const getCheckResult = (scriptType: string) => {
return tempScriptChnItem return tempScriptChnItem
} }
// 处理暂停、继续按钮点击事件
const handlePauseOrContinue = () => {
const currentTime = ref(new Date().toLocaleString());
if (testStatus.value == "paused") {
endData.value = new Date();
const Pausetime = endData.value.getTime() - startData.value.getTime();
timeDifference.value += Pausetime
testLogList.push({
type: 'info',
log: currentTime.value + ':暂停检测',
})
console.log('暂停中')
}
if (testStatus.value == "process") {
startData.value = new Date();
testLogList.push({
type: 'info',
log: currentTime.value + ':继续检测',
})
startTimer()
console.log('开始继续检测')
}
};
// 点击查看设备通道检测详情。参数1设备信息参数2通道号-1代表查看全部通道 // 点击查看设备通道检测详情。参数1设备信息参数2通道号-1代表查看全部通道
const handleClick = (item: any, chnNum: string, scriptType: string) => { const handleClick = (item: any, chnNum: string, scriptType: string) => {
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType) let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
@@ -935,17 +907,18 @@ const startTimer = () => {
switch (activeIndex) { switch (activeIndex) {
case 1: case 1:
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'yjc_ytxjy', requestId: 'yjc_ytxjy',
operateCode: "INIT_GATHER", operateCode: "INIT_GATHER",
code: "2222" code: "2222"
})},2000) })
}, 2000)
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'yjc_sbtxjy', requestId: 'yjc_sbtxjy',
operateCode: "INIT_GATHER$01", operateCode: "INIT_GATHER$01",
code: "2222", code: "2222",
data:'240003' data: '240003'
}) })
}, 4000); }, 4000);
setTimeout(() => { setTimeout(() => {
@@ -953,13 +926,13 @@ const startTimer = () => {
requestId: 'YJC_xujy', requestId: 'YJC_xujy',
operateCode: "DATA_REQUEST$02" operateCode: "DATA_REQUEST$02"
}) })
},6000) }, 6000)
setTimeout(()=>{ setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'FREQ_Start', requestId: 'FREQ_Start',
params: {} params: {}
}) })
},9000) }, 9000)
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'FREQ_End', requestId: 'FREQ_End',
@@ -1109,13 +1082,26 @@ const startTimer = () => {
}; };
const handlePauseTest = () => { const handlePauseTest = () => {
// 发送暂停指令 endData.value = new Date();
emit('sendPause') let diffTime = endData.value.getTime() - startData.value.getTime();
timeDifference.value += diffTime
testLogList.push({
type: 'info',
log: `${new Date().toLocaleString()}:暂停检测`,
})
console.log('暂停中')
}; };
const handleResumeTest = () => { const handleResumeTest = () => {
// 发送继续检测指令 activeIndex++
emit('sendResume') startData.value = new Date();
testLogList.push({
type: 'info',
log: `${new Date().toLocaleString()}:继续检测`,
})
startTimer()
console.log('开始继续检测')
}; };
//完成检测 //完成检测

View File

@@ -270,6 +270,7 @@ const detectionOptions = ref([
TestStatus.value = 'start' TestStatus.value = 'start'
} else if (TestStatus.value == 'process') { } else if (TestStatus.value == 'process') {
// 发送暂停指令 // 发送暂停指令
sendPause()
// pauseTest({deviceIds}).then(res => { // pauseTest({deviceIds}).then(res => {
// console.log(res) // console.log(res)
// if (res.code === 20000) { // if (res.code === 20000) {
@@ -279,9 +280,10 @@ const detectionOptions = ref([
// ElMessage.error(res.message) // ElMessage.error(res.message)
// } // }
// }) // })
TestStatus.value = 'paused'
} else if (TestStatus.value == 'paused') { } else if (TestStatus.value == 'paused') {
// 发送继续指令 // 发送继续指令
sendResume()
// resumeTest({deviceIds}).then(res => { // resumeTest({deviceIds}).then(res => {
// console.log(res) // console.log(res)
// if (res.code === 20000) { // if (res.code === 20000) {
@@ -291,7 +293,7 @@ const detectionOptions = ref([
// ElMessage.error(res.message) // ElMessage.error(res.message)
// } // }
// }) // })
TestStatus.value = 'process'
} }
break; break;
default: default:
@@ -348,9 +350,16 @@ const detectionOptions = ref([
const sendPause = () => { const sendPause = () => {
console.log('发送暂停指令') console.log('发送暂停指令')
Object.assign(webMsgSend.value, {
requestId:'Pause_Success'
}) // todo 可移除
} }
const sendResume = () => { const sendResume = () => {
console.log('发送继续检测指令') console.log('发送继续检测指令')
Object.assign(webMsgSend.value, {
requestId:'Resume_Success'
}) // todo 可移除
} }
const getIcon = (index: number) => { const getIcon = (index: number) => {

View File

@@ -51,15 +51,20 @@ const defaultProps = {
const searchForm = ref({ const searchForm = ref({
planName: '', planName: '',
}) })
const defaultChecked = ref<number[]>([]) // 明确类型为 number[] const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
const getTreeData = (val: any) => { const getTreeData = (val: any) => {
defaultChecked.value = [] defaultChecked.value = []
data.value = val data.value = val
if (data.value.length > 0 && data.value[0].children.length > 0) { if (data.value.length > 0 && data.value[0].children.length > 0) {
defaultChecked.value.push(data.value[0].children[0].id as number) let node = data.value[0].children[0]
defaultChecked.value.push(node.id)
checkStore.setPlanId(node.id)
checkStore.setPlanCode(node.code)
checkStore.setScriptId(node.scriptId)
checkStore.setErrorSysId(node.errorSysId)
console.log(checkStore.planId,checkStore.planCode,checkStore.scriptId,checkStore.errorSysId)
} }
checkStore.setPlanId(defaultChecked.value[0])
checkStore.setPlanCode(data.value[0].code)
} }
const filterText = ref('') const filterText = ref('')
const treeRef = ref() const treeRef = ref()
@@ -79,6 +84,7 @@ const handleNodeClick = (data: Plan.ResPlan) => {
checkStore.setPlanId(data.id) checkStore.setPlanId(data.id)
checkStore.setPlanCode(data.code) checkStore.setPlanCode(data.code)
checkStore.setScriptId(data.scriptId) checkStore.setScriptId(data.scriptId)
checkStore.setErrorSysId(data.errorSysId)
updateSelectedTreeNode(data.id) updateSelectedTreeNode(data.id)
} }
const filterNode = (value: string, data: any) => { const filterNode = (value: string, data: any) => {