Bläddra i källkod

[Style 0000] 更新测点页面高度、测点树样式

houzekong 1 år sedan
förälder
incheckning
f62781bab0

+ 14 - 3
src/views/vent/monitor/site/components/siteTree.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="overflow-auto">
     <Tree
       v-if="processedTreeData.length"
       :tree-data="processedTreeData"
@@ -10,7 +10,12 @@
     >
       <template #icon="scope">
         <Icon v-if="scope.selected" icon="material-symbols:circle" color="green" />
-        <Icon v-else-if="scope.selectable" icon="material-symbols:circle" />
+        <Icon v-else-if="scope.leaf && scope.selectable" icon="material-symbols:circle" />
+        <Icon
+          v-else-if="scope.leaf && !scope.selectable"
+          icon="material-symbols:circle"
+          color="red"
+        />
       </template>
     </Tree>
 
@@ -37,7 +42,8 @@
     const res: TreeNode = {
       title: node.label,
       key: node.id,
-      selectable: !!node.x,
+      selectable: !!node.display,
+      leaf: !!node.leafNode,
       raw: node,
       children: [],
     };
@@ -77,3 +83,8 @@
     expandedKeys,
   });
 </script>
+<style scoped>
+  ::v-deep(.vMonitor-tree) {
+    background-color: transparent;
+  }
+</style>

+ 1 - 2
src/views/vent/monitor/site/index.vue

@@ -110,7 +110,6 @@
   .monitor-site {
     position: relative;
     width: 100%;
-    height: calc(100vh - 60px);
-    margin-top: 50px;
+    height: 100%;
   }
 </style>

+ 1 - 0
src/views/vent/monitor/site/types/siteTree.ts

@@ -3,5 +3,6 @@ export interface TreeNode {
   key: string;
   children: TreeNode[];
   selectable: boolean;
+  leaf: boolean;
   [k: string]: unknown;
 }