Explorar o código

Merge remote-tracking branch 'origin/uiUpdate0507'

zhouna %!s(int64=4) %!d(string=hai) anos
pai
achega
ae8c1f7b98

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 751 - 445
src/components/knowledgeExtra/AddNewRule.vue


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

@@ -0,0 +1,862 @@
+<style lang="less" scoped>
+  #AddNewRuleTable {
+    width: 100%;
+    background: #fff;
+    margin-top: 10px;
+    padding: 20px;
+    box-sizing: border-box;
+    /deep/ .el-table .el-input--mini .el-input__inner,
+    .el-select {
+      width: 100%;
+      font-size: 12px;
+    }
+    .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;
+      }
+    }
+    /deep/ .el-table th {
+      background: transparent;
+    }
+    /deep/ .el-form-item__content {
+      padding-bottom: 14px;
+    }
+    .table_cell_cls {
+      vertical-align: top;
+    }
+    /deep/ .el-form-item__label {
+      font-size: 12px;
+    }
+    h4 {
+      font-size: 14px;
+      font-weight: 400;
+    }
+    /deep/ .el-select {
+      font-size: 12px;
+    }
+    /deep/ .el-table--mini,
+    .el-table--small,
+    .el-table__expand-icon {
+      font-size: 14px;
+    }
+  }
+</style>
+
+<template>
+  <!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
+  <div id="AddNewRuleTable">
+    <h4 style="margin-bottom: 24px">规则内容:</h4>
+    <!-- 隔行换色  :row-style="rowStyle" -->
+    <el-table
+            border
+            :data="klRuleByIdSub"
+            size="mini"
+            style="min-height: 200px"
+            height="calc(100vh - 393px)"
+            :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">
+          <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" label="基础规则名称">
+        <template slot="header" slot-scope="scope">
+          <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" label="基础规则类型">
+        <template slot="header" slot-scope="scope">
+          <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)"
+                    @focus="
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subType`)
+              "
+                    :ref="`klRuleByIdSub[${scope.$index}].subType`"
+            >
+              <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" label="基础规则术语类型">
+        <template slot="header" slot-scope="scope">
+          <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="请选择"
+                    :ref="`klRuleByIdSub[${scope.$index}].subLenCode`"
+                    @change="subCodeChange($event, scope.$index)"
+                    @focus="
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subLenCode`)
+              "
+            >
+              <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" slot-scope="scope">
+          <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"
+                    :ref="`klRuleByIdSub[${scope.$index}].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)"
+                      @focus="
+                  setTheRef($event, `klRuleByIdSub[${scope.$index}].dataType`)
+                "
+                      :ref="`klRuleByIdSub[${scope.$index}].dataType`"
+              >
+                <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: ['change']
+                      }
+                    ]"
+                  >
+                    <el-select
+                            v-model="scope.row.subMaxOperator"
+                            placeholder="请选择"
+                            clearable
+                            @change="maxChange($event, scope.$index, 's')"
+                            @focus="
+                        setTheRef(
+                          $event,
+                          `klRuleByIdSub[${scope.$index}].subMaxOperator`
+                        )
+                      "
+                            :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
+                    >
+                      <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: ['change']
+                      }
+                    ]"
+                  >
+                    <el-input
+                            type="text"
+                            @focus="maxChange($event, scope.$index, 'i')"
+                            :ref="`klRuleByIdSub[${scope.$index}].subMaxValue`"
+                            v-model="scope.row.subMaxValue"
+                            placeholder="填写数值"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                          :prop="`klRuleByIdSub[${scope.$index}].subMaxUnit`"
+                  >
+                    <el-input
+                            type="text"
+                            @focus="setScrollRight"
+                            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: ['change']
+                      }
+                    ]"
+                  >
+                    <el-select
+                            v-model="scope.row.subMinOperator"
+                            placeholder="请选择"
+                            clearable
+                            :ref="`klRuleByIdSub[${scope.$index}].subMinOperator`"
+                            @change="minChange($event, scope.$index, 's')"
+                            @focus="
+                        setTheRef(
+                          $event,
+                          `klRuleByIdSub[${scope.$index}].subMinOperator`
+                        )
+                      "
+                    >
+                      <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: ['change']
+                      }
+                    ]"
+                  >
+                    <el-input
+                            type="text"
+                            :ref="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                            @focus="minChange($event, scope.$index, 'i')"
+                            v-model="scope.row.subMinValue"
+                            placeholder="填写数值"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                          :prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
+                  >
+                    <el-input
+                            type="text"
+                            @focus="setScrollRight"
+                            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'" -->
+            <div
+                    style="flex: 2"
+                    v-if="scope.row.subType != 6 && scope.row.dataType == '2'"
+            >
+              <el-form-item
+                      class="type_content_item"
+                      style="width: 100%"
+                      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="请输入医学内容"
+                        @focus="setScrollRight"
+                        v-model.trim="scope.row.subEqValue"
+                ></el-input>
+              </el-form-item>
+            </div>
+
+            <!-- v-if="groupData.subType === 6" -->
+            <div style="flex: 2" v-if="scope.row.subType == 6">
+              <el-form-item
+                      class="type_content_item"
+                      label="正则表达式:"
+                      label-width="120px"
+                      style="width: 100%"
+                      :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="请输入正则表达式"
+                        @focus="setScrollRight"
+                        v-model.trim="scope.row.subEqValue"
+                ></el-input>
+              </el-form-item>
+            </div>
+          </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,
+                theRef: null
+            };
+        },
+        methods: {
+            setScrollRight() {
+                this.$nextTick(() => {
+                    this.$refs.table.bodyWrapper.scrollLeft = this.$refs.table.bodyWrapper.scrollWidth;
+                });
+            },
+            maxChange(e, val, type) {
+                if (
+                    type === "i" &&
+                    this.klRuleByIdSub[val].subMaxOperator &&
+                    this.klRuleByIdSub[val].subMaxOperator != ""
+                ) {
+                    this.$emit("clearValidate", [
+                        `klRuleByIdSub[${val}].subMinValue`,
+                        `klRuleByIdSub[${val}].subMinOperator`
+                    ]);
+                } else if (
+                    type === "s" &&
+                    this.klRuleByIdSub[val].subMaxValue &&
+                    this.klRuleByIdSub[val].subMaxValue != ""
+                ) {
+                    this.$emit("clearValidate", [
+                        `klRuleByIdSub[${val}].subMinValue`,
+                        `klRuleByIdSub[${val}].subMinOperator`
+                    ]);
+                }
+                this.setScrollRight();
+            },
+            minChange(e, val, type) {
+                if (
+                    type === "i" &&
+                    this.klRuleByIdSub[val].subMinOperator &&
+                    this.klRuleByIdSub[val].subMinOperator != ""
+                ) {
+                    this.$emit("clearValidate", [
+                        `klRuleByIdSub[${val}].subMaxOperator`,
+                        `klRuleByIdSub[${val}].subMaxValue`
+                    ]);
+                } else if (
+                    type === "s" &&
+                    this.klRuleByIdSub[val].subMinValue &&
+                    this.klRuleByIdSub[val].subMinValue != ""
+                ) {
+                    this.$emit("clearValidate", [
+                        `klRuleByIdSub[${val}].subMaxOperator`,
+                        `klRuleByIdSub[${val}].subMaxValue`
+                    ]);
+                }
+                this.setScrollRight();
+            },
+            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;
+            },
+            scrollFun() {
+                this.$refs.table.bodyWrapper.scrollTop =
+                    this.$refs.table.bodyWrapper.scrollTop + 60;
+            },
+            // 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);
+            },
+            //
+            setTheRef(e, val) {
+                this.theRef = val;
+            },
+            // 规则术语类型
+            subCodeChange(val, index) {
+                //基础规则术语类型修改
+                this.$emit("childSubCodeChange", val, index, this.numTypes);
+            },
+            clearConcept(index) {
+                this.$emit("childClearConcept", index);
+            },
+            clearNumText(index) {
+                this.$emit("childClearNumText", index);
+            },
+            //医学标准术语change
+            subConceptIdfocus(index) {
+                this.subConceptIdIndex = "";
+                this.subConceptIdIndex = index;
+                this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`);
+            },
+            // 医学标准术语
+            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.$emit("ChildDataTypeChange", val, index);
+            },
+            // 处理要合并相同行的列
+            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"
+                    ? "医学内容"
+                    : "正则表达式";
+            },
+            blurRef() {
+                console.log("scroll");
+                console.log(this.$refs[this.theRef]);
+                if (this.theRef) {
+                    this.$refs[this.theRef].blur();
+                    // console.log(document.getElementById(this.theRef).blur,'hehehe');
+                    // document.getElementById(this.theRef).focus()
+                    // document.getElementById(this.theRef).value = 123
+                }
+            }
+        },
+        components: {},
+        mounted() {
+            // this.theRef
+            // console.log('mounted');
+            // let that = this;
+            // this.$refs.table.bodyWrapper.addEventListener(
+            //   "scroll",
+            //   that.blurRef,
+            //   false
+            // );
+        },
+        created() {
+            this.numTypes = localStorage.getItem("zskNumDict");
+            this.getSpanArr(this.klRuleByIdSub);
+        },
+        beforeUpdate() {
+            this.getSpanArr(this.klRuleByIdSub);
+        },
+
+        updated() {
+            // let that = this;
+            // this.$nextTick(() => {
+            //   // FIX 滚动添加事件
+            //   this.$refs.table.bodyWrapper.removeEventListener(
+            //     "scroll",
+            //     that.blurRef,
+            //     false
+            //   );
+            //   setTimeout(() => {
+            //     that.$refs.table.bodyWrapper.addEventListener(
+            //       "scroll",
+            //       that.blurRef,
+            //       false
+            //     );
+            //   }, 300);
+            // });
+        },
+        props: {
+            klRuleByIdSub: {
+                type: Array,
+                required: true
+            },
+            maxNum: {
+                default: null
+            }
+        }
+    };
+</script>
+

+ 23 - 21
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="操作时间"
@@ -161,7 +171,7 @@
                 pageSizeArr:config.pageSizeArr,
                 pageLayout:config.pageLayout,
                 total: 0,
-                titleWidth:'1070px' //头部最小宽度
+                titleWidth:'970px' //头部最小宽度
             }
         },
         created() {
@@ -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>

+ 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 - 118
src/components/knowledgeExtra/SubRulesGroup.vue

@@ -1,118 +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;
-        color: #F56C6C;
-        &.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: ["change"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value.length > 100) {
+          callback(new Error("规则名称不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "change"
+    }
+  ],
+  parRuleType: [
+    { required: true, message: "请选择规则类型", trigger: ["blur"] }
+  ],
+  parLenCode: [
+    { required: true, message: "请选择规则术语类型", trigger: ["blur"] }
+  ],
+  parConceptId: [
+    { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+  ],
+  parHasSub: [
+    { required: true, message: "请选择有无子条件", trigger: ["blur"] }
+  ],
+  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"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value && value.length > 100) {
+          callback(new Error("规则名称不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "change"
+    }
+  ],
+  subType: [
+    { required: true, message: "请选择基础规则类型", trigger: ["blur"] }
+  ],
+  subLenCode: [
+    {
+      required: true,
+      message: "请选择基础规则术语类型",
+      trigger: ["blur"]
+    }
+  ],
+  subConceptId: [
+    { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+  ],
+  dataType: [
+    { required: true, message: "请选择类型", 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"
+    }
+  ]
+}

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


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


BIN=BIN
src/images/exclamationpoint.png


+ 0 - 0
td


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 8616 - 0
yarn.lock