[Frontend][系統監控] 電梯管理 列表 排序關閉 | datatable stateSave 關閉

This commit is contained in:
dev01 2022-12-02 09:38:06 +08:00
parent 5a45dba1e6
commit 4d9088849f
2 changed files with 37 additions and 32 deletions

View File

@ -1030,9 +1030,10 @@
let result = []; let result = [];
let masterList = allDevList.map(x => x.device_number.split("_")[5]).Distinct(); let masterList = allDevList.map(x => x.device_number.split("_")[5]).Distinct();
// Master(第六段) 區分 // Master(第六段) 區分
$.each(masterList, (idx, master) => { $.each(masterList, (idx, master) => {
debugger
let main = {}; let main = {};
// 匯入 Master 名稱` // 匯入 Master 名稱`
main.devName = master; main.devName = master;
@ -1043,28 +1044,30 @@
main[subKey] = subData[subKey]; main[subKey] = subData[subKey];
} }
}) })
}
main._rowType = "master";
result.push(main);
// 該 Master 底下的設備
let devListByMaster = allDevList.filter(x => x.device_number.split("_")[5] == master);
$.each(devListByMaster, (idx2, devObj) => { main._rowType = "master";
let subData = subSeviceData.filter(x => x.device_number == devObj.device_number)[0]; result.push(main);
if (subData) { // 該 Master 底下的設備
main = {}; let devListByMaster = allDevList.filter(x => x.device_number.split("_")[5] == master);
main.devNum = devObj.device_number;
main.devName = devObj.full_name; $.each(devListByMaster, (idx2, devObj) => {
main._rowType = "device"; let subData = subSeviceData.filter(x => x.device_number == devObj.device_number)[0];
// 該設備點位匯入 if (subData) {
$.each(Object.keys(subData), (idx3, subKey) => { main = {};
main[subKey] = subData[subKey]; main.devNum = devObj.device_number;
}) main.devName = devObj.full_name;
// 匯入設備資訊(訂閱點位) main._rowType = "device";
result.push(main); // 該設備點位匯入
} $.each(Object.keys(subData), (idx3, subKey) => {
}) main[subKey] = subData[subKey];
})
// 匯入設備資訊(訂閱點位)
result.push(main);
}
})
}
}) })
console.log("result:",result)
return result; return result;
} }
@ -1318,15 +1321,16 @@
let datas = []; let datas = [];
let column_defs = [ let column_defs = [
{ "targets": [0], "width": "11%", "sortable": true }, { "targets": [0], "width": "10%", "sortable": false },
{ "targets": [1], "width": "11%", "sortable": true }, { "targets": [1], "width": "10%", "sortable": false },
{ "targets": [2], "width": "11%", "sortable": true }, { "targets": [2], "width": "10%", "sortable": false },
{ "targets": [3], "width": "11%", "sortable": true }, { "targets": [3], "width": "10%", "sortable": false },
{ "targets": [4], "width": "11%", "sortable": true }, { "targets": [4], "width": "10%", "sortable": false },
{ "targets": [5], "width": "11%", "sortable": true }, { "targets": [5], "width": "10%", "sortable": false },
{ "targets": [6], "width": "11%", "sortable": true }, { "targets": [6], "width": "10%", "sortable": false },
{ "targets": [7], "width": "11%", "sortable": true }, { "targets": [7], "width": "10%", "sortable": false },
{ "targets": [8], "width": "12%", "sortable": true }, { "targets": [8], "width": "10%", "sortable": false },
{ "targets": [9], "width": "10%", "sortable": false },
]; ];
let columns = [ let columns = [
@ -1392,6 +1396,7 @@
]; ];
eleManTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "tpi"); eleManTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "tpi");
eleManTable.order([]).draw();
} }
// 電梯管理 Modal - 設置 Detail 訂閱內容 // 電梯管理 Modal - 設置 Detail 訂閱內容
@ -2373,7 +2378,7 @@
//載入3D模型 //載入3D模型
function load3DModel() { function load3DModel() {
debugger
launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDLm53ZA==', (viewer) => { launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDLm53ZA==', (viewer) => {
$.each(viewer3DNodeIds, function (idx, node) { $.each(viewer3DNodeIds, function (idx, node) {

View File

@ -57,7 +57,7 @@ function fnInitJqDataTablesNoData(tag, dataSet = null, columns = null, columnDef
"processing": true, "processing": true,
"columns": columns, "columns": columns,
"aoColumnDefs": columnDefs, "aoColumnDefs": columnDefs,
"stateSave": true, "stateSave": false,
"pagingType": "full_numbers", "pagingType": "full_numbers",
"destroy": false, "destroy": false,
"initComplete": initComplete, "initComplete": initComplete,