|
@@ -32,6 +32,9 @@
|
|
|
<template v-if="column.key === 'netStatus'">
|
|
<template v-if="column.key === 'netStatus'">
|
|
|
<a-tag :color="statusColor(record.netStatus)">{{ statusText(record.netStatus) }}</a-tag>
|
|
<a-tag :color="statusColor(record.netStatus)">{{ statusText(record.netStatus) }}</a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-if="column.key === 'strname'">
|
|
|
|
|
+ <div @click="locateIcon(record.deviceID)">{{ record.strname}}</div>
|
|
|
|
|
+ </template>
|
|
|
<template v-if="column.key === 'action'">
|
|
<template v-if="column.key === 'action'">
|
|
|
<a-button v-if="!isDevicePlaced(record)" type="primary" size="small" @click="enterPlacingMode(record)">布点</a-button>
|
|
<a-button v-if="!isDevicePlaced(record)" type="primary" size="small" @click="enterPlacingMode(record)">布点</a-button>
|
|
|
<a-button v-else type="link" size="small" danger @click="revokePlacement(record)">撤销</a-button>
|
|
<a-button v-else type="link" size="small" danger @click="revokePlacement(record)">撤销</a-button>
|
|
@@ -68,7 +71,7 @@ const baseApiUrl = globSetting.domainUrl;
|
|
|
const placingDevice = ref<DeviceRecord | null>(null);
|
|
const placingDevice = ref<DeviceRecord | null>(null);
|
|
|
const currentCoord = reactive({ x: 0, y: 0, z: 0 });
|
|
const currentCoord = reactive({ x: 0, y: 0, z: 0 });
|
|
|
const columns = [
|
|
const columns = [
|
|
|
- { title: '设备名称', dataIndex: 'strname', ellipsis: true, align: 'center' },
|
|
|
|
|
|
|
+ { title: '设备名称' ,key: 'strname', dataIndex: 'strname', ellipsis: true, align: 'center' },
|
|
|
{ title: '状态', key: 'netStatus', width: 60, align: 'center' },
|
|
{ title: '状态', key: 'netStatus', width: 60, align: 'center' },
|
|
|
{ title: '操作', key: 'action', width: 60, align: 'center' },
|
|
{ title: '操作', key: 'action', width: 60, align: 'center' },
|
|
|
];
|
|
];
|
|
@@ -428,6 +431,17 @@ const baseApiUrl = globSetting.domainUrl;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+/**
|
|
|
|
|
+ * 根据设备 id 定位 CAD 图中的设备图标(APP 调用接口)
|
|
|
|
|
+ * 定位后:图标显示到屏幕中间、视图调到合适远近、弹框显示设备信息
|
|
|
|
|
+ * @param id 设备图标 id(数字或字符串)
|
|
|
|
|
+ * @returns 是否定位成功(布尔,由组件返回)
|
|
|
|
|
+ */
|
|
|
|
|
+function locateIcon(id: number | string) {
|
|
|
|
|
+ const ok = viewerRef.value?.locateIconById(id);
|
|
|
|
|
+ console.log(`定位设备 ${id}:`, ok ? "成功" : "未找到");
|
|
|
|
|
+ return ok;
|
|
|
|
|
+}
|
|
|
function loadCAD(data){
|
|
function loadCAD(data){
|
|
|
cadData.value = data;
|
|
cadData.value = data;
|
|
|
console.log(`Loaded ${data.features.length} CAD features`);
|
|
console.log(`Loaded ${data.features.length} CAD features`);
|