This commit is contained in:
sjl
2025-01-15 09:35:36 +08:00
parent 0cace11975
commit 14e5535fd8
21 changed files with 206 additions and 36 deletions

View File

@@ -71,7 +71,8 @@
</template>
<channelsTestTable
:tableData="getTableDataForChannel(index)"
:big_V_loading="big_V_loadingStates">
:big_V_loading="big_V_loadingStates"
:curV="CurV">
</channelsTestTable>
</el-tab-pane>
</el-tabs>
@@ -112,6 +113,7 @@ const devIdArray = ref<string[]>([])//系数校准所选设备ID数组
const select_Plan = ref<Plan.ReqPlan>()
const planId = ref('')
const isButtonDisabled = ref(false);
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 状态
@@ -152,6 +154,33 @@ watch(webMsgSend,function (newValue,oldValue){
}
}
break;
case 'YJC_xujy':
switch (newValue.operateCode) {
case 'OPER_GATHER':
if (newValue.code == 10552) {
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
} else if (newValue.code == 10520) {
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
confirmButtonText: '确定',
type: 'error',
})
}
TableInit();
break;
case 'DATA_REQUEST$02':
if (newValue.code == 25003) {
ElMessageBox.alert('相序校验未通过,执行自动关闭,请重新发起检测', '相序校验未通过', {
confirmButtonText: '确定',
type: 'error',
})
}
TableInit();
break;
}
break;
case 'yjc_sbtxjy':
switch (newValue.operateCode) {
case 'INIT_GATHER$01':
@@ -165,12 +194,19 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10552) {
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
}
} else if (newValue.code == 10520) {
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
confirmButtonText: '确定',
type: 'error',
})
}
TableInit();
break;
}
break;
@@ -287,6 +323,13 @@ watch(webMsgSend,function (newValue,oldValue){
} else {
firstCoefficientVO.cIeXi = newValue.data.cIeXi;
}
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;
//console.log(newValue.data.devName + '对象:', firstCoefficientVO);
activeIndex.value++;
} else {
@@ -309,6 +352,7 @@ watch(webMsgSend,function (newValue,oldValue){
confirmButtonText: '确定',
type: 'error',
})
TableInit();
break;
}
break;
@@ -327,11 +371,22 @@ watch(webMsgSend,function (newValue,oldValue){
})
break;
}
TableInit();
break;
}
})
//出错系数检测初始化
const TableInit = () => {
isButtonDisabled.value = false; // 恢复按钮
for (let i = 0; i < channel.value.length; i++) {
const currentTableData = initializeTableData(dataTemplates, i);
tableDataMap.set(i,currentTableData)
}
activeIndex.value = 0
qualified.value = 0
active.value = 0
}
//按行图标转动
const tableLoading = (type: string, desc: string) => {
@@ -373,7 +428,12 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
cIeXi: '—',
loading:false,
devName:'',
reason:'',
aV:'',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
},
{
monitorNum: '2',
@@ -393,7 +453,12 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
cIeXi: '—',
loading:false,
devName:'',
reason:'',
aV:'',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
},
{
monitorNum: '3',
@@ -413,7 +478,12 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
cIeXi: '—',
loading:false,
devName:'',
reason:'',
aV:'',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
},
{
monitorNum: '4',
@@ -433,7 +503,12 @@ const dataTemplates : ChannelsTest.CoefficientVO[]= [
cIeXi: '—',
loading:false,
devName:'',
reason:'',
aV:'',
bV:'—',
cV:'—',
aI:'—',
bI:'—',
cI:'—',
},
];
@@ -525,6 +600,7 @@ const updateErrorState = (index: number, hasError: boolean) => {
// 打开弹窗,可能是新增,也可能是编辑
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 || '';