diff --git a/Backend/appsettings.json b/Backend/appsettings.json index 2034e27..42086f8 100644 --- a/Backend/appsettings.json +++ b/Backend/appsettings.json @@ -16,8 +16,8 @@ "MySqlDBConfig": { "Server": "FYlY+w0XDIz+jmF2rlZWJw==", //0.201 "Port": "js2LutKe+rdjzdxMPQUrvQ==", - "Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱 - //"Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp + //"Database": "VJB2XC+lAtzuHObDGMVOAA==", //三菱 + "Database": "IgYBsgG2VLKKxFb64j7LOA==", //wsp "Root": "SzdxEgaJJ7tcTCrUl2zKsA==", "Password": "FVAPxztxpY4gJJKQ/se4bQ==" } diff --git a/Backend/wwwroot/upload/device_icon/8c002c60-15f0-42ad-b188-59daa4ca7508.png b/Backend/wwwroot/upload/device_icon/8c002c60-15f0-42ad-b188-59daa4ca7508.png new file mode 100644 index 0000000..1775a4f Binary files /dev/null and b/Backend/wwwroot/upload/device_icon/8c002c60-15f0-42ad-b188-59daa4ca7508.png differ diff --git a/Backend/wwwroot/upload/device_icon/ae934b5c-d1db-49eb-bda7-e4f2d48221e8.png b/Backend/wwwroot/upload/device_icon/ae934b5c-d1db-49eb-bda7-e4f2d48221e8.png new file mode 100644 index 0000000..1775a4f Binary files /dev/null and b/Backend/wwwroot/upload/device_icon/ae934b5c-d1db-49eb-bda7-e4f2d48221e8.png differ diff --git a/Frontend/_dashboard.html b/Frontend/_dashboard.html index 51df0a6..a36c561 100644 --- a/Frontend/_dashboard.html +++ b/Frontend/_dashboard.html @@ -354,7 +354,7 @@ // 今日用電量 - getElectricMeterDayDataByBaja(devNum + "_KWH", "Mitsubishi_Sup", today, tomorrow, (data) => { + getElectricMeterDayDataByBaja(devNum + "_kWh_tot", n4Sup, today, tomorrow, (data) => { let result = data?.data[0]?.sum; result = result ? parseFloat(result).toFixed(2) : 0; $("#todayUseElec").text(result); @@ -362,7 +362,7 @@ }) // 今日用電量 (每小時) - getElectricMeterHourDataByBaja(devNum + "_KWH", "Mitsubishi_Sup", yesterday, tomorrow, (data) => { + getElectricMeterHourDataByBaja(devNum + "_kWh_tot", n4Sup, yesterday, tomorrow, (data) => { let todayData = data.data.filter(x => x.timestamp.$date.$year == getTimeByType("year") && x.timestamp.$date.$month == getTimeByType("month") && x.timestamp.$date.$day == getTimeByType("date")); let yesData = data.data.filter(x => x.timestamp.$date.$year == getTimeByType("year", -1) && x.timestamp.$date.$month == getTimeByType("month", -1) && x.timestamp.$date.$day == getTimeByType("date", -1)); @@ -371,7 +371,7 @@ }) // 昨日用電量 - getElectricMeterDayDataByBaja(devNum + "_KWH", "Mitsubishi_Sup", yesterday, today, (data) => { + getElectricMeterDayDataByBaja(devNum + "_kWh_tot", n4Sup, yesterday, today, (data) => { let result = data?.data[0]?.sum; result = result ? parseFloat(result).toFixed(2) : 0; $("#yesUseElec").text(result); @@ -379,7 +379,7 @@ }) // 本週與上週用電量 (每天) - getElectricMeterDayDataByBaja(devNum + "_KWH", "Mitsubishi_Sup", prevTwoWeek, tomorrow, (data) => { + getElectricMeterDayDataByBaja(devNum + "_kWh_tot", n4Sup, prevTwoWeek, tomorrow, (data) => { let curDay = (new Date()).getDay() == 0 ? 7 : (new Date()).getDay(); let curWeekData = data.data.filter(x => strToDate(displayDate(new Date(), "date"), null, 0 - (curDay - 1)) <= strToDate(x.timestamp.$cEncStr)); let prevWeekData = data.data.filter(x => strToDate(displayDate(new Date(), "date"), null, 0 - 7 - (curDay - 1)) <= strToDate(x.timestamp.$cEncStr) && strToDate(new Date(), null, 0 - 7) >= strToDate(x.timestamp.$cEncStr)); diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index fee24f1..e42bfa6 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -3,18 +3,42 @@
- +
+ + + \ No newline at end of file diff --git a/Frontend/css/yourteam/plugins/yt-tooltip/yt-tooltip.css b/Frontend/css/yourteam/plugins/yt-tooltip/yt-tooltip.css index a9de2a9..cbc7338 100644 --- a/Frontend/css/yourteam/plugins/yt-tooltip/yt-tooltip.css +++ b/Frontend/css/yourteam/plugins/yt-tooltip/yt-tooltip.css @@ -4,5 +4,6 @@ border-radius: 5px; box-shadow: 0px 0px 11px 3px rgb(0 0 0 / 20%); min-width:100px; + z-index:2001; } diff --git a/Frontend/index.html b/Frontend/index.html index 83f16d8..a6b4fbb 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -2035,7 +2035,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li var jwt = null; var loadingTip = ''; var pageAct = {}; //記錄全頁面已選擇項目 - pageAct.AreaTag = "TPE"; + pageAct.AreaTag = ""; if (location.href.indexOf("ord") != -1) { location.href = "/file/index.html" } @@ -2114,6 +2114,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li function loadedJsPack() { cookies = new YourTeam.Utility.Cookie(); jwt = cookies.get("JWT-Authorization"); + pageAct.AreaTag = initAreaTag; loadEvent(); if (!jwt) { @@ -2246,6 +2247,14 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li }) + onEvent("yt:tab:change", "#lightSch-tab", function () { + debugger + if (pageAct.sysMainTag == "LT" && $("#lightSchModal").length != 0) { + loadLightSchTable(); + $("#lightSchModal").modal("show"); + } + }) + $(window).on("timeout:3s", function () { getSystemAlarmByBaja((data) => { if (typeof getAlarmSub != "undefined" && getAlarmSub) { @@ -2349,11 +2358,12 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li } // Card 呈現初始化 - function initPopover() { + function initPopover(type = null) { $("[name=devItem]").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({ html: `
@@ -2364,6 +2374,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
-
${drawStateTabBlo(devNum)}
- ${drawInfoTabBlo(devGuid)} +
${drawErrRecTabBlo()} @@ -2384,10 +2394,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
${drawOpeRecTabBlo()}
- - -
-
`, + + `, group: "device", onShow: function (tooltipEle, oriEle) { var tab = new YT.Tab({ tabName: "cardTab" }) @@ -2395,7 +2403,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li //loadErrRecTable2($(oriEle).data("number")); //loadErrRecTable(); loadErr($(oriEle).data("number")); - subDeviceSetTable ? subDeviceSetTable($(oriEle).data("number")) : "" + $(tooltipEle).find("#info").html(typeof drawInfoTabBlo != "undefined"? drawInfoTabBlo(devGuid) : ""); + typeof subDeviceSetTable != "undefined "? subDeviceSetTable($(oriEle).data("number")) : "" } }) }) @@ -2440,6 +2449,67 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li let opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "tpi"); } + function loadLightSchTable(devGuid) { + + /*let url = baseApiUrl + "/api/Device/GetOpeDevice?device_guid=" + devGuid;*/ + let url = `https://63772efc5c47776512165937.mockapi.io/api/GetLightSche`; + let tag = "#lightSchTable"; + + let column_defs = [ + { "targets": [0], "width": "14%", "sortable": true }, + { "targets": [1], "width": "14%", "sortable": true }, + { "targets": [2], "width": "14%", "sortable": true }, + { "targets": [3], "width": "14%", "sortable": true }, + { "targets": [4], "width": "14%", "sortable": true }, + { "targets": [5], "width": "14%", "sortable": true }, + { "targets": [6], "width": "16%", "sortable": true }, + ]; + + let columns = [ + { + "title": "序號", + "data": null, + "render": function (data, type, row,meta) { + return meta.row + 1; + }, + }, + { + "title": "排程名稱", + "data": "sch_name", + }, + { + "title": "設備數量", + "data": "dev_cnt", + }, + { + "title": "排程設定", + "data": "sch_set", + }, + { + "title": "動作", + "data": "action", + }, + { + "title": "狀態", + "data": "status", + }, + { + "title": "功能", + "data": "sch_id", + "render": function (data, type, row) { + let btnDiv = creDiv(["row", "m-0", "justify-content-center"], { "style": "gap:10px" }); + let icon = creI(["fas", "fa-pencil-alt"]); + btnDiv.append(creBtnHtml("觸發執行", "lightSchTabTogBtn" + data, null, ["btn", "btn-success"])); + btnDiv.append(creBtn("修改", "lightSchTabEdiBtn" + data, null, ["btn", "btn-danger"], { "toggle": "modal", "target": "#delModal" }).append(icon)); + return btnDiv.outerHtml(); + }, + }, + + ]; + + let lightSchTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "tpi"); + } + // Baja 取得異常紀錄 function loadErr(allPath) { if (allPath != undefined && allPath != null) { diff --git a/Frontend/js/forge/forgemodel.js b/Frontend/js/forge/forgemodel.js index dd52a24..3264074 100644 --- a/Frontend/js/forge/forgemodel.js +++ b/Frontend/js/forge/forgemodel.js @@ -104,7 +104,7 @@ function launchViewerNoTools(urn, callback) { Autodesk.Viewing.Initializer(options, () => { //viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('forgeViewer')); - viewer = new Autodesk.Viewing.Viewer3D($('forgeViewer')[0]); + viewer = new Autodesk.Viewing.Viewer3D($(selector)[0]); viewer.start(); var documentId = 'urn:' + urn; diff --git a/Frontend/js/site.js b/Frontend/js/site.js index e48d498..50d6da7 100644 --- a/Frontend/js/site.js +++ b/Frontend/js/site.js @@ -176,6 +176,9 @@ function creImg(ele, text = null, id = null, name = null, cls = [], data = {}, a return $(`<${ele} ${comp.attrText}>${comp.text}`); } +function creI(cls = [], data = {}, attr = {}, id = null, name = null, text = null) { + return creEle("i", text, id, name, cls, data, attr); +} /** * 根據該棟建築底下的'所有'電梯執行緒物件 * */