Prechádzať zdrojové kódy

Merge branch 'uiUpdate0507' into test

reaper 4 rokov pred
rodič
commit
f88b01c6c9

+ 10 - 2
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">

+ 73 - 19
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,12 @@
     font-size: 14px;
     font-weight: 400;
   }
+  // /deep/ .el-table__body tr.current-row>td{
+  //   background: #fff;
+  // }
+  /deep/ .el-table .cell {
+    // overflow: initial;
+  }
 }
 </style>
 
@@ -103,17 +110,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 - 403px)"
-      :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">
@@ -199,6 +207,7 @@
               :disabled="scope.row.disabled"
               placeholder="请选择"
               @change="subTypeChange($event, scope.$index)"
+              :ref="`klRuleByIdSub[${scope.$index}].subType`"
             >
               <el-option
                 v-for="item in scope.row.baseTypes"
@@ -225,6 +234,7 @@
               :disabled="scope.row.disabled"
               v-model="scope.row.subLenCode"
               placeholder="请选择"
+              :ref="`klRuleByIdSub[${scope.$index}].subLenCode`"
               @change="subCodeChange($event, scope.$index)"
             >
               <el-option
@@ -256,6 +266,7 @@
               @focus="subConceptIdfocus(scope.$index)"
               :remote-method="searchConcept"
               v-model.trim="scope.row.subConceptId"
+              :ref="`klRuleByIdSub[${scope.$index}].subConceptId`"
             >
               <el-option
                 v-for="item in scope.row.conceptList"
@@ -281,6 +292,7 @@
                 v-model="scope.row.dataType"
                 placeholder="选择类型"
                 @change="dataTypeChange($event, scope.$index)"
+                :ref="`klRuleByIdSub[${scope.$index}].dataType`"
               >
                 <el-option label="数值类型" value="1"> </el-option>
                 <el-option label="文本类型" value="2"> </el-option>
@@ -311,6 +323,7 @@
                       v-model="scope.row.subMaxOperator"
                       placeholder="请选择"
                       clearable
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
                     >
                       <el-option
                         v-for="item in operMaxList"
@@ -379,6 +392,7 @@
                       v-model="scope.row.subMinOperator"
                       placeholder="请选择"
                       clearable
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinOperator`"
                     >
                       <el-option
                         v-for="item in operMinList"
@@ -518,13 +532,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 {};
@@ -719,9 +733,49 @@ export default {
     this.numTypes = localStorage.getItem("zskNumDict");
     this.getSpanArr(this.klRuleByIdSub);
   },
-  beforeUpdate() {
-    this.getSpanArr(this.klRuleByIdSub);
-  },
+  mounted() {},
+  // beforeUpdate() {
+  //   this.getSpanArr(this.klRuleByIdSub);
+  //   console.log("boxxxxxxx", this.box);
+  //   // if (this.box) {
+  //   //   this.box.removeEventListener("scroll");
+  //   // }
+  //   // console.log(box);
+  //   // if (!this.box) {
+  //     this.box = document.querySelector(".el-table__body-wrapper");
+  //   // }
+
+  //   let that = this;
+  //   this.box.addEventListener("scroll", function (e) {
+  //     console.log(that.klRuleByIdSub.length);
+  //     console.log('subType',that.$refs[`klRuleByIdSub[1].subType`]);
+  //     that.klRuleByIdSub.forEach((ite, index) => {
+  //       // console.log(
+  //       //   that.$refs[`klRuleByIdSub[${index}].subType`],
+  //       //   that.$refs[`klRuleByIdSub[${index}].subLenCode`],
+  //       //   that.$refs[`klRuleByIdSub[${index}].subConceptId`],
+  //       //   that.$refs[`klRuleByIdSub[${index}].subMaxOperator`],
+  //       //   that.$refs[`klRuleByIdSub[${index}].subMinOperator`],
+  //       //   that.$refs[`klRuleByIdSub[${index}].subMinOperator`]
+  //       // );
+  //       that.$refs[`klRuleByIdSub[${index}].subType`] &&
+  //         that.$refs[`klRuleByIdSub[${index}].subType`].blur();
+  //       that.$refs[`klRuleByIdSub[${index}].subLenCode`] &&
+  //         that.$refs[`klRuleByIdSub[${index}].subLenCode`].blur();
+  //       that.$refs[`klRuleByIdSub[${index}].subConceptId`] &&
+  //         that.$refs[`klRuleByIdSub[${index}].subConceptId`].blur();
+  //       that.$refs[`klRuleByIdSub[${index}].dataType`] &&
+  //         that.$refs[`klRuleByIdSub[${index}].dataType`].blur();
+  //       that.$refs[`klRuleByIdSub[${index}].subMaxOperator`] &&
+  //         that.$refs[`klRuleByIdSub[${index}].subMaxOperator`].blur();
+  //       that.$refs[`klRuleByIdSub[${index}].subMinOperator`] &&
+  //         that.$refs[`klRuleByIdSub[${index}].subMinOperator`].blur();
+  //       that.$refs[`klRuleByIdSub[${index}]subMinOperator`] &&
+  //         that.$refs[`klRuleByIdSub[${index}]subMinOperator`].blur();
+  //     });
+  //   });
+  // },
+  updated() {},
   props: {
     klRuleByIdSub: {
       type: Array,