chore: menu

This commit is contained in:
dap 2024-10-05 21:04:44 +08:00
parent a7aeb5ae63
commit 69b1a133b1
3 changed files with 17 additions and 3 deletions

View File

@ -82,7 +82,15 @@ export const columns: VxeGridProps['columns'] = [
slots: {
default: ({ row }) => {
const current = menuTypes[row.menuType as 'C' | 'F' | 'M'];
return current as any;
if (!current) {
return '未知';
}
return (
<span class={['flex', 'items-center', 'justify-center']}>
{renderIcon(current.icon)}
<span style={{ marginLeft: '2px' }}>{current.value}</span>
</span>
);
},
},
},

View File

@ -13,6 +13,9 @@ import { columns, querySchema } from './data';
import menuDrawer from './menu-drawer.vue';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
@ -70,7 +73,7 @@ async function handleEdit(record: Recordable<any>) {
async function handleDelete(row: Recordable<any>) {
await menuRemove(row.menuId);
await tableApi.reload();
await tableApi.query();
}
function expandAll() {
@ -133,6 +136,6 @@ function collapseAll() {
</Space>
</template>
</BasicTable>
<MenuDrawer @reload="tableApi.reload()" />
<MenuDrawer @reload="tableApi.query()" />
</Page>
</template>

View File

@ -38,6 +38,9 @@ import roleAuthModal from './role-auth-modal.vue';
import roleDrawer from './role-drawer.vue';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};