[前台] 圖資管理前端程序更新

This commit is contained in:
dev01 2023-06-05 10:26:40 +08:00
parent e5b20132ad
commit 01b4db1b92

View File

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