功能变化: 前端菜单按钮跳转路由参数

treebeard
李强 2022-05-18 13:55:46 +08:00
parent 4b11e53f48
commit de43b5945a
2 changed files with 3 additions and 5 deletions

View File

@ -72,8 +72,7 @@ export default {
createPermission (scope) { createPermission (scope) {
this.$router.push({ this.$router.push({
name: 'menuButton', name: 'menuButton',
params: { id: scope.row.id }, query: { id: scope.row.id, name: scope.row.name }
query: { name: scope.row.name }
}) })
}, },
// viewsvue // viewsvue

View File

@ -43,7 +43,6 @@
import * as api from './api' import * as api from './api'
import { crudOptions } from './crud' import { crudOptions } from './crud'
import { d2CrudPlus } from 'd2-crud-plus' import { d2CrudPlus } from 'd2-crud-plus'
import router from '@/router'
export default { export default {
name: 'menuButton', name: 'menuButton',
mixins: [d2CrudPlus.crud], mixins: [d2CrudPlus.crud],
@ -55,11 +54,11 @@ export default {
return crudOptions(this) return crudOptions(this)
}, },
pageRequest (query) { pageRequest (query) {
const menuId = this.$route.params.id const menuId = this.$route.query.id
return api.GetList({ ...query, menu: menuId }) return api.GetList({ ...query, menu: menuId })
}, },
addRequest (row) { addRequest (row) {
const menuId = this.$route.params.id const menuId = this.$route.query.id
return api.createObj(row, menuId) return api.createObj(row, menuId)
}, },
updateRequest (row) { updateRequest (row) {