| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = []) { |
| | | export default function (wrap, action = [], columns = [], toolBtns) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | let isprint = sessionStorage.getItem('MenuType') === 'billPrint' |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | |
| | | if (roleList) { |
| | | try { |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || '', |
| | | tooltip: '表格高度,空值时高度自适应。注:小于等于100时为高度的百分比。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tableType', |
| | | label: '表格属性', |
| | | initval: wrap.tableType, |
| | | initval: wrap.tableType || '', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '不可选'}, |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'parity', |
| | | label: '奇偶异色', |
| | | initval: wrap.parity || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'bordered', |
| | | label: '边框', |
| | | initval: wrap.bordered || 'true', |
| | |
| | | {value: 'true', label: '有'}, |
| | | {value: 'false', label: '无'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'actionfixed', |
| | | label: '固定按钮', |
| | | initval: wrap.actionfixed !== 'true' ? 'false' : 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: appType === 'mob' || appType === 'pc' |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | field: 'colfixed', |
| | | label: '固定列', |
| | | initval: wrap.colfixed || [], |
| | | required: false, |
| | | options: [ |
| | | {value: 'first', label: '首列'}, |
| | | {value: 'last', label: '尾列'}, |
| | | ], |
| | | forbid: appType === 'mob' || appType === 'pc' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | forbid: appType === 'mob' || appType === 'pc' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'size', |
| | | label: '表格大小', |
| | | initval: wrap.size || 'middle', |
| | | tooltip: '表格的内边距,从大到小依次递减。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'default', label: '大'}, |
| | | {value: 'middle', label: '中'}, |
| | | {value: 'small', label: '小'}, |
| | | {value: 'mini', label: '迷你'}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'selected', |
| | | label: '首行选中', |
| | | initval: wrap.selected || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'borderColor', |
| | | label: '边框颜色', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'color', |
| | | label: '字体颜色', |
| | | initval: wrap.color || 'rgba(0, 0, 0, 0.65)', |
| | | tooltip: '默认值 rgba(0, 0, 0, 0.65)。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'width', |
| | | label: '宽度', |
| | | initval: wrap.width || 24, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'fontSize', |
| | | label: '字体大小', |
| | | initval: wrap.fontSize || 14, |
| | | min: 12, |
| | | max: 30, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || '', |
| | | tooltip: '表格高度,空值时高度自适应。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | | type: 'radio', |
| | | field: 'vertical', |
| | | label: '垂直对齐', |
| | | initval: wrap.vertical || 'middle', |
| | | tooltip: '单元格的垂直对齐方式。', |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | options: [ |
| | | {value: 'top', label: '向上'}, |
| | | {value: 'middle', label: '居中'}, |
| | | {value: 'bottom', label: '向下'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'advanceWidth', |
| | | label: '高级搜索', |
| | | initval: wrap.advanceWidth || 1000, |
| | | tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。', |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | 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})), |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | 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', |
| | | field: 'controlField', |
| | | label: '禁用字段', |
| | | initval: wrap.controlField || '', |
| | | tooltip: '用于控制行数据是否可选择。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: columns, |
| | | controlFields: [ |
| | | {field: 'controlVal', notNull: true}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'controlVal', |
| | | label: '禁用值', |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'btnlimit', |
| | | label: '按钮限制', |
| | | initval: wrap.btnlimit || '', |
| | | tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。', |
| | | min: 3, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType !== '' || isprint |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | | tooltip: '分页时每页可显示的最大数量。', |
| | | min: 10, |
| | | max: 500, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: wrap.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'supKey', |
| | | label: '上级主键', |
| | | initval: wrap.supKey || 'true', |
| | | tooltip: '当设置上级组件时,上级主键值为空是否进行数据查询。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '验证'}, |
| | | {value: 'false', label: '忽略'}, |
| | | ], |
| | | forbid: isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: !appType ? '继承菜单' : '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheLocal', |
| | | label: '本地缓存', |
| | | initval: wrap.cacheLocal || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '继承菜单'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: ispop || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cacheSearch', |
| | | label: '搜索缓存', |
| | | initval: wrap.cacheSearch || 'false', |
| | | tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initval: wrap.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbid: !!appType |
| | | forbid: !!appType || isprint |
| | | }, |
| | | ] |
| | | |