zhangjie 1 سال پیش
والد
کامیت
eeb00182e3

+ 1 - 0
src/modules/course/components/profession/ModifyProfessional.vue

@@ -13,6 +13,7 @@
       ref="modalFormComp"
       :model="modalForm"
       :key="modalForm.id"
+      :rules="rules"
       label-width="100px"
     >
       <el-form-item prop="name" label="专业名称:">

+ 4 - 0
src/modules/course/components/profession/ProfessionalDetail.vue

@@ -7,6 +7,7 @@
       :close-on-press-escape="false"
       append-to-body
       fullscreen
+      @close="closeHandle"
     >
       <div slot="title">{{ rowData.name }}</div>
       <div class="mb-4 tab-btns">
@@ -79,6 +80,9 @@ export default {
     selectMenu(tab) {
       this.curTab = tab;
     },
+    closeHandle() {
+      this.curTab = "ProfessionalCourse";
+    },
   },
 };
 </script>

+ 34 - 16
src/modules/course/components/profession/ProfessionalMatrix.vue

@@ -28,14 +28,14 @@
             >
               <el-table-column
                 v-for="subr in column.subRequirements"
-                :key="subr"
-                :label="subr === 'null' ? '' : subr"
+                :key="subr.name"
+                :label="subr.name === 'null' ? '' : subr.name"
                 align="center"
               >
                 <template slot-scope="scope">
                   <el-input-number
                     v-if="scope.row.canEdit"
-                    v-model="scope.row[`${column.name}_${subr}`].value"
+                    v-model="scope.row[`${column.name}_${subr.name}`].value"
                     class="width-50"
                     :min="0"
                     :max="1"
@@ -43,11 +43,16 @@
                     step-strictly
                     :controls="false"
                     @change="
-                      () => unitChange(scope.row, `${column.name}_${subr}`)
+                      () =>
+                        unitChange(
+                          scope.row,
+                          `${column.name}_${subr.name}`,
+                          subr.columnIndex
+                        )
                     "
                   ></el-input-number>
                   <span v-else>{{
-                    scope.row[`${column.name}_${subr}`].value
+                    scope.row[`${column.name}_${subr.name}`].value
                   }}</span>
                 </template>
               </el-table-column>
@@ -71,7 +76,14 @@
                   :step="0.01"
                   step-strictly
                   :controls="false"
-                  @change="() => unitChange(scope.row, `${column.name}_null`)"
+                  @change="
+                    () =>
+                      unitChange(
+                        scope.row,
+                        `${column.name}_null`,
+                        column.columnIndex
+                      )
+                  "
                 ></el-input-number>
                 <span v-else>{{ scope.row[`${column.name}_null`].value }}</span>
               </template>
@@ -145,16 +157,22 @@ export default {
         (item) => item.subRequirements[0].name !== null
       );
       if (!this.hasSubRequirements) {
-        this.columns = requirements.map((item) => {
-          return { name: item.name };
+        this.columns = requirements.map((item, index) => {
+          return { name: item.name, columnIndex: index + 1 };
         });
         return;
       }
 
+      let cindex = 0;
       this.columns = requirements.map((item) => {
         return {
           name: item.name,
-          subRequirements: item.subRequirements.map((subr) => subr.name + ""),
+          subRequirements: item.subRequirements.map((subr) => {
+            return {
+              name: subr.name + "",
+              columnIndex: ++cindex,
+            };
+          }),
         };
       });
     },
@@ -171,15 +189,15 @@ export default {
         (item) => item[1] !== columnIndex
       );
     },
-    async unitChange(row, key) {
-      const fieldName = key.split("_")[0];
-      let columnIndex = this.columns.findIndex(
-        (item) => item.name === fieldName
+    async unitChange(row, key, columnIndex) {
+      const [fieldName, nodeName] = key.split("_");
+      const totalVal = calcSum(
+        this.dataList.map((item) => item[key].value || 0)
       );
-      columnIndex += 1;
-      const totalVal = calcSum(this.dataList.map((item) => item[key].value));
       if (totalVal > 1) {
-        this.$message.error(`${fieldName}列总和大于1,当前修改值将不会保存!`);
+        const columnName =
+          nodeName === "null" ? fieldName : `${fieldName}:${nodeName}`;
+        this.$message.error(`${columnName}列总和大于1,当前修改值将不会保存!`);
 
         const rowIndex = this.dataList.findIndex(
           (item) => item.courseCode === row.courseCode

+ 1 - 0
src/plugins/download.js

@@ -1,6 +1,7 @@
 import { objTypeOf, blobToText } from "./utils";
 
 function parseDownloadFilename(dispositionInfo) {
+  console.log(dispositionInfo);
   const strs = dispositionInfo.split(";");
   let filename = "";
   strs