sr 4 жил өмнө
parent
commit
c2a4ee4d22

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

@@ -39,6 +39,7 @@ const permission = {
           const rdata = JSON.parse(JSON.stringify(res.data))
           const sidebarRoutes = filterAsyncRouter(sdata)
           const rewriteRoutes = filterAsyncRouter(rdata, false, true)
+          console.log(sdata,sidebarRoutes,9998888)
           rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
           commit('SET_ROUTES', rewriteRoutes)
           commit('SET_SIDEBAR_ROUTERS', sidebarRoutes)

+ 16 - 6
ruoyi-ui/src/views/system/surface/index.vue

@@ -61,8 +61,9 @@
         activeNames: ['1'],
         title: '',
         queryData: {},
+        tabName: '',
         form: {
-          table: 'obj_test',
+          table: '',
           objId: -1,
           fixedData: {
             condition: {
@@ -72,7 +73,7 @@
         },
         // 查询参数
         queryParams: {
-          table: 'obj_test',
+          table: '',
           pageNo: 1,
           isUi: false,
           pageSize: 10,
@@ -116,7 +117,16 @@
         meta,
         path
       } = route;
-      console.log(route,this.tabIndex,99112)
+      let items = this.sidebarRouters.filter(res => {
+        return res.path == ('/'+this.tabIndex.split('/')[1])
+      })[0].children.filter(res => {
+        return res.path == this.tabIndex.split('/')[2]
+      })[0]
+      this.tabName = items.sysTableName
+      this.queryParams.table = items.sysTableName
+      this.form.table = items.sysTableName
+      
+      console.log(items,99112)
       // if (meta.activeMenu) {
       //   this.$store.dispatch('TabFn', meta.activeMenu)
       // }
@@ -153,7 +163,7 @@
                 return
               }
               delMenu({
-                table: 'obj_test',
+                table: this.tabName,
                 idList: this.ids
               }).then(res => {
                 this.msgSuccess('删除成功')
@@ -206,7 +216,7 @@
       // 表单重置
       reset() {
         this.form = {
-          table: 'obj_test',
+          table: this.tabName,
           objId: '',
           fixedData: {
             condition: {
@@ -248,7 +258,7 @@
       },
       init() {
         tableQuery({
-          table: 'obj_test',
+          table: this.tabName,
         }).then(res => {
           let data = res.data
           this.queryData = data