Parcourir la source

fixbug:5月20号

reaper il y a 4 ans
Parent
commit
744322c3cc

+ 70 - 53
src/components/knowledgeExtra/AddNewRule.vue

@@ -5,12 +5,19 @@
   min-width: 1000px;
   padding: 20px;
   padding-top: 50px;
+  padding-bottom: 0;
   box-sizing: border-box;
   .table_form {
     width: 100%;
     box-sizing: border-box;
     background: #fff;
     padding: 20px;
+    display: flex;
+    flex-wrap: wrap;
+    .table_cell {
+      flex: 1;
+      min-width: 25%;
+    }
   }
   /deep/ .el-input--mini .el-input__inner,
   .el-select {
@@ -26,7 +33,7 @@
   .form_btn {
     width: 100%;
     background: #fff;
-    padding: 20px 0;
+    padding-bottom: 20px;
     text-align: center;
   }
 }
@@ -39,10 +46,9 @@
       linkTo="ZskRuleManager"
     ></crumbs>
     <div class="AddRuleContent">
-      <el-form size="mini" :model="form"  ref="ruleForm">
-        <!-- <div class="table_form"> -->
-        <el-row class="table_form">
-          <el-col :span="6">
+      <el-form size="mini" :model="form" ref="ruleForm">
+        <div class="table_form">
+          <div class="table_cell">
             <!-- 规则名称 -->
             <el-form-item
               label-width="130px"
@@ -55,9 +61,9 @@
                 v-model.trim="form.parDescription"
               />
             </el-form-item>
-          </el-col>
+          </div>
 
-          <el-col :span="6">
+          <div class="table_cell">
             <!-- 规则类型 -->
             <el-form-item
               label-width="130px"
@@ -82,8 +88,8 @@
                 注:更改规则类型,将会清空已填写的规则内容~
               </div>
             </el-form-item>
-          </el-col>
-          <el-col :span="6">
+          </div>
+          <div class="table_cell">
             <!-- 规则术语类型: -->
             <el-form-item
               label-width="130px"
@@ -108,12 +114,12 @@
                 注:更改规则术语类型,将会清空已填写的规则内容~
               </div>
             </el-form-item>
-          </el-col>
-          <el-col :span="6">
+          </div>
+          <div class="table_cell">
             <el-form-item
               label-width="130px"
               label="医学标准术语:"
-              style="margin-bottom:50px"
+              :style="{ height: '100%' }"
               :rules="rules.parConceptId"
               prop="parConceptId"
             >
@@ -134,11 +140,10 @@
                 </el-option>
               </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="6">
+          </div>
+          <div class="table_cell" v-if="showHasSub" style="max-width: 25%">
             <el-form-item
               label-width="130px"
-              v-if="showHasSub"
               label="有无子条件:"
               :rules="rules.parHasSub"
               prop="parHasSub"
@@ -152,12 +157,14 @@
                 <el-option label="无" :value="0"></el-option>
               </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="12">
+          </div>
+          <div
+            class="table_cell"
+            style="flex: 3; max-width: 50%"
+            v-if="showMsg"
+          >
             <el-form-item
-              style="flex: 1; minwidth: 500px"
               label-width="130px"
-              v-if="showMsg"
               label="附加信息:"
               :rules="rules.parMsg"
               prop="parMsg"
@@ -169,14 +176,11 @@
                 v-model.trim="form.parMsg"
               ></el-input>
             </el-form-item>
-          </el-col>
-
-          <!-- 医学标准术语 -->
-        </el-row>
-        <!-- </div> -->
+          </div>
+        </div>
         <!-- 表格 -->
         <AddNewRuleTable
-          v-if="form.parHasSub"
+          v-if="form.parHasSub && tableShow"
           :klRuleByIdSub="form.klRuleByIdSub"
           :maxNum="subRuleMaxNum"
           @subTypeChange="subTypeChange"
@@ -219,6 +223,7 @@ export default {
       parId: null,
       msgDict: "", //显示附加信息的类型
       firstPlace: null,
+      tableShow: true,
       form: {
         parDescription: "",
         parRuleType: "",
@@ -414,33 +419,37 @@ export default {
     },
     // 初始化表格
     setInitGroupData(init) {
+      this.tableShow = false;
       const date = new Date().valueOf();
-      this.$set(this.form, "klRuleByIdSub", [
-        {
-          groupId: date,
-          groupChildId: "child" + new Date().valueOf(),
-          baseTypes: this.baseTypeList,
-          baseTermTypeList: [],
-          conceptList: [],
-          subDescription: "",
-          parRuleType: "",
-          subConceptId: "",
-          subType: "",
-          subMaxOperator: "",
-          subMaxUnit: "",
-          subMaxValue: "",
-          subMinOperator: "",
-          subMinUnit: "",
-          subMinValue: "",
-          subEqValue: "",
-          subLenCode: "",
-          dataType: ""
+      this.$nextTick(() => {
+        this.$set(this.form, "klRuleByIdSub", [
+          {
+            groupId: date,
+            groupChildId: "child" + new Date().valueOf(),
+            baseTypes: this.baseTypeList,
+            baseTermTypeList: [],
+            conceptList: [],
+            subDescription: "",
+            parRuleType: "",
+            subConceptId: "",
+            subType: "",
+            subMaxOperator: "",
+            subMaxUnit: "",
+            subMaxValue: "",
+            subMinOperator: "",
+            subMinUnit: "",
+            subMinValue: "",
+            subEqValue: "",
+            subLenCode: "",
+            dataType: ""
+          }
+        ]);
+        if (!init) {
+          this.form.parConceptId = ""; //医学标准术语清空
+          this.conceptList = []; //下拉列表清空
         }
-      ]);
-      if (!init) {
-        this.form.parConceptId = ""; //医学标准术语清空
-        this.conceptList = []; //下拉列表清空
-      }
+        this.tableShow = true;
+      });
     },
     // 有无子条件切换
     hasSubChange(val) {
@@ -632,16 +641,24 @@ export default {
       return Object.keys(this.firstPlace || {}).length > 0;
     },
     ruleTermCodeStr: function () {
-      return this.form.parRuleType + "-" + this.form.parLenCode;
+      const str = this.form.parRuleType + "-" + this.form.parLenCode;
+      if (str.length <= 1) {
+        return "";
+      }
+      return str;
     },
     showMsg: function () {
+      console.log(this.ruleTermCodeStr, "???", this.msgDict);
       return (
-        this.ruleTermCodeStr.length > 1 &&
+        this.ruleTermCodeStr.length > 2 &&
         this.msgDict.indexOf(this.ruleTermCodeStr) > -1
       );
     },
     showHasSub() {
-      return this.subDict.indexOf(this.ruleTermCodeStr) > -1;
+      if (this.ruleTermCodeStr.length > 2) {
+        return this.subDict.indexOf(this.ruleTermCodeStr) != -1;
+      }
+      return false;
     },
     checkFirstPlace: function () {
       return this.dict.indexOf(this.ruleTermCodeStr) > -1;

+ 15 - 13
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -2,7 +2,7 @@
 .AddNewRuleTable {
   width: 100%;
   background: #fff;
-  margin-top: 20px;
+  margin-top: 10px;
   padding: 20px;
   box-sizing: border-box;
   /deep/ .el-input--mini .el-input__inner,
@@ -22,8 +22,8 @@
       justify-content: center;
     }
     img {
-      width: 20px;
-      height: 20px;
+      width: 16px;
+      height: 16px;
       cursor: pointer;
     }
   }
@@ -89,22 +89,26 @@
   /deep/ .el-table__body .el-table__row.hover-row td {
     background-color: transparent;
   }
-  /deep/ .el-form-item__label{
+  /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: 20px">规则内容</h4>
+    <h4 style="margin-bottom: 24px">规则内容:</h4>
     <el-table
       border
       :data="klRuleByIdSub"
       size="mini"
-      style="min-height:200px"
-      height="calc(100vh - 480px)"
+      style="min-height: 200px"
+      height="calc(100vh - 443px)"
       :row-style="rowStyle"
       :header-row-style="{ background: '#E3EAF4' }"
       :cell-style="cellStyle"
@@ -300,7 +304,7 @@
                         validator: (rule, value, callback) => {
                           subMaxOperator(scope, rule, value, callback);
                         },
-                        trigger: 'change'
+                        trigger: ['blur']
                       }
                     ]"
                   >
@@ -327,7 +331,7 @@
                         validator: (rule, value, callback) => {
                           subMaxValue(scope, rule, value, callback);
                         },
-                        trigger: 'blur'
+                        trigger: ['blur']
                       }
                     ]"
                   >
@@ -368,7 +372,7 @@
                         validator: (rule, value, callback) => {
                           subMinOperatorRule(scope, rule, value, callback);
                         },
-                        trigger: 'change'
+                        trigger: ['blur']
                       }
                     ]"
                   >
@@ -395,7 +399,7 @@
                         validator: (rule, value, callback) => {
                           subMinValueRule(scope, rule, value, callback);
                         },
-                        trigger: 'blur'
+                        trigger: [ 'blur']
                       }
                     ]"
                   >
@@ -516,7 +520,6 @@ export default {
     },
     // cellStyle
     cellStyle({ row, column, rowIndex, columnIndex }) {
-      console.log(column);
       if (column.label == "组" || column.label == "基础规则") return {};
       return { "vertical-align": "top", "padding-top": "14px" };
     },
@@ -568,7 +571,6 @@ export default {
     },
     // 医学内容rule
     subEqValue(scope, rule, value, callback) {
-      console.log(value);
       if (value === "") {
         callback(new Error("请输入" + this.textName(scope.$index)));
       } else if (value.length > 200) {

+ 22 - 20
src/components/knowledgeExtra/RuleManager.vue

@@ -47,7 +47,7 @@
                         type="index"
                         :index="indexMethod"
                         label="编号"
-                        width="80">
+                        width="60">
                 </el-table-column>
                 <el-table-column
                         prop="parDescription"
@@ -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
@@ -100,6 +100,16 @@
                           </span>
                     </template>
                 </el-table-column>
+                <el-table-column
+                        prop="modifierName"
+                        label="操作人">
+                    <template slot-scope="scope">
+                        <el-tooltip v-if="scope.row.modifierName&&scope.row.modifierName.length>8" class="item" effect="dark" :content="scope.row.modifierName" placement="top">
+                            <span>{{(scope.row.modifierName||'').slice(0,8)+'...'}}</span>
+                        </el-tooltip>
+                        <span v-if="scope.row.modifierName&&scope.row.modifierName.length<9">{{scope.row.modifierName}}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column
                         prop="gmtModified"
                         label="操作时间"
@@ -186,13 +196,13 @@
                 deep: true
             }
         },
-        beforeRouteEnter(to, from, next) {
-            next(vm => {
-                //const pm = to.param;
-                Object.assign(vm, to.params);
-                vm.inCurrentPage=to.params.currentPage;
-            })
-        },
+        // 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) => {
@@ -392,6 +402,8 @@
                     if (res.data.code == '0') {
                         this.warning('更新成功','success');
                         this.getDataList();
+                    }else{
+                        this.warning(res.data.msg||'更新失败,请重试');
                     }
                 }).catch((error) => {
                     loading.close();
@@ -418,12 +430,6 @@
     }
     .delete{
         color: red;
-        &:hover{
-            color: red;
-        }
-    }
-    .delete:hover{
-        color: red;
     }
     .review{
         color: #22ccc8;
@@ -435,14 +441,10 @@
     #upFile{
         display: none !important;
     }
-    .el-button--text.unvailable{
+    .unvailable{
         color: #FE7D3D;
         &:hover{
             color: #f19061;
         }
-        &.focus{
-            color: #f19061;
-            opacity: .6;
-        }
     }
 </style>