Przeglądaj źródła

自构建查询

cynthia-qin 1 miesiąc temu
rodzic
commit
e33e1439ab
4 zmienionych plików z 230 dodań i 461 usunięć
  1. 1 0
      src/js/graphMap.js
  2. 216 345
      src/js/selfKnowledgeGraph.js
  3. 10 113
      src/js/selfgraphMap.js
  4. 3 3
      webpack.config.js

+ 1 - 0
src/js/graphMap.js

@@ -56,6 +56,7 @@ function getGraph(val, type) {
             "labelName": type
         }
         return post(url, params).then(res => {
+            console.log("getGraph", res)
             if (res.data.code == 0) {
                 // select_type = select_type_noSearch
                 $('#searchInp').val(val)

+ 216 - 345
src/js/selfKnowledgeGraph.js

@@ -21,362 +21,18 @@ require('./../resources/zTree/js/jquery.ztree.excheck.min.js')
 require('./../resources/zTree/css/zTreeStyle/zTreeStyle.css');
 const iconUp = require('./../resources/images/iconUp.png');
 const iconDown = require('./../resources/images/iconDown.png');
-// const { post, api, ifHideLogo, getUrlArgObject } = require('./api.js');
 const { mapData, zTreeData, mapData3, zTreeData3 } = require('./data.js');
-// const { drawGraph, updateTree, getGraph, getTree, getNode, getTab, renderTab, setTabBottomHei, selectedZTreeNode,
-//     setSelectName, hideHideTab, hideSlide, reDrawGraph } = require('./selfgraphMap.js');
-// /**右侧侧边栏折叠*/
-// let isRightCollapse = false
-// let self = getUrlArgObject("self") ? true : false;
-// let input = getUrlArgObject("input") || ""
-// let label = getUrlArgObject("label") || ""
-// let noTree = getUrlArgObject("no-tree") || false
-// let disease = getUrlArgObject("disease")
-// window.select_type = "疾病";
-// window.select_type_noSearch = "疾病";
-// window.refreshTree = true
-
-// // 用来存储节点操作的数据
-// window.knowledgeMapData = {}//当前右键节点数据
-// window.graphMapUpdatedData = null //实时更新的关系图数据
-// window.graphMap = null //当前关系图实例对象
-// window.knowledgeMapSetting = {
-//     self: self,
-//     operation: "view", //操作类型,修改
-//     draggable: true, //是否能拖拽节点
-//     zTree: !noTree,//是否有zTree
-//     expandPropertyId: [],//存储展开属性的nodeId
-//     expandRelationshipsId: [],//存储展开关系的nodeId
-//     currentNodeId: -1,//存储右侧显示的节点的nodeId
-//     legends: [],//图例
-//     selected: {},//选中的数据
-//     showLegend: true, //是否显示图例
-//     showLegendNum: 0,//展示图例的数量
-//     showLegendAll: false,//是否展示全部图例
-//     records: [],//历史记录
-// }
-// if (noTree) {
-//     $(".content .right").css('display', 'none')
-//     $(".content .left").css("width", "100%")
-// } else {
-//     $(".content .right").css('display', 'block')
-// }
-
-// setHei()
-// ifHideLogo();
-// function setHei() {
-//     const clientHei = $(window).height()
-//     const contentHei = 580
-//     $(".left").css("height", contentHei + 'px')
-//     $(".right").css("height", contentHei + 'px')
-//     if (select_type == "疾病") {
-//         setTabBottomHei(1)
-//     } else {
-//         setTabBottomHei(2)
-//     }
-//     $("#main").css("height", contentHei - 20 - 20 - 10 + 'px')
-// }
-// $(window).resize(function () {
-//     setHei()
-//     // getGraph(graphTxt,select_type);
-
-// })
-
-// // window.onload = function () {
-// //     console.log("notTree", notTree)
-
-// // }
-// function getTree2(data) {
-//     if (data.type == "疾病") {
-//         getTree(1, 1, data.label);
-//         $(".radioList").show()
-//     } else if (data.type == "药品") {
-//         getTree(0, 2, data.label);
-//         $(".radioList").show()
-//     } else if (data.type == "症状") {
-//         $(".radioList").hide()
-//         getTree(0, 3, data.label);
-
-//     }
-//     // else if (data.type == "手术和操作") {
-//     // $(".radioList").hide()
-//     //     getTree(0, 4, data.label);
-//     // } 
-//     else if (data.type == "实验室检查") {
-//         $(".radioList").hide()
-//         getTree(0, 5, data.label);
-
-//     } else if (data.type == "辅助检查") {
-//         $(".radioList").hide()
-//         getTree(0, 6, data.label);
-
-//     }
-// }
-// //关系图
-// getGraph(disease || input || "艾滋病", label || select_type);
-
-
-// // getTree(1, 1, disease || input || "艾滋病");
-// getTree2({
-//     type: label || select_type,
-//     label: disease || input || "艾滋病",
-// })
-// // $('#searchInp').val(disease || input || "艾滋病")
-
-
-// //选择类型
-// $('.select').click(function (e) {
-//     e.stopPropagation();
-//     hideSlide('selectList')
-//     const selectListShow = $('.selectList').css('display')
-//     if (selectListShow == 'none') {
-//         $('.iconSlide').attr('src', './images/iconSlideUp.png')
-//     } else {
-//         $('.iconSlide').attr('src', './images/iconSlideDown.png')
-//     }
-//     $('.selectList').fadeToggle()
-
-// })
-// $('.selectList .selectItem').click(function () {
-//     select_type_noSearch = $(this).attr('data-id')
-//     const txt = $(this).text()
-//     const oldTxt = $(".selectedName").html()
-//     setSelectName(txt)
-
-//     $("#searchInp").attr("placeholder", `请输入${txt}名称`)
-//     if (txt != oldTxt) {
-//         $('#searchInp').val("")
-//     }
-
-// })
-
-
-
-// //搜索节点名
-// $("#searchInp").bind("input propertychange", function (event) {
-//     const val = $("#searchInp").val().trim()
-//     if (val) {
-//         getNode(val, select_type_noSearch)
-//     } else {
-//         $(".tabNameList").hide()
-//     }
-// });
-
-// //切换条目
-// $('.radioItem').click(function (e) {
-//     $('.radioItem').css('color', '#333333')
-//     $(this).css("color", '#409EF1')
-//     const dataId = $(".showTabList .tab.activeTab").attr("data-id")
-//     const initDiag = dataId == "疾病" ? "艾滋病" : "过氧化氢溶液"
-//     const type = +$(this).attr('data-type')
-//     const subType = +$(this).attr('sub-type')
-//     // $(this).children('img').attr('src')
-//     $('.iconRadio').attr('src', '/images/radioUnSelect.png')
-//     $(this).children('img').attr('src', '/images/radioSelect.png')
-//     $('#searchInp').val(initDiag)
-//     getTree(subType, type, initDiag);
-//     getGraph(initDiag, select_type);
-//     // updateTree(initDiag)
-// })
-
-// //搜索
-// $('#searchBtn').click(function (e) {
-//     e.stopPropagation()
-//     hideSlide()
-//     const val = $('#searchInp').val().trim()
-//     if (val) {
-//         const clientHei = $(window).height()
-//         const contentHei = clientHei - 80
-//         $(".tabNameList").hide()
-//         getGraph(val, select_type_noSearch).then(() => {
-//             if (!window.refreshTree) {
-//                 return
-//             }
-//             select_type = select_type_noSearch
-
-//             if (select_type == '疾病') {
-//                 // $('#searchInp').val("高血压3级")
-//                 getTree(1, 1, val);
-//             } else if (select_type == '药品') {
-//                 getTree(0, 2, val);
-//             } else if (select_type == '症状') {
-//                 getTree(0, 3, val);
-//             }
-//             // else if (select_type == '手术和操作') {
-//             //     getTree(0, 4, val);
-//             // } 
-//             else if (select_type == '实验室检查') {
-//                 getTree(0, 5, val);
-//             } else if (select_type == '辅助检查') {
-//                 getTree(0, 6, val);
-//             }
-
-
-//             if (select_type == '疾病') {
-//                 $('.iconRadio').attr('src', '/images/radioUnSelect.png')
-//                 $('.ICD10 img').attr('src', '/images/radioSelect.png')
-//                 $(".radioList").show()
-//                 $(".radioList .radioItem").hide()
-//                 $(".radioList .disease").show()
-
-//                 setTabBottomHei(1)
-//             } else if (select_type == '药品') {
-//                 $('.iconRadio').attr('src', '/images/radioUnSelect.png')
-//                 $('.general img').attr('src', '/images/radioSelect.png')
-//                 $(".radioList").show()
-//                 $(".radioList .radioItem").hide()
-//                 $(".radioList .medicine").show()
-//                 setTabBottomHei(1)
-//             }
-//             else {
-//                 $(".radioList").hide()
-//                 setTabBottomHei(2)
-//             }
-
-//             let renderTabInfo = getTab(select_type)
-//             renderTab(renderTabInfo)
-//         })
-//     } else {
-//         $('.tabNameListNoSearch').show()
-//     }
-// })
-
-
-
-// let renderTabInfo = getTab("疾病")
-// renderTab(renderTabInfo)
-
-// $(".tabList").click(function (e) {
-//     e.stopPropagation()
-//     hideSlide()
-// })
-// $(".hideTabList").click(function (e) {
-//     e.stopPropagation()
-//     hideSlide()
-// })
-// //点击页面其他地方关闭下拉
-// $('html').click(function () {
-//     hideSlide()
-//     // const selectListShow = $('.selectList').css('display')
-//     // const tabNameListShow = $('.tabNameList').css('display')
-//     // const tabNameListNoSearchShow = $('.tabNameListNoSearch').css('display')
-//     // const hideTabListShow = $('.hideTabList').css('display')
-//     // if(selectListShow == 'block'){
-//     //     $('.selectList').hide()
-//     //     $('.iconSlide').attr('src','./images/iconSlideDown.png')
-//     // }
-//     // if(tabNameListShow == 'block'){
-//     //     $('.tabNameList').hide()
-//     // }
-//     // if(tabNameListNoSearchShow == 'block'){
-//     //     $('.tabNameListNoSearch').hide()
-//     // }
-//     // if(hideTabListShow == 'block'){
-//     //     hideHideTab()
-//     // }
-// })
-
-// // $(function () {
-// //     $(".right-aside-collapse").on("click", function () {
-// //         isRightCollapse = !isRightCollapse
-// //         if (isRightCollapse) {
-// //             $("#tabList > .toggleTab").hide()
-// //             $(".right").animate({ "width": '150px' })
-// //         } else {
-// //             $(".right").animate({ "width": '394px' })
-// //         }
-// //     })
-// // })
-
-// let toggleTabHtml = ""
-// $(".right-aside-collapse").on("click", function () {
-//     isRightCollapse = !isRightCollapse
-//     if (isRightCollapse) {
-//         $(this).attr('class', 'right-aside-collapsed')
-//         toggleTabHtml = $("#tabList > .toggleTab").html()
-//         $("#tabList > .toggleTab").empty()
-//         // document.querySelector('.toggleTab').style.display = 'none';
-//         $(".right").animate({ "width": '150px' }, function () {
-//         })
-//         const contentWidth = $(".content").width()
-//         const leftWidth = (contentWidth - 150).toString() + 'px'
-//         // console.log("contentWidth", leftWidth);
-//         $(".content .left").animate({ 'width': leftWidth, }, function () {
-//             window.graphMap.resize()
-//             // console.log("graphMap", window.graphMap)
-//         })
-
-//     } else {
-//         $(this).attr('class', 'right-aside-collapse')
-//         $("#tabList > .toggleTab").html(toggleTabHtml)
-//         $(".right").animate({ "width": '461px' })
-//         const contentWidth = $(".content").width()
-//         const leftWidth = (contentWidth - 461).toString() + 'px'
-//         $(".content .left").animate({ 'width': leftWidth, }, function () {
-//             window.graphMap.resize()
-//             // console.log("graphMap", window.graphMap)
-//         })
-//     }
-// })
-
-// window.addEventListener("message", function (event) {
-//     // console.log("message", event.data);
-//     if (event.data.operation == "left-collapse") {
-//         const contentWidth = $(".content").width()
-//         // console.log("contentWidth", contentWidth)
-//         let leftWidth = 0
-//         if (isRightCollapse) {
-//             leftWidth = (contentWidth - 150).toString() + 'px'
-//             $(".content .left").css('width', leftWidth)
-
-//         } else {
-//             leftWidth = (contentWidth - 461).toString() + 'px'
-//             $(".content .left").css('width', leftWidth)
-
-//         }
-//         // console.log("leftWidth", leftWidth);
-//         window.graphMap.resize()
-//     }
-// })
-// $(".record .selectedData,.record").on("click", function (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")
-//         const name = $(this).attr("name")
-//         const label = $(this).attr("label")
-//         // reDrawGraph(name, label)
-//         getGraph(name, label)
-//         // $(".record .selectList-record").slideUp()
-//     })
-// })
-
-
-
-
-// module.exports = {
-//     getTab,
-//     renderTab
-// }
-
 
 
 require("../css/selfKnowledgeGraph.less")
 require("./../css/common.less");
 const { drawGraph, updateTree, getGraph, getTree, getNode, getTab, renderTab, setTabBottomHei, selectedZTreeNode,
     setSelectName, hideHideTab, hideSlide, reDrawGraph } = require('./selfgraphMap.js');
-// require("element-ui/lib/theme-chalk/index.css")
-const { post, get, api, getUrlArgObject } = require('./api.js');
+const { post, get, api, getUrlArgObject, ifHideLogo} = require('./api.js');
 const $ = require('jquery')
 const Vue = require("vue/dist/vue.esm.js").default;
-// const ElementUI = require("../public/elementUI/index.js");
 
 const ElementUI = require("element-ui/lib/index.js");
-// import UmyUi from 'umy-ui'
-// Vue.use(UmyUi);
 /**右侧侧边栏折叠*/
 let isRightCollapse = false
 let self = getUrlArgObject("self") ? true : false;
@@ -406,8 +62,221 @@ window.knowledgeMapSetting = {
     showLegendAll: false,//是否展示全部图例
     records: [],//历史记录
 }
+if (noTree) {
+    $(".content .right").css('display', 'none')
+    $(".content .left").css("width", "100%")
+} else {
+    $(".content .right").css('display', 'block')
+}
+//选择类型
+$('.select').click(function (e) {
+    e.stopPropagation();
+    hideSlide('selectList')
+    const selectListShow = $('.selectList').css('display')
+    if (selectListShow == 'none') {
+        $('.iconSlide').attr('src', './images/iconSlideUp.png')
+    } else {
+        $('.iconSlide').attr('src', './images/iconSlideDown.png')
+    }
+    $('.selectList').fadeToggle()
+
+})
+$('.selectList .selectItem').click(function () {
+    select_type_noSearch = $(this).attr('data-id')
+    const txt = $(this).text()
+    const oldTxt = $(".selectedName").html()
+    setSelectName(txt)
+
+    $("#searchInp").attr("placeholder", `请输入${txt}名称`)
+    if (txt != oldTxt) {
+        $('#searchInp').val("")
+    }
+
+})
+
+
+
+//搜索节点名
+$("#searchInp").bind("input propertychange", function (event) {
+    const val = $("#searchInp").val().trim()
+    if (val) {
+        getNode(val, select_type_noSearch)
+    } else {
+        $(".tabNameList").hide()
+    }
+});
+
+//切换条目
+// $('.radioItem').click(function (e) {
+//     $('.radioItem').css('color', '#333333')
+//     $(this).css("color", '#409EF1')
+//     const dataId = $(".showTabList .tab.activeTab").attr("data-id")
+//     const initDiag = dataId == "疾病" ? "艾滋病" : "过氧化氢溶液"
+//     const type = +$(this).attr('data-type')
+//     const subType = +$(this).attr('sub-type')
+//     // $(this).children('img').attr('src')
+//     $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+//     $(this).children('img').attr('src', '/images/radioSelect.png')
+//     $('#searchInp').val(initDiag)
+//     getTree(subType, type, initDiag);
+//     getGraph(initDiag, select_type);
+//     // updateTree(initDiag)
+// })
+
+//搜索
+$('#searchBtn').click(function (e) {
+    e.stopPropagation()
+    hideSlide()
+    const val = $('#searchInp').val().trim()
+    if (val) {
+        const clientHei = $(window).height()
+        const contentHei = clientHei - 80
+        $(".tabNameList").hide()
+        getGraph(val, select_type_noSearch).then(() => {
+            if (!window.refreshTree) {
+                return
+            }
+            select_type = select_type_noSearch
+
+            if (select_type == '疾病') {
+                // $('#searchInp').val("高血压3级")
+                getTree(1, 1, val);
+            } else if (select_type == '药品') {
+                getTree(0, 2, val);
+            } else if (select_type == '症状') {
+                getTree(0, 3, val);
+            }
+            // else if (select_type == '手术和操作') {
+            //     getTree(0, 4, val);
+            // } 
+            else if (select_type == '实验室检查') {
+                getTree(0, 5, val);
+            } else if (select_type == '辅助检查') {
+                getTree(0, 6, val);
+            }
+
+
+            if (select_type == '疾病') {
+                $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                $('.ICD10 img').attr('src', '/images/radioSelect.png')
+                $(".radioList").show()
+                $(".radioList .radioItem").hide()
+                $(".radioList .disease").show()
+
+                setTabBottomHei(1)
+            } else if (select_type == '药品') {
+                $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                $('.general img').attr('src', '/images/radioSelect.png')
+                $(".radioList").show()
+                $(".radioList .radioItem").hide()
+                $(".radioList .medicine").show()
+                setTabBottomHei(1)
+            }
+            else {
+                $(".radioList").hide()
+                setTabBottomHei(2)
+            }
+
+            let renderTabInfo = getTab(select_type)
+            renderTab(renderTabInfo)
+        })
+    } else {
+        $('.tabNameListNoSearch').show()
+    }
+})
+
+
+
+let renderTabInfo = getTab("疾病")
+renderTab(renderTabInfo)
+
+$(".tabList").click(function (e) {
+    e.stopPropagation()
+    hideSlide()
+})
+$(".hideTabList").click(function (e) {
+    e.stopPropagation()
+    hideSlide()
+})
+//点击页面其他地方关闭下拉
+$('html').click(function () {
+    hideSlide()
+})
+
+
+let toggleTabHtml = ""
+$(".right-aside-collapse").on("click", function () {
+    isRightCollapse = !isRightCollapse
+    if (isRightCollapse) {
+        $(this).attr('class', 'right-aside-collapsed')
+        toggleTabHtml = $("#tabList > .toggleTab").html()
+        $("#tabList > .toggleTab").empty()
+        $(".right").animate({ "width": '150px' }, function () {
+        })
+        const contentWidth = $(".content").width()
+        const leftWidth = (contentWidth - 150).toString() + 'px'
+        $(".content .left").animate({ 'width': leftWidth, }, function () {
+            window.graphMap.resize()
+        })
+
+    } else {
+        $(this).attr('class', 'right-aside-collapse')
+        $("#tabList > .toggleTab").html(toggleTabHtml)
+        $(".right").animate({ "width": '461px' })
+        const contentWidth = $(".content").width()
+        const leftWidth = (contentWidth - 461).toString() + 'px'
+        $(".content .left").animate({ 'width': leftWidth, }, function () {
+            window.graphMap.resize()
+        })
+    }
+})
+
+window.addEventListener("message", function (event) {
+    if (event.data.operation == "left-collapse") {
+        const contentWidth = $(".content").width()
+        let leftWidth = 0
+        if (isRightCollapse) {
+            leftWidth = (contentWidth - 150).toString() + 'px'
+            $(".content .left").css('width', leftWidth)
+
+        } else {
+            leftWidth = (contentWidth - 461).toString() + 'px'
+            $(".content .left").css('width', leftWidth)
+
+        }
+        window.graphMap.resize()
+    }
+})
+$(".record .selectedData,.record").on("click", function (event) {
+    event.stopPropagation()
+    $(".record .selectList-record").slideToggle()
+    $(".record .selectList-record .selectItem-record").on("click", function (event) {
+        const name = $(this).attr("name")
+        const label = $(this).attr("label")
+        getGraph(name, label)
+    })
+})
 
 Vue.use(ElementUI)
+setHei()
+ifHideLogo();
+function setHei() {
+    const clientHei = $(window).height()
+    const contentHei = 580
+    $(".left").css("height", contentHei + 'px')
+    $(".right").css("height", contentHei + 'px')
+    if (select_type == "疾病") {
+        setTabBottomHei(1)
+    } else {
+        setTabBottomHei(2)
+    }
+    $("#main").css("height", contentHei - 20 - 20 - 10 + 'px')
+}
+$(window).resize(function () {
+    setHei()
+    // getGraph(graphTxt,select_type);
+
+})
 
 const vm = new Vue({
   el: "#app",
@@ -444,7 +313,9 @@ const vm = new Vue({
       this.initGraph(id)
     },
     initGraph(id){
+      window.graph_id = id //清除上一个关系图实例
       let user_id = localStorage.getItem("userId") ? JSON.parse(localStorage.getItem("userId")) : 1
+      window.user_id = user_id
       getGraph('艾滋病','疾病',id)
       getTree(user_id, id,'艾滋病')
 

+ 10 - 113
src/js/selfgraphMap.js

@@ -12,56 +12,19 @@ let disease = getUrlArgObject("disease")
 function getGraph(val, type,id) {
     let url = ""
     let params = null
-
-    if (window.knowledgeMapSetting.self) {
-        url = api.getSelfGraph
-        params = {
-            "input_str": val,
-            "label_name": type,
-            "user_id": localStorage.getItem("userId") ? +JSON.parse(localStorage.getItem("userId")) : -1
-        }
-        return get(url, params).then(res => {
-
-            if (res.data.code === 200) {
-                let records = res.data.records[0].records || []
-                // for (let i = 0; i < records.node.length; i++) {
-                //     records.node[i].label = records.node[i].name
-                //     records.node[i].name = (i + 1).toString()
-                // }
-                // console.log("getSelfGraph", records.node)
-                // select_type = select_type_noSearch
-                $('#searchInp').val(val)
-                window.graphTxt = val
-                window.refreshTree = true
-                // console.log(val, type, window.select_type)
-                window.select_type = type
-                select_type_noSearch = type
-                let renderTabInfo = getTab(type)
-                renderTab(renderTabInfo)
-                addRecord(val, type)
-                setSelectName(select_type)
-                drawGraph(records, null)
-            } else {
-                let nodeStr
-                nodeStr = '<li class="ellipsis">暂无符合数据</li>'
-                $(".tabNameList").html(nodeStr)
-                $(".tabNameList").show()
-                window.refreshTree = false
-            }
-        })
-    } else {
         url = api.getSelfGraph
         params = {
             "input_str": val ? val : '',
             "label_name": type,
              "user_id": localStorage.getItem("userId") ? JSON.parse(localStorage.getItem("userId")) : 1,
-             'graph_id':id,
+             'graph_id':id ? id : window.graph_id,
         }
         return get(url, params).then(res => {
-            if (res.data.code == 0) {
+            console.log("getselfGraph", res);
+            if (res.data.code == 200) {
                 // select_type = select_type_noSearch
                 $('#searchInp').val(val)
-                drawGraph(res.data.data, null)
+                drawGraph(res.data.records[0].records, null)
                 window.graphTxt = val
                 window.refreshTree = true
 
@@ -82,7 +45,7 @@ function getGraph(val, type,id) {
     }
 
 
-}
+
 
 function reDrawGraph(name, label) {
     // getGraph(name, label)
@@ -96,80 +59,14 @@ function reDrawGraph(name, label) {
     }
     let url = ""
     let params = null
-    if (window.knowledgeMapSetting.self) {
         url = api.getSelfGraph
         params = {
-            "input_str": name,
-            "label_name": label,
-            "user_id": localStorage.getItem("userId") ? JSON.parse(localStorage.getItem("userId")) : -1
+            "input_str": val ? val : '',
+            "label_name": type,
+             "user_id": localStorage.getItem("userId") ? JSON.parse(localStorage.getItem("userId")) : 1,
+             'graph_id':id,
         }
         get(url, params).then(res => {
-            if (res.data.code == 0) {
-                res.data.data.node.forEach(node => {
-                    if (!node.itemStyle.display && node.label && node.symbol == 'circle') {
-                        node.symbol = 'pin'
-                        // node.symbolSize = [node.symbolSize * 1.5, node.symbolSize]
-                    }
-                });
-                window.graphMapUpdatedData = res.data.data
-                let expandPropertyNodes = [] //要展开节点的数据
-                let currentNode = null //当前显示信息的节点
-                let legendData = null //新的图例数据
-                for (let i = 0; i < window.graphMapUpdatedData.node.length; i++) {
-                    const node = window.graphMapUpdatedData.node[i]
-                    // console.log(window.knowledgeMapSetting.currentNodeId, node.nodeId)
-                    if (node.nodeId === window.knowledgeMapSetting.currentNodeId) {
-                        currentNode = node
-                    }
-                    for (let j = 0; j < window.knowledgeMapSetting.expandPropertyId.length; j++) {
-                        const expandNodeId = window.knowledgeMapSetting.expandPropertyId[j]
-                        if (expandNodeId === node.nodeId) {
-                            expandPropertyNodes.push(node)
-                        }
-                    }
-                }
-                window.knowledgeMapSetting.legends = window.graphMapUpdatedData.categories.slice(2)
-                //重新计算showLegendNum
-                reShowLegendNum()
-                if (window.knowledgeMapSetting.showLegendAll) {
-                    legendData = window.knowledgeMapSetting.legends.map(el => el.name)
-                } else {
-                    legendData = window.knowledgeMapSetting.legends.slice(0, window.knowledgeMapSetting.showLegendNum).map(el => el.name)
-                }
-
-                expandPropertyNodePad(expandPropertyNodes) //添加展开属性节点
-                reNodeCloseAndExpand(legendData) //添加隐藏节点
-                window.graphMap.setOption({
-                    legend: [{
-                        data: legendData
-                    }],
-                    series: [{
-                        edgeLabel: {
-                            formatter: function (x) {
-                                if (x.data.hideLabel) {
-                                    return " ";
-                                }
-                                else {
-                                    return x.data.value;  //横线关系
-                                }
-                            },
-                        },
-                        categories: window.graphMapUpdatedData.categories,
-                        type: 'graph',
-                        data: window.graphMapUpdatedData.node,  // 更新节点数据
-                        links: window.graphMapUpdatedData.links,  // 更新边数据
-                    }]
-                }, false);  // 仅更新指定的部分,不重绘图表
-                rightMsgRender(currentNode) //重新渲染右侧数据
-            }
-        })
-    } else {
-        url = api.getGraph
-        params = {
-            "inputStr": name,
-            "labelName": label
-        }
-        post(url, params).then(res => {
             if (res.data.code === 200) {
                 let records = res.data.records[0].records
                 records.node.forEach(node => {
@@ -234,7 +131,7 @@ function reDrawGraph(name, label) {
 
 
 
-}
+
 function reShowLegendNum() {
     window.knowledgeMapSetting.showLegendNum = 0;
     let sum = 0

+ 3 - 3
webpack.config.js

@@ -7,9 +7,9 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
 const ExtractTextPlugin = require("extract-text-webpack-plugin");
 const webpack = require('webpack');
 // const proxyHost = "http://173.18.12.195:5050";
-const proxyHost = "http://173.18.12.205:8086/healsphere";
-// const proxyHost = "http://192.18.1.235:8000/open-platform"
-// const proxyHost = "http://192.168.3.113:5050";
+// const proxyHost = "http://173.18.12.205:8086/healsphere";
+const proxyHost = "http://192.18.1.235:8000/open-platform"
+// const proxyHost = "http://192.18.1.235:8000";
 // const proxyHost = "http://173.18.12.192:5050";
 module.exports = {
   entry: {