作者 稚屿

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

@@ -144,7 +144,7 @@ export const constantRoutes = [ @@ -144,7 +144,7 @@ export const constantRoutes = [
144 hidden: true, 144 hidden: true,
145 children: [ 145 children: [
146 { 146 {
147 - path: 'index/:tableId(\\d+)', 147 + path: 'index',
148 component: (resolve) => require(['@/views/tool/gen/editTable'], resolve), 148 component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
149 name: 'GenEdit', 149 name: 'GenEdit',
150 meta: { title: '修改生成配置', activeMenu: '/tool/gen'} 150 meta: { title: '修改生成配置', activeMenu: '/tool/gen'}
@@ -157,7 +157,7 @@ export default { @@ -157,7 +157,7 @@ export default {
157 }; 157 };
158 }, 158 },
159 created() { 159 created() {
160 - const tableId = this.$route.params && this.$route.params.tableId; 160 + const tableId = this.$route.query && this.$route.query.tableId;
161 if (tableId) { 161 if (tableId) {
162 // 获取表详细信息 162 // 获取表详细信息
163 getGenTable(tableId).then(res => { 163 getGenTable(tableId).then(res => {
@@ -212,7 +212,7 @@ export default { @@ -212,7 +212,7 @@ export default {
212 /** 关闭按钮 */ 212 /** 关闭按钮 */
213 close() { 213 close() {
214 this.$store.dispatch("tagsView/delView", this.$route); 214 this.$store.dispatch("tagsView/delView", this.$route);
215 - this.$router.push({ path: "/tool/gen", query: { t: Date.now()}}) 215 + this.$router.push({ path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } })
216 } 216 }
217 }, 217 },
218 mounted() { 218 mounted() {
@@ -238,7 +238,10 @@ export default { @@ -238,7 +238,10 @@ export default {
238 const time = this.$route.query.t; 238 const time = this.$route.query.t;
239 if (time != null && time != this.uniqueId) { 239 if (time != null && time != this.uniqueId) {
240 this.uniqueId = time; 240 this.uniqueId = time;
241 - this.resetQuery(); 241 + this.queryParams.pageNum = Number(this.$route.query.pageNum);
  242 + this.dateRange = [];
  243 + this.resetForm("queryForm");
  244 + this.getList();
242 } 245 }
243 }, 246 },
244 methods: { 247 methods: {
@@ -319,7 +322,7 @@ export default { @@ -319,7 +322,7 @@ export default {
319 /** 修改按钮操作 */ 322 /** 修改按钮操作 */
320 handleEditTable(row) { 323 handleEditTable(row) {
321 const tableId = row.tableId || this.ids[0]; 324 const tableId = row.tableId || this.ids[0];
322 - this.$router.push("/tool/gen-edit/index/" + tableId); 325 + this.$router.push({ path: '/tool/gen-edit/index', query: { tableId: tableId, pageNum: this.queryParams.pageNum } });
323 }, 326 },
324 /** 删除按钮操作 */ 327 /** 删除按钮操作 */
325 handleDelete(row) { 328 handleDelete(row) {