fix查询初始化page页数
Showing
4 changed files
with
17 additions
and
9 deletions
... | @@ -2,5 +2,5 @@ | ... | @@ -2,5 +2,5 @@ |
2 | ENV = 'development' | 2 | ENV = 'development' |
3 | 3 | ||
4 | # base api | 4 | # base api |
5 | # VUE_APP_BASE_API = 'http://192.168.11.67:8096' | 5 | VUE_APP_BASE_API = 'http://192.168.11.67:8096' |
6 | VUE_APP_BASE_API = 'https://beta-salecloud-hengan.situdata.com' | 6 | # VUE_APP_BASE_API = 'https://beta-salecloud-hengan.situdata.com' | ... | ... |
... | @@ -50,7 +50,7 @@ service.interceptors.response.use( | ... | @@ -50,7 +50,7 @@ service.interceptors.response.use( |
50 | // 2909 登录超时 | 50 | // 2909 登录超时 |
51 | // cookie失效 | 51 | // cookie失效 |
52 | Message({ | 52 | Message({ |
53 | message: res.message || 'error', | 53 | message: res.msg || 'error', |
54 | type: 'error', | 54 | type: 'error', |
55 | duration: 5 * 1000 | 55 | duration: 5 * 1000 |
56 | }) | 56 | }) |
... | @@ -58,7 +58,7 @@ service.interceptors.response.use( | ... | @@ -58,7 +58,7 @@ service.interceptors.response.use( |
58 | router.push('/login') | 58 | router.push('/login') |
59 | } else if (res && res.code) { | 59 | } else if (res && res.code) { |
60 | Message({ | 60 | Message({ |
61 | message: res.message || 'error', | 61 | message: res.msg || 'error', |
62 | type: 'error', | 62 | type: 'error', |
63 | duration: 5 * 1000 | 63 | duration: 5 * 1000 |
64 | }) | 64 | }) | ... | ... |
... | @@ -4,6 +4,7 @@ | ... | @@ -4,6 +4,7 @@ |
4 | background | 4 | background |
5 | layout="total, prev, pager, next, sizes, jumper" | 5 | layout="total, prev, pager, next, sizes, jumper" |
6 | :total="pagination.total" | 6 | :total="pagination.total" |
7 | :current-page.sync="pagination.page" | ||
7 | @current-change="handleCurrentChange" | 8 | @current-change="handleCurrentChange" |
8 | @size-change="handleSizeChange" | 9 | @size-change="handleSizeChange" |
9 | ></el-pagination> | 10 | ></el-pagination> |
... | @@ -36,6 +37,10 @@ export default { | ... | @@ -36,6 +37,10 @@ export default { |
36 | this.$emit('pager', { ...this.pagination }) | 37 | this.$emit('pager', { ...this.pagination }) |
37 | }, | 38 | }, |
38 | methods: { | 39 | methods: { |
40 | changeCurrentSize(page) { | ||
41 | this.pagination.page = page | ||
42 | this.handleCurrentChange(page) | ||
43 | }, | ||
39 | handleCurrentChange(page) { | 44 | handleCurrentChange(page) { |
40 | this.$emit('pager', { ...this.pagination, page }) | 45 | this.$emit('pager', { ...this.pagination, page }) |
41 | }, | 46 | }, | ... | ... |
... | @@ -39,9 +39,7 @@ | ... | @@ -39,9 +39,7 @@ |
39 | </el-form> | 39 | </el-form> |
40 | </div> | 40 | </div> |
41 | <div class="flex-end mb10"> | 41 | <div class="flex-end mb10"> |
42 | <el-button type="primary" size="mini" @click="handleQueryOrderList" | 42 | <el-button type="primary" size="mini" @click="submit">查询</el-button> |
43 | >查询</el-button | ||
44 | > | ||
45 | <el-button size="mini" @click="onReset">重置</el-button> | 43 | <el-button size="mini" @click="onReset">重置</el-button> |
46 | </div> | 44 | </div> |
47 | <el-table | 45 | <el-table |
... | @@ -97,8 +95,9 @@ | ... | @@ -97,8 +95,9 @@ |
97 | </el-table-column> | 95 | </el-table-column> |
98 | </el-table> | 96 | </el-table> |
99 | <FooterPaginationfrom | 97 | <FooterPaginationfrom |
100 | @pager="handleGetPager" | 98 | ref="paginationRef" |
101 | :total="total" | 99 | :total="total" |
100 | @pager="handleGetPager" | ||
102 | ></FooterPaginationfrom> | 101 | ></FooterPaginationfrom> |
103 | </Card> | 102 | </Card> |
104 | </template> | 103 | </template> |
... | @@ -148,13 +147,17 @@ export default { | ... | @@ -148,13 +147,17 @@ export default { |
148 | console.log(error) | 147 | console.log(error) |
149 | } | 148 | } |
150 | }, | 149 | }, |
150 | submit() { | ||
151 | // 会触发pager事件 | ||
152 | this.$refs.paginationRef.changeCurrentSize(1) | ||
153 | }, | ||
151 | onReset() { | 154 | onReset() { |
152 | this.ruleForm = { | 155 | this.ruleForm = { |
153 | username: '', | 156 | username: '', |
154 | userId: '', | 157 | userId: '', |
155 | times: ['', ''] | 158 | times: ['', ''] |
156 | } | 159 | } |
157 | this.handleQueryOrderList() | 160 | this.submit() |
158 | }, | 161 | }, |
159 | handleGetPager(data) { | 162 | handleGetPager(data) { |
160 | this.pagination = data | 163 | this.pagination = data | ... | ... |
-
Please register or sign in to post a comment