微调
This commit is contained in:
@@ -30,7 +30,7 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const errordetail = ref<ErrorSystem.Error_detail[]>([
|
const errorADetail = ref<ErrorSystem.Error_detail[]>([
|
||||||
{
|
{
|
||||||
col1: '电压偏差',
|
col1: '电压偏差',
|
||||||
col2: '',
|
col2: '',
|
||||||
@@ -233,5 +233,191 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const errorSDetail = ref<ErrorSystem.Error_detail[]>([
|
||||||
|
{
|
||||||
|
col1: '电压偏差',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '20%~120%标称电压',
|
||||||
|
maxErrorValue: '±0.5%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'频率偏差',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'频率',
|
||||||
|
condition: '42.5~57.5 Hz',
|
||||||
|
maxErrorValue: '±0.05Hz'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '1%~5%',
|
||||||
|
maxErrorValue: '±0.2%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '5%(不包含)~ 40%',
|
||||||
|
maxErrorValue: '±0.6%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±1%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电压波动',
|
||||||
|
col2: '电压幅值',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±1.0%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电压波动',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用半波刷新方均根值',
|
||||||
|
maxErrorValue: '±1周波'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电压波动',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用全波刷新方均根值',
|
||||||
|
maxErrorValue: '±2周波'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'闪变',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'短时间闪变',
|
||||||
|
condition: 'Pst:0.4~4',
|
||||||
|
maxErrorValue: '±10%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh≥3%Un',
|
||||||
|
maxErrorValue: '±5%Uh'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh<3%Un',
|
||||||
|
maxErrorValue: '±0.15%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In≥10%In',
|
||||||
|
maxErrorValue: '±5%Ih'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In<10%In',
|
||||||
|
maxErrorValue: '±0.5%In'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh≥3%Un',
|
||||||
|
maxErrorValue: '±5%Uh'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh<3%Un',
|
||||||
|
maxErrorValue: '±0.15%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In≥10%In',
|
||||||
|
maxErrorValue: '±5%Ih'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In<10%In',
|
||||||
|
maxErrorValue: '±0.5%In'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'功率',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'功率',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±0.5%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电流',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'I≥0.05In',
|
||||||
|
maxErrorValue: '±0.5%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电流',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: '0.01In≤I<0.05In',
|
||||||
|
maxErrorValue: '±1%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '电压幅值',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±1.0%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用半波刷新方均根值',
|
||||||
|
maxErrorValue: '±1周波'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用全波刷新方均根值',
|
||||||
|
maxErrorValue: '±2周波'
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
export default {errordata,errordetail}
|
export default {errordata,errorADetail,errorSDetail}
|
||||||
@@ -36,12 +36,13 @@ export namespace ErrorSystem {
|
|||||||
errorValueType:string;//误差值类型(包括值类型,绝对值、相对值1、相对值2)
|
errorValueType:string;//误差值类型(包括值类型,绝对值、相对值1、相对值2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看详细误差体系
|
//查看详细误差体系
|
||||||
// export interface Error_detail {
|
export interface Error_detail {
|
||||||
// measured: string;
|
col1: string;
|
||||||
// deviceLevel: string;
|
col2: string;
|
||||||
// measurementType:string;
|
deviceLevel: string;
|
||||||
// condition: string;
|
measurementType:string;
|
||||||
// maxErrorValue: string;
|
condition: string;
|
||||||
// }
|
maxErrorValue: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -598,7 +598,6 @@ for (let i = 0; i < channel.value.length; i++) {
|
|||||||
|
|
||||||
// 重置状态变量
|
// 重置状态变量
|
||||||
active.value = 0;activeIndex.value = 0;
|
active.value = 0;activeIndex.value = 0;
|
||||||
console.log('activeIndex', activeIndex.value);
|
|
||||||
const currentTableData = ref<TableDataItem[]>([]);
|
const currentTableData = ref<TableDataItem[]>([]);
|
||||||
const selectedTemplates = dataTemplates4;
|
const selectedTemplates = dataTemplates4;
|
||||||
|
|
||||||
@@ -615,13 +614,11 @@ for (let i = 0; i < channel.value.length; i++) {
|
|||||||
|
|
||||||
tableDataMap.set(i, currentTableData);
|
tableDataMap.set(i, currentTableData);
|
||||||
activeIndex.value++;
|
activeIndex.value++;
|
||||||
console.log('activeIndex', activeIndex.value);
|
|
||||||
// 清除之前的 timer1
|
// 清除之前的 timer1
|
||||||
clearInterval(timer1);
|
clearInterval(timer1);
|
||||||
// 启动 timer1
|
// 启动 timer1
|
||||||
timer1 = setInterval(() => {
|
timer1 = setInterval(() => {
|
||||||
active.value++;
|
active.value++;
|
||||||
console.log('active', active.value);
|
|
||||||
if (active.value > 5) {
|
if (active.value > 5) {
|
||||||
clearInterval(timer1);
|
clearInterval(timer1);
|
||||||
}
|
}
|
||||||
@@ -660,15 +657,11 @@ for (let i = 0; i < channel.value.length; i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('currentTableData', currentTableData);
|
|
||||||
tableDataMap.set(i, currentTableData);
|
tableDataMap.set(i, currentTableData);
|
||||||
activeIndex.value++;
|
activeIndex.value++;
|
||||||
|
|
||||||
clearInterval(timer2);
|
clearInterval(timer2);
|
||||||
console.log('activeIndex', activeIndex.value);
|
|
||||||
console.log('tableDataMap', tableDataMap);
|
|
||||||
const currentDataRef = tableDataMap.get(i);
|
const currentDataRef = tableDataMap.get(i);
|
||||||
console.log('activeIndex.value - 2',activeIndex.value)
|
|
||||||
console.log('currentDataRef',currentDataRef)
|
|
||||||
if (currentDataRef) {
|
if (currentDataRef) {
|
||||||
const currentData = currentDataRef.value;
|
const currentData = currentDataRef.value;
|
||||||
// 检查当前数据中有无不合格字段
|
// 检查当前数据中有无不合格字段
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ import ChannelsTest from './channelsTest.vue'
|
|||||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||||
import {useCheckStore} from '@/stores/modules/check'
|
import {useCheckStore} from '@/stores/modules/check'
|
||||||
import {CheckData} from '@/api/check/interface'
|
import {CheckData} from '@/api/check/interface'
|
||||||
|
import socketClient from '@/utils/webSocketClient';
|
||||||
|
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
const checkStore = useCheckStore()
|
const checkStore = useCheckStore()
|
||||||
@@ -302,6 +303,7 @@ const operationMinWidth = ref(200);
|
|||||||
const selectionShow = ref(true);
|
const selectionShow = ref(true);
|
||||||
const channelsTest = ref()
|
const channelsTest = ref()
|
||||||
const testPopup = ref()
|
const testPopup = ref()
|
||||||
|
|
||||||
const channelsSelection = ref<Device.ResPqDev[]>([])
|
const channelsSelection = ref<Device.ResPqDev[]>([])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ import {
|
|||||||
} from '@element-plus/icons-vue'
|
} from '@element-plus/icons-vue'
|
||||||
import resultPopup from './resultPopup.vue'
|
import resultPopup from './resultPopup.vue'
|
||||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||||
import {reactive, ref, watch} from "vue";
|
import {computed, reactive, ref, toRef, watch} from "vue";
|
||||||
import {dialogBig} from "@/utils/elementBind";
|
import {dialogBig} from "@/utils/elementBind";
|
||||||
import {CheckData} from "@/api/check/interface"
|
import {CheckData} from "@/api/check/interface"
|
||||||
import {useCheckStore} from "@/stores/modules/check";
|
import {useCheckStore} from "@/stores/modules/check";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig">
|
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig">
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<el-table :data="errorData"
|
<el-table :data="errorData.value"
|
||||||
height="500"
|
height="500"
|
||||||
:header-cell-style="rowClass"
|
:header-cell-style="rowClass"
|
||||||
:cell-style="{ textAlign: 'center' }"
|
:cell-style="{ textAlign: 'center' }"
|
||||||
@@ -37,10 +37,12 @@
|
|||||||
import type { ErrorSystem } from '@/api/device/interface/error'
|
import type { ErrorSystem } from '@/api/device/interface/error'
|
||||||
import errorDataList from '@/api/device/error/errorData'
|
import errorDataList from '@/api/device/error/errorData'
|
||||||
import type { TableColumnCtx } from 'element-plus'
|
import type { TableColumnCtx } from 'element-plus'
|
||||||
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
|
|
||||||
const errorData = errorDataList.errordetail
|
const dictStore = useDictStore()
|
||||||
|
const errorData = ref<ErrorSystem.Error_detail[]>([]);
|
||||||
const dialogTitle = ref()
|
const dialogTitle = ref()
|
||||||
|
const devLevelName = ref<string>('') // 假设 devLevelName 是一个 ref
|
||||||
function useMetaInfo() {
|
function useMetaInfo() {
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const formContent = ref<ErrorSystem.ErrorSystemList>({
|
const formContent = ref<ErrorSystem.ErrorSystemList>({
|
||||||
@@ -76,50 +78,58 @@ const rowClass = ({ row, column, rowIndex, columnIndex }: { row: any; column: an
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
const spanMethod = ({
|
|
||||||
|
const spanMethod = computed(() => {
|
||||||
|
return devLevelName.value === 'A级' ? spanAMethod : spanSMethod
|
||||||
|
})
|
||||||
|
|
||||||
|
const spanAMethod = ({
|
||||||
row,
|
row,
|
||||||
column,
|
column,
|
||||||
rowIndex,
|
rowIndex,
|
||||||
columnIndex,
|
columnIndex,
|
||||||
}: SpanMethodProps) => {
|
}: SpanMethodProps) => {
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
if (rowIndex <= 1 || rowIndex === 7 || rowIndex == 20) {
|
if (rowIndex <= 1 || rowIndex === 7 || rowIndex == 20) {//0电压偏差,1频率偏差,7闪变,20功率,简单的跨两列
|
||||||
return {
|
return {
|
||||||
rowspan: 1,
|
rowspan: 1,
|
||||||
colspan: 2,
|
colspan: 2,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 2) {
|
if (rowIndex === 2) {//2三相不平衡跨三行两列
|
||||||
return {
|
return {
|
||||||
rowspan: 3, // 不显示该单元格
|
rowspan: 3,
|
||||||
colspan: 2,
|
colspan: 2,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 3 || rowIndex === 4 || rowIndex === 6 || rowIndex >= 9 && rowIndex <= 15 || rowIndex >= 17 && rowIndex <= 19 || rowIndex === 22 || rowIndex === 24) {
|
if (rowIndex === 3 || rowIndex === 4 || rowIndex === 6 ||
|
||||||
|
rowIndex >= 9 && rowIndex <= 15 ||
|
||||||
|
rowIndex >= 17 && rowIndex <= 19 ||
|
||||||
|
rowIndex === 22 || rowIndex === 24) {//这些行不显示
|
||||||
return {
|
return {
|
||||||
rowspan: 0, // 不显示该单元格
|
rowspan: 0,
|
||||||
colspan: 0,
|
colspan: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 5 || rowIndex === 23) {
|
if (rowIndex === 5 || rowIndex === 23) {//5电压波动,23电压暂降暂升中断跨两列
|
||||||
return {
|
return {
|
||||||
rowspan: 2,
|
rowspan: 2,
|
||||||
colspan: 1,
|
colspan: 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 8) {
|
if (rowIndex === 8) {//谐波和间谐波跨八行两列
|
||||||
return {
|
return {
|
||||||
rowspan: 8,
|
rowspan: 8,
|
||||||
colspan: 2,
|
colspan: 2,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 16) {
|
if (rowIndex === 16) {//高频次谐波跨八行两列
|
||||||
return {
|
return {
|
||||||
rowspan: 4,
|
rowspan: 4,
|
||||||
colspan: 2,
|
colspan: 2,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 21 || rowIndex === 22) {
|
if (rowIndex === 21 || rowIndex === 22) {//电流跨两行两列
|
||||||
return {
|
return {
|
||||||
rowspan: 2,
|
rowspan: 2,
|
||||||
colspan: 2,
|
colspan: 2,
|
||||||
@@ -134,28 +144,18 @@ const spanMethod = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (columnIndex === 2) {
|
if (columnIndex === 2 || columnIndex === 3) {
|
||||||
if (rowIndex === 2 || rowIndex === 8 || rowIndex === 10 || rowIndex === 12 || rowIndex === 14 || rowIndex === 16 || rowIndex === 18 || rowIndex === 21) {
|
if (rowIndex === 2 || rowIndex === 8 || rowIndex === 10 ||
|
||||||
|
rowIndex === 12 || rowIndex === 14 || rowIndex === 16 ||
|
||||||
|
rowIndex === 18 || rowIndex === 21) {
|
||||||
return {
|
return {
|
||||||
rowspan: 2,
|
rowspan: 2,
|
||||||
colspan: 1,
|
colspan: 1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rowIndex === 3 || rowIndex === 9 || rowIndex === 11 || rowIndex === 13 || rowIndex === 15 || rowIndex === 17 || rowIndex === 19 || rowIndex === 22) {
|
if (rowIndex === 3 || rowIndex === 9 || rowIndex === 11 ||
|
||||||
return {
|
rowIndex === 13 || rowIndex === 15 || rowIndex === 17 ||
|
||||||
rowspan: 0,
|
rowIndex === 19 || rowIndex === 22) {
|
||||||
colspan: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (columnIndex === 3) {
|
|
||||||
if (rowIndex === 2 || rowIndex === 8 || rowIndex === 10 || rowIndex === 12 || rowIndex === 14 || rowIndex === 16 || rowIndex === 18 || rowIndex === 21) {
|
|
||||||
return {
|
|
||||||
rowspan: 2,
|
|
||||||
colspan: 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rowIndex === 3 || rowIndex === 9 || rowIndex === 11 || rowIndex === 13 || rowIndex === 15 || rowIndex === 17 || rowIndex === 19 || rowIndex === 22) {
|
|
||||||
return {
|
return {
|
||||||
rowspan: 0,
|
rowspan: 0,
|
||||||
colspan: 0,
|
colspan: 0,
|
||||||
@@ -164,10 +164,111 @@ const spanMethod = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 关闭弹窗
|
|
||||||
const close = () => {
|
const spanSMethod = ({
|
||||||
dialogVisible.value = false
|
row,
|
||||||
|
column,
|
||||||
|
rowIndex,
|
||||||
|
columnIndex,
|
||||||
|
}: SpanMethodProps) => {
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
if (rowIndex <= 1 || rowIndex === 8 || rowIndex == 17) {//0电压偏差,1频率偏差,7闪变,20功率,简单的跨两列
|
||||||
|
return {
|
||||||
|
rowspan: 1,
|
||||||
|
colspan: 2,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (rowIndex === 2) {//2三相不平衡跨三行两列
|
||||||
|
return {
|
||||||
|
rowspan: 3,
|
||||||
|
colspan: 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex === 3 || rowIndex === 4 || rowIndex === 6 || rowIndex === 7 ||
|
||||||
|
rowIndex >= 10 && rowIndex <= 12 ||
|
||||||
|
rowIndex >= 14 && rowIndex <= 16 ||
|
||||||
|
rowIndex === 19 || rowIndex === 21 || rowIndex === 22) {//这些行不显示
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex === 5 || rowIndex === 20) {//5电压波动,23电压暂降暂升中断跨两行
|
||||||
|
return {
|
||||||
|
rowspan: 3,
|
||||||
|
colspan: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex === 9 || rowIndex === 13) {//谐波和间谐波跨八行两列
|
||||||
|
return {
|
||||||
|
rowspan: 4,
|
||||||
|
colspan: 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex === 18 ) {//电流跨两行两列
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (columnIndex === 1) {
|
||||||
|
if (rowIndex === 6 || rowIndex === 21) {
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex <= 4 || rowIndex >= 7 && rowIndex <= 19 || rowIndex === 22) {
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (columnIndex === 2) {
|
||||||
|
if (rowIndex === 2 || rowIndex === 6 || rowIndex === 9 ||
|
||||||
|
rowIndex === 11 || rowIndex === 13 || rowIndex === 15 ||
|
||||||
|
rowIndex === 18 || rowIndex === 21) {
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex === 3 || rowIndex === 7 ||
|
||||||
|
rowIndex === 10 || rowIndex === 12 ||
|
||||||
|
rowIndex === 14 || rowIndex === 16 ||
|
||||||
|
rowIndex === 19 || rowIndex === 22) {
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(columnIndex === 3){
|
||||||
|
if (rowIndex === 2 || rowIndex === 6 || rowIndex === 9 ||
|
||||||
|
rowIndex === 11 || rowIndex === 13 ||rowIndex === 15 ||
|
||||||
|
rowIndex === 18 || rowIndex === 21){
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rowIndex === 3 || rowIndex === 7 || rowIndex === 10 ||
|
||||||
|
rowIndex === 12 || rowIndex === 14 ||rowIndex === 16 ||
|
||||||
|
rowIndex === 19 || rowIndex === 22){
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const close = () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => {
|
const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => {
|
||||||
@@ -175,6 +276,15 @@ const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
formContent.value = data as ErrorSystem.ErrorSystemList;
|
formContent.value = data as ErrorSystem.ErrorSystemList;
|
||||||
|
|
||||||
|
devLevelName.value = dictStore.getDictData('Dev_Level').find(item => item.id === data.devLevel)?.name || '';;
|
||||||
|
|
||||||
|
if(devLevelName.value === 'A级'){
|
||||||
|
errorData.value = errorDataList.errorADetail as unknown as ErrorSystem.Error_detail[];
|
||||||
|
}else{
|
||||||
|
errorData.value = errorDataList.errorSDetail as unknown as ErrorSystem.Error_detail[];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,55 +155,55 @@ const handleTableDataUpdate = (newTableData: ErrorSystem.ErrorSystemDetail[]) =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 封装提取第二层节点的逻辑
|
// 封装提取第二层节点的逻辑
|
||||||
const loadSecondLevelOptions = async () => {
|
const loadSecondLevelOptions = async () => {
|
||||||
const dictCode = '误差体系指标项'; // 替换为实际需要的字典代码
|
const dictCode = '误差体系指标项'; // 替换为实际需要的字典代码
|
||||||
const resDictTree: Dict.ResDictTree = {
|
const dictCode2 = '脚本-误差'; // 替换为实际需要的字典代码
|
||||||
name: dictCode,
|
|
||||||
id: '',
|
|
||||||
pid: '',
|
|
||||||
pids: '',
|
|
||||||
code: '',
|
|
||||||
sort: 0
|
|
||||||
};
|
|
||||||
const result = await getDictTreeList(resDictTree);
|
|
||||||
const allOptions = convertToOptions(result.data as Dict.ResDictTree[]);
|
|
||||||
|
|
||||||
// 提取第二层节点
|
const resDictTree: Dict.ResDictTree = {
|
||||||
const secondLevelOptions: any[] = [];
|
name: dictCode,
|
||||||
allOptions.forEach(option => {
|
id: '',
|
||||||
if (option.children && option.children.length > 0) {
|
pid: '',
|
||||||
secondLevelOptions.push(...option.children);
|
pids: '',
|
||||||
}
|
code: '',
|
||||||
});
|
sort: 0
|
||||||
// 将第二层节点赋值给 options.value
|
};
|
||||||
errorOptions.value = secondLevelOptions;
|
|
||||||
|
|
||||||
|
const resDictTree2: Dict.ResDictTree = {
|
||||||
|
name: dictCode2,
|
||||||
|
id: '',
|
||||||
|
pid: '',
|
||||||
|
pids: '',
|
||||||
|
code: '',
|
||||||
|
sort: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
// 并行请求两个字典树列表
|
||||||
|
const [result, result2] = await Promise.all([
|
||||||
|
getDictTreeList(resDictTree),
|
||||||
|
getDictTreeList(resDictTree2)
|
||||||
|
]);
|
||||||
|
|
||||||
|
const allOptions = convertToOptions(result.data as Dict.ResDictTree[]);
|
||||||
|
const allOptions2 = convertToOptions(result2.data as Dict.ResDictTree[]);
|
||||||
|
|
||||||
|
// 提取第二层节点
|
||||||
|
const secondLevelOptions: any[] = [];
|
||||||
|
allOptions.forEach(option => {
|
||||||
|
if (option.children && option.children.length > 0) {
|
||||||
|
secondLevelOptions.push(...option.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const secondLevelOptions2: any[] = [];
|
||||||
|
allOptions2.forEach(option => {
|
||||||
|
if (option.children && option.children.length > 0) {
|
||||||
|
secondLevelOptions2.push(...option.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const dictCode2 = '脚本-误差'; // 替换为实际需要的字典代码
|
// 将第二层节点赋值给 options.value
|
||||||
const resDictTree2: Dict.ResDictTree = {
|
errorOptions.value = secondLevelOptions;
|
||||||
name: dictCode2,
|
scriptOptions.value = secondLevelOptions2;
|
||||||
id: '',
|
|
||||||
pid: '',
|
|
||||||
pids: '',
|
|
||||||
code: '',
|
|
||||||
sort: 0
|
|
||||||
};
|
|
||||||
const result2 = await getDictTreeList(resDictTree2);
|
|
||||||
const allOptions2 = convertToOptions(result2.data as Dict.ResDictTree[]);
|
|
||||||
|
|
||||||
// 提取第二层节点
|
|
||||||
const secondLevelOptions2: any[] = [];
|
|
||||||
allOptions2.forEach(option => {
|
|
||||||
if (option.children && option.children.length > 0) {
|
|
||||||
secondLevelOptions2.push(...option.children);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 将第二层节点赋值给 options.value
|
|
||||||
scriptOptions.value = secondLevelOptions2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 转换函数
|
// 转换函数
|
||||||
@@ -216,26 +216,28 @@ const handleTableDataUpdate = (newTableData: ErrorSystem.ErrorSystemDetail[]) =>
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
|
||||||
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => {
|
const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => {
|
||||||
titleType.value = sign
|
titleType.value = sign;
|
||||||
// 确保每次打开弹窗时都重新加载数据
|
|
||||||
await loadSecondLevelOptions();
|
|
||||||
if (data.id) {
|
|
||||||
const result = await getPqErrSysListById(data);
|
|
||||||
if (result && result.data) {
|
|
||||||
formContent.value = result.data as ErrorSystem.ErrorSystemList;
|
|
||||||
|
|
||||||
tableData.value = formContent.value.pqErrSysDtlsList || []
|
// 并行执行两个异步操作
|
||||||
}
|
const loadOptionsPromise = loadSecondLevelOptions();
|
||||||
|
const fetchDataPromise = data.id ? getPqErrSysListById(data) : Promise.resolve(null);
|
||||||
|
|
||||||
|
const [_, result] = await Promise.all([loadOptionsPromise, fetchDataPromise]);
|
||||||
|
|
||||||
|
if (result && result.data) {
|
||||||
|
formContent.value = result.data as ErrorSystem.ErrorSystemList;
|
||||||
|
tableData.value = formContent.value.pqErrSysDtlsList || [];
|
||||||
} else {
|
} else {
|
||||||
|
resetFormContent();
|
||||||
resetFormContent()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置表单
|
// 重置表单
|
||||||
dialogFormRef.value?.resetFields()
|
dialogFormRef.value?.resetFields();
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// 对外映射
|
// 对外映射
|
||||||
|
|||||||
Reference in New Issue
Block a user