<!-- 账号权限 -->
<template>
    <app-drawer class="role-auth" title="权限设置" width="680" v-model:show="show">
        <el-breadcrumb separator-icon="ArrowRight">
            <el-breadcrumb-item>当前角色</el-breadcrumb-item>
            <el-breadcrumb-item>{{ selectedRow.roleName }}</el-breadcrumb-item>
        </el-breadcrumb>
        <el-scrollbar height="300px">
            <el-tree :data="userMenus" :props="{ label: 'title' }" :expand-on-click-node="false" show-checkbox
                check-on-click-node default-expand-all />
        </el-scrollbar>
        <template #footer>
            <el-button @click="show = false">取消</el-button>
            <el-button type="primary" @click="show = false">提交</el-button>
        </template>
    </app-drawer>
</template>

<script lang="ts" setup>
import { ref, PropType } from 'vue'
import { useAuth } from '@/hooks/auth'
import AppDrawer from '@pc/components/base/drawer/index.vue'

defineProps({
    selectedRow: {
        type: Object as PropType<Ermcp.UserRole>,
        default: () => ({})
    }
})

const { userMenus } = useAuth()
const show = ref(true)
</script>

<style lang="less">
@import './index.less';
</style>