improve text

This commit is contained in:
chenos 2021-08-24 23:10:19 +08:00
parent 53fa47c56f
commit 4507a5aca1
27 changed files with 101 additions and 95 deletions

View File

@ -20,7 +20,7 @@ import { useState } from 'react';
const actionTypeMap = new Map( const actionTypeMap = new Map(
Object.entries({ Object.entries({
create: '新增', create: '创建',
get: '查看', get: '查看',
update: '编辑', update: '编辑',
destroy: '删除', destroy: '删除',

View File

@ -294,7 +294,7 @@ const schema: ISchema = {
[uid()]: { [uid()]: {
type: 'void', type: 'void',
name: 'action1', name: 'action1',
title: '新增', title: '创建',
'x-align': 'right', 'x-align': 'right',
'x-decorator': 'AddNew.Displayed', 'x-decorator': 'AddNew.Displayed',
'x-decorator-props': { 'x-decorator-props': {
@ -307,7 +307,7 @@ const schema: ISchema = {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {

View File

@ -26,7 +26,7 @@ ActionLogs.FieldValue = observer((props: any) => {
if (!collectionField.uiSchema) { if (!collectionField.uiSchema) {
if (!field.value) { if (!field.value) {
return <div>N/A</div>; return <div></div>;
} }
if (typeof field.value === 'boolean') { if (typeof field.value === 'boolean') {
return <div>{field.value ? 'true' : 'false'}</div>; return <div>{field.value ? 'true' : 'false'}</div>;

View File

@ -503,7 +503,7 @@ Action.DesignableBar = (props: any) => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
</Menu> </Menu>
} }

View File

@ -1,5 +1,5 @@
--- ---
title: AddNew - 新增 title: AddNew - 创建
nav: nav:
title: 组件 title: 组件
path: /client path: /client
@ -9,7 +9,7 @@ group:
path: /client/schemas path: /client/schemas
--- ---
# AddNew - 新增 # AddNew - 创建
## Node Tree ## Node Tree

View File

@ -181,7 +181,7 @@ function generateCardItemSchema(component) {
[uid()]: { [uid()]: {
type: 'void', type: 'void',
name: 'action1', name: 'action1',
title: '新增', title: '创建',
'x-align': 'right', 'x-align': 'right',
'x-decorator': 'AddNew.Displayed', 'x-decorator': 'AddNew.Displayed',
'x-decorator-props': { 'x-decorator-props': {
@ -195,7 +195,7 @@ function generateCardItemSchema(component) {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
@ -365,7 +365,7 @@ function generateCardItemSchema(component) {
properties: { properties: {
create: { create: {
type: 'void', type: 'void',
title: '新增卡片', title: '添加卡片',
// 'x-designable-bar': 'Kanban.AddCardDesignableBar', // 'x-designable-bar': 'Kanban.AddCardDesignableBar',
'x-component': 'Kanban.Card.AddNew', 'x-component': 'Kanban.Card.AddNew',
// 'x-decorator': 'AddNew.Displayed', // 'x-decorator': 'AddNew.Displayed',
@ -376,7 +376,7 @@ function generateCardItemSchema(component) {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
@ -408,7 +408,7 @@ function generateCardItemSchema(component) {
}, },
view1: { view1: {
type: 'void', type: 'void',
title: '修改数据', title: '编辑数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Kanban.Card.View', 'x-component': 'Kanban.Card.View',
'x-component-props': { 'x-component-props': {
@ -512,7 +512,7 @@ function generateCardItemSchema(component) {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
@ -1340,7 +1340,7 @@ AddNew.CardItem = observer((props: any) => {
className={'designable-btn designable-btn-dash'} className={'designable-btn designable-btn-dash'}
icon={<PlusOutlined />} icon={<PlusOutlined />}
> >
</Button> </Button>
)} )}
</Dropdown> </Dropdown>
@ -1435,7 +1435,7 @@ AddNew.FormItem = observer((props: any) => {
key={item.name} key={item.name}
onClick={async () => { onClick={async () => {
setVisible(false); setVisible(false);
const values = await FormDialog(`新增字段`, () => { const values = await FormDialog(`创建字段`, () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
<SchemaField schema={item} /> <SchemaField schema={item} />
@ -1739,7 +1739,7 @@ AddNew.PaneItem = observer((props: any) => {
type={'dashed'} type={'dashed'}
icon={<PlusOutlined />} icon={<PlusOutlined />}
> >
</Button> </Button>
)} )}
</Dropdown> </Dropdown>

View File

@ -164,7 +164,7 @@ function generateActionSchema(type) {
}, },
create: { create: {
type: 'void', type: 'void',
title: '新增', title: '创建',
'x-align': 'right', 'x-align': 'right',
'x-designable-bar': 'Calendar.ActionDesignableBar', 'x-designable-bar': 'Calendar.ActionDesignableBar',
'x-component': 'Action', 'x-component': 'Action',
@ -178,7 +178,7 @@ function generateActionSchema(type) {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
@ -222,7 +222,7 @@ function AddActionButton() {
{ title: '标题', name: 'title' }, { title: '标题', name: 'title' },
{ title: '视图切换', name: 'viewSelect' }, { title: '视图切换', name: 'viewSelect' },
{ title: '筛选', name: 'filter' }, { title: '筛选', name: 'filter' },
{ title: '新增', name: 'create' }, { title: '创建', name: 'create' },
].map((item) => ( ].map((item) => (
<SwitchMenuItem <SwitchMenuItem
key={item.name} key={item.name}

View File

@ -92,7 +92,7 @@ const schema: ISchema = {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {

View File

@ -574,7 +574,7 @@ Calendar.Filter.DesignableBar = () => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
</Menu> </Menu>
} }

View File

@ -74,7 +74,7 @@ Chart.DesignableBar = observer((props) => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
<Menu.Divider /> <Menu.Divider />
<Menu.Item <Menu.Item

View File

@ -27,7 +27,7 @@ export const Checkbox: ComposedCheckbox = connect(
), ),
mapReadPretty((props) => { mapReadPretty((props) => {
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
return props.value ? ( return props.value ? (
<CheckOutlined style={{ color: '#52c41a' }} /> <CheckOutlined style={{ color: '#52c41a' }} />
@ -46,7 +46,7 @@ Checkbox.Group = connect(
}), }),
mapReadPretty((props) => { mapReadPretty((props) => {
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
const { options = [] } = props; const { options = [] } = props;
const field = useField<any>(); const field = useField<any>();

View File

@ -180,7 +180,7 @@ export const DatabaseCollection = observer((props) => {
> >
<Input.Search <Input.Search
size={'middle'} size={'middle'}
placeholder={'新增数据表'} placeholder={'创建数据表'}
enterButton={<PlusOutlined />} enterButton={<PlusOutlined />}
value={newValue} value={newValue}
onChange={(e) => { onChange={(e) => {
@ -480,8 +480,13 @@ export const DatabaseField: any = observer((props) => {
</Menu> </Menu>
} }
> >
<Button block type={'dashed'} style={{ marginTop: 10 }}> <Button
block
type={'dashed'}
icon={<PlusOutlined />}
style={{ marginTop: 10 }}
>
</Button> </Button>
</Dropdown> </Dropdown>
</div> </div>

View File

@ -20,12 +20,12 @@ import {
import { FullscreenOutlined } from '@ant-design/icons'; import { FullscreenOutlined } from '@ant-design/icons';
import moment from 'moment'; import moment from 'moment';
const PlaceholderContext = createContext<string>('N/A'); const PlaceholderContext = createContext<string>('');
const Placeholder = PlaceholderContext.Provider; const Placeholder = PlaceholderContext.Provider;
const usePlaceholder = (value?: any) => { const usePlaceholder = (value?: any) => {
const placeholder = useContext(PlaceholderContext) || 'N/A'; const placeholder = useContext(PlaceholderContext) || '';
return isValid(value) && value !== '' ? value : placeholder; return isValid(value) && value !== '' ? value : placeholder;
}; };
@ -299,7 +299,7 @@ const Cascader: React.FC<CascaderProps> = observer((props) => {
const DatePicker: React.FC<DatePickerProps> = (props: any) => { const DatePicker: React.FC<DatePickerProps> = (props: any) => {
if (!props.value) { if (!props.value) {
return <div>N/A</div>; return <div></div>;
} }
const placeholder = usePlaceholder(); const placeholder = usePlaceholder();
const prefixCls = usePrefixCls('description-text', props); const prefixCls = usePrefixCls('description-text', props);

View File

@ -78,7 +78,7 @@ export const FieldDesignableBar = observer((props) => {
<Menu.Item <Menu.Item
key={'update'} key={'update'}
onClick={async () => { onClick={async () => {
const values = await FormDialog('修改字段名称', () => { const values = await FormDialog('自定义字段名称', () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
<SchemaField <SchemaField
@ -122,7 +122,7 @@ export const FieldDesignableBar = observer((props) => {
}); });
}} }}
> >
</Menu.Item> </Menu.Item>
<Menu.Item <Menu.Item
style={{ minWidth: 150 }} style={{ minWidth: 150 }}

View File

@ -74,7 +74,7 @@ export const IconPicker = connect(
}), }),
mapReadPretty((props) => { mapReadPretty((props) => {
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
return <Icon type={props.value} />; return <Icon type={props.value} />;
}), }),

View File

@ -35,7 +35,7 @@ export const InputNumber: any = connect(
mapReadPretty((props: any) => { mapReadPretty((props: any) => {
const { step, value, addonBefore, addonAfter } = props; const { step, value, addonBefore, addonAfter } = props;
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
const precision = Math.max( const precision = Math.max(
getNumberPrecision(String(value)), getNumberPrecision(String(value)),
@ -56,7 +56,7 @@ InputNumber.Percent = connect(
mapReadPretty((props: any) => { mapReadPretty((props: any) => {
const { step, value } = props; const { step, value } = props;
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
return toFixed( return toFixed(
String(value), String(value),

View File

@ -78,7 +78,7 @@ export const FieldDesignableBar = observer((props) => {
<Menu.Item <Menu.Item
key={'update'} key={'update'}
onClick={async () => { onClick={async () => {
const values = await FormDialog('修改字段名称', () => { const values = await FormDialog('自定义字段名称', () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
<SchemaField <SchemaField
@ -122,7 +122,7 @@ export const FieldDesignableBar = observer((props) => {
}); });
}} }}
> >
</Menu.Item> </Menu.Item>
<Menu.Divider /> <Menu.Divider />
<Menu.Item <Menu.Item

View File

@ -126,7 +126,7 @@ const schema: ISchema = {
properties: { properties: {
create: { create: {
type: 'void', type: 'void',
title: '新增卡片', title: '添加卡片',
// 'x-designable-bar': 'Kanban.AddCardDesignableBar', // 'x-designable-bar': 'Kanban.AddCardDesignableBar',
'x-component': 'Kanban.Card.AddNew', 'x-component': 'Kanban.Card.AddNew',
// 'x-decorator': 'AddNew.Displayed', // 'x-decorator': 'AddNew.Displayed',
@ -137,7 +137,7 @@ const schema: ISchema = {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
@ -182,7 +182,7 @@ const schema: ISchema = {
}, },
view1: { view1: {
type: 'void', type: 'void',
title: '修改数据', title: '编辑数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Kanban.Card.View', 'x-component': 'Kanban.Card.View',
'x-component-props': { 'x-component-props': {

View File

@ -138,7 +138,7 @@ Markdown.Void.DesignableBar = observer((props) => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
<Menu.Divider /> <Menu.Divider />
<Menu.Item <Menu.Item

View File

@ -402,13 +402,13 @@ Menu.AddNew = observer((props: any) => {
const schemas = { const schemas = {
'Menu.Link': { 'Menu.Link': {
icon: <MenuOutlined />, icon: <MenuOutlined />,
title: '建菜单项', title: '建菜单项',
schema: { schema: {
type: 'object', type: 'object',
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '菜单项名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -424,13 +424,13 @@ Menu.AddNew = observer((props: any) => {
}, },
'Menu.SubMenu': { 'Menu.SubMenu': {
icon: <GroupOutlined />, icon: <GroupOutlined />,
title: '建菜单分组', title: '建菜单分组',
schema: { schema: {
type: 'object', type: 'object',
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '分组名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -446,13 +446,13 @@ Menu.AddNew = observer((props: any) => {
}, },
'Menu.URL': { 'Menu.URL': {
icon: <LinkOutlined />, icon: <LinkOutlined />,
title: '添加自定义链接', title: '创建自定义链接',
schema: { schema: {
type: 'object', type: 'object',
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '链接名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -498,13 +498,13 @@ Menu.AddNew = observer((props: any) => {
}} }}
> >
<AntdMenu.Item key={'Menu.Link'} icon={<MenuOutlined />}> <AntdMenu.Item key={'Menu.Link'} icon={<MenuOutlined />}>
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item key={'Menu.SubMenu'} icon={<GroupOutlined />}> <AntdMenu.Item key={'Menu.SubMenu'} icon={<GroupOutlined />}>
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item key={'Menu.URL'} icon={<LinkOutlined />}> <AntdMenu.Item key={'Menu.URL'} icon={<LinkOutlined />}>
</AntdMenu.Item> </AntdMenu.Item>
</AntdMenu> </AntdMenu>
} }
@ -526,7 +526,7 @@ Menu.DesignableBar = (props) => {
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '菜单项名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -548,7 +548,7 @@ Menu.DesignableBar = (props) => {
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '菜单项名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -570,7 +570,7 @@ Menu.DesignableBar = (props) => {
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '菜单项名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -592,7 +592,7 @@ Menu.DesignableBar = (props) => {
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '分组名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -614,7 +614,7 @@ Menu.DesignableBar = (props) => {
properties: { properties: {
title: { title: {
type: 'string', type: 'string',
title: '链接名称', title: '名称',
required: true, required: true,
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Input', 'x-component': 'Input',
@ -651,6 +651,7 @@ Menu.DesignableBar = (props) => {
const formConfig = schemas[schema['x-component']]; const formConfig = schemas[schema['x-component']];
const isSubMenu = schema['x-component'] === 'Menu.SubMenu'; const isSubMenu = schema['x-component'] === 'Menu.SubMenu';
const ctx = useContext(MenuContext); const ctx = useContext(MenuContext);
const mode = useContext(MenuModeContext);
return ( return (
<div className={cls('designable-bar', { active: visible })}> <div className={cls('designable-bar', { active: visible })}>
@ -687,7 +688,7 @@ Menu.DesignableBar = (props) => {
return; return;
} }
const values = await FormDialog( const values = await FormDialog(
`在「${schema.title}${methodLabels[method]}新建${config.title}`, `在「${schema.title}${methodLabels[method]}插入${config.title}`,
() => { () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
@ -716,7 +717,7 @@ Menu.DesignableBar = (props) => {
}, },
); );
const values = await FormDialog( const values = await FormDialog(
`修改${formConfig.title}`, `编辑${formConfig.title}`,
() => { () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
@ -740,7 +741,7 @@ Menu.DesignableBar = (props) => {
await updateSchema(schema); await updateSchema(schema);
}} }}
> >
<EditOutlined /> {formConfig.title} <EditOutlined /> {formConfig.title}
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'move'} key={'move'}
@ -861,77 +862,78 @@ Menu.DesignableBar = (props) => {
<AntdMenu.SubMenu <AntdMenu.SubMenu
key={'insertBefore'} key={'insertBefore'}
icon={<ArrowUpOutlined />} icon={<ArrowUpOutlined />}
title={'当前菜单项之前'} title={`${mode == 'inline' ? '上' : '左'}插入`}
> >
<AntdMenu.Item <AntdMenu.Item
key={'insertBefore.Menu.Link'} key={'insertBefore.Menu.Link'}
icon={<MenuOutlined />} icon={<MenuOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'insertBefore.Menu.SubMenu'} key={'insertBefore.Menu.SubMenu'}
icon={<GroupOutlined />} icon={<GroupOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'insertBefore.Menu.URL'} key={'insertBefore.Menu.URL'}
icon={<LinkOutlined />} icon={<LinkOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
</AntdMenu.SubMenu> </AntdMenu.SubMenu>
<AntdMenu.SubMenu <AntdMenu.SubMenu
key={'insertAfter'} key={'insertAfter'}
icon={<ArrowDownOutlined />} icon={<ArrowDownOutlined />}
title={'当前菜单项之后'} title={`${mode == 'inline' ? '下' : '右'}插入`}
> >
<AntdMenu.Item <AntdMenu.Item
key={'insertAfter.Menu.Link'} key={'insertAfter.Menu.Link'}
icon={<MenuOutlined />} icon={<MenuOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'insertAfter.Menu.SubMenu'} key={'insertAfter.Menu.SubMenu'}
icon={<GroupOutlined />} icon={<GroupOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'insertAfter.Menu.URL'} key={'insertAfter.Menu.URL'}
icon={<LinkOutlined />} icon={<LinkOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
</AntdMenu.SubMenu> </AntdMenu.SubMenu>
{isSubMenu && ( {isSubMenu && (
<AntdMenu.SubMenu <AntdMenu.SubMenu
key={'appendChild'} key={'appendChild'}
icon={<ArrowRightOutlined />} icon={<ArrowRightOutlined />}
title={'当前菜单分组里'} title={'向里插入'}
> >
<AntdMenu.Item <AntdMenu.Item
key={'appendChild.Menu.Link'} key={'appendChild.Menu.Link'}
icon={<MenuOutlined />} icon={<MenuOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'appendChild.Menu.SubMenu'} key={'appendChild.Menu.SubMenu'}
icon={<GroupOutlined />} icon={<GroupOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
<AntdMenu.Item <AntdMenu.Item
key={'appendChild.Menu.URL'} key={'appendChild.Menu.URL'}
icon={<LinkOutlined />} icon={<LinkOutlined />}
> >
</AntdMenu.Item> </AntdMenu.Item>
</AntdMenu.SubMenu> </AntdMenu.SubMenu>
)} )}
<AntdMenu.Divider />
<AntdMenu.Item <AntdMenu.Item
icon={<LockOutlined />} icon={<LockOutlined />}
onClick={async () => { onClick={async () => {
@ -961,7 +963,7 @@ Menu.DesignableBar = (props) => {
properties: { properties: {
roles: { roles: {
type: 'array', type: 'array',
title: '可访问该菜单的权限组', title: '允许访问的权限组',
'x-reactions': [ 'x-reactions': [
'{{useAsyncDataSource(loadRoles)}}', '{{useAsyncDataSource(loadRoles)}}',
], ],

View File

@ -61,7 +61,7 @@ export const Password = connect(
}, },
mapReadPretty((props) => { mapReadPretty((props) => {
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
return <div>********</div>; return <div>********</div>;
}), }),

View File

@ -26,7 +26,7 @@ Radio.Group = connect(
}), }),
mapReadPretty((props) => { mapReadPretty((props) => {
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
const { options = [], value } = props; const { options = [], value } = props;
const field = useField<any>(); const field = useField<any>();

View File

@ -66,13 +66,13 @@ export const Select: any = connect(
), ),
mapReadPretty((props) => { mapReadPretty((props) => {
// console.log('mapReadPretty', props.value) // console.log('mapReadPretty', props.value)
// return <div>N/A</div>; // return <div></div>;
if (!isValid(props.value)) { if (!isValid(props.value)) {
return <div>N/A</div>; return <div></div>;
} }
const field = useField<any>(); const field = useField<any>();
if (isArrayField(field) && field?.value?.length === 0) { if (isArrayField(field) && field?.value?.length === 0) {
return <div>N/A</div>; return <div></div>;
} }
const dataSource = field.dataSource || []; const dataSource = field.dataSource || [];
console.log('field.value', field.value, dataSource); console.log('field.value', field.value, dataSource);

View File

@ -139,7 +139,7 @@ export const SimpleDesignableBar = observer((props) => {
'x-component': 'Select', 'x-component': 'Select',
enum: [ enum: [
{ {
label: '新增数据', label: '创建数据',
value: 'create', value: 'create',
}, },
{ {

View File

@ -59,7 +59,7 @@ const schema: ISchema = {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Modal', 'x-component': 'Action.Modal',
'x-component-props': { 'x-component-props': {

View File

@ -471,7 +471,7 @@ function AddColumn() {
<Menu.Divider /> <Menu.Divider />
<Menu.SubMenu <Menu.SubMenu
popupClassName={'add-new-fields-popup'} popupClassName={'add-new-fields-popup'}
title={'新增字段'} title={'创建字段'}
> >
{options.map((option) => ( {options.map((option) => (
<Menu.ItemGroup title={option.label}> <Menu.ItemGroup title={option.label}>
@ -481,7 +481,7 @@ function AddColumn() {
key={item.name} key={item.name}
onClick={async () => { onClick={async () => {
setVisible(false); setVisible(false);
const values = await FormDialog(`新增字段`, () => { const values = await FormDialog(`创建字段`, () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
<SchemaField schema={item} /> <SchemaField schema={item} />
@ -896,7 +896,7 @@ function generateActionSchema(type) {
key: uid(), key: uid(),
type: 'void', type: 'void',
name: uid(), name: uid(),
title: '新增', title: '创建',
'x-align': 'right', 'x-align': 'right',
'x-decorator': 'AddNew.Displayed', 'x-decorator': 'AddNew.Displayed',
'x-decorator-props': { 'x-decorator-props': {
@ -910,7 +910,7 @@ function generateActionSchema(type) {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '新增数据', title: '创建数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
@ -1075,7 +1075,7 @@ function AddActionButton() {
{[ {[
{ title: '筛选', name: 'filter' }, { title: '筛选', name: 'filter' },
{ title: '导出', name: 'export' }, { title: '导出', name: 'export' },
{ title: '新增', name: 'create' }, { title: '创建', name: 'create' },
{ title: '删除', name: 'destroy' }, { title: '删除', name: 'destroy' },
].map((item) => ( ].map((item) => (
<SwitchMenuItem <SwitchMenuItem
@ -1471,7 +1471,7 @@ Table.Filter.DesignableBar = () => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
</Menu> </Menu>
} }
@ -1594,7 +1594,7 @@ Table.ExportActionDesignableBar = () => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
</Menu> </Menu>
} }
@ -1820,7 +1820,7 @@ Table.Action.DesignableBar = () => {
setVisible(false); setVisible(false);
}} }}
> >
</Menu.Item> </Menu.Item>
</Menu> </Menu>
} }
@ -2117,11 +2117,9 @@ Table.DesignableBar = observer((props) => {
direction: { direction: {
type: 'string', type: 'string',
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Select', 'x-component': 'Radio.Group',
'x-component-props': { 'x-component-props': {
style: { optionType: 'button',
width: 100,
},
}, },
enum: [ enum: [
{ label: '正序', value: 'asc' }, { label: '正序', value: 'asc' },
@ -2144,7 +2142,7 @@ Table.DesignableBar = observer((props) => {
properties: { properties: {
add: { add: {
type: 'void', type: 'void',
title: '新增', title: '添加排序字段',
'x-component': 'ArrayItems.Addition', 'x-component': 'ArrayItems.Addition',
}, },
}, },

View File

@ -111,7 +111,7 @@ export const Tabs: any = observer((props: any) => {
type={'dashed'} type={'dashed'}
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={async () => { onClick={async () => {
const values = await FormDialog('新增标签页', () => { const values = await FormDialog('创建标签页', () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
<SchemaField <SchemaField
@ -164,7 +164,7 @@ export const Tabs: any = observer((props: any) => {
await createSchema(data); await createSchema(data);
}} }}
> >
</Button> </Button>
) )
} }
@ -281,7 +281,8 @@ Tabs.TabPane.DesignableBar = () => {
<Menu> <Menu>
<Menu.Item <Menu.Item
onClick={async () => { onClick={async () => {
const values = await FormDialog('编辑按钮', () => { setVisible(false);
const values = await FormDialog('编辑标签页', () => {
return ( return (
<FormLayout layout={'vertical'}> <FormLayout layout={'vertical'}>
<SchemaField <SchemaField
@ -321,7 +322,7 @@ Tabs.TabPane.DesignableBar = () => {
updateSchema(schema); updateSchema(schema);
}} }}
> >
</Menu.Item> </Menu.Item>
<Menu.Divider /> <Menu.Divider />
<Menu.Item <Menu.Item