2024-08-07 08:57:56 +08:00
|
|
|
<script setup lang="ts">
|
2024-09-22 21:37:32 +08:00
|
|
|
import { Page, useVbenDrawer } from '@vben/common-ui';
|
|
|
|
import { $t } from '@vben/locales';
|
|
|
|
|
2024-09-24 11:23:02 +08:00
|
|
|
import { Card } from 'ant-design-vue';
|
|
|
|
|
|
|
|
import { useVbenForm } from '#/adapter';
|
|
|
|
|
|
|
|
import { querySchema } from './data';
|
2024-09-22 21:37:32 +08:00
|
|
|
import menuDrawer from './menu-drawer.vue';
|
|
|
|
|
|
|
|
const [MenuDrawer, drawerApi] = useVbenDrawer({
|
|
|
|
connectedComponent: menuDrawer,
|
|
|
|
});
|
|
|
|
|
|
|
|
function handleAdd() {
|
|
|
|
drawerApi.setData({ update: false });
|
|
|
|
drawerApi.open();
|
|
|
|
}
|
2024-09-24 11:23:02 +08:00
|
|
|
|
|
|
|
const [QueryForm] = useVbenForm({
|
|
|
|
// 默认展开
|
|
|
|
collapsed: false,
|
|
|
|
// 所有表单项共用,可单独在表单内覆盖
|
|
|
|
commonConfig: {
|
|
|
|
// 所有表单项
|
|
|
|
componentProps: {
|
|
|
|
class: 'w-full',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
schema: querySchema(),
|
|
|
|
// 是否可展开
|
|
|
|
showCollapseButton: true,
|
|
|
|
submitButtonOptions: {
|
|
|
|
text: '查询',
|
|
|
|
},
|
|
|
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
|
|
|
});
|
2024-08-07 08:57:56 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-09-24 11:23:02 +08:00
|
|
|
<Page content-class="flex flex-col gap-4">
|
|
|
|
<Card>
|
|
|
|
<QueryForm />
|
|
|
|
</Card>
|
|
|
|
<Card>
|
|
|
|
<div class="flex justify-end">
|
|
|
|
<a-button type="primary" @click="handleAdd">
|
|
|
|
{{ $t('pages.common.add') }}
|
|
|
|
</a-button>
|
|
|
|
</div>
|
|
|
|
</Card>
|
2024-09-22 21:37:32 +08:00
|
|
|
<MenuDrawer />
|
|
|
|
</Page>
|
2024-08-07 08:57:56 +08:00
|
|
|
</template>
|