UNPKG

ed-frame-vue

Version:

easydata 基础组件

1,052 lines (1,048 loc) 24.3 kB
import {TableEditorColumns, TableEditorRules} from "./BaseProps"; /** * 字段解释 * name:模块名 * component: 组件名 * attribute:组件属性 * label:表单名称 * name:表单值 * tag:表单标签 * children:标签下级 * options:标签下级属性值 * showTag:标签显示条件 {label:判断对象,value:判断条件} * slots: 插槽 * props: 标签基础属性 */ export const PROPS = [ { name: '输入框属性', showCommonProp: ['defaultValue', 'validateExpression'], component: 'easydata-input', attribute: [ { label: '输入提示', name: 'placeholder', tag: 'el-input' }, { label: '允许清除', name: 'clearable', tag: 'el-switch' }, { label: '是否禁用', name: 'disabled', tag: 'el-switch' }, { label: '密码框', name: 'showPassword', tag: 'el-switch' }, { label: '最大长度', name: 'maxlength', tag: 'el-input-number' }, { label: '最小长度', name: 'minlength', tag: 'el-input-number' }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '数字输入框属性', showCommonProp: ['defaultValue', 'validateExpression'], component: 'easydata-inputNumber', attribute: [ { label: '输入提示', name: 'placeholder', tag: 'el-input' }, { label: '允许清除', name: 'clearable', tag: 'el-switch' }, { label: '是否禁用', name: 'disabled', tag: 'el-switch' }, { label: '最小值', name: 'min', tag: 'el-input-number' }, { label: '最大值', name: 'max', tag: 'el-input-number' }, { label: '每次增加数值', name: 'step', tag: 'el-input-number' }, { label: '保留小数位', name: 'precision', tag: 'el-input-number' } ] }, { name: '多行输入框属性', showCommonProp: ['defaultValue', 'validateExpression'], component: 'easydata-textarea', attribute: [ { label: '输入提示', name: 'placeholder', tag: 'el-input' }, { label: '允许清除', name: 'clearable', tag: 'el-switch' }, { label: '是否禁用', name: 'disabled', tag: 'el-switch' }, { label: '内容高度', name: 'rows', tag: 'el-input-number' }, { label: 'Tips', name: 'tips', tag: 'el-input' }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '下拉框属性', component: "easydata-select", showCommonProp: ['isLabelValue'], attribute: [ { label: '输入提示', name: 'placeholder', tag: 'el-input' }, { label: '允许清除', name: 'clearable', tag: 'el-switch' }, { label: '是否禁用', name: 'disabled', tag: 'el-switch', }, { label: '是否多选', name: 'multiple', tag: 'el-switch' }, { label: '是否创建条目', name: 'isCreate', tag: 'el-switch' }, { label: '数据绑定方式', name: 'selectBindType', tag: 'el-radio-group', children: 'el-radio', options: [ {label: '自定义', value: 'diy'}, {label: '码表', value: 'dict'}, {label: '数据源', value: 'ds'}, {label: '实体表', value: 'dt'}] }, { label: '选择码值', name: 'dictType', tag: 'el-input', children: 'el-button', props: { disabled: true, size: 'small', }, showTag: { label: 'selectBindType', value: 'dict' } }, { label: '表达式', name: 'dataSourceCode', tag: 'el-input', tooltip: "示例:cust_base_info,cust_name,cust_no", props: { size: 'small', }, showTag: { label: 'selectBindType', value: 'ds,dt' } }, { label: '查询条件', name: 'dataSourceWhereList', tag: 'el-input', tooltip: '示例:[{fieldName: "cust_no", fieldValue: "111", operator: "like"}]', props: { size: 'small', }, showTag: { label: 'selectBindType', value: 'ds,dt' } }, { label: 'Tips', name: 'tips', tag: 'el-input' }, { label: "下拉元素", name: "dataSource", tag: "ed-table-editor", showTag: { label: "selectBindType", value: ['diy', 'dict'] }, props: { size: "mini", operate: { width: '100px' }, columns: TableEditorColumns, rules: TableEditorRules } } ] }, { name: '级联下拉属性', component: "easydata-cascader", showCommonProp: ['isLabelValue'], attribute: [ { label: '输入提示', name: 'placeholder', tag: 'el-input' }, { label: '允许清除', name: 'clearable', tag: 'el-switch' }, { label: '是否禁用', name: 'disabled', tag: 'el-switch', }, { label: '是否展示完整路径', name: 'showAllLevels', defaultValue: true, tag: 'el-switch', }, { label: '是否多选', name: 'multiple', tag: 'el-switch' }, { label: '是否折叠', name: 'collapseTags', defaultValue: true, tag: 'el-switch', showTag: { label: 'multiple', value: 'true' }, }, { label: '级联绑定方式', name: 'cascaderBindType', tag: 'el-radio-group', children: 'el-radio', options: [ { value: 'json', label: 'JSON文本' }, { value: 'file', label: '文件' }, { value: 'ds', label: '数据源' } ] }, { label: '级联JSON', name: 'cascaderData', tag: 'el-input', props: { rows: 4, size: 'small', type: 'textarea' }, showTag: { label: 'cascaderBindType', value: 'json' }, tooltip: "示例:[{value:'001',label:'四川',children:[{value:'001001',label:'成都'}]}]", }, { label: '表名', name: 'dsName', tag: 'el-input', showTag: { label: 'cascaderBindType', value: 'ds' } }, { label: '标签字段名', name: 'dsLabel', tag: 'el-input', showTag: { label: 'cascaderBindType', value: 'ds' } }, { label: '值字段名', name: 'dsValue', tag: 'el-input', showTag: { label: 'cascaderBindType', value: 'ds' } }, { label: '父节点字段名', name: 'dsParent', tag: 'el-input', showTag: { label: 'cascaderBindType', value: 'ds' } }, { label: '根节点字段值', name: 'dsRootValue', tag: 'el-input', tooltip: "不允许为空,及数据库全局根节点的parentId不允许为空", showTag: { label: 'cascaderBindType', value: 'ds' } }, { label: '查询条件', name: 'dsWhereList', tag: 'el-input', tooltip: "[{fieldName: \"cust_no\", fieldValue: \"111\", operator: \"like\"}]", showTag: { label: 'cascaderBindType', value: 'ds' } }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '多选框属性', component: 'easydata-checkbox', showCommonProp: ['isLabelValue'], attribute: [ { label: '是否禁用', name: 'disabled', tag: 'el-switch' }, { label: '边框', name: 'border', tag: 'el-switch' }, { label: '尺寸', name: 'size', tag: 'el-radio-group', children: 'el-radio-button', props: {size: 'small'}, options: [ { label: '大', value: 'medium', }, { label: '中', value: 'small' }, { label: '小', value: 'mini' } ], showTag: { label: 'border', value: 'true' } }, { label: '数据绑定方式', name: 'selectBindType', tag: 'el-radio-group', children: 'el-radio', options: [{label: '自定义', value: 'diy'}, {label: '码表', value: 'dict'}, {label: '数据源', value: 'ds'}] }, { label: '选择码值', name: 'dictType', tag: 'el-input', children: 'el-button', props: { disabled: true, size: 'small', }, showTag: { label: 'selectBindType', value: 'dict' } }, { label: '表达式', name: 'dataSourceCode', tag: 'el-input', tooltip: "示例:cust_base_info,cust_name,cust_no", props: { size: 'small', }, showTag: { label: 'selectBindType', value: 'ds' } }, { label: '查询条件', name: 'dataSourceWhereList', tag: 'el-input', tooltip: '示例:[{fieldName: "cust_no", fieldValue: "111", operator: "like"}]', props: { size: 'small', }, showTag: { label: 'selectBindType', value: 'ds' } }, { label: "下拉元素", name: "dataSource", tag: "ed-table-editor", showTag: { label: "selectBindType", value: ['diy', 'dict'] }, props: { size: "mini", operate: { width: '100px' }, columns: TableEditorColumns, rules: TableEditorRules } } ] }, { name: '超链接框属性', component: 'easydata-link', showCommonProp: false, attribute: [ { label: '链接状态', name: 'type', tag: 'el-select', children: 'el-option', options: [ { label: '通用', value: 'primary' }, { label: '成功', value: 'success' }, { label: '警告', value: 'warning' }, { label: '危险', value: 'danger' }, { label: '信息', value: 'info' } ] }, { label: '链接地址', name: 'href', tag: 'el-input' }, { label: '显示文本', name: 'text', tag: 'el-input' }, { label: '是否可用', name: 'disabled', tag: 'el-radio-group', children: 'el-radio', options: [ { value: false, label: '可用' }, { value: true, label: '禁用' } ] },{ label: '打开方式', name: 'target', tag: 'el-select', children: 'el-option', options: [ { value: '_blank', label: '新窗口打开' }, { value: '_self', label: '当前窗口打开' } ] }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '选择弹窗属性', component: 'easydata-popup', showCommonProp: false, attribute: [ { label: '组件类型', name: 'compType', tag: 'el-radio-group', children: 'el-radio-button', options: [ { label: '系统组件', value: 'system', }, { label: '自定义组件', value: 'diy' } ], props: { size: 'small', }, }, { label: '系统组件', name: 'popupMode', tag: 'el-select', children: 'el-option', options: [{ label: '码表选择', value: 'DictChoose', expression: 'system_dict_type,name,id' }, { label: '机构选择', value: 'OrgChoose', expression: 'system_dept,name,id' }, { label: '人员选择', value: 'UserChoose', expression: 'system_users,nick_name,id' }, { label: '接口选择', value: 'InterfaceChoose', expression: 't_interface_info,api_name,id' }, { label: '角色选择', value: 'RoleChoose', expression: 'system_role,name,id' }, { label: '模板选择', value: 'TemplateChoose', expression: 'easy_template_info,template_name,id' }, { label: '菜单选择', value: 'MenuChoose', expression: 'system_menu,name,id' }], showTag: { label: 'compType', value: 'system' } }, { label: '组件名称', tooltip: '组件名称必须以DiyComp开头,否则不予注册.示例: DiyCompTest', name: 'component', tag: 'el-input', showTag: { label: 'compType', value: 'diy' } }, { label: '是否禁用', name: 'disabled', tag: 'el-switch', defaultValue: true, props: { disabled: true } }, { label: '是否全屏', name: 'isFullScreen', tag: 'el-switch', defaultValue: false, }, { label: '弹窗宽度', tooltip: '百分比的形式,示例: 50%', name: 'width', tag: 'el-input', showTag: { label: 'isFullScreen', value: 'false' } }, { label: '传递参数', tooltip: '可以是弹窗属性也可以是表单中存在数据的key,支持单个或多个逗号分割的形式,数据传递到 laodData() 方法的参数.示例: userName 或者 userName,id', name: 'params', tag: 'el-input', }, // { // label: '默认机构', // name: 'defaultChecked', // tag: 'el-switch', // showTag: { // label: 'popupMode', // value: 'OrgChoose' // } // }, { label: '是否多选', name: 'multiple', tag: 'el-switch', }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '联动公式属性', component: 'easydata-expression', showCommonProp: false, attribute: [ { label: '公式代码', name: 'expression', tag: 'el-input', tooltip: '示例:this.getControlValue(\'input_\')', props: { rows: 4, size: 'small', type: 'textarea' }, }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '日期属性', component: 'easydata-datePicker', showCommonProp: false, attribute: [ { label: '选择模式', name: 'type', tag: 'el-select', children: 'el-option', options: [{ label: '日期', value: 'date' }, { value: 'datetime', label: '日期时间' }, { value: 'datetimerange', label: '日期时间选择范围' }, { value: 'daterange', label: '日期选择范围' }] }, { label: '选择提示', name: 'placeholder', tag: 'el-input' }, { label: '禁用', name: 'disabled', tag: 'el-switch' }, { label: '只读', name: 'readonly', tag: 'el-switch' }, { label: '是否可清除', name: 'clearable', tag: 'el-switch' }, { label: '开启可输入', name: 'editable', tag: 'el-switch' }, { label: '开启范围选择', name: 'isRange', tag: 'el-switch', }, { label: '日期显示格式', tooltip: `参考:https://element.eleme.cn/#/zh-CN/component/date-picker#ri-qi-ge-shi; app不支持该属性,只能显示yyyy-MM-dd HH:mm:ss格式`, name: 'format', tag: 'el-input', props: { placeholder: 'yyyy 第 WW 周 , yyyy-MM-dd (更多用法见tooltip)' } }, { label: '日期存储格式', tooltip: '示例:时间戳格式 timestamp', name: 'valueFormat', tag: 'el-input', props: { clearable: true, placeholder: '请输入实例化数据格式' }, defaultValue: 'timestamp', }, { label: '默认的起始与结束时刻', tooltip: '示例: 起始时刻[\'12:00:00\'],起始时刻加结束时刻[\'12:00:00\', \'08:00:00\']', name: 'defaultTime', showTag: { label: 'type', value: ['datetimerange', 'daterange'] }, tag: 'el-input', }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '时间属性', component: 'easydata-timeSelect', showCommonProp: false, attribute: [ { label: '禁用', name: 'disabled', tag: 'el-switch' }, { label: '只读', name: 'readonly', tag: 'el-switch' }, { label: '是否可清除', name: 'clearable', tag: 'el-switch' }, { label: '开启可输入', name: 'editable', tag: 'el-switch' },{ label: '选择器选项', name: 'pickerOptions', tag: 'ed-json-editor', props: { height: 25, }, defaultValue: {"start":"","step": "", "end": ""}, tooltip: `分别通过start、end和step指定可选的起始时间、结束时间和步长;示例:{"start":"08:00","step":"00:15","end":"16:00"}`, },{ label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '文件上传属性', component: 'easydata-upload', showCommonProp: false, attribute: [ { label: '是否禁用', name: 'disabled', tag: 'el-switch', }, { label: '是否支持多选', name: 'multiple', tag: 'el-switch', }, { label: '是否显示列表', name: 'showFileList', tag: 'el-switch', }, { label: '列表样式', name: 'listType', tag: 'el-radio-group', children: 'el-radio-button', options: [ { label: '文件列', value: 'text' }, { label: '图片列', value: 'picture' }, { label: '图片墙', value: 'picture-card' } ], props: { size: 'small' }, showTag: { label: 'showFileList', value: 'true' } }, { label: '是否支持拖拽', name: 'drag', tag: 'el-switch', }, { label: '最大上传数量', name: 'limit', tag: 'el-input-number', defaultValue: 1, props: { min: 1 } }, { label: '限制类型', name: 'accept', tag: 'el-input', tooltip: '文件后缀,以英文逗号,隔开.示例: .jpg,.exe,.png' }, { label: 'Tips', name: 'tips', tag: 'el-input' } ] }, { name: '单选框属性', component: 'easydata-radio', showCommonProp: ['isLabelValue'], attribute: [ { label: '是否禁用', name: 'disabled', tag: 'el-switch' }, { label: '边框', name: 'border', tag: 'el-switch' }, { label: '尺寸', name: 'size', tag: 'el-radio-group', children: 'el-radio-button', props: {size: 'small'}, options: [ { value: 'medium', label: '大', }, { value: 'small', label: '中' }, { value: 'mini', label: '小' } ], showTag: { label: 'border', value: 'true' } }, { label: '数据绑定方式', name: 'selectBindType', tag: 'el-radio-group', children: 'el-radio', options: [{label: '自定义', value: 'diy'}, {label: '码表', value: 'dict'}, {label: '数据源', value: 'ds'}] }, { label: '选择码值', name: 'dictType', tag: 'el-input', children: 'el-button', props: { disabled: true, size: 'small', }, showTag: { label: 'selectBindType', value: 'dict' } }, { label: '表达式', name: 'dataSourceCode', tag: 'el-input', tooltip: "示例:cust_base_info,cust_name,cust_no", props: { size: 'small', }, showTag: { label: 'selectBindType', value: 'ds' } }, { label: '查询条件', name: 'dataSourceWhereList', tag: 'el-input', tooltip: '示例:[{fieldName: "cust_no", fieldValue: "111", operator: "like"}]', props: { size: 'small', }, showTag: { label: 'selectBindType', value: 'ds' } }, { label: 'Tips', name: 'tips', tag: 'el-input' }, { label: "下拉元素", name: "dataSource", tag: "ed-table-editor", showTag: { label: "selectBindType", value: ['diy', 'dict'] }, props: { size: "mini", operate: { width: '100px' }, columns: TableEditorColumns, rules: TableEditorRules } } ] }, { name: '开关属性', component: 'easydata-switch', showCommonProp: ['isLabelValue', 'defaultValue'], attribute: [ { label: '是否禁用', name: 'disabled', tag: 'el-switch' }, { label: '开启时描述', name: 'activeText', tag: 'el-input' }, { label: '开启触发控件', name: 'activeTriggerControl', tag: 'ed-input-pop' }, { label: '关闭时描述', name: 'inactiveText', tag: 'el-input' }, { label: '关闭触发控件', name: 'inactiveTriggerControl', tag: 'ed-input-pop' }, { label: 'Tips', name: 'tips', tag: 'el-input' }, ] }, { name: '文本属性', component: 'easydata-label', showCommonProp: ['defaultValue'], attribute: [ { label: 'html内容', name: 'content', tag: 'el-input', props: { size: 'small', type: "textarea", rows: "4" }, }] } ]