Browse Source

修复部分bug

yangdr 4 months ago
parent
commit
77a47315a5

+ 10 - 1
src/css/home.less

@@ -321,7 +321,7 @@
               padding-bottom: 0px;
               padding-top: 0px;
               height: 30px;
-              width: 133px;
+              width: 200px;
               margin-left: 36px;
             }
           }
@@ -739,6 +739,15 @@
   }
 }
 
+// 调整el-autocomplete建议框的宽度,不隐藏文字
+.el-popper[x-placement^=bottom] {
+  width: auto !important;
+  min-width: 150px;
+  text-align: left;
+  
+}
+
+
 .icon {
   height: 18px;
   width: 18px;

+ 88 - 1
src/css/knowledgeMap.less

@@ -57,6 +57,7 @@
             .contextmenu-item {
                 margin-bottom: 10px;
                 color: #6D6D6D;
+                cursor: default;
 
                 &:last-child {
                     margin-bottom: 0px;
@@ -76,6 +77,7 @@
         // margin-left: -600px;
         cursor: default;
         height: 100%;
+
         white-space: nowrap;
         border: 1px #6794A8 dotted;
         box-sizing: border-box;
@@ -91,6 +93,7 @@
         width: calc(100% - 461px);
         box-sizing: border-box;
         overflow: hidden;
+        z-index: 5;
 
         #main {
             // width: 796px;
@@ -115,6 +118,7 @@
         border-left: 1px dotted #000;
         box-sizing: border-box;
         overflow: hidden;
+        // z-index: 10000;
 
         .top {
             // position: relative;
@@ -183,7 +187,7 @@
                     background: #fff;
                     color: #fff;
                     border: 1px solid #5BBBFF;
-                    z-index: 3;
+                    z-index: 2;
                 }
 
                 .selectItem {
@@ -431,6 +435,11 @@
                 font-family: Microsoft YaHei;
                 font-weight: 400;
                 font-size: 20px;
+                display: none;
+
+                &:is(.disease) {
+                    display: inline-block;
+                }
 
                 &:first-child {
                     color: #409EF1;
@@ -465,6 +474,63 @@
         /*background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);*/
     }
 
+    .category-num {
+        position: absolute;
+        width: 34px;
+        height: 24px;
+        bottom: 0px;
+        right: 54px;
+        color: #dd7172;
+        vertical-align: bottom;
+    }
+
+    .record {
+        position: absolute;
+        top: 10px;
+        left: 10px;
+        padding: 5px;
+        width: 100px;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        border: 1px solid #E7E7E7;
+        // box-sizing: border-box;
+        border-radius: 2px;
+
+        .selectedData {
+            position: relative;
+            z-index: 10;
+            overflow: visible;
+        }
+
+        /* 让子元素能够超出父元素的边界 */
+        .selectList-record {
+            position: absolute;
+            top: 34px;
+            left: 0px;
+            min-width: 100%;
+            max-width: 300px;
+            border: 1px solid skyblue;
+            padding: 0 5px;
+            display: none;
+            background-color: #fff;
+            box-sizing: border-box;
+
+            /* 强制元素创建新的堆叠上下文 */
+            &>.selectItem-record {
+                padding: 5px 0px;
+                text-overflow: ellipsis;
+                cursor: pointer;
+
+                &:hover {
+                    color: #0071E7;
+                }
+            }
+        }
+
+    }
+
+
     .legendIconImg {
         width: 34px;
         height: 24px;
@@ -475,6 +541,7 @@
         cursor: pointer;
     }
 
+
     .legendIconImg {
         background: url('./img/direct4@2x-2.png') no-repeat;
         background-size: 34px 24px;
@@ -528,6 +595,9 @@
 
     }
 
+
+
+
     .right-aside-collapsed {
         position: absolute;
         display: inline-block;
@@ -549,4 +619,21 @@
         background-size: cover;
         vertical-align: baseline;
     }
+
+    .icon {
+        height: 18px;
+        width: 18px;
+        display: inline-block;
+        background-size: cover;
+        vertical-align: middle;
+        background-repeat: no-repeat;
+        cursor: pointer;
+    }
+
+    .icon-triangle-down {
+        .icon();
+        background-image: url("./img/rect46@2x.png");
+        width: 18px;
+        height: 12px;
+    }
 }

+ 70 - 7
src/css/knowledgeUpdate.less

@@ -16,8 +16,8 @@
   .contextmenu-node {
     position: fixed;
     display: none;
-    width: 176px;
-    padding: 20px 21px;
+    width: auto;
+    padding: 10px 20px;
     border: 1px solid #E7E7E7;
     z-index: 100;
     background-color: white;
@@ -30,6 +30,7 @@
       .contextmenu-item {
         margin-bottom: 10px;
         color: #6D6D6D;
+        cursor: default;
 
         &:last-child {
           margin-bottom: 0px;
@@ -212,6 +213,8 @@
       cursor: pointer;
       background-color: #FFFFFF;
       position: relative;
+      white-space: nowrap;
+      box-sizing: border-box;
       -webkit-font-smoothing: antialiased;
       /* 开启字体平滑 */
       -moz-osx-font-smoothing: grayscale;
@@ -225,10 +228,20 @@
       height: 24px;
       bottom: 0px;
       right: 379px;
+      // left: 0;
       // border-top: 1px dotted black;
       /*background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%);*/
     }
 
+    .category-num {
+      position: absolute;
+      width: 34px;
+      height: 24px;
+      bottom: 0px;
+      right: 413px;
+      color: #dd7172;
+    }
+
     .legendIconImg {
       width: 34px;
       height: 24px;
@@ -239,6 +252,51 @@
       cursor: pointer;
     }
 
+    .record {
+      position: absolute;
+      top: 10px;
+      left: 10px;
+      padding: 5px;
+      width: 100px;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      border: 1px solid #E7E7E7;
+      // box-sizing: border-box;
+      border-radius: 2px;
+
+      .selectedData {
+        position: relative;
+        z-index: 10;
+        overflow: visible;
+      }
+
+      /* 让子元素能够超出父元素的边界 */
+      .selectList-record {
+        position: absolute;
+        top: 34px;
+        left: 0px;
+        min-width: 100%;
+        max-width: 300px;
+        border: 1px solid skyblue;
+        padding: 0 5px;
+        display: none;
+        background-color: #fff;
+        box-sizing: border-box;
+
+        /* 强制元素创建新的堆叠上下文 */
+        &>.selectItem-record {
+          padding: 5px 0px;
+          text-overflow: ellipsis;
+          cursor: pointer;
+          &:hover {
+            color: #0071E7;
+          }
+        }
+      }
+
+    }
+
     .legendIconImg {
       background: url('./img/direct4@2x-2.png') no-repeat;
       background-size: 34px 24px;
@@ -268,7 +326,7 @@
     // float: right;
     height: 100% !important;
     // position: absolute;
-    right: 0px;
+    // right: 0px;
     border-left: 1px dotted #000;
     box-sizing: border-box;
     overflow: auto;
@@ -282,7 +340,7 @@
 
       .box-title {
         background-color: rgb(213, 233, 254);
-        width: 370.8px;
+        // width: 100%;
         height: 42px;
         color: #333333;
         font-family: Bold;
@@ -296,8 +354,9 @@
         padding: 14px 8px;
         font-size: 16px;
         min-height: 100px;
-        max-height: 300px;
-        overflow: auto;
+        max-height: 200px;
+        overflow-y: auto;
+        overflow-x: hidden;
         box-sizing: border-box;
 
         .text {
@@ -305,10 +364,14 @@
           display: flex;
           flex-wrap: nowrap;
 
+          &:last-child {
+            padding-bottom: 0px;
+          }
+
           .text-key {}
 
           .text-value {
-            white-space: pre-wrap;
+            white-space: normal;
           }
 
         }

+ 73 - 17
src/html/home.html

@@ -20,19 +20,38 @@
   <!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> -->
   <!-- 引入echarts -->
   <script src="./js/echarts.min.js"></script>
+  <script src="https://udify.app/embed.min.js" id="H0Nrc4d1ldWJpJaJ" defer>
+  </script>
   <style>
     /*vue未加载好使隐藏页面*/
     [v-cloak] {
       display: none;
     }
+
+    #dify-chatbot-bubble-button {
+      background-color: #1C64F2 !important;
+    }
+
+    #dify-chatbot-bubble-window {
+      width: 24rem !important;
+      height: 40rem !important;
+    }
   </style>
+
+  <script>
+    window.difyChatbotConfig = {
+      token: 'H0Nrc4d1ldWJpJaJ'
+    }
+  </script>
+
+
 </head>
 
 <body>
   <div id="app" v-cloak>
     <el-container>
       <el-header>
-        <div class="logo">知识图谱系统</div>
+        <div class="logo" contenteditable="false">知识图谱系统</div>
         <div class="time">{{nowDate}}</div>
         <div class="user-area">
           <span class="icon-avatar"></span>
@@ -79,7 +98,7 @@
       </el-container>
     </el-container>
     <!-- 对话框 -->
-    <el-dialog :title="dialogData.title" :visible.sync="dialogVisible"
+    <el-dialog :title="dialogData.title" :visible.sync="dialogVisible" ref="dialogRef"
       :width="dialogData.width?dialogData.width:'686px'" height="491px" :center="false" :close-on-click-modal="false">
       <template #default>
         <div v-if="dialogData.opType=='addEntity'" class="addEntity">
@@ -195,7 +214,8 @@
                 <template slot-scope="scope">
                   <el-autocomplete v-model.trim="scope.row.startName"
                     :fetch-suggestions="(queryString,cb)=>{querySearchAsync(queryString,cb,scope.row.startLabel)}"
-                    @select="handleSelect($event, scope.row,'start')" placeholder="请选择起始实体"></el-autocomplete>
+                    @select="handleSelect($event, scope.row,'start')" placeholder="请选择起始实体"
+                    :popper-append-to-body="false"></el-autocomplete>
                 </template>
               </el-table-column>
               <el-table-column label="目标实体类型">
@@ -574,7 +594,7 @@
           { "label": "疾病", "value": "疾病" },
           { "label": "药品", "value": "药品" },
           { "label": "症状", "value": "症状" },
-          { "label": "手术和操作", "value": "手术和操作" },
+          // { "label": "手术和操作", "value": "手术和操作" },
           { "label": "实验室检查", "value": "实验室检查" },
           { "label": "辅助检查", "value": "辅助检查" },
         ],
@@ -814,6 +834,7 @@
               event.data.data.entityNode.forEach((el, index) => {
                 el.name = index
                 el.symbolSize = 80
+                el.symbol = 'circle'
                 el.itemStyle = {}
                 this.entityLink.nodes.push(el)
               })
@@ -909,8 +930,10 @@
               const { data, msg, code } = res.data
               if (code == '0') {
                 this.modifyRelationship = { ...this.$options.data().modifyRelationship }
-                tableData.splice(index, 1)
+                //this.tableData.splice(index, 1)
+
                 this.sendChildWindowMessage("update-graph", "")
+                this.dialogVisible = false
               }
             }).catch(err => {
               console.log("updateRelationshipType接口出错", err)
@@ -1057,19 +1080,29 @@
         })
       },
       updateEntityName(data, index) {
-        axios.post("/api" + api.updateEntityName, data).then(res => {
-          const { data, msg, code } = res.data
-          if (code == '0') {
-            if (index >= 0) {
-              this.nodeTable.splice(index, 1)
-            } else {
-              this.nodeTable = []
+        this.$confirm("确定修改实体名称吗?", "修改实体名称提示", {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          axios.post("/api" + api.updateEntityName, data).then(res => {
+            const { data, msg, code } = res.data
+            if (code == '0') {
+              if (index >= 0) {
+                this.nodeTable.splice(index, 1)
+              } else {
+                //this.nodeTable = []
+                this.nodeTable.splice(0, this.nodeTable.length)
+              }
               this.sendChildWindowMessage("update-graph", "")
             }
-          }
+          }).catch(err => {
+            console.log("updateEntityName接口出错", err)
+          })
         }).catch(err => {
-          console.log("updateEntityName接口出错", err)
+
         })
+
       },
       deleteEntityFunc(data, index) {
         this.$confirm('确定删除该实体吗?', '删除实体提示', {
@@ -1083,8 +1116,9 @@
               if (index >= 0) {
                 this.nodeTable.splice(index, 1)
               } else {
-                this.nodeTable = []
+                this.nodeTable.splice(0, this.nodeTable.length)
               }
+              this.sendChildWindowMessage("update-graph", "")
             }
           }).catch(err => {
             console.log("deleteEntity接口出错", err)
@@ -1098,7 +1132,7 @@
         this.addRelationshipDropdown.push(this.$options.data().addRelationshipDropdown[0])
       },
       querySearchAsync(queryString, cb, label) {
-        console.log("label", label)
+        //console.log("label", label)
         axios.post("/api" + api.getNode, {
           "inputStr": queryString,
           "labelName": label || "疾病"
@@ -1198,6 +1232,7 @@
             const { data, msg, code } = res.data
             if (code == '0') {
               tableData.splice(index, 1)
+              this.sendChildWindowMessage("update-graph", "")
             }
           }).catch(err => {
             console.log("updateRelationshipType接口出错", err)
@@ -1222,6 +1257,7 @@
             const { data, msg, code } = res.data
             if (code == '0') {
               tableData.splice(index, 1)
+              this.sendChildWindowMessage("update-graph", "")
             }
           }).catch(err => {
             console.log("updateEntityProperty接口出错")
@@ -1238,6 +1274,10 @@
         myChart = echarts.init(document.getElementById("entityLink"));
         const options = {
           color: ['#dd7172', '#E57373', '#0EB1EE', '#9D96F5', '#ACC68E', '#EDAA77', '#14BBB3', '#538FFF', '#1390FB', '#C7B02E',],
+          grid: {
+            containLabel: true,  // 保证标签和内容在图表区域内
+            //top: 1000
+          },
           tooltip: {
             formatter: function (x) {
               return x.data.label;
@@ -1253,6 +1293,8 @@
               edgeLength: [50, 150],
               layoutAnimation: true
             },
+            //center: ['50%', '50%'],
+            //radius: ['30%', '50%'],
             edgeSymbol: ['none', 'arrow'],
             edgeSymbolSize: 10,
             data: this.entityLink.nodes,
@@ -1321,7 +1363,7 @@
                   },
                   style: {
                     stroke: '#FF0000',  // 线条颜色
-                    lineWidth: 1        // 线条宽度
+                    lineWidth: 2        // 线条宽度
                   }
                 }
               ]
@@ -1342,6 +1384,20 @@
             ]
           }, false)
         })
+        myChart.getDom().addEventListener('mouseleave', (event) => {
+          //console.log("mouseup-event", event)
+          startNode = null
+          const option = myChart.getOption()
+          myChart.setOption({
+            graphic: [
+              {
+                style: {
+                  lineWidth: 0        // 线条宽度
+                }
+              }
+            ]
+          }, false)
+        })
         myChart.on('dblclick', (event) => {
           //console.log("dblclick", event)
           if (event && event.dataType === 'edge') {

+ 52 - 17
src/html/homeMini.html

@@ -72,14 +72,14 @@
             <div class="padding"></div>
           </div>
           <div class="content">
-            <iframe ref="iframe" v-show="currentPage.url" src="knowledgeUpdate.html" frameborder="0"></iframe>
+            <iframe ref="iframe" v-show="currentPage.url" src="./knowledgeUpdate.html" frameborder="0"></iframe>
             <el-empty v-show="!currentPage.url" description="这里什么都没有"></el-empty>
           </div>
         </el-main>
       </el-container>
     </el-container>
     <!-- 对话框 -->
-    <el-dialog :title="dialogData.title" :visible.sync="dialogVisible"
+    <el-dialog :title="dialogData.title" :visible.sync="dialogVisible" ref="dialogRef"
       :width="dialogData.width?dialogData.width:'686px'" height="491px" :center="false" :close-on-click-modal="false">
       <template #default>
         <div v-if="dialogData.opType=='addEntity'" class="addEntity">
@@ -195,7 +195,8 @@
                 <template slot-scope="scope">
                   <el-autocomplete v-model.trim="scope.row.startName"
                     :fetch-suggestions="(queryString,cb)=>{querySearchAsync(queryString,cb,scope.row.startLabel)}"
-                    @select="handleSelect($event, scope.row,'start')" placeholder="请选择起始实体"></el-autocomplete>
+                    @select="handleSelect($event, scope.row,'start')" placeholder="请选择起始实体"
+                    :popper-append-to-body="false"></el-autocomplete>
                 </template>
               </el-table-column>
               <el-table-column label="目标实体类型">
@@ -574,7 +575,7 @@
           { "label": "疾病", "value": "疾病" },
           { "label": "药品", "value": "药品" },
           { "label": "症状", "value": "症状" },
-          { "label": "手术和操作", "value": "手术和操作" },
+          // { "label": "手术和操作", "value": "手术和操作" },
           { "label": "实验室检查", "value": "实验室检查" },
           { "label": "辅助检查", "value": "辅助检查" },
         ],
@@ -814,6 +815,7 @@
               event.data.data.entityNode.forEach((el, index) => {
                 el.name = index
                 el.symbolSize = 80
+                el.symbol = 'circle'
                 el.itemStyle = {}
                 this.entityLink.nodes.push(el)
               })
@@ -909,7 +911,7 @@
               const { data, msg, code } = res.data
               if (code == '0') {
                 this.modifyRelationship = { ...this.$options.data().modifyRelationship }
-                tableData.splice(index, 1)
+                this.dialogVisible = false
                 this.sendChildWindowMessage("update-graph", "")
               }
             }).catch(err => {
@@ -1057,19 +1059,29 @@
         })
       },
       updateEntityName(data, index) {
-        axios.post("/api" + api.updateEntityName, data).then(res => {
-          const { data, msg, code } = res.data
-          if (code == '0') {
-            if (index >= 0) {
-              this.nodeTable.splice(index, 1)
-            } else {
-              this.nodeTable = []
+        this.$confirm("确定修改实体名称吗?", "修改实体名称提示", {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          axios.post("/api" + api.updateEntityName, data).then(res => {
+            const { data, msg, code } = res.data
+            if (code == '0') {
+              if (index >= 0) {
+                this.nodeTable.splice(index, 1)
+              } else {
+                //this.nodeTable = []
+                this.nodeTable.splice(0, this.nodeTable.length)
+              }
               this.sendChildWindowMessage("update-graph", "")
             }
-          }
+          }).catch(err => {
+            console.log("updateEntityName接口出错", err)
+          })
         }).catch(err => {
-          console.log("updateEntityName接口出错", err)
+
         })
+
       },
       deleteEntityFunc(data, index) {
         this.$confirm('确定删除该实体吗?', '删除实体提示', {
@@ -1083,8 +1095,9 @@
               if (index >= 0) {
                 this.nodeTable.splice(index, 1)
               } else {
-                this.nodeTable = []
+                this.nodeTable.splice(0, this.nodeTable.length)
               }
+              this.sendChildWindowMessage("update-graph", "")
             }
           }).catch(err => {
             console.log("deleteEntity接口出错", err)
@@ -1098,7 +1111,7 @@
         this.addRelationshipDropdown.push(this.$options.data().addRelationshipDropdown[0])
       },
       querySearchAsync(queryString, cb, label) {
-        console.log("label", label)
+        //console.log("label", label)
         axios.post("/api" + api.getNode, {
           "inputStr": queryString,
           "labelName": label || "疾病"
@@ -1198,6 +1211,7 @@
             const { data, msg, code } = res.data
             if (code == '0') {
               tableData.splice(index, 1)
+              this.sendChildWindowMessage("update-graph", "")
             }
           }).catch(err => {
             console.log("updateRelationshipType接口出错", err)
@@ -1222,6 +1236,7 @@
             const { data, msg, code } = res.data
             if (code == '0') {
               tableData.splice(index, 1)
+              this.sendChildWindowMessage("update-graph", "")
             }
           }).catch(err => {
             console.log("updateEntityProperty接口出错")
@@ -1238,6 +1253,10 @@
         myChart = echarts.init(document.getElementById("entityLink"));
         const options = {
           color: ['#dd7172', '#E57373', '#0EB1EE', '#9D96F5', '#ACC68E', '#EDAA77', '#14BBB3', '#538FFF', '#1390FB', '#C7B02E',],
+          grid: {
+            containLabel: true,  // 保证标签和内容在图表区域内
+            //top: 1000
+          },
           tooltip: {
             formatter: function (x) {
               return x.data.label;
@@ -1253,6 +1272,8 @@
               edgeLength: [50, 150],
               layoutAnimation: true
             },
+            //center: ['50%', '50%'],
+            //radius: ['30%', '50%'],
             edgeSymbol: ['none', 'arrow'],
             edgeSymbolSize: 10,
             data: this.entityLink.nodes,
@@ -1321,7 +1342,7 @@
                   },
                   style: {
                     stroke: '#FF0000',  // 线条颜色
-                    lineWidth: 1        // 线条宽度
+                    lineWidth: 2        // 线条宽度
                   }
                 }
               ]
@@ -1342,6 +1363,20 @@
             ]
           }, false)
         })
+        myChart.getDom().addEventListener('mouseleave', (event) => {
+          //console.log("mouseup-event", event)
+          startNode = null
+          const option = myChart.getOption()
+          myChart.setOption({
+            graphic: [
+              {
+                style: {
+                  lineWidth: 0        // 线条宽度
+                }
+              }
+            ]
+          }, false)
+        })
         myChart.on('dblclick', (event) => {
           //console.log("dblclick", event)
           if (event && event.dataType === 'edge') {

+ 19 - 3
src/html/knowledgeGraph.html

@@ -41,6 +41,13 @@
 				<div id="dragMe" class="legendIcon">
 					<div class="legendIconImg"></div>
 				</div>
+				<div class="category-num"></div>
+				<div select="on" class="dropdown record"><span class="selectedData">历史记录 <span
+							class="icon-triangle-down"></span></span>
+					<ul class="selectList-record">
+						<li class="selectItem" name="艾滋病" label="疾病">艾滋病</li>
+					</ul>
+				</div>
 			</div>
 			<div class="right">
 				<div class="top">
@@ -54,7 +61,7 @@
 							<li class="selectItem" title="疾病" data-id="疾病">疾病</li>
 							<li class="selectItem" title="药品" data-id="药品">药品</li>
 							<li class="selectItem" title="症状" data-id="症状">症状</li>
-							<li class="selectItem" title="手术和操作" data-id="手术和操作">手术和操作</li>
+							<!-- <li class="selectItem" title="手术和操作" data-id="手术和操作">手术和操作</li> -->
 							<li class="selectItem" title="实验室检查" data-id="实验室检查">实验室检查</li>
 							<li class="selectItem" title="辅助检查" data-id="辅助检查">辅助检查</li>
 						</ul>
@@ -89,17 +96,26 @@
 
 					<div class="tabBottom">
 						<div class="radioList">
-							<span class="radioItem ICD10" data-type="1">
+							<span class="radioItem disease ICD10" data-type="1" sub-type="1">
 								<img class="iconRadio" src="/images/radioSelect.png" alt="iconRadio">
 								ICD10
 							</span>
-							<span class="radioItem dept" data-type="2">
+							<span class="radioItem disease dept" data-type="1" sub-type="2">
 								<img class="iconRadio" src="/images/radioUnSelect.png" alt="iconRadio">
 								科室
 							</span>
+							<span class="radioItem medicine general" sub-type="0" data-type="2">
+								<img class="iconRadio" src="/images/radioSelect.png" alt="iconRadio">
+								通用分类
+							</span>
+							<span class="radioItem medicine act" sub-type="1" data-type="2">
+								<img class="iconRadio" src="/images/radioUnSelect.png" alt="iconRadio">
+								ATC分类
+							</span>
 						</div>
 						<div id="tree" class="ztree"></div>
 						<div class="right-aside-collapse"></div>
+
 					</div>
 
 				</div>

+ 63 - 57
src/html/knowledgeTree.html

@@ -5,83 +5,89 @@
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
-  <title><%= htmlWebpackPlugin.options.title %></title>
-	<link href="../resources/favicon.ico" rel="shortcut icon">
+  <title>
+    <%= htmlWebpackPlugin.options.title %>
+  </title>
+  <link href="../resources/favicon.ico" rel="shortcut icon">
   <!-- <link rel="stylesheet" href="./../resources/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css"> -->
-	<!-- <script type="text/javascript" src="./../resources/zTree/js/jquery.ztree.core.min.js"></script> -->
+  <!-- <script type="text/javascript" src="./../resources/zTree/js/jquery.ztree.core.min.js"></script> -->
 </head>
 
 <body>
   <div class="knowledgeTreeWrapper wrappper">
-      <div class="title">
-        <div class="titleTxt">
-          <!--<img class="titleLogo ltLogo" src="./images/logo.png" alt="logo">
+    <div class="title">
+      <div class="titleTxt">
+        <!--<img class="titleLogo ltLogo" src="./images/logo.png" alt="logo">
            <img class="titleLogo titleLogoShaiyifu" src="./images/logo_shaoyifu.png" alt="logo">-->
-          <span class="titleInfo">描述框架</span>
-          <span class="goto-homeStatic back-btn" link="/homeStatic.html">返回</span>
+        <span class="titleInfo">描述框架</span>
+        <span class="goto-homeStatic back-btn" link="/homeStatic.html">返回</span>
       </div>
+    </div>
+    <div class="content clearfix">
+      <div class="left">
+        <div id="main" class="mapWrapper" style="width: 796px;height:600px;cursor: pointer;"></div>
       </div>
-      <div class="content clearfix">
-        <div class="left">
-          <div id="main" class="mapWrapper" style="width: 796px;height:600px;cursor: pointer;"></div>
-        </div>
-        <div class="right">
-          <div class="top">
-            <div class="select">
-              <span class="selectedName">疾病</span>
-              <img class="iconSlide" src="./images/iconSlideDown.png" alt="iconSlide">
-              <ul class="selectList">
-                <li class="selectItem" data-id="疾病">疾病</li>
-                <li class="selectItem" data-id="药品通用名">药品</li>
-                <li class="selectItem" title="症状" data-id="症状">症状</li>
-                <li class="selectItem" title="手术和操作" data-id="手术和操作">手术和操作</li>
-                <li class="selectItem" title="实验室检查" data-id="实验室检查">实验室检查</li>
-                <li class="selectItem" title="辅助检查" data-id="辅助检查">辅助检查</li>
-              </ul>
-            </div>
-            <div class="search">
-                <input type="text" id="searchInp" placeholder="搜索疾病名称" name="" autocomplete="off" ><span class="searchBtn" id="searchBtn">搜索</span>
-                <ul class="tabNameList"></ul>
-                <ul class="tabNameListNoSearch"><li class="ellipsis">请输入内容</li></ul>
-            </div>
+      <div class="right">
+        <div class="top">
+          <div class="select">
+            <span class="selectedName">疾病</span>
+            <img class="iconSlide" src="./images/iconSlideDown.png" alt="iconSlide">
+            <ul class="selectList">
+              <li class="selectItem" data-id="疾病">疾病</li>
+              <li class="selectItem" data-id="药品通用名">药品</li>
+              <li class="selectItem" title="症状" data-id="症状">症状</li>
+              <!-- <li class="selectItem" title="手术和操作" data-id="手术和操作">手术和操作</li> -->
+              <li class="selectItem" title="实验室检查" data-id="实验室检查">实验室检查</li>
+              <li class="selectItem" title="辅助检查" data-id="辅助检查">辅助检查</li>
+            </ul>
           </div>
-          <div class="bottom">
-             <div class="tabList" id="tabList">
-              <div class="showTabList">
-                <!-- <span class="tab diagnose activeTab" data-id="疾病">疾病</span>
+          <div class="search">
+            <input type="text" id="searchInp" placeholder="搜索疾病名称" name="" autocomplete="off"><span class="searchBtn"
+              id="searchBtn">搜索</span>
+            <ul class="tabNameList"></ul>
+            <ul class="tabNameListNoSearch">
+              <li class="ellipsis">请输入内容</li>
+            </ul>
+          </div>
+        </div>
+        <div class="bottom">
+          <div class="tabList" id="tabList">
+            <div class="showTabList">
+              <!-- <span class="tab diagnose activeTab" data-id="疾病">疾病</span>
                 <span  class="tab drug"  data-id="药品通用名">药品</span>
                 <span  class="tab symptom" data-id="症状">症状</span>
                 <span  class="tab operation"  data-id="手术和操作">手术和操作</span> -->
-              </div>
-              <div class="toggleTab">
-                <span class="toggleTabTxt">展开</span>
-                <img class="toggleArrow" src="./images/iconDown.png" alt="">
-              </div>
-              <div class="hideTabList">
-                <!-- <span  class="tab lab" data-id="实验室检查">实验室检查</span>
+            </div>
+            <div class="toggleTab">
+              <span class="toggleTabTxt">展开</span>
+              <img class="toggleArrow" src="./images/iconDown.png" alt="">
+            </div>
+            <div class="hideTabList">
+              <!-- <span  class="tab lab" data-id="实验室检查">实验室检查</span>
                 <span  class="tab examination"  data-id="辅助检查">辅助检查</span> -->
-              </div>
-            
             </div>
-            <div class="tabBottom">
-              <div class="radioList">
-                <span class="radioItem ICD10" data-type="1">
-                  <img class="iconRadio" src="/images/radioSelect.png" alt="iconRadio">
-                  ICD10
-                </span>
-                <span class="radioItem dept" data-type="2">
-                  <img class="iconRadio" src="/images/radioUnSelect.png" alt="iconRadio">
-                  科室
-                </span>
-              </div>
-              <div id="tree" class="ztree"></div>
+
+          </div>
+          <div class="tabBottom">
+            <div class="radioList">
+              <span class="radioItem ICD10" data-type="1">
+                <img class="iconRadio" src="/images/radioSelect.png" alt="iconRadio">
+                ICD10
+              </span>
+              <span class="radioItem dept" data-type="2">
+                <img class="iconRadio" src="/images/radioUnSelect.png" alt="iconRadio">
+                科室
+              </span>
             </div>
+            <div id="tree" class="ztree"></div>
           </div>
         </div>
-  </div>
+      </div>
+    </div>
     <div class="footer ltLogo">
       杭州朗通信息技术有限公司 & 浙江省卫生健康委&nbsp;&nbsp;&nbsp;联合开发
     </div>
   </div>
 </body>
+
 </html>

+ 10 - 1
src/html/knowledgeUpdate.html

@@ -29,6 +29,8 @@
         <li class="contextmenu-item" title="实体合并" data-id="entityMerge">实体合并</li>
         <li class="contextmenu-item" title="展开关系" data-id="expandRelationships">展开关系</li>
         <li class="contextmenu-item" title="展开属性" data-id="expandProperty">展开属性</li>
+        <li class="contextmenu-item center" title="全部展开" data-id="expandAll">全部展开</li>
+        <li class="contextmenu-item center" title="全部关闭" data-id="closeAll">全部关闭</li>
       </ul>
     </div>
     <!-- 线的菜单 -->
@@ -81,7 +83,7 @@
               <li class="selectItem" title="疾病" data-id="疾病">疾病</li>
               <li class="selectItem" title="药品" data-id="药品">药品</li>
               <li class="selectItem" title="症状" data-id="症状">症状</li>
-              <li class="selectItem" title="手术和操作" data-id="手术和操作">手术和操作</li>
+              <!-- <li class="selectItem" title="手术和操作" data-id="手术和操作">手术和操作</li> -->
               <li class="selectItem" title="实验室检查" data-id="实验室检查">实验室检查</li>
               <li class="selectItem" title="辅助检查" data-id="辅助检查">辅助检查</li>
             </ul>
@@ -119,6 +121,13 @@
         <div id="dragMe" class="legendIcon">
           <div class="legendIconImg"></div>
         </div>
+        <div class="category-num"></div>
+        <div select="on" class="record">
+          <span class="selectedData">历史记录 <span class="icon-triangle-down"></span></span>
+          <ul class="selectList-record">
+            <li class="selectItem-record" name="艾滋病" label="疾病">艾滋病</li>
+          </ul>
+        </div>
       </div>
       <div class="right">
         <div class="content-right-box basic-information">

+ 1 - 1
src/js/api.js

@@ -83,7 +83,7 @@ const typeLis = {
 const typeLisName = {
   "临床表现": "症状",
   "疾病名称": "疾病",
-  "手术名称": "手术和操作",
+  //"手术名称": "手术和操作",
   "药物名称": "药品",
   "药物过敏原": "药品",
   "实验室检查套餐": "实验室检查",

+ 445 - 107
src/js/graphMap.js

@@ -10,7 +10,6 @@ let disease = getUrlArgObject("disease")
 
 //关系图
 function getGraph(val, type) {
-
     return post(api.getGraph, {
         "inputStr": val,
         "labelName": type
@@ -27,6 +26,7 @@ function getGraph(val, type) {
                 let renderTabInfo = getTab(type)
                 renderTab(renderTabInfo)
             }
+            addRecord(val, type)
         } else {
             let nodeStr
             nodeStr = '<li class="ellipsis">暂无符合数据</li>'
@@ -38,6 +38,8 @@ function getGraph(val, type) {
 }
 
 function reDrawGraph(name, label) {
+    // getGraph(name, label)
+    // return
     if (name && label) {
         $(".selectedName").html(label)
         $("#searchInp").val(name)
@@ -50,29 +52,120 @@ function reDrawGraph(name, label) {
         "labelName": label
     }).then(res => {
         if (res.data.code == 0) {
-            Object.assign(window.graphMapUpdatedData, res.data.data)
-            let expandPropertyNode
-            for (let i = 0; i < window.graphMapUpdatedData.node.legend; i++) {
+            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) {
-                    rightMsgRender(node)
-                    break
+                    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);  // 仅更新指定的部分,不重绘图表
-
-            // expandProperty({},false) //展开原来已经展开的属性
+            rightMsgRender(currentNode) //重新渲染右侧数据
         }
     })
 
 }
+function reShowLegendNum() {
+    window.knowledgeMapSetting.showLegendNum = 0;
+    let sum = 0
+    for (let i = 0; i < window.knowledgeMapSetting.legends.length; i++) {
+        sum += 2 + window.knowledgeMapSetting.legends[i].name.length + 1
+        if (sum <= 60) {
+            window.knowledgeMapSetting.showLegendNum++
+        }
+    }
+    if (window.knowledgeMapSetting.legends.length > window.knowledgeMapSetting.showLegendNum) {
+        $('.legendSlideUp').toggleClass('legendSlideUp')
+        $('.legendIcon').css('display', "block")
+    } else {
+        $('.legendSlideUp').toggleClass('legendSlideUp')
+        $('.legendIcon').css('display', "none")
+    }
+    $(".category-num").html(`${window.knowledgeMapSetting.legends.length}`)
+}
+//重新隐藏之前的节点
+function reNodeCloseAndExpand(newLegendData) {
+    //更新legend的 selected的数据
+    let newSelected = {}
+    for (let i = 0; i < newLegendData.length; i++) {
+        newSelected[newLegendData[i]] = true
+    }
+    window.knowledgeMapSetting.selected = Object.assign(newSelected, window.knowledgeMapSetting.selected)
+    let selected = window.knowledgeMapSetting.selected
+    //隐藏(透明化)虚拟节点
+    for (let name in selected) {
+        // const name = obj.name
+        let targetIndex = -1
+        let sourceIndex = -1
+        let linkIndex = -1
+        for (let index = 0; index < window.graphMapUpdatedData.links.length; index++) {
+            if (window.graphMapUpdatedData.links[index].value === name) {
+                targetIndex = window.graphMapUpdatedData.links[index].target
+                sourceIndex = window.graphMapUpdatedData.links[index].source
+                linkIndex = index
+                if (selected[name]) {
+                    window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
+                    window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
+                    window.graphMapUpdatedData.links[linkIndex].hideLabel = false
+                } else {
+                    window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 0 }
+                    window.graphMapUpdatedData.links[linkIndex].hideLabel = true
+                    window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 0 }
+                }
+                targetIndex = -1
+                sourceIndex = -1
+                linkIndex = -1
+            }
+        }
+    }
+}
 
 function drawGraph(data, resultShowId) {
     // 销毁之前关系图,并恢复基础配置
@@ -86,32 +179,40 @@ function drawGraph(data, resultShowId) {
     // var colors = [
     //     '#FB95AF','#788083','#B2CCCF','#68BDF6','#FFD86E','#6DCE9F','#9BB2F0','#DBB7AC'
     // ]
+    data.node.forEach(node => {
+        if (!node.itemStyle.display && node.label && node.symbol == 'circle') {
+            node.symbol = 'pin'
+            node.zIndex = -1
+            node.visible = false
+            // node.symbolSize = [node.symbolSize * 1.5, node.symbolSize]
+        }
+        // if (node.category === 0) {
+        //     node.fixed = true
+        // }
+    });
 
     var chartDom = document.getElementById('main');
     var myChart = echarts.init(chartDom, null, {
-        // devicePixelRatio: 2.5,  // 设置设备像素比,适应高分辨率显示
+        devicePixelRatio: 2.5,  // 设置设备像素比,适应高分辨率显示
         renderer: 'svg'
     });
     var categories = data['categories'];
-    window.mapData = JSON.parse(JSON.stringify(data))
-    var legends = categories.slice(2, categories.length);
-    var showLegendNum = 0;
+    // window.mapData = JSON.parse(JSON.stringify(data))
+    window.knowledgeMapSetting.legends = categories.slice(2, categories.length);
+    window.knowledgeMapSetting.showLegendNum = 0;
     let sum = 0
-    // data.node.forEach(element => {
-    //     element.itemStyle = {}
-    // });
-    for (let i = 0; i < legends.length; i++) {
-        sum += 2 + legends[i].name.length + 1
+
+    for (let i = 0; i < window.knowledgeMapSetting.legends.length; i++) {
+        sum += 2 + window.knowledgeMapSetting.legends[i].name.length + 1
         if (sum <= 60) {
-            showLegendNum++
+            window.knowledgeMapSetting.showLegendNum++
         }
     }
-    let selected = {} //存储选择的种类
-    for (let i = 0; i < data.categories.length; i++) {
-        selected[data.categories[i].name] = true
+    window.knowledgeMapSetting.selected = {} //存储选择的种类
+    for (let i = 2; i < data.categories.length; i++) {
+        window.knowledgeMapSetting.selected[data.categories[i].name] = true
     }
 
-    // console.log("selected", selected)
     var option = {
         title: {
             show: false,
@@ -152,7 +253,7 @@ function drawGraph(data, resultShowId) {
             padding: [20, 2000, 20, 20],
             backgroundColor: "#ffffff",
             margin: [0, 0, 0, 0],
-            selected: selected,
+            selected: window.knowledgeMapSetting.selected,
             textStyle: {
                 // fontFamily: 'Tahoma',  // 设置字体
                 fontSize: 18,
@@ -161,7 +262,7 @@ function drawGraph(data, resultShowId) {
                 fontWeight: 'normal',       // 正常字重
             },
             // orient: 'vertical',
-            data: legends.slice(0, showLegendNum).map(function (a) {
+            data: window.knowledgeMapSetting.legends.slice(0, window.knowledgeMapSetting.showLegendNum).map(function (a) {
                 return a.name;
             }),
 
@@ -170,14 +271,17 @@ function drawGraph(data, resultShowId) {
         series: [
             {
                 type: 'graph',
-                layout: 'force',
+                layout: 'force', //circular,force
                 cursor: 'pointer',
                 categories: categories,
                 symbolSize: 80,
                 roam: true, // 'move':仅拖动,'scale':仅放大和缩小,true:放大和缩小.
                 scaleLimit: {     // 限制缩放的范围
-                    min: 0.5,
-                    max: 4
+                    min: 0.1,
+                    max: 10
+                },
+                circular: {
+                    rotateLabel: true
                 },
                 edgeSymbol: ['circle', 'arrow'],
                 edgeSymbolSize: [1, 5],
@@ -190,12 +294,16 @@ function drawGraph(data, resultShowId) {
                     }
                 },
                 force: {
-                    repulsion: 1000,
-                    gravity: 0.8,
+                    initLayout: "circular",
+                    repulsion: 500,
+                    gravity: 1,
                     friction: 0.2, //动画速度
-                    edgeLength: [4, 15],
+                    edgeLength: [10, 15],
                     layoutAnimation: true
                 },
+                labelLayout: {
+                    hideOverlap: true //是否隐藏重叠的标签。
+                },
                 draggable: window.knowledgeMapSetting.draggable,
                 animation: true,
                 hoverAnimation: false,
@@ -256,16 +364,20 @@ function drawGraph(data, resultShowId) {
             }
         ]
     };
+
+
     $(window).on('resize', function () {
         // console.log('Window resized 0');
         myChart.resize();
     })
     myChart.on('click', dataClick);
+    myChart.on('dblclick', function () {
+
+    });
 
     myChart.on('legendselectchanged', function (obj) {
         // console.log("legendselectchanged", obj)
-        selected = obj.selected
-        Object.assign(selected, obj.selected)
+        Object.assign(window.knowledgeMapSetting.selected, obj.selected)
         const name = obj.name
         let targetIndex = -1
         let sourceIndex = -1
@@ -275,18 +387,28 @@ function drawGraph(data, resultShowId) {
                 targetIndex = window.graphMapUpdatedData.links[index].target
                 sourceIndex = window.graphMapUpdatedData.links[index].source
                 linkIndex = index
-                break
+                if (obj.selected[name]) {
+                    window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
+                    window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
+                    window.graphMapUpdatedData.links[linkIndex].hideLabel = false
+                } else {
+                    window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 0 }
+                    window.graphMapUpdatedData.links[linkIndex].hideLabel = true
+                    window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 0 }
+                }
+                // break
+                targetIndex = -1
+                sourceIndex = -1
+                linkIndex = -1
             }
         }
-        if (obj.selected[name]) {
-            window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
-            window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
-            window.graphMapUpdatedData.links[linkIndex].hideLabel = false
-        } else {
-            window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 0 }
-            window.graphMapUpdatedData.links[linkIndex].hideLabel = true
-            window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 0 }
-        }
+
+        // const name = obj.name
+
+        // if (linkIndex >= 0) { //判断该关系是否存在连线
+
+        // }
+
         // console.log("links", window.graphMapUpdatedData.links[linkIndex])
         window.graphMap.setOption({
             series: [{
@@ -308,9 +430,9 @@ function drawGraph(data, resultShowId) {
             }]
         }, false);  // 仅更新指定的部分,不重绘图表
     })
-
     myChart.setOption(option, true);
-    if (legends.length > showLegendNum) {
+
+    if (window.knowledgeMapSetting.legends.length > window.knowledgeMapSetting.showLegendNum) {
         $('.legendSlideUp').toggleClass('legendSlideUp')
         $('.legendIcon').css('display', "block")
     } else {
@@ -318,16 +440,20 @@ function drawGraph(data, resultShowId) {
         $('.legendIcon').css('display', "none")
     }
     $('.legendIconImg').off("click").on('click', function (e) {
+        // console.log("legends", window.knowledgeMapSetting.legends)
         e.stopPropagation()
+        $(".category-num").html(`${window.knowledgeMapSetting.legends.length}`)
         $('.legendIconImg').toggleClass('legendSlideUp')
         if (option.legend[0].type == 'scroll') {
             option.legend[0].type = 'plain'
-            option.legend[0].data = legends
-            option.legend[0].selected = selected
+            option.legend[0].data = window.knowledgeMapSetting.legends
+            //option.legend[0].selected = window.knowledgeMapSetting.selected
+            window.knowledgeMapSetting.showLegendAll = true
         } else {
             option.legend[0].type = 'scroll'
-            option.legend[0].data = legends.slice(0, showLegendNum)
-            option.legend[0].selected = selected
+            option.legend[0].data = window.knowledgeMapSetting.legends.slice(0, window.knowledgeMapSetting.showLegendNum)
+            //y option.legend[0].selected = window.knowledgeMapSetting.selected
+            window.knowledgeMapSetting.showLegendAll = false
         }
         option.series[0].edgeLabel = {
             formatter: function (x) {
@@ -339,6 +465,8 @@ function drawGraph(data, resultShowId) {
                 }
             }
         }
+        option.series[0].data = window.graphMapUpdatedData.node// 更新节点数据
+        option.series[0].links = window.graphMapUpdatedData.links // 更新边数据
         myChart.setOption(option, false);
     })
     //
@@ -354,7 +482,7 @@ function drawGraph(data, resultShowId) {
         });
         // 自定义右键菜单
         myChart.on('contextmenu', function (event) {
-            //console.log("contextmenu-2:", event);
+            console.log("contextmenu-edit:", event);
             // 停止冒泡
             event.event.stop()
             // 关闭全部自定义的菜单
@@ -394,11 +522,26 @@ function drawGraph(data, resultShowId) {
                         'top': event.event.event.pageY + 'px'
                     })
                 }
-                else if (event.data.symbol == 'circle') {
-                    $(".contextmenu").show().css({
-                        "left": event.event.event.pageX + 'px',
-                        'top': event.event.event.pageY + 'px'
-                    })
+                else if (event.data.symbol == 'circle' || event.data.symbol == 'pin') {
+                    let contextmenuHeight = $(".contextmenu").outerHeight()
+                    let windowHeight = document.documentElement.clientHeight
+                    if (event.data.category === 0) {
+                        $(".contextmenu .center").show()
+                    } else {
+                        $(".contextmenu .center").hide()
+                    }
+                    if (contextmenuHeight + event.event.event.pageY > windowHeight) {
+                        $(".contextmenu").show().css({
+                            "left": event.event.event.pageX + 'px',
+                            'top': event.event.event.pageY - contextmenuHeight + 'px'
+                        })
+                    } else {
+                        $(".contextmenu").show().css({
+                            "left": event.event.event.pageX + 'px',
+                            'top': event.event.event.pageY + 'px'
+                        })
+                    }
+
                 }
                 // $(".contextmenu").show().css({
                 //     "left": event.event.event.pageX + 'px',
@@ -409,6 +552,7 @@ function drawGraph(data, resultShowId) {
 
         })
     }
+
     if (window.knowledgeMapSetting.operation === "view") {
         chartDom.addEventListener('contextmenu', function (event) {
             event.preventDefault(); // 阻止默认右键菜单出现
@@ -418,6 +562,7 @@ function drawGraph(data, resultShowId) {
         $(".contextmenu .contextmenu-item").on("click", function (event) {
             const dataId = $(this).attr("data-id")
             // console.log("contextmenu-view-click", event, "dataId", dataId)
+            const selected = window.knowledgeMapSetting.selected
             switch (dataId) {
                 case "closeAll":
                     for (let key in selected) {
@@ -434,7 +579,8 @@ function drawGraph(data, resultShowId) {
                                     break
                                 }
                             }
-                            // console.log("key", key)
+                            // console.log("key", key, "linkIndex", linkIndex)
+                            if (!(linkIndex >= 0)) continue;
                             if (selected[key]) {
                                 window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
                                 window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
@@ -462,6 +608,7 @@ function drawGraph(data, resultShowId) {
                                     break
                                 }
                             }
+                            if (!(linkIndex >= 0)) continue;
                             if (selected[key]) {
                                 window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
                                 window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
@@ -511,13 +658,30 @@ function drawGraph(data, resultShowId) {
             }
         })
     }
+    // myChart.on('datazoom', function () {
+    //     let selectedLegend = myChart.getOption().legend[0].selected;
+    //     console.log("datazoom'", selectedLegend);
+    // });
+
+    //图渲染结束后,执行代码
+    myChart.on('finished', function () {
+        // var newOption = myChart.getOption();
+
+        // 禁用 force 布局,使得图表不再更新
+        // newOption.series[0].layout = 'none';  // 设置 layout 为 'none' 停止 force 布局
+        // newOption.series[0].force.layoutAnimation = false;  // 禁用动画
+        // myChart.setOption(newOption, false); // 更新 option
+    });
+
     window.graphMap = myChart
     window.graphMapUpdatedData = data
     rightMsgRender(data.node[0])
     window.knowledgeMapSetting.currentNodeId = data.node[0].nodeId
+    $(".category-num").html(`${window.knowledgeMapSetting.legends.length}`)
 }
 
 const rightMsgRender = function (data) {
+    if (!data) return;
     const basic_information_str = `
     <div class="text">
       <p class="text-key">ID:</p>
@@ -542,6 +706,10 @@ const rightMsgRender = function (data) {
     }
     $(".basic-information .box-content").html(basic_information_str)
     $(".property .box-content").html(property_str)
+    rightEntityNode(data)
+}
+// 生成右侧实体节点选项
+function rightEntityNode(data) {
     const mainId = data.nodeId
     // const mainIndex = data.name
     let entityNodes = []
@@ -589,6 +757,7 @@ const rightMsgRender = function (data) {
     $(".content .right .entity-node .box-content").html(entity_node_str)
 }
 
+
 //计算echarts内部图例占用高度(不考虑富文本的情况) //5ms
 const getLegendHeight = function (index, chartDom, myChart) {
     var height = 0;
@@ -664,8 +833,10 @@ function dataClick(param) {
     var data = param.data;
     rightMsgRender(data)
     window.knowledgeMapSetting.currentNodeId = param.data.nodeId
-    let labelList = ["疾病", "药品", "症状", "手术和操作", "实验室检查", "辅助检查"]
-    // if(labelList.indexOf(param.type)===-1) return;
+    let labelList = ["疾病", "药品", "症状",
+        // "手术和操作", 
+        "实验室检查", "辅助检查"]
+    // Object.keys(data.itemStyle) >= 1
     if (data.itemStyle.color || labelList.indexOf(param.data.type) === -1 || !data.itemStyle.display) return;
     const clientHei = $(window).height()
     const contentHei = clientHei - 80
@@ -682,9 +853,7 @@ function dataClick(param) {
                 if (window.knowledgeMapSetting.zTree) {
                     updateTree(data.label)
                 }
-
                 getGraph(data.label, select_type);
-
             } else {
                 let renderTabInfo = getTab(data.type)
                 renderTab(renderTabInfo)
@@ -693,6 +862,16 @@ function dataClick(param) {
                     $(".radioList").show()
                     $('.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 (data.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()
@@ -712,10 +891,12 @@ function dataClick(param) {
 
                     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 == "实验室检查") {
+                }
+                // 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 == "辅助检查") {
@@ -723,15 +904,34 @@ function dataClick(param) {
                     getGraph(data.label, select_type);
                 }
             }
+            // addRecord(data.label, select_type)
+            // renderRecord()
         }
     }
 }
 
+function reDrawTree(name, label) {
+    if (label == "疾病") {
+        getTree(1, 1, name);
 
+    } else if (label == "药品") {
+        getTree(0, 2, name);
 
+    } else if (label == "症状") {
+        getTree(0, 3, name);
+    }
+    // else if (label == "手术和操作") {
+    //     getTree(0, 4,name);
+    // } 
+    else if (label == "实验室检查") {
+        getTree(0, 5, name);
+    } else if (label == "辅助检查") {
+        getTree(0, 6, name);
+    }
+}
 
 function getTree(subType, type, showNodeName) {
-    if (!window.knowledgeMapSetting.zTree) return; //没有树跳过
+    if (!window.knowledgeMapSetting.zTree) return; //没有树,跳过
     post(api.getTree,
         {
             "subType": subType,     //科室subType: 2, 疾病type:1
@@ -745,6 +945,7 @@ function getTree(subType, type, showNodeName) {
         }
     })
 }
+
 function drawTree(data, showNodeName) {
     if (!window.knowledgeMapSetting.zTree) return;
     /**
@@ -782,7 +983,8 @@ function drawTree(data, showNodeName) {
         },
         //设置事件回调
         callback: {
-            onClick: function (treeId, treeNode) {
+            onClick: function (event, treeId, treeNode) {
+                // console.log("onClick-treeId", treeId, "onClick-treeNode", treeNode)
                 const selectPId = $('.curSelectedNode').attr('id')
                 if (selectPId) {
                     const selectId = selectPId.substring(0, selectPId.length - 1) + 'ico'
@@ -791,6 +993,7 @@ function drawTree(data, showNodeName) {
 
             },
             beforeClick: function (treeId, treeNode) {
+                // console.log("beforeClick-treeId", treeId, "onClick-treeNode", treeNode)
                 var zTree = $.fn.zTree.getZTreeObj("tree");
                 if (treeNode.isParent) {
                     zTree.expandNode(treeNode);
@@ -816,21 +1019,33 @@ function drawTree(data, showNodeName) {
             }
         }
     };
-    var zNodes = data.nodes;
-    // var zNodes = zTreeData.nodes; 
-    $.fn.zTree.init($("#tree"), setting, zNodes);
+    // var zNodes = []
+    // for (let i = 0; i < data.nodes.length; i++) {
+    //     const node = data.nodes[i]
+    //     let isNode = false
+    //     for (let j = 0; j < zNodes.length; j++) {
+    //         if (zNodes[j].id === node.id) {
+    //             isNode = true
+    //             break
+    //         }
+    //     }
+    //     if (!isNode) {
+    //         zNodes.push(node)
+    //     }
+    // }
+    $.fn.zTree.init($("#tree"), setting, data.nodes);
     // console.log("zNodes", zNodes)
     if (showNodeName) {
         // updateTree(showNodeName)
         selectedZTreeNode(showNodeName)
     }
-    // selectedZTreeNode("艾滋病")
 }
-
+// 定位到当前疾病
 function selectedZTreeNode(nodeName) {
     const zTreeObj = $.fn.zTree.getZTreeObj("tree")
+    // zTreeObj.expandAll()
     // console.log("zTreeObj", zTreeObj)
-    const targetNode = zTreeObj.getNodeByParam("name", nodeName); // 获取 id 为 2 的节点
+    const targetNode = zTreeObj.getNodeByParam("name", nodeName); // 名字相同的节点
     // console.log("targetNode", targetNode)
     if (targetNode) {
         // 展开指定父节点
@@ -846,12 +1061,15 @@ function selectedZTreeNode(nodeName) {
 
         // zTreeObj.scrollToNode(targetNode);
         // $.fn.zTree.getZTreeObj("tree").expandAll(true);
-        const parent = document.querySelector(`#tree`)
-        const child = document.querySelector(`.curSelectedNode`)
-        parent.scrollTo({
-            top: child.offsetTop,//需要父元素设置postion(relative、absolute、fixed)
-            behavior: "smooth"
-        })
+        setTimeout(() => {
+            const parent = document.querySelector(`#tree`)
+            const child = document.querySelector(`#tree .curSelectedNode`)
+            parent.scrollTo({
+                top: child.offsetTop,//需要父元素设置postion(relative、absolute、fixed)
+                behavior: "smooth"
+            })
+        }, 500)
+
 
     }
 }
@@ -898,22 +1116,37 @@ function getNode(val, 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 == '实验室检查') {
+                    }
+                    // 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()
+                        $(".radioList .radioItem").hide()
+                        $(".radioList .disease").show()
+
                         setTabBottomHei(1)
-                    } else {
+                    } 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)
 
@@ -984,7 +1217,9 @@ function getKeyEvent(evt) {
 }
 
 function getTab(tabName) {
-    let tabList = ["疾病", "药品", "症状", "手术和操作", "实验室检查", "辅助检查"]
+    let tabList = ["疾病", "药品", "症状",
+        //  "手术和操作",
+        "实验室检查", "辅助检查"]
     let tabListCopy = tabList.slice()
     const index = tabList.findIndex(item => item == tabName)
 
@@ -1089,10 +1324,24 @@ function bindTabClick() {
         let renderInfo = getTab(id)
         // renderTab(renderInfo)
         if (id != select_type) {
-            if (id != "疾病") {
+            if (id != "疾病" && id != "药品") {
                 $(".radioList").hide()
                 setTabBottomHei(2)
             } else {
+                if (id == '疾病') {
+                    $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                    $('.ICD10 img').attr('src', '/images/radioSelect.png')
+                    $(".radioList .radioItem").hide()
+                    $(".radioList .disease").show()
+
+
+                } else if (id == '药品') {
+                    $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                    $('.general img').attr('src', '/images/radioSelect.png')
+                    $(".radioList .radioItem").hide()
+                    $(".radioList .medicine").show()
+
+                }
                 $(".radioList").show()
                 setTabBottomHei(1)
             }
@@ -1101,7 +1350,6 @@ function bindTabClick() {
             setSelectName(select_type)
 
             if (id == "疾病") {
-
                 $('#searchInp').val(disease || "艾滋病")
                 $('.iconRadio').attr('src', '/images/radioUnSelect.png')
                 $('.ICD10 img').attr('src', '/images/radioSelect.png')
@@ -1109,25 +1357,27 @@ function bindTabClick() {
                 getGraph(disease || "艾滋病", select_type);
 
             } else if (id == "药品") {
-                $('#searchInp').val("硝苯地平缓释片(Ⅱ)")
-                getTree(0, 2, "硝苯地平缓释片(Ⅱ)");
-                getGraph("硝苯地平缓释片(Ⅱ)", select_type);
+                $('#searchInp').val("过氧化氢溶液")
+                getTree(0, 2, "过氧化氢溶液");
+                getGraph("过氧化氢溶液", select_type);
             } else if (id == "症状") {
                 $('#searchInp').val("背痛")
                 getTree(0, 3, "背痛");
                 getGraph("背痛", select_type);
-            } else if (id == "手术和操作") {
-                $('#searchInp').val("动脉缝合术")
-                getTree(0, 4, "动脉缝合术");
-                getGraph("动脉缝合术", select_type);
-            } else if (id == "实验室检查") {
-                $('#searchInp').val("白细胞计数(WBC)")
-                getTree(0, 5, "白细胞计数(WBC)");
-                getGraph("白细胞计数(WBC)", select_type);
+            }
+            // else if (id == "手术和操作") {
+            //     $('#searchInp').val("动脉缝合术")
+            //     getTree(0, 4, "动脉缝合术");
+            //     getGraph("动脉缝合术", select_type);
+            // } 
+            else if (id == "实验室检查") {
+                $('#searchInp').val("白细胞计数")
+                getTree(0, 5, "白细胞计数");
+                getGraph("白细胞计数", select_type);
             } else if (id == "辅助检查") {
-                $('#searchInp').val("肝彩超")
-                getTree(0, 6, "肝彩超");
-                getGraph("肝彩超", select_type);
+                $('#searchInp').val("ERCP下胆胰管细胞学检查")
+                getTree(0, 6, "ERCP下胆胰管细胞学检查");
+                getGraph("ERCP下胆胰管细胞学检查", select_type);
             }
             // getTree(1,1,"");  //切换tab重新画菜单树
         }
@@ -1172,8 +1422,8 @@ function setSelectName(name) {
     }
 }
 function hideSlide(expectClass) {
-    let hideSlideList = ['selectList', 'tabNameList', 'tabNameListNoSearch',
-        // 'hideTabList',
+    let hideSlideList = ['selectList', 'tabNameList', 'tabNameListNoSearch', "selectList-record",
+        // 'hideTabList',"
         'contextmenu', 'contextmenu-edge', 'contextmenu-node']
     let index = hideSlideList.findIndex(item => item == expectClass)
     for (let i = 0; i < hideSlideList.length; i++) {
@@ -1192,15 +1442,13 @@ function hideSlide(expectClass) {
 
 function expandProperty(data, flag) {
     // console.log("expandProperty", data)
-    if (flag) { //把节点添加到配置中
-        window.knowledgeMapSetting.expandPropertyId.push(data.nodeId)
-    }
+
     // window.graphMapUpdatedData
-    // 生成一个虚拟节点
-    let sourceIndex = -1
+
     //检验是否要展开属性
     let checkHasProperties = Object.keys(data.properties).filter(key => key !== "name" || key !== "is_deleted").length > 0
-
+    // 生成一个虚拟节点
+    let sourceIndex = -1
     if (checkHasProperties) {
         const newNode = {
             category: data.category,
@@ -1221,7 +1469,14 @@ function expandProperty(data, flag) {
         }
         window.graphMapUpdatedData.links.push(newLink)
         sourceIndex = newNode.name
-    } else return
+        if (flag) { //把节点添加到配置中
+            if (window.knowledgeMapSetting.expandPropertyId.indexOf(data.nodeId) === -1) {//节点id不存在则添加
+                window.knowledgeMapSetting.expandPropertyId.push(data.nodeId)
+            }
+        }
+    } else {
+        return
+    }
     // 属性节点
     for (let i in data.properties) {
         if (i == 'name' || i == 'is_deleted') continue
@@ -1254,6 +1509,89 @@ function expandProperty(data, flag) {
     }, false);  // 仅更新指定的部分,不重绘图表
 }
 
+function expandPropertyNodePad(expandPropertyNodes) {
+    for (let i = 0; i < expandPropertyNodes.length; i++) {
+        let data = expandPropertyNodes[i]
+        //展开原来已经展开的属性
+        //检验是否要展开属性
+        let checkHasProperties = Object.keys(data.properties).filter(key => key !== "name" || key !== "is_deleted").length > 0
+        // 生成一个虚拟节点
+        let sourceIndex = -1
+        if (checkHasProperties) {
+            const newNode = {
+                category: data.category,
+                label: "",
+                name: window.graphMapUpdatedData.node.length,
+                nodeId: data.nodeId,
+                properties: data.properties,
+                symbol: "diamond",
+                symbolSize: 10,
+                type: data.type,
+                itemStyle: data.itemStyle
+            }
+            window.graphMapUpdatedData.node.push(newNode)
+            const newLink = {
+                value: "属性",
+                source: data.name,
+                target: newNode.name,
+            }
+            window.graphMapUpdatedData.links.push(newLink)
+            sourceIndex = newNode.name
+        } else {
+            return
+        }
+        // 属性节点
+        for (let i in data.properties) {
+            if (i == 'name' || i == 'is_deleted') continue
+            const newNode = {
+                category: data.category,
+                label: i + ":" + data.properties[i],
+                name: window.graphMapUpdatedData.node.length,
+                nodeId: data.nodeId,
+                properties: { name: i, value: data.properties[i], parentName: data.properties.name },
+                symbol: "diamond",
+                symbolSize: 28,
+                type: data.type,
+                itemStyle: data.itemStyle
+            }
+            window.graphMapUpdatedData.node.push(newNode)
+            const newLink = {
+                value: "",
+                source: sourceIndex,
+                target: newNode.name,
+            }
+            window.graphMapUpdatedData.links.push(newLink)
+        }
+    }
+}
+function renderRecord() {
+    let record_str = ""
+    // $(".record .selectList-record").empty()
+    // console.log("records", window.knowledgeMapSettings.records)
+    for (let i = 0; i < window.knowledgeMapSetting.records.length; i++) {
+        const record = window.knowledgeMapSetting.records[i]
+        // console.log(i, "record", record)
+        record_str += `<li class="selectItem-record" name="${record.name}" label="${record.label}">${record.name}</li>`
+    }
+    $(".record .selectList-record").html(record_str)
+}
+
+function addRecord(name, label) {
+    let isHasRecord = false
+    for (let i = 0; i < window.knowledgeMapSetting.records.length; i++) {
+        const record = window.knowledgeMapSetting.records[i]
+        if (name === record.name && label === record.label) {
+            isHasRecord = true
+            break
+        }
+    }
+    if (!isHasRecord) {
+        window.knowledgeMapSetting.records.push({ name: name, label: label })
+        renderRecord()
+    }
+}
+
+
 module.exports = {
     drawGraph,
     updateTree,

+ 60 - 15
src/js/index.js

@@ -24,7 +24,7 @@ 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 } = require('./graphMap.js');
+    setSelectName, hideHideTab, hideSlide, reDrawGraph } = require('./graphMap.js');
 /**右侧侧边栏折叠*/
 let isRightCollapse = false
 window.select_type = "疾病";
@@ -32,13 +32,22 @@ window.select_type_noSearch = "疾病";
 window.refreshTree = true
 let disease = getUrlArgObject("disease")
 // 用来存储节点操作的数据
-window.knowledgeMapData = {}
-/**知识图谱的部分配置信息*/
+window.knowledgeMapData = {}//当前右键节点数据
+window.graphMapUpdatedData = null //实时更新的关系图数据
+window.graphMap = null //当前关系图实例对象
 window.knowledgeMapSetting = {
-    operation: "view", //操作类型,查看
-    showLegend: true, //是否展示图例
-    draggable: false,
-    zTree: true
+    operation: "view", //操作类型,修改
+    draggable: true, //是否能拖拽节点
+    zTree: true,//是否有zTree
+    expandPropertyId: [],//存储展开属性的nodeId
+    expandRelationshipsId: [],//存储展开关系的nodeId
+    currentNodeId: -1,//存储右侧显示的节点的nodeId
+    legends: [],//图例
+    selected: {},//选中的数据
+    showLegend: true, //是否显示图例
+    showLegendNum: 0,//展示图例的数量
+    showLegendAll: false,//是否展示全部图例
+    records: [],//历史记录
 }
 
 setHei()
@@ -107,13 +116,15 @@ $("#searchInp").bind("input propertychange", function (event) {
 $('.radioItem').click(function (e) {
     $('.radioItem').css('color', '#333333')
     $(this).css("color", '#409EF1')
-    const initDiag = disease || "艾滋病"
-    const type = $(this).attr('data-type')
+    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(type, 1, initDiag);
+    getTree(subType, type, initDiag);
     getGraph(initDiag, select_type);
     // updateTree(initDiag)
 })
@@ -136,26 +147,42 @@ $('#searchBtn').click(function (e) {
             if (select_type == '疾病') {
                 // $('#searchInp').val("高血压3级")
                 getTree(1, 1, val);
-            } else if (select_type == '药品通用名') {
+            } 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 == '实验室检查') {
+            }
+            // 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 {
+            }
+            else {
                 $(".radioList").hide()
                 setTabBottomHei(2)
             }
+
             let renderTabInfo = getTab(select_type)
             renderTab(renderTabInfo)
         })
@@ -261,6 +288,24 @@ window.addEventListener("message", function (event) {
         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,

+ 81 - 79
src/js/knowledgeTree.js

@@ -21,154 +21,156 @@ require('./../resources/zTree/css/zTreeStyle/zTreeStyle.css');
 const iconUp = require('./../resources/images/iconUp.png');
 const iconDown = require('./../resources/images/iconDown.png');
 // document.write("aaaa");
-const {getSchema,getTree,getNode,getTab,renderTab,setTabBottomHei,setSelectName,hideSlide} = require('./schemaMap.js');
-const {ifHideLogo} = require("./api.js");
+const { getSchema, getTree, getNode, getTab, renderTab, setTabBottomHei, setSelectName, hideSlide } = require('./schemaMap.js');
+const { ifHideLogo } = require("./api.js");
 
-window.select_type="疾病";
-window.select_type_noSearch="疾病";
+window.select_type = "疾病";
+window.select_type_noSearch = "疾病";
 window.refreshTree = true
 
 
- setHei()
+setHei()
 ifHideLogo()
- function setHei(){
+function setHei() {
     const clientHei = $(window).height()
     const contentHei = 580
-    $(".left").css("height",contentHei+'px')
-    $(".right").css("height",contentHei+'px')
-    console.log('select_type',select_type)
-    if(select_type=="疾病"){
+    $(".left").css("height", contentHei + 'px')
+    $(".right").css("height", contentHei + 'px')
+    console.log('select_type', select_type)
+    if (select_type == "疾病") {
         setTabBottomHei(1)
-    }else{
+    } else {
         setTabBottomHei(2)
     }
-    $("#main").css("height",contentHei-20-20+'px')
- }
+    $("#main").css("height", contentHei - 20 - 20 + 'px')
+}
 
 
 
- $(window).resize(function(){
+$(window).resize(function () {
     setHei()
     // getSchema(graphTxt,select_type);
- })
+})
 //关系图
-getSchema("胆囊炎",select_type);
-getTree(1,1,"胆囊炎");
+getSchema("胆囊炎", select_type);
+getTree(1, 1, "胆囊炎");
 $('#searchInp').val("胆囊炎")
 
 
 //选择类型
-$('.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){
+$('.radioItem').click(function (e) {
     const initDiag = "胆囊炎"
     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);
-    getSchema(initDiag,select_type);
+    $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+    $(this).children('img').attr('src', '/images/radioSelect.png')
+    $('#searchInp').val(initDiag)
+    getTree(type, 1, initDiag);
+    getSchema(initDiag, select_type);
     // updateTree(initDiag)
 })
 //搜索
-$('#searchBtn').click(function(e){
+$('#searchBtn').click(function (e) {
     e.stopPropagation()
     const val = $('#searchInp').val().trim()
-    if(val){
+    if (val) {
         const clientHei = $(window).height()
         const contentHei = clientHei - 80
         $(".tabNameList").hide()
-        getSchema(val,select_type_noSearch).then(()=>{
-            if(!window.refreshTree){
+        getSchema(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()
 })
-		
-		
-	
+
+
+
 
 
 

+ 212 - 39
src/js/knowledgeUpdate.js

@@ -32,15 +32,22 @@ window.select_type_noSearch = "疾病";
 window.refreshTree = true
 let disease = getUrlArgObject("disease")
 // 用来存储节点操作的数据
-window.knowledgeMapData = {}
+window.knowledgeMapData = {}//当前右键节点数据
+window.graphMapUpdatedData = null //实时更新的关系图数据
+window.graphMap = null //当前关系图实例对象
 window.knowledgeMapSetting = {
   operation: "edit", //操作类型,修改
-  showLegend: true, //是否显示图例
-  draggable: false, //是否能拖拽节点
+  draggable: true, //是否能拖拽节点
   zTree: false,//是否有zTree
   expandPropertyId: [],//存储展开属性的nodeId
   expandRelationshipsId: [],//存储展开关系的nodeId
   currentNodeId: -1,//存储右侧显示的节点的nodeId
+  legends: [],//图例
+  selected: {},//选中的数据
+  showLegend: true, //是否显示图例
+  showLegendNum: 0,//展示图例的数量
+  showLegendAll: false,//是否展示全部图例
+  records: [],//历史记录
 }
 
 setHei()
@@ -99,7 +106,21 @@ $('.dropdown').on('click', function (el) {
   $(this).find(".selectList").slideToggle()
 })
 
-
+$(".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()
+  })
+})
 
 
 //搜索节点名
@@ -147,9 +168,11 @@ $('#searchBtn').click(function (e) {
         getTree(0, 2, val);
       } else if (select_type == '症状') {
         getTree(0, 3, val);
-      } else if (select_type == '手术和操作') {
-        getTree(0, 4, val);
-      } else if (select_type == '实验室检查') {
+      }
+      // else if (select_type == '手术和操作') {
+      //   getTree(0, 4, val);
+      // }
+      else if (select_type == '实验室检查') {
         getTree(0, 5, val);
       } else if (select_type == '辅助检查') {
         getTree(0, 6, val);
@@ -213,6 +236,7 @@ $('html').click(function () {
 
 
 
+
 let toggleTabHtml = ""
 $(".right-aside-collapse").on("click", function () {
   isRightCollapse = !isRightCollapse
@@ -248,7 +272,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 - 110).toString() + 'px'
@@ -259,7 +283,7 @@ window.addEventListener("message", function (event) {
       $(".content .left").css('width', leftWidth)
 
     }
-    console.log("leftWidth", leftWidth);
+    // console.log("leftWidth", leftWidth);
     window.graphMap.resize()
   }
   if (event.data.operation === 'update-graph') { //重新绘制关系图
@@ -296,10 +320,13 @@ $(".dropdown[select='off'] .selectList .selectItem").on("click", function () {
 
 
 
+
+
 // 自定义的菜单和部分下拉框的操作
 function menuOperation(opType, data) {
+
   data.width = ""
-  console.log("menuOperationData", data);
+  // console.log("menuOperationData", data);
   let selectedName = ""
   let searchInp = ""
   const parentURL = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port + "/home.html";
@@ -328,10 +355,9 @@ function menuOperation(opType, data) {
       let relationshipType = "string"
       let startId = 0
       let startLabel = "string"
-      window.mapData.node.forEach((element, index) => {
+      window.graphMapUpdatedData.node.forEach((element, index) => {
         if (index == data.data.target) {
           endId = element.nodeId
-
         }
       });
       window.parent.postMessage(data, parentURL);
@@ -346,16 +372,38 @@ function menuOperation(opType, data) {
       break
     case "expandRelationships": //右键展开关系
       if (data.data.name === 0 || data.data.expanded) return;
+
       post(api.getGraph, {
         "inputStr": data.data.properties.name,
         "labelName": data.data.type
       }).then(res => {
         const { code, msg } = res.data
         const nodeLength = window.graphMapUpdatedData.node.length
-        if (code == '0') {
+        // let selected = {}
+        if (code === '0') {
+          res.data.data.node.forEach(node => {
+            if (!node.itemStyle.display && node.label && node.symbol == 'circle') {
+              node.symbol = 'pin'
+            }
+          });
           const newNodeData = res.data.data
-          // debugger
-          // console.log("newNodeData ", newNodeData)
+          //添加新的类
+          // 判断有没有新添加的类型
+          for (let i = 2; i < newNodeData.categories.length; i++) {
+            let isCategory = false
+            for (let j = 0; j < window.graphMapUpdatedData.categories.length; j++) {
+              if (newNodeData.categories[i].name === window.graphMapUpdatedData.categories[j].name) {
+                isCategory = true
+                break
+              }
+            }
+            if (!isCategory) {
+              window.graphMapUpdatedData.categories.push(newNodeData.categories[i])
+              window.knowledgeMapSetting.legends.push(newNodeData.categories[i])
+              window.knowledgeMapSetting.selected[newNodeData.categories[i].name] = true
+            }
+          }
+
           newNodeData.node.forEach((node, index) => {
             let nodeIndex = -1
             if (index === 0) {
@@ -365,34 +413,47 @@ function menuOperation(opType, data) {
             } else {
               nodeIndex = nodeLength + index - 1
               node.name = nodeIndex
-              // 检查是否存在节点
-              // const hasNodeCheck = window.graphMapUpdatedData.node.some((j) => {
-              //   if (node.nodeId === j.nodeId) {
-              //     nodeIndex = j.name
-              //     return true
-              //   }
-              // })
-              // 如果节点不存在,则新增节点
-              // if (!hasNodeCheck) {
-              //   window.graphMapUpdatedData.node.push(node)
-              // }
+              for (let i = 0; i < window.graphMapUpdatedData.categories.length; i++) {
+                if (newNodeData.categories[node.category].name === window.graphMapUpdatedData.categories[i].name) {
+                  // console.log(newNodeData.categories[node.category].name, window.graphMapUpdatedData.categories[i].name, i)
+                  node.category = i
+                  break
+                }
+              }
               window.graphMapUpdatedData.node.push(node)
             }
-            newNodeData.links.forEach(link => {
-              if (link.source === index) {
-                link.source = nodeIndex
-              };
-              if (link.target === index) {
-                link.target = nodeIndex
-              }
-            })
           })
-
+          newNodeData.links.forEach(link => {
+            if (link.source === 0) {
+              link.source = data.data.name
+            } else {
+              link.source += (nodeLength - 1)
+            }
+            if (link.target === 0) {
+              link.target = data.data.name
+            } else {
+              link.target += (nodeLength - 1)
+            }
+          })
           window.graphMapUpdatedData.links = window.graphMapUpdatedData.links.concat(newNodeData.links)
-          // console.log("graphMapUpdatedData", window.graphMapUpdatedData)
+          // window.graphMapUpdatedData.links = [...window.graphMapUpdatedData.links, ...newNodeData.links]
+          let legendData = null
+          //重新计算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)
+          }
+          reNodeCloseAndExpand()
           window.graphMap.setOption({
+            legend: [{
+              selected: window.knowledgeMapSetting.selected,
+              data: legendData,
+            }],
             series: [{
               type: 'graph',
+              categories: window.graphMapUpdatedData.categories,
               data: window.graphMapUpdatedData.node,  // 更新节点数据
               links: window.graphMapUpdatedData.links,  // 更新边数据
             }]
@@ -404,15 +465,125 @@ function menuOperation(opType, data) {
       })
       break
     case "addRelationship-dropdown":
-      data.width = "700px"
       window.parent.postMessage(data, parentURL);
       break
+    case "closeAll":
+      nodeAllCloseAndExpand(false)
+      break
+    case "expandAll":
+      nodeAllCloseAndExpand(true)
+      break
     default:
       window.parent.postMessage(data, parentURL);
   }
 }
 
+// 节点全部关闭和展开,flag为true代表全部展开,为false是全部关闭
+function nodeAllCloseAndExpand(flag) {
+  let selected = window.knowledgeMapSetting.selected
+  for (let key in selected) {
+    if (key !== "中心词" && key !== "关系") {
+      selected[key] = flag
+      let targetIndex = -1
+      let sourceIndex = -1
+      let linkIndex = -1
+      // 找到需要隐藏的节点
+      for (let index = 0; index < window.graphMapUpdatedData.links.length; index++) {
+        if (window.graphMapUpdatedData.links[index].value === key) {
+          targetIndex = window.graphMapUpdatedData.links[index].target
+          sourceIndex = window.graphMapUpdatedData.links[index].source
+          linkIndex = index
+          if (selected[key]) {
+            window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
+            window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
+            window.graphMapUpdatedData.links[linkIndex].hideLabel = false
+          } else {
+            window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 0 }
+            window.graphMapUpdatedData.links[linkIndex].hideLabel = true
+            window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 0 }
+          }
+
+          targetIndex = -1
+          sourceIndex = -1
+          linkIndex = -1
+          // break
+        }
+      }
+      // console.log("key", key, "linkIndex", linkIndex)
+      // if (!(linkIndex >= 0)) continue;
 
+    }
+  }
+  window.graphMap.setOption({
+    legend: [{ selected: selected, }],
+    series: [{
+      edgeLabel: {
+        show: true,
+        formatter: function (x) {
+          if (x.data.hideLabel) {
+            return " ";
+          }
+          else {
+            return x.data.value;  //横线关系
+          }
+        },
+      },
+      type: 'graph',
+      data: window.graphMapUpdatedData.node,  // 更新节点数据
+      links: window.graphMapUpdatedData.links,  // 更新边数据
+    }]
+  }, false);  //
+
+}
+
+//重新隐藏之前的节点
+function reNodeCloseAndExpand() {
+  let selected = window.knowledgeMapSetting.selected
+  //隐藏(透明化)虚拟节点
+  for (let name in selected) {
+    // const name = obj.name
+    let targetIndex = -1
+    let sourceIndex = -1
+    let linkIndex = -1
+    for (let index = 0; index < window.graphMapUpdatedData.links.length; index++) {
+      if (window.graphMapUpdatedData.links[index].value === name) {
+        targetIndex = window.graphMapUpdatedData.links[index].target
+        sourceIndex = window.graphMapUpdatedData.links[index].source
+        linkIndex = index
+        if (selected[name]) {
+          window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 1 }
+          window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 1 }
+          window.graphMapUpdatedData.links[linkIndex].hideLabel = false
+        } else {
+          window.graphMapUpdatedData.links[linkIndex].lineStyle = { opacity: 0 }
+          window.graphMapUpdatedData.links[linkIndex].hideLabel = true
+          window.graphMapUpdatedData.node[targetIndex].itemStyle = { opacity: 0 }
+        }
+        targetIndex = -1
+        sourceIndex = -1
+        linkIndex = -1
+      }
+    }
+  }
+}
+function reShowLegendNum() {
+  window.knowledgeMapSetting.showLegendNum = 0;
+  let sum = 0
+  for (let i = 0; i < window.knowledgeMapSetting.legends.length; i++) {
+    sum += 2 + window.knowledgeMapSetting.legends[i].name.length + 1
+    if (sum <= 60) {
+      window.knowledgeMapSetting.showLegendNum++
+    }
+  }
+  if (window.knowledgeMapSetting.legends.length > window.knowledgeMapSetting.showLegendNum) {
+    $('.legendSlideUp').toggleClass('legendSlideUp')
+    $('.legendIcon').css('display', "block")
+  } else {
+    $('.legendSlideUp').toggleClass('legendSlideUp')
+    $('.legendIcon').css('display', "none")
+  }
+  $(".category-num").html(`${window.knowledgeMapSetting.legends.length}`)
+}
 
 
 $(document).on("click", ".content .right .entity-node .box-content .text .select-sign span", function () {
@@ -443,7 +614,7 @@ $(document).on("click", ".content .right .entity-node .delete-entity", function
     }).catch(err => {
       console.log("deleteEntity接口报错", err)
     })
-    console.log("entityNodeId", entityNodeId)
+    // console.log("entityNodeId", entityNodeId)
   }
 
 })
@@ -495,7 +666,7 @@ $(document).on("click", ".link-entity", function () {
       // $(textElement).remove()
     }
   })
-  console.log("entityNode", entityNode)
+  // console.log("entityNode", entityNode)
   const data = {
     opType: "entityLink",
     showFooter: true,
@@ -512,6 +683,8 @@ $(document).on("click", ".link-entity", function () {
 
 
 
+
+
 module.exports = {
   getTab,
   renderTab

+ 256 - 250
src/js/schemaMap.js

@@ -6,20 +6,20 @@ const iconDown = require('./../resources/images/iconDown.png');
 const clientHei = $(window).height()
 const contentHei = clientHei - 80
 
-function getTree(subType, type,showNodeName){
+function getTree(subType, type, showNodeName) {
     post(api.getTree,
         {
             "subType": subType,
             "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
@@ -33,9 +33,9 @@ function drawTree(data, showNodeName){
         target:设置打开链接的方式  [在新窗口打开(_blank),要本窗口打开(_self)]
             
     **/
-    var setting = {	
+    var setting = {
         //数据格式的设置
-        data:{
+        data: {
             simpleData: {
                 enable: true, //使用简单的JSON格式
                 idKey: "id",
@@ -44,25 +44,25 @@ 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,
-            isParent:false
+            isParent: false
         },
         //设置事件回调
-        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");
@@ -72,18 +72,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)
                     }
-                    getSchema(name,select_type)
+                    getSchema(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()
                     }
-             
+
                     return true;
                 }
             }
@@ -92,74 +92,76 @@ 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()
-                getSchema(txt,select_type_noSearch).then(()=>{
-                    if(!window.refreshTree){
+                getSchema(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)
+
                 })
 
 
-               
+
             })
         }
     })
@@ -167,64 +169,64 @@ 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 getSchema(val, type){
-    return post(api.getSchema,{
+function getSchema(val, type) {
+    return post(api.getSchema, {
         "labelName": type,
         "pramNme": val
-    }).then(res=>{
-        if(res.data.code == 0) {
-            if(res.data.data.length >0){
+    }).then(res => {
+        if (res.data.code == 0) {
+            if (res.data.data.length > 0) {
                 $('#searchInp').val(val)
                 window.refreshTree = true
                 window.schemaTxt = val
                 drawSchema(res.data.data)
-                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
                 window.refreshTree = false
                 nodeStr = '<li class="ellipsis">暂无符合数据</li>'
                 $(".tabNameList").html(nodeStr)
                 $(".tabNameList").show()
             }
-        }else{
+        } else {
             let nodeStr
             window.refreshTree = false
             nodeStr = '<li class="ellipsis">暂无符合数据</li>'
@@ -233,49 +235,49 @@ function getSchema(val, type){
         }
     })
 }
- function drawSchema(data){
+function drawSchema(data) {
     var myChart = echarts.init(document.getElementById('main'));
     myChart.setOption(option = {
-        title: { 
+        title: {
             text: 'schema 结构',
             top: '10',
             left: '10',
-          textStyle:{
-                color:'#fff'
-          }
+            textStyle: {
+                color: '#fff'
+            }
         },
         tooltip: {
-            show:'true',//默认:true;是否显示提示框组件,包括提示框浮层和 axisPointer。
+            show: 'true',//默认:true;是否显示提示框组件,包括提示框浮层和 axisPointer。
             trigger: 'item',//默认:item;触发类型。item:数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。'axis':坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。'none':什么都不触发。
             triggerOn: 'mousemove',
             // borderColor: '#abcdef'
         },
-        series:[
+        series: [
             {
                 type: 'tree',
-                cursor:'pointer',
+                cursor: 'pointer',
                 data: data,
-    
+
                 left: '105px',
                 right: '100px',
                 top: '15%',
                 bottom: '10%',
-    
+
                 // symbol: 'emptyCircle',
-                itemStyle:{
+                itemStyle: {
                     // borderColor: '#abcdef'
                 },
                 // orient: 'vertical',
-                symbolSize:10,   //标记的大小,就是那个小圆圈,默认7
+                symbolSize: 10,   //标记的大小,就是那个小圆圈,默认7
                 expandAndCollapse: true,//默认:true;子树折叠和展开的交互,默认打开 。
-    
-                initialTreeDepth:1,//默认:2,树图初始展开的层级(深度)。根节点是第 0 层,然后是第 1 层、第 2 层,... ,直到叶子节点
-    
+
+                initialTreeDepth: 1,//默认:2,树图初始展开的层级(深度)。根节点是第 0 层,然后是第 1 层、第 2 层,... ,直到叶子节点
+
                 label: {
                     normal: {
                         // distance:0,
                         // position:'top',//标签的位置。
-                        position:['-100%',5],
+                        position: ['-100%', 5],
                         rotate: 0,//标签旋转。从 -90 度到 90 度。正值是逆时针。
                         verticalAlign: 'middle',//文字垂直对齐方式,默认自动。
                         align: 'right',//文字水平对齐方式,默认自动。
@@ -283,251 +285,255 @@ function getSchema(val, type){
                         // borderColor: '#abcdef',
                         // backgroundColor:'#abcdef',
                         color: '#fff',
-                        padding: [5,5,5,5],
+                        padding: [5, 5, 5, 5],
                         formatter: function (x) {
                             var tmp = x.data.name;
-                           if(tmp.length >= 12){
-                               tmp = tmp.substring(0,3);
-                               tmp = tmp + "...";
-                           }
-                           return tmp;
-                       }
+                            if (tmp.length >= 12) {
+                                tmp = tmp.substring(0, 3);
+                                tmp = tmp + "...";
+                            }
+                            return tmp;
+                        }
                     },
-                    
+
                 },
-    
+
                 leaves: {
-                    cursor:'pointer',
+                    cursor: 'pointer',
                     label: {
-                      
+
                         normal: {
-                            position: ['-100%',5],
+                            position: ['-100%', 5],
                             // color:' red',
-                            rotate:0,
-                            cursor:'default',
+                            rotate: 0,
+                            cursor: 'default',
                             verticalAlign: 'middle',
                             align: 'right',
                             fontSize: 12,//文字的字体大小
                             formatter: function (x) {
                                 var tmp = x.data.name;
-                               if(tmp.length >= 12){
-                                   tmp = tmp.substring(0,3);
-                                   tmp = tmp + "...";
-                               }
-                               return tmp;
-                           }
-                           
+                                if (tmp.length >= 12) {
+                                    tmp = tmp.substring(0, 3);
+                                    tmp = tmp + "...";
+                                }
+                                return tmp;
+                            }
+
                         },
-                        
+
                     }
-                },  
-    
+                },
+
                 animationDurationUpdate: 750
-                
+
             }
         ]
     })
-    $(window).resize(function(){
-        myChart.resize(); 
-     })
+    $(window).resize(function () {
+        myChart.resize();
+    })
     myChart.setOption(option);
- }
+}
 
 
- function getTab(tabName){
+function getTab(tabName) {
     console.log('tabName', tabName)
-    let tabList = ["疾病","药品通用名","症状","手术和操作","实验室检查","辅助检查"]
+    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")
+    $(".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 {
                 setTabBottomHei(1)
                 $(".radioList").show()
             }
             select_type_noSearch = id
             select_type = id
             setSelectName(select_type)
-           
-            if(id == "疾病"){
-               
+
+            if (id == "疾病") {
+
                 $('#searchInp').val("高血压3级")
-                $('.iconRadio').attr('src','/images/radioUnSelect.png')
-                $('.ICD10 img').attr('src','/images/radioSelect.png')
-                getTree(1,1,"胆囊炎");
-                getSchema("胆囊炎",select_type);
-            
-            
-            }else if(id=="药品通用名"){
+                $('.iconRadio').attr('src', '/images/radioUnSelect.png')
+                $('.ICD10 img').attr('src', '/images/radioSelect.png')
+                getTree(1, 1, "胆囊炎");
+                getSchema("胆囊炎", select_type);
+
+
+            } else if (id == "药品通用名") {
                 $('#searchInp').val("地高辛(XC01AAD072A001010100372)")
-                getTree(0,2,"地高辛(XC01AAD072A001010100372)");
-                getSchema("地高辛(XC01AAD072A001010100372)",select_type);
-              
-            }else if(id == "症状"){
+                getTree(0, 2, "地高辛(XC01AAD072A001010100372)");
+                getSchema("地高辛(XC01AAD072A001010100372)", select_type);
+
+            } else if (id == "症状") {
                 $('#searchInp').val("背痛")
-                getTree(0,3,"背痛");
-                getSchema("背痛",select_type);
-            }else if(id == "手术和操作"){
-                $('#searchInp').val("动脉缝合术")
-                getTree(0,4,"动脉缝合术");
-                getSchema("动脉缝合术",select_type);
-            }else if(id == "实验室检查"){
+                getTree(0, 3, "背痛");
+                getSchema("背痛", select_type);
+            }
+            // else if(id == "手术和操作"){
+            //     $('#searchInp').val("动脉缝合术")
+            //     getTree(0,4,"动脉缝合术");
+            //     getSchema("动脉缝合术",select_type);
+            // }
+            else if (id == "实验室检查") {
                 $('#searchInp').val("白细胞计数(WBC)")
-                getTree(0,5,"白细胞计数(WBC)");
-                getSchema("白细胞计数(WBC)",select_type);
-            }else if(id == "辅助检查"){
+                getTree(0, 5, "白细胞计数(WBC)");
+                getSchema("白细胞计数(WBC)", select_type);
+            } else if (id == "辅助检查") {
                 $('#searchInp').val("肝彩超")
-                getTree(0,6,"肝彩超");
-                getSchema("肝彩超",select_type);
+                getTree(0, 6, "肝彩超");
+                getSchema("肝彩超", select_type);
             }
             // getTree(1,1,"");  //切换tab重新画菜单树
         }
-       
+
         hideHideTab()
     })
 }
-function setTabBottomHei(type){
+function setTabBottomHei(type) {
     const clientHei = $(window).height()
     const contentHei = 560
-    if(type==1){
+    if (type == 1) {
         $(".tabBottom").css({
             'margin': '0px 0px 0px 0px'
         })
-        $(".tabBottom").css("height",contentHei-62-43-12+'px')
-        $(".ztree").css("height",contentHei-62-43-60-20-24+'px')
+        $(".tabBottom").css("height", contentHei - 62 - 43 - 12 + 'px')
+        $(".ztree").css("height", contentHei - 62 - 43 - 60 - 20 - 24 + 'px')
 
-    }else if(type == 2){
-        $(".tabBottom").css("height",contentHei-82-43-12+'px')
+    } else if (type == 2) {
+        $(".tabBottom").css("height", contentHei - 82 - 43 - 12 + 'px')
         $(".tabBottom").css({
             'margin': '20px 0px 0px 0px'
         })
-        $(".ztree").css("height",contentHei-82-43-60-20-24+'px')
+        $(".ztree").css("height", contentHei - 82 - 43 - 60 - 20 - 24 + '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 = {
     getSchema,
     getTree,
     updateTree,
@@ -538,4 +544,4 @@ function setTabBottomHei(type){
     setSelectName,
     hideHideTab,
     hideSlide
- }
+}

src/public/images/CAPTCHA2x.png → src/public/images/组11拷贝2x.png