| | |
| | | import { fromJS } from 'immutable' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | let modules = [] |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | | modules = MenuUtils.getSupModules(menu.components, config.uuid) |
| | | let menu = window.GLOB.customMenu |
| | | modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces) |
| | | |
| | | if (wrap.supModule && wrap.supModule.length > 0 && wrap.supModule[0] !== 'empty') { |
| | | let has = MenuUtils.checkSupModules(modules, wrap.supModule.slice(-1)[0]) |
| | | if (!has) { |
| | | wrap.supModule = '' |
| | | } |
| | | } |
| | | |
| | | let interfaces = [] |
| | | if (menu.interfaces) { |
| | | menu.interfaces.forEach(item => { |
| | | if (item.status === 'true') { |
| | | interfaces.push({ |
| | | value: item.uuid, |
| | | label: item.name |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const wrapForm = [ |
| | | { |
| | |
| | | options: [ |
| | | {value: 'dynamic', label: '动态'}, |
| | | {value: 'static', label: '静态'}, |
| | | {value: 'public', label: '公共数据源'} |
| | | ], |
| | | controlFields: [ |
| | | {field: 'empty', values: ['dynamic']}, |
| | | {field: 'supModule', values: ['static']}, |
| | | {field: 'publicId', values: ['public']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'publicId', |
| | | label: '数据源', |
| | | initval: wrap.publicId || '', |
| | | required: true, |
| | | options: interfaces, |
| | | reset_source: config.subtype !== 'tabform', |
| | | callback: (map, record) => { |
| | | if (!record.publicId) return |
| | | |
| | | let interfaces = window.GLOB.customMenu.interfaces || [] |
| | | |
| | | let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0] |
| | | |
| | | if (!d || !d.columns) return |
| | | |
| | | let columns = JSON.parse(JSON.stringify(d.columns)) |
| | | |
| | | let _sCtrl = map.get('statusControl') |
| | | |
| | | if (_sCtrl && !_sCtrl.forbid) { |
| | | _sCtrl.options = columns |
| | | _sCtrl.oriOptions = columns |
| | | map.set('statusControl', _sCtrl) |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | options: [ |
| | | {value: 'show', label: '显示'}, |
| | | {value: 'hidden', label: '隐藏'}, |
| | | ], |
| | | controlFields: [ |
| | | // {field: 'labelSize', values: ['show']}, |
| | | {field: 'labelJump', values: ['show']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'labelJump', |
| | | label: '名称切换', |
| | | initval: wrap.labelJump || 'false', |
| | | tooltip: '开启时,可通过点击分组名称向前跳转。', |
| | | required: false, |
| | | forbid: config.subtype === 'tabform', |
| | | options: [ |
| | | {value: 'false', label: '关闭'}, |
| | | {value: 'true', label: '开启'}, |
| | | ] |
| | | }, |
| | | // { |
| | | // type: 'number', |
| | | // field: 'labelSize', |
| | | // label: '名称大小', |
| | | // initval: wrap.labelSize || '', |
| | | // tooltip: '分组名称字体大小。', |
| | | // min: 12, |
| | | // max: 50, |
| | | // precision: 0, |
| | | // required: false |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'tabtype', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'formStyle', |
| | | label: '表单样式', |
| | | initval: wrap.formStyle || '', |
| | | required: false, |
| | | options: [ |
| | | {value: '', label: '默认'}, |
| | | {value: 'shadow', label: '阴影'}, |
| | | ], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'goback', |
| | | label: '空值返回', |
| | | initval: wrap.goback || 'false', |
| | | tooltip: '当查询数据为空时,返回上一界面。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: wrap.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | skip: true, |
| | | options: [ |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'cascader', |