修复代码生成页面数据编辑保存之后总是跳转第一页的问题

pull/103/head
RuoYi 3 years ago
parent 97c0603269
commit 14771f0ab4

@ -144,7 +144,7 @@ export const constantRoutes = [
hidden: true, hidden: true,
children: [ children: [
{ {
path: 'index/:tableId(\\d+)', path: 'index',
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
name: 'GenEdit', name: 'GenEdit',
meta: { title: '修改生成配置', activeMenu: '/tool/gen'} meta: { title: '修改生成配置', activeMenu: '/tool/gen'}

@ -157,7 +157,7 @@ export default {
}; };
}, },
created() { created() {
const tableId = this.$route.params && this.$route.params.tableId; const tableId = this.$route.query && this.$route.query.tableId;
if (tableId) { if (tableId) {
// //
getGenTable(tableId).then(res => { getGenTable(tableId).then(res => {
@ -212,7 +212,7 @@ export default {
/** 关闭按钮 */ /** 关闭按钮 */
close() { close() {
this.$store.dispatch("tagsView/delView", this.$route); this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({ path: "/tool/gen", query: { t: Date.now()}}) this.$router.push({ path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } })
} }
}, },
mounted() { mounted() {

@ -238,7 +238,8 @@ export default {
const time = this.$route.query.t; const time = this.$route.query.t;
if (time != null && time != this.uniqueId) { if (time != null && time != this.uniqueId) {
this.uniqueId = time; this.uniqueId = time;
this.resetQuery(); this.queryParams.pageNum = Number(this.$route.query.pageNum);
this.getList();
} }
}, },
methods: { methods: {
@ -319,7 +320,7 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleEditTable(row) { handleEditTable(row) {
const tableId = row.tableId || this.ids[0]; const tableId = row.tableId || this.ids[0];
this.$router.push("/tool/gen-edit/index/" + tableId); this.$router.push({ path: '/tool/gen-edit/index', query: { tableId: tableId, pageNum: this.queryParams.pageNum } });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {

Loading…
Cancel
Save