fix: 组件重复引入bug

This commit is contained in:
fyy 2025-07-20 20:40:35 +08:00
parent 9a14f9bc77
commit 31c260c8ca

View File

@ -5,13 +5,12 @@ import {ref} from 'vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { Dayjs } from 'dayjs'; import { Dayjs } from 'dayjs';
import { columns, querySchema } from './data'; import { columns, querySchema } from './data';
import { import {
useVbenVxeGrid, useVbenVxeGrid,
vxeCheckboxChecked, vxeCheckboxChecked,
type VxeGridProps type VxeGridProps
} from '#/adapter/vxe-table'; } from '#/adapter/vxe-table';
import { getVxePopupContainer } from '@vben/utils'; import { getVxePopupContainer } from '@vben/utils';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { import {
arrangementExport, arrangementExport,
arrangementList, arrangementList,
@ -22,11 +21,7 @@ import type { ArrangementForm } from '#/api/property/attendanceManagement/arrang
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui'; import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { Modal, Popconfirm, Space } from 'ant-design-vue'; import { Modal, Popconfirm, Space } from 'ant-design-vue';
const emit = defineEmits<{(e:'changeView',value:boolean):void}>(); const emit = defineEmits<{(e:'changeView',value:boolean):void}>();
const props = defineProps<{ const props = defineProps<{
viewMode:'calender' | 'schedule' viewMode:'calender' | 'schedule'
}>(); }>();
@ -40,25 +35,6 @@ function handleViewModeChange(e: RadioChangeEvent): void {
emit('changeView',e.target.value) emit('changeView',e.target.value)
} }
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// RangePicker /
//
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = { const gridOptions: VxeGridProps = {
checkboxConfig: { checkboxConfig: {
@ -90,10 +66,23 @@ const gridOptions: VxeGridProps = {
keyField: 'id', keyField: 'id',
}, },
// //
id: 'property-arrangement-index' id: 'property-arrangement-index',
toolbarConfig: {
//
show: true,
// "/" redo
refresh: false,
// ""
fullscreen: false,
// "" setting
columns: false,
// "" size
size: undefined,
//
// export: false, //
},
}; };
const [BasicTable, tableApi] = useVbenVxeGrid({ const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions, gridOptions,
}); });
@ -129,7 +118,7 @@ async function handleDelete(row: Required<ArrangementForm>) {
</div> </div>
<div class="flex-1"> <div class="flex-1">
<Page :auto-content-height="true"> <Page :auto-content-height="true">
<BasicTable table-title="排班列表"> <BasicTable >
<template #action="{ row }"> <template #action="{ row }">
<Space> <Space>
<ghost-button <ghost-button
@ -161,5 +150,4 @@ async function handleDelete(row: Required<ArrangementForm>) {
</div> </div>
</template> </template>
<style> <style>
</style> </style>