Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/knowledgeExtra_0521'

zhouna 4 gadi atpakaļ
vecāks
revīzija
069e13cbb1
38 mainītis faili ar 16742 papildinājumiem un 2945 dzēšanām
  1. 35 11
      package-lock.json
  2. 1 0
      package.json
  3. 6 0
      src/api/config.js
  4. 16 0
      src/api/icss.js
  5. 1103 286
      src/components/basicKnow/AddTerm.vue
  6. 46 50
      src/components/basicKnow/BasicTermsMaintenance.vue
  7. 137 0
      src/components/basicKnow/DivEditable.vue
  8. 241 0
      src/components/basicKnow/searchTerm.vue
  9. 1 1
      src/components/common/Crumbs.vue
  10. 294 241
      src/components/common/HomePage.vue
  11. 1617 375
      src/components/knowledgeExtra/AddDiagBase.vue
  12. 661 478
      src/components/knowledgeExtra/AddNewRule.vue
  13. 736 0
      src/components/knowledgeExtra/AddNewRuleTable.vue
  14. 245 0
      src/components/knowledgeExtra/AddZskRegisteredDrug.vue
  15. 426 382
      src/components/knowledgeExtra/DiagBase.vue
  16. 3 0
      src/components/knowledgeExtra/DiagBaseGroup.vue
  17. 430 366
      src/components/knowledgeExtra/DiagBaseItem.vue
  18. 149 140
      src/components/knowledgeExtra/DiagBaseType.vue
  19. 305 0
      src/components/knowledgeExtra/RegisteredDrug.vue
  20. 2 2
      src/components/knowledgeExtra/RuleManager.vue
  21. 0 449
      src/components/knowledgeExtra/SubConditions.vue
  22. 0 117
      src/components/knowledgeExtra/SubRulesGroup.vue
  23. 635 0
      src/components/knowledgeExtra/_AddNewRule.vue
  24. 635 0
      src/components/knowledgeExtra/_SubConditions.vue
  25. 129 0
      src/components/knowledgeExtra/_SubRulesGroup.vue
  26. 89 0
      src/components/knowledgeExtra/rules.js
  27. 125 0
      src/components/knowledgeExtra/table.vue
  28. BIN
      src/images/add-new-rule-del.png
  29. BIN
      src/images/add-new-rule-sub.png
  30. BIN
      src/images/icon-add.png
  31. BIN
      src/images/icon-collect-left.png
  32. BIN
      src/images/icon-collect-right.png
  33. BIN
      src/images/icon-copy.png
  34. BIN
      src/images/icon-delete.png
  35. BIN
      src/images/tips.png
  36. 56 45
      src/routes.js
  37. 2 2
      vue.config.js
  38. 8617 0
      yarn.lock

+ 35 - 11
package-lock.json

@@ -4836,7 +4836,8 @@
         "ansi-regex": {
           "version": "2.1.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -4857,12 +4858,14 @@
         "balanced-match": {
           "version": "1.0.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -4877,17 +4880,20 @@
         "code-point-at": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "concat-map": {
           "version": "0.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -5004,7 +5010,8 @@
         "inherits": {
           "version": "2.0.4",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "ini": {
           "version": "1.3.5",
@@ -5016,6 +5023,7 @@
           "version": "1.0.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -5030,6 +5038,7 @@
           "version": "3.0.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
@@ -5037,12 +5046,14 @@
         "minimist": {
           "version": "0.0.8",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "minipass": {
           "version": "2.9.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
@@ -5061,6 +5072,7 @@
           "version": "0.5.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -5150,7 +5162,8 @@
         "number-is-nan": {
           "version": "1.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -5162,6 +5175,7 @@
           "version": "1.4.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -5247,7 +5261,8 @@
         "safe-buffer": {
           "version": "5.1.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -5283,6 +5298,7 @@
           "version": "1.0.2",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
@@ -5302,6 +5318,7 @@
           "version": "3.0.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -5345,12 +5362,14 @@
         "wrappy": {
           "version": "1.0.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "yallist": {
           "version": "3.1.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         }
       }
     },
@@ -10742,6 +10761,11 @@
         }
       }
     },
+    "vue-fragment": {
+      "version": "1.5.2",
+      "resolved": "https://registry.npm.taobao.org/vue-fragment/download/vue-fragment-1.5.2.tgz",
+      "integrity": "sha1-MQAXFwxWTEqtldoUwYXJLGeE/Tw="
+    },
     "vue-hot-reload-api": {
       "version": "2.3.1",
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz",

+ 1 - 0
package.json

@@ -11,6 +11,7 @@
     "js-md5": "^0.7.3",
     "quill-image-extend-module": "^1.1.2",
     "vue": "^2.5.17",
+    "vue-fragment": "^1.5.2",
     "vue-quill-editor": "^3.0.6"
   },
   "eslintConfig": {

+ 6 - 0
src/api/config.js

@@ -585,6 +585,12 @@ export default {
     'ruleExportExcel':'/api/cdssman/test/rule/ruleExportExcel',
     'autoRuleTest':'/api/cdssman/test/rule/ruleTest',
     'clearDrug':'/api/cdssman/cache/clearDrug',
+    //药品维护
+    'getPageList': '/api/cdssman/klDrugRegister/getPage',
+    'getsearchDrug': '/api/cdssman/klDrugRegister/searchDrug',
+    'saveOrUpdate': '/api/cdssman/klDrugRegister/saveOrUpdate',
+    'getByParam': '/api/cdssman/klDrugRegister/getByParam',
+    'paramDelete': '/api/cdssman/klDrugRegister/delete',
   },
   menuIconList: { //菜单对应图标
     'YH-KZT': 'el-icon-menu',

+ 16 - 0
src/api/icss.js

@@ -421,4 +421,20 @@ export default {
     getDeptList(param) {    //医学术语命名维护-添加-获取科室
         return axios.post(urls.getDeptList,param)
     },
+
+    getPageList(param) {    //注册药品列表
+        return axios.post(urls.getPageList, param)
+    },
+    getsearchDrug(param) {    //药品关联通用名
+        return axios.post(urls.getsearchDrug, param)
+    },
+    saveOrUpdate(param) {    //药品保存
+        return axios.post(urls.saveOrUpdate, param)
+    },
+    getByParam(param) {    //药品详情
+        return axios.post(urls.getByParam, param)
+    },
+    paramDelete(param) {    //药品删除
+        return axios.post(urls.paramDelete, param)
+    },
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1103 - 286
src/components/basicKnow/AddTerm.vue


+ 46 - 50
src/components/basicKnow/BasicTermsMaintenance.vue

@@ -18,16 +18,16 @@
         <el-form-item label="同义词:">
           <el-input size="mini" v-model="filter.libName" placeholder="输入同义词"></el-input>
         </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
-                        <el-option
-                                v-for="item in stateSelect"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
+        <el-form-item label="状态:">
+          <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
+            <el-option
+              v-for="item in stateSelect"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <el-button size="mini" @click="filterDatas">确认</el-button>
         </el-form-item>
@@ -35,10 +35,7 @@
       <el-form class="secLine">
         <el-form-item>
           <el-button size="mini" type="warning" @click="addMedicalName" style="margin:0 10px">+ 新增术语</el-button>
-          <el-button
-            size="mini"
-            @click="reloadLib"
-          >更新数据</el-button>
+          <el-button size="mini" @click="reloadLib">更新数据</el-button>
         </el-form-item>
       </el-form>
     </crumbs>
@@ -57,17 +54,9 @@
         <el-table-column prop="gmtModified" label="操作时间" :show-overflow-tooltip="true"></el-table-column>
         <el-table-column label="操作" width="160">
           <template slot-scope="scope">
-            <el-button
-              type="text"
-              size="small"
-              @click="toEditProduct(scope.row)"
-            >修改</el-button>
+            <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
             <span style="margin:0 3px;">|</span>
-            <el-button
-              type="text"
-              size="small"
-              @click="toEditProduct(scope.row,true)"
-            >复制</el-button>
+            <el-button type="text" size="small" @click="toEditProduct(scope.row,true)">复制</el-button>
             <span style="margin:0 3px;">|</span>
             <el-button
               type="text"
@@ -102,9 +91,9 @@ export default {
   data: function() {
     return {
       list: [],
-      stateSelect:[
-          {id:'N',name:'启用'},
-          {id:'Y',name:'禁用'},
+      stateSelect: [
+        { id: 'N', name: '启用' },
+        { id: 'Y', name: '禁用' }
       ],
       // isState:'',
       cacheData: {}, //因为删除和恢复要及时更新,所以不做缓存
@@ -117,7 +106,7 @@ export default {
       filter: {
         term: '',
         type: '',
-        libName: '',
+        libName: ''
       },
       typeList: [],
       reloadFlag: true
@@ -125,18 +114,18 @@ export default {
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
-    
+
     this.getTypeList();
     //返回时避免参数未赋值就获取列表
-    this.$nextTick(()=>{
+    this.$nextTick(() => {
       this.getDataList();
-    })
+    });
   },
   watch: {
     filter: {
@@ -176,9 +165,9 @@ export default {
           this.getDataList();
           if (res.data.code == 0) {
             this.reloadFlag = true;
-              this.warning('更新成功','success');
-          }else{
-              this.warning(res.data.msg||'更新失败,请重试');
+            this.warning('更新成功', 'success');
+          } else {
+            this.warning(res.data.msg || '更新失败,请重试');
           }
         });
       }
@@ -204,7 +193,7 @@ export default {
       this.$router.push({
         name: 'AddTerm',
         // params: {info:row}
-        params: Object.assign(pam, { id: row.conceptId, copy: copy })
+        params: Object.assign(pam, { id: row.conceptId,libType:row.libType, copy: copy })
       });
     },
     filterDatas() {
@@ -220,14 +209,15 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       });
-      api.getBaseConceptInfoPage(param)
+      api
+        .getBaseConceptInfoPage(param)
         .then(res => {
           loading.close();
           if (res.data.code == '0') {
             const data = res.data.data;
             const templis = data.records;
-            for(let i = 0;i < templis.length;i++){
-              templis[i].isDeleted = templis[i].status=='1'?'N':'Y'
+            for (let i = 0; i < templis.length; i++) {
+              templis[i].isDeleted = templis[i].status == '1' ? 'N' : 'Y';
             }
             this.list = templis;
             // this.cacheData[param.current] = data.records;
@@ -244,11 +234,11 @@ export default {
     },
     getTypeList() {
       api
-        .baseTypeGetPage({ name: '',size: 1000 })
+        .baseTypeGetPage({ name: '', size: 1000 })
         .then(res => {
           const data = res.data;
           if (data.code == 0) {
-            this.typeList = data.data.records||[];
+            this.typeList = data.data.records || [];
           } else {
             console.log(res.msg);
           }
@@ -266,10 +256,15 @@ export default {
         this.clearFilter();
       }
       const param = {
-        "libName": this.filter.term.trim(),
-        "libType": this.filter.type,
-        "status": this.filter.isState=='N'?'1':this.filter.isState=='Y'?'0':'',
-        "synonymName": this.filter.libName.trim(),
+        libName: this.filter.term.trim(),
+        libType: this.filter.type,
+        status:
+          this.filter.isState == 'N'
+            ? '1'
+            : this.filter.isState == 'Y'
+            ? '0'
+            : '',
+        synonymName: this.filter.libName.trim(),
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
         isDeleted: this.filter.isState
@@ -313,7 +308,7 @@ export default {
       const param = {
         conceptId: item.conceptId
       };
-      let url = item.isDeleted === 'N'?'disableConcept':'startConcept'
+      let url = item.isDeleted === 'N' ? 'disableConcept' : 'startConcept';
       let waringTxt =
         item.isDeleted === 'N'
           ? '是否禁用该标准术语?'
@@ -332,7 +327,8 @@ export default {
               } else {
                 if (this.filter.isState !== '' && this.list.length === 1) {
                   //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
-                  this.currentPage = this.currentPage === 1 ? 1 : this.currentPage - 1;
+                  this.currentPage =
+                    this.currentPage === 1 ? 1 : this.currentPage - 1;
                 }
               }
               this.warning(res.data.msg || '操作成功', 'success');

+ 137 - 0
src/components/basicKnow/DivEditable.vue

@@ -0,0 +1,137 @@
+<template>
+  <div>
+    <span class="address-placeholder" v-show="onshow" @click="getfouce">{{title}}</span>
+    <div
+      class="test_box"
+      contenteditable="true"
+      v-html="innerText"
+      :ref="Maincontent"
+      @input="handleInput"
+      @blur="unblur"
+      @focus="changeColor"
+      @compositionstart="handleStart"
+      @compositionend="handleEnd"
+    ></div>
+  </div>
+</template>
+
+<script>
+// import { Fragment } from 'vue-fragment'
+export default {
+  name: 'DivEditable',
+  props: ['value', 'Maincontent','title'],
+  data() {
+    return {
+      innerText: this.value,
+      isChange: true,
+      composing: false,
+      onshow: true,
+    };
+  },
+  // components: { Fragment },
+  watch: {
+    value() {
+      if (this.isChange) {
+        this.innerText = this.value;
+      }
+    }
+  },
+  mounted() {
+    let len = this.value.length;
+    this.onshow = len > 0 ? false : true;
+  },
+  methods: {
+    changeColor(){
+      this.isChange = false
+      this.$refs[this.Maincontent].style.border = '1px solid #48C5D7'
+    },
+    unblur() {
+      this.$refs[this.Maincontent].style.border = '1px solid #dcdfe6'
+    },
+    getfouce() {
+       this.$refs[this.Maincontent].focus()
+    },
+    handleInput(event) {
+      let text = event.target.innerText;
+      let len = text.length;
+      this.onshow = len > 0 ? false : true;
+      this.valueHandle(event, text);
+      
+    },
+    valueHandle(event, strVale) {
+      let _this = this;
+      let text = strVale;
+      if (this.composing) {
+        return;
+      }
+      let len = text.length;
+      this.onshow = len > 0 ? false : true;
+      if (len > 200) {
+        this.$refs[this.Maincontent].innerHTML = text.substr(0, 200);
+        this.$refs[this.Maincontent].focus();
+      }
+      this.$emit('input', this.$refs[this.Maincontent].innerHTML);
+      setTimeout(() => {
+        _this.keepLastIndex(event.target);
+      }, 5);
+      // 拓展 如果想要只需要前100位数据
+      // this.content = this.content.substring(0, 100)
+    },
+    handleStart() {
+      this.composing = true;
+    },
+    /**
+     * 中文输入结束
+     */
+    handleEnd($event) {
+      this.composing = false;
+      let text = $event.target.innerHTML;
+      // console.log($event.target.innerHTML)
+      this.valueHandle($event, text);
+    },
+    keepLastIndex(obj) {
+      if (window.getSelection) {
+        // ie11 10 9 ff safari
+        obj.focus(); // 解决ff不获取焦点无法定位问题
+        let range = window.getSelection(); // 创建range
+        range.selectAllChildren(obj); // range 选择obj下所有子内容
+        range.collapseToEnd(); // 光标移至最后
+      } else if (document.selection) {
+        // ie10 9 8 7 6 5
+        let range = document.selection.createRange(); // 创建选择对象
+        // var range = document.body.createTextRange();
+        range.moveToElementText(obj); // range定位到obj
+        range.collapse(false); // 光标移至最后
+        range.select();
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.address-placeholder {
+  line-height: 42px;
+  height: 42px;
+  color: #a2a2a2;
+  position: absolute;
+  left: 16px;
+  top: 6px;
+  opacity: 0.7;
+  font-size: 14px;
+}
+.test_box {
+  min-height: 20px;
+  max-height: 300px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 1.5;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+  padding: 10px 15px;
+}
+</style>

+ 241 - 0
src/components/basicKnow/searchTerm.vue

@@ -0,0 +1,241 @@
+<template>
+  <div>
+    <div class="address-placeholder" v-show="!onshow && items.length == 0" @click="getfouce">请搜索</div>
+    
+    <div class="source" @click="getfouce" ref="source">
+      <div class="select">
+        <transition-group name="flip-list">
+          <span
+            v-for="(item,index) in items"
+            :key="item.conceptName"
+            draggable="true"
+            class="items"
+            @dragstart="dragstart(item)"
+            @dragenter="dragenter(item)"
+            @dragend="dragend(item)"
+          >
+            {{item.conceptName}}
+            <i class="el-icon-close" @click.stop="delTag(index)"></i>
+          </span>
+        </transition-group>
+        <input
+          class="inp"
+          @mousedown.stop
+          ref="inputVal"
+          @blur="unblur"
+          @focus="changeColor"
+          v-model="value"
+          @input="handleInput"
+        />
+      </div>
+      <ul class="list" v-if="conceptList.length>0 && onshow">
+        <li
+          @mousedown.prevent
+          class="item"
+          @click="getTag(item,index)"
+          v-for="(item,index) in conceptList"
+          :key="index"
+        >
+          {{item.conceptName}}
+          <img src />
+        </li>
+      </ul>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/knowledgeTree.js';
+export default {
+  name: 'searchTerm',
+  props: ['type', 'refbool', 'id'],
+  data() {
+    return {
+      conceptList: [],
+      oldNum: 0,
+      newNum: 0,
+      value: '',
+      items: [],
+      onshow: false
+    };
+  },
+  created() {
+    if (this.id != '') {
+      this.items = this.formatData(this.refbool);
+    }
+  },
+  watch: {
+    items(newVal, oldVal) {
+      // TO DO
+      let arr = [];
+      newVal.forEach(item => {
+        arr.push(item.conceptId);
+      });
+      this.$emit('update:refbool', arr);
+    }
+  },
+  methods: {
+    changeColor() {
+      this.$refs.source.style.border = '1px solid #48C5D7';
+    },
+    handleInput(event) {
+      let excludedConceptIds = [];
+      let text = event.target.innerText;
+      let len = text.length;
+      this.onshow = len > 0 ? false : true;
+      if (this.id == '') {
+        excludedConceptIds = [];
+      } else {
+        excludedConceptIds = [this.id];
+      }
+      const param = {
+        excludedConceptIds: excludedConceptIds,
+        libType: this.type,
+        name: this.value
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+            this.onshow = true;
+            this.items.forEach(item => {
+              this.conceptList = this.conceptList.filter(
+                it => it.conceptId !== item.conceptId
+              );
+            });
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getfouce() {
+      this.$refs.inputVal.focus();
+    },
+    getTag(item, index) {
+      var v = this.items.some(el => {
+        return el.conceptName == item.conceptName;
+      });
+      if (v) {
+        return;
+      }
+      this.conceptList.splice(index, 1);
+      this.items.push(item);
+      this.onshow = true;
+    },
+    delTag(index) {
+      this.items.splice(index, 1);
+    },
+    unblur() {
+      this.onshow = false;
+      this.conceptList = [];
+      this.value = '';
+      this.$refs.source.style.border = '1px solid #dcdfe6';
+    },
+    shuffle() {
+      this.items = _.shuffle(this.items);
+    },
+    // 记录初始信息
+    dragstart(value) {
+      this.oldNum = value;
+    },
+    // 做最终操作
+    dragend(value) {
+      if (this.oldNum != this.newNum) {
+        let oldIndex = this.items.indexOf(this.oldNum);
+        let newIndex = this.items.indexOf(this.newNum);
+        let newItems = [...this.items];
+        console.log(oldIndex);
+        // 删除老的节点
+        newItems.splice(oldIndex, 1);
+        // 在列表中目标位置增加新的节点
+        newItems.splice(newIndex, 0, this.oldNum);
+        // this.items一改变,transition-group就起了作用
+        this.items = [...newItems];
+      }
+    },
+    // 记录移动过程中信息
+    dragenter: function(value) {
+      this.newNum = value;
+    },
+    formatData(data) {
+      //转换字段名
+      let str = JSON.stringify(data)
+        .replace(/id/g, 'conceptId')
+        .replace(/libName/g, 'conceptName');
+      //console.log(JSON.parse(str))
+      return JSON.parse(str);
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.address-placeholder {
+  line-height: 42px;
+  height: 42px;
+  color: #a2a2a2;
+  position: absolute;
+  left: 16px;
+  top: 6px;
+  opacity: 0.7;
+  font-size: 14px;
+}
+.list {
+  width: 318px;
+  height: 200px;
+  position: absolute;
+  z-index: 1001;
+  border: 1px solid #e4e7ed;
+  border-radius: 4px;
+  background-color: #fff;
+  -webkit-box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  margin: 5px 0;
+  overflow-y: auto;
+  .item {
+    padding: 0 10px;
+  }
+  .item:hover {
+    background: #f5f7fa;
+  }
+}
+
+.source {
+  min-height: 40px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 40px;
+  padding: 0 16px;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+  .select {
+    .items {
+      height: 30px;
+      line-height: 30px;
+      font-size: 12px;
+      border-radius: 5px;
+      padding: 3px 4px;
+      background: #48c5d7;
+      margin: 0 5px;
+      display: inline-block;
+    }
+    .inp {
+      width: 80px;
+      height: 30px;
+      border: none;
+    }
+    .source:target {
+      border: 1px solid #51c9ff;
+    }
+  }
+}
+</style>

+ 1 - 1
src/components/common/Crumbs.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="container clearfix" :style="{'minWidth':minWidth?minWidth:'980px',position:fix?fix:'absolute'}">
+  <div class="container clearfix" :style="{'minWidth':minWidth?minWidth:'950px',position:fix?fix:'absolute'}">
     <img
       v-if="linkTo"
       class="return-btn fl"

+ 294 - 241
src/components/common/HomePage.vue

@@ -1,286 +1,339 @@
 <template>
-    <el-container :class="getRole">
-        <el-aside>
-            <div class="logo">
-                <p v-if="userLoginDTO&&userLoginDTO.type=='1'"><b>朗通后台管理系统</b></p>
-                <p v-if="userLoginDTO&&userLoginDTO.type=='0'"><b>DiagbotCloud</b></p>
-                <p v-if="userLoginDTO&&userLoginDTO.type=='0'"><b>后台管理系统</b></p>
-            </div>
-                 <lt-menu v-if="menuWrappers&&menuWrappers.length" v-bind:role="getRole"
-                 v-bind:data="menuWrappers"></lt-menu>
-            <div class="version">
-                <p>
-                    <span>版本信息:</span>
-                    <a href="javascript:void(0)" @click="showVersion">{{versionName}}</a>
-                    <i v-if="isNewV"><img src="../../images/new.png" alt=""/></i>
-                </p>
-            </div>
-        </el-aside>
-        <el-container>
-            <el-header class="clearfix">
-                <div class="title fl">
-                    <h2>{{organization&&organization.name}}</h2>
-                </div>
-                <div class="userInfo fr">
-                    <span class="username" @click="goCenter">{{userLoginDTO&&userLoginDTO.linkman}}</span>
-                    <lt-badge v-if="getRole=='user'" class="green" :authStatus="authStatus">
-                        {{authStatusName}}
-                    </lt-badge>
-                    <el-button type="info" size="small" plain @click="logout">退出</el-button>
-                </div>
-            </el-header>
-            <el-main>
-              <router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
-            </el-main>
-        </el-container>
-        <el-dialog
-                title="版本信息"
-                :visible.sync="versionVisible"
-                width="50%"
-                class="version-info">
-            <div v-html="versionInfo"></div>
-        </el-dialog>
+  <el-container :class="getRole">
+    <el-aside v-show="onshow">
+      <div class="logo">
+        <p v-if="userLoginDTO&&userLoginDTO.type=='1'">
+          <b>朗通后台管理系统</b>
+        </p>
+        <p v-if="userLoginDTO&&userLoginDTO.type=='0'">
+          <b>DiagbotCloud</b>
+        </p>
+        <p v-if="userLoginDTO&&userLoginDTO.type=='0'">
+          <b>后台管理系统</b>
+        </p>
+      </div>
+
+      <lt-menu
+        v-if="menuWrappers&&menuWrappers.length"
+        v-bind:role="getRole"
+        v-bind:data="menuWrappers"
+      ></lt-menu>
+      <div class="version">
+        <p>
+          <span>版本信息:</span>
+          <a href="javascript:void(0)" @click="showVersion">{{versionName}}</a>
+          <i v-if="isNewV">
+            <img src="../../images/new.png" alt />
+          </i>
+        </p>
+      </div>
+    </el-aside>
+    <img src="../../images/icon-collect-right.png" v-show="!onshow" class="collect" @click="collect" />
+    <img src="../../images/icon-collect-left.png" v-show="onshow" class="collect-left" @click="collect" />
+    <el-container>
+      <el-header class="clearfix">
+        <div class="title fl">
+          <h2>{{organization&&organization.name}}</h2>
+        </div>
+        <div class="userInfo fr">
+          <span class="username" @click="goCenter">{{userLoginDTO&&userLoginDTO.linkman}}</span>
+          <lt-badge v-if="getRole=='user'" class="green" :authStatus="authStatus">{{authStatusName}}</lt-badge>
+          <el-button type="info" size="small" plain @click="logout">退出</el-button>
+        </div>
+      </el-header>
+      <el-main>
+        <router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
+      </el-main>
     </el-container>
+    <el-dialog title="版本信息" :visible.sync="versionVisible" width="50%" class="version-info">
+      <div v-html="versionInfo"></div>
+    </el-dialog>
+  </el-container>
 </template>
 
 <script>
-  import LtMenu from '../common/Menu.vue';
-  import LtBadge from '@base/LtBadge.vue';
-  import api from '@api/index.js';
-  import userApi from '@api/user.js';
-  import Console from '@components/user/Console.vue';
-  import newIcon from '../../images/new.png';
-  export default {
-    name: 'homepage',
-    components: {
-      'lt-badge': LtBadge,
-      'lt-menu': LtMenu,
-      'console': Console
-    },
-    data: function () {
-      return {
-        menuWrappers: null,
-        organization: null,
-        userLoginDTO: null,
-        authStatus: null,
-        authStatusName:'',
-        ok:false,           //是否已获取到菜单
-        versionName:'',
-        versionVisible:false,
-        versionInfo:'',
-        isNewV:false,
-        version:null,       //版本信息接口返回的数据
+import LtMenu from '../common/Menu.vue';
+import LtBadge from '@base/LtBadge.vue';
+import api from '@api/index.js';
+import userApi from '@api/user.js';
+import Console from '@components/user/Console.vue';
+import newIcon from '../../images/new.png';
+export default {
+  name: 'homepage',
+  components: {
+    'lt-badge': LtBadge,
+    'lt-menu': LtMenu,
+    console: Console
+  },
+  data: function() {
+    return {
+      menuWrappers: null,
+      organization: null,
+      userLoginDTO: null,
+      authStatus: null,
+      authStatusName: '',
+      ok: false, //是否已获取到菜单
+      versionName: '',
+      versionVisible: false,
+      versionInfo: '',
+      isNewV: false,
+      version: null, //版本信息接口返回的数据
+      onshow: true
+    };
+  },
+  computed: {
+    getRole: function() {
+      return this.userLoginDTO && this.userLoginDTO.type == '0'
+        ? 'user'
+        : 'admin';
+    }
+  },
+  created() {
+    //获取菜单
+    this.getMenuList();
+  },
+  watch: {
+    $route: function(to, from) {
+      if (from.name == 'login') {
+        this.getMenuList();
       }
-    },
-    computed: {
-      getRole: function () {
-        return this.userLoginDTO && this.userLoginDTO.type == '0' ? 'user' : 'admin';
+      if (to.path == '/') {
+        // 退出时清空菜单
+        this.menuWrappers = [];
+        this.isNewV = false;
       }
+    }
+  },
+  methods: {
+    collect() {
+      this.onshow = !this.onshow;
     },
-    created () {
-      //获取菜单
-      this.getMenuList();
-    },
-    watch:{
-      '$route': function(to,from){
-            if(from.name=='login'){
-              this.getMenuList();
-            }
-            if(to.path=='/'){       // 退出时清空菜单
-              this.menuWrappers=[];
-              this.isNewV = false;
-            }
-        }
-    },
-    methods: {
-      getMenuList(){
-        api.getAccessdMenu().then((res) => {
+    getMenuList() {
+      api
+        .getAccessdMenu()
+        .then(res => {
           if (res.data.code == '0') {
             const data = res.data.data;
             this.ok = true;
-            const hasConcole=data.menuWrappers.find((it)=>{
-              return it.code.indexOf('-KZT')>-1;
+            const hasConcole = data.menuWrappers.find(it => {
+              return it.code.indexOf('-KZT') > -1;
             });
             //this.hasConcole = hasConcole!=-1;
             this.menuWrappers = data.menuWrappers;
             this.organization = data.organization;
             this.userLoginDTO = data.userLoginDTO;
-            localStorage.setItem('userLoginDTO', JSON.stringify(data.userLoginDTO));
-            this.getRole=='user' && this.getAuthStatus();
-            if(hasConcole){
-              const url = this.getRole=='user'?'/user/YH-KZT':'/admin/LT-KZT';
-              this.$router.push({path:url});
+            localStorage.setItem(
+              'userLoginDTO',
+              JSON.stringify(data.userLoginDTO)
+            );
+            this.getRole == 'user' && this.getAuthStatus();
+            if (hasConcole) {
+              const url =
+                this.getRole == 'user' ? '/user/YH-KZT' : '/admin/LT-KZT';
+              this.$router.push({ path: url });
             }
             this.getVersionInfo();
           }
-        }).catch((error) => {
+        })
+        .catch(error => {
           console.log(error);
         });
-      },
-      isNewVersion(){           //判断是否为新版
-
-      },
-      getVersionInfo(){
-        const getInfo = this.getRole=='user'?api.getVersionOuter:api.getVersionInner;
-        getInfo().then((res)=>{
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            this.fillVersionInfo(data);
-          }else{
-            this.$message(res.data.msg);
-          }
-        });
-      },
-      fillVersionInfo(data){
-        //进入时获取版本信息,如版本时间与localStorage中不一致或者一致但localStorage中未被点过,
-        // 则要显示更新图标
-        let htl = data.refreshTime?'<h3>当前版本:'+data.name+'<span>'+data.refreshTime.substr(0,10)+'</span></h3>':'<h3>当前版本:'+data.name+'</h3>';
-        let prags = data.detail||[];
-        this.versionName = data.name;
-        const versionTime = JSON.parse(localStorage.getItem('versionInfo-'+this.userLoginDTO.username));
-        if(!versionTime||(data.refreshTime===versionTime.date&&!versionTime.showed)){
-          this.isNewV = true;
-        }else{
-          this.isNewV = false
-        }
-        for(let i=0;i<prags.length;i++){
-            htl += '<p>'+prags[i].title+'</p><p>'+prags[i].description+'</p>';
+    },
+    isNewVersion() {
+      //判断是否为新版
+    },
+    getVersionInfo() {
+      const getInfo =
+        this.getRole == 'user' ? api.getVersionOuter : api.getVersionInner;
+      getInfo().then(res => {
+        if (res.data.code == '0') {
+          const data = res.data.data;
+          this.fillVersionInfo(data);
+        } else {
+          this.$message(res.data.msg);
         }
-        this.versionInfo = htl;
-        this.version = {date:data.refreshTime};
-      },
-      showVersion(){
-        this.versionVisible = true;
-        this.version.showed = true;
+      });
+    },
+    fillVersionInfo(data) {
+      //进入时获取版本信息,如版本时间与localStorage中不一致或者一致但localStorage中未被点过,
+      // 则要显示更新图标
+      let htl = data.refreshTime
+        ? '<h3>当前版本:' +
+          data.name +
+          '<span>' +
+          data.refreshTime.substr(0, 10) +
+          '</span></h3>'
+        : '<h3>当前版本:' + data.name + '</h3>';
+      let prags = data.detail || [];
+      this.versionName = data.name;
+      const versionTime = JSON.parse(
+        localStorage.getItem('versionInfo-' + this.userLoginDTO.username)
+      );
+      if (
+        !versionTime ||
+        (data.refreshTime === versionTime.date && !versionTime.showed)
+      ) {
+        this.isNewV = true;
+      } else {
         this.isNewV = false;
-        localStorage.setItem('versionInfo-'+this.userLoginDTO.username,JSON.stringify(this.version));
-      },
-      /*redirectPage(){
+      }
+      for (let i = 0; i < prags.length; i++) {
+        htl +=
+          '<p>' + prags[i].title + '</p><p>' + prags[i].description + '</p>';
+      }
+      this.versionInfo = htl;
+      this.version = { date: data.refreshTime };
+    },
+    showVersion() {
+      this.versionVisible = true;
+      this.version.showed = true;
+      this.isNewV = false;
+      localStorage.setItem(
+        'versionInfo-' + this.userLoginDTO.username,
+        JSON.stringify(this.version)
+      );
+    },
+    /*redirectPage(){
         const url = this.getRole=='user'?'/user':'/admin';
         this.$router.push({path:url});
       },*/
-      changeStatus(text){       //账号信息中提交认证后修改状态
-        this.authStatus = 2;
-        this.authStatusName = text;
-      },
-      goCenter(){
-        const url = this.getRole=='user'?'':'/admin/LT-GRZX';
-        this.$router.push({path:url});
-      },
-      getAuthStatus() {
-        //获取用户认证状态
-        userApi.getUserAuthStatus().then((res) => {
+    changeStatus(text) {
+      //账号信息中提交认证后修改状态
+      this.authStatus = 2;
+      this.authStatusName = text;
+    },
+    goCenter() {
+      const url = this.getRole == 'user' ? '' : '/admin/LT-GRZX';
+      this.$router.push({ path: url });
+    },
+    getAuthStatus() {
+      //获取用户认证状态
+      userApi
+        .getUserAuthStatus()
+        .then(res => {
           if (res.data.code == '0') {
             const data = res.data.data;
             // this.authStatus = data[0];
             this.authStatusName = data.authStatusName;
             this.authStatus = data.authStatus;
           }
-        }).catch((error) => {
-          console.log(error)
+        })
+        .catch(error => {
+          console.log(error);
         });
-      },
-      logout(){//退出
-        localStorage.removeItem('token');
-        localStorage.removeItem('menuPath');
-        this.$router.push({path:'/'});
-      }
+    },
+    logout() {
+      //退出
+      localStorage.removeItem('token');
+      localStorage.removeItem('menuPath');
+      this.$router.push({ path: '/' });
     }
   }
+};
 </script>
 
 <style lang="less">
+@import '../../less/common.less';
+.collect {
+  width: 36px;
+  height: 32px;
+  position: fixed;
+  left: 0;
+  top: 70%;
+  z-index: 20;
+}
+.collect-left{
+  width: 36px;
+  height: 32px;
+  position: fixed;
+  left:calc(20% - 36px); 
+  top: 65%;
+  z-index: 20;
+}
+.user .el-menu-item.is-active {
+  color: @userBase;
+}
 
-    @import '../../less/common.less';
-
-    .user .el-menu-item.is-active {
-        color: @userBase;
-    }
-
-    .admin .el-menu-item.is-active {
-        color: @adminBase;
-    }
-    .admin .username{
-        cursor: pointer;
-    }
-    .version-info h3{
-        font-size: 14px;
-        margin-bottom: 20px;
-        span{
-            float: right;
-            font-weight: normal;
-        }
-    }
+.admin .el-menu-item.is-active {
+  color: @adminBase;
+}
+.admin .username {
+  cursor: pointer;
+}
+.version-info h3 {
+  font-size: 14px;
+  margin-bottom: 20px;
+  span {
+    float: right;
+    font-weight: normal;
+  }
+}
 </style>
 <style lang="less" scoped>
-    @import '../../less/common.less';
-    .el-menu-vertical-demo.el-menu{
-        height: calc(100% - 120px);
-        overflow-y: auto;
-    }
-    .version{
-        position: fixed;
-        bottom: 0;
-        width: @aside-width;
-        min-width: 270px;
-        font-size: 12px;
-        /*text-indent: 50px;*/
-        text-align: center;
-        height:54px;
-        line-height: 54px;
-        background: #fff;
-        i{
-            display: inline-block;
-            width: 20px;
-            height: 16px;
-            img{
-                vertical-align: text-top;
-            }
-        }
-    }
-    .user .version a{
-        color: @userBase;
-    }
-    .admin .version a{
-        color: @adminBase;
-    }
-    .user .logo {
-        background: @userBase;
-
-    p {
-        font-size: 16px;
-        line-height: normal
+@import '../../less/common.less';
+.el-menu-vertical-demo.el-menu {
+  height: calc(100% - 120px);
+  overflow-y: auto;
+}
+.version {
+  position: fixed;
+  bottom: 0;
+  width: @aside-width;
+  min-width: 270px;
+  font-size: 12px;
+  /*text-indent: 50px;*/
+  text-align: center;
+  height: 54px;
+  line-height: 54px;
+  background: #fff;
+  i {
+    display: inline-block;
+    width: 20px;
+    height: 16px;
+    img {
+      vertical-align: text-top;
     }
+  }
+}
+.user .version a {
+  color: @userBase;
+}
+.admin .version a {
+  color: @adminBase;
+}
+.user .logo {
+  background: @userBase;
 
-    }
-    .admin .logo {
-        background: @adminBase;
-
-    p {
-        font-size: 18px;
-        line-height: 40px;
-    }
-
-    }
-    .title {
-
-    h2 {
-        display: inline-block;
-        line-height: 60px;
-        font-size: 18px;
-    }
+  p {
+    font-size: 16px;
+    line-height: normal;
+  }
+}
+.admin .logo {
+  background: @adminBase;
 
-    }
-    .block {
-        height: 40px;
-        width: 100%;
-        background: #fff;
-        box-shadow: 0px 1px 2px #c9c9c9;
-    }
-		.el-main{
-			padding: 0;
-		}
-    .el-button{
-      margin-left: 15px;
-    }
+  p {
+    font-size: 18px;
+    line-height: 40px;
+  }
+}
+.title {
+  h2 {
+    display: inline-block;
+    line-height: 60px;
+    font-size: 18px;
+  }
+}
+.block {
+  height: 40px;
+  width: 100%;
+  background: #fff;
+  box-shadow: 0px 1px 2px #c9c9c9;
+}
+.el-main {
+  padding: 0;
+}
+.el-button {
+  margin-left: 15px;
+}
 </style>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1617 - 375
src/components/knowledgeExtra/AddDiagBase.vue


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 661 - 478
src/components/knowledgeExtra/AddNewRule.vue


+ 736 - 0
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -0,0 +1,736 @@
+<style lang="less" scoped>
+.AddNewRuleTable {
+  width: 100%;
+  background: #fff;
+  margin-top: 10px;
+  padding: 20px;
+  box-sizing: border-box;
+  /deep/ .el-input--mini .el-input__inner,
+  .el-select {
+    width: 100%;
+  }
+  .btn_box {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    .btn_div {
+      flex: 1;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    img {
+      width: 16px;
+      height: 16px;
+      cursor: pointer;
+    }
+  }
+  .inp_box {
+    // width: 100px;
+    height: 100%;
+    margin: 0 auto;
+  }
+  /deep/ .el-form-item__error {
+    // position: absolute;
+    top: 28px;
+  }
+  .type_content {
+    /deep/ .el-form-item--mini.el-form-item,
+    .el-form-item--small.el-form-item {
+      margin: 0;
+      width: 100%;
+    }
+    display: flex;
+    .type_content_item1 {
+      /deep/ .el-form-item__content {
+        padding-bottom: 8px;
+      }
+      .row_box {
+        .el-col {
+          /deep/ .el-form-item__content {
+            position: static;
+          }
+          /deep/ .el-form-item__error {
+            position: absolute;
+            width: 260px;
+            left: 72px;
+            white-space: normal;
+          }
+        }
+      }
+    }
+    /deep/ .el-input.is-disabled .el-input__inner {
+      color: #888;
+    }
+  }
+  .custom_table_header {
+    vertical-align: middle;
+    &::before {
+      content: "*";
+      color: red;
+      font-size: 12px;
+      margin-right: 4px;
+    }
+  }
+  ::v-deep .el-table tbody tr:hover > td {
+    background-color: transparent;
+  }
+  /deep/ .el-table th {
+    background: transparent;
+  }
+  /deep/ .el-form-item__content {
+    padding-bottom: 14px;
+  }
+  .table_cell_cls {
+    vertical-align: top;
+  }
+  /deep/ .el-table__body .el-table__row.hover-row td {
+    background-color: transparent;
+  }
+  /deep/ .el-form-item__label {
+    font-size: 12px;
+  }
+  h4 {
+    font-size: 14px;
+    font-weight: 400;
+  }
+}
+</style>
+
+<template>
+  <!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
+  <div class="AddNewRuleTable">
+    <h4 style="margin-bottom: 24px">规则内容:</h4>
+    <el-table
+      border
+      :data="klRuleByIdSub"
+      size="mini"
+      style="min-height: 200px"
+      height="calc(100vh - 403px)"
+      :row-style="rowStyle"
+      :header-row-style="{ background: '#E3EAF4' }"
+      :cell-style="cellStyle"
+      :span-method="ObjectSpanMethod"
+      ref="table"
+    >
+      <el-table-column width="80px" label="组" prop="groupType" fixed="left">
+        <template slot-scope="scope">
+          <div class="btn_box">
+            <div class="btn_div">
+              <img
+                @click="addGroup(scope)"
+                src="../../images/add-new-rule-sub.png"
+                alt=""
+              />
+            </div>
+            <div class="btn_div" v-if="!isLastDate(scope.row.groupId)">
+              <img
+                @click="$emit('delGroup', scope.row.groupId)"
+                src="../../images/add-new-rule-del.png"
+                alt=""
+              />
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        width="80px"
+        v-if="maxNum && maxNum > 1"
+        fixed="left"
+        label="基础规则"
+        prop="groupType"
+      >
+        <template slot-scope="scope">
+          <div class="btn_box">
+            <div class="btn_div" v-if="!isMax(scope.row.groupId)">
+              <img
+                @click="addChildGroup(scope)"
+                src="../../images/add-new-rule-sub.png"
+                alt=""
+              />
+            </div>
+            <div
+              class="btn_div"
+              v-if="klRuleByIdSub.length > 1 && !scope.row.disabled"
+            >
+              <img
+                @click="$emit('delGroupChild', scope.row.groupChildId)"
+                src="../../images/add-new-rule-del.png"
+                alt=""
+              />
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column width="170px" prop="subDescription">
+        <template slot="header">
+          <div class="custom_table_header">基础规则名称</div>
+        </template>
+        <template slot-scope="scope">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subDescription`"
+            :rules="rules.subDescription"
+          >
+            <el-input
+              type="text"
+              :disabled="scope.row.disabled"
+              v-model="scope.row.subDescription"
+              clearable
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column width="170px" prop="subType">
+        <template slot="header">
+          <div class="custom_table_header">基础规则类型</div>
+        </template>
+        <template slot-scope="scope">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subType`"
+            :rules="rules.subType"
+          >
+            <el-select
+              v-model="scope.row.subType"
+              :disabled="scope.row.disabled"
+              placeholder="请选择"
+              @change="subTypeChange($event, scope.$index)"
+            >
+              <el-option
+                v-for="item in scope.row.baseTypes"
+                :key="item.id"
+                :label="item.name"
+                :value="item.type"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column width="170px" prop="subLenCode">
+        <template slot="header">
+          <div class="custom_table_header">基础规则术语类型</div>
+        </template>
+        <template slot-scope="scope">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subLenCode`"
+            :rules="rules.subLenCode"
+          >
+            <el-select
+              :disabled="scope.row.disabled"
+              v-model="scope.row.subLenCode"
+              placeholder="请选择"
+              @change="subCodeChange($event, scope.$index)"
+            >
+              <el-option
+                v-for="item in scope.row.baseTermTypeList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.code"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column width="170px" label="医学标准术语" prop="subConceptId">
+        <template slot="header">
+          <div class="custom_table_header">医学标准术语</div>
+        </template>
+        <template slot-scope="scope">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subConceptId`"
+            :rules="rules.subConceptId"
+          >
+            <el-select
+              clearable
+              remote
+              filterable
+              :disabled="scope.row.disabled"
+              @focus="subConceptIdfocus(scope.$index)"
+              :remote-method="searchConcept"
+              v-model.trim="scope.row.subConceptId"
+            >
+              <el-option
+                v-for="item in scope.row.conceptList"
+                :key="item.conceptId"
+                :label="item.conceptName"
+                :value="item.conceptId"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column label="规则具体内容" min-width="900px" prop="">
+        <template slot-scope="scope">
+          <div class="type_content">
+            <el-form-item
+              style="width: 100px; margin-right: 20px"
+              :prop="`klRuleByIdSub[${scope.$index}].dataType`"
+              :rules="rules.dataType"
+              v-if="scope.row.subType === 2 && showDataType(scope.$index)"
+            >
+              <el-select
+                v-model="scope.row.dataType"
+                placeholder="选择类型"
+                @change="dataTypeChange($event, scope.$index)"
+              >
+                <el-option label="数值类型" value="1"> </el-option>
+                <el-option label="文本类型" value="2"> </el-option>
+              </el-select>
+            </el-form-item>
+            <!-- v-if="klRuleByIdSub[scope.$index].dataType === '1'" -->
+            <el-form-item
+              class="type_content_item type_content_item1"
+              style="flex: 2; margin: 0 10px"
+              label="最大值:"
+              v-if="scope.row.dataType === '1'"
+            >
+              <!-- <div> -->
+              <el-row :gutter="10" class="row_box">
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMaxOperator(scope, rule, value, callback);
+                        },
+                        trigger: ['blur']
+                      }
+                    ]"
+                  >
+                    <el-select
+                      v-model="scope.row.subMaxOperator"
+                      placeholder="请选择"
+                      clearable
+                    >
+                      <el-option
+                        v-for="item in operMaxList"
+                        :key="item.key"
+                        :label="item.name"
+                        :value="item.key"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMaxValue`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMaxValue(scope, rule, value, callback);
+                        },
+                        trigger: ['blur']
+                      }
+                    ]"
+                  >
+                    <el-input
+                      type="text"
+                      v-model="scope.row.subMaxValue"
+                      placeholder="填写数值"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMaxUnit`"
+                    :rules="rules.subMaxUnit"
+                  >
+                    <el-input
+                      type="text"
+                      v-model.trim="scope.row.subMaxUnit"
+                      placeholder="填写单位"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <!-- </div> -->
+            </el-form-item>
+            <el-form-item
+              class="type_content_item type_content_item1"
+              style="flex: 2"
+              label="最小值:"
+              v-if="scope.row.dataType === '1'"
+            >
+              <el-row :gutter="10" class="row_box">
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMinOperator`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMinOperatorRule(scope, rule, value, callback);
+                        },
+                        trigger: ['blur']
+                      }
+                    ]"
+                  >
+                    <el-select
+                      v-model="scope.row.subMinOperator"
+                      placeholder="请选择"
+                      clearable
+                    >
+                      <el-option
+                        v-for="item in operMinList"
+                        :key="item.name"
+                        :label="item.name"
+                        :value="item.name"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMinValueRule(scope, rule, value, callback);
+                        },
+                        trigger: ['blur']
+                      }
+                    ]"
+                  >
+                    <el-input
+                      type="text"
+                      v-model="scope.row.subMinValue"
+                      placeholder="填写数值"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
+                    :rules="rules.subMinUnit"
+                  >
+                    <el-input
+                      type="text"
+                      v-model.trim="scope.row.subMinUnit"
+                      placeholder="填写单位"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <!-- v-if="klRuleByIdSub[scope.$index].subType !== 6 && klRuleByIdSub[scope.$index].dataType === '2'" -->
+            <el-form-item
+              class="type_content_item"
+              style="flex: 2"
+              v-if="scope.row.subType !== 6 && scope.row.dataType === '2'"
+              label="医学内容:"
+              label-width="100px"
+              :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
+              :rules="[
+                {
+                  required: true,
+                  message: '请输入' + textName(scope.$index),
+                  trigger: 'blur'
+                },
+                {
+                  validator: (rule, value, callback) => {
+                    subEqValue(scope, rule, value, callback);
+                  },
+                  trigger: 'blur'
+                }
+              ]"
+            >
+              <el-input
+                type="textarea"
+                rows="1"
+                placeholder="请输入医学内容"
+                v-model.trim="scope.row.subEqValue"
+              ></el-input>
+            </el-form-item>
+            <!-- v-if="groupData.subType === 6" -->
+            <el-form-item
+              class="type_content_item"
+              label="正则表达式:"
+              label-width="120px"
+              style="flex: 2"
+              v-if="scope.row.subType === 6"
+              :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
+              :rules="[
+                {
+                  required: true,
+                  message: '请输入' + textName(scope.$index),
+                  trigger: 'blur'
+                },
+                {
+                  validator: (rule, value, callback) => {
+                    subEqValue(scope, rule, value, callback);
+                  },
+                  trigger: 'blur'
+                }
+              ]"
+            >
+              <el-input
+                type="textarea"
+                rows="1"
+                placeholder="请输入正则表达式"
+                v-model.trim="scope.row.subEqValue"
+              ></el-input>
+            </el-form-item>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import api from "@api/knowledgeLib.js";
+import { tableRules } from "./rules";
+export default {
+  name: "AddNewRuleTable",
+  data() {
+    return {
+      numTypes: "",
+      subConceptIdIndex: "",
+      operMaxList: [
+        { name: "<=", key: "<=" },
+        { name: "<", key: "<" }
+      ],
+      operMinList: [
+        { name: ">", key: ">" },
+        { name: ">=", key: ">=" }
+      ],
+      rules: tableRules
+    };
+  },
+  methods: {
+    addGroup(scope) {
+      this.$emit("addGroup", null, { groupId: scope.row.groupId });
+      this.$refs.table.bodyWrapper.scrollLeft = 0;
+    },
+    addChildGroup(scope) {
+      this.$emit("addGroup", scope.row.groupId, { index: scope.$index });
+      this.$refs.table.bodyWrapper.scrollLeft = 0;
+    },
+    // table 隔行换色
+    rowStyle({ row }) {
+      if (row.rowIndex % 2 == 0) {
+        return {
+          background: "#DFF7EF"
+        };
+      }
+    },
+    // cellStyle
+    cellStyle({ row, column, rowIndex, columnIndex }) {
+      if (column.label == "组" || column.label == "基础规则") return {};
+      return { "vertical-align": "top", "padding-top": "14px" };
+    },
+    // 最大值 选择rule
+    subMaxOperator(scope, rule, value, callback) {
+      const { subMaxValue, subMinOperator, subMinValue } = scope.row;
+      const val = value + subMinOperator + subMinValue + subMaxValue;
+      if (!val || (!value && subMaxValue !== "")) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else {
+        callback();
+      }
+    },
+    // 最大值 数值rule
+    subMaxValue(scope, rule, value, callback) {
+      const { subMaxOperator, subMinOperator, subMinValue } = scope.row;
+      const val = value + subMaxOperator + subMinValue + subMinOperator;
+      const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+      if (!val || (value == "" && subMaxOperator)) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else if (value !== "" && !isNum) {
+        callback(new Error("只能输入数字"));
+      } else {
+        callback();
+      }
+    },
+    // 最小值 选择rule
+    subMinOperatorRule(scope, rule, value, callback) {
+      const { subMaxValue, subMaxOperator, subMinValue } = scope.row;
+      const val = value + subMaxOperator + subMinValue + subMaxValue;
+      if (!val || (!value && subMinValue !== "")) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else {
+        callback();
+      }
+    },
+    // 最小值 数值rule
+    subMinValueRule(scope, rule, value, callback) {
+      const { subMaxValue, subMinOperator, subMaxOperator } = scope.row;
+      const val = value + subMaxOperator + subMaxValue + subMinOperator;
+      const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+      if (!val || (value == "" && subMinOperator)) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else if (value !== "" && !isNum) {
+        callback(new Error("只能输入数字"));
+      } else {
+        callback();
+      }
+    },
+    // 医学内容rule
+    subEqValue(scope, rule, value, callback) {
+      if (value === "") {
+        callback(new Error("请输入" + this.textName(scope.$index)));
+      } else if (value.length > 200) {
+        callback(new Error(this.textName(scope.$index) + "不能超过200字"));
+      } else {
+        callback();
+      }
+    },
+    // 判断是否为最后一条规则
+    isLastDate(id) {
+      const tableLength = this.klRuleByIdSub.filter(
+        (item) => item.groupId !== id
+      ).length;
+      return tableLength === 0;
+    },
+    // 是否超出最大规则数
+    isMax(id) {
+      const typeNum = this.klRuleByIdSub.filter((item) => item.groupId === id)
+        .length;
+      return typeNum >= this.maxNum;
+    },
+    // 基础规则类型选择
+    subTypeChange(e, index) {
+      this.$emit("subTypeChange", e, index);
+    },
+    // 规则术语类型
+    subCodeChange(val, index) {
+      //基础规则术语类型修改
+      if ((this.numTypes + ",").indexOf(val + ",") > -1) {
+        this.klRuleByIdSub[index].dataType = "1";
+      } else {
+        this.klRuleByIdSub[index].dataType = "";
+      }
+      this.clearConcept(index);
+      this.clearNumText(index);
+    },
+    clearConcept(index) {
+      this.klRuleByIdSub[index].subConceptId = "";
+      this.klRuleByIdSub[index].conceptList = [];
+    },
+    clearNumText(index) {
+      this.klRuleByIdSub[index].subMaxOperator = "";
+      this.klRuleByIdSub[index].subMaxValue = "";
+      this.klRuleByIdSub[index].subMaxUnit = "";
+      this.klRuleByIdSub[index].subMinOperator = "";
+      this.klRuleByIdSub[index].subMinValue = "";
+      this.klRuleByIdSub[index].subMinUnit = "";
+      this.klRuleByIdSub[index].subEqValue = "";
+      this.klRuleByIdSub[index].subEqOperator = "";
+    },
+    //医学标准术语change
+    subConceptIdfocus(index) {
+      this.subConceptIdIndex = "";
+      this.subConceptIdIndex = index;
+    },
+    // 医学标准术语
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [
+          this.klRuleByIdSub[this.subConceptIdIndex].subType
+        ],
+        libType: this.klRuleByIdSub[this.subConceptIdIndex].subLenCode,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then((res) => {
+          if (res.data.code == "0") {
+            const data = res.data.data;
+            this.$emit("setFormData", this.subConceptIdIndex, data);
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+    dataTypeChange(val, index) {
+      this.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
+      this.clearNumText(index);
+      delete this.klRuleByIdSub[index].dataType; //触发更新
+      this.$set(this.klRuleByIdSub[index], "dataType", val);
+    },
+    // 处理要合并相同行的列
+    getSpanArr(data) {
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          // 如果是第一条记录(即索引是0的时候),向数组中加入1
+          /** *
+           * 例子:
+           * name:1
+           * name:1
+           * name:2
+           * name:2
+           * 最终结果:spanArr = [2,0,2,0]
+           */
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          if (data[i].groupId === data[i - 1].groupId) {
+            // 如果remark相等就累加,并且push 0
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            // 不相等push 1,并且pos 要换成当前下标
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+        }
+      }
+    },
+    // 合并单元格
+    ObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex == 0) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    showDataType(index) {
+      return (
+        (this.numTypes + ",").indexOf(
+          this.klRuleByIdSub[index].subLenCode + ","
+        ) === -1
+      );
+    },
+    textName(index) {
+      return this.klRuleByIdSub[index].subType !== 6 &&
+        this.klRuleByIdSub[index].dataType === "2"
+        ? "医学内容"
+        : "正则表达式";
+    }
+  },
+  components: {},
+  created() {
+    this.numTypes = localStorage.getItem("zskNumDict");
+    this.getSpanArr(this.klRuleByIdSub);
+  },
+  beforeUpdate() {
+    this.getSpanArr(this.klRuleByIdSub);
+  },
+  props: {
+    klRuleByIdSub: {
+      type: Array,
+      required: true
+    },
+    maxNum: {
+      default: null
+    }
+  }
+};
+</script>
+

+ 245 - 0
src/components/knowledgeExtra/AddZskRegisteredDrug.vue

@@ -0,0 +1,245 @@
+<template>
+  <div style="min-height:100%" ref="viewBox">
+    <crumbs :title="title" :param="$route.params" linkTo="ZskRegisteredDrug"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <el-form
+          :inline="true"
+          ref="formInline"
+          :rules="rules"
+          :model="formInline"
+          class="demo-form-inline"
+          label-width="100px"
+        >
+          <el-form-item label="药品代码:" prop="drugCode">
+            <el-input v-model.trim="formInline.drugCode" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="最小包装单位:">
+            <el-input v-model.trim="formInline.minPackUnit" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="注册名称:" prop="name">
+            <el-input v-model.trim="formInline.name" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品企业:">
+            <el-input v-model.trim="formInline.company" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="英文名称:">
+            <el-input v-model.trim="formInline.enName" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="批准文号:">
+            <el-input v-model.trim="formInline.approval" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="商品名称:">
+            <el-input v-model.trim="formInline.tradeName" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品本位码:">
+            <el-input v-model.trim="formInline.standardCode" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品剂型:">
+            <el-input v-model.trim="formInline.form" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="医保类型:">
+            <el-input v-model.trim="formInline.insuranceType" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="注册规格:">
+            <el-input v-model.trim="formInline.specification" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="医保备注:">
+            <el-input v-model.trim="formInline.insuranceRemrk" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="最小包装数量:">
+            <el-input v-model.trim="formInline.minPackQuantity" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品类别:">
+            <el-input v-model.trim="formInline.drugType" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="关联通用名:">
+            <el-select
+              clearable
+              remote
+              filterable
+              @focus="getfocus"
+              :remote-method="searchConcept"
+              v-model.trim="formInline.drugConceptId"
+            >
+              <el-option
+                v-for="item in conceptList"
+                :key="item.id"
+                :label="item.libName"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div class="Butn">
+          <el-button class="disclButn" size="small" type="primary" @click="confirm">确定</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'AddZskDiagBase',
+  data() {
+    return {
+      formInline: {
+        id: '',
+        drugCode: '', //药品代码
+        name: '', //注册名称
+        enName: '', //英文名称
+        tradeName: '', //商品名称
+        form: '', //药品剂型
+        specification: '', //注册规格
+        minPackQuantity: '', //最小包装数量
+        minPackUnit: '', //最小包装单位
+        company: '', //药品企业
+        approval: '', //批准文号
+        standardCode: '', //药品本位码
+        insuranceType: '', //医保类型
+        insuranceRemrk: '', //医保备注
+        drugType: '', //药品类别
+        drugConceptId: '' //药品通用名Id
+      },
+      rules: {
+        drugCode: [
+          { required: true, message: '请输入药品代码', trigger: 'blur' }
+        ],
+        name: [{ required: true, message: '请输入注册名称', trigger: 'change' }]
+      },
+      conceptList: [],
+      value: '',
+      isEdit: false,
+      title: '注册药品维护-添加注册药品'
+    };
+  },
+  created() {
+    let type = this.$route.params.type;
+    if (type == 2) {
+      this.title = '注册药品维护-修改注册药品';
+      api.getByParam({ id: this.$route.params.id }).then(res => {
+        if (res.data.code == 0) {
+          const data = res.data.data;
+          this.formInline.id = data.id;
+          this.formInline.drugCode = data.drugCode;
+          this.formInline.name = data.name;
+          this.formInline.enName = data.enName;
+          this.formInline.tradeName = data.tradeName;
+          this.formInline.form = data.form;
+          this.formInline.specification = data.specification;
+          this.formInline.minPackQuantity = data.minPackQuantity;
+          this.formInline.minPackUnit = data.minPackUnit;
+          this.formInline.company = data.company;
+          this.formInline.approval = data.approval;
+          this.formInline.standardCode = data.standardCode;
+          this.formInline.insuranceType = data.insuranceType;
+          this.formInline.insuranceRemrk = data.insuranceRemrk;
+          this.formInline.drugType = data.drugType;
+          this.formInline.drugConceptId = data.drugConceptId;
+          this.conceptList = [
+            { id: data.drugConceptId, libName: data.drugName }
+          ];
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: 'warning'
+          });
+        }
+      });
+    }
+  },
+  methods: {
+    searchConcept(val) {
+      if (val == '') {
+        return;
+      }
+      api
+        .getsearchDrug({ name: val })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.$nextTick(() => {
+              // dom元素更新后执行,因此这里能正确打印更改之后的值
+              this.conceptList = data; // 改变了的值
+            });
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    validateForms(callBack) {
+      this.$refs['formInline'].validate(valid => {
+        if (valid) {
+          callBack();
+        } else {
+          return false;
+        }
+      });
+    },
+    saveOrUpdate(params) {
+      api.saveOrUpdate(params).then(res => {
+        if (res.data.code == 0) {
+          this.$message({
+            message: '操作成功',
+            type: 'success'
+          });
+          this.$router.push({
+            name: 'ZskRegisteredDrug',
+            params: this.$route.params
+          });
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: 'warning'
+          });
+        }
+      });
+    },
+    getfocus() {
+      this.conceptList = [];
+    },
+    confirm() {
+      let _this = this;
+      this.validateForms(function() {
+        let params = _this.formInline;
+        _this.saveOrUpdate(params);
+      });
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+@import '../../less/admin.less';
+.container {
+  top: 0;
+}
+.contents {
+  height: 100%;
+  .content {
+    height: 600px;
+    background: #fff;
+    padding: 20px 20px 0;
+    color: #545455;
+    min-width: 980px;
+    position: relative;
+    /deep/ .el-form-item {
+      width: 45%;
+      margin-bottom: 20px;
+      .el-form-item__label {
+        margin-right: 20px;
+      }
+
+      .el-input {
+        .el-input__inner {
+          width: 300px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 426 - 382
src/components/knowledgeExtra/DiagBase.vue

@@ -1,398 +1,442 @@
 <template>
-    <div>
-        <crumbs title="诊断依据维护" :minWidth="titleWidth" class="knowledgeTitle">
-            <el-form :inline="true" class="demo-form-inline">
-                <el-form-item label="疾病名称:">
-                    <el-input size="mini" v-model="filter.conceptName" placeholder="输入疾病名称" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="描述:">
-                    <el-input size="mini" v-model="filter.description" placeholder="输入描述" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select v-model="filter.status" clearable placeholder="请选择" size="mini">
-                        <el-option
-                                v-for="item in stateSelect"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item>
-                    <el-button size="mini" @click="filterDatas">确认</el-button>
-                </el-form-item>
-                <el-form class="secLine">
-                    <el-form-item>
-                        <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增诊断依据</el-button>
-                        <el-button size="mini" @click="update">更新数据</el-button>
-                    </el-form-item>
-                </el-form>
-            </el-form>
-        </crumbs>
-        <div class="contents knowledgeContents">
-            <el-table :data="list"
-                      border
-                      style="width: 100%">
-                <el-table-column
-                        type="index"
-                        :index="indexMethod"
-                        label="编号"
-                        width="60">
-                </el-table-column>
-                <el-table-column
-                        prop="conceptName"
-                        label="疾病名称"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.conceptName.length>8" class="item" effect="dark" :content="scope.row.conceptName" placement="top">
-                            <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="description"
-                        label="描述"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.description.length>8" class="item" effect="dark" :content="scope.row.description" placement="top">
-                            <span>{{scope.row.description.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        label="状态">
-                    <template slot-scope="scope">
-                          <span>
-                            {{scope.row.status === 0?'禁用':'启用'}}
-                          </span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="modifierName"
-                        label="操作人">
-                </el-table-column>
-                <el-table-column
-                        prop="gmtModified"
-                        label="操作时间"
-                        width="180">
-                </el-table-column>
-                <el-table-column
-                        label="操作"
-                        width="180" fixed="right">
-                    <template slot-scope="scope">
-                        <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" :class="scope.row.status === 0?'':'unvailable'" @click="showDelDialog(scope.row)">{{scope.row.status === 0?'启用':'禁用'}}</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row,1)">删除</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-            <el-pagination :current-page.sync="currentPage"
-                           @current-change="currentChange"
-                           background
-                           :page-size="pageSize"
-                           :page-sizes="pageSizeArr"
-                           @size-change="handleSizeChange"
-                           :layout="pageLayout"
-                           :total="total">
-            </el-pagination>
-        </div>
-
+  <div>
+    <crumbs title="诊断依据维护" :minWidth="titleWidth" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="疾病名称:">
+          <el-input size="mini" v-model="filter.conceptName" placeholder="输入疾病名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="描述:">
+          <el-input size="mini" v-model="filter.description" placeholder="输入描述" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select v-model="filter.status" clearable placeholder="请选择" size="mini">
+            <el-option
+              v-for="item in stateSelect"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+        </el-form-item>
+        <el-form class="secLine">
+          <el-form-item>
+            <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增诊断依据</el-button>
+            <el-button size="mini" @click="update">更新数据</el-button>
+          </el-form-item>
+        </el-form>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column prop="conceptName" label="疾病名称" width="160">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.conceptName.length>8"
+              class="item"
+              effect="dark"
+              :content="scope.row.conceptName"
+              placement="top"
+            >
+              <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="description" label="描述" width="160">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.description.length>8"
+              class="item"
+              effect="dark"
+              :content="scope.row.description"
+              placement="top"
+            >
+              <span>{{scope.row.description.slice(0,8)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.status === 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modifierName" label="操作人"></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column label="操作" width="180" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="scope.row.status === 0?'':'unvailable'"
+              @click="showDelDialog(scope.row)"
+            >{{scope.row.status === 0?'启用':'禁用'}}</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              class="delete"
+              @click="showDelDialog(scope.row,1)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        :current-page.sync="currentPage"
+        @current-change="currentChange"
+        background
+        :page-size="pageSize"
+        :page-sizes="pageSizeArr"
+        @size-change="handleSizeChange"
+        :layout="pageLayout"
+        :total="total"
+      ></el-pagination>
     </div>
+  </div>
 </template>
 
 <script>
-    import api from '@api/zskDiagBase.js';
-    import config from '@api/config.js';
-    import utils from '@api/utils.js';
+import api from '@api/zskDiagBase.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
 
-    export default {
-        name: 'ZskDiagBase',
-        data: function () {
-            return {
-                list: [],
-                stateSelect:[
-                    {id:1,name:'启用'},
-                    {id:0,name:'禁用'},
-                ],
-                ruleTypeList:[],
-                searched: false,
-                filter:{
-                    conceptName:'',
-                    description:'',
-                    status:''
-                },
-                cacheData: {},
-                currentPage: 1,
-                pageSize: config.pageSize,
-                pageSizeArr:config.pageSizeArr,
-                pageLayout:config.pageLayout,
-                total: 0,
-                titleWidth:'1070px' //头部最小宽度
+export default {
+  name: 'ZskDiagBase',
+  data: function() {
+    return {
+      list: [],
+      stateSelect: [
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      ruleTypeList: [],
+      searched: false,
+      filter: {
+        conceptName: '',
+        description: '',
+        status: ''
+      },
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      titleWidth: '1070px' //头部最小宽度
+    };
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+      this.filter = param.filter;
+    }
+    this.getTypeList();
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  // beforeRouteEnter(to, from, next) {
+  //     next(vm => {
+  //         //const pm = to.param;
+  //         Object.assign(vm, to.params);
+  //         vm.inCurrentPage=to.params.currentPage;
+  //     })
+  // },
+  methods: {
+    getDict() {
+      api
+        .zskgetDict()
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem(
+              'zskDiagDicts',
+              `{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`
+            );
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getTypeList() {
+      this.getDict();
+      api
+        .getTypesList({ planCode: 'dis' })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem('zskDiagList', JSON.stringify(data));
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    addRule() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddZskDiagBase', params: pam });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList(1);
+    },
+    getDataList(flag, isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .diagBasePage(params)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            for (let j = 0; j < data.records.length; j++) {
+              data.records[j].condition =
+                data.records[j].parStatus == '1' ? '启用' : '禁用';
             }
-        },
-        created() {
-            const param = this.$route.params;
-            if(param.currentPage){
-                this.inCurrentPage = param.currentPage;
-                this.filter = param.filter
+            this.list = data.records;
+            if (!flag) {
+              //搜索时不缓存
+              this.cacheData[params.current] = data.records;
+            } else {
+              this.cacheData = {};
             }
-            this.getTypeList();
-            const that = this;
-            //返回时避免参数未赋值就获取列表
-            setTimeout(function(){
-                that.getDataList();
-            });
-        },
-        watch: {
-            'filter': {
-                handler: function () {
-                    this.searched = false;
-                },
-                deep: true
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
             }
-        },
-        // beforeRouteEnter(to, from, next) {
-        //     next(vm => {
-        //         //const pm = to.param;
-        //         Object.assign(vm, to.params);
-        //         vm.inCurrentPage=to.params.currentPage;
-        //     })
-        // },
-        methods: {
-            getDict(){
-                api.zskgetDict().then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        localStorage.setItem("zskDiagDicts",`{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`);
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            getTypeList(){
-                this.getDict();
-                api.getTypesList({planCode:'dis'}).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        localStorage.setItem("zskDiagList",JSON.stringify(data));
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            handleSizeChange(val){
-                this.pageSize = val;
-                this.currentPage = utils.getCurrentPage(this.currentPage, this.total, this.pageSize);
-                this.getDataList();
-            },
-            addRule(){
-                const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    pageSize:this.pageSize,
-                    filter: this.filter
-                } : {currentPage: this.currentPage,
-                    pageSize:this.pageSize};
-                this.$router.push({name: 'AddZskDiagBase', params: pam});
-            },
-            filterDatas(){
-                this.currentPage = 1;
-                this.getDataList(1);
-            },
-            getDataList(flag,isTurnPage) {
-                const params = this.getFilterItems(isTurnPage);
-                this.searched = true;
-                const loading = this.$loading({
-                    lock: true,
-                    text: 'Loading',
-                    spinner: 'el-icon-loading',
-                    background: 'rgba(0, 0, 0, 0.7)'
-                });
-                api.diagBasePage(params).then((res) => {
-                    loading.close();
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        for(let j = 0;j < data.records.length;j++){
-                            data.records[j].condition = (data.records[j].parStatus == '1'?'启用':'禁用')
-                        }
-                        this.list = data.records;
-                        if(!flag){//搜索时不缓存
-                            this.cacheData[params.current] = data.records;
-                        }else{
-                            this.cacheData = {}
-                        }
-                        this.total = data.total;
-                        if(this.inCurrentPage!==undefined){
-                            this.currentPage=this.inCurrentPage;
-                            this.inCurrentPage = undefined;
-                        }
-                    }else{
-                        this.warning(res.data.msg||'获取列表数据失败');
-                    }
-                }).catch((error) => {
-                    loading.close();
-                    console.log(error);
-                });
-            },
-            getFilterItems(isTurnPage) {
-                //翻页时筛选条件没点确定则清空
-                if(isTurnPage&&!this.searched){
-                    this.clearFilter();
-                };
-                const param = {
-                    current: this.inCurrentPage||this.currentPage,
-                    size: this.pageSize,
-                    conceptName: this.filter.conceptName,
-                    description: this.filter.description,
-                    status:this.filter.status
-                };
-                return param;
-            },
-            indexMethod(index) {
-                return ((this.currentPage - 1) * this.pageSize) + index + 1;
-            },
-            currentChange(next) {
-                this.currentPage = next;
-                /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+          } else {
+            this.warning(res.data.msg || '获取列表数据失败');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          console.log(error);
+        });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        conceptName: this.filter.conceptName,
+        description: this.filter.description,
+        status: this.filter.status
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
                   this.list = this.cacheData[next];
                 } else {*/
-                this.getDataList(1,true);
-                //}
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-            editData(row,isCopy){
-                const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    pageSize:this.pageSize,
-                    filter: this.filter
-                } : {currentPage: this.currentPage,
-                    pageSize:this.pageSize};
-                api.diagBaseGetDetail({id:row.id}).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.$router.push({name:'AddZskDiagBase',params:{...pam,data:{...row,klDiagnoseTypeVO:data},copy:isCopy}});
-                    }
-                }).catch((error) => {
-                    this.warning('获取详情失败,请重试')
-                });
-            },
-            showDelDialog(row,isDelete){
-                const params = {
-                    id:row.id
-                };
-                const txt=row.status===0?'重新启用':'禁用';
-                const warningTxt = isDelete?'是否删除该诊断依据?可能对现有系统造成影响':'是否'+txt+'该诊断依据?';
-                const handleFn = isDelete?api.diagBaseDelete:(row.status===0?api.diagBaseApply:api.diagBaseStop);
-                this.showConfirmDialog(warningTxt,()=>{
-                    handleFn(params).then((res)=>{
-                        if(res.data.code=='0'){
-                            if(!this.searched){
-                                //未点确认时清空搜索条件
-                                this.clearFilter();
-                            }
-                            if(isDelete){       //恢复成功后跳转到筛选条件的首页
-                                this.currentPage = 1;
-                            } else {
-                                if (this.filter.status!==''&&this.list.length === 1){
-                                    //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
-                                    this.currentPage = this.currentPage===1?1:this.currentPage-1;
-                                }
-                            }
-                            this.warning(res.data.msg||'操作成功','success');
-                            this.getDataList();
-                        }else{
-                            this.warning(res.data.msg);
-                        }
-                    }).catch((error)=>{
-                        this.warning(error);
-                    })
-                });
-            },
-            clearFilter(){
-                this.filter={
-                    conceptName:'',
-                    description:'',
-                    status:''
-                };
-            },
-            update(){
-                const loading = this.$loading({
-                    lock: true,
-                    text: 'Loading',
-                    spinner: 'el-icon-loading',
-                    background: 'rgba(0, 0, 0, 0.7)'
-                });
-                api.updateDiagBase().then((res) => {
-                    loading.close();
-                    if (res.data.code == '0') {
-                        this.warning('更新成功','success');
-                        this.getDataList();
-                    }else{
-                        this.warning(res.data.msg||'更新失败,请重试');
-                    }
-                }).catch((error) => {
-                    loading.close();
-                    this.warning('更新失败,请重试')
-                });
-            },
-        }
+      this.getDataList(1, true);
+      //}
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    editData(row, isCopy) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      api
+        .diagBaseGetDetail({ id: row.id })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.$router.push({
+              name: 'AddZskDiagBase',
+              params: {
+                ...pam,
+                data: { ...row, klDiagnoseTypeVO: data },
+                copy: isCopy
+              }
+            });
+          }
+        })
+        .catch(error => {
+          this.warning('获取详情失败,请重试');
+        });
+    },
+    showDelDialog(row, isDelete) {
+      const params = {
+        id: row.id
+      };
+      const txt = row.status === 0 ? '重新启用' : '禁用';
+      const warningTxt = isDelete
+        ? '是否删除该诊断依据?可能对现有系统造成影响'
+        : '是否' + txt + '该诊断依据?';
+      const handleFn = isDelete
+        ? api.diagBaseDelete
+        : row.status === 0
+        ? api.diagBaseApply
+        : api.diagBaseStop;
+      this.showConfirmDialog(warningTxt, () => {
+        handleFn(params)
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (isDelete) {
+                //恢复成功后跳转到筛选条件的首页
+                this.currentPage = 1;
+              } else {
+                if (this.filter.status !== '' && this.list.length === 1) {
+                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
+                  this.currentPage =
+                    this.currentPage === 1 ? 1 : this.currentPage - 1;
+                }
+              }
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    clearFilter() {
+      this.filter = {
+        conceptName: '',
+        description: '',
+        status: ''
+      };
+    },
+    update() {
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .updateDiagBase()
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            this.warning('更新成功', 'success');
+            this.getDataList();
+          } else {
+            this.warning(res.data.msg || '更新失败,请重试');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          this.warning('更新失败,请重试');
+        });
     }
+  }
+};
 </script>
 
 <style lang="less" scoped>
-    @import "../../less/admin.less";
-    /deep/ .container.knowledgeTitle {
-        height: 40px;
-        min-width: 970px!important;
-    }
-    .demo-form-inline{
-        margin: 0 20px 0 0;
-    }
-    /deep/ .contents.knowledgeContents {
-        padding: 64px 20px 0;
-    }
-    /deep/ .secLine.el-form {
-        float: right;
-        display: block;
-        position: relative;
-        top: -1px;
-    }
-    .delete{
-        color: red;
-    }
-    .review{
-        color: #22ccc8;
-    }
-    .el-table .cell{
-        overflow: hidden;
-        white-space: nowrap;
-    }
-    #upFile{
-        display: none !important;
-    }
-    .unvailable{
-        color: #FE7D3D;
-        &:hover,&:active,&:focus{
-            color: #f19061;
-        }
-    }
+@import '../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 40px;
+  min-width: 970px !important;
+}
+.demo-form-inline {
+  margin: 0 20px 0 0;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 64px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -1px;
+}
+.delete {
+  color: red;
+}
+.review {
+  color: #22ccc8;
+}
+.el-table .cell {
+  overflow: hidden;
+  white-space: nowrap;
+}
+#upFile {
+  display: none !important;
+}
+.unvailable {
+  color: #fe7d3d;
+  &:hover,
+  &:active,
+  &:focus {
+    color: #f19061;
+  }
+}
 </style>

+ 3 - 0
src/components/knowledgeExtra/DiagBaseGroup.vue

@@ -47,6 +47,9 @@
             return {
             }
         },
+        mounted(){
+            console.log(this.data)
+        },
         computed:{
             len:function(){
                 return util.delNullObj(this.data.klDiagnoseDetail).length;

+ 430 - 366
src/components/knowledgeExtra/DiagBaseItem.vue

@@ -1,385 +1,449 @@
 <template>
-    <div class="groups-cont" v-if="groupData">
-        <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
-        <div class="sub-condition-form">
-        <span v-if="!hideDel" class="del-btn"  @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
-            <el-form-item label="基础依据名称:" :key="0" :prop="ruleLine+ind+'.basDescription'">
-                <el-input v-model.trim = "groupData.basDescription" clearable></el-input>
+  <div class="groups-cont" v-if="groupData">
+    <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
+    <div class="sub-condition-form">
+      <span v-if="!hideDel" class="del-btn" @click="delRule">删除</span>
+      <!--:class="isLast?'disable del-btn':'del-btn'"-->
+      <el-form-item label="基础依据名称:" :key="0" :prop="ruleLine+ind+'.basDescription'">
+        <el-input v-model.trim="groupData.basDescription" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="基础依据类型:" :key="1" :prop="ruleLine+ind+'.basType'">
+        <el-select
+          v-model="groupData.basType"
+          id="basTypeRef"
+          placeholder="请选择"
+          size="small"
+          @change="basTypeChange"
+        >
+          <el-option v-for="item in baseTypes" :key="item.id" :label="item.name" :value="item.type"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="!showRegx" :key="2" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
+        <el-select
+          v-model="groupData.basLibType"
+          placeholder="请选择"
+          size="small"
+          :disabled="showRegx"
+          @change="basLibTypeChange"
+        >
+          <el-option
+            v-for="item in baseTermTypeList"
+            :key="item.id"
+            :label="item.name"
+            :value="Number(item.code)"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="showRegx" :key="3" label="基础依据术语类型:" class="is-required">
+        <el-input disabled v-model="basTypeName"></el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="!showRegx"
+        :key="4"
+        class="addDepartFormItem"
+        label="医学标准术语:"
+        :prop="ruleLine+ind+'.basConceptId'"
+      >
+        <el-select
+          clearable
+          remote
+          filterable
+          :remote-method="searchConcept"
+          v-model.trim="groupData.basConceptId"
+          @change="conceptChange"
+        >
+          <el-option
+            v-for="item in conceptList"
+            :key="item.conceptId"
+            :label="item.conceptName"
+            :value="item.conceptId"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        :key="5"
+        v-if="groupData.basType===2&&!onlyNum&&!onlyTxt"
+        label="选择类型:"
+        :prop="ruleLine+ind+'.dataType'"
+      >
+        <el-select
+          v-model="groupData.dataType"
+          placeholder="请选择"
+          size="small"
+          @change="dataTypeChange"
+        >
+          <el-option v-for="item in dataTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        :key="6"
+        v-if="(!showRegx&&groupData.dataType==='1')||onlyNum"
+        label="最大值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.maxOperator'">
+              <el-select v-model="groupData.maxOperator" placeholder="请选择" size="small" clearable>
+                <el-option
+                  v-for="item in operMaxList"
+                  :key="item.key"
+                  :label="item.name"
+                  :value="item.key"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item label="基础依据类型:" :key="1" :prop="ruleLine+ind+'.basType'">
-                <el-select v-model="groupData.basType"
-                           id="basTypeRef"
-                           placeholder="请选择"
-                           size="small"
-                           @change="basTypeChange">
-                    <el-option
-                            v-for="item in baseTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.type">
-                    </el-option>
-                </el-select>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.maxVal'">
+              <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值" />
             </el-form-item>
-            <el-form-item v-if="!showRegx" :key="2" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
-                <el-select v-model="groupData.basLibType"
-                           placeholder="请选择"
-                           size="small"
-                           :disabled="showRegx" @change="basLibTypeChange">
-                    <el-option
-                            v-for="item in baseTermTypeList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="Number(item.code)">
-                    </el-option>
-                </el-select>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="maxUnit">
+              <el-input type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位" />
             </el-form-item>
-            <el-form-item v-if="showRegx" :key="3" label="基础依据术语类型:" class="is-required">
-                <el-input disabled v-model="basTypeName"></el-input>
-            </el-form-item>
-            <el-form-item v-if="!showRegx" :key="4" class="addDepartFormItem" label="医学标准术语:" :prop="ruleLine+ind+'.basConceptId'">
-                <el-select clearable remote filterable :remote-method="searchConcept" v-model.trim="groupData.basConceptId" @change="conceptChange">
-                    <el-option
-                            v-for="item in conceptList"
-                            :key="item.conceptId"
-                            :label="item.conceptName"
-                            :value="item.conceptId">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item :key="5" v-if="groupData.basType===2&&!onlyNum&&!onlyTxt" label="选择类型:" :prop="ruleLine+ind+'.dataType'">
-                <el-select v-model="groupData.dataType"
-                           placeholder="请选择"
-                           size="small" @change="dataTypeChange">
-                    <el-option
-                            v-for="item in dataTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item class="min-margin" :key="6" v-if="(!showRegx&&groupData.dataType==='1')||onlyNum" label="最大值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.maxOperator'">
-                            <el-select v-model="groupData.maxOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMaxList"
-                                        :key="item.key"
-                                        :label="item.name"
-                                        :value="item.key">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.maxVal'">
-                            <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="maxUnit">
-                            <el-input  type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="(!showRegx&&groupData.dataType==='1')||onlyNum" label="最小值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.minOperator'">
-                            <el-select v-model="groupData.minOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMinList"
-                                        :key="item.name"
-                                        :label="item.name"
-                                        :value="item.name">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.minVal'">
-                            <el-input type="text" v-model="groupData.minVal" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="minUnit">
-                            <el-input  type="text" v-model.trim="groupData.minUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="(!showRegx&&groupData.dataType==='1')||onlyNum"
+        label="最小值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.minOperator'">
+              <el-select v-model="groupData.minOperator" placeholder="请选择" size="small" clearable>
+                <el-option
+                  v-for="item in operMinList"
+                  :key="item.name"
+                  :label="item.name"
+                  :value="item.name"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item v-if="showRegx" key="v11" label="正则表达式:" :prop="ruleLine+ind+'.eqValue'" class="discDesc">
-                <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.minVal'">
+              <el-input type="text" v-model="groupData.minVal" placeholder="填写数值" />
             </el-form-item>
-            <el-form-item key="v13" v-if="(!onlyNum&&!showRegx&&groupData.basType===2&&groupData.dataType==='2')||onlyTxt" label="医学内容:" :prop="ruleLine+ind+'.eqValue'" class="discDesc">
-                <el-input placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
-                <span class="tip-text">注:可输入升高、降低、阴性、阳性等~</span>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="minUnit">
+              <el-input type="text" v-model.trim="groupData.minUnit" placeholder="填写单位" />
             </el-form-item>
+          </el-col>
         </div>
-        <!--</el-form>-->
+      </el-form-item>
+      <el-form-item
+        v-if="showRegx"
+        key="v11"
+        label="正则表达式:"
+        :prop="ruleLine+ind+'.eqValue'"
+        class="discDesc"
+      >
+        <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
+      </el-form-item>
+      <el-form-item
+        key="v13"
+        v-if="(!onlyNum&&!showRegx&&groupData.basType===2&&groupData.dataType==='2')||onlyTxt"
+        label="医学内容:"
+        :prop="ruleLine+ind+'.eqValue'"
+        class="discDesc"
+      >
+        <el-input placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
+        <span class="tip-text">注:可输入升高、降低、阴性、阳性等~</span>
+      </el-form-item>
     </div>
+    <!--</el-form>-->
+  </div>
 </template>
 <script>
-    import api from '@api/zskDiagBase.js';
-    export default {
-        name:'DiagBaseItem',
-        props:['groupData','ind','baseTypes','parInx','inx','hideDel'],
-        data(){
-            return {
-                dicts:{},
-                baseTermTypeList:[],
-                typeList:[],
-                numTypes:'',    //只有数值类型的类型id
-                //basTypeName:'',
-                operMaxList:[
-                    {name:'<=',key:'<='},
-                    {name:'<',key:'<'},
-                ],
-                operMinList:[{name:'>',key:'>'},
-                    {name:'>=',key:'>='},
-                ],
-                dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
-                conceptList:[],
-            }
-        },
-        created(){
-            this.dicts=JSON.parse(localStorage.getItem("zskDiagDicts")||'{}');
-            if(this.groupData){
-                if(this.groupData.maxOperator||this.groupData.minOperator){
-                    this.groupData.dataType='1';
-                }else if(this.groupData.eqValue){
-                    this.groupData.dataType='2';
-                }
-            }
-            this.conceptList=[{conceptName:this.groupData.basLibName,conceptId:this.groupData.basConceptId}];
-            if(this.groupData.basType){
-                const obj = this.baseTypes.find((it)=>it.type===this.groupData.basType);
-                this.baseTermTypeList = obj.subMenuList;
-            }
-        },
-        computed:{
-            basTypeName:function(){
-                return (this.baseTypes.find((it)=>it.type===this.groupData.basType)||{}).name;
-            },
-            onlyNum:function(){
-                const onlyNum =this.dicts['onlyNum']||'&';
-                const codes=onlyNum+',';
-                const type=this.groupData.basLibType;
-                return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
-            },
-            onlyTxt:function(){
-                const onlyTxt =this.dicts['onlyTxt']||'&';
-                const codes=onlyTxt+',';
-                const type=this.groupData.basLibType;
-                return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
-            },
-            ruleLine:function(){
-              return 'klDiagnoseTypeVO.'+this.parInx+'.groupVO.'+this.inx+'.klDiagnoseDetail.';
-            },
-            showRegx:function(){
-              return this.groupData.basType===3||this.groupData.basType===4;
-            },
-        },
-        methods:{
-            dataTypeChange(val){
-                this.groupData.eqOperator=(val==='2'?'=':'');
-                this.clearNumText();
-                delete this.groupData.dataType;     //触发更新
-                this.$set(this.groupData,'dataType',val);
-            },
-            basTypeChange(val){        //基础依据类型修改
-                if(!val){
-                    this.baseTermTypeList =[];
-                    return;
-                }
-                this.groupData.basLibType='';
-                this.groupData.dataType='';
-                this.clearConcept();    //清空医学标准术语
-                this.clearNumText();    //清空数值、医学内容
-                const obj = this.baseTypes.find((it)=>it.type===val);
-                this.baseTermTypeList = obj.subMenuList;
-            },
-            basLibTypeChange(val){        //基础依据术语类型修改
-                this.groupData.basLibType=val;
-                if((this.numTypes+',').indexOf(val+',')>-1){
-                    this.groupData.dataType='1';
-                }else{
-                    this.groupData.dataType='';
-                }
-                this.clearConcept();
-                this.clearNumText();
-            },
-            conceptChange(val){
-                this.groupData.basConceptId=val;
-                if(val){
-                    this.groupData.basLibName=this.conceptList.find((it)=>it.conceptId===val).conceptName;
-                }else{
-                    this.groupData.basLibName='';
-                }
-            },
-            clearConcept(){
-                this.groupData.basConceptId='';
-                this.groupData.basLibName='';
-                this.conceptList=[];
-            },
-            clearNumText(){
-                this.groupData.maxOperator='';
-                this.groupData.maxVal='';
-                this.groupData.maxUnit='';
-                this.groupData.minOperator='';
-                this.groupData.minVal='';
-                this.groupData.minUnit='';
-                this.groupData.eqValue='';
-                this.groupData.eqOperator='';
-            },
-            searchConcept(val){
-                const param = {
-                    excludedConceptIds:[this.groupData.basType],
-                    libType:this.groupData.basLibType,
-                    name:val,
-                };
-                api.searchConcept(param).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.conceptList = data;
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            /*addRule(){
+import api from '@api/zskDiagBase.js';
+export default {
+  name: 'DiagBaseItem',
+  props: ['groupData', 'ind', 'baseTypes', 'parInx', 'inx', 'hideDel'],
+  data() {
+    return {
+      dicts: {},
+      baseTermTypeList: [],
+      typeList: [],
+      numTypes: '', //只有数值类型的类型id
+      //basTypeName:'',
+      operMaxList: [
+        { name: '<=', key: '<=' },
+        { name: '<', key: '<' }
+      ],
+      operMinList: [
+        { name: '>', key: '>' },
+        { name: '>=', key: '>=' }
+      ],
+      dataTypes: [
+        { id: '1', name: '数值类型' },
+        { id: '2', name: '文本类型' }
+      ],
+      conceptList: []
+    };
+  },
+  created() {
+    this.dicts = JSON.parse(localStorage.getItem('zskDiagDicts') || '{}');
+    if (this.groupData) {
+      if (this.groupData.maxOperator || this.groupData.minOperator) {
+        this.groupData.dataType = '1';
+      } else if (this.groupData.eqValue) {
+        this.groupData.dataType = '2';
+      }
+    }
+    this.conceptList = [
+      {
+        conceptName: this.groupData.basLibName,
+        conceptId: this.groupData.basConceptId
+      }
+    ];
+    if (this.groupData.basType) {
+      const obj = this.baseTypes.find(it => it.type === this.groupData.basType);
+      this.baseTermTypeList = obj.subMenuList;
+    }
+  },
+  computed: {
+    basTypeName: function() {
+      return (
+        this.baseTypes.find(it => it.type === this.groupData.basType) || {}
+      ).name;
+    },
+    onlyNum: function() {
+      const onlyNum = this.dicts['onlyNum'] || '&';
+      const codes = onlyNum + ',';
+      const type = this.groupData.basLibType;
+      return type && codes.indexOf(this.groupData.basLibType + ',') > -1;
+    },
+    onlyTxt: function() {
+      const onlyTxt = this.dicts['onlyTxt'] || '&';
+      const codes = onlyTxt + ',';
+      const type = this.groupData.basLibType;
+      return type && codes.indexOf(this.groupData.basLibType + ',') > -1;
+    },
+    ruleLine: function() {
+      return (
+        'klDiagnoseTypeVO.' +
+        this.parInx +
+        '.groupVO.' +
+        this.inx +
+        '.klDiagnoseDetail.'
+      );
+    },
+    showRegx: function() {
+      return this.groupData.basType === 3 || this.groupData.basType === 4;
+    }
+  },
+  methods: {
+    dataTypeChange(val) {
+      this.groupData.eqOperator = val === '2' ? '=' : '';
+      this.clearNumText();
+      delete this.groupData.dataType; //触发更新
+      this.$set(this.groupData, 'dataType', val);
+    },
+    basTypeChange(val) {
+      //基础依据类型修改
+      if (!val) {
+        this.baseTermTypeList = [];
+        return;
+      }
+      this.groupData.basLibType = '';
+      this.groupData.dataType = '';
+      this.clearConcept(); //清空医学标准术语
+      this.clearNumText(); //清空数值、医学内容
+      const obj = this.baseTypes.find(it => it.type === val);
+      this.baseTermTypeList = obj.subMenuList;
+    },
+    basLibTypeChange(val) {
+      console.log(val)
+      //基础依据术语类型修改
+      this.groupData.basLibType = val;
+      console.log((this.numTypes + ',').indexOf(val + ','))
+      if ((this.numTypes + ',').indexOf(val + ',') > -1) {
+        this.groupData.dataType = '1';
+      } else {
+        this.groupData.dataType = '';
+      }
+      this.clearConcept();
+      this.clearNumText();
+    },
+    conceptChange(val) {
+      this.groupData.basConceptId = val;
+      if (val) {
+        this.groupData.basLibName = this.conceptList.find(
+          it => it.conceptId === val
+        ).conceptName;
+      } else {
+        this.groupData.basLibName = '';
+      }
+    },
+    clearConcept() {
+      this.groupData.basConceptId = '';
+      this.groupData.basLibName = '';
+      this.conceptList = [];
+    },
+    clearNumText() {
+      this.groupData.maxOperator = '';
+      this.groupData.maxVal = '';
+      this.groupData.maxUnit = '';
+      this.groupData.minOperator = '';
+      this.groupData.minVal = '';
+      this.groupData.minUnit = '';
+      this.groupData.eqValue = '';
+      this.groupData.eqOperator = '';
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.groupData.basType],
+        libType: this.groupData.basLibType,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    /*addRule(){
                 this.$emit("addRule");
                 this.$emit('setRules');
             },*/
-            delRule(){
-                this.$emit("delRule",this.ind);
-                this.$emit('setRules');
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-        }
+    delRule() {
+      this.$emit('delRule', this.ind);
+      this.$emit('setRules');
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
     }
+  }
+};
 </script>
 <style lang="less">
-    .groups-cont{
-        background: #fff;
-        border-bottom:2px solid #F5F5F5;
-        .conceptItem{
-            padding: 0 10px;
-            cursor: pointer;
-            height: 32px;
-            line-height: 32px;
-            &:hover{
-                background: #ebedf1;
-            }
-        }
-        .sub-condition-form{
-            padding:10px 20px 9px;
-            position: relative;
-            border-bottom:1px solid #F5F5F5;
-            .del-btn{
-                color: #FF5B5B;
-                cursor: pointer;
-                position: absolute;
-                right: 20px;
-                top:20px;
-                z-index: 1;
-                &.disable{
-                    color: #B8B8B8;
-                }
-            }
-        }
-        .el-input__icon{
-            line-height: 32px;
-        }
-        .select-item{
-            &>div{
-                float: left;
-                margin-right: 10px;
-            }
-            .el-input{
-                width: auto;
-            }
-            input{
-                width: 95px;
-                line-height: 32px;
-                height: 32px;
-            }
-        }
-        .el-input,.el-input__inner{
-            width: 190px;
-            line-height: 32px;
-            height: 32px;
-        }
-        .el-button--danger.is-plain{
-            background: none;
-        }
-        .itemList {
-            position: absolute;
-            // display: none;
-            background: #fff;
-            width: 188px;
-            max-height: 160px;
-            border: 1px solid #DCDFE6;
-            left: 0;
-            top: 37px;
-            z-index: 2;
-            overflow-y: auto;
-        }
-        .el-form-item{
-            margin-bottom: 6px;
-            &.min-margin{
-                margin-bottom: 0;
-                position: relative;
-                .el-form-item__content{
-                    position: unset;
-                }
-                .el-form-item__error{
-                    top:10px;
-                    left: 460px;
-                    white-space: normal;
-                    width: 260px;
-                }
-            }
-            .el-textarea + .el-form-item__error{
-                top:80px;
-                left: 0;
-            }
-            .tip-text + .el-form-item__error{
-                top:40px;
-                left: 0;
-            }
-        }
-
-        .el-input-number{
-            width: 95px;
-        }
-        .el-input-number.is-controls-right .el-input-number__decrease, .el-input-number.is-controls-right .el-input-number__increase{
-            width: 25px;
-            height: 15px;
-            line-height: 16px;
-        }
-        .el-col-3 {
-            width: 94px;
-        }
+.groups-cont {
+  background: #fff;
+  border-bottom: 2px solid #f5f5f5;
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .sub-condition-form {
+    padding: 10px 20px 9px;
+    position: relative;
+    border-bottom: 1px solid #f5f5f5;
+    .del-btn {
+      color: #ff5b5b;
+      cursor: pointer;
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      z-index: 1;
+      &.disable {
+        color: #b8b8b8;
+      }
+    }
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+  .select-item {
+    & > div {
+      float: left;
+      margin-right: 10px;
+    }
+    .el-input {
+      width: auto;
+    }
+    input {
+      width: 95px;
+      line-height: 32px;
+      height: 32px;
     }
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-button--danger.is-plain {
+    background: none;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .el-form-item {
+    margin-bottom: 6px;
+    &.min-margin {
+      margin-bottom: 0;
+      position: relative;
+      .el-form-item__content {
+        position: unset;
+      }
+      .el-form-item__error {
+        top: 10px;
+        left: 460px;
+        white-space: normal;
+        width: 260px;
+      }
+    }
+    .el-textarea + .el-form-item__error {
+      top: 80px;
+      left: 0;
+    }
+    .tip-text + .el-form-item__error {
+      top: 40px;
+      left: 0;
+    }
+  }
+
+  .el-input-number {
+    width: 95px;
+  }
+  .el-input-number.is-controls-right .el-input-number__decrease,
+  .el-input-number.is-controls-right .el-input-number__increase {
+    width: 25px;
+    height: 15px;
+    line-height: 16px;
+  }
+  .el-col-3 {
+    width: 94px;
+  }
+}
 </style>

+ 149 - 140
src/components/knowledgeExtra/DiagBaseType.vue

@@ -1,148 +1,157 @@
 <template>
-    <!--<el-form ref="form" class="add-new-form" label-width="130px" :model="data">-->
-   <div class="add-new-form">
-        <el-form-item label="诊断依据类型:" :prop="'klDiagnoseTypeVO.'+inx+'.conditionType'" class="diag-type">
-            <el-select v-model="data.conditionType"
-                       placeholder="请选择"
-                       size="small">
-                <el-option
-                        v-for="item in typeList"
-                        :key="item.ruleType"
-                        :label="item.name"
-                        :value="item.ruleType">
-                </el-option>
-            </el-select>
-            <span class="tip-text">注:选择诊断依据类型后才能展示基础依据类型~</span>
-        </el-form-item>
-        <DiagBaseGroup v-for="(group,i) in data.groupVO"
-                   ref="groups"
-                   :data="group"
-                   :diagTypeList="baseTypeList"
-                   :inx="i"
-                   :parInx="inx"
-                   :isLast="isLast&&data.groupVO.length===1"
-                   @setRules="setRules"
-                   @addGroup="addGroup"
-                   @delGroup="delGroup"></DiagBaseGroup>
+  <!--<el-form ref="form" class="add-new-form" label-width="130px" :model="data">-->
+  <div class="add-new-form">
+    <el-form-item
+      label="诊断依据类型:"
+      :prop="'klDiagnoseTypeVO.'+inx+'.conditionType'"
+      class="diag-type"
+    >
+      <el-select v-model="data.conditionType" placeholder="请选择" size="small">
+        <el-option
+          v-for="item in typeList"
+          :key="item.ruleType"
+          :label="item.name"
+          :value="item.ruleType"
+        ></el-option>
+      </el-select>
+      <span class="tip-text">注:选择诊断依据类型后才能展示基础依据类型~</span>
+    </el-form-item>
+    <DiagBaseGroup
+      v-for="(group,i) in data.groupVO"
+      ref="groups"
+      :data="group"
+      :diagTypeList="baseTypeList"
+      :inx="i"
+      :parInx="inx"
+      :isLast="isLast&&data.groupVO.length===1"
+      @setRules="setRules"
+      @addGroup="addGroup"
+      @delGroup="delGroup"
+    ></DiagBaseGroup>
     <div class="group-oper">
-        <el-button size="small" @click="addDiag">+新增依据</el-button>
-        <el-button size="small" class="copy-btn" @click="copyDiag"><img src="../../images/copy.png" alt="">复制依据</el-button>
-        <el-button :disabled="isLast" size="small" type="danger" plain @click="delDiag">-删除依据</el-button>
+      <el-button size="small" @click="addDiag">+新增依据</el-button>
+      <el-button size="small" class="copy-btn" @click="copyDiag">
+        <img src="../../images/copy.png" alt />复制依据
+      </el-button>
+      <el-button :disabled="isLast" size="small" type="danger" plain @click="delDiag">-删除依据</el-button>
     </div>
-          </div>
-       <!-- </el-form>-->
-      </template>
+  </div>
+  <!-- </el-form>-->
+</template>
       <script>
-          import DiagBaseGroup from './DiagBaseGroup';
-          import util from '../../api/utils.js'
-          export default {
-              name:'DiagBaseType',
-              props:['data','isLast','inx'],
-              data(){
-                  return {
-                      form:{},
-                      conditionType:'',
-                      typeObj:{},
-                      typeList:[],
-                      /*rules:{
+import DiagBaseGroup from './DiagBaseGroup';
+import util from '../../api/utils.js';
+export default {
+  name: 'DiagBaseType',
+  props: ['data', 'isLast', 'inx'],
+  data() {
+    return {
+      form: {},
+      conditionType: '',
+      typeObj: {},
+      typeList: []
+      /*rules:{
                           conditionType:[]
                       }*/
-                  }
-              },
-              computed:{
-                baseTypeList:function(){
-                    return this.typeObj[this.data.conditionType];
-                }
-              },
-              created(){
-                  this.getTypeList();
-              },
-              methods:{
-                  setRules(){
-                      this.$emit('setRules');
-                  },
-                  getTypeList(){
-                      const typeListData = JSON.parse(localStorage.getItem("zskDiagList"));
-                      this.typeObj=util.formatObj(typeListData,'ruleType');
-                      this.typeList = typeListData;
-                  },
-                  addDiag(){
-                      this.$emit("addDiag",this.inx);
-                  },
-                  delDiag(){
-                      this.$emit("delDiag",this.inx);
-                  },
-                  copyDiag(){
-                      this.$emit("copyDiag",this.inx);
-                  },
-                  addGroup(i){
-                      const temp={
-                          "baseGroup": '',
-                          "conditionGroup": '',
-                          "fitNo": '',
-                          "klDiagnoseDetail": [{
-                              "basConceptId": '',
-                              "basDescription": "",
-                              "basLename": "",
-                              "basLibName": "",
-                              "basLibType": null,
-                              "basType": '',
-                              "eqOperator": "",
-                              "eqUnit": "",
-                              "eqValue": "",
-                              "maxOperator": "",
-                              "maxUnit": "",
-                              "maxVal": "",
-                              "minOperator": "",
-                              "minUnit": "",
-                              "minVal": ""
-                          }]
-                      };
-                      this.data.groupVO.splice(i+1,0,temp);
-                      this.$emit('setRules');
-                  },
-                  delGroup(i){
-                      if(i===0&&this.data.groupVO.length===1){
-                          this.$emit("delDiag",this.inx);
-                          return;
-                      }
-                      this.data.groupVO.splice(i,1);
-                  }
-              },
-              components:{
-                  DiagBaseGroup
-              }
+    };
+  },
+  computed: {
+    baseTypeList: function() {
+      return this.typeObj[this.data.conditionType];
+    }
+  },
+  created() {
+    console.log(this.data)
+    this.getTypeList();
+  },
+  methods: {
+    setRules() {
+      this.$emit('setRules');
+    },
+    getTypeList() {
+      const typeListData = JSON.parse(localStorage.getItem('zskDiagList'));
+      this.typeObj = util.formatObj(typeListData, 'ruleType');
+      this.typeList = typeListData;
+    },
+    addDiag() {
+      this.$emit('addDiag', this.inx);
+    },
+    delDiag() {
+      this.$emit('delDiag', this.inx);
+    },
+    copyDiag() {
+      this.$emit('copyDiag', this.inx);
+    },
+    addGroup(i) {
+      const temp = {
+        baseGroup: '',
+        conditionGroup: '',
+        fitNo: '',
+        klDiagnoseDetail: [
+          {
+            basConceptId: '',
+            basDescription: '',
+            basLename: '',
+            basLibName: '',
+            basLibType: null,
+            basType: '',
+            eqOperator: '',
+            eqUnit: '',
+            eqValue: '',
+            maxOperator: '',
+            maxUnit: '',
+            maxVal: '',
+            minOperator: '',
+            minUnit: '',
+            minVal: ''
           }
-      </script>
+        ]
+      };
+      this.data.groupVO.splice(i + 1, 0, temp);
+      this.$emit('setRules');
+    },
+    delGroup(i) {
+      if (i === 0 && this.data.groupVO.length === 1) {
+        this.$emit('delDiag', this.inx);
+        return;
+      }
+      this.data.groupVO.splice(i, 1);
+    }
+  },
+  components: {
+    DiagBaseGroup
+  }
+};
+</script>
       <style lang="less" scoped>
-          .add-new-form{
-              background: #E3EAF4;
-              padding: 20px 0;
-          }
-          /deep/ .diag-type .el-form-item__error{
-              top: 35px!important;
-              left: 0!important;
-              background: none!important;
-          }
-          .diag-type{
-              background: #fff;
-              margin: 0 20px;
-              padding: 8px 0 15px;
-          }
-          .group-oper{
-              margin: 20px 20px 0 20px;
-              background: #fff;
-              padding: 8px 0 8px 205px;;
-              /*text-align: center;*/
-              .el-button{
-                  margin-right: 60px;
-              }
-              .copy-btn{
-                  border-color:#666;
-                  color: #666;
-                  img{
-                      margin-right: 5px;
-                  }
-              }
-          }
-      </style>
+.add-new-form {
+  background: #e3eaf4;
+  padding: 20px 0;
+}
+/deep/ .diag-type .el-form-item__error {
+  top: 35px !important;
+  left: 0 !important;
+  background: none !important;
+}
+.diag-type {
+  background: #fff;
+  margin: 0 20px;
+  padding: 8px 0 15px;
+}
+.group-oper {
+  margin: 20px 20px 0 20px;
+  background: #fff;
+  padding: 8px 0 8px 205px;
+  /*text-align: center;*/
+  .el-button {
+    margin-right: 60px;
+  }
+  .copy-btn {
+    border-color: #666;
+    color: #666;
+    img {
+      margin-right: 5px;
+    }
+  }
+}
+</style>

+ 305 - 0
src/components/knowledgeExtra/RegisteredDrug.vue

@@ -0,0 +1,305 @@
+<template>
+  <div>
+    <crumbs title="注册药品维护" :minWidth="titleWidth" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="通用名:">
+          <el-input size="mini" v-model="filter.commonName" placeholder="输入通用名" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="注册/商品名称:">
+          <el-input size="mini" v-model="filter.name" placeholder="输入注册/商品名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="企业:">
+          <el-input size="mini" v-model="filter.company" placeholder="输入企业名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+        </el-form-item>
+        <el-form class="secLine">
+          <el-form-item>
+            <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增药品</el-button>
+          </el-form-item>
+        </el-form>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column prop="drugCode" label="药品代码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="name" label="注册名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="drugName" label="通用名" width="110" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="enName" label="英文名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="tradeName" label="商品名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="form" label="药品剂型" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="specification" label="注册规格" width="70" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="minPackQuantity" label="最小包装数量" width="80" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="minPackUnit" label="最小包装单位" width="80" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="company" label="企业" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="approval" label="批准文号" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="standardCode" label="药品本位码" width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="insuranceType" label="医保类型" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="insuranceRemrk" label="医保备注" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="modifier" label="操作人" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column label="操作" width="120" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        :current-page.sync="currentPage"
+        @current-change="currentChange"
+        background
+        :page-size="pageSize"
+        :page-sizes="pageSizeArr"
+        @size-change="handleSizeChange"
+        :layout="pageLayout"
+        :total="total"
+      ></el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'ZskRegisteredDrug',
+  data: function() {
+    return {
+      list: [],
+      stateSelect: [
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      ruleTypeList: [],
+      searched: false,
+      filter: {
+        commonName: '',
+        name: '',
+        company: ''
+      },
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      titleWidth: '1070px' //头部最小宽度
+    };
+  },
+  created() {
+    this.getDataList();
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    addRule() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddZskRegisteredDrug', params: pam });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList(1);
+    },
+    getDataList(flag, isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .getPageList(params)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            for (let j = 0; j < data.records.length; j++) {
+              data.records[j].condition =
+                data.records[j].parStatus == '1' ? '启用' : '禁用';
+            }
+            this.list = data.records;
+            if (!flag) {
+              //搜索时不缓存
+              this.cacheData[params.current] = data.records;
+            } else {
+              this.cacheData = {};
+            }
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
+            }
+          } else {
+            this.warning(res.data.msg || '获取列表数据失败');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          console.log(error);
+        });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        commonName: this.filter.commonName,
+        name: this.filter.name,
+        company: this.filter.company
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(1, true);
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    editData(row) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddZskRegisteredDrug',
+        params: {
+          id: row.id,
+          type: 2
+        }
+      });
+    },
+    showDelDialog(row) {
+      const params = {
+        id: row.id
+      };
+      const warningTxt = '是否删除该注册药品?可能对现有系统造成影响';
+      this.showConfirmDialog(warningTxt, () => {
+        api.paramDelete(params)
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              this.currentPage = 1;
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    clearFilter() {
+      this.filter = {
+        commonName: '',
+        name: '',
+        company: ''
+      };
+    },
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import '../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 40px;
+  min-width: 970px !important;
+}
+/deep/.demo-form-inline .el-input--mini .el-input__inner {
+    width: 115px;
+}
+.demo-form-inline {
+  margin: 0 20px 0 0;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 64px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -1px;
+}
+/deep/ .cell{
+  line-height: 20px;
+}
+.delete {
+  color: red;
+}
+.review {
+  color: #22ccc8;
+}
+.el-table .cell {
+  overflow: hidden;
+  white-space: nowrap;
+}
+#upFile {
+  display: none !important;
+}
+.unvailable {
+  color: #fe7d3d;
+  &:hover,
+  &:active,
+  &:focus {
+    color: #f19061;
+  }
+}
+</style>

+ 2 - 2
src/components/knowledgeExtra/RuleManager.vue

@@ -89,7 +89,7 @@
                         label="有无子条件"
                         width="100">
                     <template slot-scope="scope">
-                        {{scope.row.parHasSub === '0'?'无':'有'}}
+                        {{scope.row.parHasSub == '0'?'无':'有'}}
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -171,7 +171,7 @@
                 pageSizeArr:config.pageSizeArr,
                 pageLayout:config.pageLayout,
                 total: 0,
-                titleWidth:'1070px' //头部最小宽度
+                titleWidth:'970px' //头部最小宽度
             }
         },
         created() {

+ 0 - 449
src/components/knowledgeExtra/SubConditions.vue

@@ -1,449 +0,0 @@
-<template>
-    <div class="groups-cont">
-        <el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">
-            <span v-if="!disabled&&!isLast" class="del-btn"  @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
-            <el-form-item label="基础规则名称:" prop="subDescription">
-                <el-input v-model.trim = "groupData.subDescription" :disabled="disabled"></el-input>
-            </el-form-item>
-            <el-form-item label="基础规则类型:" prop="subType">
-                <el-select v-model="groupData.subType"
-                           :disabled="disabled"
-                           placeholder="请选择"
-                           size="small"
-                           @change="subTypeChange">
-                    <el-option
-                            v-for="item in baseTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.type">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="基础规则术语类型:" prop="subLenCode">
-                <el-select v-model="groupData.subLenCode"
-                           :disabled="disabled"
-                           placeholder="请选择"
-                           size="small" @change="subCodeChange">
-                    <el-option
-                            v-for="item in baseTermTypeList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.code">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item  class="addDepartFormItem" label="医学标准术语:" prop="subConceptId">
-                <el-select clearable remote filterable :disabled="disabled" :remote-method="searchConcept" v-model.trim="groupData.subConceptId">
-                    <el-option
-                            v-for="item in conceptList"
-                            :key="item.conceptId"
-                            :label="item.conceptName"
-                            :value="item.conceptId">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item v-if="groupData.subType===2&&showDataType" label="选择类型:" prop="dataType">
-                <el-select v-model="groupData.dataType"
-                           placeholder="请选择"
-                           size="small" @change="dataTypeChange">
-                    <el-option
-                            v-for="item in dataTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="groupData.dataType==='1'" label="最大值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item prop="subMaxOperator">
-                            <el-select v-model="groupData.subMaxOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMaxList"
-                                        :key="item.key"
-                                        :label="item.name"
-                                        :value="item.key">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMaxValue">
-                            <el-input type="text" v-model="groupData.subMaxValue" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMaxUnit">
-                            <el-input  type="text" v-model.trim="groupData.subMaxUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="groupData.dataType==='1'" label="最小值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item prop="subMinOperator">
-                            <el-select v-model="groupData.subMinOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMinList"
-                                        :key="item.name"
-                                        :label="item.name"
-                                        :value="item.name">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMinValue">
-                            <el-input type="text" v-model="groupData.subMinValue" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMinUnit">
-                            <el-input  type="text" v-model.trim="groupData.subMinUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item v-if="groupData.subType!==6&&groupData.dataType==='2'" label="医学内容:" prop="subEqValue" class="discDesc is-required">
-                <el-input type="textarea" rows="3" placeholder="请输入医学内容" v-model.trim="groupData.subEqValue"></el-input>
-            </el-form-item>
-            <el-form-item v-if="groupData.subType===6" label="正则表达式:" prop="subEqValue" class="discDesc is-required">
-                <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.subEqValue"></el-input>
-            </el-form-item>
-        </el-form>
-        <div class="inner-oper" v-if="showAdd">
-            <span>新增规则:</span>
-            <span class="add-btn" @click="addRule"><img src="../../images/add.png" alt="新增规则"></span>
-        </div>
-    </div>
-</template>
-<script>
-    import api from '@api/knowledgeLib.js';
-    export default {
-        name:'subCondititons',
-        props:['groupData','ind','isLast','baseTypes','firstPlace','disabled','showAdd'],
-        data(){
-            return {
-                //baseTermTypeList:[],
-                typeList:[],
-                numTypes:'',    //只有数值类型的类型id
-                operMaxList:[
-                    {name:'<=',key:'<='},
-                    {name:'<',key:'<'},
-                ],
-                operMinList:[{name:'>',key:'>'},
-                    {name:'>=',key:'>='},
-                ],
-                dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
-                conceptList:[],
-                rules:{
-                    subDescription:[{ required: true, message: '请输入基础规则名称',trigger: ['blur'] },{
-                        validator: (rule,value,callback)=>{
-                            if(value&&value.length>100){
-                                callback(new Error('规则名称不能超过100字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'change'
-                    }],
-                    subType:[{ required: true, message: '请选择基础规则类型',trigger: ['change'] }],
-                    subLenCode:[{ required: true, message: '请选择基础规则术语类型',trigger: ['change'] }],
-                    subConceptId:[{ required: true, message: '请输入医学标准术语',trigger: ['blur'] }],
-                    dataType:[{ required: true, message: '请选择类型',trigger: ['change'] }],
-                    subMaxOperator:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxValue,subMinOperator,subMinValue}=this.groupData;
-                            const val=value+subMinOperator+subMinValue+subMaxValue;
-                            if(!val||(!value&&subMaxValue!=='')){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subMinOperator:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxValue,subMaxOperator,subMinValue}=this.groupData;
-                            const val=value+subMaxOperator+subMinValue+subMaxValue;
-                            if(!val||(!value&&subMinValue!=='')){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subMaxValue:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxOperator,subMinOperator,subMinValue}=this.groupData;
-                            const val=value+subMaxOperator+subMinValue+subMinOperator;
-                            const isNum=/^(\-|\+)?\d+(\.\d+)?$/.test(value);
-                            if(!val||(value==''&&subMaxOperator)){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else if(value!==''&&!isNum){
-                                callback(new Error('只能输入数字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subMinValue:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxValue,subMinOperator,subMaxOperator}=this.groupData;
-                            const val=value+subMaxOperator+subMaxValue+subMinOperator;
-                            const isNum=/^(\-|\+)?\d+(\.\d+)?$/.test(value);
-                            if(!val||(value==''&&subMinOperator)){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else if(value!==''&&!isNum){
-                                callback(new Error('只能输入数字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subEqValue:[{
-                        validator: (rule,value,callback)=>{
-                            if(value===''){
-                                callback(new Error('请输入'+this.textName));
-                            }else if(value.length>200){
-                                callback(new Error(this.textName+'不能超过200字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                },
-            }
-        },
-        watch:{
-            'groupData':{
-                handler:function(val){
-                    this.$emit("changeVal",val,this.ind);
-                },
-                deep:true
-            },
-            /*'baseTypes':{
-                handler:function(val){
-                    if(!this.groupData.subType){
-                        this.baseTermTypeList =[];
-                        return;
-                    }
-                    const obj = val.find((it)=>it.type===this.groupData.subType);
-                    this.baseTermTypeList = obj.subMenuList;
-                },
-                deep:true
-            },*/
-            'firstPlace':{
-                handler:function(val) {
-                    if (this.ind!==0||!val) return;
-                    const dict = localStorage.getItem("zskDicts").match(new RegExp(val.checkedType+'-\\d+','g'))||[];
-                    const types = dict[0].split("-");
-                    this.groupData.subType = +types[2];
-                    this.groupData.subLenCode = types[1];
-                    this.conceptList = [val];
-                    this.groupData.subDescription = val.conceptName;
-                    this.groupData.subConceptId = val.conceptId;
-                    this.groupData.subConceptName = val.conceptName;
-                },
-                deep:true
-            }
-        },
-        created(){
-            this.numTypes = localStorage.getItem("zskNumDict");
-            this.conceptList=[{conceptName:this.groupData.subLibName||this.groupData.subConceptName,conceptId:this.groupData.subConceptId}];
-        },
-        computed:{
-            baseTermTypeList:function(){
-                if(!this.baseTypes.length){
-                    return [];
-                }
-                const sub = this.baseTypes.find((it) => it.type === this.groupData.subType)||{};
-                return sub.subMenuList;
-            },
-            showDataType:function(){
-               return (this.numTypes+',').indexOf(this.groupData.subLenCode+',')===-1;
-            },
-            textName:function(){
-                return this.groupData.subType!==6&&this.groupData.dataType==='2'?'医学内容':'正则表达式';
-            }
-        },
-        methods:{
-            dataTypeChange(val){
-                this.groupData.subEqOperator=(val==='2'?'=':'');
-                this.clearNumText();
-                delete this.groupData.dataType;     //触发更新
-                this.$set(this.groupData,'dataType',val);
-            },
-            subTypeChange(val){        //基础规则类型修改
-                this.groupData.subLenCode='';
-                this.groupData.dataType='';
-                this.clearConcept();
-                this.clearNumText();
-            },
-            subCodeChange(val){        //基础规则术语类型修改
-                this.groupData.subLenCode=val;
-                if((this.numTypes+',').indexOf(val+',')>-1){
-                    this.groupData.dataType='1';
-                }else{
-                    this.groupData.dataType='';
-                }
-                this.clearConcept();
-                this.clearNumText();
-            },
-            clearConcept(){
-              this.groupData.subConceptId='';
-              this.conceptList=[];
-            },
-            clearNumText(){
-                this.groupData.subMaxOperator='';
-                this.groupData.subMaxValue='';
-                this.groupData.subMaxUnit='';
-                this.groupData.subMinOperator='';
-                this.groupData.subMinValue='';
-                this.groupData.subMinUnit='';
-                this.groupData.subEqValue='';
-                this.groupData.subEqOperator='';
-            },
-            searchConcept(val){
-                const param = {
-                    excludedConceptIds:[this.groupData.subType],
-                    libType:this.groupData.subLenCode,
-                    name:val,
-                };
-                api.searchConcept(param).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.conceptList = data;
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            addRule(){
-                this.$emit("addRule");
-            },
-            delRule(){
-                if(this.isLast){
-                    this.warning("初始状态规则不能删除~");
-                    return;
-                }
-                //this.showConfirmDialog("是否删除该条规则,可能对现有系统会造成影响",()=>{
-                    this.$emit("delRule",this.ind);
-                //});
-
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-        }
-    }
-</script>
-<style lang="less">
-    .groups-cont{
-        background: #fff;
-        .conceptItem{
-            padding: 0 10px;
-            cursor: pointer;
-            height: 32px;
-            line-height: 32px;
-            &:hover{
-                background: #ebedf1;
-            }
-        }
-        .inner-oper{
-            padding: 15px 0 15px 21px;
-            .add-btn {
-                cursor: pointer;
-                img {
-                    vertical-align: middle;
-                }
-            }
-        }
-        .sub-condition-form{
-            padding: 20px;
-            position: relative;
-            border-bottom:2px solid #F5F5F5;
-            .del-btn{
-                color: #FF5B5B;
-                cursor: pointer;
-                position: absolute;
-                right: 20px;
-                top:20px;
-                z-index: 1;
-                &.disable{
-                    color: #B8B8B8;
-                }
-            }
-        }
-        .el-input__icon{
-            line-height: 32px;
-        }
-        .select-item{
-            &>div{
-                float: left;
-                margin-right: 10px;
-            }
-            .el-input{
-                width: auto;
-            }
-            input{
-                width: 95px;
-                line-height: 32px;
-                height: 32px;
-            }
-        }
-        .el-input,.el-input__inner{
-            width: 190px;
-            line-height: 32px;
-            height: 32px;
-        }
-        .el-button--danger.is-plain{
-            background: none;
-        }
-        .itemList {
-            position: absolute;
-            // display: none;
-            background: #fff;
-            width: 188px;
-            max-height: 160px;
-            border: 1px solid #DCDFE6;
-            left: 0;
-            top: 37px;
-            z-index: 2;
-            overflow-y: auto;
-        }
-        .el-form-item{
-            margin-bottom: 22px;
-            &.min-margin{
-                margin-bottom: 0;
-            }
-        }
-        .el-form-item__error{
-            top: auto;
-            white-space: nowrap;
-            background: #fff;
-        }
-        .el-input-number{
-            width: 95px;
-        }
-        .el-input-number.is-controls-right .el-input-number__decrease, .el-input-number.is-controls-right .el-input-number__increase{
-            width: 25px;
-            height: 15px;
-            line-height: 16px;
-        }
-        .el-col-3 {
-            width: 94px;
-        }
-    }
-</style>

+ 0 - 117
src/components/knowledgeExtra/SubRulesGroup.vue

@@ -1,117 +0,0 @@
-<template>
-    <div class="sub-groups" v-if="data">
-        <SubConditions v-for="(rules,i) in data"
-                       ref="group"
-                       :groupData="rules"
-                       :isLast="data.length===1"
-                       :ind="i"
-                       :showAdd="data.length<maxNum"
-                       :baseTypes="baseTypes"
-                       :firstPlace="firstPlace"
-                       :disabled="i===0&&disable"
-                       @changeVal="handleInput"
-                       @addRule="addRule"
-                       @delRule="delRule"></SubConditions>
-        <div class="group-oper">
-            <el-button size="small" @click="addGroup">+新增分组</el-button>
-            <el-button :disabled="isLast" size="small" type="danger" plain @click="delGroup">-删除分组</el-button>
-        </div>
-    </div>
-</template>
-<script>
-    import SubConditions from './SubConditions.vue';
-    export default {
-        name:'SubRulesGroup',
-        props:['data','inx','isLast','baseTypes','maxNum','firstPlace'],
-        data(){
-            return {
-            }
-        },
-        computed:{
-          'disable':function(){
-              return Object.keys(this.firstPlace||{}).length>0;
-          }
-        },
-        methods:{
-            handleInput(val,i){
-                this.data[i]=val;
-            },
-            addRule(){
-                let temp={
-                    subDescription:'',
-                    subConceptId:'',
-                    subType:'',
-                    subLenName:'',
-                    subLenCode:'',
-                    subLibName:'',
-                    subMaxOperator:'',
-                    subMaxUnit:'',
-                    subMaxValue:'',
-                    subMinOperator:'',
-                    subMinUnit:'',
-                    subMinValue:'',
-                    subEqValue:'',
-                    dataType:'',
-                };
-                this.data.push(temp);
-            },
-            delRule(i){
-                if(i===0&&this.data.length===1){
-                    this.$emit("delGroup",this.inx);
-                    return;
-                }
-                this.data.splice(i,1);
-            },
-            addGroup(){
-                this.$emit("addGroup");
-            },
-            delGroup(){
-               this.$emit("delGroup",this.inx);
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {
-                    this.warning("删除失败,请重试!")
-                });
-            },
-        },
-        components:{
-            SubConditions
-        }
-    }
-</script>
-<style lang="less" scoped>
-    .sub-groups{
-        background: #F5F5F5;
-        padding: 20px;
-    }
-    .group-oper{
-        text-align: center;
-        padding: 11px 0;
-        border-top: 4px solid #F5F5F5;
-        background: #fff;
-    }
-    .el-button--danger.is-plain:focus, .el-button--danger.is-plain:hover{
-        color: #fbc4c4;
-        border-color:#fbc4c4;
-    }
-    .el-button--danger.is-plain{
-        background: none;
-        &.is-disabled{
-            color: #f9a7a7;
-            background-color: #fef0f0;
-            border-color: #fde2e2;
-        }
-    }
-</style>

+ 635 - 0
src/components/knowledgeExtra/_AddNewRule.vue

@@ -0,0 +1,635 @@
+<template>
+  <div>
+    <crumbs
+      :title="title"
+      :param="$route.params"
+      linkTo="ZskRuleManager"
+    ></crumbs>
+    <div class="contents">
+      <div class="content2">
+        <el-form
+          ref="form"
+          :label-position="labelPosition"
+          class="add-new-form"
+          label-width="130px"
+          :model="form"
+          :rules="rules"
+        >
+          <div class="table_header">
+            <el-form-item label="规则名称:" prop="parDescription">
+              <el-input v-model.trim="form.parDescription"></el-input>
+            </el-form-item>
+            <el-form-item label="规则类型:" prop="parRuleType">
+              <el-select
+                v-model="form.parRuleType"
+                placeholder="请选择"
+                size="small"
+                @change="ruleTypeChange"
+              >
+                <el-option
+                  v-for="item in ruleTypeList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <div class="tip-text">
+                注:更改规则类型,将会清空已填写的规则内容~
+              </div>
+            </el-form-item>
+            <el-form-item label="规则术语类型:" prop="parLenCode">
+              <el-select
+                v-model="form.parLenCode"
+                placeholder="请选择"
+                size="small"
+                @change="ruleTermChange"
+              >
+                <el-option
+                  v-for="item in ruleTermTypeList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.code"
+                >
+                </el-option>
+              </el-select>
+              <div class="tip-text">
+                注:更改规则术语类型,将会清空已填写的规则内容~
+              </div>
+            </el-form-item>
+            <el-form-item
+              class="addDepartFormItem"
+              label="医学标准术语:"
+              prop="parConceptId"
+            >
+              <el-select
+                clearable
+                filterable
+                remote
+                :remote-method="searchConcept"
+                v-model.trim="form.parConceptId"
+              >
+                <el-option
+                  v-for="item in conceptList"
+                  :key="item.conceptId"
+                  :label="item.conceptName"
+                  :value="item.conceptId"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              v-if="showHasSub"
+              label="有无子条件:"
+              prop="parHasSub"
+            >
+              <el-select
+                v-model="form.parHasSub"
+                placeholder="请选择"
+                size="small"
+                @change="hasSubChange"
+              >
+                <el-option
+                  v-for="item in hasSub"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              v-if="showMsg"
+              label="附加信息:"
+              prop="parMsg"
+              class="parMsg"
+              style="flex: 1"
+            >
+              <el-input
+                type="textarea"
+                :rows="3"
+                placeholder="请输入附加信息"
+                v-model.trim="form.parMsg"
+              ></el-input>
+            </el-form-item>
+          </div>
+
+          <el-form-item
+            v-if="form.parHasSub === 1"
+            prop="remind"
+            label-width="0"
+            class="discDesc"
+          >
+            <h4>规则内容</h4>
+            <SubRulesGroup
+              v-for="(group, i) in subGroups"
+              ref="groups"
+              :key="i"
+              :data="group"
+              :baseTypes="baseTypeList"
+              :inx="i"
+              :maxNum="subRuleMaxNum"
+              :firstPlace="firstPlace"
+              :isLast="subGroups.length === 1"
+              @addGroup="addGroup"
+              @delGroup="delGroup"
+            ></SubRulesGroup>
+          </el-form-item>
+          <el-button
+            class="disclButn"
+            size="small"
+            type="primary"
+            @click="confirm"
+            >保存</el-button
+          >
+        </el-form>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import api from "@api/knowledgeLib.js";
+import SubRulesGroup from "./SubRulesGroup";
+import ComTable from "./table";
+export default {
+  name: "AddRule",
+  data() {
+    return {
+      labelPosition: "left",
+      isFirst: true,
+      isCopy: false,
+      dict: "", //规则内容固定的类型
+      msgDict: "", //显示附加信息的类型
+      title: "规则维护-添加规则",
+      ruleTermTypeList: [],
+      ruleTypeList: [],
+      conceptList: [],
+      baseTypeList: [],
+      conceptName: "",
+      subRuleMaxNum: null, //规则内容中规则的限制个数
+      firstPlace: null,
+      subGroups: [
+        [
+          {
+            subDescription: "",
+            parRuleType: "",
+            subConceptId: "",
+            subType: "",
+            subMaxOperator: "",
+            subMaxUnit: "",
+            subMaxValue: "",
+            subMinOperator: "",
+            subMinUnit: "",
+            subMinValue: "",
+            subEqValue: "",
+            subLenCode: "",
+            dataType: ""
+          }
+        ]
+      ],
+      form: {
+        parDescription: "",
+        parRuleType: "",
+        parConceptId: "",
+        parlibName: "",
+        parLenName: "",
+        parHasSub: undefined,
+        parLenCode: "",
+        parMsg: "",
+        klRuleInfoSaveSub: []
+      },
+      parId: null,
+      rules: {
+        parDescription: [
+          { required: true, message: "请输入规则名称", trigger: ["blur"] },
+          {
+            validator: (rule, value, callback) => {
+              if (value.length > 100) {
+                callback(new Error("规则名称不能超过100字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ],
+        parRuleType: [
+          { required: true, message: "请选择规则类型", trigger: ["change"] }
+        ],
+        parLenCode: [
+          { required: true, message: "请选择规则术语类型", trigger: ["change"] }
+        ],
+        parConceptId: [
+          { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+        ],
+        parHasSub: [
+          { required: true, message: "请选择有无子条件", trigger: ["change"] }
+        ],
+        parMsg: [
+          { required: true, message: "请输入附加信息", trigger: ["change"] },
+          {
+            validator: (rule, value, callback) => {
+              if (value.length > 100) {
+                callback(new Error("附加信息不能超过100字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ]
+      },
+      hasSub: [
+        { name: "有", id: 1 },
+        { name: "无", id: 0 }
+      ]
+    };
+  },
+  updated() {
+    console.log(JSON.stringify(this.subGroups));
+  },
+  created() {
+    this.getTypeList();
+    this.setDict();
+    const param = this.$route.params;
+    let info = param.data;
+    if (info) {
+      this.parId = info.parId;
+      this.isCopy = param.copy;
+      this.title = "规则维护-" + (this.isCopy ? "复制" : "修改") + "规则";
+      this.form = Object.assign({}, this.form, info);
+      this.conceptList = [
+        { conceptName: this.form.parlibName, conceptId: this.form.parConceptId }
+      ];
+      this.subGroups = this.formatGroupDatas(info.klRuleByIdSub);
+    }
+  },
+  watch: {
+    "form.parRuleType": function (val) {
+      const obj = this.ruleTypeList.find((it) => it.id === val);
+      this.ruleTermTypeList = obj.subMenuList;
+    },
+    "form.parLenCode": function (val) {
+      if (!val) {
+        this.baseTypeList = [];
+        return;
+      }
+      const obj = this.ruleTermTypeList.find((it) => it.code === val);
+      this.baseTypeList = obj.subMenuList;
+      this.subRuleMaxNum = obj.number;
+    },
+    "form.parConceptId": function (val) {
+      if (val && this.checkFirstPlace && this.conceptList) {
+        this.firstPlace = this.conceptList.find((it) => it.conceptId === val);
+        this.firstPlace["checkedType"] = this.ruleTermCodeStr;
+      } else if (!val) {
+        this.setInitGroupData();
+        this.firstPlace = null;
+      } else {
+        this.firstPlace = null;
+      }
+    }
+  },
+  components: {
+    SubRulesGroup,
+    ComTable
+  },
+  computed: {
+    ruleTermCodeStr: function () {
+      return this.form.parRuleType + "-" + this.form.parLenCode;
+    },
+    checkFirstPlace: function () {
+      return this.dict.indexOf(this.ruleTermCodeStr) > -1;
+    },
+    showMsg: function () {
+      return (
+        this.ruleTermCodeStr.length > 1 &&
+        this.msgDict.indexOf(this.ruleTermCodeStr) > -1
+      );
+    },
+    showHasSub: function () {
+      return this.subDict.indexOf(this.ruleTermCodeStr) > -1;
+    }
+  },
+  methods: {
+    hasSubChange(val) {
+      if (val) {
+        this.subGroups = [
+          [
+            {
+              subDescription: "",
+              parRuleType: "",
+              subConceptId: "",
+              subType: "",
+              subMaxOperator: "",
+              subMaxUnit: "",
+              subMaxValue: "",
+              subMinOperator: "",
+              subMinUnit: "",
+              subMinValue: "",
+              subEqValue: "",
+              subLenCode: "",
+              dataType: ""
+            }
+          ]
+        ];
+      }
+    },
+    setDict() {
+      this.dict = localStorage.getItem("zskDicts");
+      this.msgDict = localStorage.getItem("zskMsgDict");
+      this.subDict = localStorage.getItem("zskSubDict");
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    formatGroupDatas(data) {
+      let arr = [];
+      data.map((it) => {
+        if (!arr[it.groupType]) {
+          arr[it.groupType] = [];
+        }
+        if (it.subMaxOperator || it.subMinOperator) {
+          it.dataType = "1";
+        } else if (it.subEqValue) {
+          it.dataType = "2";
+        }
+        arr[it.groupType].push(it);
+      });
+      arr = arr.filter((it) => {
+        if (it) return it;
+      });
+      return arr;
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.form.parRuleType],
+        libType: this.form.parLenCode,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then((res) => {
+          if (res.data.code == "0") {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+    ruleTypeChange(val) {
+      //规则类型选中
+      this.form.parRuleType = val;
+      this.form.parLenCode = "";
+      this.form.parMsg = "";
+      const obj = this.ruleTypeList.find((it) => it.id === val); //console.log(val)
+      this.ruleTermTypeList = obj.subMenuList;
+      this.setInitGroupData();
+    },
+    ruleTermChange(val) {
+      //规则术语类型选中
+      this.form.parLenCode = val;
+      this.form.parMsg = "";
+      const obj = this.ruleTermTypeList.find((it) => it.code === val);
+      this.form.parLenName = obj.name;
+      this.baseTypeList = obj.subMenuList;
+      this.subRuleMaxNum = obj.number;
+      this.setInitGroupData();
+      this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
+    },
+    getTypeList() {
+      const typeListData = JSON.parse(localStorage.getItem("zskTypesList"));
+      this.ruleTypeList = typeListData;
+    },
+    setInitGroupData() {
+      this.subGroups = [
+        [
+          {
+            subDescription: "",
+            parRuleType: "",
+            subConceptId: "",
+            subType: "",
+            subMaxOperator: "",
+            subMaxUnit: "",
+            subMaxValue: "",
+            subMinOperator: "",
+            subMinUnit: "",
+            subMinValue: "",
+            subEqValue: "",
+            subLenCode: "",
+            dataType: ""
+          }
+        ]
+      ];
+      this.form.parConceptId = ""; //医学标准术语清空
+      this.conceptList = []; //下拉列表清空
+    },
+    addGroup() {
+      let temp = {
+        subDescription: "",
+        subConceptId: "",
+        subType: "",
+        subLenCode: "",
+        dataType: "",
+        subMaxOperator: "",
+        subMaxUnit: "",
+        subMaxValue: "",
+        subMinOperator: "",
+        subMinUnit: "",
+        subMinValue: "",
+        subEqValue: ""
+      };
+      if (this.checkFirstPlace) {
+        const obj = this.subGroups[0][0];
+        temp = {
+          subDescription: obj.subConceptName,
+          subConceptId: obj.subConceptId,
+          subConceptName: obj.subConceptName,
+          subLenCode: this.form.parLenCode,
+          subLenName: this.form.parLenName,
+          subLibName: this.form.parlibName,
+          subType: obj.subType,
+          dataType: "",
+          subMaxOperator: "",
+          subMaxUnit: "",
+          subMaxValue: "",
+          subMinOperator: "",
+          subMinUnit: "",
+          subMinValue: "",
+          subEqValue: ""
+        };
+      }
+      this.subGroups.push([temp]);
+    },
+    delGroup(i) {
+      //this.subGroups.splice(i,1);
+      this.$set(this.subGroups, i, null);
+    },
+    saveRule(params) {
+      api.saveRule(params).then((res) => {
+        if (res.data.code == 0) {
+          this.$message({
+            message: "操作成功",
+            type: "success"
+          });
+          this.$router.push({
+            name: "ZskRuleManager",
+            params: Object.assign({}, this.$route.params, { currentPage: 1 })
+          });
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: "warning"
+          });
+        }
+      });
+    },
+    formatGroups() {
+      let obj = [];
+      this.subGroups.map((item, i) => {
+        item &&
+          item.map((it) => {
+            obj.push({ ...it, groupType: i + 1 });
+          });
+      });
+      return obj;
+    },
+    validateForms(callBack) {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          const groupsRef = this.$refs["groups"];
+          if (!groupsRef || groupsRef.length === 0) {
+            callBack();
+            return;
+          }
+          let groupRef = null,
+            goOn = true;
+          for (let i = 0; i < groupsRef.length; i++) {
+            groupRef = groupsRef[i].$refs["group"];
+            for (let j = 0; j < groupRef.length; j++) {
+              groupRef[j].$refs["groupData"].validate((valid) => {
+                if (!valid) {
+                  goOn = false;
+                }
+              });
+            }
+          }
+          if (goOn) {
+            callBack();
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    confirm() {
+      const _this = this;
+      this.validateForms(function () {
+        delete _this.form.klRuleByIdSub;
+        _this.form.klRuleInfoSaveSub = _this.form.parHasSub
+          ? _this.formatGroups()
+          : undefined;
+        let params = _this.form;
+        if (_this.parId) {
+          //修改/复制
+          params = Object.assign({}, _this.form, {
+            parId: _this.isCopy ? undefined : _this.parId,
+            parStatus: _this.isCopy ? 1 : _this.form.parStatus
+          });
+        }
+        console.log(params);
+        _this.saveRule(params);
+      });
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+@import "../../less/admin.less";
+.content2 {
+  background-color: #dee2ea;
+  // padding: 20px 20px 30px;
+  //   padding: 20px 20px 50px;
+  color: #545455;
+  min-width: 980px;
+  position: relative;
+  .tip-text {
+    color: #f56c6c;
+    font-size: 12px;
+    margin-left: -80px;
+  }
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .discDesc {
+    margin-bottom: 20px;
+  }
+  .disclButn {
+    position: absolute;
+    right: 80px;
+    bottom: 10px;
+  }
+}
+.add-new-form {
+  .el-form-item__label {
+    text-align: right;
+  }
+  .addDepartFormItem {
+    position: relative;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .indexList {
+    left: 42px;
+    top: 78px;
+  }
+  .el-input__prefix,
+  .el-input__suffix {
+    /*top:-2px;*/
+    right: 3px;
+  }
+  .el-input--suffix .el-input__inner {
+    padding-right: 22px;
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+}
+.table_header {
+  background: #fff;
+  padding: 20px;
+  display: flex;
+  flex-wrap: wrap;
+}
+</style>

+ 635 - 0
src/components/knowledgeExtra/_SubConditions.vue

@@ -0,0 +1,635 @@
+<template>
+  <div class="groups-cont">
+    <el-form
+      ref="groupData"
+      label-width="150px"
+      class="sub-condition-form"
+      :model="groupData"
+      :rules="rules"
+    >
+      <span v-if="!disabled && !isLast" class="del-btn" @click="delRule"
+        >删除</span
+      ><!--:class="isLast?'disable del-btn':'del-btn'"-->
+      <el-form-item label="基础规则名称:" prop="subDescription">
+        <el-input
+          v-model.trim="groupData.subDescription"
+          :disabled="disabled"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="基础规则类型:" prop="subType">
+        <el-select
+          v-model="groupData.subType"
+          :disabled="disabled"
+          placeholder="请选择"
+          size="small"
+          @change="subTypeChange"
+        >
+          <el-option
+            v-for="item in baseTypes"
+            :key="item.id"
+            :label="item.name"
+            :value="item.type"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="基础规则术语类型:" prop="subLenCode">
+        <el-select
+          v-model="groupData.subLenCode"
+          :disabled="disabled"
+          placeholder="请选择"
+          size="small"
+          @change="subCodeChange"
+        >
+          <el-option
+            v-for="item in baseTermTypeList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.code"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="addDepartFormItem"
+        label="医学标准术语:"
+        prop="subConceptId"
+      >
+        <el-select
+          clearable
+          remote
+          filterable
+          :disabled="disabled"
+          :remote-method="searchConcept"
+          v-model.trim="groupData.subConceptId"
+        >
+          <el-option
+            v-for="item in conceptList"
+            :key="item.conceptId"
+            :label="item.conceptName"
+            :value="item.conceptId"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="groupData.subType === 2 && showDataType"
+        label="选择类型:"
+        prop="dataType"
+      >
+        <el-select
+          v-model="groupData.dataType"
+          placeholder="请选择"
+          size="small"
+          @change="dataTypeChange"
+        >
+          <el-option
+            v-for="item in dataTypes"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="groupData.dataType === '1'"
+        label="最大值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item prop="subMaxOperator">
+              <el-select
+                v-model="groupData.subMaxOperator"
+                placeholder="请选择"
+                size="small"
+                clearable
+              >
+                <el-option
+                  v-for="item in operMaxList"
+                  :key="item.key"
+                  :label="item.name"
+                  :value="item.key"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMaxValue">
+              <el-input
+                type="text"
+                v-model="groupData.subMaxValue"
+                placeholder="填写数值"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMaxUnit">
+              <el-input
+                type="text"
+                v-model.trim="groupData.subMaxUnit"
+                placeholder="填写单位"
+              />
+            </el-form-item>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="groupData.dataType === '1'"
+        label="最小值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item prop="subMinOperator">
+              <el-select
+                v-model="groupData.subMinOperator"
+                placeholder="请选择"
+                size="small"
+                clearable
+              >
+                <el-option
+                  v-for="item in operMinList"
+                  :key="item.name"
+                  :label="item.name"
+                  :value="item.name"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMinValue">
+              <el-input
+                type="text"
+                v-model="groupData.subMinValue"
+                placeholder="填写数值"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMinUnit">
+              <el-input
+                type="text"
+                v-model.trim="groupData.subMinUnit"
+                placeholder="填写单位"
+              />
+            </el-form-item>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        v-if="groupData.subType !== 6 && groupData.dataType === '2'"
+        label="医学内容:"
+        prop="subEqValue"
+        class="discDesc is-required"
+      >
+        <el-input
+          type="textarea"
+          rows="3"
+          placeholder="请输入医学内容"
+          v-model.trim="groupData.subEqValue"
+        ></el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="groupData.subType === 6"
+        label="正则表达式:"
+        prop="subEqValue"
+        class="discDesc is-required"
+      >
+        <el-input
+          type="textarea"
+          rows="3"
+          placeholder="请输入正则表达式"
+          v-model.trim="groupData.subEqValue"
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <div class="inner-oper" v-if="showAdd">
+      <span>新增规则:</span>
+      <span class="add-btn" @click="addRule"
+        ><img src="../../images/add.png" alt="新增规则"
+      /></span>
+    </div>
+  </div>
+</template>
+<script>
+import api from "@api/knowledgeLib.js";
+export default {
+  name: "subCondititons",
+  props: [
+    "groupData",
+    "ind",
+    "isLast",
+    "baseTypes",
+    "firstPlace",
+    "disabled",
+    "showAdd"
+  ],
+  data() {
+    return {
+      //baseTermTypeList:[],
+      typeList: [],
+      numTypes: "", //只有数值类型的类型id
+      operMaxList: [
+        { name: "<=", key: "<=" },
+        { name: "<", key: "<" }
+      ],
+      operMinList: [
+        { name: ">", key: ">" },
+        { name: ">=", key: ">=" }
+      ],
+      dataTypes: [
+        { id: "1", name: "数值类型" },
+        { id: "2", name: "文本类型" }
+      ],
+      conceptList: [],
+      rules: {
+        subDescription: [
+          { required: true, message: "请输入基础规则名称", trigger: ["blur"] },
+          {
+            validator: (rule, value, callback) => {
+              if (value && value.length > 100) {
+                callback(new Error("规则名称不能超过100字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ],
+        subType: [
+          { required: true, message: "请选择基础规则类型", trigger: ["change"] }
+        ],
+        subLenCode: [
+          {
+            required: true,
+            message: "请选择基础规则术语类型",
+            trigger: ["change"]
+          }
+        ],
+        subConceptId: [
+          { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+        ],
+        dataType: [
+          { required: true, message: "请选择类型", trigger: ["change"] }
+        ],
+        subMaxOperator: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxValue,
+                subMinOperator,
+                subMinValue
+              } = this.groupData;
+              const val = value + subMinOperator + subMinValue + subMaxValue;
+              if (!val || (!value && subMaxValue !== "")) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subMinOperator: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxValue,
+                subMaxOperator,
+                subMinValue
+              } = this.groupData;
+              const val = value + subMaxOperator + subMinValue + subMaxValue;
+              if (!val || (!value && subMinValue !== "")) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subMaxValue: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxOperator,
+                subMinOperator,
+                subMinValue
+              } = this.groupData;
+              const val = value + subMaxOperator + subMinValue + subMinOperator;
+              const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+              if (!val || (value == "" && subMaxOperator)) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else if (value !== "" && !isNum) {
+                callback(new Error("只能输入数字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subMinValue: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxValue,
+                subMinOperator,
+                subMaxOperator
+              } = this.groupData;
+              const val = value + subMaxOperator + subMaxValue + subMinOperator;
+              const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+              if (!val || (value == "" && subMinOperator)) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else if (value !== "" && !isNum) {
+                callback(new Error("只能输入数字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subEqValue: [
+          {
+            validator: (rule, value, callback) => {
+              if (value === "") {
+                callback(new Error("请输入" + this.textName));
+              } else if (value.length > 200) {
+                callback(new Error(this.textName + "不能超过200字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ]
+      }
+    };
+  },
+  watch: {
+    groupData: {
+      handler: function (val) {
+        this.$emit("changeVal", val, this.ind);
+      },
+      deep: true
+    },
+    /*'baseTypes':{
+                handler:function(val){
+                    if(!this.groupData.subType){
+                        this.baseTermTypeList =[];
+                        return;
+                    }
+                    const obj = val.find((it)=>it.type===this.groupData.subType);
+                    this.baseTermTypeList = obj.subMenuList;
+                },
+                deep:true
+            },*/
+    firstPlace: {
+      handler: function (val) {
+        if (this.ind !== 0 || !val) return;
+        const dict =
+          localStorage
+            .getItem("zskDicts")
+            .match(new RegExp(val.checkedType + "-\\d+", "g")) || [];
+        const types = dict[0].split("-");
+        this.groupData.subType = +types[2];
+        this.groupData.subLenCode = types[1];
+        this.conceptList = [val];
+        this.groupData.subDescription = val.conceptName;
+        this.groupData.subConceptId = val.conceptId;
+        this.groupData.subConceptName = val.conceptName;
+      },
+      deep: true
+    }
+  },
+  created() {
+    this.numTypes = localStorage.getItem("zskNumDict");
+    this.conceptList = [
+      {
+        conceptName: this.groupData.subLibName || this.groupData.subConceptName,
+        conceptId: this.groupData.subConceptId
+      }
+    ];
+  },
+  computed: {
+    baseTermTypeList: function () {
+      if (!this.baseTypes.length) {
+        return [];
+      }
+      const sub =
+        this.baseTypes.find((it) => it.type === this.groupData.subType) || {};
+      return sub.subMenuList;
+    },
+    showDataType: function () {
+      return (
+        (this.numTypes + ",").indexOf(this.groupData.subLenCode + ",") === -1
+      );
+    },
+    textName: function () {
+      return this.groupData.subType !== 6 && this.groupData.dataType === "2"
+        ? "医学内容"
+        : "正则表达式";
+    }
+  },
+  methods: {
+    dataTypeChange(val) {
+      this.groupData.subEqOperator = val === "2" ? "=" : "";
+      this.clearNumText();
+      delete this.groupData.dataType; //触发更新
+      this.$set(this.groupData, "dataType", val);
+    },
+    subTypeChange(val) {
+      //基础规则类型修改
+      this.groupData.subLenCode = "";
+      this.groupData.dataType = "";
+      this.clearConcept();
+      this.clearNumText();
+    },
+    subCodeChange(val) {
+      //基础规则术语类型修改
+      this.groupData.subLenCode = val;
+      if ((this.numTypes + ",").indexOf(val + ",") > -1) {
+        this.groupData.dataType = "1";
+      } else {
+        this.groupData.dataType = "";
+      }
+      this.clearConcept();
+      this.clearNumText();
+    },
+    clearConcept() {
+      this.groupData.subConceptId = "";
+      this.conceptList = [];
+    },
+    clearNumText() {
+      this.groupData.subMaxOperator = "";
+      this.groupData.subMaxValue = "";
+      this.groupData.subMaxUnit = "";
+      this.groupData.subMinOperator = "";
+      this.groupData.subMinValue = "";
+      this.groupData.subMinUnit = "";
+      this.groupData.subEqValue = "";
+      this.groupData.subEqOperator = "";
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.groupData.subType],
+        libType: this.groupData.subLenCode,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then((res) => {
+          if (res.data.code == "0") {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+    addRule() {
+      this.$emit("addRule");
+    },
+    delRule() {
+      if (this.isLast) {
+        this.warning("初始状态规则不能删除~");
+        return;
+      }
+      //this.showConfirmDialog("是否删除该条规则,可能对现有系统会造成影响",()=>{
+      this.$emit("delRule", this.ind);
+      //});
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning"
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    }
+  }
+};
+</script>
+<style lang="less">
+.groups-cont {
+  background: #fff;
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .inner-oper {
+    padding: 15px 0 15px 21px;
+    .add-btn {
+      cursor: pointer;
+      img {
+        vertical-align: middle;
+      }
+    }
+  }
+  .sub-condition-form {
+    padding: 20px;
+    position: relative;
+    border-bottom: 2px solid #f5f5f5;
+    .del-btn {
+      color: #ff5b5b;
+      cursor: pointer;
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      z-index: 1;
+      &.disable {
+        color: #b8b8b8;
+      }
+    }
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+  .select-item {
+    & > div {
+      float: left;
+      margin-right: 10px;
+    }
+    .el-input {
+      width: auto;
+    }
+    input {
+      width: 95px;
+      line-height: 32px;
+      height: 32px;
+    }
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-button--danger.is-plain {
+    background: none;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .el-form-item {
+    margin-bottom: 22px;
+    &.min-margin {
+      margin-bottom: 0;
+    }
+  }
+  .el-form-item__error {
+    top: auto;
+    white-space: nowrap;
+    background: #fff;
+  }
+  .el-input-number {
+    width: 95px;
+  }
+  .el-input-number.is-controls-right .el-input-number__decrease,
+  .el-input-number.is-controls-right .el-input-number__increase {
+    width: 25px;
+    height: 15px;
+    line-height: 16px;
+  }
+  .el-col-3 {
+    width: 94px;
+  }
+}
+</style>

+ 129 - 0
src/components/knowledgeExtra/_SubRulesGroup.vue

@@ -0,0 +1,129 @@
+<template>
+  <div class="sub-groups" v-if="data">
+    <SubConditions
+      v-for="(rules, i) in data"
+      :key="i"
+      ref="group"
+      :groupData="rules"
+      :isLast="data.length === 1"
+      :ind="i"
+      :showAdd="data.length < maxNum"
+      :baseTypes="baseTypes"
+      :firstPlace="firstPlace"
+      :disabled="i === 0 && disable"
+      @changeVal="handleInput"
+      @addRule="addRule"
+      @delRule="delRule"
+    ></SubConditions>
+    <div class="group-oper">
+      <el-button size="small" @click="addGroup">+新增分组</el-button>
+      <el-button
+        :disabled="isLast"
+        size="small"
+        type="danger"
+        plain
+        @click="delGroup"
+        >-删除分组</el-button
+      >
+    </div>
+  </div>
+</template>
+<script>
+import SubConditions from "./_SubConditions.vue";
+export default {
+  name: "SubRulesGroup",
+  props: ["data", "inx", "isLast", "baseTypes", "maxNum", "firstPlace"],
+  data() {
+    return {};
+  },
+  computed: {
+    disable: function () {
+      return Object.keys(this.firstPlace || {}).length > 0;
+    }
+  },
+  methods: {
+    handleInput(val, i) {
+      this.data[i] = val;
+    },
+    addRule() {
+      let temp = {
+        subDescription: "",
+        subConceptId: "",
+        subType: "",
+        subLenName: "",
+        subLenCode: "",
+        subLibName: "",
+        subMaxOperator: "",
+        subMaxUnit: "",
+        subMaxValue: "",
+        subMinOperator: "",
+        subMinUnit: "",
+        subMinValue: "",
+        subEqValue: "",
+        dataType: ""
+      };
+      this.data.push(temp);
+    },
+    delRule(i) {
+      if (i === 0 && this.data.length === 1) {
+        this.$emit("delGroup", this.inx);
+        return;
+      }
+      this.data.splice(i, 1);
+    },
+    addGroup() {
+      this.$emit("addGroup");
+    },
+    delGroup() {
+      this.$emit("delGroup", this.inx);
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning"
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.warning("删除失败,请重试!");
+        });
+    }
+  },
+  components: {
+    SubConditions
+  }
+};
+</script>
+<style lang="less" scoped>
+.sub-groups {
+  background: #f5f5f5;
+  padding: 20px;
+}
+.group-oper {
+  text-align: center;
+  padding: 11px 0;
+  border-top: 4px solid #f5f5f5;
+  background: #fff;
+}
+.el-button--danger.is-plain:focus,
+.el-button--danger.is-plain:hover {
+  color: #fbc4c4;
+  border-color: #fbc4c4;
+}
+.el-button--danger.is-plain {
+  background: none;
+  &.is-disabled {
+    color: #f9a7a7;
+    background-color: #fef0f0;
+    border-color: #fde2e2;
+  }
+}
+</style>

+ 89 - 0
src/components/knowledgeExtra/rules.js

@@ -0,0 +1,89 @@
+export const formRules = {
+  parDescription: [
+    { required: true, message: "请输入规则名称", trigger: ["blur"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value.length > 100) {
+          callback(new Error("规则名称不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: ["change"]
+    }
+  ],
+  parRuleType: [
+    { required: true, message: "请选择规则类型", trigger: ["change"] }
+  ],
+  parLenCode: [
+    { required: true, message: "请选择规则术语类型", trigger: ["change"] }
+  ],
+  parConceptId: [
+    { required: true, message: "请输入医学标准术语", trigger: ["change"] }
+  ],
+  parHasSub: [
+    { required: true, message: "请选择有无子条件", trigger: ["change"] }
+  ],
+  parMsg: [
+    { required: true, message: "请输入附加信息", trigger: ["change"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value.length > 100) {
+          callback(new Error("附加信息不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "change"
+    }
+  ],
+
+}
+
+export const tableRules = {
+  subDescription: [
+    { required: true, message: "请输入基础规则名称", trigger: ["change","blur"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value && value.length > 100) {
+          callback(new Error("规则名称不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: ["change","blur"]
+    }
+  ],
+  subType: [
+    { required: true, message: "请选择基础规则类型", trigger: ["change"] }
+  ],
+  subLenCode: [
+    {
+      required: true,
+      message: "请选择基础规则术语类型",
+      trigger: ["blur"]
+    }
+  ],
+  subConceptId: [
+    { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+  ],
+  dataType: [
+    { required: true, message: "请选择类型", trigger: ["change"] }
+  ],
+
+
+  subEqValue: [
+    {
+      validator: (rule, value, callback) => {
+        if (value === "") {
+          callback(new Error("请输入" + this.textName));
+        } else if (value.length > 200) {
+          callback(new Error(this.textName + "不能超过200字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "blur"
+    }
+  ]
+}

+ 125 - 0
src/components/knowledgeExtra/table.vue

@@ -0,0 +1,125 @@
+<template>
+  <!-- <el-form
+    ref="groupData"
+    label-width="150px"
+    class="sub-condition-form"
+    :model="groupData"
+    :rules="rules"
+  >
+    <el-table :data="formatList" style="width: 100%">
+      <el-table-column prop="TableId" label="TableId" width="180">
+      </el-table-column>
+      <el-table-column prop="TableRowId" label="TableRowId" width="180">
+      </el-table-column>
+    </el-table>
+  </el-form> -->
+  <div>
+    <table border="1">
+      <thead>
+        <tr>
+          <th>头</th>
+          <th>头</th>
+          <th>头</th>
+          <th>头</th>
+          <th>头</th>
+        </tr>
+      </thead>
+      <tbody>
+        <form action=""> 
+          <tr>
+            <td>com</td>
+            <td>com1</td>
+            <td>com2</td>
+            <td>com3</td>
+            <td>com4</td>
+          </tr>
+        </form>
+        <form action="">
+          <tr>
+            <td>com</td>
+            <td>com1</td>
+            <td>com2</td>
+            <td>com3</td>
+            <td>com4</td>
+          </tr>
+        </form>
+      </tbody>
+    </table>
+    <div class="c_table">
+      <div class="c_row">
+        <form action="">
+          <div class="c_cell">张三</div>
+          <div class="c_cell">李四</div>
+          <div class="c_cell">王五</div>
+          <div class="c_cell">王五</div>
+        </form>
+      </div>
+      <form action="">
+        <div>
+          <div>
+            <ul>
+              <li>
+                <div class="c_row">
+                  <div class="c_cell">
+                    <div>
+                      <input type="text" name="" id="" />
+                    </div>
+                  </div>
+                  <div class="c_cell">张三</div>
+                  <div class="c_cell">李四</div>
+                  <div class="c_cell">王五</div>
+                </div>
+              </li>
+            </ul>
+          </div>
+        </div>
+      </form>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["list"],
+  data() {
+    return {};
+  },
+  computed: {
+    formatList() {
+      let list = JSON.parse(JSON.stringify(this.list));
+      let newList = [];
+      list.forEach((item, index) => {
+        item.forEach((ite, i) => {
+          ite.TableId = index + 1;
+          ite.TableRowId = i + 1;
+        });
+        newList.push(...item);
+      });
+      console.log("newList", newList);
+      return newList;
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.c_table {
+  display: table;
+  border: 1px solid #cccccc;
+  margin: 5px;
+  /*display: table时padding会失效*/
+}
+
+.c_row {
+  display: table-row;
+  border: 1px solid #cccccc;
+  /*display: table-row时margin、padding同时失效*/
+}
+
+.c_cell {
+  display: table-cell;
+  border: 1px solid #cccccc;
+  padding: 5px;
+  /*display: table-cell时margin会失效*/
+}
+</style>

BIN
src/images/add-new-rule-del.png


BIN
src/images/add-new-rule-sub.png


BIN
src/images/icon-add.png


BIN
src/images/icon-collect-left.png


BIN
src/images/icon-collect-right.png


BIN
src/images/icon-copy.png


BIN
src/images/icon-delete.png


BIN
src/images/tips.png


+ 56 - 45
src/routes.js

@@ -211,14 +211,15 @@ import AddDevKnow from '@components/knowledgeExtra/AddDevKnow.vue'   //知识库
 import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
 import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
 import KnowledgeAll from '@components/knowledgeExtra/KnowledgeAll.vue'   //知识库树
-import KnowledgeBaseType from '@components/knowledgeExtra/KnowledgeBaseType.vue'   
-import AboutDisease from '@components/knowledgeExtra/AboutDisease.vue'   
-import DiseaseTree from '@components/knowledgeExtra/DiseaseTree.vue'   
+import KnowledgeBaseType from '@components/knowledgeExtra/KnowledgeBaseType.vue'
+import AboutDisease from '@components/knowledgeExtra/AboutDisease.vue'
+import DiseaseTree from '@components/knowledgeExtra/DiseaseTree.vue'
 import AutoKnowledgeMapRuleTest from '@components/autoTest/AutoKnowledgeMapRuleTest.vue';
 import AutoBillCommonTest from '@components/autoTest/AutoBillCommonTest.vue';
 import ZskDiagBase from '@components/knowledgeExtra/DiagBase.vue';      //知识库拓展-诊断依据维护
 import AddZskDiagBase from '@components/knowledgeExtra/AddDiagBase.vue';
-
+import ZskRegisteredDrug from '@components/knowledgeExtra/RegisteredDrug.vue';
+import AddZskRegisteredDrug from '@components/knowledgeExtra/AddZskRegisteredDrug.vue';
 export default [
     {
         path: '/',
@@ -618,46 +619,56 @@ export default [
                 component: AddZskDiagBase,
                 name: 'AddZskDiagBase',
             },
-    {
-        path: 'LT-ZSKKZWH-JTXXWH',
-        component: StaticInfo,
-        name: 'StaticInfo',
-    },
-    {
-        path: 'LT-ZSKKZWH-JTXXWH-EDIT',
-        component: AddDevKnow,
-        name: 'AddDevKnow',
-    },
-    {
-        path: 'LT-ZSKKZWH-SXJGWH',
-        component: KnowledgeAll,
-        name: 'KnowledgeAll',
-    }, //树形结构维护
-    {
-        path: 'LT-ZSKJCWH-JCSYLXWH',
-        component: KnowledgeBaseType,
-        name: 'KnowledgeBaseType',
-    }, //基础术语类型维护
-    {
-        path: 'LT-ZSKKZWH-JBXGWH',
-        component: AboutDisease,
-        name: 'AboutDisease',
-    }, //疾病相关维护
-    {
-        path: 'LT-ZSKKZWH-JBXGWH-EDIT',
-        component: DiseaseTree,
-        name: 'DiseaseTree',
-    }, //疾病相关维护, 
-    {
-        path: 'LT-YYSYZDHCS-ZSTPGZCS',
-        component: AutoKnowledgeMapRuleTest,
-        name: 'AutoKnowledgeMapRuleTest',
-    }, 
-    {
-        path: 'LT-YYSYZDHCS-ZSTPGZCS-TYGZCS',
-        component: AutoBillCommonTest,
-        name: 'AutoBillCommonTest',
+            {
+                path: 'LT-ZSKKZWH-JTXXWH',
+                component: StaticInfo,
+                name: 'StaticInfo',
+            },
+            {
+                path: 'LT-ZSKKZWH-JTXXWH-EDIT',
+                component: AddDevKnow,
+                name: 'AddDevKnow',
+            },
+            {
+                path: 'LT-ZSKKZWH-SXJGWH',
+                component: KnowledgeAll,
+                name: 'KnowledgeAll',
+            }, //树形结构维护
+            {
+                path: 'LT-ZSKJCWH-JCSYLXWH',
+                component: KnowledgeBaseType,
+                name: 'KnowledgeBaseType',
+            }, //基础术语类型维护
+            {
+                path: 'LT-ZSKKZWH-JBXGWH',
+                component: AboutDisease,
+                name: 'AboutDisease',
+            }, //疾病相关维护
+            {
+                path: 'LT-ZSKKZWH-JBXGWH-EDIT',
+                component: DiseaseTree,
+                name: 'DiseaseTree',
+            }, //疾病相关维护, 
+            {
+                path: 'LT-YYSYZDHCS-ZSTPGZCS',
+                component: AutoKnowledgeMapRuleTest,
+                name: 'AutoKnowledgeMapRuleTest',
+            },
+            {
+                path: 'LT-YYSYZDHCS-ZSTPGZCS-TYGZCS',
+                component: AutoBillCommonTest,
+                name: 'AutoBillCommonTest',
+            },
+            {
+                path: 'LT-ZSKKZWH-ZCYPWH',
+                component: ZskRegisteredDrug,
+                name: 'ZskRegisteredDrug',
+            },
+            {
+                path: 'LT-ZSKKZWH-TJZCYPWH',
+                component: AddZskRegisteredDrug,
+                name: 'AddZskRegisteredDrug',
+            },
+        ],
     },
-],
-},
 ];

+ 2 - 2
vue.config.js

@@ -1,7 +1,7 @@
 const path = require('path');
 // const proxy_path = 'http://192.168.2.236:80';
-const proxy_path = 'http://192.168.2.241:88';
-// const proxy_path = 'http://192.168.2.236:88';
+// const proxy_path = 'http://192.168.2.241:88';
+const proxy_path = 'http://192.168.2.236:5050';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚
 // const proxy_path = 'http://192.168.3.113:5050'; //王峰

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 8617 - 0
yarn.lock