feat(client): integer field

This commit is contained in:
chenos 2022-07-01 09:35:36 +08:00
parent 70ab4dcf1f
commit 9928424f5a
4 changed files with 35 additions and 1 deletions

View File

@ -6,9 +6,11 @@ export * from './createdAt';
export * from './createdBy'; export * from './createdBy';
export * from './datetime'; export * from './datetime';
export * from './email'; export * from './email';
export * from './formula';
export * from './icon'; export * from './icon';
export * from './id'; export * from './id';
export * from './input'; export * from './input';
export * from './integer';
export * from './linkTo'; export * from './linkTo';
export * from './m2m'; export * from './m2m';
export * from './m2o'; export * from './m2o';
@ -28,5 +30,4 @@ export * from './textarea';
export * from './time'; export * from './time';
export * from './updatedAt'; export * from './updatedAt';
export * from './updatedBy'; export * from './updatedBy';
export * from './formula';

View File

@ -0,0 +1,31 @@
import { defaultProps, operators } from './properties';
import { IField } from './types';
export const integer: IField = {
name: 'integer',
type: 'object',
group: 'basic',
order: 5,
title: '{{t("Integer")}}',
sortable: true,
default: {
type: 'integer',
// name,
uiSchema: {
type: 'number',
// title,
'x-component': 'InputNumber',
'x-component-props': {
stringMode: true,
step: '0',
},
'x-validator': 'integer',
},
},
properties: {
...defaultProps,
},
filterable: {
operators: operators.number,
},
};

View File

@ -120,6 +120,7 @@ export default {
"Phone": "Phone", "Phone": "Phone",
"Email": "Email", "Email": "Email",
"Number": "Number", "Number": "Number",
"Integer": "Integer",
"Percent": "Percent", "Percent": "Percent",
"Password": "Password", "Password": "Password",
"Formula": "Formula", "Formula": "Formula",

View File

@ -123,6 +123,7 @@ export default {
"Phone": "手机号码", "Phone": "手机号码",
"Email": "电子邮箱", "Email": "电子邮箱",
"Number": "数字", "Number": "数字",
"Integer": "整数",
"Percent": "百分比", "Percent": "百分比",
"Password": "密码", "Password": "密码",
"Formula": "公式", "Formula": "公式",