@wufengteam/wform
Version:
@wufengteam/wform
440 lines • 11.1 kB
JavaScript
import { getTodoActionListByKey } from '../utils';
import { PROPS_FOR_PC } from '../utils/constant';
export default {
type: 'EditableTable',
icon: 'Table',
groupsName: '高级组件',
compType: 2,
label: '表格',
platform: 'pc',
props: {
name: '表格',
span: 24,
tableItem: [{
id: '345716',
alias: 'DformInput',
text: '输入框',
type: 'Input',
name: 'tb1gg4fevba',
props: {
name: '输入框'
},
todoProps: {
name: {
label: '标题',
type: 'Input',
groupsName: '基础',
props: {
required: false,
maxLength: 20,
showCount: true
}
},
defaultValue: {
label: '默认值',
type: 'SetDefaultValue',
groupsName: '基础'
},
placeholder: {
label: '引导文字',
type: 'Input',
groupsName: '基础',
props: {
maxLength: 50,
showCount: true
}
},
allowClear: {
label: '允许清除',
type: 'Switch',
groupsName: '基础'
},
required: {
label: '必填',
type: 'Switch',
groupsName: '校验',
istodoBind: false,
props: {
defaultValue: false
}
}
}
}],
fieldDes: '',
isView: false
},
todoProps: {
isView: {
label: '是否是子表单',
type: 'Input',
props: {
dependProps: {
noShow: true
}
}
},
labelCol: {
label: '标题占比',
type: 'FormItemLabel',
groupsName: '基础',
props: {
dependProps: {
noShow: true
}
}
},
wrapperCol: {
label: '标题占比',
type: 'FormItemLabel',
groupsName: '基础',
props: {
dependProps: {
noShow: true
}
}
},
// 解决复制黏贴报 [组件属性]: 单行文本组件不可配置额外的fieldName字段。
fieldName: {
label: '字段编码',
type: 'Input',
props: {
dependProps: {
noShow: true
}
}
},
name: {
type: 'Input',
label: '标题',
groupsName: '基础',
props: {
label: '标题',
maxLength: 20,
showCount: true
}
},
fieldNameAlias: {
label: '字段编码',
type: 'FieldNameAlias',
groupsName: '基础',
props: {
required: true,
tooltipText: '编码仅支持字母、数字、下划线,不能都是数字,不能都是下划线,必须是字母开头,但不能以sys开头,不能是数据库关键字'
}
},
tableItem: {
type: 'tableItem',
label: '字段',
groupsName: '基础',
props: {
label: '字段',
filedComponentList: [{
type: 'Input',
label: '输入框',
alias: 'DformInput',
todoProps: {
name: {
label: '标题',
type: 'Input',
groupsName: '基础',
props: {
required: false,
maxLength: 20,
showCount: true
}
},
defaultValue: {
label: '默认值',
type: 'SetDefaultValue',
groupsName: '基础'
},
placeholder: {
label: '引导文字',
type: 'Input',
groupsName: '基础',
props: {
maxLength: 50,
showCount: true
}
},
allowClear: {
label: '允许清除',
type: 'Switch',
groupsName: '基础'
},
required: {
label: '必填',
type: 'Switch',
groupsName: '校验',
istodoBind: false,
props: {
defaultValue: false
}
}
}
}, {
type: 'InputNumber',
label: '数字输入',
alias: 'DformInputNumber',
todoProps: {
name: {
label: '标题',
type: 'Input',
groupsName: '基础',
props: {
required: false,
maxLength: 20,
showCount: true
}
},
defaultValue: {
label: '默认值',
type: 'SetDefaultValue',
groupsName: '基础'
},
placeholder: {
label: '引导文字',
type: 'Input',
groupsName: '基础',
props: {
maxLength: 50,
showCount: true
}
},
readOnly: {
label: '是否只读',
type: 'Switch',
groupsName: '基础',
istodoBind: false,
props: {
defaultValue: false
}
},
disabled: {
label: '是否禁用',
type: 'Switch',
groupsName: '基础',
istodoBind: false,
props: {
defaultValue: false
}
},
addonAfter: {
label: '单位',
type: 'Input',
groupsName: '基础'
},
formatting: {
label: '格式化',
type: 'Select',
groupsName: '基础',
props: {
defaultValue: '',
options: [{
title: '无',
value: ''
}, {
title: '百分比格式',
value: 'percent'
}, {
title: '文字千分割',
value: 'word'
}, {
title: '逗号千分割',
value: 'comma'
}]
}
},
required: {
label: '必填',
type: 'Switch',
groupsName: '校验',
istodoBind: false,
props: {
defaultValue: false
}
},
min: {
label: '最小值',
type: 'InputNumber',
groupsName: '基础',
istodoBind: false,
props: {
defaultValue: 0
}
},
max: {
label: '最大值',
type: 'InputNumber',
groupsName: '基础',
istodoBind: false
}
}
}, {
type: 'Select',
label: '下拉单选',
alias: 'DformPicker',
todoProps: {
name: {
label: '标题',
type: 'Input',
groupsName: '基础',
props: {
required: false,
maxLength: 20,
showCount: true
}
},
value: {
label: '默认值',
type: 'SetDefaultValue',
groupsName: '基础',
istodoBind: true,
props: {
// defaultValue: '暂未绑定数据',
}
},
placeholder: {
label: '引导文字',
type: 'Input',
groupsName: '基础',
props: {
maxLength: 50,
showCount: true
}
},
allowClear: {
label: '允许清除',
type: 'Switch',
groupsName: '基础'
},
required: {
label: '必填',
type: 'Switch',
groupsName: '校验',
istodoBind: false,
props: {
defaultValue: false
}
},
staticData: {
label: '选项设置',
type: 'optionSet',
groupsName: '选项设置',
props: {
required: true
}
}
}
}, {
type: 'MultipleSelect',
label: '下拉复选',
alias: 'DMultiplePicker',
todoProps: {
name: {
label: '标题',
type: 'Input',
groupsName: '基础',
props: {
required: false,
maxLength: 20,
showCount: true
}
},
value: {
label: '默认值',
type: 'SetDefaultValue',
groupsName: '基础',
istodoBind: true,
props: {
required: false
// defaultValue: '暂未绑定数据',
}
},
placeholder: {
label: '引导文字',
type: 'Input',
groupsName: '基础',
props: {
maxLength: 50,
showCount: true
}
},
allowClear: {
label: '允许清除',
type: 'Switch',
groupsName: '基础'
},
required: {
label: '必填',
type: 'Switch',
groupsName: '校验',
istodoBind: false,
props: {
defaultValue: false
}
},
staticData: {
label: '选项设置',
type: 'optionSet',
groupsName: '选项设置',
props: {
required: true
}
}
}
}]
}
},
basicStatus: {
label: '状态',
type: 'RadioButton',
groupsName: '基础',
istodoBind: false,
props: {
options: [{
title: '普通',
value: 1
}, {
title: '隐藏',
value: 2
}, {
title: '禁用',
value: 3
}
// { title: '只读', value: 4 },
],
defaultValue: 1,
style: {
padding: '0 6px',
fontSize: '12px'
}
}
},
fieldDes: {
type: 'textArea',
label: '字段说明',
groupsName: '基础',
props: {
label: '字段说明'
}
},
required: {
label: '必填',
type: 'Switch',
groupsName: '校验',
istodoBind: false,
props: {
defaultValue: false
}
},
selfSpan: {
label: '列占比',
type: 'ColSpan',
groupsName: PROPS_FOR_PC,
istodoBind: false
}
},
// 控制函数里-上下文是否可选到该组件 PC端-getValue H5端-value
todoActionList: getTodoActionListByKey(['getValue'])
};