Explorar o código

修改拖拽表单时按钮组回显问题/分页数据保存已选择数据

lph hai 1 ano
pai
achega
cc0d7d4262

+ 9 - 3
zkqy-ui/src/views/tableMange/index.vue

@@ -1926,19 +1926,25 @@ export default {
     async getBtnList() {
       console.log("aaaaaaa");
       let res = await listBtn({ isEnablePaging: false, btnParentId: 0 });
-      this.btnGroupOptions = res.rows.filter((item) => !item.whetherBind);
+      // this.btnGroupOption=res.rows
+      // this.btnGroupOptions = res.rows.filter((item) => !item.whetherBind);
+      this.btnGroupOptions = res.rows.filter((item) => {
+        let isMyBtn=this.formData.btnGroupList.some((val)=>item.btnKey==val)
+        return !item.whetherBind ||isMyBtn
+      });
+      
     },
   },
   created() {},
   async mounted() {
     this.getAllTable();
     this.initDragTable();
-    await this.getBtnList();
     await this.getMenuList();
     if (this.$route.query.tId) {
       this.tId = this.$route.query.tId;
-      this.initTableData(this.tId);
+      await this.initTableData(this.tId);
     }
+    this.getBtnList();
   },
 };
 </script>

+ 12 - 5
zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -448,9 +448,16 @@ export default {
   methods: {
     // 获取row-key
     getRowKey(row) {
-      return camelCase(
-        this.tableName + "_" + this.templateInfo.template?.primaryKey
+      console.log(
+        row[
+          camelCase(
+            this.tableName + "_" + this.templateInfo.template?.primaryKey
+          )
+        ]
       );
+      return row[
+        camelCase(this.tableName + "_" + this.templateInfo.template?.primaryKey)
+      ];
     },
     /** 查询列表 */
     getList(queryParams) {
@@ -510,9 +517,9 @@ export default {
             // });
             this.tableList = await this.setFieldStyleData(tempTableList);
             this.total = res.total;
-            this.$nextTick(() => {
-              this.$refs.tableRef?.clearSelection();
-            });
+            // this.$nextTick(() => {
+            //   this.$refs.tableRef?.clearSelection();
+            // });
             this.loading = false;
           });