This commit is contained in:
caozehui
2024-12-23 13:23:28 +08:00
parent 0a4385f29b
commit fd21d32f4a
6 changed files with 50 additions and 43 deletions

View File

@@ -0,0 +1,5 @@
import http from "@/api";
export const getCheckItemDetail = (params: { checkItemId: string, deviceId: string, chnNum: number }) => {
return http.post<any>("/check/test/detail/", params, {loading: false});
}

View File

@@ -29,7 +29,7 @@
"isChildNode":true,
"pid": "0-1",
"id": "0-1-3",
"name": "输入:频率 50.05Hz..."
"name": "输入:频率 50.05Hz...."
}
]
},

View File

@@ -10,33 +10,33 @@
</el-table-column>
<el-table-column prop="standardValue" label="标准值V"/>
<el-table-column label="L1V">
<el-table-column prop="L1" width="80" label="被检值">
<el-table-column prop="L1" width="75" label="被检值">
</el-table-column>
<el-table-column prop="L1_errValue" width="80" label="误差值">
<el-table-column prop="L1_errValue" width="75" label="误差值">
</el-table-column>
</el-table-column>
<el-table-column label="L2V">
<el-table-column prop="L2" width="80" label="被检值">
<el-table-column prop="L2" width="75" label="被检值">
</el-table-column>
<el-table-column prop="L2_errValue" width="80" label="误差值">
<el-table-column prop="L2_errValue" width="75" label="误差值">
</el-table-column>
</el-table-column>
<el-table-column label="L3V">
<el-table-column prop="L3" width="80" label="被检值">
<el-table-column prop="L3" width="75" label="被检值">
</el-table-column>
<el-table-column prop="L3_errValue" width="80" label="误差值">
<el-table-column prop="L3_errValue" width="75" label="误差值">
</el-table-column>
</el-table-column>
<el-table-column prop="maxErrVaule" width="130" label="最大误差V">
<el-table-column prop="maxErrVaule" width="110" label="最大误差V">
</el-table-column>
<el-table-column prop="result" label="检测结果">
<el-table-column prop="result" label="检测结果" width="100">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.result === '不合格'">{{ scope.row.result }}</el-tag>
<span v-if="scope.row.result != '不合格'">{{ scope.row.result }}</span>

View File

@@ -34,7 +34,7 @@
</el-radio-group>
</div>
<div class="content-tree">
<el-tree :default-expanded-keys="['0', '0-1', '0-2', '0-3', '1']" node-key="id" :data="treeData"
<el-tree :default-expanded-keys="['0', '0-2']" node-key="id" :data="treeData"
:props="defaultProps" @node-click="handleNodeClick"/>
</div>
</div>
@@ -65,7 +65,7 @@ import {dialogBig} from '@/utils/elementBind'
import {reactive, ref} from 'vue'
import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
import type {CheckResult, DataCheck, RawDataItem} from "@/api/check/interface";
import {CheckData} from "@/api/check/interface";
import {data as treeData} from "@/api/plan/autoTest.json";
const {appendToBody} = withDefaults(defineProps<{
@@ -73,7 +73,7 @@ const {appendToBody} = withDefaults(defineProps<{
}>(), {appendToBody: false})
const formContent = reactive<DataCheck>({
const formContent = reactive<CheckData.DataCheck>({
testScriptName: 'Q/GDW 10650.4-2021 模拟式',
errorSysName: 'Q/GDW 10650.2-2021',
dataRule: '所有值',
@@ -128,7 +128,7 @@ const handleNodeClick = (data: any) => {
console.log(data);
};
const checkResultTableData = reactive<CheckResult[]>([
const checkResultTableData = reactive<CheckData.CheckResult[]>([
{
chnNum: '1',
standardValue: 57.74,
@@ -143,7 +143,7 @@ const checkResultTableData = reactive<CheckResult[]>([
}
])
const rawTableData = reactive<RawDataItem[]>([
const rawTableData = reactive<CheckData.RawDataItem[]>([
{
updateTime: "2024-10-10 09:30:00",
L1: 57.73,
@@ -279,9 +279,10 @@ const close = () => {
visible.value = false;
};
const open = (deviceItem: any, chnNum?: number) => {
const open = (checkItemId: string, deviceId: string, chnNum?: number) => {
console.log(checkItemId, deviceId, chnNum);
// 发起后端请求,查询详细信息
// const deviceItem = await getDetail(planId,checkItemId,deviceItem.id, chnNum)
//const result = await getCheckItemDetail({checkItemId,deviceId, chnNum})
// 数据处理
// checkResultTableData=[];
@@ -302,7 +303,7 @@ defineExpose({
flex-direction: column;
overflow-y: hidden;
overflow-x: hidden;
width: 100%;
.data-check-dialog {
display: flex;
@@ -315,30 +316,30 @@ defineExpose({
}
.data-check-body {
width: 100%;
display: flex;
flex-direction: row;
width: 100%;
.content-left-tree {
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
max-height: 473px;
padding: 10px 0;
border: 1px solid #ccc;
overflow: auto;
.content-tree {
width: 250px;
max-width: 250px;
height: 450px;
max-height: 450px;
overflow-x: auto;
overflow-y: auto;
min-width: 100%;
height: 100%;
max-height: 100%;
margin-top: 10px;
}
}
.content-right {
width: 75%;
margin-left: 10px;
flex: 1;
@@ -360,4 +361,5 @@ defineExpose({
}
}
}
</style>

View File

@@ -38,10 +38,10 @@
</div>
<div class="dialog-content">
<el-table :data="checkResultView" :cell-class-name="tableCell" row-key="scriptID" height="450px"
<el-table :data="checkResultView" :cell-class-name="tableCell" row-key="scriptId" height="450px"
:header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%"
border>
<el-table-column fixed prop="scriptItemName" label="检测项目" width="250px">
<el-table-column fixed prop="scriptItemName" label="检测项目" width="140px" align="center">
</el-table-column>
<template v-if="chnSum<=MAX_CHN_SUM">
@@ -57,7 +57,7 @@
:disabled="row.devices[index1].chnResult[index2].resultType=='info'"
:type="row.devices[index1].chnResult[index2].resultType"
size="small"
@click="handleClick(item,chnItem)"
@click="handleClick(row.scriptId,item.deviceId,chnItem)"
>
{{ row.devices[index1].chnResult[index2].resultValue }}
</el-button>
@@ -77,7 +77,7 @@
:disabled="row.devices[index].chnResult[0].resultType=='info'"
:type="row.devices[index].chnResult[0].resultType"
size="small"
@click="handleClick(item,-1)"
@click="handleClick(row.scriptId,item.deviceId,-1)"
>
{{ row.devices[index].chnResult[0].resultValue }}
</el-button>
@@ -628,7 +628,7 @@ const errorCheckItem = reactive<string[]>([]);
// 动态获取表格单元格样式
function tableCell({row, columnIndex}) {
let items = errorCheckItem.filter((item) => item === row.scriptID)
let items = errorCheckItem.filter((item) => item === row.scriptId)
if (columnIndex === 0 && items.length > 0) {
return 'warning-row'
@@ -650,8 +650,8 @@ const resultDialogVisible = ref(false)
function clear() {
}
const updateCheckResultView = (scriptID: string) => {
const temp = simulateCheck(scriptID)
const updateCheckResultView = (scriptId: string) => {
const temp = simulateCheck(scriptId)
updateCheckResult(temp)
// traverseTableData(scriptData, id);
};
@@ -730,8 +730,8 @@ const handlePauseOrContinue = () => {
};
// 点击查看设备通道检测详情。参数1设备信息参数2通道号-1代表查看全部通道
const handleClick = (deviceItem: any, chnNum: number) => {
dataCheckSingleChannelSingleTestPopupRef.value?.open(deviceItem, chnNum);
const handleClick = (scriptId:string,deviceId: any, chnNum: number) => {
dataCheckSingleChannelSingleTestPopupRef.value?.open(scriptId, deviceId, chnNum);
};
const props = defineProps({

View File

@@ -207,15 +207,15 @@ const detectionOptions = ref([
text: '',
background: 'rgb(255, 255, 255, 0)',
})*/
startTest({
userPageId: "cdf",
devIds:["5eaba83670ff4d9daf892a62a5e13ea3","80b4b4f52a4c4064a18319525f8ac13c"],
//planId:"31cc203f3fa94fa39323ae7cc411cd66"
}).then(res=>{
})
// startTest({
// userPageId: "cdf",
// devIds:["5eaba83670ff4d9daf892a62a5e13ea3","80b4b4f52a4c4064a18319525f8ac13c"],
// //planId:"31cc203f3fa94fa39323ae7cc411cd66"
// }).then(res=>{
//
//
//
// })
break;
case 1:
timeTestStatus.value = 'start'