From b6c698c8833836971184a0a9c2645a15f8174d37 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 08 五月 2025 16:31:18 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/table/normal-table/options.jsx | 354 ++++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 268 insertions(+), 86 deletions(-) diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index b876e95..62fd279 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -1,9 +1,13 @@ +import MenuUtils from '@/utils/utils-custom.js' + /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, action = [], columns = []) { +export default function (wrap, action = [], columns = [], toolBtns, supNodes, id = '') { let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') + let isprint = sessionStorage.getItem('MenuType') === 'billPrint' + let ispop = sessionStorage.getItem('editMenuType') === 'popview' if (roleList) { try { @@ -14,6 +18,9 @@ } else { roleList = [] } + + let menu = window.GLOB.customMenu + let modules = MenuUtils.getSupModules(menu.components, id, menu.interfaces) const wrapForm = [ { @@ -45,10 +52,10 @@ { type: 'number', field: 'height', - label: '楂樺害', + label: '鏈�澶ч珮搴�', initval: wrap.height || '', - tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆�', - min: 10, + tooltip: '琛ㄦ牸鍐呭鍖虹殑鏈�澶ч珮搴︼紙涓嶅寘鍚〃澶达級锛岀┖鍊兼椂楂樺害鑷�傚簲銆傛敞锛氬皬浜庣瓑浜�100澶т簬0鏃朵负楂樺害鐨勭櫨鍒嗘瘮锛屽皬浜�0鏃朵负绐楀彛楂樺害鍑忓幓姝ゅ�笺��', + min: -1000, max: 3000, precision: 0, required: false, @@ -71,6 +78,17 @@ }, { type: 'radio', + field: 'parity', + label: '濂囧伓寮傝壊', + initval: wrap.parity || 'false', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ] + }, + { + type: 'radio', field: 'bordered', label: '杈规', initval: wrap.bordered || 'true', @@ -79,6 +97,30 @@ {value: 'true', label: '鏈�'}, {value: 'false', label: '鏃�'}, ] + }, + { + type: 'radio', + field: 'actionfixed', + label: '鍥哄畾鎸夐挳', + initval: wrap.actionfixed !== 'true' ? 'false' : 'true', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + forbid: appType === 'mob' || appType === 'pc' + }, + { + type: 'checkbox', + field: 'colfixed', + label: '鍥哄畾鍒�', + initval: wrap.colfixed || [], + required: false, + options: [ + {value: 'first', label: '棣栧垪'}, + {value: 'last', label: '灏惧垪'}, + ], + forbid: appType === 'mob' || appType === 'pc' }, { type: 'radio', @@ -119,6 +161,19 @@ }, { type: 'radio', + field: 'searchSize', + label: '鎼滅储鏍峰紡', + initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '', + required: false, + options: [ + {value: '', label: '榛樿'}, + {value: 'small', label: '灏忛棿璺�'}, + {value: 'updown', label: '涓婁笅鎺掑垪'}, + ], + forbid: appType === 'mob' + }, + { + type: 'radio', field: 'mode', label: '妯″紡', initval: wrap.mode || 'default', @@ -128,45 +183,6 @@ {value: 'ghost', label: '閫忔槑'}, ] }, - { - 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: '閫変腑鏍囪'} - ], - }, - // { - // type: 'radio', - // field: 'selected', - // label: '棣栬閫変腑', - // initval: wrap.selected || 'false', - // tooltip: '褰撴寜閽墽琛屽畬鎴愬苟杩斿洖涓婚敭鍊兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇銆�', - // required: false, - // options: [ - // {value: 'false', label: '鏃�'}, - // {value: 'init', label: '鍒濆鍖�'}, - // {value: 'always', label: '鏁版嵁鍔犺浇'}, - // ] - // }, - // { - // type: 'radio', - // field: 'show', - // label: '鎼滅储鎸夐挳', - // initval: wrap.show || 'true', - // tooltip: '鎼滅储鏉′欢瀛樺湪鏃讹紝鍙�夋嫨鏄惁鏄剧ず鎼滅储鎸夐挳銆�', - // required: false, - // options: [ - // {value: 'true', label: '鏄剧ず'}, - // {value: 'false', label: '闅愯棌'}, - // ] - // }, { type: 'color', field: 'borderColor', @@ -188,47 +204,20 @@ {value: 'bottom', label: '鍚戜笅'}, ] }, - // { - // type: 'color', - // field: 'color', - // label: '瀛椾綋棰滆壊', - // initval: wrap.color || 'rgba(0, 0, 0, 0.65)', - // tooltip: '榛樿鍊� rgba(0, 0, 0, 0.65)銆�', - // required: false - // }, - // { - // type: 'number', - // field: 'fontSize', - // label: '瀛椾綋澶у皬', - // initval: wrap.fontSize || 14, - // min: 12, - // max: 30, - // precision: 0, - // required: false - // }, - // { - // type: 'number', - // field: 'advanceWidth', - // label: '楂樼骇鎼滅储', - // initval: wrap.advanceWidth || 1000, - // tooltip: '楂樼骇鎼滅储寮圭獥鐨勫搴︼紝娉細褰撳搴﹀�煎皬浜�100鏃惰〃绀哄崰绐楀彛鐨勭櫨鍒嗘瘮锛屽ぇ浜�100鏃惰〃绀哄搴︾殑缁濆鍊笺��', - // min: 10, - // max: 3000, - // precision: 0, - // required: false, - // forbid: appType === 'mob' - // }, { - type: 'number', - field: 'btnlimit', - label: '鎸夐挳闄愬埗', - initval: wrap.btnlimit || '', - tooltip: '鎸夐挳鏁伴噺闄愬埗锛岃秴鍑虹殑鎸夐挳浼氬湪鏇村涓笅鎷夋樉绀猴紝娉細鏇村涓殑鎸夐挳涓嶈缁戝畾鍙屽嚮浜嬩欢銆�', - min: 3, - max: 3000, - precision: 0, + type: 'select', + field: 'selected', + label: '鏁版嵁閫変腑', + initval: wrap.selected || 'false', + tooltip: '鍒濆鍖栵細鏁版嵁鍔犺浇鏃堕�変腑棣栬鏁版嵁锛屼粎鎵ц涓�娆°�傛暟鎹姞杞斤細姣忔鏁版嵁鍔犺浇鏃跺潎閫変腑棣栬锛堝綋鎸夐挳鎵ц瀹屾垚骞惰繑鍥炰富閿�兼椂锛岄粯璁ら�変腑涓婚敭鍊煎搴旇锛夈�傞�変腑鏍囪锛氳繑鍥炴暟鎹腑瀛樺湪 selected 瀛楁锛屼笖鍊间负 true 鐨勬暟鎹閫変腑銆傛湰鍦拌褰曪細鏁版嵁鍒锋柊鏃朵笂娆¤閫変腑鐨勮灏嗚嚜鍔ㄩ�変腑銆�', required: false, - forbid: appType !== '' + options: [ + {value: 'false', label: '鏃�'}, + {value: 'init', label: '鍒濆鍖�'}, + {value: 'always', label: '鏁版嵁鍔犺浇'}, + {value: 'sign', label: '閫変腑鏍囪'}, + {value: 'local', label: '鏈湴璁板綍'}, + ], }, { type: 'select', @@ -238,8 +227,28 @@ tooltip: '鍙屽嚮琛ㄦ牸涓锛岃Е鍙戠殑鎸夐挳銆�', required: false, allowClear: true, - options: action.map(item => ({value: item.uuid, label: item.label})), + options: [...toolBtns, ...action].map(item => ({value: item.uuid, label: item.label})), forbid: appType === 'mob' + }, + { + type: 'select', + field: 'autoExec', + label: '鑷姩鎵ц', + initval: wrap.autoExec || '', + tooltip: '鍒濆鍖栬嚜鍔ㄦ墽琛屾寜閽��', + required: false, + options: toolBtns.map(item => ({value: item.uuid, label: item.label})) + }, + { + type: 'select', + field: 'tipField', + label: '淇℃伅鎻愮ず', + initval: wrap.tipField || '', + tooltip: '榧犳爣鎮诞浜庤涓婃柟鏃剁殑鎻愮ず淇℃伅銆�', + required: false, + allowClear: true, + joint: true, + options: columns }, { type: 'select', @@ -249,6 +258,7 @@ tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�', required: false, allowClear: true, + joint: true, options: columns, controlFields: [ {field: 'controlVal', notNull: true}, @@ -263,6 +273,30 @@ required: false }, { + type: 'number', + field: 'btnlimit', + label: '鎸夐挳闄愬埗', + initval: wrap.btnlimit || '', + tooltip: '鎸夐挳鏁伴噺闄愬埗锛岃秴鍑虹殑鎸夐挳浼氬湪鏇村涓笅鎷夋樉绀猴紝娉細鏇村涓殑鎸夐挳涓嶈缁戝畾鍙屽嚮浜嬩欢銆�', + min: 3, + max: 3000, + precision: 0, + required: false, + forbid: appType !== '' || isprint + }, + { + type: 'number', + field: 'maxPageSize', + label: '姣忛〉鏈�澶ф暟', + initval: wrap.maxPageSize || '', + tooltip: '鍒嗛〉鏃舵瘡椤靛彲鏄剧ず鐨勬渶澶ф暟閲忋��', + min: 10, + max: 500, + precision: 0, + required: false, + forbid: appType === 'mob' + }, + { type: 'radio', field: 'empty', label: '绌哄�奸殣钘�', @@ -272,6 +306,21 @@ 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: '闅愯棌'}, ], }, { @@ -285,18 +334,121 @@ {value: 'true', label: '楠岃瘉'}, {value: 'false', label: '蹇界暐'}, ], + forbid: isprint + }, + { + type: 'radio', + field: 'supType', + label: '涓婄骇绫诲瀷', + initval: wrap.supType || 'single', + tooltip: '涓婄骇缁勪欢涓哄崟涓�缁勪欢鎴栧涓粍浠躲��', + required: false, + forbid: appType === 'mob' || isprint, + options: [ + {value: 'single', label: '鍗曠粍浠�'}, + {value: 'multi', label: '澶氱粍浠�'}, + ], + controlFields: [ + {field: 'supNodes', values: ['multi']}, + ] }, { type: 'radio', field: 'permission', label: '鏉冮檺楠岃瘉', - initval: wrap.permission || 'false', + 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 || sessionStorage.getItem('editMenuType') === 'popview' + forbid: !!appType || isprint + }, + { + type: 'radio', + field: 'tree', + label: '缁撴瀯鏍�', + initval: wrap.tree || 'false', + tooltip: '浣跨敤缁撴瀯鏍戞椂锛屾樉绀哄垪棣栧垪璇蜂娇鐢ㄦ枃鏈被鍨嬨��', + required: false, + options: [ + {value: 'true', label: '鍚敤'}, + {value: 'false', label: '绂佺敤'}, + ], + controlFields: [ + {field: 'valueField', values: ['true']}, + {field: 'parentField', values: ['true']}, + {field: 'mark', values: ['true']}, + {field: 'defOpen', values: ['true']}, + ], + forbid: appType === 'mob' || isprint + }, + { + type: 'select', + field: 'valueField', + label: '鍊煎瓧娈�', + initval: wrap.valueField || '', + tooltip: '鏁版嵁鍊煎瓧娈碉紝缁撴瀯鏍戜腑鑺傜偣ID鍊硷紝涓庝笂绾у瓧娈甸厤鍚堢粍缁囨暟鎹殑涓婁笅绾у叧绯汇��', + required: true, + options: columns, + forbid: appType === 'mob' || isprint + }, + { + type: 'select', + field: 'parentField', + label: '涓婄骇瀛楁', + initval: wrap.parentField || '', + tooltip: '涓婄骇瀛楁锛岀敤浜庣粍缁囨暟鎹殑涓婁笅绾у叧绯汇��', + required: true, + options: columns, + forbid: appType === 'mob' || isprint + }, + { + type: 'text', + field: 'mark', + label: '椤剁骇鏍囪瘑', + initval: wrap.mark || '', + tooltip: '涓婄骇瀛楁鍊间笌椤剁骇鏍囪瘑鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�', + required: false, + forbid: appType === 'mob' || isprint + }, + { + type: 'radio', + field: 'defOpen', + label: '榛樿灞曞紑', + initval: wrap.defOpen || '', + required: false, + options: [ + {value: '', label: '鏃�'}, + {value: 'topline', label: '棣栬'}, + {value: 'all', label: '鍏ㄩ儴'}, + ], + forbid: appType === 'mob' || isprint }, { type: 'multiselect', @@ -305,8 +457,38 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, + { + type: 'table', + field: 'supNodes', + label: '涓婄骇缁勪欢', + initval: supNodes, + required: true, + forbid: 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 wrapForm -- Gitblit v1.8.0