middleground_code_v2/src/views/masterDataOptions/dataOrigin/configData.js

282 lines
5.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const dataOriginFormRow = [
{
elCol: [
{
type: "input",
title: "表名",
id: "clientPath",
row: 12,
disabled: false,
required: true,
fontSize: 16
},
{
type: "input",
title: "备注",
id: "webPath",
row: 12,
disabled: false,
required: false,
fontSize: 16
},
],
},
]
const optionFormRow = [
{
elCol: [
{
type: "input",
title: "中文名称",
id: "chName",
row: 24,
disabled: false,
required: true,
fontSize: 16
},
],
},
{
elCol: [
{
type: "input",
title: "英文名称",
id: "enName",
row: 24,
disabled: false,
required: true,
fontSize: 16,
pattern: /^[a-z][a-z0-9_]{0,50}$/,
message: "须以小写字母开头,只能包含小写字母,数字和下划线,不能包含中文字符其他符号。",
disabledOfId: true,
},
],
},
{
elCol: [
{
type: "select",
title: "字段类型",
id: "filedType",
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [],
},
],
},
{
elCol: [
{
type: "num",
title: "长度",
id: "filedLength",
max:255,
row: 24,
disabled: false,
required: true,
fontSize: 16
},
],
},
{
elCol: [
{
type: "input",
title: "显示名",
id: "title",
row: 24,
disabled: false,
required: true,
fontSize: 16
},
],
}
, {
elCol: [
{
type: "select",
title: "宽度",
id: "row",
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [
{
label: "3",
id: "3",
}, {
label: "6",
id: "6",
}, {
label: "9",
id: "9",
}, {
label: "12",
id: "12",
}, {
label: "15",
id: "15",
}, {
label: "18",
id: "18",
}, {
label: "21",
id: "21",
}, {
label: "24",
id: "24",
},
]
},
],
},
{
elCol: [
{
type: "num",
title: "单元格宽度",
id: "width",
row: 24,
disabled: false,
required: false,
fontSize: 16,
message:"px"
},
],
},
{
elCol: [
{
type: "select",
title: "数据类型",
id: "type",
row: 24,
disabled: false,
required: true,
fontSize: 16,
options: [
{
label: "input",
id: "input",
}, {
label: "datepick",
id: "datepick",
}, {
label: "daterange",
id: "daterange",
}, {
label: "radio",
id: "radio",
}, {
label: "textrea",
id: "textrea",
}, {
label: "select",
id: "select",
}, {
label: "treeselect",
id: "treeselect",
}, {
label: "number",
id: "num",
},
]
},
],
},
{
elCol: [
{
type: "onecheck",
title: "必填",
id: "required",
row: 24,
disabled: false,
required: false,
fontSize: 16,
options: [
{
label: "是",
id: "true",
}, {
label: "否",
id: "false",
}
]
},
],
},
{
elCol: [
{
type: "onecheck",
title: "禁止修改",
id: "disabled",
row: 24,
disabled: false,
required: false,
fontSize: 16,
options: [
{
label: "是",
id: "true",
},
]
},
],
},
]
const mainOptionRow = [
{
elCol: [
{
type: "input",
title: "英文名",
id: "dbName",
disabledOfId: true,
row: 24,
disabled: false,
required: true,
fontSize: 16,
pattern: /^[a-zA-Z][a-zA-Z0-9_]{0,50}$/,
message: "须以字母开头且不能出现_外的字符与中文",
},
],
},
{
elCol: [
{
type: "input",
title: "表说明",
id: "remark",
row: 24,
disabled: false,
required: true,
fontSize: 16
},
],
},
]
const mainRule =
{
dbName: [
{
pattern: /^[a-zA-Z][a-zA-Z0-9_]{0,29}$/,
message: "必须以字母开头后续字符可包含字母、数字和下划线总长度不超过30个字符。",
trigger: "change",
},
],
}
const config = {
dataOriginFormRow,
optionFormRow,
mainOptionRow,
mainRule
}
export default config