| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { btnCustomClasses } from '@/utils/option.js' |
| | | |
| | | const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | |
| | | export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let printTemps = sessionStorage.getItem('printTemps') || [] |
| | | let setting = config.setting || {} |
| | | let columns = config.columns || [] |
| | | let appMenus = [] |
| | |
| | | ] |
| | | pageTemps = [ |
| | | { value: 'linkpage', text: '关联菜单' }, |
| | | // { value: 'pay', text: Formdict['model.pay'] }, |
| | | { value: 'custom', text: '链接' } |
| | | ] |
| | | } else { |
| | |
| | | |
| | | if (!card.control && card.controlField) { |
| | | card.control = 'disabled' |
| | | } |
| | | if (appType === 'mob' && card.control === 'parent') { |
| | | card.control = '' |
| | | } |
| | | |
| | | let forms = [ |
| | |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | initVal: card.innerFunc || '', |
| | | tooltip: functip, |
| | | fields: usefulFields, |
| | | tooltipClass: 'middle', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | initVal: card.pageTemplate || '', |
| | | required: true, |
| | | options: pageTemps |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'printTemp', |
| | | label: '打印模板', |
| | | initVal: card.printTemp || '', |
| | | required: true, |
| | | options: printTemps |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | label: Formdict['header.form.outerFunc'], |
| | | initVal: card.outerFunc || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | label: Formdict['header.form.callbackFunc'], |
| | | initVal: card.callbackFunc || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | tooltip: '此颜色为按钮初始化颜色,可在样式调整中修改。', |
| | | required: false, |
| | | forbid: type === 'datacard' && appType === 'mob', // 移动端,滑动显示的按钮不设置通用颜色 |
| | | options: [] |
| | | options: btnCustomClasses |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | type: 'number', |
| | | key: 'ratio', |
| | | min: 1, |
| | | max: 24, |
| | | max: 3000, |
| | | precision: 0, |
| | | label: '比例', |
| | | initVal: card.ratio || 85, |
| | |
| | | key: 'control', |
| | | label: '按钮控制', |
| | | initVal: card.control || (card.controlField ? 'disabled' : ''), |
| | | tooltip: '当选择禁用或隐藏,且字段值与控制值相等时,按钮会隐藏或禁用。当选择上级,主表字段值与控制值相等或主表字段值不存在时,按钮会隐藏。注:多个值用逗号分隔', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | |
| | | }, { |
| | | value: 'hidden', |
| | | text: '隐藏' |
| | | // }, { |
| | | // value: 'parent', |
| | | // text: '上级' |
| | | }, { |
| | | value: 'parent', |
| | | text: '上级' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'controlField', |
| | | label: '控制字段', |
| | | tooltip: '控制字段,可根据数据控制按钮的隐藏或禁用。', |
| | | initVal: card.controlField || '', |
| | | required: true, |
| | | allowClear: true, |
| | |
| | | type: 'text', |
| | | key: 'controlVal', |
| | | label: '控制值', |
| | | tooltip: '当选择禁用或隐藏,且字段值与控制值相等时,按钮会隐藏或禁用,多个值用逗号分隔。当选择上级时,默认隐藏,只有主表行信息符合条件时显示,格式为@field@:values,field为主表字段名,values为值多个可用逗号拼接', |
| | | initVal: card.controlVal || '', |
| | | required: false |
| | | }, |