From 47b9baefdeeb41f50a9b7abc1abcf5e90931a89d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 31 八月 2023 11:17:48 +0800 Subject: [PATCH] 2023-08-31 --- src/menu/components/card/data-card/options.jsx | 101 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 67 insertions(+), 34 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 0deb6b7..519af8e 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -5,7 +5,8 @@ */ export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) { let appType = sessionStorage.getItem('appType') - let MenuType = '' + let isprint = sessionStorage.getItem('MenuType') === 'billPrint' + let ispop = sessionStorage.getItem('editMenuType') === 'popview' let menu = window.GLOB.customMenu let laypage = setting && setting.laypage !== 'false' let interfaces = [] @@ -18,10 +19,6 @@ }) } }) - } - - if (menu.parentId === 'BillPrintTemp') { - MenuType = 'billPrint' } let modules = [] if (subtype === 'propcard' || subtype === 'datacard') { @@ -103,10 +100,10 @@ ], linkFields: ['priKeyType'], controlFields: [ - {field: 'goback', values: ['dynamic']}, + {field: 'goback', values: ['dynamic', 'public']}, {field: 'empty', values: ['dynamic', 'public']}, - {field: 'jump', values: ['dynamic']}, - {field: 'autoExec', values: ['dynamic']}, + {field: 'jump', values: ['dynamic', 'public']}, + {field: 'broadcast', values: ['dynamic', 'public']}, {field: 'supModule', values: ['static']}, {field: 'publicId', values: ['public']}, ], @@ -119,7 +116,42 @@ initval: wrap.publicId || '', required: true, options: interfaces, - forbid: subtype !== 'propcard' + reset_source: true, + forbid: subtype !== 'propcard', + 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 _broadcast = map.get('broadcast') + + if (_broadcast && !_broadcast.forbid) { + _broadcast.options = columns + _broadcast.oriOptions = columns + map.set('broadcast', _broadcast) + } + + let _jumpField = map.get('jumpField') + + if (_jumpField && !_jumpField.forbid) { + _jumpField.options = columns + _jumpField.oriOptions = columns + map.set('jumpField', _jumpField) + } + + let _link = map.get('link') + + if (_link && !_link.forbid) { + _link.options = columns + _link.oriOptions = columns + map.set('link', _link) + } + } }, { type: 'radio', @@ -149,7 +181,7 @@ options: [ {value: 'page', label: '椤电爜'}, {value: 'switch', label: '宸﹀彸鍒囨崲', forbid: appType === 'mob' || subtype === 'tablecard'}, - {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'}, + {value: 'slide', label: '婊戝姩鍔犺浇', forbid: appType !== 'mob' || ispop}, {value: 'more', label: '鏌ョ湅鏇村'}, ], controlFields: [ @@ -244,18 +276,6 @@ ], forbid: subtype === 'tablecard' }, - // { - // type: 'radio', - // field: 'checkAll', - // label: '鍏ㄩ��', - // initval: wrap.checkAll || 'hidden', - // required: false, - // options: [ - // {value: 'hidden', label: '闅愯棌'}, - // {value: 'show', label: '鏄剧ず'}, - // ], - // forbid: subtype !== 'datacard' || appType !== 'mob' - // }, { type: 'radio', field: 'cardFloat', @@ -301,16 +321,16 @@ field: 'printType', label: '缁勪欢绫诲瀷', initval: wrap.printType || 'content', - tooltip: '閫夋嫨绫诲瀷涓恒�婇〉鐪�/椤佃剼銆嬫椂锛屾墦鍗扮殑姣忛〉閲岄兘浼氬甫鏈夎缁勪欢銆�', + tooltip: '閫夋嫨绫诲瀷涓恒�婇〉鐪�/椤佃剼銆嬫椂锛屾墦鍗扮殑姣忛〉閲岄兘浼氬甫鏈夎缁勪欢銆傛敞锛氶〉鐪夐〉鑴氫腑鏂囨湰鍏冪礌灏嗘浛鎹� @pageIndex@锛堥〉鐮侊級銆丂total@锛堟�绘暟锛夈�丂date@锛堝綋鍓嶆棩鏈燂級銆丂datetime@锛堝綋鍓嶆椂闂达級锛屼娇鐢ㄥ垎椤靛弬鏁版椂娉ㄦ剰鎵撳嵃妯℃澘鐨勯〉闈㈠竷灞�浣跨敤鍒嗛〉銆�', required: false, options: [ - {value: 'content', label: '鍐呭'}, + {value: 'content', label: '灞炴�у崱'}, {value: 'headerOrfooter', label: '椤电湁/椤佃剼'}, ], controlFields: [ {field: 'printHeight', values: ['content']}, ], - forbid: subtype !== 'propcard' || MenuType !== 'billPrint' + forbid: subtype !== 'propcard' || !isprint }, { type: 'number', @@ -319,14 +339,14 @@ initval: wrap.printHeight || '', tooltip: subtype !== 'propcard' ? '褰撳墠鏁版嵁鍗¢珮搴︾浉褰撲簬鍑犳潯鏁版嵁銆�' : '褰撳墠灞炴�у崱楂樺害鐩稿綋浜庡嚑鏉℃暟鎹��', required: false, - forbid: subtype === 'tablecard' || MenuType !== 'billPrint' + forbid: subtype === 'tablecard' || !isprint }, { type: 'select', field: 'broadcast', label: '璇煶鎾姤', initval: wrap.broadcast || '', - tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧapp涓湁鏁堛�傛敞锛氫娇鐢ㄨ闊虫挱鎶ユ椂锛屾暟鎹簮涓嶈浣跨敤鍚屾鏌ヨ锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', + tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧ鏈夋晥銆傛敞锛氬湪H5涓浣跨敤闊抽閾炬帴锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', required: false, options: columns, forbid: !columns || appType !== 'mob' || subtype !== 'propcard' @@ -349,6 +369,7 @@ field: 'display', label: '鏄剧ず鎺у埗', initval: wrap.display || 'normal', + tooltip: '褰撲娇鐢ㄥ睘鎬у崱杩涜鏌愪簺涓氬姟鎿嶄綔锛屼笖涓嶉渶瑕佸睍绀哄崱鐗囦俊鎭椂锛屽彲璁剧疆涓轰笉鍙銆�', required: false, options: [ {value: 'normal', label: '姝e父鏄剧ず'}, @@ -467,7 +488,7 @@ {value: 'true', label: '楠岃瘉'}, {value: 'false', label: '蹇界暐'}, ], - forbid: subtype !== 'datacard' + forbid: subtype !== 'datacard' || isprint }, { type: 'cascader', @@ -477,7 +498,7 @@ required: false, options: modules, allowClear: true, - forbid: subtype !== 'propcard' + forbid: subtype !== 'propcard' || isprint }, { type: 'select', @@ -509,7 +530,7 @@ initval: wrap.supType || 'single', tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', required: false, - forbid: subtype !== 'datacard' || appType === 'mob', + forbid: subtype !== 'datacard' || appType === 'mob' || isprint, options: [ {value: 'single', label: '鍗曠粍浠�'}, {value: 'multi', label: '澶氱粍浠�'}, @@ -525,10 +546,22 @@ initval: wrap.permission || (!appType ? 'true' : 'false'), required: false, options: [ - {value: 'true', label: '鍚敤'}, + {value: 'true', label: !appType ? '缁ф壙鑿滃崟' : '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: sessionStorage.getItem('editMenuType') === 'popview' + forbid: ispop || isprint + }, + { + type: 'radio', + field: 'cacheLocal', + label: '鏈湴缂撳瓨', + initval: wrap.cacheLocal || 'true', + required: false, + options: [ + {value: 'true', label: '缁ф壙鑿滃崟'}, + {value: 'false', label: '绂佺敤'}, + ], + forbid: ispop || isprint }, { type: 'multiselect', @@ -537,7 +570,7 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, { type: 'text', @@ -554,7 +587,7 @@ label: '涓婄骇缁勪欢', initval: supNodes, required: true, - forbid: subtype !== 'datacard' || appType === 'mob', + forbid: subtype !== 'datacard' || appType === 'mob' || isprint, span: 24, columns: [ { -- Gitblit v1.8.0