From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 五月 2024 10:56:41 +0800 Subject: [PATCH] 2024-05-16 --- src/menu/components/card/data-card/options.jsx | 579 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 515 insertions(+), 64 deletions(-) diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 6288dce..91f71f7 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -1,20 +1,35 @@ -import { fromJS } from 'immutable' import MenuUtils from '@/utils/utils-custom.js' /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, subtype, columns = [], id = '') { +export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) { let appType = sessionStorage.getItem('appType') - let MenuType = '' - let menu = fromJS(window.GLOB.customMenu).toJS() - - if (menu.parentId === 'BillPrintTemp') { - MenuType = 'billPrint' + 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 + }) + } + }) } let modules = [] - if (subtype === 'propcard') { - modules = MenuUtils.getSupModules(menu.components, id) || [] + if (subtype === 'propcard' || subtype === 'datacard') { + 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') @@ -28,6 +43,89 @@ } else { roleList = [] } + + let menulist = [] + + if (appType === 'mob') { + menulist = sessionStorage.getItem('appMenus') + if (menulist) { + try { + menulist = JSON.parse(menulist) + } catch (e) { + menulist = [] + } + } else { + menulist = [] + } + } + + 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 = [ { @@ -66,27 +164,100 @@ options: [ {value: 'dynamic', label: '鍔ㄦ��', priKeyType: 'static'}, {value: 'static', label: '闈欐��', priKeyType: 'static'}, + {value: 'public', label: '鍏叡鏁版嵁婧�', priKeyType: 'static'}, ], linkFields: ['priKeyType'], controlFields: [ - {field: 'goback', values: ['dynamic']}, + {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']}, ], forbid: subtype !== 'propcard' + }, + { + type: 'select', + field: 'publicId', + label: '鏁版嵁婧�', + initval: wrap.publicId || '', + required: true, + options: interfaces, + 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', + field: 'layout', + label: '鍗$墖甯冨眬', + initval: wrap.layout || 'grid', + tooltip: appType === 'mob' ? '寮规�у竷灞�鏃讹紝婊戝姩鍔犺浇鏃犳晥' : '寮规�у竷灞�鏃讹紝宸﹀彸鍒囨崲鏃犳晥', + required: false, + options: [ + {value: 'grid', label: '鏍呮牸甯冨眬'}, + {value: 'flex', label: '寮规�у竷灞�'}, + ], + controlFields: subtype !== 'propcard' ? [ + {field: 'printHeight', values: ['flex']}, + {field: 'cardFloat', values: ['grid']}, + ] : [{field: 'cardFloat', values: ['grid']}], + forbid: subtype === 'tablecard' }, { type: 'radio', 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' || ispop}, + {value: 'more', label: '鏌ョ湅鏇村'}, ], - forbid: !(subtype === 'datacard' || (subtype === 'tablecard' && appType === 'mob')) + controlFields: [ + {field: 'slidetip', values: ['slide']}, + {field: 'maxPageSize', values: ['page']}, + ], + forbid: subtype === 'propcard' }, { type: 'radio', @@ -103,7 +274,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' }, @@ -120,33 +291,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: 'radio', + type: 'select', field: 'selected', - label: '棣栬閫変腑', + 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: 'supType', - label: '涓婄骇绫诲瀷', - initval: wrap.supType || 'single', - tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', + field: 'selected', + label: '鏁版嵁閫変腑', + initval: wrap.selected || 'false', + tooltip: '鍒濆鍖栵細鏁版嵁鍔犺浇鏃堕�変腑棣栬鏁版嵁锛屼粎鎵ц涓�娆°�傛暟鎹姞杞斤細姣忔鏁版嵁鍔犺浇鏃跺潎閫変腑棣栬銆�', required: false, - forbid: subtype !== 'datacard' || appType === 'mob', options: [ - {value: 'single', label: '鍗曠粍浠�'}, - {value: 'multi', label: '澶氱粍浠�'}, - ] + {value: 'false', label: '鏃�'}, + {value: 'init', label: '鍒濆鍖�'}, + {value: 'always', label: '鏁版嵁鍔犺浇'}, + ], + forbid: subtype !== 'propcard' }, { type: 'select', @@ -158,30 +336,23 @@ options: [ {value: 'none', label: '鏃�'}, {value: 'active', label: '澶栭槾褰�'}, - {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'}, + {value: 'backFont', label: '鑳屾櫙锛堟祬锛�+鏂囧瓧锛堟繁锛�'}, + {value: 'deepBackFont', label: '鑳屾櫙锛堟繁锛�+鏂囧瓧锛堟祬锛�'}, {value: 'font', label: '鏂囧瓧'}, - ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '鍕鹃��'}] : []) - ] - // forbid: subtype !== 'propcard' + {value: 'tabs', label: '鏍囩椤�'}, + ...(subtype === 'datacard' ? [ + {value: 'check', label: '鍕鹃�夛紙鍦嗘锛�'}, + {value: 'check square', label: '鍕鹃�夛紙鏂规锛�'} + ] : []) + ], + 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', label: '瀵归綈鏂瑰紡', initval: wrap.cardFloat || 'left', - tooltip: '璁剧疆涓哄眳涓榻愭垨鍙冲榻愶紝鍙湪鍗$墖涓�1琛屾椂鏈夋晥銆�', + tooltip: '璁剧疆鍗$墖鐨勫榻愭柟寮忋��', required: false, options: [ {value: 'left', label: '宸﹀榻�'}, @@ -192,52 +363,102 @@ }, { 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: 'checkbox', + field: 'interaction', + label: '浜や簰鏁堟灉', + initval: interaction, + required: false, + options: interOptions, + forbid: interOptions.length === 0 }, { type: 'radio', 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: '椤电湁/椤佃剼'}, ], - forbid: subtype !== 'propcard' || MenuType !== 'billPrint' + controlFields: [ + {field: 'printHeight', values: ['content']}, + ], + forbid: subtype !== 'propcard' || !isprint + }, + { + type: 'number', + field: 'printHeight', + label: '鎹㈢畻楂樺害', + initval: wrap.printHeight || '', + tooltip: subtype !== 'propcard' ? '褰撳墠鏁版嵁鍗¢珮搴︾浉褰撲簬鍑犳潯鏁版嵁銆�' : '褰撳墠灞炴�у崱楂樺害鐩稿綋浜庡嚑鏉℃暟鎹��', + required: false, + forbid: subtype === 'tablecard' || !isprint }, { type: 'select', field: 'broadcast', label: '璇煶鎾姤', initval: wrap.broadcast || '', - tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧapp涓湁鏁堛�傛敞锛氫娇鐢ㄨ闊虫挱鎶ユ椂锛屾暟鎹簮涓嶈浣跨敤鍚屾鏌ヨ锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', + tooltip: '璇煶鎾姤鍦ㄧЩ鍔ㄧ鏈夋晥銆傛敞锛氬湪H5涓浣跨敤闊抽閾炬帴锛屾坊鍔犲畾鏃跺櫒鏃讹紝鍙惊鐜挱鎶�', required: false, options: columns, - forbid: !columns || appType !== 'mob' + forbid: !columns || appType !== 'mob' || subtype !== 'propcard' }, { 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', + tooltip: '褰撲娇鐢ㄥ睘鎬у崱杩涜鏌愪簺涓氬姟鎿嶄綔锛屼笖涓嶉渶瑕佸睍绀哄崱鐗囦俊鎭椂锛屽彲璁剧疆涓轰笉鍙銆�', + required: false, + options: [ + {value: 'normal', label: '姝e父鏄剧ず'}, + {value: 'hidden', label: '涓嶅彲瑙�'}, + ], + controlFields: [ + {field: 'empty', values: ['normal']}, + ], + forbid: subtype !== 'propcard' }, { type: 'radio', @@ -246,11 +467,111 @@ initval: wrap.empty || 'show', tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', required: false, + skip: true, options: [ {value: 'show', label: '鍚�'}, {value: 'hidden', label: '鏄�'}, ], - forbid: subtype !== 'datacard' + }, + { + type: 'select', + field: 'autoExec', + label: '鑷姩鎵ц', + initval: wrap.autoExec || '', + tooltip: subtype === 'propcard' ? '鏁版嵁鏇存柊鏃惰嚜鍔ㄦ墽琛屾寜閽�傛敞锛氭鎸夐挳鎵ц鎴愬姛鍚庤皑鎱庨�夋嫨鍒锋柊椤癸紝閬垮厤閫犳垚寰幆鎵ц銆�' : '鍒濆鍖栬嚜鍔ㄦ墽琛屾寜閽��', + required: false, + options: buttons, + forbid: subtype !== 'propcard' && subtype !== 'datacard', + controlFields: [ + {field: 'emptyExec', notNull: true}, + ] + }, + { + type: 'radio', + field: 'emptyExec', + label: '绌哄�兼墽琛�', + initval: wrap.emptyExec || 'true', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岃嚜鍔ㄦ墽琛屾寜閽槸鍚︽墽琛屻��', + required: false, + forbid: subtype !== 'propcard', + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + }, + { + type: 'radio', + field: 'jump', + label: '椤甸潰璺宠浆', + initval: wrap.jump || '', + tooltip: '閫氳繃鏌ヨ杩斿洖鍊煎垽鏂〉闈㈡槸鍚﹁璺宠浆銆�', + required: false, + options: [ + {value: '', label: '鏃�'}, + {value: 'menu', label: '鑿滃崟'}, + {value: 'link', label: '閾炬帴'}, + ], + controlFields: [ + {field: 'jumpField', values: ['menu', 'link']}, + {field: 'open', values: ['menu', 'link']}, + {field: 'menu', values: ['menu']}, + {field: 'link', values: ['link']}, + ], + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'select', + field: 'jumpField', + label: '鎺у埗瀛楁', + initval: wrap.jumpField || '', + tooltip: '褰撳瓧娈靛�间负true鏃惰Е鍙戣烦杞��', + required: true, + options: columns, + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'select', + field: 'menu', + label: '鑿滃崟', + initval: wrap.menu || '', + required: true, + options: menulist, + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'select', + field: 'link', + label: '閾炬帴瀛楁', + initval: wrap.link || '', + tooltip: '璺宠浆閾炬帴涓烘煡璇㈡暟鎹殑杩斿洖鍊笺��', + required: true, + options: columns, + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'radio', + field: 'open', + label: '鎵撳紑鏂瑰紡', + initval: wrap.open || 'blank', + required: false, + options: [ + {value: 'blank', label: '鏂扮獥鍙�'}, + {value: 'self', label: '褰撳墠绐楀彛'}, + ], + forbid: subtype !== 'propcard' || appType !== 'mob' + }, + { + type: 'radio', + field: 'supKey', + label: '涓婄骇涓婚敭', + initval: wrap.supKey || 'true', + tooltip: '褰撹缃笂绾х粍浠舵椂锛屼笂绾т富閿�间负绌烘槸鍚﹁繘琛屾暟鎹煡璇€��', + required: false, + options: [ + {value: 'true', label: '楠岃瘉'}, + {value: 'false', label: '蹇界暐'}, + ], + forbid: subtype !== 'datacard' || isprint }, { type: 'cascader', @@ -260,7 +581,7 @@ required: false, options: modules, allowClear: true, - forbid: subtype !== 'propcard' + forbid: subtype !== 'propcard' || isprint }, { type: 'select', @@ -279,11 +600,102 @@ { type: 'text', field: 'controlVal', - label: '鎺у埗鍊�', + label: '绂佺敤鍊�', initval: wrap.controlVal || '', - tooltip: '褰撳瓧娈靛�间笌鎺у埗鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + tooltip: '褰撳瓧娈靛�间笌绂佺敤鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', required: false, forbid: subtype !== 'datacard' + }, + { + type: 'radio', + field: 'supType', + label: '涓婄骇绫诲瀷', + initval: wrap.supType || 'single', + tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', + required: false, + forbid: subtype !== 'datacard' || appType === 'mob' || isprint, + options: [ + {value: 'single', label: '鍗曠粍浠�'}, + {value: 'multi', label: '澶氱粍浠�'}, + ], + controlFields: [ + {field: 'supNodes', values: ['multi']}, + ] + }, + { + type: 'radio', + field: 'permission', + label: '鏉冮檺楠岃瘉', + 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: !!appType || isprint + }, + { + type: 'radio', + field: 'searchBtn', + label: '鎼滅储鎸夐挳', + initval: wrap.searchBtn || 'hidden', + // tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�', + required: false, + options: [ + {value: 'hidden', label: '闅愯棌'}, + {value: 'show', label: '鏄剧ず'}, + ], + forbid: appType === 'mob' || 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', @@ -292,15 +704,54 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, + { + type: 'text', + field: 'slidetip', + label: '搴曢儴鎻愮ず', + initval: wrap.slidetip || wrap.slidetip === '' ? wrap.slidetip : '娌℃湁鏇村浜�', + tooltip: '婊戝姩鍔犺浇鑷冲簳閮ㄦ椂鐨勬彁绀轰俊鎭��', + required: false, + forbid: !laypage || appType !== 'mob' || subtype === 'propcard' + }, + { + type: 'table', + field: 'supNodes', + label: '涓婄骇缁勪欢', + initval: supNodes, + required: true, + forbid: subtype !== 'datacard' || appType === 'mob' || isprint, + span: 24, + actions: ['edit', 'del', 'add', 'move'], + columns: [ + { + title: '搴忓彿', + dataIndex: '$index', + editable: false, + required: false, + width: '20%' + }, + { + title: '缁勪欢', + dataIndex: 'nodes', + inputType: 'cascader', + editable: true, + required: true, + extends: [{key: 'label', value: 'label'}], + width: '50%', + render: (text, record) => record.label, + options: modules + } + ] + } ] - return cardWrapForm.map(item => { + return cardWrapForm.filter(item => { if (['pagestyle'].includes(item.field)) { item.options = item.options.filter(option => !option.forbid) } - return item + return !item.forbid }) } \ No newline at end of file -- Gitblit v1.8.0