<script lang="ts" setup>
|
import { reactive, toRefs } from 'vue';
|
|
import { BasicPopup, usePopupInner } from '@jnpf/ui/popup';
|
|
import Authorize from '#/views/_core/profile/components/Authorize.vue';
|
|
interface State {
|
title: string;
|
userId: string;
|
}
|
|
const state = reactive<State>({
|
title: '',
|
userId: '',
|
});
|
const { title, userId } = toRefs(state);
|
const [registerPopup] = usePopupInner(init);
|
|
function init(data) {
|
state.title = `${data.fullName}的权限`;
|
state.userId = data.id || '';
|
}
|
function onClose() {
|
state.userId = '';
|
}
|
</script>
|
<template>
|
<BasicPopup v-bind="$attrs" @register="registerPopup" :title="title" class="full-popup" destroy-on-close @close="onClose">
|
<Authorize :user-id="userId" v-if="userId" />
|
</BasicPopup>
|
</template>
|