| | |
| | | * @description 获取显示列表单配置信息 |
| | | * @param {object} card // 搜索条件对象 |
| | | */ |
| | | export function getColumnForm (card, fields = []) { |
| | | export function getColumnForm (card, fields = [], columns = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | |
| | | value: 'index', |
| | | text: '序号' |
| | | }] |
| | | |
| | | let editCols = [ |
| | | { |
| | | field: '$next', |
| | | label: '下一行' |
| | | } |
| | | ] |
| | | columns.forEach(col => { |
| | | if (col.editable === 'true' && col.uuid !== card.uuid) { |
| | | editCols.push({ |
| | | field: col.uuid, |
| | | label: col.label |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | return [ |
| | | { |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sum', |
| | | label: '显示合计', |
| | | initVal: card.sum || 'false', |
| | | tooltip: '合计信息只在使用系统数据源时有效。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'editable', |
| | | label: '可编辑', |
| | | initVal: card.editable || 'false', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: '必填', |
| | | initVal: card.required || 'false', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '否' |
| | | }, { |
| | | value: 'true', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: '默认值', |
| | | initVal: card.initval, |
| | | tooltip: '使用$copy时,表示新增时复制上一行信息。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'enter', |
| | | label: '回车切换', |
| | | initVal: card.enter || '$next', |
| | | options: editCols |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'footEnter', |
| | | label: '末行回车', |
| | | initVal: card.footEnter || 'false', |
| | | tooltip: '新增功能仅在表格可新增时有效。', |
| | | options: [{ |
| | | value: 'sub', |
| | | text: '提交' |
| | | }, { |
| | | value: 'add', |
| | | text: '新增' |
| | | }, { |
| | | value: 'false', |
| | | text: '无动作' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'max', |
| | | label: '最大值', |
| | | initVal: card.max, |
| | | unlimit: true, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'min', |
| | | label: '最小值', |
| | | initVal: card.min, |
| | | unlimit: true, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: Formdict['header.form.format'], |