From 4470663489b8e7a3774c8d45f5f8bee881d0f552 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期一, 18 十一月 2024 14:44:26 +0800
Subject: [PATCH] 添加loading
---
src/components/page/orderRecord/indexDay.vue | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/src/components/page/orderRecord/indexDay.vue b/src/components/page/orderRecord/indexDay.vue
index 84402f9..9514a84 100644
--- a/src/components/page/orderRecord/indexDay.vue
+++ b/src/components/page/orderRecord/indexDay.vue
@@ -24,6 +24,7 @@
</div>
<el-table
+ v-loading="loading"
:height="tableHeight"
:data="table2"
border
@@ -71,7 +72,8 @@
table1:[],
table2:[],
headTable:[],
- tableHeight:500
+ tableHeight:500,
+ loading:true
}
},
created() {
@@ -85,19 +87,25 @@
},
methods: {
loadData() {
- this.table2 = []
- this.$byutil.postData(this, this.urlPath+'findCountPageByDay', this.searchForm,res => {
- this.headTable = res.data[0].data
- let temp = res.data
- temp.forEach(item => {
- let row = {day:item.day};
- item.data.forEach(e=>{
- row[e.parkName + 'num']=e.num;
- row[e.parkName + 'price']=e.price;
+ try{
+ this.loading = true
+ this.table2 = []
+ this.$byutil.postData(this, this.urlPath+'findCountPageByDay', this.searchForm,res => {
+ this.loading = false
+ this.headTable = res.data[0].data
+ let temp = res.data
+ temp.forEach(item => {
+ let row = {day:item.day};
+ item.data.forEach(e=>{
+ row[e.parkName + 'num']=e.num;
+ row[e.parkName + 'price']=e.price;
+ })
+ this.table2.push(row)
})
- this.table2.push(row)
- })
- });
+ });
+ }catch (err){
+ this.loading = false
+ }
},
onSearch() {
this.loadData();
--
Gitblit v1.9.1