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 || '';

View File

@@ -27,8 +27,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电压L1系数校准不合格原因'+scope.row.aVuData"
>
<template #content>
误差范围 {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}<br/>
误差值{{ scope.row.aV }}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.aVuXi }}
</el-tag>
@@ -38,8 +41,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电压L1系数校准合格原因'+scope.row.aVuData"
>
<template #content>
误差范围 {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}<br/>
误差值{{ scope.row.aV }}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.aVuXi }}</el-tag>
</el-tooltip>
<!-- <el-tag type="danger" v-if="scope.row.aVuXi === '不合格'">
@@ -72,8 +78,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电压L2系数校准不合格原因'+scope.row.bVuData"
>
<template #content>
误差范围 {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}<br/>
误差值{{ scope.row.bV }}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.bVuXi }}
</el-tag>
@@ -83,8 +92,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电压L2系数校准合格原因'+scope.row.bVuData"
>
<template #content>
误差范围 {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}<br/>
误差值{{ scope.row.bV }}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.bVuXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.bVuXi === '—'&& scope.row.loading" class="loading-box">
@@ -111,8 +123,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电压L3系数校准不合格原因'+scope.row.cVuData"
>
<template #content>
误差范围 {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}<br/>
误差值{{ scope.row.cV }}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.cVuXi }}
</el-tag>
@@ -122,8 +137,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电压L3系数校准合格原因'+scope.row.cVuData"
>
<template #content>
误差范围 {{ (-0.1 * props.curV).toFixed(4) + '~' + (0.1 * props.curV).toFixed(4)}}<br/>
误差值{{ scope.row.cV }}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.cVuXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.cVuXi === '—'&& scope.row.loading" class="loading-box">
@@ -152,8 +170,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电流L1系数校准不合格原因'+scope.row.aIeData"
>
<template #content>
误差范围 {{ -0.5 + "~" +0.5 }}<br/>
误差值{{ scope.row.aI }}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.aIeXi }}
</el-tag>
@@ -163,8 +184,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电流L1系数校准合格原因'+scope.row.aIeData"
>
<template #content>
误差范围 {{ -0.5 + "~" +0.5 }}<br/>
误差值{{ scope.row.aI }}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.aIeXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.aIeXi === '—'&& scope.row.loading" class="loading-box">
@@ -191,8 +215,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电流L2系数校准不合格原因'+scope.row.bIeData"
>
<template #content>
误差范围 {{ -0.5 + "~" +0.5 }}<br/>
误差值{{ scope.row.bI }}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.bIeXi }}
</el-tag>
@@ -202,8 +229,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电流L2系数校准合格原因'+scope.row.bIeData"
>
<template #content>
误差范围 {{ -0.5 + "~" +0.5 }}<br/>
误差值{{ scope.row.bI }}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.bIeXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.bIeXi === '—'&& scope.row.loading" class="loading-box">
@@ -230,8 +260,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电流L3系数校准不合格原因'+scope.row.cIeData"
>
<template #content>
误差范围 {{ -0.5 + "~" +0.5 }}<br/>
误差值{{ scope.row.cI }}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.cIeXi }}
</el-tag>
@@ -241,8 +274,11 @@
class="item"
effect="dark"
placement="bottom-start"
:content="'电流L3系数校准合格原因'+scope.row.cIeData"
>
<template #content>
误差范围 {{ -0.5 + "~" +0.5 }}<br/>
误差值{{ scope.row.cI }}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.cIeXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.cIeXi === '—'&& scope.row.loading" class="loading-box">
@@ -257,13 +293,22 @@
</template>
<script lang="ts" setup name="ErrorSystemDialog">
import { defineProps } from 'vue';
import { defineProps, type PropType } from 'vue';
import { ElIcon, ElLoading, ElTag } from 'element-plus';
import type { ChannelsTest } from '@/api/home/interface/channelsTest';
import { number } from 'echarts';
const props = defineProps<{
tableData: Array<ChannelsTest.CoefficientVO>;
}>();
interface Props {
tableData: ChannelsTest.CoefficientVO[];
big_V_loading: boolean;
curV: number;
}
const props = withDefaults(defineProps<Props>(), {
tableData: () => [],
big_V_loading: false,
curV: 0,
});
function objectSpanMethod({ row, column, rowIndex, columnIndex }: { row: any, column: any, rowIndex: number, columnIndex: number }) {
if (columnIndex === 0) {

View File

@@ -968,7 +968,7 @@ const handleTest = async (val:string) => {
const data = reactive({
socketServe: socketClient.Instance,
});
const url = 'ws://localhost:7777/hello?name=cdf';
const url = 'ws://192.168.1.127:7777/hello?name=cdf';
socketClient.Instance.connect(url);
data.socketServe = socketClient.Instance;
data.socketServe.registerCallBack('aaa', (res: { code: number; }) => {