2024-11-18 22:04:59 +08:00
|
|
|
|
<template>
|
2025-01-14 11:43:35 +08:00
|
|
|
|
<el-dialog v-model='dialogVisible' title="系数校准" v-bind="dialogBig" width="1550px" @close="handleCancel">
|
2024-12-18 15:49:29 +08:00
|
|
|
|
<div class="test-dialog" >
|
2024-12-05 15:22:46 +08:00
|
|
|
|
<div class="dialog-content">
|
|
|
|
|
|
<div class="right-title">
|
2024-11-21 23:02:43 +08:00
|
|
|
|
<!-- <div>系数校准表</div> -->
|
2024-12-05 21:33:52 +08:00
|
|
|
|
<div>{{ outputDsc }}</div>
|
2024-11-18 22:04:59 +08:00
|
|
|
|
<div>
|
2024-12-05 15:22:46 +08:00
|
|
|
|
<span style=" font-size: 18px;font-weight: 600;">
|
|
|
|
|
|
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> 台/共 <span style="color: green">{{ total }}</span>
|
|
|
|
|
|
台
|
|
|
|
|
|
</span>
|
|
|
|
|
|
<!-- <el-button type="primary" loading
|
|
|
|
|
|
v-if="activeIndex > 0 && activeIndex < activeTotalNum">通道系数已校准3台/共3台</el-button>
|
|
|
|
|
|
<el-button type="primary" :disabled="true" v-if="activeIndex === activeTotalNum">通道系数已校准3台/共3台</el-button> -->
|
2024-11-18 22:04:59 +08:00
|
|
|
|
</div>
|
2024-12-05 15:22:46 +08:00
|
|
|
|
</div>
|
2024-12-20 10:21:36 +08:00
|
|
|
|
<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>
|
2024-12-30 14:43:13 +08:00
|
|
|
|
<span>大电压/电流系数下装</span><br/>
|
2025-01-06 09:21:24 +08:00
|
|
|
|
<span class="spanStyle">源输出为:</span><br/>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<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>
|
2024-12-20 10:21:36 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-step>
|
|
|
|
|
|
<el-step>
|
|
|
|
|
|
<template #title>
|
2024-12-30 14:43:13 +08:00
|
|
|
|
<span>小电压/电流系数下装</span><br/>
|
2025-01-06 09:21:24 +08:00
|
|
|
|
<span class="spanStyle">源输出为:</span><br/>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<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>
|
2024-12-30 14:43:13 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-step>
|
|
|
|
|
|
<el-step>
|
|
|
|
|
|
<template #title>
|
|
|
|
|
|
<span>大电压/电流校准</span><br/>
|
2025-01-06 09:21:24 +08:00
|
|
|
|
<span class="spanStyle">源输出为:</span><br/>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<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>
|
2024-12-30 14:43:13 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-step>
|
|
|
|
|
|
<el-step>
|
|
|
|
|
|
<template #title>
|
|
|
|
|
|
<span>小电压/电流校准</span><br/>
|
2025-01-06 09:21:24 +08:00
|
|
|
|
<span class="spanStyle">源输出为:</span><br/>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<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>
|
2024-12-20 10:21:36 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-step>
|
|
|
|
|
|
<el-step title="结束"/>
|
|
|
|
|
|
</el-steps>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="right-content">
|
2025-01-02 14:17:41 +08:00
|
|
|
|
<el-tabs type="border-card" v-model="editableTabsValue" :active-index="String(activeIndex)" >
|
2025-01-02 13:12:13 +08:00
|
|
|
|
<el-tab-pane v-for="(device, index) in name" :key="index" :label="device">
|
2024-12-20 10:21:36 +08:00
|
|
|
|
<template #label>
|
|
|
|
|
|
<span class="custom-tabs-label">
|
|
|
|
|
|
<span>{{ device }}</span>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<el-icon v-if="errorStates[index]" class ="icon-style" >
|
2024-12-20 10:21:36 +08:00
|
|
|
|
<Failed />
|
|
|
|
|
|
</el-icon>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<channelsTestTable
|
|
|
|
|
|
:tableData="getTableDataForChannel(index)"
|
2025-01-15 09:35:36 +08:00
|
|
|
|
:big_V_loading="big_V_loadingStates"
|
|
|
|
|
|
:curV="CurV">
|
2025-01-08 11:40:12 +08:00
|
|
|
|
</channelsTestTable>
|
2024-12-20 10:21:36 +08:00
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
</div>
|
2024-12-05 15:22:46 +08:00
|
|
|
|
</div>
|
2024-12-20 10:21:36 +08:00
|
|
|
|
</div>
|
2024-12-05 15:22:46 +08:00
|
|
|
|
</div>
|
2024-12-18 15:49:29 +08:00
|
|
|
|
<template #footer>
|
|
|
|
|
|
<div class="dialog-footer">
|
2025-01-08 11:40:12 +08:00
|
|
|
|
<el-button type="primary" @click="handleSubmit" :disabled="isButtonDisabled">开始系数校准</el-button>
|
2024-12-18 15:49:29 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
2024-11-18 22:04:59 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script lang="tsx" setup name="channelsTest">
|
2024-12-20 10:21:36 +08:00
|
|
|
|
import { type Device } from '@/api/device/interface/device';
|
2024-12-23 14:05:53 +08:00
|
|
|
|
import { SuccessFilled, Failed, Message, MessageBox } from '@element-plus/icons-vue'
|
2024-12-20 10:21:36 +08:00
|
|
|
|
import { type Ref, ref, toRef, watch } from 'vue'
|
2024-12-30 19:59:15 +08:00
|
|
|
|
import {dialogBig} from '@/utils/elementBind'
|
2025-01-02 13:12:13 +08:00
|
|
|
|
import { ElMessage, ElMessageBox, TabsPaneContext } from 'element-plus';
|
2025-01-08 11:40:12 +08:00
|
|
|
|
import { getCoefficientCheck } from '@/api/home/channelsTest/index'
|
|
|
|
|
|
import type { ChannelsTest } from '@/api/home/interface/channelsTest';
|
|
|
|
|
|
import type { Plan } from '@/api/plan/interface';
|
2025-01-09 13:56:56 +08:00
|
|
|
|
import { fa } from 'element-plus/es/locale';
|
2024-11-18 22:04:59 +08:00
|
|
|
|
const activeIndex = ref(0)
|
2024-12-05 21:33:52 +08:00
|
|
|
|
const activeTotalNum = ref(4)
|
2024-12-05 15:22:46 +08:00
|
|
|
|
const qualified = ref(0)
|
2024-12-05 21:33:52 +08:00
|
|
|
|
const outputDsc = ref('电压误差为:±0.1Un%; 电流误差为:±0.5%')
|
2024-12-05 15:22:46 +08:00
|
|
|
|
const total = ref(0)
|
2024-12-18 15:49:29 +08:00
|
|
|
|
const dialogVisible = ref(false)
|
2024-12-20 10:21:36 +08:00
|
|
|
|
const active = ref(0)
|
2024-12-30 19:17:39 +08:00
|
|
|
|
let timer1: NodeJS.Timeout | null = null; // 声明并初始化 timer1
|
|
|
|
|
|
let timer2: NodeJS.Timeout | null = null; // 同样声明并初始化 timer2
|
2024-12-30 19:59:15 +08:00
|
|
|
|
const name = ref<string[]>([])//系数校准所选设备名字数组
|
|
|
|
|
|
const channel = ref<number[]>([])//系数校准所选设备通道数组
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const devIdArray = ref<string[]>([])//系数校准所选设备ID数组
|
|
|
|
|
|
const select_Plan = ref<Plan.ReqPlan>()
|
|
|
|
|
|
const planId = ref('')
|
|
|
|
|
|
const isButtonDisabled = ref(false);
|
2025-01-15 09:35:36 +08:00
|
|
|
|
const CurV= ref<number>()//额定电压
|
2024-12-20 10:21:36 +08:00
|
|
|
|
// 在 setup 函数中
|
|
|
|
|
|
const errorStates = ref(new Array(name.value.length).fill(false));
|
2025-01-08 11:40:12 +08:00
|
|
|
|
//const loadingStates = ref(new Array(name.value.length).fill(false)); // 初始化 loading 状态
|
|
|
|
|
|
const big_V_loadingStates = ref(false); // 初始化 大电压大电流下装loading 状态
|
|
|
|
|
|
const small_V_loadingStates = ref(false); // 初始化 小电压小电流下装loading 状态
|
|
|
|
|
|
const big_V_loadingStates2 = ref(false); // 初始化 大电压大电流校准loading 状态
|
|
|
|
|
|
const small_V_loadingStates2 = ref(false); // 初始化 小电压小电流校准loading 状态
|
2025-01-02 14:17:41 +08:00
|
|
|
|
const editableTabsValue = ref('0')
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const big_V_Download = ref('')
|
|
|
|
|
|
const big_I_Download = ref('')
|
|
|
|
|
|
const small_V_Download = ref('')
|
|
|
|
|
|
const small_I_Download = ref('')
|
|
|
|
|
|
const big_V_Adjust = ref('')
|
|
|
|
|
|
const big_I_Adjust = ref('')
|
|
|
|
|
|
const small_V_Adjust = ref('')
|
|
|
|
|
|
const small_I_Adjust = ref('')
|
2025-01-02 13:12:13 +08:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
webMsgSend: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
default: () => ({})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2025-01-08 11:40:12 +08:00
|
|
|
|
|
|
|
|
|
|
const tableDataMap = new Map<number, Ref<ChannelsTest.CoefficientVO[]>>([]);
|
|
|
|
|
|
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
|
2025-01-02 13:12:13 +08:00
|
|
|
|
const webMsgSend = toRef(props, 'webMsgSend');
|
|
|
|
|
|
|
|
|
|
|
|
watch(webMsgSend,function (newValue,oldValue){
|
|
|
|
|
|
switch (newValue.requestId){
|
2025-01-13 08:56:13 +08:00
|
|
|
|
case 'yjc_ytxjy':
|
|
|
|
|
|
switch (newValue.operateCode) {
|
2025-01-15 20:23:05 +08:00
|
|
|
|
case'INIT_GATHER':
|
2025-01-13 08:56:13 +08:00
|
|
|
|
if(newValue.code ==-1){
|
2025-01-15 20:23:05 +08:00
|
|
|
|
ElMessageBox.alert('源未知异常', '初始化失败', {
|
2025-01-13 08:56:13 +08:00
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
|
|
|
|
|
}else if (newValue.code == 10523) {
|
|
|
|
|
|
ElMessageBox.alert('源连接失败', '源连接失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
|
|
|
|
|
TableInit();
|
|
|
|
|
|
}
|
2025-01-13 08:56:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-01-15 09:35:36 +08:00
|
|
|
|
case 'YJC_xujy':
|
|
|
|
|
|
switch (newValue.operateCode) {
|
|
|
|
|
|
case 'OPER_GATHER':
|
|
|
|
|
|
if (newValue.code == 10552) {
|
|
|
|
|
|
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-15 09:35:36 +08:00
|
|
|
|
} else if (newValue.code == 10520) {
|
|
|
|
|
|
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-15 09:35:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'DATA_REQUEST$02':
|
|
|
|
|
|
if (newValue.code == 25003) {
|
|
|
|
|
|
ElMessageBox.alert('相序校验未通过,执行自动关闭,请重新发起检测', '相序校验未通过', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-15 09:35:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-01-08 11:40:12 +08:00
|
|
|
|
case 'yjc_sbtxjy':
|
|
|
|
|
|
switch (newValue.operateCode) {
|
|
|
|
|
|
case 'INIT_GATHER$01':
|
|
|
|
|
|
if (newValue.code == 10550) {
|
|
|
|
|
|
ElMessageBox.alert('设备连接异常', '设备连接异常', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-08 11:40:12 +08:00
|
|
|
|
}else if (newValue.code == 10551) {
|
|
|
|
|
|
ElMessageBox.alert('设备触发报告异常', '设备触发报告异常', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 09:35:36 +08:00
|
|
|
|
TableInit();
|
2025-01-08 11:40:12 +08:00
|
|
|
|
} else if (newValue.code == 10552) {
|
|
|
|
|
|
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-15 09:35:36 +08:00
|
|
|
|
} else if (newValue.code == 10520) {
|
|
|
|
|
|
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-15 09:35:36 +08:00
|
|
|
|
}
|
2025-01-15 20:23:05 +08:00
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'Coefficient_Check':
|
2025-01-15 20:23:05 +08:00
|
|
|
|
console.log("Coefficient_Checkactive",active.value);
|
2025-01-08 11:40:12 +08:00
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
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++;
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
case 'DATA_CHNFACTOR$02'://表格
|
|
|
|
|
|
// 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象
|
|
|
|
|
|
for (let i = 0; i < name.value.length; i++) {
|
|
|
|
|
|
const targetArrayRef = tableDataMap.get(i);
|
|
|
|
|
|
if (targetArrayRef) {
|
|
|
|
|
|
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);
|
|
|
|
|
|
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
|
2025-01-13 18:12:36 +08:00
|
|
|
|
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
|
|
|
|
|
|
if (!isNaN(parseFloat(newValue.data.aVuXi)) && isFinite(newValue.data.aVuXi)) {
|
2025-01-14 19:05:08 +08:00
|
|
|
|
firstCoefficientVO.aVuXi = (parseFloat(newValue.data.aVuXi) / 10000).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
firstCoefficientVO.aVuXi = newValue.data.aVuXi;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
|
|
|
|
|
|
if (!isNaN(parseFloat(newValue.data.bVuXi)) && isFinite(newValue.data.bVuXi)) {
|
2025-01-14 19:05:08 +08:00
|
|
|
|
firstCoefficientVO.bVuXi = (parseFloat(newValue.data.bVuXi) / 10000).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
firstCoefficientVO.bVuXi = newValue.data.bVuXi;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
|
|
|
|
|
|
if (!isNaN(parseFloat(newValue.data.cVuXi)) && isFinite(newValue.data.cVuXi)) {
|
2025-01-14 19:05:08 +08:00
|
|
|
|
firstCoefficientVO.cVuXi = (parseFloat(newValue.data.cVuXi) / 10000).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
firstCoefficientVO.cVuXi = newValue.data.cVuXi;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
|
|
|
|
|
|
if (!isNaN(parseFloat(newValue.data.aIeXi)) && isFinite(newValue.data.aIeXi)) {
|
2025-01-14 19:05:08 +08:00
|
|
|
|
firstCoefficientVO.aIeXi = (parseFloat(newValue.data.aIeXi) / 10000).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
firstCoefficientVO.aIeXi = newValue.data.aIeXi;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
|
|
|
|
|
|
if (!isNaN(parseFloat(newValue.data.bIeXi)) && isFinite(newValue.data.bIeXi)) {
|
2025-01-14 19:05:08 +08:00
|
|
|
|
firstCoefficientVO.bIeXi = (parseFloat(newValue.data.bIeXi) / 10000).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
firstCoefficientVO.bIeXi = newValue.data.bIeXi;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
|
|
|
|
|
|
if (!isNaN(parseFloat(newValue.data.cIeXi)) && isFinite(newValue.data.cIeXi)) {
|
2025-01-14 19:05:08 +08:00
|
|
|
|
firstCoefficientVO.cIeXi = (parseFloat(newValue.data.cIeXi) / 10000).toFixed(4);
|
2025-01-14 16:24:29 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
firstCoefficientVO.cIeXi = newValue.data.cIeXi;
|
|
|
|
|
|
}
|
2025-01-15 09:35:36 +08:00
|
|
|
|
|
|
|
|
|
|
firstCoefficientVO.aV = newValue.data.aV;
|
|
|
|
|
|
firstCoefficientVO.bV = newValue.data.bV;
|
|
|
|
|
|
firstCoefficientVO.cV = newValue.data.cV;
|
|
|
|
|
|
firstCoefficientVO.aI = newValue.data.aI;
|
|
|
|
|
|
firstCoefficientVO.bI = newValue.data.bI;
|
|
|
|
|
|
firstCoefficientVO.cI = newValue.data.cI;
|
2025-01-13 22:42:14 +08:00
|
|
|
|
//console.log(newValue.data.devName + '对象:', firstCoefficientVO);
|
2025-01-08 11:40:12 +08:00
|
|
|
|
activeIndex.value++;
|
|
|
|
|
|
} else {
|
2025-01-14 16:24:29 +08:00
|
|
|
|
//console.log('未找到匹配的'+ newValue.data.devName+'对象');
|
2025-01-08 11:40:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
2025-01-13 22:42:14 +08:00
|
|
|
|
//console.log(newValue.data.devName + '数组为空');
|
2025-01-08 11:40:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
2025-01-13 22:42:14 +08:00
|
|
|
|
//console.log('未找到'+newValue.data.devName+'对应的数组');
|
2025-01-08 11:40:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'socket_timeout':
|
|
|
|
|
|
switch(newValue.operateCode){
|
|
|
|
|
|
case 'VOLTAGE':
|
|
|
|
|
|
ElMessageBox.alert('连接超时!', '连接超时', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 09:35:36 +08:00
|
|
|
|
TableInit();
|
2025-01-08 11:40:12 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'connect':
|
|
|
|
|
|
switch (newValue.operateCode){
|
|
|
|
|
|
case "Source":
|
|
|
|
|
|
ElMessageBox.alert('源服务端连接失败', '源服务端连接失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-08 11:40:12 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case "Dev":
|
|
|
|
|
|
ElMessageBox.alert('设备服务端连接失败', '设备服务端连接失败', {
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
type: 'error',
|
|
|
|
|
|
})
|
2025-01-15 20:23:05 +08:00
|
|
|
|
TableInit();
|
2025-01-08 11:40:12 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2025-01-15 20:23:05 +08:00
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
break;
|
2025-01-13 08:56:13 +08:00
|
|
|
|
}
|
2025-01-02 13:12:13 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2025-01-15 09:35:36 +08:00
|
|
|
|
//出错系数检测初始化
|
|
|
|
|
|
const TableInit = () => {
|
2025-01-15 20:23:05 +08:00
|
|
|
|
console.log("TableInitactive",active.value);
|
2025-01-15 09:35:36 +08:00
|
|
|
|
isButtonDisabled.value = false; // 恢复按钮
|
|
|
|
|
|
for (let i = 0; i < channel.value.length; i++) {
|
|
|
|
|
|
const currentTableData = initializeTableData(dataTemplates, i);
|
|
|
|
|
|
tableDataMap.set(i,currentTableData)
|
2025-01-15 20:23:05 +08:00
|
|
|
|
|
|
|
|
|
|
// const targetArrayRef = tableDataMap.get(i);
|
|
|
|
|
|
// if (targetArrayRef) {
|
|
|
|
|
|
// const targetArray = targetArrayRef.value;
|
|
|
|
|
|
// if (targetArray.length > 0) {
|
|
|
|
|
|
// targetArray.forEach(item => item.loading =false)
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2025-01-15 09:35:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
activeIndex.value = 0
|
|
|
|
|
|
qualified.value = 0
|
|
|
|
|
|
active.value = 0
|
2025-01-15 20:23:05 +08:00
|
|
|
|
|
2025-01-15 09:35:36 +08:00
|
|
|
|
}
|
2025-01-08 11:40:12 +08:00
|
|
|
|
|
|
|
|
|
|
//按行图标转动
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-12-23 14:05:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const dataTemplates : ChannelsTest.CoefficientVO[]= [
|
2024-12-23 15:08:14 +08:00
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '1',
|
|
|
|
|
|
desc: '系数下装',
|
|
|
|
|
|
type:'big',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
|
|
|
|
|
loading:false,
|
2025-01-09 13:56:56 +08:00
|
|
|
|
devName:'',
|
2025-01-15 09:35:36 +08:00
|
|
|
|
aV:'—',
|
|
|
|
|
|
bV:'—',
|
|
|
|
|
|
cV:'—',
|
|
|
|
|
|
aI:'—',
|
|
|
|
|
|
bI:'—',
|
|
|
|
|
|
cI:'—',
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '2',
|
|
|
|
|
|
desc: '系数下装',
|
|
|
|
|
|
type:'small',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
|
|
|
|
|
loading:false,
|
2025-01-09 13:56:56 +08:00
|
|
|
|
devName:'',
|
2025-01-15 09:35:36 +08:00
|
|
|
|
aV:'—',
|
|
|
|
|
|
bV:'—',
|
|
|
|
|
|
cV:'—',
|
|
|
|
|
|
aI:'—',
|
|
|
|
|
|
bI:'—',
|
|
|
|
|
|
cI:'—',
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '3',
|
|
|
|
|
|
desc: '系数校准',
|
|
|
|
|
|
type:'big',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
|
|
|
|
|
loading:false,
|
2025-01-09 13:56:56 +08:00
|
|
|
|
devName:'',
|
2025-01-15 09:35:36 +08:00
|
|
|
|
aV:'—',
|
|
|
|
|
|
bV:'—',
|
|
|
|
|
|
cV:'—',
|
|
|
|
|
|
aI:'—',
|
|
|
|
|
|
bI:'—',
|
|
|
|
|
|
cI:'—',
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '4',
|
|
|
|
|
|
desc: '系数校准',
|
|
|
|
|
|
type:'small',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
|
|
|
|
|
loading:false,
|
2025-01-09 13:56:56 +08:00
|
|
|
|
devName:'',
|
2025-01-15 09:35:36 +08:00
|
|
|
|
aV:'—',
|
|
|
|
|
|
bV:'—',
|
|
|
|
|
|
cV:'—',
|
|
|
|
|
|
aI:'—',
|
|
|
|
|
|
bI:'—',
|
|
|
|
|
|
cI:'—',
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
2024-12-30 14:43:13 +08:00
|
|
|
|
|
2024-12-23 15:08:14 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const dataTemplates2 : ChannelsTest.CoefficientVO[]= [
|
2024-12-23 15:08:14 +08:00
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '1',
|
|
|
|
|
|
desc: '系数下装',
|
|
|
|
|
|
type:'big',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
2025-01-09 13:56:56 +08:00
|
|
|
|
loading:false,
|
|
|
|
|
|
devName:''
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '2',
|
|
|
|
|
|
desc: '系数下装',
|
|
|
|
|
|
type:'small',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
2025-01-09 13:56:56 +08:00
|
|
|
|
loading:false,
|
|
|
|
|
|
devName:''
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '3',
|
|
|
|
|
|
desc: '系数校准',
|
|
|
|
|
|
type:'big',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'不合格',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
2025-01-09 13:56:56 +08:00
|
|
|
|
loading:false,
|
|
|
|
|
|
devName:''
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-01-08 11:40:12 +08:00
|
|
|
|
monitorNum: '4',
|
|
|
|
|
|
desc: '系数校准',
|
|
|
|
|
|
type:'small',
|
|
|
|
|
|
aVuData: '—',
|
|
|
|
|
|
aVuXi:'—',
|
|
|
|
|
|
bVuData: '—',
|
|
|
|
|
|
bVuXi: '—',
|
|
|
|
|
|
cVuData: '—',
|
|
|
|
|
|
cVuXi: '—',
|
|
|
|
|
|
aIeData: '—',
|
|
|
|
|
|
aIeXi: '—',
|
|
|
|
|
|
bIeData: '—',
|
|
|
|
|
|
bIeXi: '—',
|
|
|
|
|
|
cIeData: '—',
|
|
|
|
|
|
cIeXi: '—',
|
2025-01-09 13:56:56 +08:00
|
|
|
|
loading:false,
|
|
|
|
|
|
devName:''
|
2024-12-23 15:08:14 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
2024-12-30 14:43:13 +08:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// 更新错误状态的方法
|
|
|
|
|
|
const updateErrorState = (index: number, hasError: boolean) => {
|
|
|
|
|
|
errorStates.value[index] = hasError;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-12-18 15:49:29 +08:00
|
|
|
|
// 打开弹窗,可能是新增,也可能是编辑
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const open = (selection: Device.ResPqDev[],plan:Plan.ReqPlan) => {
|
2025-01-15 09:35:36 +08:00
|
|
|
|
CurV.value = selection[0]?.devVolt || 57.74;
|
2025-01-08 11:40:12 +08:00
|
|
|
|
isButtonDisabled.value = false; // 恢复按钮
|
|
|
|
|
|
select_Plan.value = plan
|
|
|
|
|
|
planId.value = selection[0]?.planId || '';
|
|
|
|
|
|
devIdArray.value = selection.map(item => item.id);
|
2024-12-20 10:21:36 +08:00
|
|
|
|
name.value = selection.map(item => item.name)
|
|
|
|
|
|
channel.value = selection.map(item => item.devChns)
|
2024-12-18 15:49:29 +08:00
|
|
|
|
dialogVisible.value = true;
|
2024-12-20 10:21:36 +08:00
|
|
|
|
total.value = name.value.length
|
2024-12-23 15:08:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-12-30 14:43:13 +08:00
|
|
|
|
// 初始化 loadingStates 为 false
|
2025-01-08 11:40:12 +08:00
|
|
|
|
// loadingStates.value = new Array(selection.length).fill(false);
|
2024-12-30 14:43:13 +08:00
|
|
|
|
errorStates.value = new Array(selection.length).fill(false);
|
|
|
|
|
|
|
2024-12-23 15:08:14 +08:00
|
|
|
|
for (let i = 0; i < channel.value.length; i++) {
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const currentTableData = initializeTableData(dataTemplates, i);
|
2024-12-23 15:08:14 +08:00
|
|
|
|
tableDataMap.set(i,currentTableData)
|
|
|
|
|
|
}
|
2025-01-13 22:42:14 +08:00
|
|
|
|
//console.log('tableDataMap',tableDataMap);
|
2024-12-20 10:21:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-14 11:43:35 +08:00
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
|
(e: 'quitClicked'): void;
|
2025-01-17 09:25:52 +08:00
|
|
|
|
(e: 'submitClicked'): void;
|
2025-01-14 11:43:35 +08:00
|
|
|
|
}>();
|
|
|
|
|
|
|
2024-12-20 10:21:36 +08:00
|
|
|
|
const handleCancel=() => {
|
|
|
|
|
|
// 清空 name, channel, total
|
|
|
|
|
|
name.value = [];
|
|
|
|
|
|
channel.value = [];
|
|
|
|
|
|
total.value = 0;
|
|
|
|
|
|
activeIndex.value = 0
|
|
|
|
|
|
qualified.value = 0
|
2024-12-20 10:43:43 +08:00
|
|
|
|
active.value = 0
|
2024-12-20 10:21:36 +08:00
|
|
|
|
dialogVisible.value = false
|
2025-01-06 09:21:24 +08:00
|
|
|
|
editableTabsValue.value = '0'
|
2025-01-14 11:43:35 +08:00
|
|
|
|
emit('quitClicked'); // 触发事件
|
2024-12-05 15:22:46 +08:00
|
|
|
|
}
|
2024-12-18 15:49:29 +08:00
|
|
|
|
|
2024-12-20 10:21:36 +08:00
|
|
|
|
const getTableDataForChannel = (index: number): any[] => {
|
|
|
|
|
|
const data = tableDataMap.get(index);
|
|
|
|
|
|
return data ? data.value : [];
|
|
|
|
|
|
}
|
2024-12-18 15:49:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(activeIndex, function (newValue, oldValue) {
|
2024-12-20 10:21:36 +08:00
|
|
|
|
if(activeIndex.value === 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
outputDsc.value = "电压误差为:±0.1Un%; 电流误差为:±0.5%";
|
|
|
|
|
|
// 当前源输出为:Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A"
|
|
|
|
|
|
}
|
2025-01-02 14:17:41 +08:00
|
|
|
|
})
|
2024-12-18 15:49:29 +08:00
|
|
|
|
|
2024-12-20 10:21:36 +08:00
|
|
|
|
// 示例的 checkForErrors 函数,根据实际需求进行调整
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const checkForErrors = (data: ChannelsTest.CoefficientVO[]): boolean => {
|
2024-12-20 10:21:36 +08:00
|
|
|
|
// 这里假设不合格字段的标准是 status 为 '不合格' 或 isValid 为 false
|
|
|
|
|
|
return data.some(item =>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
item.aVuXi === '不合格' ||
|
|
|
|
|
|
item.bVuXi === '不合格' ||
|
|
|
|
|
|
item.cVuXi === '不合格' ||
|
|
|
|
|
|
item.aIeXi === '不合格' ||
|
|
|
|
|
|
item.bIeXi === '不合格' ||
|
|
|
|
|
|
item.cIeXi === '不合格'
|
2024-12-20 10:21:36 +08:00
|
|
|
|
);
|
|
|
|
|
|
};
|
2024-11-18 22:04:59 +08:00
|
|
|
|
|
2024-12-30 14:43:13 +08:00
|
|
|
|
const handleSubmit = async () => {
|
2025-01-08 11:40:12 +08:00
|
|
|
|
isButtonDisabled.value = true; // 禁用按钮
|
|
|
|
|
|
tableLoading('big','系数下装')
|
|
|
|
|
|
await getCoefficientCheck({
|
|
|
|
|
|
userPageId: "cdf",
|
2025-01-13 18:12:36 +08:00
|
|
|
|
devIds:devIdArray.value,
|
2025-01-08 11:40:12 +08:00
|
|
|
|
planId:planId.value,
|
|
|
|
|
|
errorSysId: select_Plan.value?.errorSysId,
|
|
|
|
|
|
scriptId: select_Plan.value?.scriptId,
|
|
|
|
|
|
operateType:'0' // '0'为预检测、‘1‘为正式检测
|
|
|
|
|
|
})
|
|
|
|
|
|
active.value++;
|
2025-01-17 09:25:52 +08:00
|
|
|
|
emit('submitClicked'); // 触发事件
|
2025-01-08 11:40:12 +08:00
|
|
|
|
// 初始化 loadingStates 为 true
|
|
|
|
|
|
// loadingStates.value = new Array(name.value.length).fill(true);
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
2024-12-30 14:43:13 +08:00
|
|
|
|
// 初始化 currentTableData
|
|
|
|
|
|
let isTimer2Completed = false;
|
|
|
|
|
|
|
2025-01-08 11:40:12 +08:00
|
|
|
|
|
|
|
|
|
|
//"80b4b4f52a4c4064a18319525f8ac13c",
|
2025-01-02 13:12:13 +08:00
|
|
|
|
for (let i = 0; i < channel.value.length; i++) {
|
|
|
|
|
|
// 重置状态变量
|
|
|
|
|
|
active.value = 0;
|
|
|
|
|
|
//activeIndex.value = 0;
|
2025-01-02 14:17:41 +08:00
|
|
|
|
editableTabsValue.value = i.toString();
|
2025-01-02 13:12:13 +08:00
|
|
|
|
// 初始化并填充 currentTableData
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const currentTableData = initializeTableData(dataTemplates2, i);
|
2024-12-30 19:59:15 +08:00
|
|
|
|
tableDataMap.set(i, currentTableData);
|
2025-01-02 13:12:13 +08:00
|
|
|
|
//activeIndex.value++;
|
|
|
|
|
|
|
2024-12-30 19:59:15 +08:00
|
|
|
|
// 清除之前的 timer1
|
2024-12-30 19:17:39 +08:00
|
|
|
|
clearInterval(timer1);
|
2025-01-02 13:12:13 +08:00
|
|
|
|
// 启动 timer1
|
2024-12-30 19:59:15 +08:00
|
|
|
|
timer1 = setInterval(() => {
|
|
|
|
|
|
active.value++;
|
|
|
|
|
|
if (active.value > 5) {
|
|
|
|
|
|
clearInterval(timer1);
|
|
|
|
|
|
}
|
2025-01-08 11:40:12 +08:00
|
|
|
|
}, 3000);
|
2024-12-30 14:43:13 +08:00
|
|
|
|
|
2024-12-30 19:59:15 +08:00
|
|
|
|
// 清除之前的 timer2
|
|
|
|
|
|
clearInterval(timer2);
|
|
|
|
|
|
// 启动 timer2
|
|
|
|
|
|
timer2 = setInterval(() => {
|
2025-01-02 13:12:13 +08:00
|
|
|
|
// 初始化并填充 currentTableData
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const currentTableData = initializeTableData(i > 0 ? dataTemplates2 : dataTemplates2, i);
|
2025-01-02 13:12:13 +08:00
|
|
|
|
tableDataMap.set(i, currentTableData);
|
|
|
|
|
|
activeIndex.value++;
|
|
|
|
|
|
|
|
|
|
|
|
clearInterval(timer2);
|
|
|
|
|
|
const currentDataRef = tableDataMap.get(i);
|
|
|
|
|
|
if (currentDataRef) {
|
|
|
|
|
|
const currentData = currentDataRef.value;
|
|
|
|
|
|
// 检查当前数据中有无不合格字段
|
|
|
|
|
|
const hasError = checkForErrors(currentData);
|
|
|
|
|
|
if (hasError) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
qualified.value++;
|
|
|
|
|
|
}
|
|
|
|
|
|
updateErrorState(i, hasError);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 设置标志变量为 true,表示 timer2 已经完成
|
|
|
|
|
|
isTimer2Completed = true;
|
|
|
|
|
|
}, 3000);
|
|
|
|
|
|
|
|
|
|
|
|
// 等待 timer2 完成
|
|
|
|
|
|
while (!isTimer2Completed) {
|
|
|
|
|
|
// 这里可以添加一个短暂的等待,避免死循环
|
|
|
|
|
|
await new Promise(resolve => setTimeout(resolve, 100));
|
2024-12-30 14:43:13 +08:00
|
|
|
|
}
|
2025-01-02 13:12:13 +08:00
|
|
|
|
|
|
|
|
|
|
// 重置标志变量
|
|
|
|
|
|
isTimer2Completed = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 提取初始化并填充 currentTableData 的函数
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: number): Ref<ChannelsTest.CoefficientVO[]> => {
|
|
|
|
|
|
const currentTableData = ref<ChannelsTest.CoefficientVO[]>([]);
|
2025-01-02 13:12:13 +08:00
|
|
|
|
for (let j = 0; j < channel.value[index]; j++) {
|
|
|
|
|
|
templates.forEach((template) => {
|
|
|
|
|
|
// 使用解构赋值排除 id 和 MonitorIdx 属性
|
2025-01-08 11:40:12 +08:00
|
|
|
|
const { devName,monitorNum: __, ...rest } = template;
|
|
|
|
|
|
currentTableData.value.push({
|
|
|
|
|
|
monitorNum: (j + 1).toString(),
|
|
|
|
|
|
devName: name.value[index],
|
2025-01-02 13:12:13 +08:00
|
|
|
|
...rest,
|
2024-12-30 14:43:13 +08:00
|
|
|
|
});
|
2025-01-02 13:12:13 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
return currentTableData;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-18 15:49:29 +08:00
|
|
|
|
// 对外映射
|
|
|
|
|
|
defineExpose({ open })
|
2024-11-18 22:04:59 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
2025-01-08 11:40:12 +08:00
|
|
|
|
|
|
|
|
|
|
/* 确保 el-icon-loading 的动画效果没有被覆盖 */
|
|
|
|
|
|
.loading-box {
|
|
|
|
|
|
animation: rotate 2s linear infinite;
|
|
|
|
|
|
font-size: 30px; /* 增大图标的大小 */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes rotate {
|
|
|
|
|
|
from {
|
|
|
|
|
|
transform: rotate(0deg);
|
|
|
|
|
|
}
|
|
|
|
|
|
to {
|
|
|
|
|
|
transform: rotate(360deg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-05 15:22:46 +08:00
|
|
|
|
.right-title {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
/* 横向排列 */
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.custom-tabs-label .el-icon {
|
2024-11-25 21:11:10 +08:00
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
}
|
2024-12-05 15:22:46 +08:00
|
|
|
|
|
2024-11-25 21:11:10 +08:00
|
|
|
|
.custom-tabs-label span {
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
}
|
2024-12-05 15:22:46 +08:00
|
|
|
|
|
|
|
|
|
|
.dialog-content {
|
2024-12-30 14:43:13 +08:00
|
|
|
|
height: 510px;
|
2024-12-05 11:07:54 +08:00
|
|
|
|
}
|
2024-12-05 15:22:46 +08:00
|
|
|
|
|
2024-12-05 11:07:54 +08:00
|
|
|
|
.el-tabs--border-card {
|
2024-12-20 10:21:36 +08:00
|
|
|
|
height: 470px;
|
2024-12-05 15:22:46 +08:00
|
|
|
|
}
|
2025-01-08 11:40:12 +08:00
|
|
|
|
/* .el-icon svg {
|
|
|
|
|
|
color: #ff7171;
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
.icon-style{
|
2024-12-05 15:22:46 +08:00
|
|
|
|
color: #ff7171;
|
2024-12-05 11:07:54 +08:00
|
|
|
|
}
|
2024-12-20 10:21:36 +08:00
|
|
|
|
.container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dialog-left {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right-content {
|
2025-01-06 09:21:24 +08:00
|
|
|
|
flex: 6;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.spanStyle{
|
|
|
|
|
|
font-size: 14px;
|
2024-12-20 10:21:36 +08:00
|
|
|
|
}
|
2025-01-08 11:40:12 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-11-18 22:04:59 +08:00
|
|
|
|
</style>
|