🎉 修复分页参数丢失的bug

This commit is contained in:
smallchill 2019-06-25 10:33:21 +08:00
parent 0606c430d5
commit 0e5378fb1e
14 changed files with 78 additions and 64 deletions

View File

@ -100,8 +100,10 @@
}); });
this.$store.dispatch("LoginByUsername", this.loginForm).then(() => { this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
this.$router.push({ path: this.tagWel.value }); this.$router.push({ path: this.tagWel.value });
});
loading.close(); loading.close();
}).catch(() => {
loading.close()
});
} }
}); });
} }

View File

@ -40,6 +40,7 @@
data() { data() {
return { return {
form: {}, form: {},
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -169,9 +170,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -214,7 +217,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -25,6 +25,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -104,9 +105,11 @@
}, },
methods: { methods: {
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
beforeOpen(done, type) { beforeOpen(done, type) {
@ -124,7 +127,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getApiList(page.currentPage, page.pageSize, params).then(res => { getApiList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -25,6 +25,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -111,9 +112,11 @@
}, },
methods: { methods: {
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
beforeOpen(done, type) { beforeOpen(done, type) {
@ -131,7 +134,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getErrorList(page.currentPage, page.pageSize, params).then(res => { getErrorList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -25,6 +25,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -103,9 +104,11 @@
}, },
methods: { methods: {
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
beforeOpen(done, type) { beforeOpen(done, type) {
@ -123,7 +126,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getUsualList(page.currentPage, page.pageSize, params).then(res => { getUsualList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -36,6 +36,7 @@
data() { data() {
return { return {
form: {}, form: {},
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -227,9 +228,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -272,7 +275,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -29,14 +29,7 @@
</template> </template>
<script> <script>
import { import {add, getDept, getDeptTree, getList, remove, update} from "@/api/system/dept";
getList,
remove,
update,
add,
getDept,
getDeptTree
} from "@/api/system/dept";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import website from '@/config/website'; import website from '@/config/website';
@ -45,6 +38,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -226,9 +220,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -249,9 +245,8 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; this.data = res.data.data;
this.data = data;
getDeptTree().then(res => { getDeptTree().then(res => {
const data = res.data.data; const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId"); const index = this.$refs.crud.findColumnIndex("parentId");

View File

@ -29,14 +29,7 @@
</template> </template>
<script> <script>
import { import {add, getDict, getDictTree, getList, remove, update} from "@/api/system/dict";
getList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dict";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
@ -44,6 +37,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -188,9 +182,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -233,9 +229,8 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; this.data = res.data.data;
this.data = data;
getDictTree().then(res => { getDictTree().then(res => {
const data = res.data.data; const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId"); const index = this.$refs.crud.findColumnIndex("parentId");

View File

@ -35,7 +35,7 @@
</template> </template>
<script> <script>
import {getList, remove, update, add, getMenu} from "@/api/system/menu"; import {add, getList, getMenu, remove, update} from "@/api/system/menu";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import iconList from "@/config/iconList"; import iconList from "@/config/iconList";
@ -44,6 +44,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -290,9 +291,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -335,9 +338,8 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; this.data = res.data.data;
this.data = data;
}); });
} }
} }

View File

@ -37,6 +37,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -146,9 +147,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -183,7 +186,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -50,16 +50,7 @@
</template> </template>
<script> <script>
import { import {add, getList, getRole, getRoleTree, grant, grantTree, remove, update} from "@/api/system/role";
getList,
remove,
update,
add,
grant,
grantTree,
getRole,
getRoleTree
} from "@/api/system/role";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import website from '@/config/website'; import website from '@/config/website';
@ -75,6 +66,7 @@ export default {
list: [], list: [],
defaultObj: [], defaultObj: [],
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -248,9 +240,11 @@ export default {
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -301,9 +295,8 @@ export default {
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; this.data = res.data.data;
this.data = data;
getRoleTree().then(res => { getRoleTree().then(res => {
const data = res.data.data; const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId"); const index = this.$refs.crud.findColumnIndex("parentId");

View File

@ -37,6 +37,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -166,9 +167,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -203,7 +206,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -79,6 +79,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -325,9 +326,11 @@
}); });
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -399,7 +402,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;

View File

@ -44,6 +44,7 @@
return { return {
form: {}, form: {},
selectionList: [], selectionList: [],
query: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -205,9 +206,11 @@
}, },
searchReset() { searchReset() {
this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params) { searchChange(params) {
this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
}, },
selectionChange(list) { selectionChange(list) {
@ -273,7 +276,7 @@
this.page.pageSize = pageSize; this.page.pageSize = pageSize;
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;