2024-08-07 08:57:56 +08:00
|
|
|
<script setup lang="ts">
|
2024-09-23 11:33:55 +08:00
|
|
|
import { Page, useVbenDrawer } from '@vben/common-ui';
|
|
|
|
import { $t } from '@vben/locales';
|
|
|
|
|
|
|
|
import { Space } from 'ant-design-vue';
|
|
|
|
|
|
|
|
import deptDrawer from './dept-drawer.vue';
|
|
|
|
|
|
|
|
const [DeptDrawer, drawerApi] = useVbenDrawer({
|
|
|
|
connectedComponent: deptDrawer,
|
|
|
|
});
|
|
|
|
|
|
|
|
function handleAdd() {
|
|
|
|
drawerApi.setData({});
|
|
|
|
drawerApi.open();
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleTest(id: number | string) {
|
|
|
|
drawerApi.setData({ id });
|
|
|
|
drawerApi.open();
|
|
|
|
}
|
2024-08-07 08:57:56 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-09-23 11:33:55 +08:00
|
|
|
<Page>
|
|
|
|
<Space>
|
|
|
|
<a-button type="primary" @click="handleAdd">
|
|
|
|
{{ $t('pages.common.add') }}
|
|
|
|
</a-button>
|
|
|
|
<a-button @click="handleTest(103)"> 新增 上级id=103 </a-button>
|
|
|
|
<a-button @click="handleTest(105)"> 新增 上级id=105 </a-button>
|
|
|
|
</Space>
|
|
|
|
<DeptDrawer />
|
|
|
|
</Page>
|
2024-08-07 08:57:56 +08:00
|
|
|
</template>
|