Przeglądaj źródła

:tada: 表格加载添加loading

smallchill 6 lat temu
rodzic
commit
1fd754d0aa

+ 4 - 0
src/views/authority/apiscope.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -89,6 +90,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -474,8 +476,10 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getMenuList(page.currentPage, page.pageSize, params).then(res => {
           this.data = res.data.data;
+          this.loading = false;
         });
       },
       // 数据权限模块

+ 4 - 0
src/views/authority/datascope.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -89,6 +90,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -504,8 +506,10 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getMenuList(page.currentPage, page.pageSize, params).then(res => {
           this.data = res.data.data;
+          this.loading = false;
         });
       },
       // 数据权限模块

+ 4 - 0
src/views/authority/role.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -95,6 +96,7 @@
         apiScopeTreeObj: [],
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -330,6 +332,7 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           this.data = res.data.data;
           getRoleTree().then(res => {
@@ -337,6 +340,7 @@
             const index = this.$refs.crud.findColumnIndex("parentId");
             this.option.column[index].dicData = data;
           });
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/desk/notice.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                :page="page"
                @row-del="rowDel"
@@ -41,6 +42,7 @@
       return {
         form: {},
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -247,10 +249,12 @@
           }
           values.releaseTimeRange = null;
         }
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/flow/follow.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -51,6 +52,7 @@
         processInstanceId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -165,10 +167,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         followList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/flow/manager.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -116,6 +117,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -313,10 +315,12 @@
           ...params,
           category: (params.category) ? flowCategory(params.category) : null
         }
+        this.loading = true;
         managerList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/flow/model.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -125,6 +126,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -297,10 +299,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         modelList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
         getDictionary({code: 'flow'}).then(res => {
           this.category = res.data.data;

+ 4 - 0
src/views/monitor/log/api.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -26,6 +27,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -127,10 +129,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getApiList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/monitor/log/error.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                :before-open="beforeOpen"
@@ -26,6 +27,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -134,10 +136,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getErrorList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/monitor/log/usual.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -26,6 +27,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -126,10 +128,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getUsualList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/resource/oss.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                :page="page"
                @row-del="rowDel"
@@ -55,6 +56,7 @@
       return {
         form: {},
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -281,10 +283,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 6 - 2
src/views/system/client.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                :page="page"
                @row-del="rowDel"
@@ -37,6 +38,7 @@
       return {
         form: {},
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -268,17 +270,19 @@
         }
         done();
       },
-      currentChange(currentPage){
+      currentChange(currentPage) {
         this.page.currentPage = currentPage;
       },
-      sizeChange(pageSize){
+      sizeChange(pageSize) {
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/dept.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -50,6 +51,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -272,6 +274,7 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           this.data = res.data.data;
           getDeptTree().then(res => {
@@ -279,6 +282,7 @@
             const index = this.$refs.crud.findColumnIndex("parentId");
             this.option.column[index].dicData = data;
           });
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/dict.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -45,6 +46,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -236,6 +238,7 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           this.data = res.data.data;
           getDictTree().then(res => {
@@ -243,6 +246,7 @@
             const index = this.$refs.crud.findColumnIndex("parentId");
             this.option.column[index].dicData = data;
           });
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/menu.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -44,6 +45,7 @@
       return {
         form: {},
         query: {},
+        loading: true,
         selectionList: [],
         page: {
           pageSize: 10,
@@ -295,8 +297,10 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           this.data = res.data.data;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/param.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -38,6 +39,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -186,10 +188,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/tenant.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -38,6 +39,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -206,10 +208,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/topmenu.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                :page="page"
                :permission="permissionList"
@@ -70,6 +71,7 @@
         form: {},
         box: false,
         query: {},
+        loading: true,
         props: {
           label: "title",
           value: "key"
@@ -276,10 +278,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/system/user.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -80,6 +81,7 @@
         form: {},
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -406,10 +408,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
+        this.loading = true;
         getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
         getDeptTree(this.form.tenantId).then(res => {
           const index = this.$refs.crud.findColumnIndex("deptId");

+ 7 - 1
src/views/tool/code.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -44,6 +45,8 @@
       return {
         form: {},
         selectionList: [],
+        loading: true,
+        query: {},
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -209,6 +212,7 @@
         this.onLoad(this.page);
       },
       searchChange(params) {
+        this.query = params;
         this.onLoad(this.page, params);
       },
       selectionChange(list) {
@@ -274,10 +278,12 @@
         this.page.pageSize = pageSize;
       },
       onLoad(page, params = {}) {
-        getList(page.currentPage, page.pageSize, params).then(res => {
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/work/claim.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -74,6 +75,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -191,10 +193,12 @@
           ...params,
           category: (params.category) ? flowCategory(params.category) : null
         }
+        this.loading = true;
         claimList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/work/done.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -67,6 +68,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -167,10 +169,12 @@
           ...params,
           category: (params.category) ? flowCategory(params.category) : null
         }
+        this.loading = true;
         doneList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/work/send.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -71,6 +72,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -177,10 +179,12 @@
           ...params,
           category: (params.category) ? flowCategory(params.category) : null
         }
+        this.loading = true;
         sendList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/work/start.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -75,6 +76,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -180,10 +182,12 @@
           ...params,
           category: (params.category) ? flowCategory(params.category) : null
         }
+        this.loading = true;
         startList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 4 - 0
src/views/work/todo.vue

@@ -1,6 +1,7 @@
 <template>
   <basic-container>
     <avue-crud :option="option"
+               :table-loading="loading"
                :data="data"
                ref="crud"
                v-model="form"
@@ -74,6 +75,7 @@
         selectionId: '',
         selectionList: [],
         query: {},
+        loading: true,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -177,10 +179,12 @@
           ...params,
           category: (params.category) ? flowCategory(params.category) : null
         }
+        this.loading = true;
         todoList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
+          this.loading = false;
         });
       }
     }

+ 1 - 1
vue.config.js

@@ -25,7 +25,7 @@ module.exports = {
     port: 1888,
     proxy: {
       '/api': {
-        target: 'http://localhost',
+        target: 'https://saber.bladex.vip/api',
         ws: true,
         pathRewrite: {
           '^/api': '/'