瀏覽代碼

Merge branch 'uiUpdate0507' into test

reaper 4 年之前
父節點
當前提交
bd9027bbe8
共有 2 個文件被更改,包括 66 次插入43 次删除
  1. 45 27
      src/components/knowledgeExtra/AddNewRule.vue
  2. 21 16
      src/components/knowledgeExtra/AddNewRuleTable.vue

+ 45 - 27
src/components/knowledgeExtra/AddNewRule.vue

@@ -1,6 +1,6 @@
 <style lang="less" scoped>
 @import "../../less/admin.less";
-.AddRuleContent {
+#AddRuleContent {
   width: 100%;
   min-width: 1000px;
   padding: 20px;
@@ -12,6 +12,7 @@
     box-sizing: border-box;
     background: #fff;
     padding: 20px;
+    padding-bottom: 0;
     display: flex;
     flex-wrap: wrap;
     .table_cell {
@@ -22,6 +23,7 @@
   /deep/ .el-input--mini .el-input__inner,
   .el-select {
     width: 100%;
+    font-size: 14px;
   }
   .tip_text {
     // margin-top: -8px;
@@ -36,6 +38,12 @@
     padding-bottom: 20px;
     text-align: center;
   }
+  /deep/ .el-form-item.is-success .el-input__inner,
+  .el-form-item.is-success .el-input__inner:focus,
+  .el-form-item.is-success .el-textarea__inner,
+  .el-form-item.is-success .el-textarea__inner:focus {
+    border-color: #c9c9c9;
+  }
 }
 </style>
 <template>
@@ -45,7 +53,7 @@
       :param="$route.params"
       linkTo="ZskRuleManager"
     ></crumbs>
-    <div class="AddRuleContent">
+    <div id="AddRuleContent">
       <el-form size="mini" :model="form" ref="ruleForm">
         <div class="table_form">
           <div class="table_cell">
@@ -422,28 +430,33 @@ export default {
       this.tableShow = false;
       const date = new Date().valueOf();
       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 (this.form.parHasSub && this.form.parHasSub != 0) {
+          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: ""
+            }
+          ]);
+        } else {
+          this.$set(this.form, "klRuleByIdSub", []);
+        }
+
         if (!init) {
           this.form.parConceptId = ""; //医学标准术语清空
           this.conceptList = []; //下拉列表清空
@@ -631,9 +644,14 @@ export default {
       deep: true
     },
     "form.parHasSub"(val) {
-      if (!val || val == 0) {
-        this.form.klRuleByIdSub = [];
-      }
+      console.log(val);
+      console.log(this.form);
+      // if (!val || val == 0) {
+      //   // this.form.klRuleByIdSub = [];
+      //   this.$set(this.form, "klRuleByIdSub", []);
+
+      //   console.log(this.form);
+      // }
     }
   },
   computed: {

+ 21 - 16
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -5,9 +5,10 @@
   margin-top: 10px;
   padding: 20px;
   box-sizing: border-box;
-  /deep/ .el-input--mini .el-input__inner,
+  /deep/ .el-table .el-input--mini .el-input__inner,
   .el-select {
     width: 100%;
+    font-size: 12px;
   }
   .btn_box {
     width: 100%;
@@ -74,9 +75,9 @@
       margin-right: 4px;
     }
   }
-  ::v-deep .el-table tbody tr:hover > td {
-    background-color: transparent;
-  }
+  // ::v-deep .el-table tbody tr:hover > td {
+  //   // background-color: transparent;
+  // }
   /deep/ .el-table th {
     background: transparent;
   }
@@ -86,9 +87,9 @@
   .table_cell_cls {
     vertical-align: top;
   }
-  /deep/ .el-table__body .el-table__row.hover-row td {
-    background-color: transparent;
-  }
+  // /deep/ .el-table__body .el-table__row.hover-row td {
+  //   // background-color: transparent;
+  // }
   /deep/ .el-form-item__label {
     font-size: 12px;
   }
@@ -96,6 +97,9 @@
     font-size: 14px;
     font-weight: 400;
   }
+  // /deep/ .el-table__body tr.current-row>td{
+  //   background: #fff;
+  // }
 }
 </style>
 
@@ -103,17 +107,18 @@
   <!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
   <div class="AddNewRuleTable">
     <h4 style="margin-bottom: 24px">规则内容:</h4>
+    <!-- 隔行换色  :row-style="rowStyle" -->
     <el-table
       border
       :data="klRuleByIdSub"
       size="mini"
       style="min-height: 200px"
-      height="calc(100vh - 415px)"
-      :row-style="rowStyle"
+      height="calc(100vh - 383px)"
       :header-row-style="{ background: '#E3EAF4' }"
       :cell-style="cellStyle"
       :span-method="ObjectSpanMethod"
       ref="table"
+      row-key="groupChildId"
     >
       <el-table-column width="80px" label="组" prop="groupType" fixed="left">
         <template slot-scope="scope">
@@ -518,13 +523,13 @@ export default {
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
     // table 隔行换色
-    rowStyle({ row }) {
-      if (row.rowIndex % 2 == 0) {
-        return {
-          background: "#DFF7EF"
-        };
-      }
-    },
+    // rowStyle({ row }) {
+    //   if (row.rowIndex % 2 == 0) {
+    //     return {
+    //       background: "#DFF7EF"
+    //     };
+    //   }
+    // },
     // cellStyle
     cellStyle({ row, column, rowIndex, columnIndex }) {
       if (column.label == "组" || column.label == "基础规则") return {};