import { ValidationType, DEFAULT_EDITABLE_FUN } from '@/constants'; import { ValidationSetter, RsFunButtonSetter } from 'lowcode/_setters'; /** * 数字校验属性 */ export default [ { name: 'editableExpression', title: { label: { type: 'i18n', zh_CN: '可编辑条件', en_US: 'Editable Expression', }, tip: { type: 'i18n', zh_CN: 'editableExpression: 可编辑条件函数 || 可编辑条件,支持函数表达式,返回值为 true 时可编辑', en_US: 'prop: editableExpression', }, }, setter: { componentName: RsFunButtonSetter, props: { defaultValue: DEFAULT_EDITABLE_FUN, header: '可编辑条件函数' } } }, { name: 'required', title: { label: { type: 'i18n', zh_CN: '必填', en_US: 'Required' }, }, setter: { componentName: ValidationSetter, }, }, { name: 'minValue', title: { label: { type: 'i18n', zh_CN: '最小值', en_US: 'Min Value' }, }, setter: { componentName: ValidationSetter, props: { type: ValidationType.MIN_VALUE, }, }, }, { name: 'maxValue', title: { label: { type: 'i18n', zh_CN: '最大值', en_US: 'Max Value' }, }, setter: { componentName: ValidationSetter, props: { type: ValidationType.MAX_VALUE, }, }, }, { name: 'customFunction', title: { label: { type: 'i18n', zh_CN: '自定义函数', en_US: 'Custom Function' }, tip: { type: 'i18n', zh_CN: 'customFunction | 自定义函数', en_US: 'customFunction | Custom Function', }, }, propType: 'func', setter: { componentName: ValidationSetter, props: { type: ValidationType.CUSTOM_FUNCTION, }, }, }, ];