noob 3 年 前
コミット
00f3f7c4dc

+ 26 - 12
src/pages/main/performance/components/sheet.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-12-04 14:23:58
  * @LastEditors  : yuanrunwei
- * @LastEditTime : 2021-12-26 19:38:09
+ * @LastEditTime : 2021-12-28 14:49:37
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\sheet.vue
 -->
 
@@ -66,8 +66,8 @@
                         <el-option
                             v-for="(value, index) in 10"
                             :key="index"
-                            :label="index"
-                            :value="index"
+                            :label="index + 1"
+                            :value="index + 1"
                         >
                         </el-option> </el-select
                 ></el-form-item>
@@ -111,8 +111,8 @@
                             <el-option
                                 v-for="(value, index) in 10"
                                 :key="index"
-                                :label="index"
-                                :value="index"
+                                :label="index + 1"
+                                :value="index + 1"
                             >
                             </el-option>
                         </el-select>
@@ -183,10 +183,10 @@ export default {
                     value: 1,
                     label: "按行",
                 },
-                {
-                    value: 2,
-                    label: "按列",
-                },
+                // {
+                //     value: 2,
+                //     label: "按列",
+                // },
             ],
         };
     },
@@ -233,7 +233,7 @@ export default {
                 },
             });
             if (list && list.length) {
-                const [{ type, allowEditingColumns }] = list;
+                const [{ type, allowEditingColumns, rowNum }] = list;
                 this.form = {
                     ...this.form,
                     type: JSON.parse(type),
@@ -245,6 +245,18 @@ export default {
                         })
                     ),
                 };
+                this.row_list =
+                    this.type === "edit"
+                        ? rowNum
+                              .split(",")
+                              .map((element) => JSON.parse(element) - 1)
+                        : [];
+                this.column_list =
+                    this.type === "edit"
+                        ? allowEditingColumns
+                              .split(",")
+                              .map((element) => JSON.parse(element) - 1)
+                        : [];
             }
             this.handleCreate({
                 json: JSON.parse(templateContent),
@@ -283,9 +295,11 @@ export default {
                     },
                     cellRenderAfter: function (cell, position) {
                         const { r: row, c: column } = position;
-                        if (!that.handleAllow({ row, column })) {
-                            if (cell) {
+                        if (cell) {
+                            if (!that.handleAllow({ row, column })) {
                                 cell.bg = "#d5d5d5";
+                            } else {
+                                cell.bg = "#ffffff";
                             }
                         }
                     },

+ 1 - 1
src/pages/main/performance/department.vue

@@ -394,7 +394,7 @@ export default {
         data: data,
       }).then(({ data: { count, data } }) => {
         this.total = count;
-        this.table_list = data;
+        this.table_list = data || [];
         // this.table_list = [
         //   {
         //     id: 10,