|
@@ -237,18 +237,49 @@ const getCustomImg = (iconName: string) => {
|
|
|
|
|
|
// 表格配置项
|
|
// 表格配置项
|
|
const columns = reactive<ColumnProps[]>([
|
|
const columns = reactive<ColumnProps[]>([
|
|
- { prop: "a", label: "状态"},
|
|
|
|
- { prop: "b", label: "状态值"},
|
|
|
|
- { prop: "c", label: "备注" },
|
|
|
|
|
|
+ { prop: "sta_name", label: "状态"},
|
|
|
|
+ { prop: "sta_value", label: "状态值"},
|
|
|
|
+ { prop: "sta_remark", label: "备注" },
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
|
|
-const handlePlatform = (item)=>{
|
|
|
|
- radio1.value = '1'
|
|
|
|
- itemData.value = item
|
|
|
|
- dialog2.visible = true
|
|
|
|
- dialog2.title = '传感器信息'
|
|
|
|
-}
|
|
|
|
|
|
+const handlePlatform = (item) => {
|
|
|
|
+ if (!item || typeof item !== 'object') {
|
|
|
|
+ console.error('Invalid item provided');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ radio1.value = '1';
|
|
|
|
+ itemData.value = item;
|
|
|
|
+ dialog2.visible = true;
|
|
|
|
+ dialog2.title = '传感器信息';
|
|
|
|
+
|
|
|
|
+ processTableData2.value = [];
|
|
|
|
+
|
|
|
|
+ const { se_type } = item;
|
|
|
|
+ if (se_type === undefined || se_type === null) {
|
|
|
|
+ console.error('Invalid se_type in item');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (se_type) {
|
|
|
|
+ case 0:
|
|
|
|
+ processTableData2.value = processTableFrom.value?.sta_yclq || [];
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ processTableData2.value = processTableFrom.value?.sta_txmk || [];
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ console.log(se_type);
|
|
|
|
+ const result = processTableFrom.value?.sta_list?.find(obj => obj.id === se_type.toString());
|
|
|
|
+ if (result) {
|
|
|
|
+ processTableData2.value = result.item || [];
|
|
|
|
+ } else {
|
|
|
|
+ console.warn(`No matching entry found for se_type: ${se_type}`);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
const itemData= ref({})
|
|
const itemData= ref({})
|
|
|
|
|