From 53b9fb93d0376eb02bb996935f1720b4e95cd897 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 12 十月 2022 14:41:06 +0800 Subject: [PATCH] 2022-10-12 --- src/menu/components/card/balcony/options.jsx | 89 +++++++++++++++++++++++++++++++++++++------- 1 files changed, 74 insertions(+), 15 deletions(-) diff --git a/src/menu/components/card/balcony/options.jsx b/src/menu/components/card/balcony/options.jsx index b1684a8..c39fa7b 100644 --- a/src/menu/components/card/balcony/options.jsx +++ b/src/menu/components/card/balcony/options.jsx @@ -1,3 +1,4 @@ +import React from 'react' import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' @@ -5,14 +6,29 @@ * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ export default function (wrap) { - let modules = MenuUtils.getLinkModules(fromJS(window.GLOB.customMenu).toJS().components) || [] - let supmodules = MenuUtils.getSupModules(fromJS(window.GLOB.customMenu).toJS().components, '') || [] + let menu = fromJS(window.GLOB.customMenu).toJS() + + let modules = MenuUtils.getLinkModules(menu.components) || [] + let supmodules = MenuUtils.getSupModules(menu.components, '') || [] let roleList = sessionStorage.getItem('sysRoles') + let appType = sessionStorage.getItem('appType') + + let interfaces = [] + if (menu.interfaces) { + menu.interfaces.forEach(item => { + if (item.status === 'true') { + interfaces.push({ + value: item.uuid, + label: item.name + }) + } + }) + } if (roleList) { try { roleList = JSON.parse(roleList) - } catch { + } catch (e) { roleList = [] } } else { @@ -49,14 +65,32 @@ options: [ {value: 'dynamic', label: '鍔ㄦ��'}, {value: 'static', label: '闈欐��'}, + {value: 'public', label: '鍏叡鏁版嵁婧�'}, + ], + controlFields: [ + {field: 'empty', values: ['dynamic']}, + {field: 'publicId', values: ['public']}, ] + }, + { + type: 'select', + field: 'publicId', + label: '鏁版嵁婧�', + initval: wrap.publicId || '', + required: true, + options: interfaces }, { type: 'radio', field: 'linkType', label: '鍙楁帶绫诲瀷', initval: wrap.linkType || 'static', - tooltip: '缁勪欢涓庡叾浠栫粍浠朵箣闂寸殑鎺у埗绫诲瀷锛岀嫭绔嬭〃绀轰笌鍏朵粬娌℃湁鍏宠仈銆�', + tooltip: <div> + <div>缁勪欢涓庡叾浠栫粍浠朵箣闂寸殑鎺у埗绫诲瀷: </div> + <div>1銆佺嫭绔嬭〃绀轰笌鍏朵粬缁勪欢娌℃湁鍏宠仈銆�</div> + <div>2銆佸悓姝ョ被鍨嬩腑鍏紡銆佹寜閽互鍙婂叏閫夊厓绱犳瘮杈冪壒娈婏紝鎿嶄綔鏁版嵁涓哄叾鍚屾缁勪欢鐨勬暟鎹��</div> + <div>3銆佷笂绾х被鍨嬮渶娣诲姞褰撳墠缁勪欢鐨勪笂绾х粍浠讹紝骞跺彲璁剧疆褰撳墠缁勪欢涓哄缁堟樉绀猴紝杩樻槸鍙湁鍦ㄤ笂绾х粍浠堕�夎鍚庢墠鏄剧ず銆�</div> + </div>, required: false, options: [ {value: 'static', label: '鐙珛'}, @@ -74,7 +108,8 @@ type: 'cascader', field: 'supModule', label: '涓婄骇缁勪欢', - initval: wrap.supModule || '', + initval: wrap.supModule || [], + // tooltip: '褰撲笂绾х粍浠朵笉瀛樺湪鎴栨病鏈夋潈闄愭椂锛屽綋鍓嶇粍浠朵笉鏄剧ず銆�', required: true, options: supmodules }, @@ -82,8 +117,8 @@ type: 'radio', field: 'supControl', label: '鏄剧ず鎺у埗', - tooltip: '褰撳墠缁勪欢鍦ㄤ富琛ㄩ�変腑琛屾椂鏄剧ず锛岃繕鏄缁堟樉绀恒��', initval: wrap.supControl || 'show', + tooltip: '褰撳墠缁勪欢鍦ㄤ富琛ㄩ�変腑琛屾椂鏄剧ず锛岃繕鏄缁堟樉绀恒��', required: false, options: [ {value: 'hidden', label: '閫夎'}, @@ -95,6 +130,7 @@ field: 'syncModule', label: '鍚屾缁勪欢', initval: wrap.syncModule || '', + tooltip: '褰撳悓姝ョ粍浠朵笉瀛樺湪鎴栨病鏈夋潈闄愭椂锛屽綋鍓嶇粍浠朵笉鏄剧ず銆�', required: true, options: modules }, @@ -115,20 +151,17 @@ field: 'position', label: '浣嶇疆', initval: wrap.position || 'relative', - tooltip: '浣跨敤鍥哄畾瀹氫綅鏃讹紝璇峰湪娴嬭瘯鐜涓煡鐪嬪畾浣嶆晥鏋溿��', + tooltip: '鐩稿瀹氫綅鏄浉瀵瑰叾姝e父浣嶇疆鐨勫亸绉伙紱缁濆瀹氫綅鏄浉瀵逛簬鍘熺粍浠剁殑鍋忕Щ锛屽師缁勪欢楂樺害鍙涓�0锛涘浐瀹氬畾浣嶆槸鐩稿浜庣獥鍙g殑浣嶇疆锛屽畾浣嶆晥鏋滄祴璇曠幆澧冧腑鏌ョ湅銆�', required: false, options: [ {value: 'relative', label: '鐩稿瀹氫綅'}, + {value: 'absolute', label: '缁濆瀹氫綅'}, {value: 'fixed', label: '鍥哄畾瀹氫綅'}, ], controlFields: [ {field: 'quick', values: ['fixed']}, - {field: 'top', values: ['fixed']}, - {field: 'right', values: ['fixed']}, - {field: 'bottom', values: ['fixed']}, - {field: 'left', values: ['fixed']}, - {field: 'realwidth', values: ['fixed']}, - {field: 'transform', values: ['fixed']}, + {field: 'realwidth', values: ['fixed', 'absolute']}, + {field: 'transform', values: ['fixed', 'absolute']}, ] }, { @@ -203,12 +236,38 @@ ] }, { + 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', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ], + forbid: !appType + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', - initval: wrap.blacklist || '', + initval: wrap.blacklist || [], required: false, - options: roleList + options: roleList, + forbid: !!appType }, ] -- Gitblit v1.8.0