Showing
2 changed files
with
15 additions
and
12 deletions
@@ -10,7 +10,7 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | @@ -10,7 +10,7 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | ||
10 | exports('mxgraphAdd', function (data) { | 10 | exports('mxgraphAdd', function (data) { |
11 | 11 | ||
12 | var sessions = layui.sessions; | 12 | var sessions = layui.sessions; |
13 | - var access_token = sessions.getToken()['access_token']; | 13 | + var access_token = common.getMjToken(); |
14 | 14 | ||
15 | var id = data.id; | 15 | var id = data.id; |
16 | 16 | ||
@@ -84,12 +84,14 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | @@ -84,12 +84,14 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | ||
84 | //绑定用户 | 84 | //绑定用户 |
85 | $.ajax({ | 85 | $.ajax({ |
86 | type: 'get', | 86 | type: 'get', |
87 | - url: common.domainName + '/api-user/users/getAll?access_token=' + access_token, | 87 | + url: common.domainName + '/mj/user/page?username=&nickname=&enabled=&perPage=9999&page=1&&accessToken=' + access_token, |
88 | async: false, | 88 | async: false, |
89 | success: function (res) { | 89 | success: function (res) { |
90 | - if (res && res.length > 0) { | 90 | + |
91 | + if (res && res.data) { | ||
92 | + let userArr = res.data.rows | ||
91 | var datas = []; | 93 | var datas = []; |
92 | - $.each(res, function (i, v) { | 94 | + $.each(userArr, function (i, v) { |
93 | datas.push({name: v.nickname, value: v.username}); | 95 | datas.push({name: v.nickname, value: v.username}); |
94 | }); | 96 | }); |
95 | xmSelectUsers = xmSelect.render({ | 97 | xmSelectUsers = xmSelect.render({ |
@@ -106,12 +108,13 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | @@ -106,12 +108,13 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | ||
106 | //绑定角色 | 108 | //绑定角色 |
107 | $.ajax({ | 109 | $.ajax({ |
108 | type: 'get', | 110 | type: 'get', |
109 | - url: common.domainName + '/api-user/roles?access_token=' + access_token, | 111 | + url: common.domainName + '/mj/sys/role/roles?name=&perPage=10&page=1&&accessToken=' + access_token, |
110 | async: false, | 112 | async: false, |
111 | success: function (res) { | 113 | success: function (res) { |
112 | - if (res && res.data.length > 0) { | 114 | + if (res && res.data) { |
115 | + let roleArr = res.data.rows | ||
113 | var datas = []; | 116 | var datas = []; |
114 | - $.each(res.data, function (i, v) { | 117 | + $.each(roleArr, function (i, v) { |
115 | datas.push({name: `${v.name}(${v.code})`, value: v.id, code: v.code, roleName: v.name}); | 118 | datas.push({name: `${v.name}(${v.code})`, value: v.id, code: v.code, roleName: v.name}); |
116 | }) | 119 | }) |
117 | xmSelectRoles = xmSelect.render({ | 120 | xmSelectRoles = xmSelect.render({ |
@@ -225,7 +228,7 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | @@ -225,7 +228,7 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli | ||
225 | id = res.str; | 228 | id = res.str; |
226 | } | 229 | } |
227 | //http://192.168.0.247:8085 | 230 | //http://192.168.0.247:8085 |
228 | - var url = common.graphEditorOrigin + "/jgraph/grapheditor/index.html?access_token=" + access_token + '&id=' + id; | 231 | + var url = common.graphEditorOrigin + "/jgraph/grapheditor/index.html?access_token=" + access_token + '&id=' + id+ "&theme=" + localStorage.getItem("theme"); |
229 | window.open(url); | 232 | window.open(url); |
230 | } | 233 | } |
231 | }); | 234 | }); |
@@ -222,7 +222,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun | @@ -222,7 +222,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun | ||
222 | if (cell && cell != null && cell.edge != 1 && cell.childTopoId) { | 222 | if (cell && cell != null && cell.edge != 1 && cell.childTopoId) { |
223 | // $("#topo_view_childtop").attr("lay-href", "/mxgraph/view/from=v/id=" + cell.childTopoId); | 223 | // $("#topo_view_childtop").attr("lay-href", "/mxgraph/view/from=v/id=" + cell.childTopoId); |
224 | // $("#topo_view_childtop").trigger("click"); | 224 | // $("#topo_view_childtop").trigger("click"); |
225 | - var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + cell.childTopoId; | 225 | + var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + cell.childTopoId + "&theme=" + localStorage.getItem("theme"); |
226 | window.top.postMessage({ | 226 | window.top.postMessage({ |
227 | type: 'dialog', | 227 | type: 'dialog', |
228 | message: {'params':{},'title':'子拓扑','url':url} | 228 | message: {'params':{},'title':'子拓扑','url':url} |
@@ -317,7 +317,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun | @@ -317,7 +317,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun | ||
317 | //编辑拓扑 | 317 | //编辑拓扑 |
318 | $("#gotoedittopo").unbind('click').on("click", function () { | 318 | $("#gotoedittopo").unbind('click').on("click", function () { |
319 | // $(this).attr("lay-href", "/grapheditor-web/mxgraph/setting/id=" + topoId) | 319 | // $(this).attr("lay-href", "/grapheditor-web/mxgraph/setting/id=" + topoId) |
320 | - var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId; | 320 | + var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId + "&theme=" + localStorage.getItem("theme"); |
321 | window.top.postMessage({ | 321 | window.top.postMessage({ |
322 | type: 'dialog', | 322 | type: 'dialog', |
323 | message: {'params':{},'title':'编辑拓扑','url':url} | 323 | message: {'params':{},'title':'编辑拓扑','url':url} |
@@ -333,11 +333,11 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun | @@ -333,11 +333,11 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun | ||
333 | //xwx 2021-10-29 拓扑视图下拉选择框默认回填 --end | 333 | //xwx 2021-10-29 拓扑视图下拉选择框默认回填 --end |
334 | // $("#mxgraph-topoTitle").text(" - " + res.object.topoName); | 334 | // $("#mxgraph-topoTitle").text(" - " + res.object.topoName); |
335 | } | 335 | } |
336 | - $('#newViewGraphContainer iframe').attr('src', `/grapheditor-web/jgraph/grapheditor/viewer.html?access_token=${accessToken}&id=${topoId}`); | 336 | + $('#newViewGraphContainer iframe').attr('src', `/grapheditor-web/jgraph/grapheditor/viewer.html?access_token=${accessToken}&id=${topoId}&theme=${localStorage.getItem("theme")}`); |
337 | if (topoId) { | 337 | if (topoId) { |
338 | //编辑拓扑 | 338 | //编辑拓扑 |
339 | $("#gotoedittopo").unbind('click').on("click", function () { | 339 | $("#gotoedittopo").unbind('click').on("click", function () { |
340 | - var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId; | 340 | + var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId + "&theme=" + localStorage.getItem("theme"); |
341 | // window.open(url); | 341 | // window.open(url); |
342 | 342 | ||
343 | window.top.postMessage({ | 343 | window.top.postMessage({ |
-
Please register or login to post a comment