feat: improve text

This commit is contained in:
chenos 2021-08-27 18:26:10 +08:00
parent 6c779a7e6b
commit f8c3c6a19b
18 changed files with 70 additions and 49 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

@ -299,7 +299,7 @@ const schema: ISchema = {
}, },
[uid()]: { [uid()]: {
type: 'void', type: 'void',
title: '创建', title: '添加',
'x-align': 'right', 'x-align': 'right',
'x-decorator': 'AddNew.Displayed', 'x-decorator': 'AddNew.Displayed',
'x-decorator-props': { 'x-decorator-props': {
@ -313,7 +313,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

@ -61,18 +61,36 @@ export const UserInfo = () => {
</Menu.Item> </Menu.Item>
<Menu.Item> <Menu.Item>
<Select <div style={{ display: 'flex', justifyContent: 'space-between' }}>
className={'roles-select'} <span style={{ marginRight: 16, display: 'inline-block' }}></span>
bordered={false} <Select
style={{ minWidth: 100, paddingLeft: 0 }} className={'roles-select'}
size={'small'} bordered={false}
defaultValue={'admin'} style={{ minWidth: 100 }}
options={[ size={'small'}
{ label: '超级管理员', value: 'admin' }, defaultValue={'admin'}
{ label: '数据管理员', value: 'editor' }, options={[
{ label: '普通成员', value: 'member' }, { label: '超级管理员', value: 'admin' },
]} { label: '数据管理员', value: 'editor' },
/> { label: '普通成员', value: 'member' },
]}
/>
</div>
</Menu.Item>
<Menu.Item>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<span style={{ marginRight: 16, display: 'inline-block' }}></span>
<Select
className={'roles-select'}
bordered={false}
size={'small'}
defaultValue={'zh-CN'}
options={[
{ label: '简体中文', value: 'zh-CN' },
{ label: 'English', value: 'en-US' },
]}
/>
</div>
</Menu.Item> </Menu.Item>
<Menu.Divider /> <Menu.Divider />
<Menu.Item <Menu.Item

View File

@ -34,7 +34,7 @@
// } // }
.roles-select { .roles-select {
.ant-select-selector { .ant-select-selector {
padding-left: 0 !important; // padding-left: 0 !important;
} }
} }
.nb-spin-center { .nb-spin-center {

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

@ -186,7 +186,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': {
@ -201,7 +201,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': {
@ -382,7 +382,7 @@ function generateCardItemSchema(component) {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '创建数据', title: '添加数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-decorator-props': { 'x-decorator-props': {
useResource: '{{ Kanban.useCreateResource }}', useResource: '{{ Kanban.useCreateResource }}',
@ -507,7 +507,7 @@ function generateCardItemSchema(component) {
}, },
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',
@ -522,7 +522,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': {
@ -1336,7 +1336,7 @@ AddNew.CardItem = observer((props: any) => {
</Menu.ItemGroup> </Menu.ItemGroup>
<Menu.Divider></Menu.Divider> <Menu.Divider></Menu.Divider>
<Menu.Item disabled key={'addNewRef'}> <Menu.Item disabled key={'addNewRef'}>
</Menu.Item> </Menu.Item>
</Menu.SubMenu> </Menu.SubMenu>
</Menu> </Menu>

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',
@ -179,7 +179,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': {
@ -223,7 +223,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

@ -183,8 +183,8 @@ 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) => {
setNewValue(e.target.value); setNewValue(e.target.value);

View File

@ -7,7 +7,7 @@ export const createdAt: FieldOptions = {
type: 'object', type: 'object',
group: 'systemInfo', group: 'systemInfo',
order: 1, order: 1,
title: '创建时间', title: '添加时间',
sortable: true, sortable: true,
default: { default: {
dataType: 'date', dataType: 'date',
@ -15,7 +15,7 @@ export const createdAt: FieldOptions = {
// name, // name,
uiSchema: { uiSchema: {
type: 'datetime', type: 'datetime',
title: '创建时间', title: '添加时间',
'x-component': 'DatePicker', 'x-component': 'DatePicker',
'x-component-props': {}, 'x-component-props': {},
'x-read-pretty': true, 'x-read-pretty': true,

View File

@ -7,7 +7,7 @@ export const createdBy: FieldOptions = {
type: 'object', type: 'object',
group: 'systemInfo', group: 'systemInfo',
order: 3, order: 3,
title: '创建人', title: '添加人',
isAssociation: true, isAssociation: true,
default: { default: {
dataType: 'belongsTo', dataType: 'belongsTo',
@ -16,7 +16,7 @@ export const createdBy: FieldOptions = {
// name, // name,
uiSchema: { uiSchema: {
type: 'object', type: 'object',
title: '创建人', title: '添加人',
'x-component': 'Select.Drawer', 'x-component': 'Select.Drawer',
'x-component-props': { 'x-component-props': {
fieldNames: { fieldNames: {

View File

@ -27,7 +27,7 @@ group:
</Form.Field> </Form.Field>
</Form> </Form>
// Form 用作 decorator 时只用于创建独立的作用域 // Form 用作 decorator 时只用于添加独立的作用域
<Table x-decorator={'Form'}/> <Table x-decorator={'Form'}/>
</pre> </pre>

View File

@ -137,8 +137,11 @@ const schema: ISchema = {
properties: { properties: {
modal: { modal: {
type: 'void', type: 'void',
title: '创建数据', title: '添加数据',
'x-decorator': 'Form', 'x-decorator': 'Form',
'x-decorator-props': {
useResource: '{{ Kanban.useCreateResource }}',
},
'x-component': 'Action.Drawer', 'x-component': 'Action.Drawer',
'x-component-props': { 'x-component-props': {
useOkAction: '{{ Kanban.useCreateAction }}', useOkAction: '{{ Kanban.useCreateAction }}',

View File

@ -101,7 +101,7 @@ const SideMenu = (props: any) => {
icon={<PlusOutlined />} icon={<PlusOutlined />}
className={`nb-add-new-menu-item menu-mode-inline designable-btn designable-btn-dash`} className={`nb-add-new-menu-item menu-mode-inline designable-btn designable-btn-dash`}
> >
</Button> </Button>
</Menu.AddNew> </Menu.AddNew>
</AntdMenu> </AntdMenu>
@ -216,7 +216,7 @@ export const Menu: any = observer((props: any) => {
icon={<PlusOutlined />} icon={<PlusOutlined />}
type={mode == 'inline' ? 'dashed' : 'primary'} type={mode == 'inline' ? 'dashed' : 'primary'}
> >
</Button> </Button>
</Menu.AddNew> </Menu.AddNew>
</AntdMenu> </AntdMenu>
@ -404,7 +404,7 @@ 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: {
@ -426,7 +426,7 @@ Menu.AddNew = observer((props: any) => {
}, },
'Menu.SubMenu': { 'Menu.SubMenu': {
icon: <GroupOutlined />, icon: <GroupOutlined />,
title: '创建分组', title: '添加分组',
schema: { schema: {
type: 'object', type: 'object',
properties: { properties: {
@ -448,7 +448,7 @@ Menu.AddNew = observer((props: any) => {
}, },
'Menu.URL': { 'Menu.URL': {
icon: <LinkOutlined />, icon: <LinkOutlined />,
title: '创建链接', title: '添加链接',
schema: { schema: {
type: 'object', type: 'object',
properties: { properties: {

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

@ -53,13 +53,13 @@ const schema: ISchema = {
[uid()]: { [uid()]: {
type: 'void', type: 'void',
name: 'action1', name: 'action1',
title: '创建', title: '添加',
'x-component': 'Action', 'x-component': 'Action',
'x-designable-bar': 'Table.Action.DesignableBar', 'x-designable-bar': 'Table.Action.DesignableBar',
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

@ -883,7 +883,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': {
@ -898,7 +898,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': {
@ -1071,7 +1071,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

View File

@ -119,7 +119,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
@ -172,7 +172,7 @@ export const Tabs: any = observer((props: any) => {
await createSchema(data); await createSchema(data);
}} }}
> >
</Button> </Button>
) )
} }