Browse Source

导出问题处理

lph 1 year ago
parent
commit
2801f61f1b

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

@@ -1419,7 +1419,7 @@ export default {
         } else {
           // tempFieldName = temp.fieldName;
           tempFieldName = temp.tableName + "_" + temp.fieldName;
-          exportFieldName = temp.fieldName;
+          exportFieldName = temp.tableName + "_" + temp.fieldName;
         }
         if (temp.isShow) {
           let tempObj = {};
@@ -1924,6 +1924,7 @@ export default {
 
     // 获取按钮组数据
     async getBtnList() {
+      console.log("aaaaaaa");
       let res = await listBtn({ isEnablePaging: false, btnParentId: 0 });
       this.btnGroupOptions = res.rows.filter((item) => !item.whetherBind);
     },
@@ -1932,7 +1933,7 @@ export default {
   async mounted() {
     this.getAllTable();
     this.initDragTable();
-    this.getBtnList();
+    await this.getBtnList();
     await this.getMenuList();
     if (this.$route.query.tId) {
       this.tId = this.$route.query.tId;

+ 11 - 1
zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -120,9 +120,10 @@
       v-loading="loading"
       :data="tableList"
       @selection-change="handleSelectionChange"
-      row-key="id"
       ref="tableRef"
       :cell-style="cellStyle"
+      :reserve-selection="true"
+      :row-key="getRowKey"
     >
       <el-table-column
         type="selection"
@@ -445,6 +446,12 @@ export default {
     },
   },
   methods: {
+    // 获取row-key
+    getRowKey(row) {
+      return camelCase(
+        this.tableName + "_" + this.templateInfo.template?.primaryKey
+      );
+    },
     /** 查询列表 */
     getList(queryParams) {
       this.loading = true;
@@ -960,6 +967,9 @@ export default {
             })
           );
         });
+      } else {
+        this.$message.warning("请至少勾选一条导出数据");
+        return;
       }
       this.queryParams.execlMap = JSON.stringify(this.queryParams.execlMap);
       this.download(