Authored by wangtao

fix: 拓扑视图深色模式

... ... @@ -10,7 +10,7 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli
exports('mxgraphAdd', function (data) {
var sessions = layui.sessions;
var access_token = sessions.getToken()['access_token'];
var access_token = common.getMjToken();
var id = data.id;
... ... @@ -84,12 +84,14 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli
//绑定用户
$.ajax({
type: 'get',
url: common.domainName + '/api-user/users/getAll?access_token=' + access_token,
url: common.domainName + '/mj/user/page?username=&nickname=&enabled=&perPage=9999&page=1&&accessToken=' + access_token,
async: false,
success: function (res) {
if (res && res.length > 0) {
if (res && res.data) {
let userArr = res.data.rows
var datas = [];
$.each(res, function (i, v) {
$.each(userArr, function (i, v) {
datas.push({name: v.nickname, value: v.username});
});
xmSelectUsers = xmSelect.render({
... ... @@ -106,12 +108,13 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli
//绑定角色
$.ajax({
type: 'get',
url: common.domainName + '/api-user/roles?access_token=' + access_token,
url: common.domainName + '/mj/sys/role/roles?name=&perPage=10&page=1&&accessToken=' + access_token,
async: false,
success: function (res) {
if (res && res.data.length > 0) {
if (res && res.data) {
let roleArr = res.data.rows
var datas = [];
$.each(res.data, function (i, v) {
$.each(roleArr, function (i, v) {
datas.push({name: `${v.name}(${v.code})`, value: v.id, code: v.code, roleName: v.name});
})
xmSelectRoles = xmSelect.render({
... ... @@ -225,7 +228,7 @@ layui.define(['form', 'admin', 'layer', 'common', 'sessions', 'xmSelect', 'resli
id = res.str;
}
//http://192.168.0.247:8085
var url = common.graphEditorOrigin + "/jgraph/grapheditor/index.html?access_token=" + access_token + '&id=' + id;
var url = common.graphEditorOrigin + "/jgraph/grapheditor/index.html?access_token=" + access_token + '&id=' + id+ "&theme=" + localStorage.getItem("theme");
window.open(url);
}
});
... ...
... ... @@ -222,7 +222,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
if (cell && cell != null && cell.edge != 1 && cell.childTopoId) {
// $("#topo_view_childtop").attr("lay-href", "/mxgraph/view/from=v/id=" + cell.childTopoId);
// $("#topo_view_childtop").trigger("click");
var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + cell.childTopoId;
var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + cell.childTopoId + "&theme=" + localStorage.getItem("theme");
window.top.postMessage({
type: 'dialog',
message: {'params':{},'title':'子拓扑','url':url}
... ... @@ -317,7 +317,7 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
//编辑拓扑
$("#gotoedittopo").unbind('click').on("click", function () {
// $(this).attr("lay-href", "/grapheditor-web/mxgraph/setting/id=" + topoId)
var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId;
var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId + "&theme=" + localStorage.getItem("theme");
window.top.postMessage({
type: 'dialog',
message: {'params':{},'title':'编辑拓扑','url':url}
... ... @@ -333,11 +333,11 @@ layui.define(['common', 'sessions', 'commonDetail', 'mxClient', 'cascader'], fun
//xwx 2021-10-29 拓扑视图下拉选择框默认回填 --end
// $("#mxgraph-topoTitle").text(" - " + res.object.topoName);
}
$('#newViewGraphContainer iframe').attr('src', `/grapheditor-web/jgraph/grapheditor/viewer.html?access_token=${accessToken}&id=${topoId}`);
$('#newViewGraphContainer iframe').attr('src', `/grapheditor-web/jgraph/grapheditor/viewer.html?access_token=${accessToken}&id=${topoId}&theme=${localStorage.getItem("theme")}`);
if (topoId) {
//编辑拓扑
$("#gotoedittopo").unbind('click').on("click", function () {
var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId;
var url = "/grapheditor-web/jgraph/grapheditor/index.html?access_token=" + accessToken + '&id=' + topoId + "&theme=" + localStorage.getItem("theme");
// window.open(url);
window.top.postMessage({
... ...