实时数据对齐,修改成标准对应被检
This commit is contained in:
@@ -268,17 +268,17 @@ const generateChannelMapping = () => {
|
|||||||
const sourceDeviceText = sourceDeviceNode.data.label.children[1].children
|
const sourceDeviceText = sourceDeviceNode.data.label.children[1].children
|
||||||
const targetDeviceText = targetDeviceNode.data.label.children[1].children
|
const targetDeviceText = targetDeviceNode.data.label.children[1].children
|
||||||
|
|
||||||
// 构造键名
|
// 构造键名 - 现在以标准设备为键
|
||||||
const sourceKey = `${sourceDeviceText}`.replace('设备名称:', '')
|
const targetKey = `${targetDeviceText}`.replace('设备名称:', '')
|
||||||
const targetValue = `${targetDeviceText}通道${targetChannel}`.replace('设备名称:', '')
|
const sourceValue = `${sourceDeviceText}通道${sourceChannel}`.replace('设备名称:', '')
|
||||||
|
|
||||||
// 初始化对象
|
// 初始化对象
|
||||||
if (!mapping[sourceKey]) {
|
if (!mapping[targetKey]) {
|
||||||
mapping[sourceKey] = {}
|
mapping[targetKey] = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加映射关系
|
// 添加映射关系 - 标准设备通道 -> 被检设备信息
|
||||||
mapping[sourceKey][`通道${sourceChannel}`] = targetValue
|
mapping[targetKey][`通道${targetChannel}`] = sourceValue
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<div class="table-toolbar">
|
<div class="table-toolbar">
|
||||||
<el-form-item label="被检设备通道号" prop="createId">
|
<el-form-item label="标准设备通道号" prop="createId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="selectedChannels[deviceName]"
|
v-model="selectedChannels[deviceName]"
|
||||||
placeholder="选择通道"
|
placeholder="选择通道"
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
@change="() => handleDutChannelChange(deviceName)">
|
@change="() => handleDutChannelChange(deviceName)">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="channel in device.channelDataList"
|
v-for="channel in device.channelDataList"
|
||||||
:key="channel.devNum"
|
:key="channel.stdDevNum"
|
||||||
:label="`通道${channel.devNum}`"
|
:label="`通道${channel.stdDevNum}`"
|
||||||
:value="`通道${channel.devNum}`">
|
:value="`通道${channel.stdDevNum}`">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span style="margin-left: 20px; font-size: 14px; color: var(--el-color-primary);">
|
<span style="margin-left: 20px; font-size: 14px; color: var(--el-color-primary);">
|
||||||
被检设备:{{ deviceName }}-{{ selectedChannels[deviceName] }} ---> 标准设备:{{ formatStandardChannelLabel(getMappedStandardChannel(deviceName, selectedChannels[deviceName])) }}
|
标准设备:{{ deviceName }}-{{ selectedChannels[deviceName] }} ---> 被检设备:{{ formatDutChannelLabel(getMappedDutChannel(deviceName, selectedChannels[deviceName])) }}
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="primary" @click="exportData">导出数据</el-button>
|
<el-button type="primary" @click="exportData">导出数据</el-button>
|
||||||
@@ -44,17 +44,17 @@
|
|||||||
:style="{ height: '400px',maxHeight: '400px',overflow:'hidden'}">
|
:style="{ height: '400px',maxHeight: '400px',overflow:'hidden'}">
|
||||||
|
|
||||||
<el-table-column :label="`${deviceName}-${selectedChannels[deviceName] || '通道1'}`">
|
<el-table-column :label="`${deviceName}-${selectedChannels[deviceName] || '通道1'}`">
|
||||||
|
<el-table-column prop="timeStdDev" label="数据时标" width="200"/>
|
||||||
|
<el-table-column prop="uaStdDev" label="A相(V)"/>
|
||||||
|
<el-table-column prop="ubStdDev" label="B相(V)"/>
|
||||||
|
<el-table-column prop="ucStdDev" label="C相(V)"/>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="formatDutChannelLabel(getMappedDutChannel(deviceName, selectedChannels[deviceName]))">
|
||||||
<el-table-column prop="timeDev" label="数据时标" width="200"/>
|
<el-table-column prop="timeDev" label="数据时标" width="200"/>
|
||||||
<el-table-column prop="uaDev" label="A相(V)"/>
|
<el-table-column prop="uaDev" label="A相(V)"/>
|
||||||
<el-table-column prop="ubDev" label="B相(V)"/>
|
<el-table-column prop="ubDev" label="B相(V)"/>
|
||||||
<el-table-column prop="ucDev" label="C相(V)"/>
|
<el-table-column prop="ucDev" label="C相(V)"/>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="formatStandardChannelLabel(getMappedStandardChannel(deviceName, selectedChannels[deviceName]))">
|
|
||||||
<el-table-column prop="timeStdDev" label="数据时标" width="200"/>
|
|
||||||
<el-table-column prop="uaStdDev" label="A相(V)"/>
|
|
||||||
<el-table-column prop="uaStdDev" label="B相(V)"/>
|
|
||||||
<el-table-column prop="uaStdDev" label="C相(V)"/>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
<script setup lang='tsx' name='realTimeDataAlign'>
|
<script setup lang='tsx' name='realTimeDataAlign'>
|
||||||
import { dialogBig } from "@/utils/elementBind";
|
import { dialogBig } from "@/utils/elementBind";
|
||||||
import { PropType, ref } from "vue";
|
import { PropType, ref, nextTick } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { CircleCheck, CircleClose } from '@element-plus/icons-vue';
|
import { CircleCheck, CircleClose } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
@@ -72,8 +72,8 @@ const activeTab = ref('channel1');
|
|||||||
|
|
||||||
// 在 script setup 中定义接口
|
// 在 script setup 中定义接口
|
||||||
interface ChannelData {
|
interface ChannelData {
|
||||||
devNum: string;
|
stdDevNum: string;
|
||||||
standardDevInfo: string;
|
devInfo: string;
|
||||||
dataList: {
|
dataList: {
|
||||||
timeDev: string | null;
|
timeDev: string | null;
|
||||||
uaDev: number | null;
|
uaDev: number | null;
|
||||||
@@ -87,185 +87,18 @@ interface ChannelData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface DeviceData {
|
interface DeviceData {
|
||||||
devName: string;
|
stdDevName: string;
|
||||||
channelDataList: ChannelData[];
|
channelDataList: ChannelData[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改 testDataStructure 的类型声明
|
// 修改 testDataStructure 的类型声明
|
||||||
const testDataStructure = ref<Record<string, DeviceData>>({});
|
const testDataStructure = ref<Record<string, DeviceData>>({});
|
||||||
|
|
||||||
// 重构后的 testDataStructure
|
|
||||||
// const testDataStructure = ref({
|
|
||||||
// "被检1": {
|
|
||||||
// devName: "被检设备1",
|
|
||||||
// channelDataList: [
|
|
||||||
// {
|
|
||||||
// devNum: "1",
|
|
||||||
// standardDevInfo: "标准设备1通道1",
|
|
||||||
// dataList: [
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.234",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: null,
|
|
||||||
// uaStdDev: null,
|
|
||||||
// ubStdDev: null,
|
|
||||||
// ucStdDev: null
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: null,
|
|
||||||
// uaDev: null,
|
|
||||||
// ubDev: null,
|
|
||||||
// ucDev: null,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.237",
|
|
||||||
// uaStdDev: 57.74,
|
|
||||||
// ubStdDev: 57.74,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// devNum: "2",
|
|
||||||
// standardDevInfo: "标准设备2通道4",
|
|
||||||
// dataList: [
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// "被检2": {
|
|
||||||
// devName: "被检设备2",
|
|
||||||
// channelDataList: [
|
|
||||||
// {
|
|
||||||
// devNum: "1",
|
|
||||||
// standardDevInfo: "标准设备1通道1",
|
|
||||||
// dataList: [
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.234",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.234",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.237",
|
|
||||||
// uaStdDev: 57.74,
|
|
||||||
// ubStdDev: 57.74,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// devNum: "3",
|
|
||||||
// standardDevInfo: "标准设备2通道4",
|
|
||||||
// dataList: [
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// timeDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaDev: 57.74,
|
|
||||||
// ubDev: 57.74,
|
|
||||||
// ucDev: 57.74,
|
|
||||||
// timeStdDev: "2025-09-02 14:00:02.231",
|
|
||||||
// uaStdDev: 57.73,
|
|
||||||
// ubStdDev: 57.73,
|
|
||||||
// ucStdDev: 57.74
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// 每个设备选中的通道
|
// 每个设备选中的通道
|
||||||
const selectedChannels = ref<Record<string, string>>({});
|
const selectedChannels = ref<Record<string, string>>({});
|
||||||
|
|
||||||
// 通道映射关系:被检设备通道 -> 标准设备通道
|
// 通道映射关系:标准设备通道 -> 被检设备通道
|
||||||
const channelMapping = ref<Record<string, Record<string, string>>>({
|
const channelMapping = ref<Record<string, Record<string, string>>>({});
|
||||||
// '被检1': {
|
|
||||||
// '通道1': '标准设备1通道2',
|
|
||||||
// '通道2': '标准设备2通道4',
|
|
||||||
// },
|
|
||||||
// '被检2': {
|
|
||||||
// '通道1': '标准设备1通道3',
|
|
||||||
// '通道3': '标准设备2通道1'
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
|
|
||||||
// 每个设备的表格数据
|
// 每个设备的表格数据
|
||||||
const tableDataMap = ref<Record<string, any[]>>({});
|
const tableDataMap = ref<Record<string, any[]>>({});
|
||||||
@@ -279,40 +112,41 @@ const hasIncompleteData = (deviceName: string) => {
|
|||||||
if (!tableData || tableData.length === 0) return false;
|
if (!tableData || tableData.length === 0) return false;
|
||||||
|
|
||||||
// 检查每一行是否有缺失数据(包含null的字段)
|
// 检查每一行是否有缺失数据(包含null的字段)
|
||||||
return tableData.some(row => {
|
return tableData.some(row => {
|
||||||
return row.Ua1 === '/' || row.Ub1 === '/' || row.Uc1 === '/' ||
|
return row.uaDev === '/' || row.ubDev === '/' || row.ucDev === '/' ||
|
||||||
row.Ua2 === '/' || row.Ub2 === '/' || row.Uc2 === '/';
|
row.uaStdDev === '/' || row.ubStdDev === '/' || row.ucStdDev === '/';
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取映射的标准设备通道
|
// 获取映射的被检设备通道
|
||||||
const getMappedStandardChannel = (deviceName: string, dutChannel: string) => {
|
const getMappedDutChannel = (deviceName: string, stdChannel: string) => {
|
||||||
|
console.log('getMappedDutChannel', deviceName, stdChannel,channelMapping.value);
|
||||||
return channelMapping.value[deviceName][dutChannel];
|
// 添加安全检查
|
||||||
|
if (!channelMapping.value[deviceName]) return '';
|
||||||
|
return channelMapping.value[deviceName][stdChannel] || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 格式化被检设备通道标签,将设备名称和通道号用"-"连接
|
||||||
|
const formatDutChannelLabel = (dutChannel: string) => {
|
||||||
|
// 如果是"被检设备X通道Y"格式,则转换为"被检设备X-通道Y"
|
||||||
|
if (!dutChannel) return '未映射';
|
||||||
|
return dutChannel.replace(/(被检设备\d+)(通道\d+)/, '$1-$2');
|
||||||
|
};
|
||||||
|
|
||||||
// 格式化标准设备通道标签,将设备名称和通道号用"-"连接
|
// 处理标准设备通道切换
|
||||||
const formatStandardChannelLabel = (standardChannel: string) => {
|
|
||||||
// 如果是"标准设备X通道Y"格式,则转换为"标准设备X-通道Y"
|
|
||||||
return standardChannel.replace(/(标准设备\d+)(通道\d+)/, '$1-$2');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 处理被检设备通道切换
|
|
||||||
const handleDutChannelChange = (deviceName: string) => {
|
const handleDutChannelChange = (deviceName: string) => {
|
||||||
// 更新指定设备的表格数据,但不改变tab图标状态
|
// 更新指定设备的表格数据,但不改变tab图标状态
|
||||||
updateTableData(deviceName);
|
updateTableData(deviceName);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 根据 testDataStructure 生成表格数据
|
// 根据 testDataStructure 生成表格数据
|
||||||
const generateTableData = (deviceName: string, dutChannel: string) => {
|
const generateTableData = (deviceName: string, stdChannel: string) => {
|
||||||
const deviceData = testDataStructure.value[deviceName];
|
const deviceData = testDataStructure.value[deviceName];
|
||||||
if (!deviceData) return [];
|
if (!deviceData) return [];
|
||||||
|
|
||||||
|
|
||||||
// 根据实际通道编号查找对应的数据
|
// 根据实际通道编号查找对应的数据
|
||||||
const channelData = deviceData.channelDataList.find(channel =>
|
const channelData = deviceData.channelDataList.find(channel =>
|
||||||
`通道${channel.devNum}` === dutChannel
|
`通道${channel.stdDevNum}` === stdChannel
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!channelData) return [];
|
if (!channelData) return [];
|
||||||
@@ -338,16 +172,23 @@ const updateTableData = (deviceName: string) => {
|
|||||||
if (selectedChannel) {
|
if (selectedChannel) {
|
||||||
const tableData = generateTableData(deviceName, selectedChannel);
|
const tableData = generateTableData(deviceName, selectedChannel);
|
||||||
tableDataMap.value[deviceName] = tableData;
|
tableDataMap.value[deviceName] = tableData;
|
||||||
|
console.log('tableDataMap:', tableDataMap.value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 初始化所有设备的数据和状态
|
// 初始化所有设备的数据和状态
|
||||||
const initAllTableData = () => {
|
const initAllTableData = () => {
|
||||||
Object.keys(testDataStructure.value).forEach(deviceName => {
|
Object.keys(testDataStructure.value).forEach(deviceName => {
|
||||||
|
// 确保设备有数据
|
||||||
|
if (!testDataStructure.value[deviceName] ||
|
||||||
|
!testDataStructure.value[deviceName].channelDataList ||
|
||||||
|
testDataStructure.value[deviceName].channelDataList.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 默认选择第一个可用通道
|
// 默认选择第一个可用通道
|
||||||
const firstChannel = testDataStructure.value[deviceName].channelDataList[0];
|
const firstChannel = testDataStructure.value[deviceName].channelDataList[0];
|
||||||
selectedChannels.value[deviceName] = `通道${firstChannel.devNum}`;
|
selectedChannels.value[deviceName] = `通道${firstChannel.stdDevNum}`;
|
||||||
|
|
||||||
// 生成表格数据
|
// 生成表格数据
|
||||||
updateTableData(deviceName);
|
updateTableData(deviceName);
|
||||||
@@ -377,13 +218,13 @@ const open = async (mapping : Record<string, Record<string, string>>,data : any)
|
|||||||
// 假设传入的数据是一个数组,需要转换为以设备名为键的对象
|
// 假设传入的数据是一个数组,需要转换为以设备名为键的对象
|
||||||
if (Array.isArray(parsedData)) {
|
if (Array.isArray(parsedData)) {
|
||||||
parsedData.forEach((deviceItem: any) => {
|
parsedData.forEach((deviceItem: any) => {
|
||||||
const deviceName = deviceItem.devName;
|
const deviceName = deviceItem.stdDevName;
|
||||||
convertedData[deviceName] = {
|
convertedData[deviceName] = {
|
||||||
devName: deviceName,
|
stdDevName: deviceName,
|
||||||
channelDataList: deviceItem.channelDataList.map((channel: any) => ({
|
channelDataList: deviceItem.channelDataList?.map((channel: any) => ({
|
||||||
devNum: channel.devNum,
|
stdDevNum: channel.stdDevNum,
|
||||||
standardDevInfo: channel.standardDevInfo,
|
devInfo: channel.devInfo,
|
||||||
dataList: channel.dataList.map((dataItem: any) => ({
|
dataList: channel.dataList?.map((dataItem: any) => ({
|
||||||
timeDev: dataItem.timeDev,
|
timeDev: dataItem.timeDev,
|
||||||
uaDev: dataItem.uaDev,
|
uaDev: dataItem.uaDev,
|
||||||
ubDev: dataItem.ubDev,
|
ubDev: dataItem.ubDev,
|
||||||
@@ -392,8 +233,8 @@ const open = async (mapping : Record<string, Record<string, string>>,data : any)
|
|||||||
uaStdDev: dataItem.uaStdDev,
|
uaStdDev: dataItem.uaStdDev,
|
||||||
ubStdDev: dataItem.ubStdDev,
|
ubStdDev: dataItem.ubStdDev,
|
||||||
ucStdDev: dataItem.ucStdDev
|
ucStdDev: dataItem.ucStdDev
|
||||||
}))
|
})) || []
|
||||||
}))
|
})) || []
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} else if (parsedData && typeof parsedData === 'object') {
|
} else if (parsedData && typeof parsedData === 'object') {
|
||||||
@@ -401,8 +242,11 @@ const open = async (mapping : Record<string, Record<string, string>>,data : any)
|
|||||||
Object.assign(convertedData, parsedData);
|
Object.assign(convertedData, parsedData);
|
||||||
}
|
}
|
||||||
testDataStructure.value = convertedData;
|
testDataStructure.value = convertedData;
|
||||||
|
console.log('testDataStructure:', testDataStructure.value);
|
||||||
channelMapping.value = mapping;
|
channelMapping.value = mapping;
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
|
// 使用 nextTick 确保 DOM 更新后再初始化数据
|
||||||
|
await nextTick();
|
||||||
// 初始化数据和状态
|
// 初始化数据和状态
|
||||||
initAllTableData();
|
initAllTableData();
|
||||||
|
|
||||||
@@ -419,6 +263,11 @@ const exportData = () => {
|
|||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
dialogVisible.value = false;
|
dialogVisible.value = false;
|
||||||
|
// 清空数据
|
||||||
|
testDataStructure.value = {};
|
||||||
|
tableDataMap.value = {};
|
||||||
|
selectedChannels.value = {};
|
||||||
|
tabStatus.value = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
defineExpose({ open });
|
defineExpose({ open });
|
||||||
|
|||||||
Reference in New Issue
Block a user