|
@@ -27,6 +27,9 @@ const { drawGraph, updateTree, getGraph, getTree, getNode, getTab, renderTab, se
|
|
|
setSelectName, hideHideTab, hideSlide, reDrawGraph } = require('./graphMap.js');
|
|
|
/**右侧侧边栏折叠*/
|
|
|
let isRightCollapse = false
|
|
|
+let input = getUrlArgObject("input") || ""
|
|
|
+let label = getUrlArgObject("label") || ""
|
|
|
+let noTree = getUrlArgObject("no-tree") || false
|
|
|
window.select_type = "疾病";
|
|
|
window.select_type_noSearch = "疾病";
|
|
|
window.refreshTree = true
|
|
@@ -38,7 +41,7 @@ window.graphMap = null //当前关系图实例对象
|
|
|
window.knowledgeMapSetting = {
|
|
|
operation: "view", //操作类型,修改
|
|
|
draggable: true, //是否能拖拽节点
|
|
|
- zTree: true,//是否有zTree
|
|
|
+ zTree: !noTree,//是否有zTree
|
|
|
expandPropertyId: [],//存储展开属性的nodeId
|
|
|
expandRelationshipsId: [],//存储展开关系的nodeId
|
|
|
currentNodeId: -1,//存储右侧显示的节点的nodeId
|
|
@@ -49,6 +52,12 @@ window.knowledgeMapSetting = {
|
|
|
showLegendAll: false,//是否展示全部图例
|
|
|
records: [],//历史记录
|
|
|
}
|
|
|
+if (noTree) {
|
|
|
+ $(".content .right").css('display', 'none')
|
|
|
+ $(".content .left").css("width", "100%")
|
|
|
+} else {
|
|
|
+ $(".content .right").css('display', 'block')
|
|
|
+}
|
|
|
|
|
|
setHei()
|
|
|
ifHideLogo();
|
|
@@ -67,10 +76,16 @@ function setHei() {
|
|
|
$(window).resize(function () {
|
|
|
setHei()
|
|
|
// getGraph(graphTxt,select_type);
|
|
|
+
|
|
|
})
|
|
|
|
|
|
+// window.onload = function () {
|
|
|
+// console.log("notTree", notTree)
|
|
|
+
|
|
|
+// }
|
|
|
+
|
|
|
//关系图
|
|
|
-getGraph(disease || "艾滋病", select_type);
|
|
|
+getGraph(disease || input || "艾滋病", label || select_type);
|
|
|
getTree(1, 1, disease || "艾滋病");
|
|
|
$('#searchInp').val(disease || "艾滋病")
|
|
|
|
|
@@ -273,7 +288,7 @@ window.addEventListener("message", function (event) {
|
|
|
// console.log("message", event.data);
|
|
|
if (event.data.operation == "left-collapse") {
|
|
|
const contentWidth = $(".content").width()
|
|
|
- console.log("contentWidth", contentWidth)
|
|
|
+ // console.log("contentWidth", contentWidth)
|
|
|
let leftWidth = 0
|
|
|
if (isRightCollapse) {
|
|
|
leftWidth = (contentWidth - 150).toString() + 'px'
|
|
@@ -284,18 +299,18 @@ window.addEventListener("message", function (event) {
|
|
|
$(".content .left").css('width', leftWidth)
|
|
|
|
|
|
}
|
|
|
- console.log("leftWidth", leftWidth);
|
|
|
+ // console.log("leftWidth", leftWidth);
|
|
|
window.graphMap.resize()
|
|
|
}
|
|
|
})
|
|
|
$(".record .selectedData,.record").on("click", function (event) {
|
|
|
- console.log("event-record", event)
|
|
|
+ // console.log("event-record", event)
|
|
|
event.stopPropagation()
|
|
|
// event.preventDefault()
|
|
|
$(".record .selectList-record").slideToggle()
|
|
|
$(".record .selectList-record .selectItem-record").on("click", function (event) {
|
|
|
// event.stopPropagation()
|
|
|
- console.log("eve")
|
|
|
+ // console.log("eve")
|
|
|
const name = $(this).attr("name")
|
|
|
const label = $(this).attr("label")
|
|
|
// reDrawGraph(name, label)
|