From 2a9f0e7497d60d94795ce795863e0e24be5d44f9 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期一, 15 七月 2024 18:27:57 +0800
Subject: [PATCH] 1
---
mixin/mixin.js | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/mixin/mixin.js b/mixin/mixin.js
index 7459a6f..a2ac9ad 100644
--- a/mixin/mixin.js
+++ b/mixin/mixin.js
@@ -13,7 +13,7 @@
return state.hasLogin || false
},
selftype: state => {
- return state.type || ''
+ return (state.currentInfo || {}).type || ''
},
currentInfo: state => {
return state.currentInfo || {}
@@ -23,6 +23,9 @@
},
cache_user: state => {
return state.currentInfo || {}
+ },
+ sign: state => {
+ return state.sign || {}
},
// currentEnId: state=>{
// // console.log('currentEnId',state.currentInfo.enId,state.currentInfo)
@@ -255,13 +258,21 @@
}
return true
},
- async getList() {
+ async refreshList(){
+ this.page.current = 1
+ await this.getList()
+ },
+ async getList(type='get') {
if (this.listApi) {
this.$message.showLoading()
const {
data
- } = await this.$http.request('get', this.listApi, {
+ } = await this.$http.request(type, this.listApi, {
params: {
+ ...this.query,
+ ...this.page
+ },
+ data:{
...this.query,
...this.page
}
@@ -288,10 +299,10 @@
}
},
- async getMore() {
+ async getMore(type='get') {
if (this.page.total > this.page.current * this.page.size) {
this.page.current += 1
- await this.getList()
+ await this.getList(type)
}
},
backHome() {
--
Gitblit v1.9.3