From d4d2b680baff18f950da5e77463c1f0e26dbd567 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 四月 2025 10:10:25 +0800 Subject: [PATCH] 2025-04-03 --- src/menu/components/card/data-card/options.jsx | 344 +++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 250 insertions(+), 94 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 7f8f0cb..9b0aeec 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -1,27 +1,18 @@ -import MenuUtils from '@/utils/utils-custom.js' +import MenuUtils, { getInterfaces } from '@/utils/utils-custom.js' /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ 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 = [] - 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 interfaces = [] + if (subtype === 'propcard') { + interfaces = getInterfaces() } let modules = [] if (subtype === 'propcard' || subtype === 'datacard') { @@ -62,6 +53,74 @@ } } + let interaction = [] + let interOptions = [] + + if (wrap.scale === 'true') { + interaction.push('scale') + } + if (wrap.parity === 'true') { + interaction.push('parity') + } + if (wrap.hover === 'true') { + interaction.push('hover') + } + + if (subtype === 'datacard') { + interOptions = [ + {value: 'parity', label: '濂囧伓寮傝壊'}, + ] + if (appType !== 'mob') { + interOptions.push( + {value: 'hover', label: '鎮诞鍙樿壊'}, + {value: 'scale', label: '鎮诞鏀惧ぇ'} + ) + } + } else if (subtype === 'propcard' && appType !== 'mob') { + interOptions = [ + {value: 'scale', label: '鎮诞鏀惧ぇ'} + ] + } else if (subtype === 'tablecard') { + interOptions = [ + {value: 'parity', label: '濂囧伓寮傝壊'}, + ] + if (appType !== 'mob') { + interOptions.push( + {value: 'hover', label: '鎮诞鍙樿壊'} + ) + } + } + + if (interaction.length && interOptions.length) { + interaction = interaction.filter(m => interOptions.findIndex(cell => cell.value === m) > -1) + } + + // let interItem = null + + // if (interOptions.length === 1) { + // interItem = { + // type: 'radio', + // field: interOptions[0].value, + // label: interOptions[0].label, + // initval: interaction.length === 1 ? 'true' : 'false', + // required: false, + // options: [ + // {value: 'true', label: '鍚敤'}, + // {value: 'false', label: '绂佺敤'} + // ] + // } + // } else { + // interItem = { + // type: 'checkbox', + // field: 'interaction', + // label: '浜や簰鏁堟灉', + // initval: interaction, + // required: false, + // options: interOptions, + // forbid: interOptions.length === 0 + // } + // } + const cardWrapForm = [ { type: 'text', @@ -94,7 +153,7 @@ field: 'datatype', label: '鏁版嵁鏉ユ簮', initval: wrap.datatype || 'dynamic', - tooltip: '閫夋嫨闈欐�佸�硷紝鏃犻渶閰嶇疆鏁版嵁婧愩��', + tooltip: '閫夋嫨闈欐�佹椂锛屾棤闇�閰嶇疆鏁版嵁婧愶紝鍙睍绀轰笂绾х粍浠舵垨url鍙傛暟瀛楁銆�', required: false, options: [ {value: 'dynamic', label: '鍔ㄦ��', priKeyType: 'static'}, @@ -102,14 +161,15 @@ {value: 'public', label: '鍏叡鏁版嵁婧�', priKeyType: 'static'}, ], linkFields: ['priKeyType'], - controlFields: [ + controlFields: subtype === 'propcard' ? [ {field: 'goback', values: ['dynamic', 'public']}, {field: 'empty', values: ['dynamic', 'public']}, {field: 'jump', values: ['dynamic', 'public']}, {field: 'broadcast', values: ['dynamic', 'public']}, {field: 'supModule', values: ['static']}, {field: 'publicId', values: ['public']}, - ], + {field: 'emptyExec', values: ['dynamic', 'public']}, + ] : null, forbid: subtype !== 'propcard' }, { @@ -121,38 +181,17 @@ options: interfaces, reset_source: true, forbid: subtype !== 'propcard', - callback: (map, record) => { + callback: (record) => { if (!record.publicId) return - let interfaces = window.GLOB.customMenu.interfaces || [] - - let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0] + let d = interfaces.filter(m => m.value === record.publicId)[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) + return { + broadcast: d.columns, + jumpField: d.columns, + link: d.columns } } }, @@ -170,8 +209,21 @@ controlFields: subtype !== 'propcard' ? [ {field: 'printHeight', values: ['flex']}, {field: 'cardFloat', values: ['grid']}, + {field: 'zHeight', values: ['grid']}, ] : [{field: 'cardFloat', values: ['grid']}], forbid: subtype === 'tablecard' + }, + { + type: 'number', + field: 'zHeight', + label: '鏈�澶ч珮搴�', + initval: wrap.zHeight || '', + tooltip: '鍗$墖鍐呭鍖虹殑鏈�澶ч珮搴︼紙涓嶅寘鍚爣棰樸�佺炕椤电瓑鍏冪礌锛夛紝娣诲姞楂樺害鍚庣粍浠朵腑绗竴涓睘鎬у崱灏嗗浐瀹氫簬澶撮儴銆傛敞锛氬皬浜庣瓑浜�100澶т簬0鏃朵负楂樺害鐨勭櫨鍒嗘瘮锛屽皬浜�0鏃朵负绐楀彛楂樺害鍑忓幓姝ゅ�笺��', + min: -1000, + max: 3000, + precision: 0, + required: false, + forbid: subtype !== 'datacard' || appType === 'mob' }, { type: 'radio', @@ -184,11 +236,12 @@ 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: [ {field: 'slidetip', values: ['slide']}, + {field: 'maxPageSize', values: ['page']}, ], forbid: subtype === 'propcard' }, @@ -207,7 +260,7 @@ {field: 'checkAll', values: ['checkbox']}, {field: 'selected', values: ['radio', 'checkbox']}, {field: 'selStyle', values: ['radio', 'checkbox']}, - // {field: 'priKeyType', values: ['radio', 'checkbox']}, + {field: 'pickup', values: ['radio', 'checkbox']}, ], forbid: subtype === 'tablecard' }, @@ -220,12 +273,10 @@ required: false, linkField: 'datatype', options: [ - {ParentID: 'static', value: 'static', label: '闈欐�佸��'}, - {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: '', value: 'static', label: '闈欐�佸��'}, + {ParentID: 'dynamic', value: 'joint', label: '鎷兼帴鍊�'}, {ParentID: 'public', value: 'joint', label: '鎷兼帴鍊�'}, ], forbid: subtype !== 'propcard' @@ -263,13 +314,14 @@ type: 'select', field: 'selStyle', label: '閫変腑椋庢牸', - initval: wrap.selStyle || 'active', + initval: wrap.selStyle || 'none', tooltip: '瀛樺湪杈规鏃讹紝杈规浼氫娇鐢ㄧ郴缁熻壊銆�', required: false, options: [ {value: 'none', label: '鏃�'}, {value: 'active', label: '澶栭槾褰�'}, - {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'}, + {value: 'backFont', label: '鑳屾櫙锛堟祬锛�+鏂囧瓧锛堟繁锛�'}, + {value: 'deepBackFont', label: '鑳屾櫙锛堟繁锛�+鏂囧瓧锛堟祬锛�'}, {value: 'font', label: '鏂囧瓧'}, {value: 'tabs', label: '鏍囩椤�'}, ...(subtype === 'datacard' ? [ @@ -295,29 +347,38 @@ }, { type: 'radio', - field: 'scale', - label: '鏀惧ぇ鏁堟灉', - initval: wrap.scale || 'false', - tooltip: '榧犳爣鎮诞浜庡崱鐗囦笂鏂规椂锛屽崱鐗囨斁澶�1.05鍊嶃��', + field: 'pickup', + label: '鏀惰捣寮�鍏�', + initval: wrap.pickup || 'false', + tooltip: '鏁版嵁鍗″彸涓婅浼氭樉绀烘敹璧峰紑鍏炽��', required: false, options: [ {value: 'false', label: '鏃�'}, {value: 'true', label: '鏈�'}, ], - forbid: subtype === 'tablecard' || appType === 'mob' + forbid: subtype !== 'datacard' || appType === 'mob' }, + // { + // type: 'radio', + // field: 'scale', + // label: '鏀惧ぇ鏁堟灉', + // initval: wrap.scale || 'false', + // tooltip: '榧犳爣鎮诞浜庡崱鐗囦笂鏂规椂锛屽崱鐗囨斁澶�1.05鍊嶃��', + // required: false, + // options: [ + // {value: 'false', label: '鏃�'}, + // {value: 'true', label: '鏈�'}, + // ], + // forbid: subtype === 'tablecard' || appType === 'mob' + // }, { - type: 'radio', - field: 'parity', - label: '濂囧伓鑳屾櫙', - initval: wrap.parity || 'false', - tooltip: '鍋舵暟琛屼細娣诲姞鑳屾櫙鑹层��', + type: 'checkbox', + field: 'interaction', + label: '浜や簰鏁堟灉', + initval: interaction, required: false, - options: [ - {value: 'false', label: '鏃�'}, - {value: 'true', label: '鏈�'}, - ], - forbid: subtype === 'propcard' + options: interOptions, + forbid: interOptions.length === 0 }, { type: 'radio', @@ -333,7 +394,7 @@ controlFields: [ {field: 'printHeight', values: ['content']}, ], - forbid: subtype !== 'propcard' || MenuType !== 'billPrint' + forbid: subtype !== 'propcard' || !isprint }, { type: 'number', @@ -342,7 +403,7 @@ initval: wrap.printHeight || '', tooltip: subtype !== 'propcard' ? '褰撳墠鏁版嵁鍗¢珮搴︾浉褰撲簬鍑犳潯鏁版嵁銆�' : '褰撳墠灞炴�у崱楂樺害鐩稿綋浜庡嚑鏉℃暟鎹��', required: false, - forbid: subtype === 'tablecard' || MenuType !== 'billPrint' + forbid: subtype === 'tablecard' || !isprint }, { type: 'select', @@ -350,6 +411,7 @@ label: '璇煶鎾姤', initval: wrap.broadcast || '', tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧ鏈夋晥銆傛敞锛氬湪H5涓浣跨敤闊抽閾炬帴锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', + timestamp: new Date().getTime(), required: false, options: columns, forbid: !columns || appType !== 'mob' || subtype !== 'propcard' @@ -378,9 +440,9 @@ {value: 'normal', label: '姝e父鏄剧ず'}, {value: 'hidden', label: '涓嶅彲瑙�'}, ], - controlFields: [ + controlFields: subtype === 'propcard' ? [ {field: 'empty', values: ['normal']}, - ], + ] : null, forbid: subtype !== 'propcard' }, { @@ -390,21 +452,62 @@ initval: wrap.empty || 'show', tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', required: false, - skip: true, options: [ {value: 'show', label: '鍚�'}, {value: 'hidden', label: '鏄�'}, ], + controlFields: [ + {field: 'empSign', values: ['show']}, + ] + }, + { + type: 'radio', + field: 'empSign', + label: '绌哄�煎浘鏍�', + initval: wrap.empSign || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛屾槸鍚︽樉绀虹┖鍊兼彁绀哄浘鏍囥��', + required: false, + options: [ + {value: 'show', label: '鏄剧ず'}, + {value: 'hidden', label: '闅愯棌'}, + ], + forbid: subtype === 'propcard' }, { type: 'select', field: 'autoExec', label: '鑷姩鎵ц', initval: wrap.autoExec || '', - tooltip: '鏁版嵁鏇存柊鏃惰嚜鍔ㄦ墽琛屾寜閽�傛敞锛氭鎸夐挳鎵ц鎴愬姛鍚庤皑鎱庨�夋嫨鍒锋柊椤癸紝閬垮厤閫犳垚寰幆鎵ц銆�', + tooltip: subtype === 'propcard' ? '鏁版嵁鏇存柊鏃惰嚜鍔ㄦ墽琛屾寜閽�傛敞锛氭鎸夐挳鎵ц鎴愬姛鍚庤皑鎱庨�夋嫨鍒锋柊椤癸紝閬垮厤閫犳垚寰幆鎵ц銆�' : '鍒濆鍖栬嚜鍔ㄦ墽琛屾寜閽��', required: false, options: buttons, + forbid: subtype !== 'propcard' && subtype !== 'datacard', + controlFields: [ + {field: 'emptyExec', notNull: true}, + {field: 'execDelay', notNull: true}, + ] + }, + { + type: 'number', + field: 'execDelay', + label: '鎵ц寤舵椂', + initval: wrap.execDelay, + tooltip: '鑷姩鎵ц鎸夐挳鐨勫欢鏃舵墽琛屾椂闂达紝鍗曚綅姣銆�', + required: false, forbid: subtype !== 'propcard' + }, + { + type: 'radio', + field: 'emptyExec', + label: '绌哄�兼墽琛�', + initval: wrap.emptyExec || 'true', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岃嚜鍔ㄦ墽琛屾寜閽槸鍚︽墽琛屻��', + required: false, + forbid: subtype !== 'propcard', + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], }, { type: 'radio', @@ -420,7 +523,6 @@ ], controlFields: [ {field: 'jumpField', values: ['menu', 'link']}, - {field: 'joint', values: ['menu', 'link']}, {field: 'open', values: ['menu', 'link']}, {field: 'menu', values: ['menu']}, {field: 'link', values: ['link']}, @@ -433,6 +535,7 @@ label: '鎺у埗瀛楁', initval: wrap.jumpField || '', tooltip: '褰撳瓧娈靛�间负true鏃惰Е鍙戣烦杞��', + timestamp: new Date().getTime(), required: true, options: columns, forbid: subtype !== 'propcard' || appType !== 'mob' @@ -452,20 +555,9 @@ label: '閾炬帴瀛楁', initval: wrap.link || '', tooltip: '璺宠浆閾炬帴涓烘煡璇㈡暟鎹殑杩斿洖鍊笺��', + timestamp: new Date().getTime(), required: true, options: columns, - forbid: subtype !== 'propcard' || appType !== 'mob' - }, - { - type: 'radio', - field: 'joint', - label: '鍙傛暟鎷兼帴', - initval: wrap.joint || 'true', - required: false, - options: [ - {value: 'true', label: '鏄�'}, - {value: 'false', label: '鍚�'}, - ], forbid: subtype !== 'propcard' || appType !== 'mob' }, { @@ -491,7 +583,7 @@ {value: 'true', label: '楠岃瘉'}, {value: 'false', label: '蹇界暐'}, ], - forbid: subtype !== 'datacard' + forbid: subtype !== 'datacard' || isprint }, { type: 'cascader', @@ -501,7 +593,7 @@ required: false, options: modules, allowClear: true, - forbid: subtype !== 'propcard' + forbid: subtype !== 'propcard' || isprint }, { type: 'select', @@ -511,6 +603,7 @@ tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�', required: false, allowClear: true, + joint: true, options: columns, controlFields: [ {field: 'controlVal', notNull: true}, @@ -533,7 +626,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: '澶氱粍浠�'}, @@ -549,10 +642,72 @@ initval: wrap.permission || (!appType ? 'true' : 'false'), required: false, options: [ + {value: 'true', label: !appType ? '缁ф壙鑿滃崟' : '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ], + 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: 'radio', + field: 'cacheSearch', + label: '鎼滅储缂撳瓨', + initval: wrap.cacheSearch || 'false', + tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�', + required: false, + options: [ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: sessionStorage.getItem('editMenuType') === 'popview' + forbid: !!appType || subtype === 'propcard' || isprint + }, + { + type: 'radio', + field: 'searchBtn', + label: '鎼滅储鎸夐挳', + initval: wrap.searchBtn || 'hidden', + required: false, + options: [ + {value: 'hidden', label: '闅愯棌'}, + {value: 'show', label: '鏄剧ず'}, + ], + forbid: appType === 'mob' || subtype === 'propcard' || isprint, + }, + { + type: 'radio', + field: 'shifting', + label: '鎸夐挳鍋忕Щ', + initval: wrap.shifting || 'false', + tooltip: '鍚敤鏃讹紝宸ュ叿鏍忔寜閽皢鏄剧ず鍦ㄦ爣棰樻爮鍙充笂瑙掋��', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ], + forbid: !!appType || subtype !== 'datacard' || isprint + }, + { + type: 'number', + field: 'maxPageSize', + label: '姣忛〉鏈�澶ф暟', + initval: wrap.maxPageSize || '', + tooltip: '鍒嗛〉鏃舵瘡椤靛彲鏄剧ず鐨勬渶澶ф暟閲忋��', + min: 10, + max: 500, + precision: 0, + required: false, + forbid: !laypage || appType === 'mob' || subtype !== 'datacard' }, { type: 'multiselect', @@ -561,7 +716,7 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, { type: 'text', @@ -578,8 +733,9 @@ label: '涓婄骇缁勪欢', initval: supNodes, required: true, - forbid: subtype !== 'datacard' || appType === 'mob', + forbid: subtype !== 'datacard' || appType === 'mob' || isprint, span: 24, + actions: ['edit', 'del', 'add', 'move'], columns: [ { title: '搴忓彿', @@ -589,7 +745,7 @@ width: '20%' }, { - title: '鑿滃崟', + title: '缁勪欢', dataIndex: 'nodes', inputType: 'cascader', editable: true, -- Gitblit v1.8.0