From 7bc44b8b3e88950fd2ff553f41dd0a01198f27ca Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 十一月 2023 15:06:41 +0800 Subject: [PATCH] 2023-11-09 --- src/menu/components/form/step-form/options.jsx | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 106 insertions(+), 5 deletions(-) diff --git a/src/menu/components/form/step-form/options.jsx b/src/menu/components/form/step-form/options.jsx index 403fa82..1ec6a9e 100644 --- a/src/menu/components/form/step-form/options.jsx +++ b/src/menu/components/form/step-form/options.jsx @@ -1,4 +1,3 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** @@ -20,8 +19,27 @@ } 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 = [ { @@ -53,10 +71,41 @@ 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', @@ -78,8 +127,22 @@ options: [ {value: 'show', label: '鏄剧ず'}, {value: 'hidden', label: '闅愯棌'}, - ] + ], + // controlFields: [ + // {field: 'labelSize', values: ['show']}, + // ] }, + // { + // type: 'number', + // field: 'labelSize', + // label: '鍚嶇О澶у皬', + // initval: wrap.labelSize || '', + // tooltip: '鍒嗙粍鍚嶇О瀛椾綋澶у皬銆�', + // min: 12, + // max: 50, + // precision: 0, + // required: false + // }, { type: 'radio', field: 'tabtype', @@ -103,6 +166,44 @@ }, { 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', @@ -111,7 +212,7 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType + forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { type: 'cascader', -- Gitblit v1.8.0