This commit is contained in:
GiteaAdmin 2023-06-06 10:58:35 +08:00
commit ad0449eb52
8 changed files with 3114 additions and 2832 deletions

View File

@ -170,12 +170,12 @@ namespace Backend
); );
#endregion #endregion
#region API //#region 定時取得氣象API
services.AddSingleton<WeatherAPIJob>(); //services.AddSingleton<WeatherAPIJob>();
services.AddSingleton( //services.AddSingleton(
new JobSchedule(jobType: typeof(WeatherAPIJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob")) //new JobSchedule(jobType: typeof(WeatherAPIJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
); //);
#endregion //#endregion
double loginExpireMinute = this.Configuration.GetValue<double>("LoginExpireMinute"); double loginExpireMinute = this.Configuration.GetValue<double>("LoginExpireMinute");
services.AddSession(options => services.AddSession(options =>

View File

@ -89,7 +89,7 @@
<span aria-hidden="true"><i class="fal fa-times"></i></span> <span aria-hidden="true"><i class="fal fa-times"></i></span>
</button> </button>
</div> </div>
<form id="opeRecForm"> <form id="alr_opeRecForm">
<div class="modal-body"> <div class="modal-body">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@ -200,8 +200,8 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" id="OpeRecCanBtn" data-dismiss="modal">關閉</button> <button type="button" class="btn btn-secondary" id="alr_OpeRecCanBtn" data-dismiss="modal">關閉</button>
<button type="button" class="btn btn-primary" id="OpeRecSendBtn" e-prevent>儲存</button> <button type="button" class="btn btn-primary" id="alr_OpeRecSendBtn" e-prevent>儲存</button>
</div> </div>
</form> </form>
</div> </div>
@ -218,7 +218,7 @@
pageAct.alrSelSysSub = []; pageAct.alrSelSysSub = [];
pageAct.selAllSysSub = false; pageAct.selAllSysSub = false;
first = true; first = true;
let dataAlarm = []; // let dataAlarm = [];
var historyTable = null; var historyTable = null;
var elemIndex = 0; var elemIndex = 0;
var index = 0; var index = 0;
@ -386,8 +386,8 @@
$('#inpFixDoCode').val(alr_fixDoCode); $('#inpFixDoCode').val(alr_fixDoCode);
}); });
onEvent('click', '#OpeRecSendBtn', function () { onEvent('click', '#alr_OpeRecSendBtn', function () {
let form = $("#opeRecForm"); let form = $("#alr_opeRecForm");
$(form).validate({ $(form).validate({
rules: { rules: {
inpWorTyp: { required: true }, inpWorTyp: { required: true },
@ -441,7 +441,7 @@
} else { } else {
//toast_ok(common.AddSuc); //toast_ok(common.AddSuc);
//$("#opeFirmModal").modal("hide"); //$("#opeFirmModal").modal("hide");
$("#OpeRecCanBtn").click(); $("#alr_OpeRecCanBtn").click();
getData(); getData();
} }
} }

View File

@ -144,6 +144,7 @@
var uploadFiles = {}; var uploadFiles = {};
var curActGraid = 0; var curActGraid = 0;
var cookies = new YourTeam.Utility.Cookie(); var cookies = new YourTeam.Utility.Cookie();
var token = cookies.get("JWT-Authorization"); var token = cookies.get("JWT-Authorization");
$(function () { $(function () {
initList(); initList();
@ -343,9 +344,9 @@
if (!res || res.code != "0000" || !res.data) { if (!res || res.code != "0000" || !res.data) {
} else { } else {
res.data.forEach(x => x.parent = x.system_parent_id); res.data.forEach(x => x.parent = x.parent_id);
res.data.forEach(x => x.text = x.system_key); res.data.forEach(x => x.text = x.name);
res.data.forEach(x => x.parent = x.parent); // res.data.forEach(x => x.parent = x.parent);
callback ? callback(res.data) : ""; callback ? callback(res.data) : "";
} }
}, null, "POST").send(); }, null, "POST").send();
@ -454,12 +455,12 @@
}) })
$("#graTree").on('create_node.jstree', function (e, data) { $("#graTree").on('create_node.jstree', function (e, data) {
let main = {}; let main = {};
main.system_key = data.node.text; main.name = data.node.text;
main.system_parent_id = parseInt(data.node.parent); main.parent_id = parseInt(data.node.parent);
objSendData.Data = main; objSendData.Data = main;
ytAjax = new YourTeam.Ajax(baseApiUrl + "/GraphManage/SaveVar", objSendData, function (res) { ytAjax = new YourTeam.Ajax(baseApiUrl + "/GraphManage/SaveGraphManageTree", objSendData, function (res) {
if (!res || res.code != "0000") { if (!res || res.code != "0000") {
data.instance.delete_node(data.node); data.instance.delete_node(data.node);
toast_error(res.msg || common.SysErr); toast_error(res.msg || common.SysErr);
@ -475,10 +476,10 @@
let main = {} let main = {}
main.id = parseInt(data.node.id); main.id = parseInt(data.node.id);
main.system_key = data.node.text; main.name = data.node.text;
objSendData.Data = main; objSendData.Data = main;
ytAjax = new YourTeam.Ajax(baseApiUrl + "/GraphManage/EditVar", objSendData, function (res) { ytAjax = new YourTeam.Ajax(baseApiUrl + "/GraphManage/EditGraphManageTree", objSendData, function (res) {
if (!res || res.code != "0000" || !res.data) { if (!res || res.code != "0000" || !res.data) {
toast_error(res.msg || common.SysErr); toast_error(res.msg || common.SysErr);
} else { } else {
@ -495,7 +496,7 @@
if (!isNaN(parseInt(data.node.id))) { if (!isNaN(parseInt(data.node.id))) {
main.id = parseInt(data.node.id); main.id = parseInt(data.node.id);
objSendData.Data = main; objSendData.Data = main;
ytAjax = new YourTeam.Ajax(baseApiUrl + "/GraphManage/DelVar", objSendData, function (res) { ytAjax = new YourTeam.Ajax(baseApiUrl + "/GraphManage/DelGraphManageTree", objSendData, function (res) {
if (!res || res.code != "0000" || !res.data) { if (!res || res.code != "0000" || !res.data) {
toast_error(res.msg || common.SysErr); toast_error(res.msg || common.SysErr);
} else { } else {

View File

@ -198,7 +198,7 @@
if ( if (
data.point_name == norDevPoiName && data.point_name == norDevPoiName &&
data.value == matchDevice.device_normal_point_value && (data.value == matchDevice.device_normal_point_value || norDevPoiName === errDevPoiName) &&
!deviceNormalArr.some( !deviceNormalArr.some(
({ device_number }) => device_number === matchDevice.device_number ({ device_number }) => device_number === matchDevice.device_number
) )

View File

@ -624,7 +624,7 @@
if ( if (
data.point_name == norDevPoiName && data.point_name == norDevPoiName &&
data.value == matchDevice.device_normal_point_value && (data.value == matchDevice.device_normal_point_value || norDevPoiName === errDevPoiName) &&
!deviceScatterNormalArr.some( !deviceScatterNormalArr.some(
({ device_number }) => data.device_number_full === device_number ({ device_number }) => data.device_number_full === device_number
) )

View File

@ -1152,7 +1152,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
getAlarmSub(data); getAlarmSub(data);
} }
alarmIconBlink(); alarmIconBlink(data);
}); });
getAlarm(); getAlarm();
}); });

File diff suppressed because it is too large Load Diff

View File

@ -506,11 +506,25 @@ namespace Repository.BackendRepository.Implement
//本次有匯入的 isLink 改為 1, 沒有的 isLink = 0 //本次有匯入的 isLink 改為 1, 沒有的 isLink = 0
sb.Append($@" SET SQL_SAFE_UPDATES = 0; sb.Append($@" SET SQL_SAFE_UPDATES = 0;
UPDATE device_item d LEFT JOIN import_niagara_item m update
ON d.device_system_tag = m.device_system_tag and d.device_name_tag = m.device_name_tag and d.points = m.device_point_name and d.full_name = m.full_name and d.is_show_history = m.is_history device_item d
SET d.is_link = case when device_point_name is null then 0 else 1 end , LEFT JOIN import_niagara_item m
d.is_show_history = case when device_point_name is null then 0 else 1 end ON d.device_system_tag = m.device_system_tag
where m.is_history = 1 and d.device_name_tag = m.device_name_tag
and d.points = m.device_point_name
and d.full_name = m.full_name
SET d.is_link = case when device_point_name is null then 0 else 1 end;
update
device_item d
LEFT JOIN import_niagara_item m
ON d.device_system_tag = m.device_system_tag
and d.device_name_tag = m.device_name_tag
and d.points = m.device_point_name
and d.full_name = m.full_name
and d.is_show_history = m.is_history
SET d.is_show_history = case when device_point_name is null then 0 else 1 end
where (m.is_history = 1 or d.is_show_history);
"); ");
await conn.ExecuteAsync(sb.ToString()); await conn.ExecuteAsync(sb.ToString());