improve text
This commit is contained in:
parent
53fa47c56f
commit
4507a5aca1
@ -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: '删除',
|
||||||
|
@ -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': {
|
||||||
|
@ -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>;
|
||||||
|
@ -503,7 +503,7 @@ Action.DesignableBar = (props: any) => {
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
移除
|
隐藏
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
@ -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}
|
||||||
|
@ -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': {
|
||||||
|
@ -574,7 +574,7 @@ Calendar.Filter.DesignableBar = () => {
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
移除
|
隐藏
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ Chart.DesignableBar = observer((props) => {
|
|||||||
setVisible(false);
|
setVisible(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
修改内容
|
编辑图表
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
|
@ -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>();
|
||||||
|
@ -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>
|
||||||
|
@ -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);
|
||||||
|
@ -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 }}
|
||||||
|
@ -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} />;
|
||||||
}),
|
}),
|
||||||
|
@ -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),
|
||||||
|
@ -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
|
||||||
|
@ -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': {
|
||||||
|
@ -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
|
||||||
|
@ -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)}}',
|
||||||
],
|
],
|
||||||
|
@ -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>;
|
||||||
}),
|
}),
|
||||||
|
@ -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>();
|
||||||
|
@ -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);
|
||||||
|
@ -139,7 +139,7 @@ export const SimpleDesignableBar = observer((props) => {
|
|||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
enum: [
|
enum: [
|
||||||
{
|
{
|
||||||
label: '新增数据',
|
label: '创建数据',
|
||||||
value: 'create',
|
value: 'create',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -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': {
|
||||||
|
@ -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',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user