微调
This commit is contained in:
@@ -45,21 +45,21 @@ export namespace CheckData {
|
||||
* 用于定义 查看(设备)通道检测结果表格展示数据 类型
|
||||
*/
|
||||
export interface CheckResult {
|
||||
aStd?: string,
|
||||
aData?: string,
|
||||
aError?: string,
|
||||
stdA?: string,
|
||||
dataA?: string,
|
||||
errorA?: string,
|
||||
isDataA?: number,
|
||||
bStd?: string,
|
||||
bData?: string,
|
||||
bError?: string,
|
||||
stdB?: string,
|
||||
dataB?: string,
|
||||
errorB?: string,
|
||||
isDataB?: number,
|
||||
cStd?: string,
|
||||
cData?: string,
|
||||
cError?: string,
|
||||
stdC?: string,
|
||||
dataC?: string,
|
||||
errorC?: string,
|
||||
isDataC?: number,
|
||||
tStd?: string,
|
||||
tData?: string,
|
||||
tError?: string,
|
||||
stdT?: string,
|
||||
dataT?: string,
|
||||
errorT?: string,
|
||||
isDataT?: number,
|
||||
|
||||
//最大误差值
|
||||
@@ -74,12 +74,12 @@ export namespace CheckData {
|
||||
*/
|
||||
export interface RawDataItem {
|
||||
time?: string,
|
||||
harmNum?: number|null,
|
||||
harmNum?: number | null,
|
||||
dataA?: string,
|
||||
dataB?: string,
|
||||
dataC?: string,
|
||||
dataT?: string,
|
||||
unit?: string|null
|
||||
unit?: string | null
|
||||
}
|
||||
|
||||
export interface Device {
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
<!-- </el-table-column>-->
|
||||
<template v-if="phaseT === 0">
|
||||
<el-table-column :label="`A(${unit})`">
|
||||
<el-table-column prop="aStd" width="100" label="标准值"/>
|
||||
<el-table-column prop="aData" width="100" label="被检值"/>
|
||||
<el-table-column prop="stdA" width="100" label="标准值"/>
|
||||
<el-table-column prop="dataA" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataA" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差:{{ maxErrorView }}<br/>
|
||||
误差值:{{ scope.row.aError }} {{ unit }}
|
||||
最大误差:{{ maxErrorStr }}<br/>
|
||||
误差值:{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
|
||||
@@ -25,23 +25,16 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="aError" width="92" label="误差值">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <span v-if="scope.row.isDataA === 1">{{scope.row.aError}}</span>-->
|
||||
<!-- <el-tag type="danger" v-if="scope.row.isDataA === 2">{{scope.row.aError}}</el-tag>-->
|
||||
<!-- <span v-if="scope.row.isDataA === 4">/</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table-column>
|
||||
<el-table-column :label="`B(${unit})`">
|
||||
<el-table-column prop="bStd" width="100" label="标准值"/>
|
||||
<el-table-column prop="bData" width="100" label="被检值"/>
|
||||
<el-table-column prop="stdB" width="100" label="标准值"/>
|
||||
<el-table-column prop="dataB" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataB" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差:{{ maxErrorView }}<br/>
|
||||
误差值:{{ scope.row.bError }} {{ unit }}
|
||||
最大误差:{{ maxErrorStr }}<br/>
|
||||
误差值:{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
|
||||
@@ -51,14 +44,14 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`C(${unit})`">
|
||||
<el-table-column prop="cStd" width="100" label="标准值"/>
|
||||
<el-table-column prop="cData" width="100" label="被检值"/>
|
||||
<el-table-column prop="stdC" width="100" label="标准值"/>
|
||||
<el-table-column prop="dataC" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataC" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差: {{ maxErrorView }}<br/>
|
||||
误差值:{{ scope.row.cError }} {{ unit }}
|
||||
最大误差: {{ maxErrorStr }}<br/>
|
||||
误差值:{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
|
||||
@@ -67,27 +60,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="maxError" :label="`最大误差(${unit})`"/>-->
|
||||
<!-- <el-table-column prop="result" label="检测结果" width="88">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>-->
|
||||
<!-- <span v-if="scope.row.result === 1">符合</span>-->
|
||||
<!-- <span v-if="scope.row.result === 4">/</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</template>
|
||||
|
||||
<template v-if="phaseT === 1">
|
||||
<el-table-column :label="`T(${unit})`">
|
||||
<el-table-column prop="tStd" label="标准值"/>
|
||||
<el-table-column prop="tData" label="被检值"/>
|
||||
<el-table-column prop="tError" label="误差值"/>
|
||||
<el-table-column prop="result" label="检测结果">
|
||||
<el-table-column prop="stdT" label="标准值"/>
|
||||
<el-table-column prop="dataT" label="被检值"/>
|
||||
<el-table-column prop="isDataT" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差: {{ maxErrorView }}<br/>
|
||||
误差值:{{ scope.row.tError }} {{ unit }}
|
||||
最大误差: {{ maxErrorStr }}<br/>
|
||||
误差值:{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataT === 2">不符合</el-tag>
|
||||
@@ -125,18 +109,11 @@ const unit = computed(() => {
|
||||
})
|
||||
|
||||
const phaseT = computed(() => {
|
||||
let result = 0;
|
||||
if (tableData.length > 0) {
|
||||
result = !tableData[0].tData ? 0 : 1;
|
||||
}
|
||||
return result;
|
||||
return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1
|
||||
})
|
||||
|
||||
const maxErrorView = computed((data) => {
|
||||
let result = '';
|
||||
if (tableData.length > 0) {
|
||||
result = tableData[0].maxError ? tableData[0].maxError : '';
|
||||
}
|
||||
const maxErrorStr = computed((data) => {
|
||||
let result = tableData[0].maxError ?? '/'
|
||||
let idx = result.indexOf('~');
|
||||
if (idx > 0) {
|
||||
result = result.substring(0, idx) + unit.value + result.substring(idx, result.length) + unit.value;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<div class="data-check-body">
|
||||
<div class="content-left-tree">
|
||||
<div style="width: 190px;">
|
||||
<div style="width: 99%;">
|
||||
<el-input
|
||||
placeholder='请输入测试项名称'
|
||||
clearable
|
||||
@@ -50,12 +50,12 @@
|
||||
|
||||
<div class="content-right">
|
||||
<div class="content-right-title">
|
||||
<div style="width: 680px;">
|
||||
<div style="width: 750px;">
|
||||
<span class="content-right-title-text">当前检测项目:
|
||||
<el-popover trigger="hover" :content="currentDesc? currentDesc : '无'" :width="popoverWidth" placement="right">
|
||||
<el-popover trigger="hover" :content="currentDesc" :width="popoverWidth" placement="right">
|
||||
<template #reference>
|
||||
<el-button type="text" style="font-size: 14px;">
|
||||
{{ currentScriptTypeName ? currentScriptTypeName : '无' }}
|
||||
{{ currentScriptTypeName }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
@@ -164,7 +164,7 @@ let resTableData: { resultData: Map<string, any>, rawData: Map<string, any> } =
|
||||
const checkResultData = reactive<CheckData.CheckResult[]>([])
|
||||
|
||||
const popoverWidth: ComputedRef<string> = computed(() => {
|
||||
return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (harmNumList.length || checkList.length ? 140 : 0)}px`
|
||||
return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (harmNumList.length || checkList.length ? 160 : 0)}px`
|
||||
})
|
||||
|
||||
// 原始数据表格数据
|
||||
@@ -206,9 +206,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
|
||||
updateTreeFly(resTreeDataTemp, 2)
|
||||
|
||||
Object.assign(treeDataAll, resTreeDataTemp)
|
||||
console.log("树数据", treeDataAll)
|
||||
|
||||
// await handleSwitchChange(0)
|
||||
defaultOperate()
|
||||
await updateTableData()
|
||||
}
|
||||
@@ -219,7 +217,13 @@ watch(currentHarmNum, (newVal, oldVal) => {
|
||||
if (newVal !== '-1') {
|
||||
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal.toString())
|
||||
setCheckResultData(resCheckResult)
|
||||
setRawData(resTableData.rawData.get(newVal.toString()))
|
||||
|
||||
let tempRawData = resTableData.rawData.get(newVal.toString())
|
||||
if (tempRawData) {
|
||||
setRawData(tempRawData)
|
||||
} else {
|
||||
setRawData([])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -229,7 +233,13 @@ watch(currentCheckItem, (newVal, oldVal) => {
|
||||
let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间'
|
||||
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(key)
|
||||
setCheckResultData(resCheckResult)
|
||||
setRawData(resTableData.rawData.get(key))
|
||||
|
||||
let tempRawData = resTableData.rawData.get(key)
|
||||
if (tempRawData) {
|
||||
setRawData(tempRawData)
|
||||
} else {
|
||||
setRawData([])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -382,8 +392,10 @@ const close = () => {
|
||||
treeDataAll.length = 0
|
||||
harmNumList.length = 0
|
||||
currentHarmNum.value = '-1'
|
||||
currentCheckItem.value = ''
|
||||
checkResultData.length = 0
|
||||
rawTableData.length = 0
|
||||
checkList.length = 0
|
||||
defaultExpandedKeys = []
|
||||
checkIndex.value = ''
|
||||
activeTab.value = 'resultTab'
|
||||
@@ -394,21 +406,22 @@ const close = () => {
|
||||
};
|
||||
|
||||
const setCheckResultData = (data: CheckData.ResCheckResult) => {
|
||||
console.log("检测结果", data);
|
||||
let result: CheckData.CheckResult[] = []
|
||||
if (data.dataA && data.dataB && data.dataC) {
|
||||
if (data.dataA != null && data.dataB != null && data.dataC != null) {
|
||||
result.push({
|
||||
aStd: numberToFixed(data.dataA?.resultData),
|
||||
aData: numberToFixed(data.dataA?.data),
|
||||
aError: getError(data.dataA?.resultData, data.dataA?.data),
|
||||
isDataA: data.dataA?.isData,
|
||||
bStd: numberToFixed(data.dataB?.resultData),
|
||||
bData: numberToFixed(data.dataB?.data),
|
||||
bError: getError(data.dataB?.resultData, data.dataB?.data),
|
||||
isDataB: data.dataB?.isData,
|
||||
cStd: numberToFixed(data.dataC?.resultData),
|
||||
cData: numberToFixed(data.dataC?.data),
|
||||
cError: getError(data.dataC?.resultData, data.dataC?.data),
|
||||
isDataC: data.dataC?.isData,
|
||||
stdA: numberToFixed(data.dataA.resultData),
|
||||
dataA: numberToFixed(data.dataA.data),
|
||||
errorA: getError(data.dataA.resultData, data.dataA.data),
|
||||
isDataA: data.dataA.isData,
|
||||
stdB: numberToFixed(data.dataB.resultData),
|
||||
dataB: numberToFixed(data.dataB.data),
|
||||
errorB: getError(data.dataB.resultData, data.dataB.data),
|
||||
isDataB: data.dataB.isData,
|
||||
stdC: numberToFixed(data.dataC.resultData),
|
||||
dataC: numberToFixed(data.dataC.data),
|
||||
errorC: getError(data.dataC.resultData, data.dataC.data),
|
||||
isDataC: data.dataC.isData,
|
||||
|
||||
maxError: data.radius,
|
||||
unit: data.unit,
|
||||
@@ -416,35 +429,35 @@ const setCheckResultData = (data: CheckData.ResCheckResult) => {
|
||||
})
|
||||
}
|
||||
|
||||
if (data.dataT) {
|
||||
if (data.dataT != null) {
|
||||
result.push({
|
||||
tStd: numberToFixed(data.dataT?.resultData),
|
||||
tData: numberToFixed(data.dataT?.data),
|
||||
tError: getError(data.dataT?.resultData, data.dataT?.data),
|
||||
stdT: numberToFixed(data.dataT.resultData),
|
||||
dataT: numberToFixed(data.dataT.data),
|
||||
errorT: getError(data.dataT.resultData, data.dataT.data),
|
||||
isDataT: data.dataT?.isData,
|
||||
|
||||
maxError: data.radius,
|
||||
unit: data.unit,
|
||||
result: data.isData,
|
||||
})
|
||||
}
|
||||
console.log("检测结果", result);
|
||||
Object.assign(checkResultData, result)
|
||||
}
|
||||
|
||||
const setRawData = (data: CheckData.RawDataItem[]) => {
|
||||
console.log("原始数据", data)
|
||||
data.forEach((item: CheckData.RawDataItem) => {
|
||||
item.dataA = item.dataA == null || item.dataA == undefined ? '' : Number(item.dataA).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataB = item.dataB == null || item.dataB == undefined ? '' : Number(item.dataB).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataC = item.dataC == null || item.dataC == undefined ? '' : Number(item.dataC).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataT = item.dataT == null || item.dataT == undefined ? '' : Number(item.dataT).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataA = item.dataA == null || item.dataA == undefined ? '/' : Number(item.dataA).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataB = item.dataB == null || item.dataB == undefined ? '/' : Number(item.dataB).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataC = item.dataC == null || item.dataC == undefined ? '/' : Number(item.dataC).toFixed(fixed).replace(/-/g, "")
|
||||
item.dataT = item.dataT == null || item.dataT == undefined ? '/' : Number(item.dataT).toFixed(fixed).replace(/-/g, "")
|
||||
})
|
||||
Object.assign(rawTableData, data)
|
||||
}
|
||||
|
||||
const numberToFixed = (num: number): string => {
|
||||
if (num == null || num == undefined) {
|
||||
return ''
|
||||
return '/'
|
||||
} else {
|
||||
return num.toFixed(fixed).replace(/-/g, "")
|
||||
}
|
||||
@@ -452,7 +465,7 @@ const numberToFixed = (num: number): string => {
|
||||
|
||||
const getError = (num1: number, num2: number): string => {
|
||||
if (num1 == null || num1 == undefined || num2 == null || num2 == undefined) {
|
||||
return ''
|
||||
return '/'
|
||||
}
|
||||
return Math.abs(Number(numberToFixed(num1)) - Number(numberToFixed(num2))).toFixed(fixed)
|
||||
}
|
||||
@@ -574,14 +587,14 @@ defineExpose({
|
||||
align-items: center;
|
||||
max-height: 473px;
|
||||
|
||||
padding: 10px 0;
|
||||
padding: 10px 0.5% 0px 0.5%;
|
||||
border: 1px solid #ccc;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
|
||||
.content-tree {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
margin-top: 10px;
|
||||
|
||||
.custom-tree-node {
|
||||
|
||||
Reference in New Issue
Block a user