bug修复

This commit is contained in:
caozehui
2025-04-09 19:30:00 +08:00
parent 9938306884
commit ce74ec4db7
2 changed files with 333 additions and 324 deletions

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog v-model='dialogVisible' title="系数校准" v-bind="dialogBig" width="1550px" @close="handleCancel">
<div class="test-dialog" >
<el-dialog v-model='dialogVisible' title="系数校准" v-bind="dialogBig" width="1550px" @close="handleCancel">
<div class="test-dialog">
<div class="dialog-content">
<div class="right-title">
<!-- <div>系数校准表</div> -->
@@ -16,88 +16,95 @@
</div>
</div>
<div class="container">
<div class="dialog-left">
<el-steps direction="vertical" :active="active" :process-status="currentStepStatus" finish-status="success">
<el-step title="开始" />
<el-step>
<template #title>
<span>大电压/电流系数下装</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 0">{{big_V_Download}}</span><br/>
<span class="spanStyle" v-if="active > 0">{{big_I_Download}}</span>
<el-icon v-if="active === 1 " class="loading-box"><el-icon-loading /></el-icon>
</template>
</el-step>
<el-step>
<template #title>
<span>小电压/电流系数下装</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 1">{{ small_V_Download }}</span><br/>
<span class="spanStyle" v-if="active > 1">{{ small_I_Download }}</span>
<el-icon v-if="active === 2" class="loading-box"><el-icon-loading /></el-icon>
</template>
</el-step>
<el-step>
<template #title>
<span>大电压/电流校准</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 2">{{ big_V_Adjust }}</span><br/>
<span class="spanStyle" v-if="active > 2">{{ big_I_Adjust }}</span>
<el-icon v-if="active === 3" class="loading-box"><el-icon-loading /></el-icon>
</template>
</el-step>
<el-step>
<template #title>
<span>小电压/电流校准</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 3">{{ small_V_Adjust }}</span><br/>
<span class="spanStyle" v-if="active > 3">{{ small_I_Adjust }}</span>
<el-icon v-if="active === 4" class="loading-box"><el-icon-loading /></el-icon>
</template>
</el-step>
<el-step title="结束"/>
</el-steps>
</div>
<div class="right-content">
<el-tabs type="border-card" v-model="editableTabsValue" :active-index="String(activeIndex)" >
<el-tab-pane v-for="(device, index) in name" :key="index" :label="device">
<template #label>
<div class="dialog-left">
<el-steps direction="vertical" :active="active" :process-status="currentStepStatus" finish-status="success">
<el-step title="开始"/>
<el-step>
<template #title>
<span>大电压/电流系数下装</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 0">{{ big_V_Download }}</span><br/>
<span class="spanStyle" v-if="active > 0">{{ big_I_Download }}</span>
<el-icon v-if="active === 1 " class="loading-box">
<el-icon-loading/>
</el-icon>
</template>
</el-step>
<el-step>
<template #title>
<span>小电压/电流系数下装</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 1">{{ small_V_Download }}</span><br/>
<span class="spanStyle" v-if="active > 1">{{ small_I_Download }}</span>
<el-icon v-if="active === 2" class="loading-box">
<el-icon-loading/>
</el-icon>
</template>
</el-step>
<el-step>
<template #title>
<span>大电压/电流校准</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 2">{{ big_V_Adjust }}</span><br/>
<span class="spanStyle" v-if="active > 2">{{ big_I_Adjust }}</span>
<el-icon v-if="active === 3" class="loading-box">
<el-icon-loading/>
</el-icon>
</template>
</el-step>
<el-step>
<template #title>
<span>小电压/电流校准</span><br/>
<span class="spanStyle">源输出为</span><br/>
<span class="spanStyle" v-if="active > 3">{{ small_V_Adjust }}</span><br/>
<span class="spanStyle" v-if="active > 3">{{ small_I_Adjust }}</span>
<el-icon v-if="active === 4" class="loading-box">
<el-icon-loading/>
</el-icon>
</template>
</el-step>
<el-step title="结束"/>
</el-steps>
</div>
<div class="right-content">
<el-tabs type="border-card" v-model="editableTabsValue" :active-index="String(activeIndex)">
<el-tab-pane v-for="(device, index) in name" :key="index" :label="device">
<template #label>
<span class="custom-tabs-label">
<span>{{ device }}</span>
<el-icon v-if="errorStates[index]" class ="icon-style" >
<Failed />
<el-icon v-if="errorStates[index]" class="icon-style">
<Failed/>
</el-icon>
</span>
</template>
<channelsTestTable
:tableData="getTableDataForChannel(index)"
:big_V_loading="big_V_loadingStates"
:curV="CurV">
</template>
<channelsTestTable
:tableData="getTableDataForChannel(index)"
:big_V_loading="big_V_loadingStates"
:curV="CurV">
</channelsTestTable>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</div>
</div>
</div>
<template #footer>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmit" :disabled="isButtonDisabled">开始系数校准</el-button>
</div>
</template>
</template>
</el-dialog>
</template>
<script lang="tsx" setup name="channelsTest">
import { type Device } from '@/api/device/interface/device';
import { SuccessFilled, Failed, Message, MessageBox } from '@element-plus/icons-vue'
import { type Ref, ref, toRef, watch } from 'vue'
import {type Device} from '@/api/device/interface/device';
import {Failed} from '@element-plus/icons-vue'
import {type Ref, ref, toRef, watch} from 'vue'
import {dialogBig} from '@/utils/elementBind'
import { ElMessage, ElMessageBox, TabsPaneContext } from 'element-plus';
import { getCoefficientCheck } from '@/api/home/channelsTest/index'
import type { ChannelsTest } from '@/api/home/interface/channelsTest';
import type { Plan } from '@/api/plan/interface';
import { fa } from 'element-plus/es/locale';
import {ElMessageBox} from 'element-plus';
import {getCoefficientCheck} from '@/api/home/channelsTest/index'
import type {ChannelsTest} from '@/api/home/interface/channelsTest';
import type {Plan} from '@/api/plan/interface';
import {useUserStore} from "@/stores/modules/user";
@@ -116,7 +123,7 @@ const devIdArray = ref<string[]>([])//系数校准所选设备ID数组
const select_Plan = ref<Plan.ReqPlan>()
const planId = ref('')
const isButtonDisabled = ref(false);
const CurV= ref<number>()//额定电压
const CurV = ref<number>()//额定电压
// 在 setup 函数中
const errorStates = ref(new Array(name.value.length).fill(false));
//const loadingStates = ref(new Array(name.value.length).fill(false)); // 初始化 loading 状态
@@ -144,7 +151,7 @@ const tableDataMap = new Map<number, Ref<ChannelsTest.CoefficientVO[]>>([]);
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
const webMsgSend = toRef(props, 'webMsgSend');
watch(webMsgSend,function (newValue,oldValue){
watch(webMsgSend, function (newValue, oldValue) {
if (newValue.code == 10520) {
ElMessageBox.alert('报文解析异常!', '初始化失败', {
confirmButtonText: '确定',
@@ -218,25 +225,25 @@ watch(webMsgSend,function (newValue,oldValue){
})
TableInit();
} else {
switch (newValue.requestId){
switch (newValue.requestId) {
case 'yjc_ytxjy':
switch (newValue.operateCode) {
case'INIT_GATHER':
if(newValue.code ==-1){
if (newValue.code == -1) {
ElMessageBox.alert('源未知异常', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
}else if (newValue.code == 10523) {
} else if (newValue.code == 10523) {
ElMessageBox.alert('源连接失败', '源连接失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
}
}
break;
}
}
break;
case 'YJC_xujy':
switch (newValue.operateCode) {
case 'OPER_GATHER':
@@ -274,7 +281,7 @@ watch(webMsgSend,function (newValue,oldValue){
type: 'error',
})
TableInit();
}else if (newValue.code == 10551) {
} else if (newValue.code == 10551) {
ElMessageBox.alert('设备触发报告异常', '设备触发报告异常', {
confirmButtonText: '确定',
type: 'error',
@@ -296,62 +303,67 @@ watch(webMsgSend,function (newValue,oldValue){
break;
}
break;
break;
case 'Coefficient_Check':
console.log("Coefficient_Checkactive",active.value);
switch (newValue.operateCode){
console.log("Coefficient_Checkactive", active.value);
switch (newValue.operateCode) {
case 'big_start'://大电压,电流下装
big_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
big_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
break;
case 'big_end'://大电压,电流下装
active.value++;
big_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
big_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
tableLoading('small','系数下装')
break;
active.value++;
tableLoading('small', '系数下装')
break;
}
switch (newValue.operateCode){
switch (newValue.operateCode) {
case 'small_start'://小电压,电流下装
small_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
small_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
break;
case 'small_end'://小电压,电流下装
active.value++;
small_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
small_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
tableLoading('big','系数校准')
break;
active.value++;
tableLoading('big', '系数校准')
break;
}
switch (newValue.operateCode){
switch (newValue.operateCode) {
case 'big_comp_start'://大电压,电流校准
big_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
big_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
break;
case 'big_comp_end'://大电压,电流校准
active.value++;
big_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
big_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
tableLoading('small','系数校准')
break;
active.value++;
tableLoading('small', '系数校准')
break;
}
switch (newValue.operateCode){
switch (newValue.operateCode) {
case 'small_comp_start'://小电压,电流校准
small_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
small_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
break;
case 'small_comp_end'://小电压,电流校准
active.value++;
small_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
small_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
active.value++;
active.value++;
active.value++;
for (let i = 0; i < name.value.length; i++) {
const currentDataRef = tableDataMap.get(i);
if (currentDataRef) {
const currentData = currentDataRef.value;
// 检查当前数据中有无不合格字段
const hasError = checkForErrors(currentData);
if (hasError) {
} else {
qualified.value++;
}
updateErrorState(i, hasError);
}
for (let i = 0; i < name.value.length; i++) {
const currentDataRef = tableDataMap.get(i);
if (currentDataRef) {
const currentData = currentDataRef.value;
// 检查当前数据中有无不合格字段
const hasError = checkForErrors(currentData);
if (hasError) {
} else {
qualified.value++;
}
updateErrorState(i, hasError);
}
}
//editableTabsValue.value = (tabNumber.value).toString();//显示下一个tab
isButtonDisabled.value = false; // 恢复按钮
break;
//editableTabsValue.value = (tabNumber.value).toString();//显示下一个tab
isButtonDisabled.value = false; // 恢复按钮
break;
}
switch (newValue.operateCode){
switch (newValue.operateCode) {
case 'DATA_CHNFACTOR$02'://表格
// 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象
for (let i = 0; i < name.value.length; i++) {
@@ -360,9 +372,9 @@ watch(webMsgSend,function (newValue,oldValue){
const targetArray = targetArrayRef.value;
if (targetArray.length > 0) {
const firstCoefficientVO = targetArray.find(item => item.monitorNum === newValue.data.monitorNum &&
item.type === newValue.data.type &&
item.desc === newValue.data.desc &&
item.devName === newValue.data.devName);
item.type === newValue.data.type &&
item.desc === newValue.data.desc &&
item.devName === newValue.data.devName);
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
@@ -432,60 +444,60 @@ watch(webMsgSend,function (newValue,oldValue){
}
break;
}
break;
break;
case 'socket_timeout':
switch(newValue.operateCode){
case 'VOLTAGE':
switch (newValue.operateCode) {
case 'VOLTAGE':
ElMessageBox.alert('连接超时!', '连接超时', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
break;
confirmButtonText: '确定',
type: 'error',
})
TableInit();
break;
}
break;
break;
case 'connect':
switch (newValue.operateCode){
switch (newValue.operateCode) {
case "Source":
ElMessageBox.alert('源服务端连接失败', '源服务端连接失败', {
confirmButtonText: '确定',
type: 'error',
})
confirmButtonText: '确定',
type: 'error',
})
TableInit();
break;
case "Dev":
ElMessageBox.alert('设备服务端连接失败', '设备服务端连接失败', {
confirmButtonText: '确定',
type: 'error',
})
confirmButtonText: '确定',
type: 'error',
})
TableInit();
break;
}
break;
break;
}
}
})
//出错系数检测初始化
const TableInit = () => {
console.log("TableInitactive",active.value);
isButtonDisabled.value = false; // 恢复按钮
for (let i = 0; i < channel.value.length; i++) {
const currentTableData = initializeTableData(dataTemplates, i);
tableDataMap.set(i,currentTableData)
console.log("TableInitactive", active.value);
isButtonDisabled.value = false; // 恢复按钮
for (let i = 0; i < channel.value.length; i++) {
const currentTableData = initializeTableData(dataTemplates, i);
tableDataMap.set(i, currentTableData)
// const targetArrayRef = tableDataMap.get(i);
// if (targetArrayRef) {
// const targetArray = targetArrayRef.value;
// if (targetArray.length > 0) {
// targetArray.forEach(item => item.loading =false)
// }
// }
}
activeIndex.value = 0
qualified.value = 0
active.value = 0
// const targetArrayRef = tableDataMap.get(i);
// if (targetArrayRef) {
// const targetArray = targetArrayRef.value;
// if (targetArray.length > 0) {
// targetArray.forEach(item => item.loading =false)
// }
// }
}
activeIndex.value = 0
qualified.value = 0
active.value = 0
}
@@ -493,30 +505,30 @@ const TableInit = () => {
const tableLoading = (type: string, desc: string) => {
for (let i = 0; i < channel.value.length; i++) {
const targetArrayRef = tableDataMap.get(i);
if (targetArrayRef) {
const targetArray = targetArrayRef.value;
if (targetArray.length > 0) {
for (let j = 0; j < channel.value[i]; j++) {
const firstCoefficientVO = targetArray.find(item => item.monitorNum === (j + 1).toString() &&
item.type === type &&
item.desc === desc);
if (firstCoefficientVO){
firstCoefficientVO.loading = true;
}
}
}
const targetArrayRef = tableDataMap.get(i);
if (targetArrayRef) {
const targetArray = targetArrayRef.value;
if (targetArray.length > 0) {
for (let j = 0; j < channel.value[i]; j++) {
const firstCoefficientVO = targetArray.find(item => item.monitorNum === (j + 1).toString() &&
item.type === type &&
item.desc === desc);
if (firstCoefficientVO) {
firstCoefficientVO.loading = true;
}
}
}
}
}
}
const dataTemplates : ChannelsTest.CoefficientVO[]= [
const dataTemplates: ChannelsTest.CoefficientVO[] = [
{
monitorNum: '1',
desc: '系数下装',
type:'big',
type: 'big',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -527,21 +539,21 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:'',
aV:'—',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
loading: false,
devName: '',
aV: '—',
bV: '—',
cV: '—',
aI: '—',
bI: '—',
cI: '—',
},
{
monitorNum: '2',
desc: '系数下装',
type:'small',
type: 'small',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -552,21 +564,21 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:'',
aV:'—',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
loading: false,
devName: '',
aV: '—',
bV: '—',
cV: '—',
aI: '—',
bI: '—',
cI: '—',
},
{
monitorNum: '3',
desc: '系数校准',
type:'big',
type: 'big',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -577,21 +589,21 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:'',
aV:'—',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
loading: false,
devName: '',
aV: '—',
bV: '—',
cV: '—',
aI: '—',
bI: '—',
cI: '—',
},
{
monitorNum: '4',
desc: '系数校准',
type:'small',
type: 'small',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -602,25 +614,25 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:'',
aV:'—',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
loading: false,
devName: '',
aV: '—',
bV: '—',
cV: '—',
aI: '—',
bI: '—',
cI: '—',
},
];
const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
const dataTemplates2: ChannelsTest.CoefficientVO[] = [
{
monitorNum: '1',
desc: '系数下装',
type:'big',
type: 'big',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -631,15 +643,15 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:''
loading: false,
devName: ''
},
{
monitorNum: '2',
desc: '系数下装',
type:'small',
type: 'small',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -650,15 +662,15 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:''
loading: false,
devName: ''
},
{
monitorNum: '3',
desc: '系数校准',
type:'big',
type: 'big',
aVuData: '—',
aVuXi:'不合格',
aVuXi: '不合格',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -669,15 +681,15 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:''
loading: false,
devName: ''
},
{
monitorNum: '4',
desc: '系数校准',
type:'small',
type: 'small',
aVuData: '—',
aVuXi:'—',
aVuXi: '—',
bVuData: '—',
bVuXi: '—',
cVuData: '—',
@@ -688,8 +700,8 @@ const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
bIeXi: '—',
cIeData: '—',
cIeXi: '—',
loading:false,
devName:''
loading: false,
devName: ''
},
];
@@ -699,51 +711,51 @@ const updateErrorState = (index: number, hasError: boolean) => {
errorStates.value[index] = hasError;
};
// 打开弹窗,可能是新增,也可能是编辑
const open = (selection: Device.ResPqDev[],plan:Plan.ReqPlan) => {
CurV.value = selection[0]?.devVolt || 57.74;
isButtonDisabled.value = false; // 恢复按钮
select_Plan.value = plan
planId.value = selection[0]?.planId || '';
devIdArray.value = selection.map(item => item.id);
name.value = selection.map(item => item.name)
channel.value = selection.map(item => item.devChns)
dialogVisible.value = true;
total.value = name.value.length
// 打开弹窗,可能是新增,也可能是编辑
const open = (selection: Device.ResPqDev[], plan: Plan.ReqPlan) => {
CurV.value = selection[0]?.devVolt || 57.74;
isButtonDisabled.value = false; // 恢复按钮
select_Plan.value = plan
planId.value = selection[0]?.planId || '';
devIdArray.value = selection.map(item => item.id);
name.value = selection.map(item => item.name)
channel.value = selection.map(item => item.devChns)
dialogVisible.value = true;
total.value = name.value.length
// 初始化 loadingStates 为 false
// loadingStates.value = new Array(selection.length).fill(false);
errorStates.value = new Array(selection.length).fill(false);
// 初始化 loadingStates 为 false
// loadingStates.value = new Array(selection.length).fill(false);
errorStates.value = new Array(selection.length).fill(false);
for (let i = 0; i < channel.value.length; i++) {
const currentTableData = initializeTableData(dataTemplates, i);
tableDataMap.set(i,currentTableData)
}
//console.log('tableDataMap',tableDataMap);
for (let i = 0; i < channel.value.length; i++) {
const currentTableData = initializeTableData(dataTemplates, i);
tableDataMap.set(i, currentTableData)
}
//console.log('tableDataMap',tableDataMap);
}
const emit = defineEmits<{
(e: 'quitClicked'): void;
(e: 'submitClicked', callback: (resolve: (value: boolean) => void) => void): void;
}>();
const emit = defineEmits<{
(e: 'quitClicked'): void;
(e: 'submitClicked', callback: (resolve: (value: boolean) => void) => void): void;
}>();
const handleCancel=() => {
const handleCancel = () => {
//dataSocket.socketServe.closeWs()
// 清空 name, channel, total
name.value = [];
channel.value = [];
total.value = 0;
activeIndex.value = 0
qualified.value = 0
active.value = 0
dialogVisible.value = false
editableTabsValue.value = '0'
emit('quitClicked'); // 触发事件
}
//dataSocket.socketServe.closeWs()
// 清空 name, channel, total
name.value = [];
channel.value = [];
total.value = 0;
activeIndex.value = 0
qualified.value = 0
active.value = 0
dialogVisible.value = false
editableTabsValue.value = '0'
emit('quitClicked'); // 触发事件
}
const getTableDataForChannel = (index: number): any[] => {
const data = tableDataMap.get(index);
@@ -752,28 +764,27 @@ const getTableDataForChannel = (index: number): any[] => {
watch(activeIndex, function (newValue, oldValue) {
if(activeIndex.value === 1)
{
outputDsc.value = "电压误差为±0.1Un% 电流误差为±0.5%";
// 当前源输出为Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A"
}
if (activeIndex.value === 1) {
outputDsc.value = "电压误差为±0.1Un% 电流误差为±0.5%";
// 当前源输出为Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A"
}
})
// 示例的 checkForErrors 函数,根据实际需求进行调整
const checkForErrors = (data: ChannelsTest.CoefficientVO[]): boolean => {
// 这里假设不合格字段的标准是 status 为 '不合格' 或 isValid 为 false
return data.some(item =>
item.aVuXi === '不合格' ||
item.bVuXi === '不合格' ||
item.cVuXi === '不合格' ||
item.aIeXi === '不合格' ||
item.bIeXi === '不合格' ||
item.cIeXi === '不合格'
item.aVuXi === '不合格' ||
item.bVuXi === '不合格' ||
item.cVuXi === '不合格' ||
item.aIeXi === '不合格' ||
item.bIeXi === '不合格' ||
item.cIeXi === '不合格'
);
};
const handleSubmit = async () => {
// 创建一个 Promise 来等待父组件的回调
// 创建一个 Promise 来等待父组件的回调
const response = await new Promise<boolean>((resolve) => {
emit('submitClicked', resolve);
});
@@ -783,16 +794,16 @@ const handleSubmit = async () => {
}
isButtonDisabled.value = true; // 禁用按钮
tableLoading('big','系数下装')
tableLoading('big', '系数下装')
await getCoefficientCheck({
userPageId: "cdf",
devIds:devIdArray.value,
planId:planId.value,
errorSysId:select_Plan.value?.errorSysId,
scriptId:select_Plan.value?.scriptId,
operateType:'0', // '0'为预检测、1为正式检测
userId:userStore.userInfo.id
})
userPageId: "cdf",
devIds: devIdArray.value,
planId: planId.value,
errorSysId: select_Plan.value?.errorSysId,
scriptId: select_Plan.value?.scriptId,
operateType: '0', // '0'为预检测、1为正式检测
userId: userStore.userInfo.id
})
active.value++;
// 初始化 loadingStates 为 true
@@ -866,11 +877,11 @@ const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: num
const currentTableData = ref<ChannelsTest.CoefficientVO[]>([]);
for (let j = 0; j < channel.value[index]; j++) {
templates.forEach((template) => {
// 使用解构赋值排除 id 和 MonitorIdx 属性
const { devName,monitorNum: __, ...rest } = template;
currentTableData.value.push({
monitorNum: (j + 1).toString(),
devName: name.value[index],
// 使用解构赋值排除 id 和 MonitorIdx 属性
const {devName, monitorNum: __, ...rest} = template;
currentTableData.value.push({
monitorNum: (j + 1).toString(),
devName: name.value[index],
...rest,
});
});
@@ -879,8 +890,8 @@ const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: num
};
// 对外映射
defineExpose({ open })
// 对外映射
defineExpose({open})
</script>
<style scoped>
@@ -906,6 +917,7 @@ const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: num
justify-content: space-between;
margin-bottom: 10px;
}
.custom-tabs-label .el-icon {
vertical-align: middle;
}
@@ -922,13 +934,15 @@ const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: num
.el-tabs--border-card {
height: 470px;
}
/* .el-icon svg {
color: #ff7171;
} */
.icon-style{
.icon-style {
color: #ff7171;
}
.container {
display: flex;
}
@@ -941,7 +955,7 @@ const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: num
flex: 6;
}
.spanStyle{
.spanStyle {
font-size: 14px;
}

View File

@@ -344,12 +344,7 @@ const sendPause = () => {
console.log('发起暂停请求')
TestStatus.value = 'paused_ing'
pauseTest().then(res => {
Object.assign(webMsgSend.value, {
requestId: 'preStopTest',
operateCode: 'stop'
})
})
pauseTest()
// setTimeout(() => {
// Object.assign(webMsgSend.value, {
// requestId: 'preStopTest',