Browse Source

添加能从链接获取搜索数据的功能

yangdr 7 months ago
parent
commit
de30a12a83
4 changed files with 498 additions and 491 deletions
  1. 2 1
      package.json
  2. 303 301
      src/js/graphMap.js
  3. 90 88
      src/js/index.js
  4. 103 101
      webpack.config.js

+ 2 - 1
package.json

@@ -8,7 +8,8 @@
     "es3ify-loader": "^0.2.0",
     "jquery": "^1.12.4",
     "poplar-annotation": "^2.0.3",
-    "webpack-cli": "^3.3.1"
+    "webpack-cli": "^3.3.1",
+    "zn": "file:"
   },
   "devDependencies": {
     "@babel/core": "^7.4.4",

+ 303 - 301
src/js/graphMap.js

@@ -1,30 +1,32 @@
 const echarts = require("echarts");
-const { post, api } = require('./api.js');
+const { post, api, getUrlArgObject } = require('./api.js');
 const iconUp = require('./../resources/images/iconUp.png');
 const iconDown = require('./../resources/images/iconDown.png');
 
 const clientHei = $(window).height()
 const contentHei = clientHei - 80
+let disease = getUrlArgObject("disease")
+// console.log("disease", disease);
 
 //关系图
-function getGraph(val, type){
-    return post(api.getGraph,{
+function getGraph(val, type) {
+    return post(api.getGraph, {
         "inputStr": val,
         "labelName": type
-    }).then(res=>{
-        if(res.data.code == 0) {
+    }).then(res => {
+        if (res.data.code == 0) {
             // select_type = select_type_noSearch
             $('#searchInp').val(val)
             drawGraph(res.data.data)
             window.graphTxt = val
             window.refreshTree = true
-            if(type != select_type){
+            if (type != select_type) {
                 select_type = type
-                let renderTabInfo = getTab(type) 
-                renderTab(renderTabInfo) 
-              
+                let renderTabInfo = getTab(type)
+                renderTab(renderTabInfo)
+
             }
-        }else{
+        } else {
             let nodeStr
             nodeStr = '<li class="ellipsis">暂无符合数据</li>'
             $(".tabNameList").html(nodeStr)
@@ -35,7 +37,7 @@ function getGraph(val, type){
 }
 
 
-function drawGraph(data,resultShowId) {
+function drawGraph(data, resultShowId) {
     // var colors = [
     //     '#FB95AF','#788083','#B2CCCF','#68BDF6','#FFD86E','#6DCE9F','#9BB2F0','#DBB7AC'
     // ]
@@ -44,23 +46,23 @@ function drawGraph(data,resultShowId) {
     var legends = categories.slice(2, categories.length);
     var showLegendNum = 0;
     let sum = 0
-    for(let i = 0; i < legends.length; i++){
+    for (let i = 0; i < legends.length; i++) {
 
-        sum += 2+legends[i].name.length+1
-        if(sum <= 60){
-            showLegendNum ++
+        sum += 2 + legends[i].name.length + 1
+        if (sum <= 60) {
+            showLegendNum++
         }
     }
     var option = {
-        title: { 
+        title: {
             text: '医学知识图谱',
             top: '10',
             left: '10',
-          textStyle:{
-                color:'#5BBBFF'
-          }
+            textStyle: {
+                color: '#5BBBFF'
+            }
         },
-        color:['#dd7172','#E57373','#0EB1EE','#9D96F5','#ACC68E','#EDAA77','#14BBB3','#538FFF','#1390FB','#C7B02E',],
+        color: ['#dd7172', '#E57373', '#0EB1EE', '#9D96F5', '#ACC68E', '#EDAA77', '#14BBB3', '#538FFF', '#1390FB', '#C7B02E',],
         tooltip: {
             formatter: function (x) {
                 return x.data.label;
@@ -70,32 +72,32 @@ function drawGraph(data,resultShowId) {
             type: 'scroll',
             bottom: 0,
             //  left: 0,
-             itemWidth: 8,
-             itemHeight: 8,
-             itemGap: 20,
-             icon: 'circle',
-             width: 766,
-             verticalAlign:'top',
-                color:'#fff',
-             borderColor:'#E6E6E6',
+            itemWidth: 8,
+            itemHeight: 8,
+            itemGap: 20,
+            icon: 'circle',
+            width: 766,
+            verticalAlign: 'top',
+            color: '#fff',
+            borderColor: '#E6E6E6',
             //  borderTopWidth:1,
-            padding:[20, 1000, 0, 1000],
+            padding: [20, 1000, 0, 1000],
             backgroundColor: "#0D2C53",
-            selected:{},
-            textStyle:{
-                  color:'#fff'
+            selected: {},
+            textStyle: {
+                color: '#fff'
             },
             // orient: 'vertical',
-            data: legends.slice(0,showLegendNum).map(function (a) {
+            data: legends.slice(0, showLegendNum).map(function (a) {
                 return a.name;
             }),
-            
+
         }],
         series: [
             {
                 type: 'graph',
                 layout: 'force',
-                cursor:'pointer',
+                cursor: 'pointer',
                 categories: categories,
                 symbolSize: 80,
                 roam: 'move',
@@ -112,14 +114,14 @@ function drawGraph(data,resultShowId) {
                 force: {
                     repulsion: 500,
                     gravity: 0.8,
-                    friction :0.2, //动画速度
+                    friction: 0.2, //动画速度
                     edgeLength: [4, 7],
-                    layoutAnimation : true
+                    layoutAnimation: true
                 },
                 draggable: false,
                 animation: true,
-                hoverAnimation:false,
-                animationDuration:5000,
+                hoverAnimation: false,
+                animationDuration: 5000,
                 focusNodeAdjacency: true,
                 itemStyle: {
                     normal: {
@@ -133,7 +135,7 @@ function drawGraph(data,resultShowId) {
                 lineStyle: {
                     normal: {
                         width: 2,
-                        cursor:'default',
+                        cursor: 'default',
                         color: 'target'
                     }
                 },
@@ -149,13 +151,13 @@ function drawGraph(data,resultShowId) {
                     normal: {
                         show: true,
                         textStyle: {
-                            cursor:'pointer',
+                            cursor: 'pointer',
                         },
-                        color:'#fff', //label字体颜色
+                        color: '#fff', //label字体颜色
                         formatter: function (x) {
-                             var tmp = x.data.label;
-                            if(tmp.length >= 12){
-                                tmp = tmp.substring(0,12);
+                            var tmp = x.data.label;
+                            if (tmp.length >= 12) {
+                                tmp = tmp.substring(0, 12);
                                 tmp = tmp + "...";
                             }
                             return tmp;
@@ -167,66 +169,66 @@ function drawGraph(data,resultShowId) {
             }
         ]
     };
-    $(window).resize(function(){
-        myChart.resize(); 
-     })
-    myChart.on('click',dataClick);
+    $(window).resize(function () {
+        myChart.resize();
+    })
+    myChart.on('click', dataClick);
     let selected = {}
-    myChart.on('legendselectchanged',function(obj){
+    myChart.on('legendselectchanged', function (obj) {
         selected = obj.selected
     })
-    myChart.setOption(option,true);
-    if(legends.length > showLegendNum){
+    myChart.setOption(option, true);
+    if (legends.length > showLegendNum) {
         $('.legendSlideUp').toggleClass('legendSlideUp')
-        $('.legendIcon').css('display',"block")
-    }else{
+        $('.legendIcon').css('display', "block")
+    } else {
         $('.legendSlideUp').toggleClass('legendSlideUp')
-        $('.legendIcon').css('display',"none")
+        $('.legendIcon').css('display', "none")
     }
-    $('.legendIconImg').off("click").on('click',function(e){
+    $('.legendIconImg').off("click").on('click', function (e) {
         e.stopPropagation()
         $('.legendIconImg').toggleClass('legendSlideUp')
-        if(option.legend[0].type=='scroll'){
-            option.legend[0].type='plain'
+        if (option.legend[0].type == 'scroll') {
+            option.legend[0].type = 'plain'
             option.legend[0].data = legends
             option.legend[0].selected = selected
-        }else{
-            option.legend[0].type='scroll'
-            option.legend[0].data = legends.slice(0,showLegendNum)
+        } else {
+            option.legend[0].type = 'scroll'
+            option.legend[0].data = legends.slice(0, showLegendNum)
             option.legend[0].selected = selected
         }
-       
-        myChart.setOption(option,true);
+
+        myChart.setOption(option, true);
     })
-}   
+}
 
-function dataClick(param){
+function dataClick(param) {
     var data = param.data;
     const clientHei = $(window).height()
     const contentHei = clientHei - 80
     // console.log('data', data,select_type)
     // var nodes = option.series[0].nodes;
-    if(data.category == 0){
+    if (data.category == 0) {
         return
-    }else{
-        if(data.symbol != "circle"){
+    } else {
+        if (data.symbol != "circle") {
             return
-        }else{
-            if(data.type == select_type){
+        } else {
+            if (data.type == select_type) {
                 $('#searchInp').val(data.label)
                 updateTree(data.label)
-                getGraph(data.label,select_type);
-              
-            }else {
-                let renderTabInfo = getTab(data.type) 
-                renderTab(renderTabInfo) 
-               
-                if(data.type == "疾病"){
+                getGraph(data.label, select_type);
+
+            } else {
+                let renderTabInfo = getTab(data.type)
+                renderTab(renderTabInfo)
+
+                if (data.type == "疾病") {
                     $(".radioList").show()
-                    $('.iconRadio').attr('src','/images/radioUnSelect.png')
-                    $('.ICD10 img').attr('src','/images/radioSelect.png')
+                    $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                    $('.ICD10 img').attr('src', '/images/radioSelect.png')
                     setTabBottomHei(1)
-                }else{
+                } else {
                     $(".radioList").hide()
                     setTabBottomHei(2)
                 }
@@ -234,48 +236,48 @@ function dataClick(param){
                 select_type = data.type
                 setSelectName(select_type)
                 $('#searchInp').val(data.label)
-                if(data.type == "疾病"){
-                    getTree(1,1,data.label);
-                    getGraph(data.label,select_type);
-                }else if(data.type == "药品通用名"){
-                    getTree(0,2,data.label);
-                    getGraph(data.label,select_type);
-                }else if(data.type == "症状"){
-                  
-                    getTree(0,3,data.label);
-                    getGraph(data.label,select_type);
-                }else if(data.type == "手术和操作"){
-                    getTree(0,4,data.label);
-                    getGraph(data.label,select_type);
-                }else if(data.type == "实验室检查"){
-                    getTree(0,5,data.label);
-                    getGraph(data.label,select_type);
-                }else if(data.type == "辅助检查"){
-                    getTree(0,6,data.label);
-                    getGraph(data.label,select_type);
+                if (data.type == "疾病") {
+                    getTree(1, 1, data.label);
+                    getGraph(data.label, select_type);
+                } else if (data.type == "药品通用名") {
+                    getTree(0, 2, data.label);
+                    getGraph(data.label, select_type);
+                } else if (data.type == "症状") {
+
+                    getTree(0, 3, data.label);
+                    getGraph(data.label, select_type);
+                } else if (data.type == "手术和操作") {
+                    getTree(0, 4, data.label);
+                    getGraph(data.label, select_type);
+                } else if (data.type == "实验室检查") {
+                    getTree(0, 5, data.label);
+                    getGraph(data.label, select_type);
+                } else if (data.type == "辅助检查") {
+                    getTree(0, 6, data.label);
+                    getGraph(data.label, select_type);
                 }
             }
         }
     }
- }
+}
 
 
 
 
-function getTree(subType, type,showNodeName){
+function getTree(subType, type, showNodeName) {
     post(api.getTree,
         {
             "subType": subType,     //科室subType: 2, 疾病type:1
             "type": type
         }
-    ).then(res=>{
-        if(res.data.code == 0) {
+    ).then(res => {
+        if (res.data.code == 0) {
             const data = res.data.data
-            drawTree(data,showNodeName)
+            drawTree(data, showNodeName)
         }
     })
 }
-function drawTree(data, showNodeName){
+function drawTree(data, showNodeName) {
     /**
         属性说明  id  当前节点的唯一ID
         pId [必须大写]  代表当前节点的父节点id
@@ -289,9 +291,9 @@ function drawTree(data, showNodeName){
         target:设置打开链接的方式  [在新窗口打开(_blank),要本窗口打开(_self)]
             
     **/
-    var setting = {	
+    var setting = {
         //数据格式的设置
-        data:{
+        data: {
             simpleData: {
                 enable: true, //使用简单的JSON格式
                 idKey: "id",
@@ -300,24 +302,24 @@ function drawTree(data, showNodeName){
             },
         },
         //树的显示设置
-        view:{
-            showLine:true, //设置是否显示连线 默认为true
+        view: {
+            showLine: true, //设置是否显示连线 默认为true
             showTitle: true,//设置是否显示鼠标悬浮时显示title的效果
             dblClickExpand: true,//设置是否支持双击展开树节点
-            fontCss : {color:"#fff"},//设置节点样式
+            fontCss: { color: "#fff" },//设置节点样式
             expandSpeed: "normal",//设置展开的速度  fast normal  slow 
             nameIsHTML: true,//名字是否是HTML
             selectedMulti: true,
         },
         //设置事件回调
-        callback:{
+        callback: {
             onClick: function (treeId, treeNode) {
                 const selectPId = $('.curSelectedNode').attr('id')
-                if(selectPId){
-                    const selectId = selectPId.substring(0,selectPId.length-1) + 'ico'
-                    $('#'+selectId).append('<img class="iconSelect" src="./images/iconSelect.png">')
+                if (selectPId) {
+                    const selectId = selectPId.substring(0, selectPId.length - 1) + 'ico'
+                    $('#' + selectId).append('<img class="iconSelect" src="./images/iconSelect.png">')
                 }
-              
+
             },
             beforeClick: function (treeId, treeNode) {
                 var zTree = $.fn.zTree.getZTreeObj("tree");
@@ -327,18 +329,18 @@ function drawTree(data, showNodeName){
                 } else {
                     const treeNodeName = treeNode.name
                     let index = treeNodeName.indexOf(' ')
-                    const name = treeNodeName.substring(index+1)
-                    if(select_type != select_type_noSearch){
+                    const name = treeNodeName.substring(index + 1)
+                    if (select_type != select_type_noSearch) {
                         select_type_noSearch = select_type
                         setSelectName(select_type)
                     }
-                    getGraph(name,select_type)
+                    getGraph(name, select_type)
                     const selectPId = $('.curSelectedNode').attr('id')
-                    if(selectPId){
-                        const selectId = selectPId.substring(0,selectPId.length-1) + 'ico'
-                        $('#'+selectId + ' .iconSelect').remove()
+                    if (selectPId) {
+                        const selectId = selectPId.substring(0, selectPId.length - 1) + 'ico'
+                        $('#' + selectId + ' .iconSelect').remove()
                     }
-             
+
                     // showKnowledgeGraph(treeNode.name, 'graph', 0);
                     return true;
                 }
@@ -348,74 +350,74 @@ function drawTree(data, showNodeName){
     var zNodes = data.nodes;
     // var zNodes = zTreeData.nodes; 
     $.fn.zTree.init($("#tree"), setting, zNodes);
-    if(showNodeName) {
+    if (showNodeName) {
         // updateTree(showNodeName)
 
     }
 }
 
-function getNode(val, type){
+function getNode(val, type) {
     post(api.getNode,
         {
             "inputStr": val,
             "labelName": type
         }
-    ).then(res=>{
-        if(res.data.code == 0) {
+    ).then(res => {
+        if (res.data.code == 0) {
             const data = res.data.data
-            let nodeStr =''
-            if(data.length > 0){
-                for(let i = 0; i < data.length; i++){
-                    nodeStr +=`<li class="ellipsis nodeItem" title=${data[i].name}>${data[i].name}</li>`
+            let nodeStr = ''
+            if (data.length > 0) {
+                for (let i = 0; i < data.length; i++) {
+                    nodeStr += `<li class="ellipsis nodeItem" title=${data[i].name}>${data[i].name}</li>`
                 }
-            }else{
+            } else {
                 nodeStr = '<li class="ellipsis">暂无符合数据</li>'
             }
             $(".tabNameList").html(nodeStr)
             $(".tabNameList").show()
-            $(".tabNameList li").click(function(){
+            $(".tabNameList li").click(function () {
                 const txt = $(this).text()
-                if(txt !="暂无符合数据"){
+                if (txt != "暂无符合数据") {
                     $('#searchInp').val(txt)
                 }
                 const clientHei = $(window).height()
                 const contentHei = clientHei - 80
                 $(".tabNameList").hide()
-                getGraph(txt,select_type_noSearch).then(()=>{
-                    if(!window.refreshTree){
-                      
+                getGraph(txt, select_type_noSearch).then(() => {
+                    if (!window.refreshTree) {
+
                         return
                     }
-                        select_type = select_type_noSearch
-                        
-                        if(select_type == '疾病'){
-                            // $('#searchInp').val("高血压3级")
-                            getTree(1,1,txt);
-                        }else if(select_type == '药品通用名'){
-                            getTree(0,2,txt);
-                        }else if(select_type == '症状'){
-                            getTree(0,3,txt);
-                        }else if(select_type == '手术和操作'){
-                            getTree(0,4,txt);
-                        }else if(select_type == '实验室检查'){
-                            getTree(0,5,txt);
-                        }else if(select_type == '辅助检查'){
-                            getTree(0,6,txt);
-                        }
-                        if(select_type == '疾病'){
-                            $('.iconRadio').attr('src','/images/radioUnSelect.png')
-                            $('.ICD10 img').attr('src','/images/radioSelect.png')
-                            $(".radioList").show()
-                            setTabBottomHei(1)
-                        }else{
-                            $(".radioList").hide()
-                            setTabBottomHei(2)
-                        }
-                        let renderTabInfo = getTab(select_type) 
-                        renderTab(renderTabInfo)
-                    
+                    select_type = select_type_noSearch
+
+                    if (select_type == '疾病') {
+                        // $('#searchInp').val("高血压3级")
+                        getTree(1, 1, txt);
+                    } else if (select_type == '药品通用名') {
+                        getTree(0, 2, txt);
+                    } else if (select_type == '症状') {
+                        getTree(0, 3, txt);
+                    } else if (select_type == '手术和操作') {
+                        getTree(0, 4, txt);
+                    } else if (select_type == '实验室检查') {
+                        getTree(0, 5, txt);
+                    } else if (select_type == '辅助检查') {
+                        getTree(0, 6, txt);
+                    }
+                    if (select_type == '疾病') {
+                        $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                        $('.ICD10 img').attr('src', '/images/radioSelect.png')
+                        $(".radioList").show()
+                        setTabBottomHei(1)
+                    } else {
+                        $(".radioList").hide()
+                        setTabBottomHei(2)
+                    }
+                    let renderTabInfo = getTab(select_type)
+                    renderTab(renderTabInfo)
+
                 })
-               
+
             })
         }
     })
@@ -423,260 +425,260 @@ function getNode(val, type){
 
 function updateTree(keyWord, txt) {
     var t = $("#tree");
-        // if(zNodes&& zNodes.length > 0 && zNodes[0]['name'].indexOf(txt) != -1){
-        //     $.fn.zTree.init(t, setting, zNodes);
-        //     var zTree = $.fn.zTree.getZTreeObj("tree");
-        //     zTree.selectNode(zTree.getNodeByParam("name", keyWord));
-        // }else {
-        var tree_select = document.getElementsByClassName("tree_selected");
-        for(i = 0; i < tree_select.length; i++){
-            tree_select[i].className = "tree_button";
-        }
-        var tree_button = document.getElementsByClassName("tree_button");
-        for(i = 0; i < tree_button.length; i++){
-            if(tree_button[i].text == txt){
-                tree_button[i].className = "tree_selected";
-            }
-        }
-        if(txt != "疾病"){
-            $("#radio").hide();
-        }else {
-             $("#radio").show();
+    // if(zNodes&& zNodes.length > 0 && zNodes[0]['name'].indexOf(txt) != -1){
+    //     $.fn.zTree.init(t, setting, zNodes);
+    //     var zTree = $.fn.zTree.getZTreeObj("tree");
+    //     zTree.selectNode(zTree.getNodeByParam("name", keyWord));
+    // }else {
+    var tree_select = document.getElementsByClassName("tree_selected");
+    for (i = 0; i < tree_select.length; i++) {
+        tree_select[i].className = "tree_button";
+    }
+    var tree_button = document.getElementsByClassName("tree_button");
+    for (i = 0; i < tree_button.length; i++) {
+        if (tree_button[i].text == txt) {
+            tree_button[i].className = "tree_selected";
         }
-        selectedNode = keyWord;
-        var data = {"name":'tree'};
-        var zTree = $.fn.zTree.getZTreeObj("tree");
-                zTree.selectNode(zTree.getNodeByParam("name", keyWord));
-                const selectPId = $('.curSelectedNode').attr('id')
-                if(selectPId){
-                    const selectId = selectPId.substring(0,selectPId.length-1) + 'ico'
-                    $('.iconSelect').remove()
-                    $('#'+selectId).append('<img class="iconSelect" src="./images/iconSelect.png">')
-                }
-       
+    }
+    if (txt != "疾病") {
+        $("#radio").hide();
+    } else {
+        $("#radio").show();
+    }
+    selectedNode = keyWord;
+    var data = { "name": 'tree' };
+    var zTree = $.fn.zTree.getZTreeObj("tree");
+    zTree.selectNode(zTree.getNodeByParam("name", keyWord));
+    const selectPId = $('.curSelectedNode').attr('id')
+    if (selectPId) {
+        const selectId = selectPId.substring(0, selectPId.length - 1) + 'ico'
+        $('.iconSelect').remove()
+        $('#' + selectId).append('<img class="iconSelect" src="./images/iconSelect.png">')
+    }
+
 }
 
 
 
-function isEmpty(obj){
-    if(typeof obj == "undefined" || obj == null || obj == ""){
+function isEmpty(obj) {
+    if (typeof obj == "undefined" || obj == null || obj == "") {
         return true;
-    }else{
+    } else {
         return false;
     }
 }
 
 function getKeyEvent(evt) {
     var evt = (evt) ? evt : ((window.event) ? window.event : "");
-    var key = evt.keyCode?evt.keyCode:evt.which;
-    if(key==13){
+    var key = evt.keyCode ? evt.keyCode : evt.which;
+    if (key == 13) {
         keyDown = true;
         queryGraph();
         evt.cancleBubble = true;
         evt.returnValue = false;
         return false;
-    }else{
+    } else {
         return false;
     }
 }
 
-function getTab(tabName){
-    let tabList = ["疾病","药品通用名","症状","手术和操作","实验室检查","辅助检查"]
+function getTab(tabName) {
+    let tabList = ["疾病", "药品通用名", "症状", "手术和操作", "实验室检查", "辅助检查"]
     let tabListCopy = tabList.slice()
     const index = tabList.findIndex(item => item == tabName)
-  
-    if(index <= 3){
+
+    if (index <= 3) {
         return {
             activeIndex: index,
-            showTabList:tabListCopy.slice(0,4),
-            hideTabList:tabListCopy.slice(4)
+            showTabList: tabListCopy.slice(0, 4),
+            hideTabList: tabListCopy.slice(4)
         }
-    }else{
-        tabListCopy.splice(index,1)
+    } else {
+        tabListCopy.splice(index, 1)
         let hideTabList = tabListCopy.slice(3)
-        
+
         return {
             activeIndex: 3,
-            showTabList:tabListCopy.slice(0,3).concat(tabName),
-            hideTabList:hideTabList
+            showTabList: tabListCopy.slice(0, 3).concat(tabName),
+            hideTabList: hideTabList
         }
     }
 }
 
-function renderTab(data){
+function renderTab(data) {
     const showList = data.showTabList
     const hideList = data.hideTabList
     const activeIndex = data.activeIndex
     let showtabStr = ``
     let hidetabStr = ``
-    for(let i = 0; i < showList.length; i++){
-        showtabStr +=`	<span class="tab ${i === activeIndex ? 'activeTab':''}" data-id="${showList[i]}">${showList[i] =="药品通用名" ?"药品":showList[i]}</span>`
-        if(i === activeIndex){
-            if(showList[i] =="药品通用名"){
-                $("#searchInp").attr("placeholder",`请输入药品名称`)
-            }else{
-                $("#searchInp").attr("placeholder",`请输入${showList[i]}名称`)
+    for (let i = 0; i < showList.length; i++) {
+        showtabStr += `	<span class="tab ${i === activeIndex ? 'activeTab' : ''}" data-id="${showList[i]}">${showList[i] == "药品通用名" ? "药品" : showList[i]}</span>`
+        if (i === activeIndex) {
+            if (showList[i] == "药品通用名") {
+                $("#searchInp").attr("placeholder", `请输入药品名称`)
+            } else {
+                $("#searchInp").attr("placeholder", `请输入${showList[i]}名称`)
             }
         }
-        
+
     }
-    for(let i = 0; i < hideList.length; i++){
-        hidetabStr +=`<span class="tab " data-id="${hideList[i]}">${hideList[i]}</span>`
+    for (let i = 0; i < hideList.length; i++) {
+        hidetabStr += `<span class="tab " data-id="${hideList[i]}">${hideList[i]}</span>`
     }
     hidetabStr += `<div class="toggleTab">
     <span class="toggleTabTxt">收起</span>
     <img class="toggleArrow" style="transform: rotate(180deg);top:18px;" src="./images/iconDown.png" alt="">
 </div>`
     // console.log('showtabStr',showtabStr)
-    
+
     $('.showTabList').html(showtabStr)
     $('.hideTabList').html(hidetabStr)
     bindTabClick()
     ToggleTab()
 }
 ToggleTab()
-function ToggleTab(){
-    $(".toggleTab").off("click").click(function(e){
+function ToggleTab() {
+    $(".toggleTab").off("click").click(function (e) {
         e.stopPropagation()
         hideSlide("hideTabList")
         const hideTabDis = $(".hideTabList").css("display")
-        if(hideTabDis == "none"){
+        if (hideTabDis == "none") {
             showHideTab()
-        }else{
+        } else {
             hideHideTab()
         }
     })
-    
-  
+
+
 }
-function showHideTab(){
+function showHideTab() {
     $(".hideTabList").show()
     $(".tabList").addClass("tabListShow")
-    $(".toggleTab").css("display","none")
-    $(".hideTabList .toggleTab").css("display","inline-block")
+    $(".toggleTab").css("display", "none")
+    $(".hideTabList .toggleTab").css("display", "inline-block")
     // $(".toggleTabTxt").html("收起")
     // $(".toggleArrow").attr("src",iconUp)
 }
-function hideHideTab(e){
+function hideHideTab(e) {
     $(".hideTabList").hide()
     // $(".toggleTabTxt").html("展开")
     // $(".toggleArrow").attr("src",iconDown)
-        $(".toggleTab").css("display","block")
-        $(".tabList").removeClass("tabListShow")
-    
-    
+    $(".toggleTab").css("display", "block")
+    $(".tabList").removeClass("tabListShow")
+
+
 }
 bindTabClick()
 //切换tab
-function bindTabClick(){
-    $('.tabList .tab').click(function(){
+function bindTabClick() {
+    $('.tabList .tab').click(function () {
         const id = $(this).attr('data-id')
         $(this).addClass("activeTab").siblings().removeClass('activeTab')
-        let renderInfo = getTab(id) 
+        let renderInfo = getTab(id)
         renderTab(renderInfo)
-        if(id != select_type){
-            if(id != "疾病"){
+        if (id != select_type) {
+            if (id != "疾病") {
                 $(".radioList").hide()
                 setTabBottomHei(2)
-            }else{
+            } else {
                 $(".radioList").show()
                 setTabBottomHei(1)
             }
             select_type_noSearch = id
             select_type = id
             setSelectName(select_type)
-           
-            if(id == "疾病"){
-               
-                $('#searchInp').val("急性胰腺炎")
-                $('.iconRadio').attr('src','/images/radioUnSelect.png')
-                $('.ICD10 img').attr('src','/images/radioSelect.png')
-                getTree(1,1,"急性胰腺炎");
-                getGraph("急性胰腺炎",select_type);
-            
-            }else if(id=="药品通用名"){
+
+            if (id == "疾病") {
+
+                $('#searchInp').val(disease || "急性胰腺炎")
+                $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                $('.ICD10 img').attr('src', '/images/radioSelect.png')
+                getTree(1, 1, disease || "急性胰腺炎");
+                getGraph(disease || "急性胰腺炎", select_type);
+
+            } else if (id == "药品通用名") {
                 $('#searchInp').val("地高辛(XC01AAD072A001010100372)")
-                getTree(0,2,"地高辛(XC01AAD072A001010100372)");
-                getGraph("地高辛(XC01AAD072A001010100372)",select_type);
-            }else if(id == "症状"){
+                getTree(0, 2, "地高辛(XC01AAD072A001010100372)");
+                getGraph("地高辛(XC01AAD072A001010100372)", select_type);
+            } else if (id == "症状") {
                 $('#searchInp').val("背痛")
-                getTree(0,3,"背痛");
-                getGraph("背痛",select_type);
-            }else if(id == "手术和操作"){
+                getTree(0, 3, "背痛");
+                getGraph("背痛", select_type);
+            } else if (id == "手术和操作") {
                 $('#searchInp').val("动脉缝合术")
-                getTree(0,4,"动脉缝合术");
-                getGraph("动脉缝合术",select_type);
-            }else if(id == "实验室检查"){
+                getTree(0, 4, "动脉缝合术");
+                getGraph("动脉缝合术", select_type);
+            } else if (id == "实验室检查") {
                 $('#searchInp').val("白细胞计数(WBC)")
-                getTree(0,5,"白细胞计数(WBC)");
-                getGraph("白细胞计数(WBC)",select_type);
-            }else if(id == "辅助检查"){
+                getTree(0, 5, "白细胞计数(WBC)");
+                getGraph("白细胞计数(WBC)", select_type);
+            } else if (id == "辅助检查") {
                 $('#searchInp').val("肝彩超")
-                getTree(0,6,"肝彩超");
-                getGraph("肝彩超",select_type);
+                getTree(0, 6, "肝彩超");
+                getGraph("肝彩超", select_type);
             }
-           
+
             // getTree(1,1,"");  //切换tab重新画菜单树
         }
-       
+
         hideHideTab()
     })
 }
 
-function setTabBottomHei(type){
+function setTabBottomHei(type) {
     const clientHei = $(window).height()
     const contentHei = 700
-    if(type==1){
+    if (type == 1) {
         $(".tabBottom").css({
             'margin': '0px 0px 0px 0px'
         })
-        $(".tabBottom").css("height",contentHei-220-43-10+19+'px')
-        $(".ztree").css("height",contentHei-220-43-60-20-24+19+'px')
+        $(".tabBottom").css("height", contentHei - 220 - 43 - 10 + 19 + 'px')
+        $(".ztree").css("height", contentHei - 220 - 43 - 60 - 20 - 24 + 19 + 'px')
 
-    }else if(type == 2){
-        $(".tabBottom").css("height",contentHei-220-43-10-20+19+'px')
+    } else if (type == 2) {
+        $(".tabBottom").css("height", contentHei - 220 - 43 - 10 - 20 + 19 + 'px')
         $(".tabBottom").css({
             'margin': '20px 0px 0px 0px'
         })
-        $(".ztree").css("height",contentHei-220-43-20-20-20+19+'px')
+        $(".ztree").css("height", contentHei - 220 - 43 - 20 - 20 - 20 + 19 + 'px')
     }
- }
+}
 
- function setSelectName(name){
-    if(name=="药品通用名"){
+function setSelectName(name) {
+    if (name == "药品通用名") {
         $('.selectedName').html("药品")
-        $('.selectedName').attr("title","药品")
-        $("#searchInp").attr("placeholder",`请输入药品名称`)
-    }else{
+        $('.selectedName').attr("title", "药品")
+        $("#searchInp").attr("placeholder", `请输入药品名称`)
+    } else {
         $('.selectedName').attr('title', name)
-        $("#searchInp").attr("placeholder",`请输入${name}名称`)
-        if(name.length > 4){
-            $('.selectedName').html(name.slice(0,4)+'...')
-        }else{
+        $("#searchInp").attr("placeholder", `请输入${name}名称`)
+        if (name.length > 4) {
+            $('.selectedName').html(name.slice(0, 4) + '...')
+        } else {
             $('.selectedName').html(name)
         }
-       
+
     }
- }
- function hideSlide(expectClass){
-    let hideSlideList = ['selectList', 'tabNameList','tabNameListNoSearch','hideTabList']
+}
+function hideSlide(expectClass) {
+    let hideSlideList = ['selectList', 'tabNameList', 'tabNameListNoSearch', 'hideTabList']
     let index = hideSlideList.findIndex(item => item == expectClass)
-    for(let i = 0; i < hideSlideList.length; i++){
-        if(i != index){
-            if(hideSlideList[i] == "selectList"){
-                $('.'+hideSlideList[i]).hide()
-                $('.iconSlide').attr('src','./images/iconSlideDown.png')
-            }else if(hideSlideList[i] == "hideTabList"){
+    for (let i = 0; i < hideSlideList.length; i++) {
+        if (i != index) {
+            if (hideSlideList[i] == "selectList") {
+                $('.' + hideSlideList[i]).hide()
+                $('.iconSlide').attr('src', './images/iconSlideDown.png')
+            } else if (hideSlideList[i] == "hideTabList") {
                 hideHideTab()
-            }else{
-                $('.'+hideSlideList[i]).hide()
+            } else {
+                $('.' + hideSlideList[i]).hide()
             }
         }
     }
- }
+}
 
 
-module.exports ={
+module.exports = {
     drawGraph,
     updateTree,
     getGraph,

+ 90 - 88
src/js/index.js

@@ -21,153 +21,155 @@ 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 } = require('./api.js');
-const { mapData, zTreeData,mapData3,zTreeData3 } = require('./data.js');
-const { drawGraph,updateTree,getGraph,getTree,getNode,getTab,renderTab,setTabBottomHei,setSelectName,hideHideTab,hideSlide} = require('./graphMap.js');
+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, setSelectName, hideHideTab, hideSlide } = require('./graphMap.js');
 
-window.select_type="疾病";
-window.select_type_noSearch="疾病";
+window.select_type = "疾病";
+window.select_type_noSearch = "疾病";
 window.refreshTree = true
+let disease = getUrlArgObject("disease")
+// console.log("disease@@", disease);
 
- setHei()
+setHei()
 ifHideLogo();
- function setHei(){
+function setHei() {
     const clientHei = $(window).height()
-    const contentHei =580
-    $(".left").css("height",contentHei+'px')
-    $(".right").css("height",contentHei+'px')
-    if(select_type=="疾病"){
+    const contentHei = 580
+    $(".left").css("height", contentHei + 'px')
+    $(".right").css("height", contentHei + 'px')
+    if (select_type == "疾病") {
         setTabBottomHei(1)
-    }else{
+    } else {
         setTabBottomHei(2)
     }
-    $("#main").css("height",contentHei-20-20-10+'px')
- }
- $(window).resize(function(){
+    $("#main").css("height", contentHei - 20 - 20 - 10 + 'px')
+}
+$(window).resize(function () {
     setHei()
     // getGraph(graphTxt,select_type);
- })
+})
 
 //关系图
-getGraph("急性胰腺炎",select_type);
-getTree(1,1,"急性胰腺炎");
-$('#searchInp').val("急性胰腺炎")
+getGraph(disease || "急性胰腺炎", select_type);
+getTree(1, 1, disease || "急性胰腺炎");
+$('#searchInp').val(disease || "急性胰腺炎")
 
 //选择类型
-$('.select').click(function(e){
+$('.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')
+    if (selectListShow == 'none') {
+        $('.iconSlide').attr('src', './images/iconSlideUp.png')
+    } else {
+        $('.iconSlide').attr('src', './images/iconSlideDown.png')
     }
     $('.selectList').fadeToggle()
-   
+
 })
-$('.selectList .selectItem').click(function(){
+$('.selectList .selectItem').click(function () {
     select_type_noSearch = $(this).attr('data-id')
-    const txt =  $(this).text()
+    const txt = $(this).text()
     const oldTxt = $(".selectedName").html()
     setSelectName(txt)
-   
-    $("#searchInp").attr("placeholder",`请输入${txt}名称`)
-    if(txt != oldTxt){
+
+    $("#searchInp").attr("placeholder", `请输入${txt}名称`)
+    if (txt != oldTxt) {
         $('#searchInp').val("")
     }
-    
+
 })
 
 //搜索节点名
-$("#searchInp").bind("input propertychange",function(event){
+$("#searchInp").bind("input propertychange", function (event) {
     const val = $("#searchInp").val().trim()
-    if(val){
-        getNode(val,select_type_noSearch)
-    }else{
+    if (val) {
+        getNode(val, select_type_noSearch)
+    } else {
         $(".tabNameList").hide()
     }
 });
 
 //切换条目
-$('.radioItem').click(function(e){
-    const initDiag = "急性胰腺炎"
+$('.radioItem').click(function (e) {
+    const initDiag = disease || "急性胰腺炎"
     const type = $(this).attr('data-type')
     // $(this).children('img').attr('src')
-    $('.iconRadio').attr('src','/images/radioUnSelect.png')
-    $(this).children('img').attr('src','/images/radioSelect.png')
-     $('#searchInp').val(initDiag)
-    getTree(type,1,initDiag);
-    getGraph(initDiag,select_type);
+    $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+    $(this).children('img').attr('src', '/images/radioSelect.png')
+    $('#searchInp').val(initDiag)
+    getTree(type, 1, initDiag);
+    getGraph(initDiag, select_type);
     // updateTree(initDiag)
 })
 
 //搜索
-$('#searchBtn').click(function(e){
+$('#searchBtn').click(function (e) {
     e.stopPropagation()
     hideSlide()
     const val = $('#searchInp').val().trim()
-    if(val){
+    if (val) {
         const clientHei = $(window).height()
         const contentHei = clientHei - 80
         $(".tabNameList").hide()
-        getGraph(val,select_type_noSearch).then(()=>{
-            if(!window.refreshTree){
-              
+        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()
-                    setTabBottomHei(1)
-                }else{
-                    $(".radioList").hide()
-                    setTabBottomHei(2)
-                }
-                let renderTabInfo = getTab(select_type) 
-                renderTab(renderTabInfo)
-            
+            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()
+                setTabBottomHei(1)
+            } else {
+                $(".radioList").hide()
+                setTabBottomHei(2)
+            }
+            let renderTabInfo = getTab(select_type)
+            renderTab(renderTabInfo)
+
         })
-        
-   
-       
-    }else{
-       $('.tabNameListNoSearch').show()
+
+
+
+    } else {
+        $('.tabNameListNoSearch').show()
     }
 })
 
 
 
-let renderTabInfo = getTab("疾病") 
+let renderTabInfo = getTab("疾病")
 renderTab(renderTabInfo)
 
-$(".tabList").click(function(e){
+$(".tabList").click(function (e) {
     e.stopPropagation()
     hideSlide()
 })
-$(".hideTabList").click(function(e){
+$(".hideTabList").click(function (e) {
     e.stopPropagation()
     hideSlide()
 })
 //点击页面其他地方关闭下拉
-$('html').click(function(){
+$('html').click(function () {
     hideSlide()
     // const selectListShow = $('.selectList').css('display')
     // const tabNameListShow = $('.tabNameList').css('display')
@@ -189,10 +191,10 @@ $('html').click(function(){
 })
 
 
-module.exports ={
+module.exports = {
     getTab,
     renderTab
 }
-		
-		
-	
+
+
+

+ 103 - 101
webpack.config.js

@@ -6,15 +6,17 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const CopyWebpackPlugin = require('copy-webpack-plugin');
 const ExtractTextPlugin = require("extract-text-webpack-plugin");
 const webpack = require('webpack');
-const proxyHost = "http://192.168.2.121:5050";
+// const proxyHost = "http://173.18.12.195:5050";
+const proxyHost = "http://173.18.12.191:1388";
 // const proxyHost = "http://192.168.3.113:5050";
+// const proxyHost = "http://173.18.12.192:5050";
 module.exports = {
   entry: {
     index: path.resolve(__dirname, 'src/js', 'index.js'),
     knowledgeTree: path.resolve(__dirname, 'src/js', 'knowledgeTree.js'),
-    participle: path.resolve(__dirname,'src/js', 'participle.js'),
-    qaPage:path.resolve(__dirname,'src/js', 'qaPage.js'),
-    medicalTermMap:path.resolve(__dirname,'src/js', 'medicalTermMap.js'),
+    participle: path.resolve(__dirname, 'src/js', 'participle.js'),
+    qaPage: path.resolve(__dirname, 'src/js', 'qaPage.js'),
+    medicalTermMap: path.resolve(__dirname, 'src/js', 'medicalTermMap.js'),
     vendor: 'lodash'// 多个页面所需的公共库文件,防止重复打包带入
   },
   output: {
@@ -41,76 +43,76 @@ module.exports = {
       }
     }),
     new HtmlWebpackPlugin({
-        title: '描述框架',
-        template: path.resolve(__dirname, 'src/html', 'knowledgeTree.html'),
-        filename: 'knowledgeTree.html',
-        chunks: ['knowledgeTree', 'vendor', 'common'],
-        inject: true,
-        hash: true, //防止缓存
-        minify: {
-          removeAttributeQuotes: true, //压缩 去掉引号
-          removeComments: true, //移除HTML中的注释
-          collapseWhitespace: true //删除空白符与换行符
-        }
-      }),
-      new HtmlWebpackPlugin({
-        title: '电子病历信息抽取',
-        template: path.resolve(__dirname, 'src/html', 'participle.html'),
-        filename: 'participle.html',
-        chunks: ['participle', 'vendor', 'common'],
-        inject: true,
-        hash: true, //防止缓存
-        minify: {
-          removeAttributeQuotes: true, //压缩 去掉引号
-          removeComments: true, //移除HTML中的注释
-          collapseWhitespace: true //删除空白符与换行符
-        }
-      }),
-      new HtmlWebpackPlugin({
-        title: '智能问答',
-        template: path.resolve(__dirname, 'src/html', 'qaPage.html'),
-        filename: 'qaPage.html',
-        chunks: ['qaPage', 'vendor', 'common'],
-        inject: true,
-        hash: true, //防止缓存
-        minify: {
-          removeAttributeQuotes: true, //压缩 去掉引号
-          removeComments: true, //移除HTML中的注释
-          collapseWhitespace: true //删除空白符与换行符
-        }
-      }),
-      new HtmlWebpackPlugin({
-        title: '医学术语映射',
-        template: path.resolve(__dirname, 'src/html', 'medicalTermMap.html'),
-        filename: 'medicalTermMap.html',
-        chunks: ['medicalTermMap', 'vendor', 'common'],
-        inject: true,
-        hash: true, //防止缓存
-        minify: {
-          removeAttributeQuotes: true, //压缩 去掉引号
-          removeComments: true, //移除HTML中的注释
-          collapseWhitespace: true //删除空白符与换行符
-        }
-      }),
-      new CopyWebpackPlugin([
-        {
-          from:'src/resources',
-          to:path.resolve(__dirname,'dist','resources'),
-          flatten:true,   //false会拷贝原始文件夹路径
-        }
-      ]),
-      new MiniCssExtractPlugin({
-        filename: 'css/[name].css',
-        chunkFilename: '[id].css'
-      }),
-      new webpack.ProvidePlugin({
-          $: 'jquery',
-          jQuery: 'jquery',
-          'window.jQuery': 'jquery'
-      }),
-      new webpack.HotModuleReplacementPlugin(),
-      new CleanWebpackPlugin(),
-      new ExtractTextPlugin("stylesheets/[name].css"),
+      title: '描述框架',
+      template: path.resolve(__dirname, 'src/html', 'knowledgeTree.html'),
+      filename: 'knowledgeTree.html',
+      chunks: ['knowledgeTree', 'vendor', 'common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
+    new HtmlWebpackPlugin({
+      title: '电子病历信息抽取',
+      template: path.resolve(__dirname, 'src/html', 'participle.html'),
+      filename: 'participle.html',
+      chunks: ['participle', 'vendor', 'common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
+    new HtmlWebpackPlugin({
+      title: '智能问答',
+      template: path.resolve(__dirname, 'src/html', 'qaPage.html'),
+      filename: 'qaPage.html',
+      chunks: ['qaPage', 'vendor', 'common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
+    new HtmlWebpackPlugin({
+      title: '医学术语映射',
+      template: path.resolve(__dirname, 'src/html', 'medicalTermMap.html'),
+      filename: 'medicalTermMap.html',
+      chunks: ['medicalTermMap', 'vendor', 'common'],
+      inject: true,
+      hash: true, //防止缓存
+      minify: {
+        removeAttributeQuotes: true, //压缩 去掉引号
+        removeComments: true, //移除HTML中的注释
+        collapseWhitespace: true //删除空白符与换行符
+      }
+    }),
+    new CopyWebpackPlugin([
+      {
+        from: 'src/resources',
+        to: path.resolve(__dirname, 'dist', 'resources'),
+        flatten: true,   //false会拷贝原始文件夹路径
+      }
+    ]),
+    new MiniCssExtractPlugin({
+      filename: 'css/[name].css',
+      chunkFilename: '[id].css'
+    }),
+    new webpack.ProvidePlugin({
+      $: 'jquery',
+      jQuery: 'jquery',
+      'window.jQuery': 'jquery'
+    }),
+    new webpack.HotModuleReplacementPlugin(),
+    new CleanWebpackPlugin(),
+    new ExtractTextPlugin("stylesheets/[name].css"),
   ],
   optimization: { //webpack4.x的最新优化配置项,用于提取公共代码
     minimizer: [
@@ -126,7 +128,7 @@ module.exports = {
             except: ['e']
           },
           output: {
-              beautify: true
+            beautify: true
           },
           sourceMap: false
         }
@@ -145,13 +147,13 @@ module.exports = {
       }
     }
   },
-      
+
   module: {
     rules: [
       {
-          test: /.js$/,
-          enforce: 'post', 
-          loader: 'es3ify-loader'
+        // test: /.js$/,
+        // enforce: 'post',
+        // loader: 'es3ify-loader'
       },
       {
         test: /\.m?js$/,
@@ -159,19 +161,19 @@ module.exports = {
         use: {
           loader: 'babel-loader',
           options: {
-            presets:['@babel/preset-env']
+            presets: ['@babel/preset-env']
           }
         }
       },
       {
         test: /\.css$/,
-        use:ExtractTextPlugin.extract({
+        use: ExtractTextPlugin.extract({
           use: [
-          // {
-          //   loader: MiniCssExtractPlugin.loader
-          // },
-          'css-loader'
-        ]
+            // {
+            //   loader: MiniCssExtractPlugin.loader
+            // },
+            'css-loader'
+          ]
         })
       },
       {
@@ -179,20 +181,20 @@ module.exports = {
         use: ExtractTextPlugin.extract({
           fallback: 'style-loader',
           use: [
-              // {
-              //   loader: 'style-loader', // creates style nodes from JS strings
-              // },
-              {
-                loader: 'css-loader', // translates CSS into CommonJS
-              },
-              {
-                loader: 'less-loader', // compiles Less to CSS
-              },
-            ],
-          })
-        
+            // {
+            //   loader: 'style-loader', // creates style nodes from JS strings
+            // },
+            {
+              loader: 'css-loader', // translates CSS into CommonJS
+            },
+            {
+              loader: 'less-loader', // compiles Less to CSS
+            },
+          ],
+        })
+
       },
-      { 
+      {
         test: /\.(png|jpg|jpeg|gif|svg)$/,
         use: {
           loader: 'file-loader',
@@ -213,7 +215,7 @@ module.exports = {
       '/api': proxyHost
     },
     hot: true,
-    openPage:'knowledgeGraph.html'
-    
+    openPage: 'knowledgeGraph.html'
+
   }
 }