|
@@ -50,6 +50,8 @@ const menuVisible = ref(false);
|
|
|
const menuX = ref(0);
|
|
|
const menuY = ref(0);
|
|
|
let selectedNode = null;
|
|
|
+const firstLevelKeys = ref([])
|
|
|
+
|
|
|
const handleRightClick = (event, { node, data }) => {
|
|
|
event.preventDefault();
|
|
|
menuX.value = event.clientX;
|
|
@@ -76,7 +78,11 @@ const handleMenuClick = (action) => {
|
|
|
const getTree = async () => {
|
|
|
const res = await DeviceCategoryApi.IotProductClassifyApi.getSimpleProductClassifyList()
|
|
|
deviceCategoryList.value = []
|
|
|
- deviceCategoryList.value.push(...handleTree(res))
|
|
|
+ let device: Tree = { id: 0, name: '顶级设备分类', children: [] }
|
|
|
+ device.children = handleTree(res)
|
|
|
+ // deviceCategoryList.value.push(...handleTree(res))
|
|
|
+ deviceCategoryList.value.push(device)
|
|
|
+ firstLevelKeys.value = deviceCategoryList.value.map(node => node.id);
|
|
|
}
|
|
|
|
|
|
/** 基于名字过滤 */
|