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 { columns, querySchema } from './data';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import { getVxePopupContainer } from '@vben/utils';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import {
arrangementExport,
arrangementList,
@@ -22,11 +21,7 @@ import type { ArrangementForm } from '#/api/property/attendanceManagement/arrang
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
const emit = defineEmits<{(e:'changeView',value:boolean):void}>();
const props = defineProps<{
viewMode:'calender' | 'schedule'
}>();
@@ -40,25 +35,6 @@ function handleViewModeChange(e: RadioChangeEvent): void {
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 = {
checkboxConfig: {
@@ -90,10 +66,23 @@ const gridOptions: VxeGridProps = {
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({
formOptions,
gridOptions,
});
@@ -129,7 +118,7 @@ async function handleDelete(row: Required<ArrangementForm>) {
</div>
<div class="flex-1">
<Page :auto-content-height="true">
<BasicTable table-title="排班列表">
<BasicTable >
<template #action="{ row }">
<Space>
<ghost-button
@@ -161,5 +150,4 @@ async function handleDelete(row: Required<ArrangementForm>) {
</div>
</template>
<style>
</style>
</style>