diff --git a/Frontend/js/n4js/alarmbaja.js b/Frontend/js/n4js/alarmbaja.js index 6a1612c..e24fba3 100644 --- a/Frontend/js/n4js/alarmbaja.js +++ b/Frontend/js/n4js/alarmbaja.js @@ -12,39 +12,6 @@ function addzero(num) { * @param {any} alarmClass * @param {any} callback */ -// function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, isAck, alarmClass, callback) { -// let _sourceTmp; -// var _result = ""; -// var _ss = ""; -// var _bfName = ""; -// var _sourceName = ""; -// var _index = 0; -// var _recoverState = isRecover ? "!= null" : "= null"; -// var _ackState = isAck ? "= 1" : "!= 1"; - -// require(['baja!'], function (baja) { -// baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " order by timestamp asc").get() -// .then(function (table) { -// return table.cursor({ -// each: function (record) { -// _sourceTmp = (record.get('alarmData').get('sourceName')).toString().split('_'); -// _bfName = _sourceTmp[1] + "-" + _sourceTmp[4]; -// _sourceName = _sourceTmp[7] + "-" + _sourceTmp[8]; -// _ss += ', "' + _index + '": {"buildingFloorName_zh":"' + _bfName + '", "uuid":"' + record.get('uuid') + '", "timestamp":"' + record.get('timestamp') + '", "alarmClass":"' + record.get('alarmClass') + '", "sourceName_zh":"' + _sourceName + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "normalTime":"' + record.get('normalTime') + '"}'; -// _index++; -// }, -// after: function () { -// _result += '{' + '"count": ' + _index; -// _result += _ss; -// _result += '}'; -// if (typeof callback === 'function') { -// callback(_result); -// } -// } -// }); -// }); -// }); -// } function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, isAck, alarmClass, callback) { let _sourceTmp; var _result = ""; @@ -77,7 +44,9 @@ function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, i if (typeof callback === 'function') { callback(_result); } - } + }, + limit: -1, + offset: 0 }); }); }); @@ -88,35 +57,6 @@ function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, i * @param {any} devicePath * @param {any} callback */ -// function getOneDeviceAlarmTop10ByBaja(devicePath, callback) { -// var _result = ""; -// var _ss = ""; -// var _index = 0; -// //{ "count":2,"data": [{ "time": "2022/11/14 15:00:00", "errId": "0001", "ackCheck": "未確認", "errReason": "燈泡故障" }, { "time": "2022/11/14 15:00:00", "errId": "0002", "ackCheck": "未確認", "errReason": "燈泡故障" }]} -// require(['baja!'], function (baja) { -// baja.Ord.make("local:|foxs:|alarm:|bql:select top 10 timestamp, ackState, alarmData, alarmData.sourceName, sourceState, uuid, alarmData.msgText, normalTime where alarmData.sourceName like '%" + devicePath + "%' order by timestamp desc").get() -// .then(function (table) { -// return table.cursor({ -// each: function (record) { -// if (_index == 0) -// _ss += '{"uuid":"' + record.get('uuid') + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "timestamp":"' + record.get('timestamp') + '"}'; -// else -// _ss += ',{"uuid":"' + record.get('uuid') + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "timestamp":"' + record.get('timestamp') + '"}'; -// _index++; -// }, -// after: function () { -// _result += '{' + '"count": ' + _index +', "data":['; - -// _result += _ss+']'; -// _result += '}'; -// if (typeof callback === 'function') { -// callback(_result); -// } -// } -// }); -// }); -// }); -// } function getOneDeviceAlarmTop10ByBaja(devicePath, callback) { var _result = ""; var _ss = ""; @@ -156,7 +96,9 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) { if (typeof callback === 'function') { callback(_result); } - } + }, + limit: -1, + offset: 0 }); }); }); @@ -167,31 +109,6 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) { * @param {any} systemPath * @param {any} callback */ -// function getOneSystemAlarmStateByBaja(systemPath, callback) { -// var _result = ""; -// var _ss = ""; -// var _index = 0; - -// require(['baja!'], function (baja) { -// baja.Ord.make("local:|foxs:|alarm:|bql:select alarmData, alarmData.sourceName, sourceState, uuid where alarmData.sourceName like '%" + systemPath + "%' order by timestamp desc").get() -// .then(function (table) { -// return table.cursor({ -// each: function (record) { -// _ss += ', "' + _index + '": {"uuid":"' + record.get('uuid') + '", "sourceName":"' + record.get('alarmData').get('sourceName') + '", "sourceState":"' + record.get('sourceState') + '"}'; -// _index++; -// }, -// after: function () { -// _result += '{' + '"count": ' + _index; -// _result += _ss; -// _result += '}'; -// if (typeof callback === 'function') { -// callback(_result); -// } -// } -// }); -// }); -// }); -// } function getOneSystemAlarmStateByBaja(systemPath, callback) { var _result = ""; var _ss = ""; @@ -215,7 +132,9 @@ function getOneSystemAlarmStateByBaja(systemPath, callback) { if (typeof callback === 'function') { callback(_result); } - } + }, + limit: -1, + offset: 0 }); }); }); diff --git a/Frontend/js/n4js/elevatorbaja.js b/Frontend/js/n4js/elevatorbaja.js index c357cff..398adc6 100644 --- a/Frontend/js/n4js/elevatorbaja.js +++ b/Frontend/js/n4js/elevatorbaja.js @@ -6,7 +6,7 @@ function getElevatorInfoByBaja(path, callback) { var _index = 0; // require(['baja!'], function (baja) { - baja.Ord.make("local:|foxs:|station:|slot:/" + path + "|bql:select name, displayName, out, out.value, slotPath, parent.name as 'device_number' from control:ControlPoint where name = 'CP' or name = 'RD' or name = 'DS' or name = 'ST' or name = 'LOAD' or name = 'MID' or name = 'HAND' or name = 'IND' or name = 'MD' or name = 'DNO'").get() + baja.Ord.make("local:|foxs:|station:|slot:/" + path + "|bql:select name, displayName, out, out.value, slotPath, parent.name as 'device_number' from control:ControlPoint").get() .then(function (table) { return table.cursor({ each: function (record) { @@ -70,7 +70,9 @@ function getElevatorInfoByBaja(path, callback) { if (typeof callback === 'function') { callback(_result); } - } + }, + limit: -1, + offset: 0 }); }); }); diff --git a/Frontend/js/n4js/historybaja.js b/Frontend/js/n4js/historybaja.js index 5bf45a8..9043e3f 100644 --- a/Frontend/js/n4js/historybaja.js +++ b/Frontend/js/n4js/historybaja.js @@ -8,32 +8,6 @@ * @param {any} company * @param {any} callback */ -// function getHistoryDataByBaja(devicePath, startDate_millisecond, endDate_millisecond, deviceName, company, callback) { -// var _result = ""; -// var _ss = ""; -// var _index = 0; - -// require(['baja!'], function (baja) { -// baja.Ord.make('local:|foxs:|history:/' + company + '/' + devicePath + '|bql:select * from control:ControlPoint where timestamp.millis > ' + startDate_millisecond + ' and timestamp.millis < ' + endDate_millisecond).get() -// .then(function (table) { -// return table.cursor({ -// each: function (record) { -// _ss += ', "' + _index + '": {"deviceName":"' + deviceName + '", "value":' + record.get('value') + ', "timestamp":"' + record.get('timestamp') + '"}'; -// _index++; -// }, -// after: function () { -// _result += '{' + '"count": ' + _index; -// _result += _ss; -// _result += '}'; -// if (typeof callback === 'function') { -// callback(_result); -// } -// } -// }); -// }); -// }); -// } - function getHistoryDataByBaja(devicePath, startDate_millisecond, endDate_millisecond, deviceName, company, callback) { var _result = ""; var _ss = "";