소스 검색

修复代码生成点击多次表修改数据不变化的问题

RuoYi 4 년 전
부모
커밋
7a9564ced5
3개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      ruoyi-ui/src/router/index.js
  2. 2 2
      ruoyi-ui/src/views/tool/gen/editTable.vue
  3. 1 1
      ruoyi-ui/src/views/tool/gen/index.vue

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

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

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

@@ -147,8 +147,8 @@ export default {
       info: {}
     };
   },
-  beforeCreate() {
-    const { tableId } = this.$route.query;
+  created() {
+    const tableId = this.$route.params && this.$route.params.tableId;
     if (tableId) {
       // 获取表详细信息
       getGenTable(tableId).then(res => {

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

@@ -270,7 +270,7 @@ export default {
     /** 修改按钮操作 */
     handleEditTable(row) {
       const tableId = row.tableId || this.ids[0];
-      this.$router.push({ path: "/gen/edit", query: { tableId: tableId } });
+      this.$router.push("/gen/edit/" + tableId);
     },
     /** 删除按钮操作 */
     handleDelete(row) {