diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html index a36c561..0ac082f 100644 --- a/Frontend/_dashboard.html +++ b/Frontend/_dashboard.html @@ -2,9 +2,9 @@
- -
- + +
+
@@ -144,7 +144,7 @@
- +
@@ -156,10 +156,10 @@
- +
- +
@@ -183,7 +183,7 @@
-->
- +
@@ -202,16 +202,16 @@
+
+
+ 3/10 +
+
+ +

14,134

+
+
+
-->
已完成
6
@@ -237,7 +237,7 @@ \ No newline at end of file diff --git a/Frontend/index.html b/Frontend/index.html index e232a14..14b0b0d 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -1978,6 +1978,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
+ + @@ -2253,6 +2255,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li $("#lightSchModal").modal("show"); } }) + + onEvent("click", "#testsysbtn", function () { + + }) $(window).on("timeout:3s", function () { getSystemAlarmByBaja((data) => { @@ -2357,13 +2363,13 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li } // Card 呈現初始化 - function initPopover(type = null) { - $("[name=devItem]").each((index, ele) => { + function initPopover(type = null, extOption = {},selector = "[name=devItem]") { + $(selector).each((index, ele) => { let devNum = $(ele).data("number"); //設備編號 let devGuid = $(ele).data("id"); //guid let devName = $(ele).data("name"); //full_name let lightHtml = type == "light" ? `` : ""; - $(ele).YTTooltip({ + let option = { html: `
@@ -2402,10 +2408,14 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li //loadErrRecTable2($(oriEle).data("number")); //loadErrRecTable(); loadErr($(oriEle).data("number")); - $(tooltipEle).find("#info").html(typeof drawInfoTabBlo != "undefined"? drawInfoTabBlo(devGuid) : ""); - typeof subDeviceSetTable != "undefined "? subDeviceSetTable($(oriEle).data("number")) : "" + $(tooltipEle).find("#info").html(typeof drawInfoTabBlo != "undefined" ? drawInfoTabBlo(devGuid) : ""); + typeof subDeviceSetTable != "undefined " ? subDeviceSetTable($(oriEle).data("number")) : "" } - }) + }; + + $.extend(option, extOption); + + $(ele).YTTooltip(option); }) } diff --git a/Frontend/js/forge/forgemodel.js b/Frontend/js/forge/forgemodel.js index 3729e3c..1a927de 100644 --- a/Frontend/js/forge/forgemodel.js +++ b/Frontend/js/forge/forgemodel.js @@ -640,7 +640,7 @@ async function addHotPoint(data) { const dbId = 10 + index; const myPosition = myData.position; const viewable = new DataVizCore.SpriteViewable(myPosition, style, dbId); - + myData._dbId = dbId; viewableData.addViewable(viewable); }); @@ -653,7 +653,8 @@ async function addHotPoint(data) { if (event.dbId >= 10 && event.dbId <= 13) {//event.dbId > 0 && event.dbId < 19 console.log(`Sprite clicked: ${event.dbId}`); openHotspotModal(); - $(selector).trigger("autodesk:click:sprite", event); + let myData = myDataList.filter(x => x._dbId == event.dbId)[0]; + $(selector).trigger("autodesk:click:sprite", event, myData); } if (event.clickInfo != null) { diff --git a/Frontend/js/yourteam/plugins/yt-tooltip/yt-tooltip.js b/Frontend/js/yourteam/plugins/yt-tooltip/yt-tooltip.js index f0b9dc2..60208ba 100644 --- a/Frontend/js/yourteam/plugins/yt-tooltip/yt-tooltip.js +++ b/Frontend/js/yourteam/plugins/yt-tooltip/yt-tooltip.js @@ -31,6 +31,12 @@ $.fn.YTTooltip = function (option) { hideTooltipEvent: hideTooltipEvent, onShow: option.onShow || null, group: option.group || null, + targetPosition: { + left: option.tpLeft || null, + top: option.tpTop || null, + offsetWidth: option.tpOffWidth || null, + offsetHeight: option.tpOffHeight || null, + } }; if (obj.toggle == "hover") { @@ -49,10 +55,21 @@ $.fn.YTTooltip = function (option) { let bodyHeight = $("body")[0].offsetHeight; //計算引用元素 offset let offset = $(this).offset(); + if (obj.targetPosition.left != null) { + offset.left = obj.targetPosition.left; + } + if (obj.targetPosition.top != null) { + offset.top = obj.targetPosition.top; + } //引用元素 高寬 let width = $(this)[0].offsetWidth; + if (obj.targetPosition.offsetWidth != null) { + width = obj.targetPosition.offsetWidth; + } let height = $(this)[0].offsetHeight; - + if (obj.targetPosition.offsetHeight != null) { + height = obj.targetPosition.offsetHeight; + } $(this).data("yttooltipid", ranId); $(clone).attr("id", "yt_tooltip_" + ranId); if (obj.group) { @@ -85,15 +102,17 @@ $.fn.YTTooltip = function (option) { } else if (obj.direction == "right") { left = offset.left + toolWidth + width > bodyWidth ? offset.left - toolWidth - 10 : offset.left + width + 10; } else if (obj.direction == "bottom") { + left = offset.left + toolWidth + width > bodyWidth ? offset.left - toolWidth - 10 : offset.left; top = offset.top + toolHeight + height > bodyHeight ? offset.top + height + 10 : offset.top + height + 10; } else if (obj.direction == "top") { + left = offset.left + toolWidth + width > bodyWidth ? offset.left - toolWidth - 10 : offset.left; top = offset.top < toolHeight ? offset.top + height + 5 : offset.top - toolHeight - 10; } if (obj.direction == "left" || obj.direction == "right") { $(clone).css({ left: left, top: offset.top }); } else if (obj.direction == "top" || obj.direction == "bottom"){ - $(clone).css({ left: offset.left, top: top}); + $(clone).css({ left: left, top: top}); } setTimeout(function () { obj.onShow ? obj.onShow(clone, obj.ele, obj) : "";