From cc1a76df575c18f0d0ee96e8658461efdce3a918 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 17 一月 2023 18:01:01 +0800 Subject: [PATCH] 2023-01-17 --- src/menu/components/card/data-card/options.jsx | 116 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 96 insertions(+), 20 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 18c7a2c..49358f7 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -1,20 +1,38 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, subtype, columns = [], id = '', supNodes = []) { +export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) { let appType = sessionStorage.getItem('appType') let MenuType = '' - let menu = fromJS(window.GLOB.customMenu).toJS() + let menu = window.GLOB.customMenu + let laypage = setting && setting.laypage !== 'false' + let interfaces = [] + if (subtype === 'propcard' && menu.interfaces) { + menu.interfaces.forEach(item => { + if (item.status === 'true') { + interfaces.push({ + value: item.uuid, + label: item.name + }) + } + }) + } if (menu.parentId === 'BillPrintTemp') { MenuType = 'billPrint' } let modules = [] if (subtype === 'propcard' || subtype === 'datacard') { - modules = MenuUtils.getSupModules(menu.components, id) || [] + modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) + + if (subtype === 'propcard' && 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 roleList = sessionStorage.getItem('sysRoles') @@ -81,14 +99,26 @@ options: [ {value: 'dynamic', label: '鍔ㄦ��', priKeyType: 'static'}, {value: 'static', label: '闈欐��', priKeyType: 'static'}, + {value: 'public', label: '鍏叡鏁版嵁婧�', priKeyType: 'static'}, ], linkFields: ['priKeyType'], controlFields: [ {field: 'goback', values: ['dynamic']}, - {field: 'empty', values: ['dynamic']}, + {field: 'empty', values: ['dynamic', 'public']}, {field: 'jump', values: ['dynamic']}, + {field: 'autoExec', values: ['dynamic']}, {field: 'supModule', values: ['static']}, + {field: 'publicId', values: ['public']}, ], + forbid: subtype !== 'propcard' + }, + { + type: 'select', + field: 'publicId', + label: '鏁版嵁婧�', + initval: wrap.publicId || '', + required: true, + options: interfaces, forbid: subtype !== 'propcard' }, { @@ -113,17 +143,19 @@ field: 'pagestyle', label: '鍒嗛〉椋庢牸', initval: wrap.pagestyle || 'page', - tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛�傛敞锛氭粦鍔ㄥ姞杞藉彧鏈夌涓�涓湁鏁�', + tooltip: '鏁版嵁婧愰�夋嫨鍒嗛〉鏃舵湁鏁堛�傛敞锛氬脊鎬у竷灞�鏃跺浐瀹氫负椤电爜銆�', required: false, + disabled: !laypage, options: [ {value: 'page', label: '椤电爜'}, - {value: 'switch', label: '宸﹀彸鍒囨崲', forbid: appType === 'mob'}, - {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob'}, + {value: 'switch', label: '宸﹀彸鍒囨崲', forbid: appType === 'mob' || subtype === 'tablecard'}, + {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'}, + {value: 'more', label: '鏌ョ湅鏇村'}, ], controlFields: [ {field: 'slidetip', values: ['slide']}, ], - forbid: !(subtype === 'datacard' || (subtype === 'tablecard' && appType === 'mob')) + forbid: subtype === 'propcard' }, { type: 'radio', @@ -157,22 +189,40 @@ {ParentID: 'dynamic', value: 'static', label: '闈欐�佸��'}, {ParentID: 'dynamic', value: 'dynamic', label: '鍔ㄦ�佸��'}, {ParentID: 'dynamic', value: 'joint', label: '鎷兼帴鍊�'}, + {ParentID: 'public', value: 'static', label: '闈欐�佸��'}, + {ParentID: 'public', value: 'dynamic', label: '鍔ㄦ�佸��'}, + {ParentID: 'public', value: 'joint', label: '鎷兼帴鍊�'}, ], forbid: subtype !== 'propcard' }, { + type: 'select', + field: 'selected', + label: '鏁版嵁閫変腑', + initval: wrap.selected || 'false', + tooltip: '鍒濆鍖栵細鏁版嵁鍔犺浇鏃堕�変腑棣栬鏁版嵁锛屼粎鎵ц涓�娆°�傛暟鎹姞杞斤細姣忔鏁版嵁鍔犺浇鏃跺潎閫変腑棣栬锛堝綋鎸夐挳鎵ц瀹屾垚骞惰繑鍥炰富閿�兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇锛夈�傞�変腑鏍囪锛氳繑鍥炴暟鎹腑瀛樺湪 selected 瀛楁锛屼笖鍊间负 true 鐨勬暟鎹閫変腑銆�', + required: false, + options: [ + {value: 'false', label: '鏃�'}, + {value: 'init', label: '鍒濆鍖�'}, + {value: 'always', label: '鏁版嵁鍔犺浇'}, + {value: 'sign', label: '閫変腑鏍囪'} + ], + forbid: subtype !== 'datacard' + }, + { type: 'radio', field: 'selected', - label: '棣栬閫変腑', + label: '鏁版嵁閫変腑', initval: wrap.selected || 'false', - tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�', + tooltip: '鍒濆鍖栵細鏁版嵁鍔犺浇鏃堕�変腑棣栬鏁版嵁锛屼粎鎵ц涓�娆°�傛暟鎹姞杞斤細姣忔鏁版嵁鍔犺浇鏃跺潎閫変腑棣栬銆�', required: false, options: [ {value: 'false', label: '鏃�'}, {value: 'init', label: '鍒濆鍖�'}, {value: 'always', label: '鏁版嵁鍔犺浇'}, ], - forbid: subtype === 'tablecard' + forbid: subtype !== 'propcard' }, { type: 'select', @@ -186,6 +236,7 @@ {value: 'active', label: '澶栭槾褰�'}, {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'}, {value: 'font', label: '鏂囧瓧'}, + {value: 'tabs', label: '鏍囩椤�'}, ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '鍕鹃��'}] : []) ], forbid: subtype === 'tablecard' @@ -267,15 +318,30 @@ { type: 'radio', field: 'goback', - label: '绌哄�艰繑鍥�', + label: appType === 'mob' ? '绌哄�艰繑鍥�' : '绌哄�煎叧闂�', initval: wrap.goback || 'false', - tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岃繑鍥炰笂涓�鐣岄潰銆�', + tooltip: appType === 'mob' ? '褰撴煡璇㈡暟鎹负绌烘椂锛岃繑鍥炰笂涓�鐣岄潰銆�' : '褰撴煡璇㈡暟鎹负绌烘椂锛屽叧闂綋鍓嶆爣绛鹃〉銆�', required: false, options: [ - {value: 'true', label: '鏄�'}, {value: 'false', label: '鍚�'}, + {value: 'true', label: '鏄�'}, ], - forbid: subtype !== 'propcard' || appType !== 'mob' + forbid: subtype !== 'propcard' || appType === 'pc' + }, + { + type: 'radio', + field: 'display', + label: '鏄剧ず鎺у埗', + initval: wrap.display || 'normal', + required: false, + options: [ + {value: 'normal', label: '姝e父鏄剧ず'}, + {value: 'hidden', label: '涓嶅彲瑙�'}, + ], + controlFields: [ + {field: 'empty', values: ['normal']}, + ], + forbid: subtype !== 'propcard' }, { type: 'radio', @@ -289,6 +355,16 @@ {value: 'show', label: '鍚�'}, {value: 'hidden', label: '鏄�'}, ], + }, + { + type: 'select', + field: 'autoExec', + label: '鑷姩鎵ц', + initval: wrap.autoExec || '', + tooltip: '鏁版嵁鏇存柊鏃惰嚜鍔ㄦ墽琛屾寜閽�傛敞锛氭鎸夐挳鎵ц鎴愬姛鍚庤皑鎱庨�夋嫨鍒锋柊椤癸紝閬垮厤閫犳垚寰幆鎵ц銆�', + required: false, + options: buttons, + forbid: subtype !== 'propcard' }, { type: 'radio', @@ -391,9 +467,9 @@ { type: 'text', field: 'controlVal', - label: '鎺у埗鍊�', + label: '绂佺敤鍊�', initval: wrap.controlVal || '', - tooltip: '褰撳瓧娈靛�间笌鎺у埗鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + tooltip: '褰撳瓧娈靛�间笌绂佺敤鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', required: false, forbid: subtype !== 'datacard' }, @@ -423,7 +499,7 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType + forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { type: 'multiselect', @@ -441,7 +517,7 @@ initval: wrap.slidetip || wrap.slidetip === '' ? wrap.slidetip : '娌℃湁鏇村浜�', tooltip: '婊戝姩鍔犺浇鑷冲簳閮ㄦ椂鐨勬彁绀轰俊鎭��', required: false, - forbid: appType !== 'mob' || subtype === 'propcard' + forbid: !laypage || appType !== 'mob' || subtype === 'propcard' }, { type: 'table', -- Gitblit v1.8.0