From 280edfe55b8f48648d332ae0e33e219b8bae49fa Mon Sep 17 00:00:00 2001
From: guonan <guonan201020@163.com>
Date: 星期二, 15 四月 2025 15:29:36 +0800
Subject: [PATCH] 修改样式

---
 src/components/menu/Device.vue |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/src/components/menu/Device.vue b/src/components/menu/Device.vue
index 08bb263..11d5ac4 100644
--- a/src/components/menu/Device.vue
+++ b/src/components/menu/Device.vue
@@ -29,7 +29,7 @@
       >
         <template #default="{ node, data }">
           <span v-if="!data.children" class="device-tree-item">
-            <div class="device-item-icon"></div>
+            <!-- <div class="device-item-icon"></div> -->
             <span class="device-item-text">{{ node.label }}</span>
           </span>
           <span v-else class="device-tree-category">
@@ -74,18 +74,18 @@
 
 const devicetList = ref([
   {
-    deviceCode: "303A9016",
-    deviceId: "1821067878870257666",
-    deviceName: "瀛欒儭娌�(澧掓儏)",
-    dictDeviceType: "1437295822",
-    latitude: 40.56476666,
-    longitude: 116.5955361,
-  },
-  {
     deviceCode: "01303A9016",
     deviceId: "1821067850122498049",
     deviceName: "瀛欒儭娌�(澧掓儏)",
     dictDeviceType: "14372958380",
+    latitude: 40.56476666,
+    longitude: 116.5955361,
+  },
+  {
+    deviceCode: "303A9016",
+    deviceId: "1821067878870257666",
+    deviceName: "瀛欒儭娌�(澧掓儏)",
+    dictDeviceType: "1437295822",
     latitude: 40.56476666,
     longitude: 116.5955361,
   },
@@ -241,18 +241,26 @@
 };
 
 // 璁$畻灞炴�э細灏嗚澶囧垪琛ㄨ浆鎹负鏍戝舰缁撴瀯
+// 璁$畻灞炴�э細灏嗚澶囧垪琛ㄨ浆鎹负鏍戝舰缁撴瀯
 const deviceTree = computed(() => {
   const typeMap = {};
 
   // 鍏堟寜璁惧绫诲瀷鍒嗙粍
   devicetList.value.forEach((device) => {
     const typeName = getDictName(deviceDictList, device.dictDeviceType);
+
+    if (!typeName) {
+      console.warn("鏈壘鍒拌澶囩被鍨�:", device);
+      return;
+    }
+
     if (!typeMap[typeName]) {
       typeMap[typeName] = [];
     }
+    // 鐩存帴浣跨敤鍘熷鐨勮澶囧悕绉帮紝涓嶈繘琛屼换浣曟浛鎹㈡搷浣�
     typeMap[typeName].push({
       ...device,
-      deviceName: device.deviceName.replace(`${typeName})`, ")"), // 绉婚櫎閲嶅鐨勭被鍨嬪悕
+      deviceName: device.deviceName.trim(), // 鍙幓闄ら灏剧┖鏍�
     });
   });
 
@@ -262,7 +270,6 @@
     children: typeMap[typeName],
   }));
 });
-
 function handleTreeNodeClick(data) {
   // 鍙湁璁惧鑺傜偣鎵嶅鐞嗙偣鍑讳簨浠�
   if (!data.children) {
@@ -295,7 +302,7 @@
 .device-content {
   padding: 10px;
   overflow-y: auto;
-  height: calc(100% - 40px);
+  height: calc(100% - 70px);
 }
 
 .device-tree {
@@ -303,6 +310,8 @@
   background: transparent;
   color: white;
   margin-top: 10px;
+  width: 100%;
+  overflow-x: auto;
 
   :deep(.el-tree-node__content) {
     height: 30px;
@@ -352,4 +361,7 @@
   color: white !important;
   background-color: rgb(38, 124, 124, 0.5);
 }
+:deep(.el-tree-node__content) {
+  padding-left: 0px !important ;
+}
 </style>

--
Gitblit v1.9.3