This commit is contained in:
caozehui
2025-03-31 13:22:57 +08:00
parent e7348107d0
commit 56d035253b
5 changed files with 50 additions and 20 deletions

View File

@@ -21,6 +21,7 @@ export namespace CheckData {
isData?: number, isData?: number,
//最大误差值 //最大误差值
radius?: string, radius?: string,
unit?: string,
} }
/** /**
@@ -51,21 +52,25 @@ export namespace CheckData {
errorA?: string, errorA?: string,
maxErrorA?: string, maxErrorA?: string,
isDataA?: number, isDataA?: number,
unitA?: string,
stdB?: string, stdB?: string,
dataB?: string, dataB?: string,
errorB?: string, errorB?: string,
maxErrorB?: string, maxErrorB?: string,
isDataB?: number, isDataB?: number,
unitB?: string,
stdC?: string, stdC?: string,
dataC?: string, dataC?: string,
errorC?: string, errorC?: string,
maxErrorC?: string, maxErrorC?: string,
isDataC?: number, isDataC?: number,
unitC?: string,
stdT?: string, stdT?: string,
dataT?: string, dataT?: string,
errorT?: string, errorT?: string,
maxErrorT?: string, maxErrorT?: string,
isDataT?: number, isDataT?: number,
unitT?: string,
//最大误差值 //最大误差值
maxError?: string, maxError?: string,

View File

@@ -10,14 +10,14 @@
<!-- </el-table-column>--> <!-- </el-table-column>-->
<template v-if="phaseT === 0"> <template v-if="phaseT === 0">
<el-table-column label="A相"> <el-table-column label="A相">
<el-table-column prop="stdA" width="105" :label="'标准值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="stdA" width="105" :label="'标准值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="dataA" width="105" :label="'被检值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataA" width="105" :label="'被检值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="isDataA" label="检测结果"> <el-table-column prop="isDataA" label="检测结果">
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
误差范围{{ scope.row.maxErrorA }} <br/> 误差范围{{ scope.row.maxErrorA }} <br/>
误差值{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? unit : '' }} 误差值{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? innerUnitA : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
<el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag> <el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
@@ -28,14 +28,14 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="B相"> <el-table-column label="B相">
<el-table-column prop="stdB" width="105" :label="'标准值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="stdB" width="105" :label="'标准值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="dataB" width="105" :label="'被检值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataB" width="105" :label="'被检值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="isDataB" label="检测结果"> <el-table-column prop="isDataB" label="检测结果">
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
误差范围{{ scope.row.maxErrorB }}<br/> 误差范围{{ scope.row.maxErrorB }}<br/>
误差值{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? unit : '' }} 误差值{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? innerUnitB : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
<el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag> <el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
@@ -46,14 +46,14 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="C相"> <el-table-column label="C相">
<el-table-column prop="stdC" width="105" :label="'标准值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="stdC" width="105" :label="'标准值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="dataC" width="105" :label="'被检值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataC" width="105" :label="'被检值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="isDataC" label="检测结果"> <el-table-column prop="isDataC" label="检测结果">
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
误差范围 {{ scope.row.maxErrorC }}<br/> 误差范围 {{ scope.row.maxErrorC }}<br/>
误差值{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? unit : '' }} 误差值{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? innerUnitC : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
<el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag> <el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
@@ -67,14 +67,14 @@
<template v-if="phaseT === 1"> <template v-if="phaseT === 1">
<el-table-column :label="tableHeader"> <el-table-column :label="tableHeader">
<el-table-column prop="stdT" :label="'标准值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="stdT" :label="'标准值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="dataT" :label="'被检值'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataT" :label="'被检值'+(outerUnit==''?'':''+outerUnit+'')"/>
<el-table-column prop="isDataT" label="检测结果"> <el-table-column prop="isDataT" label="检测结果">
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
误差范围 {{ scope.row.maxErrorT }}<br/> 误差范围 {{ scope.row.maxErrorT }}<br/>
误差值{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? unit : '' }} 误差值{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? innerUnitT : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>
<el-tag type="danger" v-if="scope.row.isDataT === 2">不符合</el-tag> <el-tag type="danger" v-if="scope.row.isDataT === 2">不符合</el-tag>
@@ -109,10 +109,23 @@ const {tableData, currentScriptTypeName} = defineProps<{
}>(); }>();
const unit = computed(() => { const outerUnit = computed(() => {
return tableData.length > 0 ? tableData[0].unit : ''; return tableData.length > 0 ? tableData[0].unit : '';
}) })
const innerUnitA = computed(() => {
return tableData.length > 0 ? tableData[0].unitA : '';
})
const innerUnitB = computed(() => {
return tableData.length > 0 ? tableData[0].unitB : '';
})
const innerUnitC = computed(() => {
return tableData.length > 0 ? tableData[0].unitC : '';
})
const innerUnitT = computed(() => {
return tableData.length > 0 ? tableData[0].unitT : '';
})
const phaseT = computed(() => { const phaseT = computed(() => {
return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1 return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1
}) })
@@ -129,7 +142,7 @@ const tableHeader = computed(() => {
// let result = tableData[0].maxError ?? '/' // let result = tableData[0].maxError ?? '/'
// let idx = result.indexOf('~'); // let idx = result.indexOf('~');
// if (idx > 0) { // if (idx > 0) {
// result = result.substring(0, idx) + unit.value + result.substring(idx, result.length) + unit.value; // result = result.substring(0, idx) + outerUnit.value + result.substring(idx, result.length) + outerUnit.value;
// } // }
// return result; // return result;
// }) // })

View File

@@ -526,18 +526,21 @@ const setCheckResultData = (data: CheckData.ResCheckResult | null) => {
stdA: numberToFixed(data.dataA.resultData), stdA: numberToFixed(data.dataA.resultData),
dataA: numberToFixed(data.dataA.data), dataA: numberToFixed(data.dataA.data),
errorA: numberToFixed(data.dataA.errorData), errorA: numberToFixed(data.dataA.errorData),
maxErrorA: toMaxErrorStr(data.dataA.radius, data.unit), maxErrorA: toMaxErrorStr(data.dataA.radius, data.dataA.unit),
unitA: data.dataA.unit,
isDataA: data.dataA.isData, isDataA: data.dataA.isData,
stdB: numberToFixed(data.dataB.resultData), stdB: numberToFixed(data.dataB.resultData),
dataB: numberToFixed(data.dataB.data), dataB: numberToFixed(data.dataB.data),
errorB: numberToFixed(data.dataB.errorData), errorB: numberToFixed(data.dataB.errorData),
maxErrorB: toMaxErrorStr(data.dataB.radius, data.unit), maxErrorB: toMaxErrorStr(data.dataB.radius, data.dataB.unit),
isDataB: data.dataB.isData, isDataB: data.dataB.isData,
unitB: data.dataB.unit,
stdC: numberToFixed(data.dataC.resultData), stdC: numberToFixed(data.dataC.resultData),
dataC: numberToFixed(data.dataC.data), dataC: numberToFixed(data.dataC.data),
errorC: numberToFixed(data.dataC.errorData), errorC: numberToFixed(data.dataC.errorData),
maxErrorC: toMaxErrorStr(data.dataC.radius, data.unit), maxErrorC: toMaxErrorStr(data.dataC.radius, data.dataC.unit),
isDataC: data.dataC.isData, isDataC: data.dataC.isData,
unitC: data.dataC.unit,
maxError: data.radius, maxError: data.radius,
unit: data.unit, unit: data.unit,
@@ -550,8 +553,9 @@ const setCheckResultData = (data: CheckData.ResCheckResult | null) => {
stdT: numberToFixed(data.dataT.resultData), stdT: numberToFixed(data.dataT.resultData),
dataT: numberToFixed(data.dataT.data), dataT: numberToFixed(data.dataT.data),
errorT: numberToFixed(data.dataT.errorData), errorT: numberToFixed(data.dataT.errorData),
maxErrorT: toMaxErrorStr(data.dataT.radius, data.unit), maxErrorT: toMaxErrorStr(data.dataT.radius, data.dataT.unit),
isDataT: data.dataT?.isData, isDataT: data.dataT?.isData,
unitT: data.dataT.unit,
maxError: data.radius, maxError: data.radius,
unit: data.unit, unit: data.unit,

View File

@@ -26,7 +26,7 @@
<el-form-item label="状态" prop="enable" > <el-form-item label="状态" prop="enable" >
<el-select v-model='formContent.enable' placeholder="请选择状态"> <el-select v-model='formContent.enable' placeholder="请选择状态">
<el-option label="启用" :value="1"></el-option> <el-option label="启用" :value="1"></el-option>
<el-option label="不启用" :value="0"></el-option> <el-option label="用" :value="0"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@@ -27,7 +27,7 @@
<ErrorStandardPopup :refresh-table='proTable?.getTableList' ref='errorStandardPopup' /> <ErrorStandardPopup :refresh-table='proTable?.getTableList' ref='errorStandardPopup' />
</template> </template>
<script setup lang="ts" name='useProTable'> <script setup lang="tsx" name='useProTable'>
import ProTable from '@/components/ProTable/index.vue' import ProTable from '@/components/ProTable/index.vue'
import type { ColumnProps, ProTableInstance } from '@/components/ProTable/interface' import type { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
import { CirclePlus, Delete,EditPen,View} from '@element-plus/icons-vue' import { CirclePlus, Delete,EditPen,View} from '@element-plus/icons-vue'
@@ -73,6 +73,14 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
search: { el: 'select', props: { filterable: true } }, search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'name', value: 'id' }, fieldNames: { label: 'name', value: 'id' },
}, },
{
prop: 'enable',
label: '启用状态',
width: 120,
render: scope => {
return (scope.row.enable ? <el-tag type='success'>启用</el-tag> : <el-tag type='danger'>停用</el-tag>)
},
},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,}, { prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
]) ])