fix actions for calendar view

This commit is contained in:
chenos 2021-03-26 14:49:59 +08:00
parent 38e9b2c96c
commit bfa998e478
2 changed files with 19 additions and 0 deletions

View File

@ -10,5 +10,6 @@
.filter-action-button { .filter-action-button {
position: absolute; position: absolute;
left: 24px; left: 24px;
margin-left: 0;
} }
} }

View File

@ -10,6 +10,7 @@ import moment from 'moment';
const localizer = momentLocalizer(moment) // or globalizeLocalizer const localizer = momentLocalizer(moment) // or globalizeLocalizer
import Drawer from '@/components/pages/AdminLoader/Drawer'; import Drawer from '@/components/pages/AdminLoader/Drawer';
import { Details, DetailsPage } from '../Table'; import { Details, DetailsPage } from '../Table';
import { Actions } from '../../Actions';
export const icon = <LoadingOutlined style={{ fontSize: 36 }} spin />; export const icon = <LoadingOutlined style={{ fontSize: 36 }} spin />;
@ -60,6 +61,7 @@ export function Calendar(props: CalendarProps) {
endDateField, endDateField,
detailsOpenMode, detailsOpenMode,
details = [], details = [],
actions = [],
} = schema; } = schema;
console.log({schema}) console.log({schema})
@ -131,6 +133,22 @@ export function Calendar(props: CalendarProps) {
console.log('events', data) console.log('events', data)
return ( return (
<Card bordered={false}> <Card bordered={false}>
<Actions associatedKey={associatedKey} onTrigger={{
async create(values) {
await refresh();
},
async filter(values) {
const items = values.filter.and || values.filter.or;
// @ts-ignore
run({...params[0], filter: values.filter});
// refresh();
},
}} actions={actions} style={{
position: 'absolute',
left: '157px',
right: '168px',
marginBottom: 14
}}/>
<BigCalendar <BigCalendar
popup popup
selectable selectable