浏览代码

冲突合并

reaper 4 年之前
父节点
当前提交
8de355d16f

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 .DS_Store
 node_modules
 /dist
+vue.config.js
 
 # local env files
 .env.local

+ 9 - 0
src/api/config.js

@@ -3,6 +3,7 @@ const testUrl = ''
 
 export default {
   host: 'http://192.168.2.121:5050',
+   imgHost: 'http://192.168.2.236:82',      //富文本编辑器图片回传地址
   // imgHost: 'http://192.168.2.121:82',      //富文本编辑器图片回传地址
   imgHost: 'http://192.168.2.241:82',      //富文本编辑器图片回传地址
   delayTime: 500,
@@ -593,8 +594,11 @@ export default {
     'searchConcept': '/api/cdssman/klDisease/searchConcept',
     'findDisName': '/api/cdssman/klDisease/findDisName',
     'diseaseBaseSave': '/api/cdssman/klDisease/save',
+<<<<<<< HEAD
     'exportExcelTemplates': '/api/cdssman/importConcept/exportExcelTemplates',
     'exportTermExcel': '/api/cdssman/importConcept/exportTermExcel',
+=======
+>>>>>>> scaleManage0527
     //静态知识术语
     'staticBaseKnowledge': '/api/cdssman/kl/conceptInfo/getPage',
     'changeBaseStatus': '/api/cdssman/kl/conceptInfo/changeStatus',
@@ -609,12 +613,17 @@ export default {
     'ruleExportExcel': '/api/cdssman/test/rule/ruleExportExcel',
     'autoRuleTest': '/api/cdssman/test/rule/ruleTest',
     'clearDrug': '/api/cdssman/cache/clearDrug',
+<<<<<<< HEAD
     //药品维护
     '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',
+=======
+    'klRegulation': '/api/cdssman/klRegulation/index'
+
+>>>>>>> scaleManage0527
   },
   menuIconList: { //菜单对应图标
     'YH-KZT': 'el-icon-menu',

+ 6 - 2
src/api/knowledgeTree.js

@@ -145,5 +145,9 @@ export default {
       contentType: "multipart/form-data",
       responseType: 'blob'//必须添加,否则会乱码
     })
-  }
-};
+  },
+  // /klRegulation/index
+  searchRuleCode(param) {
+    return axios.post(urls.klRegulation, param);
+  },
+};

+ 252 - 0
src/components/knowledgeExtra/AddAssess/ScoreResultsTable.vue

@@ -0,0 +1,252 @@
+<style lang="less" scoped>
+.ScoreResults {
+  width: 100%;
+  padding: 30px 30px 0 30px;
+  box-sizing: border-box;
+  h4 {
+    font-size: 14px;
+  }
+  /deep/.el-table th,
+  .el-table tr {
+    height: 50px;
+    background: #e3eaf4;
+  }
+  /deep/.el-table th {
+    padding: 0;
+  }
+  .btn_box {
+    width: 100%;
+    height: 100%;
+    padding: 20px 0;
+    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;
+    }
+  }
+  .range_box {
+    display: flex;
+    position: relative;
+    .range_child {
+      flex: 1;
+      &:nth-child(1) {
+        margin-right: 20px;
+      }
+      /deep/.el-form-item__content {
+        position: static;
+      }
+      /deep/ .is-error .el-form-item__error {
+        left: 70px;
+      }
+    }
+  }
+  /deep/.el-input--mini .el-input__inner {
+    width: 100%;
+  }
+  /deep/.el-form-item--mini.el-form-item,
+  .el-form-item--small.el-form-item {
+    padding: 18px 0;
+  }
+  .custom_table_header {
+    vertical-align: middle;
+    &::before {
+      content: "*";
+      color: red;
+      font-size: 12px;
+      margin-right: 4px;
+    }
+  }
+}
+/deep/ .el-textarea__inner {
+  overflow-y: hidden;
+}
+/deep/ .el-input--mini {
+  font-size: 14px;
+}
+/deep/ .el-form-item.is-success .el-input__inner,
+.el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+/deep/ .el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+/deep/ .el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+</style>
+<template>
+  <div class="ScoreResults">
+    <h4>得分结果:</h4>
+
+    <el-table
+      :data="list"
+      header-row-class-name="header_row_class_name"
+      border
+      style="width: 100%; margin: 20px 0"
+    >
+      <el-table-column prop="orderNo" width="70px" label="">
+        <template slot-scope="scope">
+          <div class="btn_box">
+            <div class="btn_div">
+              <img
+                @click="$emit('CHANEG_SCORE_RESULT', 1, scope.$index)"
+                src="@/images/add-new-rule-sub.png"
+                alt=""
+              />
+            </div>
+            <div class="btn_div" v-if="list.length > 1">
+              <img
+                @click="$emit('CHANEG_SCORE_RESULT', 0, scope.$index)"
+                src="@/images/add-new-rule-del.png"
+                alt=""
+              />
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column prop="content" label="得分范围">
+        <template slot="header">
+          <div class="custom_table_header">得分范围</div>
+        </template>
+        <template slot-scope="scope">
+          <!-- <div>{{ scope.row.content.max }},{{ scope.row.content.min }}</div> -->
+          <div class="range_box">
+            <div class="range_child">
+              <el-form-item
+                label="大于:"
+                label-width="70px"
+                :prop="`scoreresultsdatas[${scope.$index}].content.min`"
+                :rules="[
+                  {
+                    validator: (rule, value, callback) => {
+                      validateMinMax(scope, rule, value, callback);
+                    },
+                    trigger: ['blur']
+                  }
+                ]"
+              >
+                <el-input
+                  type="text"
+                  v-model.number="scope.row.content.min"
+                  clearable
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </div>
+            <div class="range_child">
+              <el-form-item
+                label="小于:"
+                label-width="70px"
+                :prop="`scoreresultsdatas[${scope.$index}].content.max`"
+                :rules="[
+                  {
+                    validator: (rule, value, callback) => {
+                      validateMinMax(scope, rule, value, callback);
+                    },
+                    trigger: ['blur']
+                  }
+                ]"
+              >
+                <el-input
+                  type="text"
+                  v-model.number="scope.row.content.max"
+                  clearable
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column prop="result" label="结果">
+        <template slot="header">
+          <div class="custom_table_header">结果</div>
+        </template>
+        <template slot-scope="scope">
+          <el-form-item
+            :prop="`scoreresultsdatas[${scope.$index}].result`"
+            :rules="rules.soureResult"
+          >
+            <el-input
+              :ref="`scoreresultsdatas[${scope.$index}].result`"
+              type="textarea"
+              rows="1"
+              :autosize="true"
+              resize="none"
+              v-model="scope.row.result"
+              clearable
+              maxlength="300"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column prop="pushInfo" label="建议">
+        <template slot-scope="scope">
+          <el-form-item
+            :prop="`scoreresultsdatas[${scope.$index}].pushInfo`"
+            :rules="rules.sourePushInfo"
+          >
+            <el-input
+              :ref="`scoreresultsdatas[${scope.$index}].pushInfo`"
+              type="textarea"
+              rows="1"
+              :autosize="true"
+              resize="none"
+              v-model="scope.row.pushInfo"
+              clearable
+              maxlength="500"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import rules from "./rules";
+export default {
+  data() {
+    return {
+      rules: rules
+    };
+  },
+  methods: {
+    resizeTable() {
+      setTimeout(() => {
+        this.list.forEach((item, index) => {
+          this.$refs[`scoreresultsdatas[${index}].pushInfo`] &&
+            this.$refs[`scoreresultsdatas[${index}].pushInfo`].resizeTextarea();
+          this.$refs[`scoreresultsdatas[${index}].result`] &&
+            this.$refs[`scoreresultsdatas[${index}].result`].resizeTextarea();
+        });
+      });
+    },
+    validateMinMax(scope, rule, value, callback) {
+      const { min, max } = scope.row.content;
+      if (min || max) {
+        callback();
+      } else {
+        callback(new Error("大于和小于至少完整填写一个"));
+      }
+    }
+  },
+  props: {
+    list: {
+      default: []
+    }
+  }
+};
+</script>
+

文件差异内容过多而无法显示
+ 1112 - 0
src/components/knowledgeExtra/AddAssess/index.vue


+ 54 - 0
src/components/knowledgeExtra/AddAssess/rules.js

@@ -0,0 +1,54 @@
+export default {
+  title: [
+    { required: true, message: "请输入标题", trigger: ["blur"] },
+  ],
+  tableFactor: [
+    { required: true, message: "请输入系数", trigger: ["blur"] },
+  ],
+  tableConstant: [
+    { required: true, message: "请输入常数", trigger: ["blur"] },
+  ],
+  // 问题选项
+  issueContent: [
+    { required: true, message: "请输入问题内容", trigger: ["blur"] },
+  ],
+  issueFactor: [
+    { required: true, message: "请输入系数", trigger: ["blur"] },
+  ],
+  issueConstant: [
+    { required: true, message: "请输入常数", trigger: ["blur"] },
+  ],
+  content: [
+    { required: true, message: "请输入选项内容", trigger: ["blur"] },
+  ],
+  score: [
+    { required: true, message: "请输入分值", trigger: ["blur"] },
+  ],
+  ruleCode:[
+    { required: true, message: "请输入编码", trigger: ["change"] },
+  ],
+  result: [
+    { required: true, message: "请输入结果", trigger: ["blur"] },
+  ],
+  pushInfo: [
+    { required: true, message: "请输入建议", trigger: ["blur"] },
+  ],
+  // 概述
+  fwbContent: [
+    { required: true, message: "请输入概述", trigger: ["blur"] },
+    { max: 1000, message: "最多输入1000字", trigger: ["blur"] },
+  ],
+  // 得分结果
+  max: [
+    { required: true, message: "请输入大于值", trigger: ["blur"] },
+  ],
+  min: [
+    { required: true, message: "请输入小于值", trigger: ["blur"] },
+  ],
+  soureResult: [
+    { required: true, message: "请输入结果", trigger: ["blur"] },
+  ],
+  sourePushInfo: [
+    { required: true, message: "请输入建议", trigger: ["blur"] },
+  ],
+}

+ 661 - 0
src/components/knowledgeExtra/AddAssess/scale-table.vue

@@ -0,0 +1,661 @@
+
+<style lang="less" scoped>
+.scaleTable {
+  min-height: 100px;
+  .table_box {
+    padding: 0 30px;
+  }
+  .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;
+    }
+  }
+  .table_select_btn {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    /deep/ .el-button--text {
+      padding: 3px 0;
+      margin: 0;
+    }
+  }
+  /deep/.el-input--mini .el-input__inner {
+    width: 100%;
+  }
+  /deep/.el-table th {
+    padding: 0;
+  }
+}
+/deep/.el-table th,
+.el-table tr {
+  height: 50px;
+  background: #e3eaf4;
+}
+/deep/.el-table th {
+  padding: 0;
+}
+.custom_table_header {
+  vertical-align: middle;
+  &::before {
+    content: "*";
+    color: red;
+    font-size: 12px;
+    margin-right: 4px;
+  }
+}
+/deep/.el-form-item--mini.el-form-item,
+.el-form-item--small.el-form-item {
+  padding: 18px 0;
+  position: static;
+}
+/deep/ .el-textarea__inner {
+  overflow-y: hidden;
+}
+.cell_center_box {
+  /deep/ .el-input__inner {
+    // width: 40px;
+    text-align: center;
+  }
+}
+/deep/.el-select--mini {
+  width: 100%;
+}
+/deep/ .el-input--mini{
+  font-size: 14px;
+  
+}
+/deep/ .el-form-item.is-success .el-input__inner,
+.el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+/deep/ .el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+/deep/ .el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+</style>
+<template>
+  <div class="scaleTable" :id="`scaleTableRef[${tableIndex}]`">
+    <div class="table_box">
+      <el-table
+        v-if="tableShow"
+        :data="tableData"
+        header-row-class-name="header_row_class_name"
+        border
+        style="width: 100%; margin: 20px 0"
+        :span-method="objectSpanMethod"
+        :ref="`scaleTableRef[${tableIndex}]`"
+      >
+        <el-table-column prop="issueId" label="组" width="70px">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 1,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId
+                    })
+                  "
+                  src="../../../images/add-new-rule-sub.png"
+                  alt=""
+                />
+              </div>
+              <div
+                class="btn_div"
+                v-if="imposeRestrictionsRemoveOnGroup(scope.row.groupId)"
+              >
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: -1,
+                      tableIndex,
+                      groupId: scope.row.groupId
+                    })
+                  "
+                  src="../../../images/add-new-rule-del.png"
+                  alt=""
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="groupId" label="问题" width="70px">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 2,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="../../../images/add-new-rule-sub.png"
+                  alt=""
+                />
+              </div>
+              <div
+                class="btn_div"
+                v-if="
+                  imposeRestrictionsRemoveOnIssue({
+                    groupId: scope.row.groupId,
+                    issueId: scope.row.issueId
+                  })
+                "
+              >
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: -2,
+                      tableIndex,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="../../../images/add-new-rule-del.png"
+                  alt=""
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="two_selectType" label="选择" width="70px">
+          <template slot-scope="scope">
+            <div class="table_select_btn">
+              <el-button
+                @click="handleSelectTypeBtn(scope.$index, 1)"
+                :style="scope.row.two_selectType != 1 ? { color: '#999' } : ''"
+                type="text"
+                >单选</el-button
+              >
+              <el-button
+                :style="scope.row.two_selectType != 2 ? { color: '#999' } : ''"
+                @click="handleSelectTypeBtn(scope.$index, 2)"
+                type="text"
+                >多选</el-button
+              >
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="two_content" label="问题内容">
+          <template slot="header">
+            <div class="custom_table_header">问题内容</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_content`"
+              :rules="rules.issueContent"
+            >
+              <el-input
+                :ref="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_content`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.two_content"
+                clearable
+                maxlength="300"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="two_factor"
+          label="系数"
+          width="90px"
+          v-if="tableResultType === 2"
+        >
+          <template slot-scope="scope">
+            <div class="cell_center_box">
+              <el-form-item
+                :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_factor`"
+                :rules="rules.issueFactor"
+              >
+                <el-input
+                  type="text"
+                  v-model.number="scope.row.two_factor"
+                  placeholder="请输入"
+                ></el-input>
+              </el-form-item>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="two_constant"
+          label="常数"
+          width="90px"
+          v-if="tableResultType === 2"
+        >
+          <template slot-scope="scope">
+            <div class="cell_center_box">
+              <el-form-item
+                :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_constant`"
+                :rules="rules.issueConstant"
+              >
+                <el-input
+                  type="text"
+                  v-model.number="scope.row.two_constant"
+                  placeholder="请输入"
+                  style="text-align: center"
+                ></el-input>
+              </el-form-item>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="issueId" label="选项个数" width="80px">
+          <template slot-scope="scope">
+            <div>
+              {{ optionLength(scope.row.issueId) }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="orderNo" label="选项" width="70px">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 3,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="../../../images/add-new-rule-sub.png"
+                  alt=""
+                />
+              </div>
+              <div
+                class="btn_div"
+                v-if="imposeRestrictionsRemoveOnOption(scope.row.issueId)"
+              >
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: -3,
+                      tableIndex,
+                      rowIndex: scope.$index
+                    })
+                  "
+                  src="../../../images/add-new-rule-del.png"
+                  alt=""
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="content"
+          label="选项内容"
+          :width="tableResultType === 1 ? '200px' : ''"
+        >
+          <template slot="header">
+            <div class="custom_table_header">选项内容</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].content`"
+              :rules="rules.content"
+            >
+              <el-input
+                :ref="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].content`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.content"
+                clearable
+                maxlength="300"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="content"
+          label="编码"
+          :width="tableResultType === 1 ? '200px' : ''"
+          v-if="tableResultType === 2"
+        >
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].ruleCode`"
+              :rules="rules.ruleCode"
+              ><el-select
+                clearable
+                remote
+                filterable
+                :remote-method="searchRuleCode"
+                @focus="ruleCodeFocus(scope.$index)"
+                v-model.trim="scope.row.ruleCode"
+              >
+                <el-option
+                  v-for="item in scope.row.ruleCodeList"
+                  :key="item.code"
+                  :label="item.code"
+                  :value="item.code"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="content"
+          label="分值"
+          v-if="tableResultType === 2"
+        >
+          <template slot="header">
+            <div class="custom_table_header">分值</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].score`"
+              :rules="rules.score"
+            >
+              <el-input
+                type="text"
+                maxlength="6"
+                v-model.number="scope.row.score"
+                clearable
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="result"
+          label="结果"
+          width="200px"
+          v-if="tableResultType === 1"
+        >
+        <template slot="header">
+            <div class="custom_table_header">结果</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].result`"
+              :rules="rules.result"
+            >
+              <el-input
+                :ref="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].result`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.result"
+                clearable
+                maxlength="300"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="pushInfo"
+          label="建议"
+          v-if="tableResultType === 1"
+        >
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].pushInfo`"
+              :rules="rules.pushInfo"
+            >
+              <el-input
+                :ref="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].pushInfo`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.pushInfo"
+                clearable
+                maxlength="500"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import rules from "./rules";
+import api from "@api/knowledgeTree.js";
+export default {
+  name: "scaleTable",
+  data() {
+    return {
+      tableShow: true,
+      rules: rules,
+      ruleCodeIndex: null
+    };
+  },
+  methods: {
+    resizeTable() {
+      setTimeout(() => {
+        this.tableData.forEach((item, index) => {
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].content`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].content`
+            ].resizeTextarea();
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].two_content`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].two_content`
+            ].resizeTextarea();
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].result`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].result`
+            ].resizeTextarea();
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].pushInfo`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].pushInfo`
+            ].resizeTextarea();
+        });
+      }, 500);
+    },
+    ruleCodeFocus(index) {
+      this.ruleCodeIndex = index;
+    },
+    searchRuleCode(val) {
+      api
+        .searchRuleCode({ name: val === "" ? null : val, type: 1 })
+        .then((res) => {
+          if (res.data.code == "0") {
+            this.$emit(
+              "CHANGE_FORM_DATA",
+              this.tableIndex,
+              this.ruleCodeIndex,
+              "ruleCodeList",
+              res.data.data
+            );
+          }
+        });
+    },
+    addGroup() {},
+    // 单选、多选
+    handleSelectTypeBtn(index, type) {
+      this.$emit(
+        "CHANGE_FORM_DATA",
+        this.tableIndex,
+        index,
+        "two_selectType",
+        type
+      );
+    },
+    // 计算表格选项内容的值
+    optionLength(val) {
+      if (val || val === 0) {
+        const accordWithThis = this.tableData.filter(
+          (item) => item.issueId === val
+        );
+        return accordWithThis.length ? accordWithThis.length : 0;
+      }
+    },
+    // 表格合并单元格逻辑
+    getSpanArr(data) {
+      this.spanArr = [];
+      this.spanArr1 = [];
+      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;
+          this.spanArr1.push(1);
+          this.pos1 = 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;
+          }
+
+          if (data[i].issueId === data[i - 1].issueId) {
+            // 如果remark相等就累加,并且push 0
+            this.spanArr1[this.pos1] += 1;
+            this.spanArr1.push(0);
+          } else {
+            // 不相等push 1,并且pos 要换成当前下标
+            this.spanArr1.push(1);
+            this.pos1 = 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
+        };
+      } else if (
+        column.label == "问题" ||
+        column.label == "选择" ||
+        column.label == "问题内容" ||
+        column.label == "系数" ||
+        column.label == "常数" ||
+        column.label == "选项个数"
+      ) {
+        const _row = this.spanArr1[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    // 删除组限制:剩余一组时隐藏删除按钮
+    imposeRestrictionsRemoveOnGroup(groupId) {
+      // 查找有没有其他组存在 如果为0的话则不存在
+      const otherGroupLength = this.tableData.filter(
+        (item) => item.groupId !== groupId
+      ).length;
+      return otherGroupLength;
+    },
+    // 删除问题限制:该组剩余一个问题时隐藏删除按钮
+    imposeRestrictionsRemoveOnIssue(val) {
+      const { groupId, issueId } = val;
+      // 获取该组所有的issus
+      const thisGroups = this.tableData.filter(
+        (item) => item.groupId === groupId
+      );
+      // 查找该组有没有其他问题 otherIssueLength为0表示只有当前一个问题存在 所以隐藏删除按钮
+      const otherIssueLength = thisGroups.filter(
+        (item) => item.issueId !== issueId
+      ).length;
+
+      if (otherIssueLength) {
+        return true;
+      }
+      return false;
+    },
+    // 删除选项限制:该问题剩余一个选项时隐藏删除按钮
+    imposeRestrictionsRemoveOnOption(issueId) {
+      // 查找同组的问题,如果只有一个问题则隐藏删除按钮
+      const thisOptionByissueIdLenth = this.tableData.filter(
+        (item) => item.issueId === issueId
+      ).length;
+      if (thisOptionByissueIdLenth > 1) {
+        return true;
+      }
+      return false;
+    }
+  },
+  created() {
+    this.getSpanArr(this.tableData);
+  },
+  watch: {
+    tableData: {
+      handler() {
+        this.getSpanArr(this.tableData);
+      },
+      deep: true
+    },
+    tableResultType() {
+      this.tableShow = false;
+
+      setTimeout(() => {
+        this.tableShow = true;
+      });
+    }
+  },
+  props: {
+    tableData: {
+      default: []
+    },
+    tableIndex: {
+      required: true
+    },
+    tableResultType: {
+      required: true,
+      default: 1
+    }
+  }
+};
+</script>

文件差异内容过多而无法显示
+ 443 - 229
src/components/knowledgeExtra/AddDevKnow.vue


+ 14 - 2
src/components/knowledgeExtra/DevInfo.vue

@@ -4,6 +4,7 @@
     :model="data"
     ref="form"
     class="sub-form"
+    size="mini"
     :validate-on-rule-change="false"
   >
     <!--<el-input v-model="form.orderNo" :value="index" type="hidden"></el-input>-->
@@ -34,8 +35,8 @@
       <a v-if="index!==total-1" :class="index===0?'order-spc':'order-down'" @click="reOrder(0)">下降</a>
     </div>
     <el-form-item label-width="160px" class="btns">
-      <el-button @click="addEmit">添加段落</el-button>
-      <el-button @click="delEmit" type="info">删除本段落</el-button>
+      <el-button size="small" @click="addEmit">添加段落</el-button>
+      <el-button size="small" @click="delEmit" type="info">删除本段落</el-button>
     </el-form-item>
   </el-form>
 </template>
@@ -294,4 +295,15 @@ it .ql-editor,
 .btns {
   margin-top: 20px;
 }
+
+/deep/ .el-form-item.is-success .el-input__inner,
+.el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+/deep/ .el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
+/deep/ .el-form-item.is-success .el-textarea__inner {
+  border-color: #c9c9c9 !important;
+}
 </style>

+ 5 - 0
yarn.lock

@@ -8285,6 +8285,11 @@ vue@^2.5.17:
   resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123"
   integrity sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==
 
+vuex@^3.6.2:
+  version "3.6.2"
+  resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
+  integrity sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==
+
 watchpack-chokidar2@^2.0.1:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957"