From a9b02f6862522b54d0824152017bf2acfec2af7b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 三月 2024 10:29:50 +0800 Subject: [PATCH] 2024-03-21 --- src/menu/components/table/normal-table/options.jsx | 272 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 217 insertions(+), 55 deletions(-) diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index 0d0e698..413b0cd 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -1,9 +1,11 @@ /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, action = []) { +export default function (wrap, action = [], columns = [], toolBtns) { 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 { @@ -32,10 +34,33 @@ required: true }, { + type: 'number', + field: 'width', + label: '瀹藉害', + initval: wrap.width || 24, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + min: 1, + max: 24, + precision: 0, + required: true + }, + { + type: 'number', + field: 'height', + label: '楂樺害', + initval: wrap.height || '', + tooltip: '琛ㄦ牸楂樺害锛岀┖鍊兼椂楂樺害鑷�傚簲銆傛敞锛氬皬浜庣瓑浜�100鏃朵负楂樺害鐨勭櫨鍒嗘瘮銆�', + min: 10, + max: 3000, + precision: 0, + required: false, + forbid: appType === 'mob' + }, + { type: 'radio', field: 'tableType', label: '琛ㄦ牸灞炴��', - initval: wrap.tableType, + initval: wrap.tableType || '', required: false, options: [ {value: '', label: '涓嶅彲閫�'}, @@ -48,6 +73,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', @@ -56,6 +92,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', @@ -78,18 +138,20 @@ {value: 'true', label: '鏄�'}, {value: 'false', label: '鍚�'}, ], - forbid: appType === 'mob' + forbid: appType === 'mob' || appType === 'pc' }, { type: 'radio', field: 'size', label: '琛ㄦ牸澶у皬', initval: wrap.size || 'middle', + tooltip: '琛ㄦ牸鐨勫唴杈硅窛锛屼粠澶у埌灏忎緷娆¢�掑噺銆�', required: false, options: [ {value: 'default', label: '澶�'}, {value: 'middle', label: '涓�'}, {value: 'small', label: '灏�'}, + {value: 'mini', label: '杩蜂綘'}, ] }, { @@ -104,18 +166,6 @@ ] }, { - type: 'radio', - field: 'selected', - label: '棣栬閫変腑', - initval: wrap.selected || 'false', - required: false, - options: [ - {value: 'false', label: '鏃�'}, - {value: 'init', label: '鍒濆鍖�'}, - {value: 'always', label: '鏁版嵁鍔犺浇'}, - ] - }, - { type: 'color', field: 'borderColor', label: '杈规棰滆壊', @@ -124,45 +174,31 @@ required: false }, { - 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 || 24, - min: 12, - max: 30, - precision: 0, - required: false - }, - { - type: 'number', - field: 'width', - label: '瀹藉害', - initval: wrap.width || 24, - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', - min: 1, - max: 24, - precision: 0, - required: true - }, - { - type: 'number', - field: 'advanceWidth', - label: '楂樼骇鎼滅储', - initval: wrap.advanceWidth || 1000, - tooltip: '楂樼骇鎼滅储寮圭獥鐨勫搴︼紝娉細褰撳搴﹀�煎皬浜�100鏃惰〃绀哄崰绐楀彛鐨勭櫨鍒嗘瘮锛屽ぇ浜�100鏃惰〃绀哄搴︾殑缁濆鍊笺��', - min: 10, - max: 3000, - precision: 0, + type: 'radio', + field: 'vertical', + label: '鍨傜洿瀵归綈', + initval: wrap.vertical || 'middle', + tooltip: '鍗曞厓鏍肩殑鍨傜洿瀵归綈鏂瑰紡銆�', required: false, - forbid: appType === 'mob' + options: [ + {value: 'top', label: '鍚戜笂'}, + {value: 'middle', label: '灞呬腑'}, + {value: 'bottom', 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: 'select', @@ -172,8 +208,134 @@ 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, + options: columns + }, + { + type: 'select', + field: 'controlField', + label: '绂佺敤瀛楁', + initval: wrap.controlField || '', + tooltip: '鐢ㄤ簬鎺у埗琛屾暟鎹槸鍚﹀彲閫夋嫨銆�', + required: false, + allowClear: true, + options: columns, + controlFields: [ + {field: 'controlVal', notNull: true}, + ] + }, + { + type: 'text', + field: 'controlVal', + label: '绂佺敤鍊�', + initval: wrap.controlVal || '', + tooltip: '褰撳瓧娈靛�间笌绂佺敤鍊肩浉绛夋椂锛岃鏁版嵁浼氱鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + 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: '绌哄�奸殣钘�', + initval: wrap.empty || 'show', + tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�', + required: false, + options: [ + {value: 'show', label: '鍚�'}, + {value: 'hidden', label: '鏄�'}, + ], + }, + { + type: 'radio', + field: 'supKey', + label: '涓婄骇涓婚敭', + initval: wrap.supKey || 'true', + tooltip: '褰撹缃笂绾х粍浠舵椂锛屼笂绾т富閿�间负绌烘槸鍚﹁繘琛屾暟鎹煡璇€��', + required: false, + options: [ + {value: 'true', label: '楠岃瘉'}, + {value: 'false', label: '蹇界暐'}, + ], + forbid: isprint + }, + { + 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: 'multiselect', @@ -182,7 +344,7 @@ initval: wrap.blacklist || [], required: false, options: roleList, - forbid: !!appType + forbid: !!appType || isprint }, ] -- Gitblit v1.8.0