From 32973f90869ff466401759c23681fc06fa65c71a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 10 六月 2025 23:06:50 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/mob/components/menubar/normal-menubar/menucomponent/options.jsx | 133 ++++++++++++++++++++++++++++++++------------ 1 files changed, 97 insertions(+), 36 deletions(-) diff --git a/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx b/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx index 8df0cb0..c8ead06 100644 --- a/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx +++ b/src/mob/components/menubar/normal-menubar/menucomponent/options.jsx @@ -1,17 +1,25 @@ /** * @description Setting琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (setting) { +export default function (setting, columns) { let menulist = sessionStorage.getItem('appMenus') if (menulist) { try { menulist = JSON.parse(menulist) - } catch { + } catch (e) { menulist = [] } } else { menulist = [] + } + + let ops = [] + let adapters = sessionStorage.getItem('adapter') || '' + if (adapters.indexOf('wxmini') > -1) { + ops.push({value: 'miniprogram', label: '灏忕▼搴�'}) + } else if (setting.type === 'miniprogram') { + setting.type = '' } const menuWrapForm = [ @@ -22,26 +30,15 @@ initval: setting.name || '', required: true }, + // { + // type: 'text', + // field: 'MenuNo', + // label: '鑿滃崟鍙傛暟', + // initval: setting.MenuNo || '', + // required: true + // }, { - type: 'text', - field: 'MenuNo', - label: '鑿滃崟鍙傛暟', - initval: setting.MenuNo || '', - required: true - }, - { - type: 'number', - field: 'width', - label: '瀹藉害', - initval: setting.width || 24, - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', - min: 1, - max: 24, - precision: 0, - required: true - }, - { - type: 'select', + type: 'radio', field: 'type', label: '鑿滃崟灞炴��', initval: setting.type || 'menu', @@ -49,34 +46,58 @@ options: [ {value: 'menu', label: '鑿滃崟'}, {value: 'linkmenu', label: '鍏宠仈鑿滃崟'}, - {value: 'sysmenu', label: '绯荤粺椤�'}, {value: 'link', label: '閾炬帴'}, + ...ops ], controlFields: [ - {field: 'sysmenu', values: ['sysmenu']}, {field: 'copyMenuId', values: ['menu']}, {field: 'linkMenuId', values: ['linkmenu']}, {field: 'linkurl', values: ['link']}, + {field: 'primaryId', values: ['menu', 'linkmenu']}, + {field: 'miniAppId', values: ['miniprogram']}, + {field: 'miniPath', values: ['miniprogram']}, ] }, { - type: 'select', - field: 'sysmenu', - label: '绯荤粺椤甸潰', - initval: setting.sysmenu || '', - required: true, - options: [ - {value: 'AIService', label: '鏅鸿兘瀹㈡湇'}, - ] + type: 'text', + field: 'miniAppId', + label: '灏忕▼搴廇ppID', + initval: setting.miniAppId || '', + required: true + }, + { + type: 'text', + field: 'miniPath', + label: '椤甸潰璺緞', + initval: setting.miniPath || '', + tooltip: '鍙寚瀹氳烦杞皬绋嬪簭椤甸潰璺緞銆�', + required: false }, { type: 'select', field: 'copyMenuId', label: '澶嶅埗鑿滃崟', initval: setting.copyMenuId || '', - tooltip: '澶嶅埗鑿滃崟浠呭湪褰撳墠鑿滃崟鍒濆鍖栨椂鏈夋晥銆�', + tooltip: '澶嶅埗鑿滃崟浠呭湪褰撳墠鑿滃崟鍒涘缓鏃舵湁鏁堛��', required: false, - options: menulist + options: menulist, + extendName: 'MenuNo', + dropdown: 'false', + controlFields: [ + {field: 'clearMenu', notNull: true}, + ], + }, + { + type: 'radio', + field: 'clearMenu', + label: '娓呯┖鍏宠仈鑿滃崟', + initval: setting.clearMenu || 'true', + tooltip: '澶嶅埗鑿滃崟鏃讹紝鏄惁娓呯┖鍘熼〉闈腑鐨勫叧鑱旇彍鍗曘��', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'} + ] }, { type: 'select', @@ -84,14 +105,19 @@ label: '鍏宠仈鑿滃崟', initval: setting.linkMenuId || '', required: true, - options: menulist + extendName: 'MenuNo', + options: [ + ...menulist, + {value: 'AIService', label: '鏅鸿兘瀹㈡湇锛堢郴缁熼〉锛�'} + ] }, { type: 'textarea', field: 'linkurl', label: '閾炬帴', initval: setting.linkurl || '', - required: true + required: true, + span: 24 }, { type: 'radio', @@ -122,11 +148,22 @@ }, { type: 'number', + field: 'width', + label: '瀹藉害', + initval: setting.width || 24, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + min: 1, + max: 24, + precision: 0, + required: true + }, + { + type: 'number', field: 'iconFont', label: '瀛椾綋澶у皬', initval: setting.iconFont || 20, min: 12, - max: 200, + max: 300, precision: 0, required: true }, @@ -139,6 +176,13 @@ max: 200, precision: 0, required: true + }, + { + type: 'styleInput', + field: 'borderRadius', + label: '鍦嗚', + initval: setting.borderRadius || '15%', + required: false }, { type: 'color', @@ -172,6 +216,23 @@ precision: 0, required: false }, + { + type: 'select', + field: 'tip', + label: '鎻愮ず', + initval: setting.tip || '', + tooltip: '缁戝畾鎻愮ず瀛楁鍚庯紝浼氬湪鑿滃崟鍙充笂瑙掓樉绀虹孩鑹叉爣璁般��', + required: false, + options: columns + }, + { + type: 'text', + field: 'primaryId', + label: '闈欐�佷富閿��', + initval: setting.primaryId || '', + tooltip: '鍙綔涓築ID浼犲埌涓嬩竴椤甸潰銆傛敞锛欯userid@浼氭浛鎹负鐢ㄦ埛ID銆�', + required: false + } ] return menuWrapForm -- Gitblit v1.8.0