| | |
| | | * @param {*} permFuncField 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, setting, permFuncField = [], type, menulist = []) { |
| | | export function getActionForm (card, functip, setting, permFuncField = [], type, menulist = [], modules = []) { |
| | | let opentypes = [ |
| | | { |
| | | value: 'pop', |
| | |
| | | } |
| | | ] |
| | | |
| | | if (card.intertype === 'inner' && !card.innerFunc) { |
| | | card.intertype = 'system' |
| | | } |
| | | |
| | | if (type === 'chart') { |
| | | if (card.focus) { |
| | | // 导入和导出excel,按钮名称直接为导入、导出 |
| | | card.label = '导出Excel' |
| | | card.OpenType = 'excelOut' |
| | | card.icon = 'download' |
| | | card.intertype = setting.interType |
| | | card.innerFunc = setting.innerFunc |
| | | card.sysInterface = setting.sysInterface |
| | | card.outerFunc = setting.outerFunc |
| | | card.interface = setting.interface |
| | | card.class = 'dgreen' |
| | | } |
| | | opentypes = [ |
| | | { |
| | | value: 'excelIn', |
| | |
| | | text: '系统' |
| | | }, { |
| | | value: 'inner', |
| | | text: Formdict['header.form.interface.inner'] |
| | | text: Formdict['model.interface.inner'] |
| | | }, { |
| | | value: 'outer', |
| | | text: Formdict['header.form.interface.outer'] |
| | | text: Formdict['model.interface.outer'] |
| | | }] |
| | | }, |
| | | { |
| | |
| | | key: 'sqlType', |
| | | label: Formdict['header.form.action.type'], |
| | | initVal: card.sqlType || '', |
| | | tooltip: Formdict['header.form.actionhelp.sqlType'], |
| | | required: false, |
| | | required: true, |
| | | options: [] |
| | | }, |
| | | { |
| | |
| | | key: 'sql', |
| | | label: Formdict['model.form.tablename'], |
| | | initVal: card.sql || setting.tableName || '', |
| | | tooltip: Formdict['header.form.actionhelp.tablename'], |
| | | required: false |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkTab', |
| | | label: '关联标签', |
| | | initVal: card.linkTab || '', |
| | | required: false, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'pageTemplate', |
| | | label: Formdict['model.form.newpage.type'], |
| | | initVal: card.pageTemplate || '', |
| | | required: true, |
| | | options: [{ |
| | | value: 'print', |
| | | text: Formdict['header.menu.printTemplate'] |
| | | value: 'billprint', |
| | | text: '单据打印' |
| | | }, { |
| | | value: 'pay', |
| | | text: Formdict['model.pay'] |
| | |
| | | initVal: card.callbackFunc || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'position', |
| | | label: Formdict['header.form.position'], |
| | | initVal: card.position || 'toolbar', |
| | | required: true, |
| | | options: [{ |
| | | value: 'toolbar', |
| | | text: Formdict['header.form.toolbar'] |
| | | }, { |
| | | value: 'grid', |
| | | text: Formdict['header.form.grid'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '宽度', |
| | | initVal: card.width || 12, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | forbid: type !== 'card', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'show', |
| | | label: "显示为", |
| | | initVal: card.show || 'icon', |
| | | required: true, |
| | | options: [{ |
| | | value: 'icon', |
| | | text: '图标' |
| | | }, { |
| | | value: 'button', |
| | | text: '按钮' |
| | | }, { |
| | | value: 'link', |
| | | text: '链接' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'icon', |
| | | label: Formdict['model.icon'], |
| | | initVal: card.icon, |
| | | required: type === 'chart', // 图表必须使用图标 |
| | | required: false, |
| | | options: [] |
| | | }, |
| | | { |
| | |
| | | text: '非必填' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'mcascader', |
| | | key: 'syncComponent', |
| | | label: '同步刷新', |
| | | initVal: card.syncComponent || [], |
| | | required: false, |
| | | options: modules |
| | | }, |
| | | // { |
| | | // type: 'select', |
| | | // key: 'linkcomponents', |
| | |
| | | // } |
| | | ] |
| | | |
| | | if (type === 'chart') { |
| | | return forms |
| | | } |
| | | return forms |
| | | } |