修改authcode全域變數
This commit is contained in:
parent
21e3890686
commit
a671bc2a55
@ -328,7 +328,7 @@
|
||||
|
||||
let btnDiv = creDiv(["row", "m-0", "justify-content-center"], { "style": "gap:10px" });
|
||||
btnDiv.append(creBtnHtml("修改", "accManEdiBtn" + data, null, ["btn", "btn-info"], { "toggle": "modal", "target": "#accManModal" }));
|
||||
btnDiv.append(creBtnHtml("設備權限", "accManSysRolEdiBtn" + data, null, ["btn", "btn-info"], { "toggle": "modal", "target": "#accManSysModal", "fullname": row.full_name }));
|
||||
btnDiv.append(creBtnHtml("設備權限", "accManSysRolEdiBtn" + data, null, ["btn", "btn-info"], { "toggle": "modal", "target": "#accManSysModal", "fullname": row.full_name }));
|
||||
btnDiv.append(creBtnHtml("刪除", "accManDelBtn" + data, null, ["btn", "btn-danger"], { "toggle": "modal", "target": "#delModal" }));
|
||||
return btnDiv.outerHtml();
|
||||
}
|
||||
@ -447,7 +447,6 @@
|
||||
"title": "功能",
|
||||
"data": "role_guid",
|
||||
"render": function (data, type, row, meta) {
|
||||
pageAct.authCode.push(row.authCode);
|
||||
let btnDiv = creDiv(["row", "m-0", "justify-content-center"], { "style": "gap:10px" });
|
||||
btnDiv.append(creBtnHtml("刪除", "rolAuthDelBtn" + data, null, ["btn", "btn-danger"], { "toggle": "modal", "target": "#delModal", "id": data, "authcode": row.authCode }));
|
||||
return btnDiv.outerHtml();
|
||||
@ -456,6 +455,18 @@
|
||||
];
|
||||
|
||||
rolAuthTable = new YourTeam.JqDataTables.getTableByAjax(ajaxObj, tag, null, columns, column_defs);
|
||||
|
||||
let url = baseApiUrl + "/User/RoleAuthList";
|
||||
objSendData.Data = { SelectedRoleId: pageAct.selRolAuth }
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
|
||||
if (!res || res.code != "0000" || !res.data) {
|
||||
|
||||
} else {
|
||||
$.each(res.data, function (i, v) {
|
||||
pageAct.authCode.push(v.authCode);
|
||||
});
|
||||
}
|
||||
}, null, "POST").send();
|
||||
}
|
||||
|
||||
function loadAuthPageTable() {
|
||||
@ -474,14 +485,14 @@
|
||||
|
||||
let columns = [
|
||||
{
|
||||
"title": "選擇",
|
||||
"title": "選擇",
|
||||
"data": 'authCode',
|
||||
"render": function (data, type, row, meta) {
|
||||
return `<td><input id='${data}' type="checkbox"></td>`
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "編號",
|
||||
"title": "編號",
|
||||
"data": null,
|
||||
"render": function (data, type, row, meta) {
|
||||
return meta.row + 1;
|
||||
@ -489,7 +500,7 @@
|
||||
},
|
||||
{
|
||||
"title": "存取權限",
|
||||
"data": "subName"
|
||||
"data": "subName"
|
||||
}
|
||||
];
|
||||
|
||||
@ -497,37 +508,37 @@
|
||||
}
|
||||
|
||||
function loadDevSysTable(data) {
|
||||
let tag = "#devSysTable";
|
||||
let tag = "#devSysTable";
|
||||
|
||||
let column_defs = [
|
||||
{ "targets": [0], "width": "33%", "sortable": true },
|
||||
{ "targets": [1], "width": "33%", "sortable": true },
|
||||
{ "targets": [2], "width": "33%", "sortable": true },
|
||||
];
|
||||
let column_defs = [
|
||||
{ "targets": [0], "width": "33%", "sortable": true },
|
||||
{ "targets": [1], "width": "33%", "sortable": true },
|
||||
{ "targets": [2], "width": "33%", "sortable": true },
|
||||
];
|
||||
|
||||
let columns = [
|
||||
{
|
||||
"title": "類別代號",
|
||||
"data": 'sub_system_tag',
|
||||
},
|
||||
{
|
||||
"title": "類別名稱",
|
||||
"data": "full_name",
|
||||
},
|
||||
{
|
||||
"title": "功能名稱",
|
||||
let columns = [
|
||||
{
|
||||
"title": "類別代號",
|
||||
"data": 'sub_system_tag',
|
||||
},
|
||||
{
|
||||
"title": "類別名稱",
|
||||
"data": "full_name",
|
||||
},
|
||||
{
|
||||
"title": "功能名稱",
|
||||
"data": null,
|
||||
"render": function (data, type, row, meta) {
|
||||
return `<div class="custom-control custom-checkbox">
|
||||
"render": function (data, type, row, meta) {
|
||||
return `<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="${row.auth_code}" data-type="usrDevSys">
|
||||
<label class="custom-control-label" for="${row.auth_code}">啟用</label>
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
devSysTable = new YourTeam.JqDataTables.getTableByStatic(tag, data, columns, column_defs, null, null, null, null, "tpi");
|
||||
}
|
||||
devSysTable = new YourTeam.JqDataTables.getTableByStatic(tag, data, columns, column_defs, null, null, null, null, "tpi");
|
||||
}
|
||||
|
||||
function getRoleSel() {
|
||||
|
||||
@ -556,10 +567,10 @@
|
||||
function events() {
|
||||
onEvent("change", "#roleSel", function () {
|
||||
let roleGuid = $(this).val();
|
||||
pageAct.selRolAuth = $(this).val();
|
||||
pageAct.selRolAuth = $(this).val();
|
||||
dtAjaxResetSendData(rolAuthTable, { SelectedRoleId: roleGuid })
|
||||
loadRolAuthTable();
|
||||
setAuthPage();
|
||||
loadRolAuthTable();
|
||||
setAuthPage();
|
||||
})
|
||||
|
||||
onEvent("click", "[data-target*=accManModal]", function () {
|
||||
@ -654,7 +665,7 @@
|
||||
else if (acc_table == "rolAuth") {
|
||||
loadRolAuthTable();
|
||||
setAuthPage();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onEvent("click", "li.nav-item", function () {
|
||||
@ -767,11 +778,11 @@
|
||||
|
||||
let name = $(this).data('fullname');
|
||||
let id = $(this).prop('id').split('Btn')[1];
|
||||
let url = baseApiUrl + "/User/GetMainSub";
|
||||
let sendData = {
|
||||
building_tag: pageAct.buiTag
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
let url = baseApiUrl + "/User/GetMainSub";
|
||||
let sendData = {
|
||||
building_tag: pageAct.buiTag
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
function success(res) {
|
||||
$('#devSysTabTitle').html(name);
|
||||
$('#accManSysRolSavBtn').attr('data-id', id);
|
||||
@ -785,41 +796,41 @@
|
||||
if (data.length > 0) {
|
||||
loadDevSysTable(data);
|
||||
getUsrDevSys(id);
|
||||
}
|
||||
}
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||
}
|
||||
}
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||
});
|
||||
|
||||
onEvent("click", "[data-type=usrDevSys]", function () {
|
||||
if (pageAct.usrDevSys.length > 0) {
|
||||
if ($(this).is(':checked')) {
|
||||
if ((jQuery.inArray($(this).prop('id'), pageAct.usrDevSys) == -1)) {
|
||||
pageAct.addUsrDevSys.push($(this).prop('id'));
|
||||
if ((jQuery.inArray($(this).prop('id'), pageAct.usrDevSys) == -1)) {
|
||||
pageAct.addUsrDevSys.push($(this).prop('id'));
|
||||
}
|
||||
|
||||
if (jQuery.inArray($(this).prop('id'), pageAct.delUsrDevSys) != -1) {
|
||||
pageAct.delUsrDevSys.splice($.inArray($(this).prop('id'), pageAct.delUsrDevSys), 1);
|
||||
}
|
||||
if (jQuery.inArray($(this).prop('id'), pageAct.delUsrDevSys) != -1) {
|
||||
pageAct.delUsrDevSys.splice($.inArray($(this).prop('id'), pageAct.delUsrDevSys), 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (jQuery.inArray($(this).prop('id'), pageAct.usrDevSys) != -1) {
|
||||
pageAct.delUsrDevSys.push($(this).prop('id'));
|
||||
if (jQuery.inArray($(this).prop('id'), pageAct.usrDevSys) != -1) {
|
||||
pageAct.delUsrDevSys.push($(this).prop('id'));
|
||||
}
|
||||
|
||||
if (jQuery.inArray($(this).prop('id'), pageAct.addUsrDevSys) != -1) {
|
||||
pageAct.addUsrDevSys.splice($.inArray($(this).prop('id'), pageAct.addUsrDevSys), 1);
|
||||
}
|
||||
if (jQuery.inArray($(this).prop('id'), pageAct.addUsrDevSys) != -1) {
|
||||
pageAct.addUsrDevSys.splice($.inArray($(this).prop('id'), pageAct.addUsrDevSys), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onEvent("click", "#accManSysRolSavBtn", function () {
|
||||
//get user role id
|
||||
let url = baseApiUrl + "/User/GetUsrRolId";
|
||||
let sendData = {
|
||||
userinfo_guid: $(this).data('id')
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
let url = baseApiUrl + "/User/GetUsrRolId";
|
||||
let sendData = {
|
||||
userinfo_guid: $(this).data('id')
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
function success(res) {
|
||||
//save role auth(devSys)
|
||||
url = baseApiUrl + "/User/SaveRoleAuth";
|
||||
@ -831,16 +842,16 @@
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, null, null, "POST").send();
|
||||
|
||||
//delete role auth(devSys)
|
||||
url = baseApiUrl + "/User/DelDevSysRoleAuth";
|
||||
sendData = {
|
||||
SelectedRoleId: res.data,
|
||||
SaveCheckAuth: pageAct.delUsrDevSys
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
url = baseApiUrl + "/User/DelDevSysRoleAuth";
|
||||
sendData = {
|
||||
SelectedRoleId: res.data,
|
||||
SaveCheckAuth: pageAct.delUsrDevSys
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, null, null, "POST").send();
|
||||
|
||||
$("#accManSysModal").modal("hide");
|
||||
}
|
||||
$("#accManSysModal").modal("hide");
|
||||
}
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||
});
|
||||
}
|
||||
@ -862,22 +873,22 @@
|
||||
$(v).click();
|
||||
});
|
||||
|
||||
pageAct.authCode = pageAct.authCode.filter(function (elem, index, self) {
|
||||
return index === self.indexOf(elem);
|
||||
pageAct.authCode = pageAct.authCode.filter(function (elem, index, self) {
|
||||
return index === self.indexOf(elem);
|
||||
});
|
||||
|
||||
$.each(pageAct.authCode, function (i, v) {
|
||||
$(`#accAuthPageTable input[id=${v}]`).click();
|
||||
$(`#accAuthPageTable input[id=${v}]`).click();
|
||||
$(`#accAuthPageTable input[id=${v}]`).attr('disabled', true);
|
||||
});
|
||||
}
|
||||
|
||||
function getUsrDevSys(user_guid) {
|
||||
let url = baseApiUrl + "/User/GetUsrDevSys";
|
||||
let url = baseApiUrl + "/User/GetUsrDevSys";
|
||||
let sendData = {
|
||||
userinfo_guid: user_guid
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
}
|
||||
objSendData.Data = sendData;
|
||||
function success(res) {
|
||||
pageAct.usrDevSys = [];
|
||||
|
||||
@ -886,11 +897,11 @@
|
||||
});
|
||||
|
||||
$.each(res.data, function (i, v) {
|
||||
$(`#devSysTable input[type=checkbox][id=${v}]`).click();
|
||||
$(`#devSysTable input[type=checkbox][id=${v}]`).click();
|
||||
});
|
||||
|
||||
pageAct.usrDevSys = res.data;
|
||||
}
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||
}
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||
}
|
||||
</script>
|
@ -2036,10 +2036,6 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
var loadingTip = '';
|
||||
var pageAct = {}; //記錄全頁面已選擇項目
|
||||
pageAct.AreaTag = "TPE";
|
||||
if (localStorage.getItem("buiTag")) {
|
||||
pageAct.buiTag = localStorage.getItem("buiTag");
|
||||
}
|
||||
|
||||
if (location.href.indexOf("ord") != -1) {
|
||||
location.href = "/file/index.html"
|
||||
}
|
||||
@ -2153,11 +2149,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
} else {
|
||||
let strHtml = ``;
|
||||
$.each(res.data, (index, buiObj) => {
|
||||
let actStr = "";
|
||||
if (pageAct.buiTag == buiObj.building_tag) {
|
||||
actStr = "active";
|
||||
}
|
||||
strHtml += `<a id="buiBtn${buiObj.building_tag}" data-urn="${buiObj.urn_3D}" class="dropdown-item ${actStr}" href="javascript:;">${buiObj.full_name}</a>`;
|
||||
strHtml += `<a id="buiBtn${buiObj.building_tag}" data-urn="${buiObj.urn_3D}" class="dropdown-item" href="javascript:;">${buiObj.full_name}</a>`;
|
||||
})
|
||||
$("#buiList").append(strHtml).droSetItem(); //droSetItem 預設第一筆 active
|
||||
}
|
||||
@ -2249,9 +2241,9 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
onEvent("active:change", "#buiList", function (e, actEle) {
|
||||
if (actEle) {
|
||||
pageAct.buiTag = $(actEle).prop("id").split("buiBtn")[1];
|
||||
localStorage.setItem("buiTag", pageAct.buiTag);
|
||||
pageAct.urn = $(actEle).data("urn");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(window).on("timeout:3s", function () {
|
||||
@ -2403,7 +2395,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
//loadErrRecTable2($(oriEle).data("number"));
|
||||
//loadErrRecTable();
|
||||
loadErr($(oriEle).data("number"));
|
||||
typeof subDeviceSetTable != "undefined" ? subDeviceSetTable($(oriEle).data("number")) : ""
|
||||
subDeviceSetTable ? subDeviceSetTable($(oriEle).data("number")) : ""
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -2650,9 +2642,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
||||
ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
|
||||
console.log(res);
|
||||
if (!res || res.code != "0000" || !res.data) {
|
||||
console.log('aaaaa');
|
||||
|
||||
} else {
|
||||
console.log('bbbbb');
|
||||
$("#sysMonBtnList").html("")
|
||||
$.each(res.data.history_Main_Systems, (index, mainSysObj) => {
|
||||
$.each(mainSysObj.history_Sub_systems, (index2, subSysObj) => {
|
||||
|
Loading…
Reference in New Issue
Block a user