| | |
| | | * @param {*} config 页面配置 |
| | | * @param {*} permFuncField 存储过程可用的开始字段 |
| | | */ |
| | | export function getActionForm (card, functip, config, permFuncField, type) { |
| | | let openTypeOptions = [{ |
| | | value: 'pop', |
| | | text: Formdict['header.form.popform'] |
| | | }, { |
| | | value: 'prompt', |
| | | text: Formdict['header.form.prompt'] |
| | | }, { |
| | | value: 'exec', |
| | | text: Formdict['header.form.exec'] |
| | | }, { |
| | | value: 'excelIn', |
| | | text: Formdict['header.form.excelIn'] |
| | | }, { |
| | | value: 'excelOut', |
| | | text: Formdict['header.form.excelOut'] |
| | | }, { |
| | | value: 'popview', |
| | | text: Formdict['header.form.popview'] |
| | | }] |
| | | |
| | | if (type === 'main') { |
| | | openTypeOptions = [ |
| | | ...openTypeOptions, |
| | | { |
| | | value: 'tab', |
| | | text: Formdict['header.form.tab'] |
| | | }, { |
| | | value: 'blank', |
| | | text: Formdict['header.form.blank'] |
| | | }, { |
| | | value: 'innerpage', |
| | | text: Formdict['header.form.newpage.inner'] |
| | | }, { |
| | | value: 'outerpage', |
| | | text: Formdict['header.form.newpage.outer'] |
| | | } |
| | | ] |
| | | } |
| | | export function getActionForm (card, functip, config, permFuncField) { |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | label: Formdict['header.form.openType'], |
| | | initVal: card.OpenType, |
| | | required: true, |
| | | options: openTypeOptions |
| | | options: [{ |
| | | value: 'pop', |
| | | text: Formdict['header.form.popform'] |
| | | }, { |
| | | value: 'prompt', |
| | | text: Formdict['header.form.prompt'] |
| | | }, { |
| | | value: 'exec', |
| | | text: Formdict['header.form.exec'] |
| | | }, { |
| | | value: 'excelIn', |
| | | text: Formdict['header.form.excelIn'] |
| | | }, { |
| | | value: 'excelOut', |
| | | text: Formdict['header.form.excelOut'] |
| | | }, { |
| | | value: 'popview', |
| | | text: Formdict['header.form.popview'] |
| | | }, { |
| | | value: 'tab', |
| | | text: Formdict['header.form.tab'] |
| | | }, { |
| | | value: 'blank', |
| | | text: Formdict['header.form.blank'] |
| | | }, { |
| | | value: 'innerpage', |
| | | text: Formdict['header.form.newpage.inner'] |
| | | }, { |
| | | value: 'outerpage', |
| | | text: Formdict['header.form.newpage.outer'] |
| | | }] |
| | | }, { |
| | | type: 'select', |
| | | key: 'tabType', |
| | |
| | | type: 'select', |
| | | key: 'tabTemplate', |
| | | label: '标签模板', |
| | | initVal: card.tabTemplate || 'formTab', |
| | | initVal: card.tabTemplate || 'FormTab', |
| | | required: true, |
| | | options: [{ |
| | | value: 'formTab', |
| | | value: 'FormTab', |
| | | text: '带标签表单' |
| | | }] |
| | | }, |
| | |
| | | required: false |
| | | } |
| | | ] |
| | | } |
| | | |
| | | /** |
| | | * @description 获取表单配置信息 |
| | | * @param {*} card |
| | | * @param {*} inputfields |
| | | */ |
| | | export function getModalForm (card, inputfields) { |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['header.form.name'], |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['header.form.field'], |
| | | initVal: card.field, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'type', |
| | | label: Formdict['header.form.type'], |
| | | initVal: card.type, |
| | | required: true, |
| | | options: [{ |
| | | value: 'text', |
| | | text: Formdict['header.form.text'] |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['header.form.number'] |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['header.form.select'] |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['header.form.multiselect'] |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['header.form.link'] |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['header.form.dateday'] |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['header.form.datemonth'] |
| | | }, { |
| | | value: 'datetime', |
| | | text: Formdict['header.form.datetime'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['header.form.textarea'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: Formdict['header.form.initval'], |
| | | initVal: card.initval, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'resourceType', |
| | | label: Formdict['header.form.resourceType'], |
| | | initVal: card.resourceType || '0', |
| | | required: true, |
| | | options: [{ |
| | | value: '0', |
| | | text: Formdict['header.form.custom'] |
| | | }, { |
| | | value: '1', |
| | | text: Formdict['header.form.datasource'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'setAll', |
| | | label: Formdict['header.form.setAll'], |
| | | initVal: card.setAll || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'dataSource', |
| | | label: Formdict['header.form.datasource'], |
| | | initVal: card.dataSource || '', |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'options', |
| | | key: 'options', |
| | | label: '', |
| | | initVal: card.options || [], |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'linkField', |
| | | label: Formdict['header.form.linkField'], |
| | | initVal: card.linkField || '', |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'valueField', |
| | | label: Formdict['header.form.valueField'], |
| | | initVal: card.valueField || '', |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'valueText', |
| | | label: Formdict['header.form.valueText'], |
| | | initVal: card.valueText || '', |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'orderBy', |
| | | label: Formdict['header.form.orderBy'], |
| | | initVal: card.orderBy || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'orderType', |
| | | label: Formdict['header.form.orderType'], |
| | | initVal: card.orderType || 'asc', |
| | | options: [{ |
| | | value: 'asc', |
| | | text: Formdict['header.form.asc'] |
| | | }, { |
| | | value: 'desc', |
| | | text: Formdict['header.form.desc'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | label: Formdict['header.form.decimal'], |
| | | initVal: card.decimal || 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'min', |
| | | label: '最小值', |
| | | initVal: card.min || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'max', |
| | | label: '最大值', |
| | | initVal: card.max || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readonly', |
| | | label: Formdict['header.form.readonly'], |
| | | initVal: card.readonly || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['header.form.field.required'], |
| | | initVal: card.required || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'linkSubField', |
| | | label: Formdict['header.form.linkForm'], |
| | | initVal: card.linkSubField || [], |
| | | options: inputfields |
| | | } |
| | | ] |
| | | } |