Explorar o código

bugfix: 8454;添加缺失字段

reaper %!s(int64=4) %!d(string=hai) anos
pai
achega
03d16a7f38

+ 43 - 57
src/components/knowledgeExtra/AddAssess/index.vue

@@ -272,6 +272,7 @@ it .ql-editor,
           :tableResultType="table.resultType"
           @CHANGE_FORM_DATA="CHANGE_FORM_DATA"
           @CHANGE_TABLE_ROW="CHANGE_TABLE_ROW"
+          @CHANGE_ISSUE_CONTENT="CHANGE_ISSUE_CONTENT"
           ref="ScaleTable"
         />
         <div class="rich_text" v-if="table.textType === 12">
@@ -321,12 +322,12 @@ it .ql-editor,
       />
     </el-form>
     <!-- 暂时用的按钮 -->
-    <!-- <button
+    <button
       style="position: fixed; bottom: 20px; right: 20px; font-size: 16px"
       @click="assessCommitTest"
     >
       暂时用的按钮
-    </button> -->
+    </button>
   </div>
 </template>
 
@@ -354,7 +355,7 @@ const defaultDate = {
   two_score: 0,
   two_selectType: 1,
   two_status: 0,
-  two_textType: 0,
+  two_textType: 21,
   content: "",
   orderNo: 0,
   pushInfo: "",
@@ -362,8 +363,8 @@ const defaultDate = {
   result: "",
   ruleCode: "",
   score: null,
-  status: 0,
-  textType: 11
+  status: 1,
+  textType: 31
 };
 const defaultTable = {
   constant: 0,
@@ -379,7 +380,7 @@ const defaultTable = {
   resultType: 2,
   ruleCode: "string",
   score: null,
-  status: 0,
+  status: 1,
   textType: 11
 };
 export default {
@@ -416,8 +417,8 @@ export default {
                 two_ruleCode: "",
                 two_score: 0,
                 two_selectType: 1,
-                two_status: 0,
-                two_textType: 0,
+                two_status: 1,
+                two_textType: 21,
                 content: "",
                 orderNo: 0,
                 pushInfo: "",
@@ -425,8 +426,8 @@ export default {
                 result: "",
                 ruleCode: "",
                 score: null,
-                status: 0,
-                textType: 0
+                status: 1,
+                textType: 31
               }
             ],
             orderNo: 0,
@@ -434,7 +435,7 @@ export default {
             resultType: 2,
             ruleCode: "string",
             score: "",
-            status: 0,
+            status: 1,
             textType: 11
           }
         ],
@@ -487,43 +488,6 @@ export default {
         }
       },
       toolbarMode: 0,
-      ScoreResultsData: {
-        //得分结果提交格式
-        constant: null,
-        content: "得分结果",
-        factor: "",
-        klScaleSaveGroup: {
-          groupNum: 0,
-          klScaleSub: [
-            {
-              constant: 0,
-              content: "得分范围",
-              factor: 0,
-              klScaleDetail: [
-                {
-                  content: "string",
-                  orderNo: 0,
-                  pushInfo: "string",
-                  remark: "string",
-                  result: "string",
-                  ruleCode: "string",
-                  score: null,
-                  status: 0,
-                  textType: 0
-                }
-              ],
-              orderNo: 0,
-              remark: "string",
-              resultType: 0,
-              ruleCode: "string",
-              score: null,
-              selectType: 0,
-              status: 0,
-              textType: 0
-            }
-          ]
-        }
-      },
       scoreresults: {
         scoreresultsdatas: [
           // todo me: 最后处理数据记得将orderNo设不唯一的值
@@ -538,14 +502,28 @@ export default {
             result: "",
             ruleCode: null,
             score: null,
-            status: null,
-            textType: null
+            status: 2,
+            textType: 31
           }
         ]
       }
     };
   },
   methods: {
+    CHANGE_ISSUE_CONTENT(data) {
+      const { value, tableIndex, rowIndex, name } = data;
+      console.log(value, tableIndex, rowIndex, name);
+      const thisIssueId =
+        this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup[rowIndex]
+          .issueId;
+      console.log(thisIssueId);
+      this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.forEach(
+        (item) => {
+          item[name] = value;
+        }
+      );
+      console.log(this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup);
+    },
     onEditorChange(e) {
       e.quill.deleteText(1000, 4);
       // e.quill.getLength()>1000
@@ -687,8 +665,8 @@ export default {
                     ruleCode: "string",
                     score: null,
                     selectType: 0,
-                    status: 0,
-                    textType: 0,
+                    status: 1,
+                    textType: 21,
                     klScaleDetail: []
                   }
                 ]
@@ -728,8 +706,8 @@ export default {
                 ruleCode: "string",
                 score: null,
                 selectType: 0,
-                status: 0,
-                textType: 0
+                status: 2,
+                textType: 21
               }
             ]
           }
@@ -739,7 +717,7 @@ export default {
         resultType: 0,
         ruleCode: "string",
         score: null,
-        status: 0,
+        status: 2,
         textType: 13
       };
       // 13. 将得分结果加入到提交数据中
@@ -816,8 +794,8 @@ export default {
           result: "",
           ruleCode: null,
           score: null,
-          status: null,
-          textType: null
+          status: 2,
+          textType: 31
         });
       } else {
         this.$delete(this.scoreresults.scoreresultsdatas, index);
@@ -918,11 +896,19 @@ export default {
             0,
             child
           );
+
           break;
         case 3: //type 3: 添加选项
           // 设置新的 groupId(相同的组id)、issueId(相同的组问题id)
           child.groupId = groupId;
           child.issueId = issueId;
+          // 添加相同问题的内容、常数、系数、选择
+          const thisRowData =
+            this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup[rowIndex];
+          child.two_content = thisRowData.content;
+          child.two_factor = thisRowData.two_factor;
+          child.two_constant = thisRowData.two_constant;
+          child.two_selectType = thisRowData.two_selectType;
           // 将新的组插入到当前组后边
           this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.splice(
             rowIndex + 1,

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

@@ -215,6 +215,9 @@
                 clearable
                 maxlength="300"
                 placeholder="请输入"
+                @input="
+                  changeDataFun($event, tableIndex, scope.$index, 'two_content')
+                "
               ></el-input>
             </el-form-item>
           </template>
@@ -235,6 +238,14 @@
                   type="number"
                   v-model.number="scope.row.two_factor"
                   placeholder="请输入"
+                  @input="
+                    changeDataFun(
+                      $event,
+                      tableIndex,
+                      scope.$index,
+                      'two_factor'
+                    )
+                  "
                 ></el-input>
               </el-form-item>
             </div>
@@ -257,6 +268,14 @@
                   v-model.number="scope.row.two_constant"
                   placeholder="请输入"
                   style="text-align: center"
+                  @input="
+                    changeDataFun(
+                      $event,
+                      tableIndex,
+                      scope.$index,
+                      'two_constant'
+                    )
+                  "
                 ></el-input>
               </el-form-item>
             </div>
@@ -454,6 +473,14 @@ export default {
     };
   },
   methods: {
+    changeDataFun(val, tableIndex, rowIndex, name) {
+      this.$emit("CHANGE_ISSUE_CONTENT", {
+        value: val,
+        tableIndex,
+        rowIndex,
+        name
+      });
+    },
     resizeTable() {
       setTimeout(() => {
         this.tableData.forEach((item, index) => {
@@ -512,6 +539,7 @@ export default {
         "two_selectType",
         type
       );
+      this.changeDataFun(type, this.tableIndex, index, "two_selectType");
     },
     // 计算表格选项内容的值
     optionLength(val) {