| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = [], columns = []) { |
| | | export default function (wrap, action = [], columns = [], toolBtns = []) { |
| | | const wrapForm = [ |
| | | { |
| | | type: 'radio', |
| | |
| | | { |
| | | type: 'radio', |
| | | field: 'actionfixed', |
| | | label: '按钮固定', |
| | | initval: wrap.actionfixed || 'false', |
| | | label: '固定按钮', |
| | | initval: wrap.actionfixed !== 'true' ? 'false' : 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | field: 'colfixed', |
| | | label: '固定列', |
| | | initval: wrap.colfixed || [], |
| | | required: false, |
| | | options: [ |
| | | {value: 'first', label: '首列'}, |
| | | {value: 'last', label: '尾列'}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | field: 'height', |
| | | label: '表格高度', |
| | | initval: wrap.height || '', |
| | | tooltip: '表格高度,空值时高度自适应。', |
| | | tooltip: '表格高度,空值时高度自适应。注:小于等于100时为高度的百分比。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | |
| | | tooltip: '双击表格中行,触发的按钮。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: action.map(item => ({value: item.uuid, label: item.label})), |
| | | options: [...toolBtns, ...action].map(item => ({value: item.uuid, label: item.label})), |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'autoExec', |
| | | label: '自动执行', |
| | | initval: wrap.autoExec || '', |
| | | tooltip: '初始化自动执行按钮。', |
| | | required: false, |
| | | options: toolBtns.map(item => ({value: item.uuid, label: item.label})) |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'tipField', |
| | | label: '信息提示', |
| | | initval: wrap.tipField || '', |
| | | tooltip: '鼠标悬浮于行上方时的提示信息。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false |
| | | } |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | ] |
| | | |
| | | return wrapForm |