소스 검색

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

daiqisheng 3 년 전
부모
커밋
4a1d96ac19
2개의 변경된 파일29개의 추가작업 그리고 14개의 파일을 삭제
  1. 28 12
      src/pages/main/performance/components/sheet.vue
  2. 1 2
      src/pages/main/performance/department.vue

+ 28 - 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:33:50
+ * @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";
                             }
                         }
                     },
@@ -397,6 +411,8 @@ export default {
             // 新增时添加权限
             if (!this.id) {
                 this.handleAddAuth({ id: body });
+            } else {
+                this.$message.success("提交成功");
             }
             this.$emit("save");
         },

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

@@ -398,7 +398,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,
@@ -677,7 +677,6 @@ export default {
       this.track_visible = visible;
     },
     handleSave() {
-      this.$message.success("提交成功");
       this.handleInit({
         ...this.table_search,
         page: this.page,