From 300302c118798bd0111b1de4405407c28c350e12 Mon Sep 17 00:00:00 2001 From: dream2023 <1098626505@qq.com> Date: Sat, 13 Jan 2024 17:44:08 +0800 Subject: [PATCH] fix: bug --- .../client/collection-templates/calendar.tsx | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-calendar/src/client/collection-templates/calendar.tsx b/packages/plugins/@nocobase/plugin-calendar/src/client/collection-templates/calendar.tsx index c22c47516a..fbe37d9c36 100644 --- a/packages/plugins/@nocobase/plugin-calendar/src/client/collection-templates/calendar.tsx +++ b/packages/plugins/@nocobase/plugin-calendar/src/client/collection-templates/calendar.tsx @@ -1,58 +1,58 @@ -import { CollectionTemplate, getConfigurableProperties } from '@nocobase/client'; +import { CollectionTemplate, ICollectionTemplate, getConfigurableProperties } from '@nocobase/client'; import { generateNTemplate } from '../../locale'; -// export const calendar: ICollectionTemplate = { -// name: 'calendar', -// title: generateNTemplate('Calendar collection'), -// order: 2, -// color: 'orange', -// default: { -// createdBy: true, -// updatedBy: true, -// createdAt: true, -// updatedAt: true, -// sortable: true, -// fields: [ -// { -// name: 'cron', -// type: 'string', -// uiSchema: { -// type: 'string', -// title: generateNTemplate('Repeats'), -// 'x-component': 'CronSet', -// 'x-component-props': 'allowClear', -// enum: [ -// { -// label: generateNTemplate('Daily'), -// value: '0 0 0 * * ?', -// }, -// { -// label: generateNTemplate('Weekly'), -// value: 'every_week', -// }, -// { -// label: generateNTemplate('Monthly'), -// value: 'every_month', -// }, -// { -// label: generateNTemplate('Yearly'), -// value: 'every_year', -// }, -// ], -// }, -// interface: 'select', -// }, -// { -// name: 'exclude', -// type: 'json', -// }, -// ], -// }, -// availableFieldInterfaces: { -// include: [], -// }, -// configurableProperties: getConfigurableProperties('title', 'name', 'inherits', 'category', 'description'), -// }; +export const calendar: ICollectionTemplate = { + name: 'calendar', + title: generateNTemplate('Calendar collection'), + order: 2, + color: 'orange', + default: { + createdBy: true, + updatedBy: true, + createdAt: true, + updatedAt: true, + sortable: true, + fields: [ + { + name: 'cron', + type: 'string', + uiSchema: { + type: 'string', + title: generateNTemplate('Repeats'), + 'x-component': 'CronSet', + 'x-component-props': 'allowClear', + enum: [ + { + label: generateNTemplate('Daily'), + value: '0 0 0 * * ?', + }, + { + label: generateNTemplate('Weekly'), + value: 'every_week', + }, + { + label: generateNTemplate('Monthly'), + value: 'every_month', + }, + { + label: generateNTemplate('Yearly'), + value: 'every_year', + }, + ], + }, + interface: 'select', + }, + { + name: 'exclude', + type: 'json', + }, + ], + }, + availableFieldInterfaces: { + include: [], + }, + configurableProperties: getConfigurableProperties('title', 'name', 'inherits', 'category', 'description'), +}; export class CalendarCollectionTemplate extends CollectionTemplate { name = 'calendar';