| | |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | */ |
| | | export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side) { |
| | | export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side, position) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let setting = config.setting || {} |
| | |
| | | }] |
| | | } else if (card.formType === 'scan') { |
| | | card.formType = 'switch' |
| | | } |
| | | |
| | | let width = card.width || (card.width === 0 ? 0 : 12) |
| | | if (/x/.test(card.width)) { |
| | | width = +width.replace(/x/, '.5') |
| | | } |
| | | |
| | | let forms = [ |
| | |
| | | key: 'width', |
| | | min: 0, |
| | | max: 24, |
| | | precision: 0, |
| | | precision: 1, |
| | | label: '宽度', |
| | | initVal: card.width || (card.width === 0 ? 0 : 12), |
| | | tooltip: '栅格布局,每行等分为24列。为 0 时宽度自适应。', |
| | | initVal: width, |
| | | tooltip: '栅格布局,每行等分为24列。为 0 时宽度自适应。可设置半列即.5。', |
| | | forbid: type !== 'card', |
| | | required: true |
| | | }, |
| | |
| | | tooltip: '鼠标悬浮在按钮上方时的提示信息。', |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'showName', |
| | | label: '显示内容', |
| | | initVal: card.showName || '', |
| | | tooltip: '行级按钮可通过行信息控制按钮显示内容。', |
| | | required: false, |
| | | allowClear: true, |
| | | forbid: position !== 'line', |
| | | options: columns.map(item => ({ |
| | | value: item.field, |
| | | text: `${item.label}(${item.field})` |
| | | })) |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | options: modules |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'preHandle', |
| | | label: '自定义脚本', |
| | | initVal: card.preHandle || 'false', |
| | | // tooltip: '隐藏后按钮在页面中不显示,且不参与权限分配。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | key: 'pre_func', |
| | | label: '自定义脚本', |
| | | initVal: card.pre_func || '', |
| | | required: true, |
| | | } |
| | | ] |
| | | |
| | |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | */ |
| | | export function getBaseTableActionForm (card, functip, config, usefulFields, modules) { |
| | | export function getBaseTableActionForm (card, functip, config, usefulFields, modules, position) { |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let setting = config.setting || {} |
| | | let columns = config.columns || [] |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'showName', |
| | | label: '显示内容', |
| | | initVal: card.showName || '', |
| | | tooltip: '行级按钮可通过行信息控制按钮显示内容。', |
| | | required: false, |
| | | allowClear: true, |
| | | forbid: position !== 'line', |
| | | options: columns.map(item => ({ |
| | | value: item.field, |
| | | text: `${item.label}(${item.field})` |
| | | })) |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'openTab', |
| | | label: '打开方式', |
| | |
| | | options: modules |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'preHandle', |
| | | label: '自定义脚本', |
| | | initVal: card.preHandle || 'false', |
| | | // tooltip: '隐藏后按钮在页面中不显示,且不参与权限分配。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | key: 'pre_func', |
| | | label: '自定义脚本', |
| | | initVal: card.pre_func || '', |
| | | required: true, |
| | | } |
| | | ] |
| | | |