From 2aa5ab63b4bbce5c36dbb3511b205b3b5f6af9bd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 07 五月 2024 11:34:20 +0800 Subject: [PATCH] 2024-05-07 --- src/menu/components/form/step-form/options.jsx | 123 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 119 insertions(+), 4 deletions(-) diff --git a/src/menu/components/form/step-form/options.jsx b/src/menu/components/form/step-form/options.jsx index fa3eb97..647d7a0 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,36 @@ 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', @@ -103,6 +180,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 +226,7 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType + forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { type: 'cascader', -- Gitblit v1.8.0