From 366e8053d77db67dee65a31e3510d14901f14e11 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期六, 16 十一月 2024 15:46:28 +0800
Subject: [PATCH] 解决水流动画显示问题,之后关于水流动画应该不会再更新了

---
 WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicCalcuCustomLabel.js |   56 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicCalcuCustomLabel.js b/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicCalcuCustomLabel.js
index 4b575ec..031248a 100644
--- a/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicCalcuCustomLabel.js
+++ b/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicCalcuCustomLabel.js
@@ -18,7 +18,7 @@
 //娣诲姞涓氬姟璁$畻鑷畾涔夋爣绛鹃」
 function addLogicCalcuCustomLabel(item) {
     let content = document.createElement('div');
-    content.className = 'w-fit rounded-md space-y-1.5 text-nowrap flex flex-col';
+    content.className = 'w-fit rounded-md text-nowrap flex';
     content.style.color = 'white';
     content.style.backgroundColor = '#32d3a6';
     content.style.padding = '5px';
@@ -31,6 +31,9 @@
     config.opacity = 1;
     config.objectId = item.id;
     config.id = "LogicCalcuCustomLabel" + item.id;
+    config.visibleDistance = item.distance;
+    _logicCalcuCustomLabelIds.add(config.id);
+
     let boundingBox = _modeler.getBoundingBoxById(item.id);
     let boundingBoxMin = boundingBox.min;
     let boundingBoxMax = boundingBox.max;
@@ -42,6 +45,7 @@
 
     let customItem = new Glodon.Bimface.Plugins.Drawable.CustomItem(config);
     _drawableContainer.addItem(customItem);
+    //customItem.setVisibleDistance(item.distance);
 }
 
 //鑾峰彇涓氬姟璁$畻鏁版嵁鍐呭html
@@ -50,14 +54,42 @@
         return '';
     }
     let html = '';
-    data.forEach((d) => {
-        html += `
-        <div class="flex justify-between  items-center">
-        <span>${d.name}</span>
-        <span class="p-x-8">${d.value}</span>
-        <span>${d.unit}</span>
-        </div>`;
-    });
+    // 鍗曞厓鏍奸珮
+    const cellHeight = 18;
+    // 涓棿鐨勫�煎垪涓庝袱杈归棿璺�
+    const middleOffset = 2;
+
+    const nameColListHtml = data
+        .map((item) => `<span class="flex-items-center justify-start" style="height: ${cellHeight}px">${item.name}</span>`)
+        .join('');
+    // 鍚嶇О鍒�
+    const nameColHtml = `
+			<div class="flex flex-col">
+                ${nameColListHtml}
+			</div>
+    `;
+
+    const valueColListHtml = data
+        .map((item) => `<span class="flex-items-center justify-center" style="height: ${cellHeight}px">${item.value}</span>`)
+        .join('');
+    // 鍊煎垪锛屽�煎垪闇�瑕佷笌涓よ竟鏈夐棿璺�
+    const valueColHtml = `
+			<div class="flex flex-col" style="margin-left: ${middleOffset}px; margin-right: ${middleOffset}px">
+                ${valueColListHtml}
+			</div>
+    `;
+
+    const unitColListHtml = data
+        .map((item) => `<span class="flex-items-center justify-end" style="height: ${cellHeight}px">${item.unit}</span>`)
+        .join('');
+    // 鍗曚綅鍒�
+    const unitColHtml = `
+			<div class="flex flex-col">
+                ${unitColListHtml}
+			</div>
+    `;
+
+    html += `${nameColHtml}${valueColHtml}${unitColHtml}`;
     return html;
 }
 
@@ -72,3 +104,9 @@
     }
 }
 
+
+
+
+
+
+

--
Gitblit v1.9.3