[Frontend] datatable ajax 讀取判斷是否為後端API Object 另存取datas | [系統監控] tooltip 跳出增加設備名稱
This commit is contained in:
parent
eba8bba41e
commit
c0e2ae2f71
1
.gitignore
vendored
1
.gitignore
vendored
@ -361,3 +361,4 @@ MigrationBackup/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
/Backend/wwwroot/upload/floor_map.zip
|
||||
|
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 105 KiB |
@ -1,6 +1,6 @@
|
||||
<style>
|
||||
[id^=yt_tooltip] {
|
||||
width: 450px;
|
||||
width: 600px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
$.each(floObj.device_list, (index2, devObj) => {
|
||||
console.log(">>>> url: " + baseImgUrl + " , img: " + varPathImg + ", icon: " + devObj.device_master_icon);
|
||||
strHtml += `<div name="devItem" data-id="${devObj.device_guid}" data-number="${devObj.device_number}" class="mr-5 cur-poi">
|
||||
strHtml += `<div name="devItem" data-id="${devObj.device_guid}" data-number="${devObj.device_number}" data-name="${devObj.full_name}" class="mr-5 cur-poi">
|
||||
<span class="status status-success d-inline-block">
|
||||
<img src="${baseImgUrl + varPathImg + devObj.device_master_icon}" class="profile-image rounded-circle" onerror="defDev(this)" alt="...">
|
||||
</span> ${devObj.full_name}
|
||||
@ -144,9 +144,13 @@
|
||||
$("[name=devItem]").each((index, ele) => {
|
||||
let devNum = $(ele).data("number"); //設備編號
|
||||
let devGuid = $(ele).data("id"); //guid
|
||||
let devName = $(ele).data("name"); //full_name
|
||||
$(ele).YTTooltip({
|
||||
html: `<div class="card m-1 border device-wrap">
|
||||
<div class="card-header p-2 px-3">
|
||||
<div class="position-absolute w-50" style="word-break: break-all;">
|
||||
<label class="m-0 mt-2">${devName}</label>
|
||||
</div>
|
||||
<div id="card-tab" class="row justify-content-end nav nav-tabs" role="tablist">
|
||||
<button type="button" id="state-tab" class="btn btn-icon nav-link active" role="tab" data-tabname="cardTab" data-target="#state"><i class="fa fa-desktop icon"></i></button>
|
||||
<button type="button" id="info-tab" class="btn btn-icon nav-link" role="tab" data-tabname="cardTab" data-target="#info"><i class="fa fa-cog icon"></i></button>
|
||||
@ -200,7 +204,7 @@
|
||||
let columns = [
|
||||
{
|
||||
"title": "類型",
|
||||
"data": "work_type",
|
||||
"data": "work_type_name",
|
||||
},
|
||||
{
|
||||
"title": "項目",
|
||||
@ -269,7 +273,7 @@
|
||||
let result = '{"count": 2,"data":[{ "uuid": "43dc7846-bd96-4be2-ab35-f11aec729c60","msgText": "","ackState": "1","timestamp": "2022-Nov-16 10:30:24.951 AM UTC+08:00"},{"uuid": "7c309846-d862-4a8b-803b-cdc8e0efa092","msgText": "","ackState": "1","timestamp": "2022-Nov-16 10:00:24.893 AM UTC+08:00"}]}';
|
||||
let json_object = JSON.parse(result);
|
||||
datas = json_object['data'];
|
||||
errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs);
|
||||
errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "tpi");
|
||||
}
|
||||
|
||||
//function loadErrRecTable2(allPath) {
|
||||
|
@ -15,6 +15,7 @@
|
||||
var currentData = [];
|
||||
var allDeviceRowData = []; //所有設備原始資料
|
||||
var global_emergency_alarm_device_number = [];
|
||||
var zoomToggle = 3;
|
||||
$(function () {
|
||||
initChart();
|
||||
getFloData();
|
||||
@ -565,7 +566,7 @@
|
||||
obj.symbolSize = 60
|
||||
}
|
||||
console.log(item.zoom)
|
||||
if (item.zoom > 8) {
|
||||
if (item.zoom > zoomToggle) {
|
||||
obj.symbolSize = 10
|
||||
}
|
||||
res.push(obj);
|
||||
@ -771,7 +772,7 @@
|
||||
zoom = floChart.getOption().geo[0].zoom;
|
||||
}
|
||||
|
||||
if (zoom <= 8) {
|
||||
if (zoom <= zoomToggle) {
|
||||
floChart.setOption({
|
||||
series: [{
|
||||
symbolOffset: [0, 0],
|
||||
|
@ -4,6 +4,7 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ================================================================ */
|
||||
/* 單一方法 */
|
||||
/* ================================================================ */
|
||||
|
@ -144,6 +144,9 @@ function fnInitJqDataTablesAjax(apiUrl, tag, sendData = null, columns, columns_d
|
||||
if (sendData == null) {
|
||||
sendData = function (json) {
|
||||
console.log("讀取列表", json)
|
||||
if (json.code && json.code == "0000") {
|
||||
return json.data;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user