提交 d9100e52 authored 作者: 钟是志's avatar 钟是志

27657 [北电科系统配置]设置一下,这块输入字数加限制 输入多了加提示 全系统

上级 dffc1441
export default function giveVarcharRules({
dataColumn = {},
json = {},
required = false,
title = '',
}) {
const res =
Array.isArray(json.vlds) && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
];
if (dataColumn?.type === 'VARCHAR' && dataColumn.length) {
// console.log(dataColumn.length);
res.push({
max: dataColumn.length,
message: `不能超过${dataColumn.length}个字符`,
});
}
return res;
}
......@@ -76,6 +76,8 @@ import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUp
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
const {
MonthPicker,
......@@ -2767,15 +2769,12 @@ ${obj[dataColumn.base52]}
if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
rules:giveVarcharRules({
dataColumn,
json,
required,
title
}),
})(
<TextArea
autoSize={{ minRows: 4 }}
......@@ -2805,15 +2804,12 @@ ${obj[dataColumn.base52]}
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
rules:giveVarcharRules({
dataColumn,
json,
required,
title
}),
})(
<TextArea
autoSize={{ minRows: 4 }}
......@@ -2847,15 +2843,12 @@ ${obj[dataColumn.base52]}
}
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
rules: giveVarcharRules({
dataColumn,
json,
required,
title
}),
})(
<Input
disabled={disabled}
......@@ -3088,10 +3081,10 @@ ${obj[dataColumn.base52]}
{...otherProps}>
{
(json.options && Array.isArray(json.options)) ?
json.options.map((r)=>{
return (<Option key={r.value} value={r.value}>
json.options.map((r) => {
return (<Option key={r.value} value={r.value}>
{r.label}
</Option>)
</Option>);
}) : options && options instanceof Array
? options.map((r) => (
<Option key={r.value} value={r.value}>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论