jiangping
2024-06-28 c41f8c8a75c4475831e3c7e9cde7467d2fb39950
company/src/components/system/role/MenuConfigWindow.vue
@@ -25,7 +25,8 @@
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import { createRoleMenu } from '@/api/system/role'
import { fetchTree as fetchMenuList } from '@/api/system/menu'
import {   fetchTree1 } from '@/api/system/menu'
import { mapState } from 'vuex'
export default {
  name: 'MenuConfigWindow',
  components: { GlobalWindow },
@@ -41,12 +42,15 @@
      selectedIds: []
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  methods: {
    /**
     * @role 角色对象
     */
    open (role) {
      fetchMenuList({})
        fetchTree1(0)
        .then(records => {
          this.role = role
          this.menus = records
@@ -61,6 +65,25 @@
        .catch(e => {
          this.$tip.apiFailed(e)
        })
      // }
      // else {
      //   fetchMenuList()
      //     .then(records => {
      //       this.role = role
      //       this.menus = records
      //       // 如果为固定角色,则固定菜单不可更改
      //       this.__resetDisabled(this.menus, this.role)
      //       // 找出叶节点
      //       role.menus = role.menus.filter(menu => role.menus.findIndex(m => m.parentId === menu.id) === -1)
      //       // 初始化选中
      //       this.selectedIds = role.menus.map(r => r.id)
      //       this.visible = true
      //     })
      //     .catch(e => {
      //       this.$tip.apiFailed(e)
      //     })
      // }
    },
    // 确认选择菜单
    confirm () {