Browse Source

标签组和模板修改

Luolei 6 years ago
parent
commit
86cfdaa8f4

+ 89 - 6
src/components/icss/BloodPressTagGroup.vue

@@ -37,7 +37,19 @@
         ></span></p>
     </div>
     <div class="bottomPartRight ">
-      <p class="poolTitle">操作界面:</p>
+      <div class="poolTitle clearfix">
+        <span class="fl">操作界面:</span>
+        <div class="arrowWrap fr">
+          <i
+            class="el-icon-arrow-left arrowWrapPub"
+            @click="toggleTopDownList(1)"
+          ></i>
+          <i
+            class="el-icon-arrow-right arrowWrapPub"
+            @click="toggleTopDownList(2)"
+          ></i>
+        </div>
+      </div>
       <ul class="tagList operationPool templateTagList">
         <li
           class="tagItem operationItem"
@@ -162,15 +174,70 @@ export default {
 
     },
     selectRightTag(tag) {
-      const hasTag = this.isHasTag(tag, this.selectRightTagsList)
-      console.log(tag)
-      if (hasTag) {
+      if (tag.type == 'input') {
+        return;
+      }
+      let tmpArr = [];
+      tmpArr.push(tag);
+      if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
         this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
       } else {
-        this.selectRightTagsList.push(tag);
+        this.selectRightTagsList = tmpArr;
       }
+      // const hasTag = this.isHasTag(tag, this.selectRightTagsList)
+      // if (hasTag) {
+      //   this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
+      // } else {
+      //   this.selectRightTagsList.push(tag);
+      // }
 
     },
+    toggleTopDownList(type) {
+      if (this.selectRightTagsList.length == 0 || this.rightTagsList2.length == 0) {
+        return
+      }
+      const tmpRightSelect = JSON.parse(JSON.stringify(this.selectRightTagsList))
+      const tmpRightLis = JSON.parse(JSON.stringify(this.rightTagsList2))
+      const numLen = tmpRightLis.length
+      const numId = tmpRightSelect[0].id
+      if (type == 1) {
+        for (let i = 0; i < tmpRightLis.length; i++) {
+          if (numId === tmpRightLis[i].id) {//选中的是第几个
+            if (i == 1) {//第一个不能往上移动
+              return;
+            } else {//先把这个元素和后面的输入框从数组中删除,再添加到数组里
+              let tmp1 = tmpRightLis[i]
+              let tmp2 = tmpRightLis[i + 1]
+              tmpRightLis.splice(i, 1)
+              tmpRightLis.splice(i, 1)
+              tmpRightLis.splice(i - 2, 0, tmp1)
+              tmpRightLis.splice(i - 1, 0, tmp2)
+              this.rightTagsList2 = [...tmpRightLis]
+              this.$emit('changeActionData', this.rightTagsList2, false);
+              return
+            }
+          }
+        }
+      } else if (type == 2) {
+        for (let i = 0; i < tmpRightLis.length; i++) {
+          if (numId === tmpRightLis[i].id) {
+            if (i == numLen - 1) {
+              return;
+            } else {
+              let tmp1 = tmpRightLis[i]
+              let tmp2 = tmpRightLis[i + 1]
+              tmpRightLis.splice(i, 1)
+              tmpRightLis.splice(i, 1)
+              tmpRightLis.splice(i + 2, 0, tmp1)
+              tmpRightLis.splice(i + 3, 0, tmp2)
+              this.rightTagsList2 = [...tmpRightLis]
+              this.$emit('changeActionData', this.rightTagsList2, false);
+              return
+            }
+          }
+        }
+      }
+    },
     isHasTag(item, arr) {
       for (let i = 0; i < arr.length; i++) {
         if (arr[i].id === item.id) {
@@ -283,6 +350,20 @@ export default {
 <style lang="less" scoped>
 @import "../../less/common.less";
 .symptomTagGroupWrapper {
+  .arrowWrap {
+    position: absolute;
+    right: 0;
+    .arrowWrapPub {
+      border: 1px solid @icssBorder;
+      height: 23px;
+      width: 40px;
+      text-align: center;
+      background: #fff;
+      line-height: 23px;
+      border-radius: 3px;
+      margin: 0 7px 10px 5px;
+    }
+  }
   .bottomPartLeft {
     width: 30%;
     box-sizing: border-box;
@@ -292,6 +373,7 @@ export default {
     // border-bottom: 1px solid @icssBorder;
     box-sizing: border-box;
     margin-bottom: 20px;
+    position: relative;
   }
   .pool {
     // border:1px solid @icssBorder;
@@ -316,8 +398,9 @@ export default {
   }
   .operationPool {
     position: relative;
-    width: 85%;
+    width: 100%;
     padding: 10px;
+    box-sizing: border-box;
   }
   .tagName {
     line-height: 30px;

+ 2 - 2
src/components/icss/PubTemplateGroup.vue

@@ -52,8 +52,8 @@
           <el-option
             v-for="item in sonLis"
             :label="item.name"
-            :value="item.id+''"
-            :key="item.id"
+            :value="item.conceptId+''"
+            :key="item.conceptId"
             v-if="!!item.name"
           ></el-option>
         </el-select>

+ 84 - 25
src/components/icss/SymptomTagGroup.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="symptomTagGroupWrapper clearfix">
+    <div class="symptomTagGroupWrapper commomSymptom clearfix">
     <div class="bottomPartLeft">
       <p class="poolTitle">标签池</p>
       <div class="pool">
@@ -31,7 +31,7 @@
     </div>
     <div class="bottomPartRight ">
       <p class="poolTitle">操作界面:</p>
-      <ul class="tagList operationPool">
+      <ul class="tagList operationPool" :class="(type == 1 && isSymp == 0)?'':'operationPools'">
             <li class = "tagItem"
                 v-for="(item) in rightTagsList2" 
                 :key='item.id'
@@ -47,30 +47,31 @@
                     </el-input>
                 </div>
                 <p v-if="item.tagName" class="tagName  ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
-                <div class="attributeBox">
+                <div class="attributeBox" v-if="item.symptomType === 1 || item.symptomType === 2">
                     <p v-if="item.symptomType === 1" class="tagAttribute" @click.stop>跟主症状 <span @click="closeTagAttribute(item)" class="closeTagAttribute"><i class="el-icon-error"></i></span></p>
                     <p v-if="item.symptomType === 2" class="tagAttribute" @click.stop>跟伴随症状<span  @click="closeTagAttribute(item)" class="closeTagAttribute"><i class="el-icon-error"></i></span></p>
                 </div>
             </li>
         </ul>
     </div>
-    <div class="buttonBox" v-if="type == 1 && isSymp == 0"> 
-        <div class="mainButton">
+    <div class="buttonBox"> 
+        <div class="mainButton" v-if="type == 1 && isSymp == 0">
             <el-button type="primary" @click="mainSymptom">跟主症状</el-button>
         </div>
-        <div class="followButton">
+        <div class="followButton" v-if="type == 1 && isSymp == 0">
             <el-button type="primary" @click="followSymptom">跟伴随症状</el-button>
         </div>
+        <div class="bottomPartMid bottomPartMidss fl" :class="(type == 1 && isSymp == 0)?'':'bottomPartMids'">
+            <p><span class="el-icon-arrow-up" @click="toggleTopDownList(1)"></span></p>
+            <p><span class="el-icon-arrow-down" @click="toggleTopDownList(2)"></span></p>
+        </div>
     </div>
-    <!-- <div class="bottomPartMid fl">
-        <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
-        <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
-    </div> -->
   </div>
 </template>
 <script>
 import api from '@api/icss.js';
 import utils from '@api/utils.js';
+import { constants } from 'fs';
 
 export default {
     name: "SymptomTagGroup",
@@ -174,22 +175,22 @@ export default {
             }
         },
         selectRightTag(tag) {
-            // if(tag.type == 'input'){
-            //   return;
-            // }
-            // let tmpArr = [];
-            // tmpArr.push(tag);
-            // if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
-            //   this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
-            // }else{
-            //   this.selectRightTagsList = tmpArr;
-            // }
-            const hasTag = this.isHasTag(tag, this.selectRightTagsList)
-            if (hasTag) {
-                this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
-            } else {
-                this.selectRightTagsList.push(tag);
+            if(tag.type == 'input'){
+              return;
+            }
+            let tmpArr = [];
+            tmpArr.push(tag);
+            if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
+              this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
+            }else{
+              this.selectRightTagsList = tmpArr;
             }
+            // const hasTag = this.isHasTag(tag, this.selectRightTagsList)
+            // if (hasTag) {
+            //     this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
+            // } else {
+            //     this.selectRightTagsList.push(tag);
+            // }
         },
         isHasTag(item, arr) {
             for ( let i = 0; i <arr.length; i++) {
@@ -208,6 +209,52 @@ export default {
             // return utils.filterArr(this.selectRightTagsList,item,2)
             return this.isHasTag(item, this.selectRightTagsList)
         },
+        toggleTopDownList(type){
+          if(this.selectRightTagsList.length == 0 || this.rightTagsList2.length == 0){
+            return
+          }
+          const tmpRightSelect = JSON.parse(JSON.stringify(this.selectRightTagsList))
+          const tmpRightLis = JSON.parse(JSON.stringify(this.rightTagsList2))
+          const numLen = tmpRightLis.length
+          const numId = tmpRightSelect[0].id
+          if(type == 1){
+            for(let i = 0;i < tmpRightLis.length;i++){
+              if(numId === tmpRightLis[i].id){//选中的是第几个
+                if(i == 1){//第一个不能往上移动
+                  return;
+                }else{//先把这个元素和后面的输入框从数组中删除,再添加到数组里
+                  let tmp1 = tmpRightLis[i]
+                  let tmp2 = tmpRightLis[i+1]
+                  tmpRightLis.splice(i,1)
+                  tmpRightLis.splice(i,1)
+                  tmpRightLis.splice(i-2,0,tmp1)
+                  tmpRightLis.splice(i-1,0,tmp2)
+                  this.rightTagsList2 = [...tmpRightLis]
+                  this.$emit('changeActionData',this.rightTagsList2, false);
+                  return
+                }
+              }
+            }
+          }else if(type == 2){
+            for(let i = 0;i < tmpRightLis.length;i++){
+              if(numId === tmpRightLis[i].id){
+                if(i == numLen-1){
+                  return;
+                }else{
+                  let tmp1 = tmpRightLis[i]
+                  let tmp2 = tmpRightLis[i+1]
+                  tmpRightLis.splice(i,1)
+                  tmpRightLis.splice(i,1)
+                  tmpRightLis.splice(i+2,0,tmp1)
+                  tmpRightLis.splice(i+3,0,tmp2)
+                  this.rightTagsList2 = [...tmpRightLis]
+                  this.$emit('changeActionData',this.rightTagsList2, false);
+                  return
+                }
+              }
+            }
+          }
+        },
         toLeftList() {
             // if(!this.searchVal) {
             //     this.leftTagsList = this.searchTagList()
@@ -334,6 +381,17 @@ export default {
 
 <style lang="less" >
 @import '../../less/common.less';
+.commomSymptom {
+  .tagList.operationPools {
+    width: 100%;
+  }
+  div.bottomPartMids {
+    margin-left: 20px;
+  }
+  div.bottomPartMidss {
+    margin-top: 30px;
+  }
+}
 .symptomTagGroupWrapper {
     .bottomPartLeft {
         width: 30%;
@@ -412,6 +470,7 @@ export default {
     .buttonBox {
         width: 10%;
         float: left;
+        margin-top: 30px;
     }
     .followButton {
         margin-top: 20px;

+ 2 - 2
src/components/icss/TemplateMaintenance.vue

@@ -19,7 +19,7 @@
                 </el-form-item>
                 <el-form-item label="属于:">
                     <el-select size="mini" v-model="filter.ownTo" placeholder="属于" clearable>
-                        <el-option v-if="!!item.name" v-for="item in AdscriptionsOwnTo" :label="item.name" :value="item.id" :key="item.id" ></el-option>
+                        <el-option v-if="!!item.name" v-for="item in AdscriptionsOwnTo" :label="item.name" :value="item.conceptId" :key="item.conceptId" ></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item>
@@ -232,7 +232,7 @@
         // })
         Promise.all([
           api.getModuleInfoOne({moduleId:row.id}),
-          api.getModuleDetailInfo({moduleId:row.id})
+          api.getModuleDetailInfo({moduleId:row.id,type:row.type})
         ]).then((data)=>{
           let data0 = data[0].data;
           let data1 = data[1].data;