Przeglądaj źródła

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

RuoYi 4 lat temu
rodzic
commit
14771f0ab4

+ 1 - 1
ruoyi-ui/src/router/index.js

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

+ 2 - 2
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -157,7 +157,7 @@ export default {
157 157
     };
158 158
   },
159 159
   created() {
160
-    const tableId = this.$route.params && this.$route.params.tableId;
160
+    const tableId = this.$route.query && this.$route.query.tableId;
161 161
     if (tableId) {
162 162
       // 获取表详细信息
163 163
       getGenTable(tableId).then(res => {
@@ -212,7 +212,7 @@ export default {
212 212
     /** 关闭按钮 */
213 213
     close() {
214 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 218
   mounted() {

+ 3 - 2
ruoyi-ui/src/views/tool/gen/index.vue

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