| | |
| | | * @description 获取显示列表单配置信息 |
| | | * @param {object} card // 搜索条件对象 |
| | | */ |
| | | export function getColumnForm (card, fields = [], columns = []) { |
| | | export function getColumnForm (card, fields = [], columns = [], wrap) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | |
| | | }] |
| | | |
| | | let editCols = [ |
| | | // { |
| | | // field: '$sub', |
| | | // label: '提交' |
| | | // }, |
| | | { |
| | | field: '$sub', |
| | | label: '提交' |
| | | field: '$noAct', |
| | | label: '无动作' |
| | | }, |
| | | { |
| | | field: '$next', |
| | | label: '下一行' |
| | | }, |
| | | { |
| | | field: '$noAct', |
| | | label: '无动作' |
| | | } |
| | | ] |
| | | |
| | | if (card.enter === '$sub') { |
| | | card.enter = '$noAct' |
| | | } |
| | | if (wrap.commit === 'change') { |
| | | editCols[0].label = '失去焦点' |
| | | } |
| | | |
| | | let cols = [] |
| | | let getcols = (columns, suplabel = '') => { |
| | |
| | | label: col.label + '(下一行)' |
| | | }) |
| | | }) |
| | | |
| | | editCols.push({ |
| | | field: '$next_' + card.uuid, |
| | | label: card.label + '(下一行)' |
| | | }) |
| | | |
| | | if (wrap.commit === 'change') { |
| | | editCols.push({ |
| | | field: '$noActX', |
| | | label: '无动作', |
| | | disabled: card.editType !== 'select' |
| | | }) |
| | | } else if (card.enter === '$noActX') { |
| | | card.enter = '$noAct' |
| | | } |
| | | |
| | | return [ |
| | | { |
| | |
| | | key: 'showField', |
| | | label: '显示字段', |
| | | initVal: card.showField || '', |
| | | tooltip: '用于控制选择框中的显示内容。', |
| | | required: true, |
| | | tooltip: '用于控制单元格中的显示内容。', |
| | | required: false, |
| | | options: 'columns' |
| | | }, |
| | | { |
| | |
| | | initVal: card.popWidth || 60, |
| | | tooltip: '小于100时为百分率,大于100时为绝对值。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'laypage', |
| | | label: '分页', |
| | | initVal: card.laypage || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'onload', |
| | | label: '初始化', |
| | | initVal: card.onload || 'true', |
| | | tooltip: '当没有设置搜索字段时,初始化加载数据。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '加载' |
| | | }, { |
| | | value: 'false', |
| | | text: '不加载' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'cache', |
| | | label: '选项查询', |
| | | initVal: card.cache || 'true', |
| | | tooltip: '数据查询是否使用缓存。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '缓存' |
| | | }, { |
| | | value: 'false', |
| | | text: '实时' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | key: 'enter', |
| | | label: '回车切换', |
| | | initVal: card.enter || '$noAct', |
| | | tooltip: '包括文本或数值回车事件、下拉菜单选中事件、开关切换事件。', |
| | | tooltip: '包括文本或数值回车事件、下拉菜单、选择器、时间变化事件、开关切换事件。', |
| | | options: editCols |
| | | }, |
| | | { |
| | |
| | | initVal: card.ctrlValue || '', |
| | | tooltip: '多个值用逗号分隔。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'clearField', |
| | | label: '清空字段', |
| | | initVal: card.clearField || '', |
| | | tooltip: '当前字段编辑时需要清空的字段。', |
| | | allowClear: true, |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '当值为0时是否显示', |
| | | tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |