Browse Source

表格编辑和表单编辑路由跳转调整

lph 1 year ago
parent
commit
e3160003fe

+ 4 - 3
ruoyi-ui/src/store/getters.js

@@ -12,8 +12,9 @@ const getters = {
   roles: state => state.user.roles,
   roles: state => state.user.roles,
   permissions: state => state.user.permissions,
   permissions: state => state.user.permissions,
   permission_routes: state => state.permission.routes,
   permission_routes: state => state.permission.routes,
-  topbarRouters:state => state.permission.topbarRouters,
-  defaultRoutes:state => state.permission.defaultRoutes,
-  sidebarRouters:state => state.permission.sidebarRouters,
+  topbarRouters: state => state.permission.topbarRouters,
+  defaultRoutes: state => state.permission.defaultRoutes,
+  sidebarRouters: state => state.permission.sidebarRouters,
+  addRoutes: state => state.permission.addRoutes
 }
 }
 export default getters
 export default getters

+ 1 - 0
ruoyi-ui/src/store/modules/permission.js

@@ -37,6 +37,7 @@ const permission = {
           const sdata = JSON.parse(JSON.stringify(res.data))
           const sdata = JSON.parse(JSON.stringify(res.data))
           const rdata = JSON.parse(JSON.stringify(res.data))
           const rdata = JSON.parse(JSON.stringify(res.data))
           const sidebarRoutes = filterAsyncRouter(sdata)
           const sidebarRoutes = filterAsyncRouter(sdata)
+          // console.log('sidebarRoutes', sidebarRoutes);
           const rewriteRoutes = filterAsyncRouter(rdata, false, true)
           const rewriteRoutes = filterAsyncRouter(rdata, false, true)
           const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
           const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
           rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
           rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })

+ 2 - 2
ruoyi-ui/src/views/dragform/index.vue

@@ -485,7 +485,7 @@ export default {
     /** 新增按钮操作 */
     /** 新增按钮操作 */
     handleAdd() {
     handleAdd() {
       sessionStorage.removeItem("fid");
       sessionStorage.removeItem("fid");
-      this.$router.push("system/fromModel/index");
+      this.$router.push("/system/fromModel/index/formBuild");
     },
     },
     /** 修改按钮操作 */
     /** 修改按钮操作 */
     handleUpdate(row) {
     handleUpdate(row) {
@@ -493,7 +493,7 @@ export default {
       sessionStorage.setItem("fid", fId);
       sessionStorage.setItem("fid", fId);
       // this.$router.replace("system/fromModel/index");
       // this.$router.replace("system/fromModel/index");
       this.$router.push({
       this.$router.push({
-        path: "/system/fromModel/index/system/fromModel/index",
+        path: "/system/fromModel/index/formBuild",
         query: { fId },
         query: { fId },
       });
       });
     },
     },

+ 12 - 4
ruoyi-ui/src/views/dragform/tableList.vue

@@ -86,7 +86,7 @@
         @queryTable="getList"
         @queryTable="getList"
       ></right-toolbar>
       ></right-toolbar>
     </el-row>
     </el-row>
-  
+
     <el-table
     <el-table
       v-loading="loading"
       v-loading="loading"
       :data="tableList"
       :data="tableList"
@@ -146,7 +146,6 @@
                   >删除
                   >删除
                 </el-button>
                 </el-button>
               </el-dropdown-item>
               </el-dropdown-item>
-             
             </el-dropdown-menu>
             </el-dropdown-menu>
           </el-dropdown>
           </el-dropdown>
         </template>
         </template>
@@ -224,6 +223,7 @@
 </template>
 </template>
 <script>
 <script>
 import { listTable, removeTableList } from "@/api/dragform/tableList";
 import { listTable, removeTableList } from "@/api/dragform/tableList";
+import { mapGetters } from "vuex";
 import DictData from "@/components/DictData";
 import DictData from "@/components/DictData";
 
 
 export default {
 export default {
@@ -274,6 +274,10 @@ export default {
   created() {
   created() {
     this.getList();
     this.getList();
   },
   },
+  computed: {
+    ...mapGetters(["addRoutes"]),
+  },
+
   methods: {
   methods: {
     /** 查询动态格列表 */
     /** 查询动态格列表 */
     getList() {
     getList() {
@@ -336,6 +340,7 @@ export default {
     //   this.title = "添加动态格";
     //   this.title = "添加动态格";
     // },
     // },
     handleAdd() {
     handleAdd() {
+      console.log(this.addRoutes);
       this.$router.push({
       this.$router.push({
         path: "/system/fromModel/index/tableMange",
         path: "/system/fromModel/index/tableMange",
       });
       });
@@ -387,9 +392,12 @@ export default {
         data.sqlKeys = this.Keys;
         data.sqlKeys = this.Keys;
       }
       }
       // console.log(data);
       // console.log(data);
-      this.$modal.confirm('是否确认删除动态格编号为"' + data.tIds.join(',') + '"的数据项?')
+      this.$modal
+        .confirm(
+          '是否确认删除动态格编号为"' + data.tIds.join(",") + '"的数据项?'
+        )
         .then(async function () {
         .then(async function () {
-          const res = await removeTableList(data)
+          const res = await removeTableList(data);
           // console.log(res);
           // console.log(res);
         })
         })
         .then(() => {
         .then(() => {