From 891f462e34c90372b8cb97e215bb9858839dc232 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 十月 2023 15:51:12 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/formconfig.jsx | 2165 ---------------------------------------------------------- 1 files changed, 0 insertions(+), 2,165 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index a6170ab..7cd8e72 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1,287 +1,4 @@ import React from 'react' -import { formRule, btnClasses } from '@/utils/option.js' - -/** - * @description 鑾峰彇鏍戝舰椤甸潰璁剧疆琛ㄥ崟閰嶇疆淇℃伅 - * @param {object} setting // 鑿滃崟鍏ㄥ眬璁剧疆淇℃伅 - * @param {array} usefulFields // 鍙敤寮�濮嬪瓧绗� - * @param {string} MenuID // 鑿滃崟ID - */ -export function getTreeSettingForm (setting, usefulFields = [], MenuID) { - let str = '^(' + usefulFields.join('|') + ')' - let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') - let rules = [{ - max: formRule.func.max, - message: formRule.func.maxMessage - }] - - if (usefulFields.length > 0) { - rules.push({ - pattern: _patten, - message: formRule.func.innerMessage - }) - } - - return [ - { - type: 'text', - key: 'tableName', - label: '琛ㄥ悕', - initVal: setting.tableName || '', - required: true, - readonly: false, - rules: [ - { - max: formRule.input.max, - message: formRule.input.message - } - ] - }, - { - type: 'text', - key: 'title', - label: '鏍囬', - initVal: setting.title || '', - required: true, - readonly: false, - rules: [ - { - max: formRule.input.max, - message: formRule.input.message - } - ] - }, - { - type: 'radio', - key: 'interType', - label: '鎺ュ彛绫诲瀷', - initVal: setting.interType || 'inner', - required: false, - readonly: false, - options: [ - { value: 'inner', text: '鍐呴儴' }, - { value: 'outer', text: '澶栭儴' } - ] - }, - { - type: 'radio', - key: 'sysInterface', - label: '绯荤粺鎺ュ彛', - initVal: setting.sysInterface || 'false', - tooltip: '鍗曠偣鐧诲綍绯荤粺', - required: false, - readonly: false, - options: [ - { value: 'true', text: '鏄�' }, - { value: 'false', text: '鍚�' } - ] - }, - { - type: 'text', - key: 'interface', - label: '鎺ュ彛鍦板潃', - initVal: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''), - required: true, - readonly: setting.sysInterface === 'true', - rules: [ - { - max: formRule.input.max, - message: formRule.input.message - } - ] - }, - { - type: 'text', - key: 'outerFunc', - label: '澶栭儴鍑芥暟', - initVal: setting.outerFunc || '', - required: false, - readonly: false, - rules: [ - { - pattern: formRule.func.pattern, - message: formRule.func.message - }, { - max: formRule.func.max, - message: formRule.func.maxMessage - } - ] - }, - { - type: 'text', - key: 'innerFunc', - label: '鍐呴儴鍑芥暟', - initVal: setting.innerFunc || '', - tooltip: usefulFields.length ? '寮�澶村彲鐢ㄥ瓧绗︼細' + usefulFields.join(', ') : '', - placement: 'bottomLeft', - required: false, - readonly: false, - rules: rules - }, - { - type: 'datasource', - key: 'dataresource', - label: '鏁版嵁婧�', - initVal: setting.dataresource || '', - tooltip: '浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愩�傛敞锛氭暟鎹潈闄愭浛鎹㈢ $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'', - help: '鏁版嵁ID锛�' + MenuID, - required: false, - readonly: false, - rules: [ - { - pattern: _patten, - message: formRule.func.innerMessage - }, { - max: formRule.func.max, - message: formRule.func.maxMessage - } - ] - }, - { - type: 'text', - key: 'valueField', - label: 'Value', - initVal: setting.valueField || '', - tooltip: '鏁版嵁鍊煎瓧娈点��', - required: true, - readonly: false, - rules: [ - { - pattern: formRule.field.pattern, - message: formRule.field.message - }, { - max: formRule.field.max, - message: formRule.field.maxMessage - } - ] - }, - { - type: 'text', - key: 'labelField', - label: 'Label', - initVal: setting.labelField || '', - tooltip: '鏄剧ず鏂囧瓧瀛楁銆�', - required: true, - readonly: false, - rules: [ - { - pattern: formRule.field.pattern, - message: formRule.field.message - }, { - max: formRule.field.max, - message: formRule.field.maxMessage - } - ] - }, - { - type: 'text', - key: 'parentField', - label: 'Parent', - initVal: setting.parentField || '', - tooltip: '鐖剁骇瀛楁銆�', - required: true, - readonly: false, - rules: [ - { - pattern: formRule.field.pattern, - message: formRule.field.message - }, { - max: formRule.field.max, - message: formRule.field.maxMessage - } - ] - }, - { - type: 'text', - key: 'order', - label: '鎺掑簭', - initVal: setting.order || '', - placeholder: 'ID asc, UID desc', - required: true, - readonly: false, - rules: [ - { - max: formRule.input.max, - message: formRule.input.message - } - ] - }, - { - type: 'text', - key: 'mark', - label: '椤剁骇鏍囪瘑', - initVal: setting.mark || '', - tooltip: '鐖剁骇瀛楁鍊间笌椤剁骇鏍囪瘑鐩稿悓鏃讹紝瑙嗕负椤剁骇鑺傜偣銆�', - required: false, - readonly: false, - rules: [ - { - max: formRule.input.max, - message: formRule.input.message - } - ] - }, - { - type: 'number', - key: 'width', - min: 2, - max: 12, - label: '瀹藉害', - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鏍戝舰姣斾緥鍙缃负2-12锛堟渶澶�50%锛�', - initVal: setting.width || 5, - required: true - }, - { - type: 'radio', - key: 'searchable', - label: '鎼滅储', - initVal: setting.searchable || 'true', - required: false, - readonly: false, - options: [ - { value: 'true', text: '鏄剧ず' }, - { value: 'false', text: '闅愯棌' } - ] - }, - { - type: 'radio', - key: 'default', - label: '榛樿sql', - initVal: setting.default || 'true', - required: false, - readonly: false, - options: [ - { value: 'true', text: '鎵ц' }, - { value: 'false', text: '涓嶆墽琛�' } - ] - }, - { - type: 'radio', - key: 'showIcon', - label: '鏄剧ず鍥炬爣', - initVal: setting.showIcon || 'false', - required: false, - readonly: false, - options: [ - { value: 'true', text: '鏄�' }, - { value: 'false', text: '鍚�' } - ] - }, - { - type: 'radio', - key: 'showLine', - label: '鏄剧ず鍒嗗壊绾�', - initVal: setting.showLine || 'false', - required: false, - readonly: false, - options: [ - { value: 'true', text: '鏄�' }, - { value: 'false', text: '鍚�' } - ] - } - ] -} - /** * @description 鑾峰彇鎼滅储鏉′欢琛ㄥ崟閰嶇疆淇℃伅 * @param {object} card // 鎼滅储鏉′欢瀵硅薄 @@ -467,19 +184,6 @@ text: '鏁版嵁婧�' }] }, - // { - // type: 'radio', - // key: 'setAll', - // label: '璁剧疆鍏ㄩ儴', - // initVal: card.setAll || 'true', - // options: [{ - // value: 'true', - // text: '鏄�' - // }, { - // value: 'false', - // text: '鍚�' - // }] - // }, { type: 'radio', key: 'display', @@ -1014,1538 +718,6 @@ } /** - * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅 - * @param {*} card 缂栬緫鎸夐挳 - * @param {*} config 椤甸潰閰嶇疆 - * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� - * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 - */ -export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = [], tabs = []) { - let columns = (config.columns || []).filter(col => col.field) - - let opentypes = [ - { - value: 'pop', - text: '寮圭獥锛堣〃鍗曪級' - }, { - value: 'prompt', - text: '鎻愮ず妗�' - }, { - value: 'exec', - text: '鐩存帴鎵ц' - }, { - value: 'excelIn', - text: '瀵煎叆Excel' - }, { - value: 'excelOut', - text: '瀵煎嚭Excel' - }, { - value: 'popview', - text: '寮圭獥锛堟爣绛撅級' - }, { - value: 'tab', - text: '鏍囩椤�' - }, { - value: 'innerpage', - text: '鏂伴〉闈�' - }, { - value: 'funcbutton', - text: '鍔熻兘鎸夐挳' - } - ] - - if (card.execSuccess === 'view' || card.execSuccess === 'refresh') { // refresh涓鸿〃鍗曟爣绛鹃〉 - card.execSuccess = 'grid' - } - if (card.execError === 'view' || card.execError === 'refresh') { - card.execError = 'grid' - } - if (card.popClose === 'view') { - card.popClose = 'grid' - } - - if (card.OpenType === 'outerpage') { - card.pageTemplate = 'custom' - card.OpenType = 'innerpage' - } - - let refresh = [] - - if (type === 'subtable') { // 瀛愯〃椤甸潰锛屽彲璁剧疆鍒锋柊涓昏〃鍙婂悓绾ф爣绛� - if (card.focus) { - card.popClose = 'maingrid' - } - refresh.push({ - value: 'maingrid', - text: '鍒锋柊涓昏〃锛堣锛�' - }, { - value: 'equaltab', - text: '鍒锋柊鍚岀骇鏍囩' - }) - } else if (card.execSuccess === 'maingrid') { - card.execSuccess = 'grid' - } - - if (card.OpenType === 'blank') { - card.OpenType = 'tab' - } - if (!card.control && card.controlField) { - card.control = 'disabled' - } - - if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 鍏煎澶栭儴鍑芥暟鐩翠紶绫诲瀷 - card.procMode = 'none' - } - - return [ - { - type: 'select', - key: 'OpenType', - label: '鎵撳紑鏂瑰紡', - initVal: card.OpenType, - required: true, - options: opentypes - }, - { - type: 'text', - key: 'label', - label: '鎸夐挳鍚嶇О', - initVal: card.label, - required: true, - readonly: false - }, - { - type: 'select', - key: 'funcType', - label: '鍔熻兘绫诲瀷', - initVal: card.funcType || '', - required: true, - options: [{ - value: 'print', - text: '鏍囩鎵撳嵃' - }, { - value: 'refund', - text: '閫�娆�' - }, { - value: 'changeuser', - text: '鍒囨崲鐢ㄦ埛' - }, { - value: 'closetab', - text: '鏍囩鍏抽棴' - }, { - value: 'megvii', - text: '鏃疯闈㈡澘鏈�' - }, { - value: 'filezip', - text: '鏂囦欢鍘嬬缉鍖�' - }] - }, - { // 鏃疯闈㈡澘鏈烘帴鍙� 寰呮墿灞� - type: 'radio', - key: 'subFunc', - label: '鎺ュ彛鍚嶇О', - initVal: card.subFunc || 'addUser', - required: true, - options: [ - { value: 'addUser', text: '娣诲姞鐢ㄦ埛' }, - ] - }, - { - type: 'select', - key: 'execMode', - label: '鎵ц鏂瑰紡', - initVal: card.execMode || 'exec', - required: true, - options: [{ - value: 'exec', - text: '鐩存帴鎵ц' - }, { - value: 'prompt', - text: '鎻愮ず妗�' - }, { - value: 'pop', - text: '寮圭獥锛堣〃鍗曪級' - }] - }, - { - type: 'radio', - key: 'intertype', - label: '鎺ュ彛绫诲瀷', - initVal: card.intertype || 'system', - required: true, - options: [] - }, - { - type: 'radio', - key: 'procMode', - label: '鍙傛暟澶勭悊', - initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), - tooltip: '褰撹繑鍥炲�煎瓨鍦� mk_ex_invoke 涓斿�间负 false 鏃讹紝涓嶄細璋冪敤澶栭儴鎺ュ彛銆�', - required: true, - options: [{ - value: 'system', - text: '绯荤粺鍑芥暟' - }, { - value: 'inner', - text: '鍐呴儴鍑芥暟' - }, { - value: 'none', - text: '鏃�' - }] - }, - { - type: 'radio', - key: 'sqlType', - label: '鎿嶄綔绫诲瀷', - initVal: card.sqlType || '', - required: true, - options: [] - }, - { - type: 'text', - key: 'sql', - label: '琛ㄥ悕', - initVal: card.sql || config.setting.tableName || '', - required: true - }, - { - type: 'text', - key: 'innerFunc', - label: '鍐呴儴鍑芥暟', - initVal: card.innerFunc || '', - tooltip: usefulFields.length ? `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬨�俙 : '', - fields: usefulFields, - required: card.intertype === 'inner', - readonly: false - }, - { - type: 'text', - key: 'urlkey', - label: '鍦板潃瀛楁', - initVal: card.urlkey || '', - tooltip: '鍥剧墖锛堟枃浠讹級閾炬帴鐨勫瓧娈靛悕銆�', - required: false, - readonly: false - }, - { - type: 'select', - key: 'linkTab', - label: '鍏宠仈鏍囩', - initVal: card.linkTab || '', - required: false, - options: [ - { - value: '', - text: '鏂板缓' - }, - ...tabs - ] - }, - { - type: 'select', - key: 'pageTemplate', - label: '椤甸潰绫诲瀷', - initVal: card.pageTemplate || '', - required: true, - options: [{ - // value: 'print', - // text: '鏍囩鎵撳嵃妯℃澘' - // }, { - // value: 'billprintTemp', - // text: '鍗曟嵁鎵撳嵃妯℃澘' - // }, { - value: 'billprint', - text: '鍗曟嵁鎵撳嵃' - }, { - value: 'pay', - text: '鏀粯' - }, { - value: 'custom', - text: '鑷畾涔�' - }] - }, - { - type: 'select', - key: 'printTemp', - label: '鎵撳嵃妯℃澘', - initVal: card.printTemp || '', - required: true, - options: printTemps - }, - { - type: 'text', - key: 'url', - label: '椤甸潰鍦板潃', - initVal: card.url || '', - required: true - }, - { - type: 'radio', - key: 'sysInterface', - label: '绯荤粺鎺ュ彛', - initVal: card.sysInterface || 'false', - tooltip: '鍗曠偣鐧诲綍绯荤粺', - required: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'text', - key: 'outerFunc', - label: '澶栭儴鍑芥暟', - initVal: card.outerFunc || '', - required: false, - readonly: false - }, - { - type: 'textarea', - key: 'interface', - label: '娴嬭瘯鍦板潃', - initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (card.interface || ''), - required: true, - readonly: card.sysInterface === 'true' - }, - { - type: 'textarea', - key: 'proInterface', - label: '姝e紡鍦板潃', - initVal: card.proInterface || '', - tooltip: '姝e紡绯荤粺鎵�浣跨敤鐨勬帴鍙e湴鍧�銆�', - required: false - }, - { - type: 'radio', - key: 'callbackType', - label: '鍥炶皟鏂瑰紡', - initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'), - tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��', - required: true, - options: [{ - value: 'script', - text: '鑷畾涔夎剼鏈�' - }, { - value: 'default', - text: '鍚庡彴鑴氭湰' - }, { - value: 'func', - text: '鍥炶皟鍑芥暟' - }, { - value: 'none', - text: '鏃�' - }] - }, - { - type: 'text', - key: 'cbTable', - label: '鍥炶皟琛ㄥ悕', - initVal: card.cbTable || '', - required: true - }, - { - type: 'text', - key: 'callbackFunc', - label: '鍥炶皟鍑芥暟', - initVal: card.callbackFunc || '', - required: true, - readonly: false - }, - { - type: 'radio', - key: 'method', - label: '璇锋眰鏂瑰紡', - initVal: card.method || 'post', - required: true, - options: [{ - value: 'get', - text: 'GET' - }, { - value: 'post', - text: 'POST' - }] - }, - { - type: 'radio', - key: 'cross', - label: '鎺ュ彛璺ㄥ煙', - initVal: card.cross || 'true', - tooltip: '濡傛灉鑷畾涔夋帴鍙d笉鏀寔璺ㄥ煙璇锋眰锛屼細閫氳繃褰撳墠绯荤粺杞彂銆�', - required: false, - options: [{ - value: 'true', - text: '鏀寔' - }, { - value: 'false', - text: '涓嶆敮鎸�' - }] - }, - { - type: 'radio', - key: 'stringify', - label: '搴忓垪鍖�', - initVal: card.stringify || 'text', - required: false, - options: [{ - value: 'text', - text: 'Text' - }, { - value: 'JSON', - text: 'JSON' - }, { - value: 'qs', - text: 'qs' - }] - }, - { - type: 'radio', - key: 'position', - label: '鏄剧ず浣嶇疆', - initVal: card.position || 'toolbar', - required: true, - options: [{ - value: 'toolbar', - text: '宸ュ叿鏍�' - }, { - value: 'grid', - text: '琛ㄦ牸' - }] - }, - { - type: 'select', - key: 'Ot', - label: '琛岃缃�', - initVal: card.Ot || 'requiredSgl', - required: true, - options: [] - }, - { - type: 'cascader', - key: 'linkmenu', - label: '鍏宠仈鑿滃崟', - initVal: card.linkmenu || [], - required: true, - options: menulist - }, - { - type: 'cascader', - key: 'refreshTab', - label: '鍒锋柊鏍囩', - initVal: card.refreshTab || [], - required: false, - options: menulist - }, - { - type: refresh.length === 0 ? 'radio' : 'select', - key: 'execSuccess', - label: '鎴愬姛鍚�', - initVal: card.execSuccess || 'grid', - tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��', - required: true, - options: [{ - value: 'never', - text: '涓嶅埛鏂�' - }, { - value: 'line', - text: '鍒锋柊琛�' - }, { - value: 'grid', - text: '鍒锋柊琛ㄦ牸' - }, - ...refresh] - }, - { - type: refresh.length === 0 ? 'radio' : 'select', - key: 'execError', - label: '澶辫触鍚�', - initVal: card.execError || 'never', - tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺�傚闇�璇煶鎾姤璇蜂互@speak@寮�澶达紝鎾姤鍐呭鎴栨枃浠舵斁缃簬<<>>涓��', - required: true, - options: [{ - value: 'never', - text: '涓嶅埛鏂�' - }, { - value: 'line', - text: '鍒锋柊琛�' - }, { - value: 'grid', - text: '鍒锋柊琛ㄦ牸' - }, - ...refresh] - }, - { - type: refresh.length === 0 ? 'radio' : 'select', - key: 'popClose', - label: '鍏抽棴鍚�', - initVal: card.popClose || 'grid', - required: true, - options: [{ - value: 'never', - text: '涓嶅埛鏂�' - }, { - value: 'grid', - text: '鍒锋柊琛ㄦ牸' - }, - ...refresh] - }, - { - type: 'radio', - key: 'resetPageIndex', - label: '鍒锋柊鏃�', - initVal: card.resetPageIndex || 'true', - required: false, - options: [{ - value: 'true', - text: '閲嶇疆椤电爜' - }, { - value: 'false', - text: '涓嶉噸缃�' - }] - }, - { - type: 'icon', - key: 'icon', - label: '鍥炬爣', - initVal: card.icon, - required: false - }, - { - type: 'select', - key: 'class', - label: '棰滆壊', - initVal: card.class, - required: false, - options: btnClasses - }, - { - type: 'cascader', - key: 'openmenu', - label: '鎵撳紑鑿滃崟', - initVal: card.openmenu || [], - tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��', - required: false, - options: menulist - }, - { - type: 'text', - key: 'output', - label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝杩斿洖id鏃跺彲浣跨敤@id@锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��', - initVal: card.output || '', - required: false - }, - { - type: 'text', - key: 'tipTitle', - label: '纭鎻愮ず', - initVal: card.tipTitle || '', - tooltip: '娉細寮圭獥锛堣〃鍗曪級鍦ㄦ樉绀轰负鏄惁妗嗘椂鏈夋晥銆�', - required: false - }, - { - type: 'radio', - key: 'joint', - label: '鎷兼帴鍙傛暟', - initVal: card.joint || 'true', - required: false, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'text', - key: 'sheet', - label: '琛ㄥ悕', - initVal: card.sheet || config.setting.tableName || '', - required: true - }, - { - type: 'radio', - key: 'pagination', - label: '鍒嗛〉', - initVal: card.pagination || 'false', - required: false, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'search', - label: '鎼滅储鏉′欢', - initVal: card.search || 'false', - required: false, - options: [{ - value: 'true', - text: '蹇呭~' - }, { - value: 'false', - text: '闈炲繀濉�' - }] - }, - { - type: 'radio', - key: 'display', - label: '鏄剧ず鏂瑰紡', - initVal: card.display || 'modal', - required: true, - options: [{ - value: 'modal', - text: '妯℃�佹' - }, { - value: 'drawer', - text: '鎶藉眽' - }] - }, - { - type: 'number', - key: 'ratio', - min: 1, - max: 3000, - precision: 0, - label: '姣斾緥', - initVal: card.ratio || 85, - tooltip: '妯℃�佹鎴栨娊灞夌殑瀹藉害锛屽皬浜�100涓虹獥鍙e搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��', - required: true - }, - { - type: 'radio', - key: 'placement', - label: '寮瑰嚭鏂瑰悜', - initVal: card.placement || 'right', - required: false, - options: [{ - value: 'right', - text: '鍙充晶' - }, { - value: 'left', - text: '宸︿晶' - }, { - value: 'top', - text: '涓婁晶' - }, { - value: 'bottom', - text: '涓嬩晶' - }] - }, - { - type: 'radio', - key: 'clickouter', - label: '鐐瑰嚮钂欏眰', - initVal: card.clickouter || 'unclose', - required: false, - options: [{ - value: 'unclose', - text: '涓嶅叧闂�' - }, { - value: 'close', - text: '鍏抽棴' - }] - }, - { - type: 'radio', - key: 'control', - label: '鎸夐挳鎺у埗', - initVal: card.control || '', - required: false, - options: [{ - value: '', - text: '鏃�' - }, { - value: 'disabled', - text: '绂佺敤' - }, { - value: 'hidden', - text: '闅愯棌' - }] - }, - { - type: 'select', - key: 'controlField', - label: '鎺у埗瀛楁', - tooltip: '鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鐨勯殣钘忔垨绂佺敤銆�', - initVal: card.controlField || '', - required: true, - options: columns - }, - { - type: 'text', - key: 'controlVal', - label: '鎺у埗鍊�', - tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細闅愯棌鎴栫鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', - initVal: card.controlVal || '', - required: false - }, - { - type: 'text', - key: 'reason', - label: '绂佺敤鍘熷洜', - initVal: card.reason || '', - required: false - }, - { - type: 'radio', - key: 'hidden', - label: '闅愯棌', - initVal: card.hidden || 'false', - tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��', - required: false, - options: [{ - value: 'false', - text: '鍚�' - }, { - value: 'true', - text: '鏄�' - }] - }, - { - type: 'radio', - key: 'progress', - label: '杩涘害鎻愮ず', - initVal: card.progress || 'number', - required: false, - options: [{ - value: 'number', - text: '鍓╀綑鏁�' - }, { - value: 'progressbar', - text: '杩涘害鏉�' - }] - } - ] -} - -/** - * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭� - * @param {object} card // 鎼滅储鏉′欢瀵硅薄 - * @param {Array} menulist // 鑿滃崟鍒楄〃-鐢ㄤ簬瀛楁閫忚 - */ -export function getColumnForm (card, menulist = [], fields = []) { - let roleList = sessionStorage.getItem('sysRoles') - if (roleList) { - try { - roleList = JSON.parse(roleList) - } catch (e) { - roleList = [] - } - } else { - roleList = [] - } - - if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) { - card.perspective = '' - } - - return [ - { - type: 'text', - key: 'label', - label: '鍚嶇О', - initVal: card.label, - required: true - }, - { - type: 'text', - key: 'field', - label: '瀛楁', - initVal: card.field, - required: true, - readonly: false - }, - { - type: 'select', - key: 'type', - label: '绫诲瀷', - initVal: card.type, - required: true, - options: [{ - value: 'text', - text: '鏂囨湰' - }, { - value: 'number', - text: '鏁板瓧' - }, { - value: 'picture', - text: '鍥剧墖' - }, { - value: 'video', - text: '瑙嗛' - }, { - value: 'link', - text: '閾炬帴' - }, { - value: 'textarea', - text: '澶氳鏂囨湰' - }, { - value: 'index', - text: '搴忓彿' - }] - }, - { - type: 'text', - key: 'nameField', - label: '鍚嶇О瀛楁', - initVal: card.nameField, - required: false, - readonly: false - }, - { - type: 'number', - key: 'Width', - min: 1, - max: 1000, - decimal: 0, - label: '鍒楀', - initVal: card.Width, - required: true - }, - { - type: 'radio', - key: 'joint', - label: '鎷兼帴鍙傛暟', - initVal: card.joint || 'true', - required: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'Hide', - label: '闅愯棌', - initVal: card.Hide || 'false', - required: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'IsSort', - label: '鎺掑簭', - initVal: card.IsSort || 'true', - required: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'Align', - label: '瀵归綈鏂瑰紡', - initVal: card.Align || 'left', - required: true, - options: [{ - value: 'left', - text: '宸﹀榻�' - }, { - value: 'center', - text: '灞呬腑' - }, { - value: 'right', - text: '鍙冲榻�' - }] - }, - { - type: 'number', - key: 'startTime', - precision: 0, - label: '寮�濮嬫椂闂�', - initVal: card.startTime || 0, - tooltip: '瑙嗛寮�濮嬫挱鏀剧殑鏃堕棿锛岀敤浜庤皟鏁磋棰戝垵濮嬪寲灞曠ず鐨勭晫闈€��', - required: false - }, - { - type: 'select', - key: 'aspectRatio', - label: '闀垮姣�', - initVal: card.aspectRatio || '16:9', - required: true, - options: [ - { value: '4:3', text: '4:3' }, - { value: '16:9', text: '16:9' } - ] - }, - { - type: 'radio', - key: 'rowspan', - label: '琛屽悎骞�', - initVal: card.rowspan || 'false', - tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆�', - required: false, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'sum', - label: '鏄剧ず鍚堣', - initVal: card.sum || 'false', - tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愶紝涓斿綋鍓嶅垪鏈殣钘忔椂鏈夋晥銆�', - required: false, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'number', - key: 'decimal', - min: 0, - max: 18, - decimal: 0, - label: '灏忔暟浣�', - initVal: card.decimal || 0, - required: true - }, - { - type: 'number', - key: 'fieldlength', - label: '瀛楁闀垮害', - initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), - required: true - }, - { - type: 'select', - key: 'format', - label: '鏍煎紡鍖�', - initVal: card.format || 'none', - options: [{ - value: 'none', - text: '鏃�' - }, { - value: 'thdSeparator', - text: '鍗冨垎浣�' - }, { - value: 'percent', - text: '鐧惧垎姣�' - }, { - value: 'abs', - text: '缁濆鍊�' - }], - required: false - }, - { - type: 'select', - key: 'textFormat', - label: '鏍煎紡鍖�', - initVal: card.textFormat || 'none', - options: [{ - value: 'none', - text: '鏃�' - }, { - value: 'encryption', - text: '鍔犲瘑' - }, { - value: 'YYYY-MM-DD', - text: 'YYYY-MM-DD' - }, { - value: 'YYYY-MM-DD HH:mm:ss', - text: 'YYYY-MM-DD HH:mm:ss' - }], - required: false - }, - { - type: 'text', - key: 'prefix', - label: '鍓嶇紑', - initVal: card.prefix || '', - required: false, - readonly: false - }, - { - type: 'text', - key: 'postfix', - label: '鍚庣紑', - initVal: card.postfix || '', - tooltipClass: 'middle', - required: false, - readonly: false - }, - { - type: 'number', - key: 'span', - min: 1, - max: 24, - precision: 0, - label: '鍥剧墖瀹藉害', - initVal: card.span || 24, - tooltip: '鏍呮牸甯冨眬锛岀瓑鍒嗕负24浠姐��', - required: true - }, - { - type: 'select', - key: 'lenWidRadio', - label: '闀垮姣�', - initVal: card.lenWidRadio || '1:1', - required: true, - options: [ - { value: '1:1', text: '1:1' }, - { value: '4:3', text: '4:3' }, - { value: '3:2', text: '3:2' }, - { value: '16:9', text: '16:9' }, - { value: '2:1', text: '2:1' }, - { value: '3:1', text: '3:1' }, - { value: '4:1', text: '4:1' }, - { value: '5:1', text: '5:1' }, - { value: '6:1', text: '6:1' }, - { value: '7:1', text: '7:1' }, - { value: '8:1', text: '8:1' }, - { value: '9:1', text: '9:1' }, - { value: '10:1', text: '10:1' }, - { value: '3:4', text: '3:4' }, - { value: '2:3', text: '2:3' }, - { value: '9:16', text: '9:16' }, - ] - }, - { - type: 'radio', - key: 'scale', - label: '鐐瑰嚮缂╂斁', - initVal: card.scale || 'true', - required: false, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'perspective', - label: '瀛楁閫忚', - initVal: card.perspective || '', - options: [{ - value: '', - text: '鏃�' - }, { - value: 'linkmenu', - text: '鑿滃崟' - }, { - value: 'linkurl', - text: '閾炬帴' - }] - }, - { - type: 'cascader', - key: 'linkmenu', - label: '鑿滃崟', - initVal: card.linkmenu || [], - required: true, - options: menulist - }, - { - type: 'textarea', - key: 'linkurl', - label: '閾炬帴鍦板潃', - initVal: card.linkurl || '', - required: true - }, - { - type: 'multiselect', - key: 'linkfields', - label: '鍏宠仈瀛楁', - initVal: card.linkfields || [], - required: false, - options: fields - }, - { - type: 'multiselect', - key: 'blacklist', - label: '榛戝悕鍗�', - initVal: card.blacklist || [], - required: false, - options: roleList - } - ] -} - -/** - * @description 鑾峰彇鍥捐〃瑙嗗浘澶栭儴閰嶇疆琛ㄥ崟 - * @param {object} card // 鎼滅储鏉′欢瀵硅薄 - * @param {Array} columns // 鏄剧ず鍒� - * @param {Array} actions // 鎸夐挳缁別xcel - * @param {Array} extraActions // 甯歌鎸夐挳 - */ -export function getChartViewForm (card, _columns, actions, extraActions) { - let roleList = sessionStorage.getItem('sysRoles') - if (roleList) { - try { - roleList = JSON.parse(roleList) - } catch (e) { - roleList = [] - } - } else { - roleList = [] - } - - let _charts = [{ - value: 'line', - text: '鎶樼嚎鍥�' - }, { - value: 'bar', - text: '鏌辩姸鍥�' - }, { - value: 'pie', - text: '楗煎浘' - }, { - value: 'card', - text: '鍗$墖' - }] - - if (card.chartType === 'table') { - _charts = [{ - value: 'table', - text: '琛ㄦ牸' - }] - } - - return [ - { - type: 'text', - key: 'title', - label: '鏍囬', - initVal: card.title, - required: false - }, - { - type: 'select', - key: 'chartType', - label: '鍥捐〃绫诲瀷', - initVal: card.chartType, - required: true, - readonly: card.chartType === 'table', - options: _charts - }, - { - type: 'number', - key: 'height', - min: 100, - max: 1000, - decimal: 0, - label: '楂樺害', - initVal: card.height || 400, - required: true - }, - { - type: 'radio', - key: 'Hide', - label: '闅愯棌', - initVal: card.Hide, - required: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'number', - key: 'width', - min: 1, - max: 24, - decimal: 0, - label: '鍥捐〃瀹藉害', - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', - initVal: card.width || 24, - required: true - }, - { - type: 'number', - key: 'cardWidth', - min: 1, - max: 24, - decimal: 0, - label: '鍗$墖瀹藉害', - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', - initVal: card.cardWidth || 6, - hidden: true, - required: true - }, - { - type: 'select', - key: 'bgfield', - label: '鑳屾櫙鎺у埗', - initVal: card.bgfield || '', - required: false, - readonly: false, - hidden: true, - options: _columns - }, - { - type: 'radio', - key: 'border', - label: '杈规', - initVal: card.border || 'show', - required: false, - hidden: true, - options: [{ - value: 'show', - text: '鏄剧ず' - }, { - value: 'hidden', - text: '闅愯棌' - }] - }, - { - type: 'radio', - key: 'switch', - label: '鏁版嵁鍒囨崲', - initVal: card.switch || 'true', - required: false, - hidden: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'select', - key: 'extraAction', - label: '鎵╁睍鍗$墖', - initVal: card.extraAction || '', - tooltip: '缁戝畾涓嶉�夎鐨勬寜閽紝鍗$墖灏鹃儴浼氬鍔犲姛鑳藉崱鐗�', - required: false, - options: extraActions - }, - { - type: 'multiselect', - key: 'blacklist', - label: '榛戝悕鍗�', - initVal: card.blacklist || [], - required: false, - options: roleList - }, - { - type: 'multiselect', - key: 'actions', - label: '鎵╁睍鎸夐挳', - initVal: card.actions || [], - tooltip: '鍙粦瀹氬凡鏈夌殑excel瀵煎叆銆佸鍑烘寜閽�', - required: false, - options: actions - } - ] -} - -/** - * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 - * @param {object} card // 鍥捐〃瀵硅薄 - * @param {Array} columns // 鏄剧ず鍒� - * @param {String} setting // 椤甸潰璁剧疆 - */ -export function getChartOptionForm (card, columns, setting) { - let shapes = [] - - if (card.chartType === 'line') { - shapes = [ - { field: 'smooth', label: 'smooth' }, - { field: 'line', label: 'line' }, - { field: 'dot', label: 'dot' }, - { field: 'dash', label: 'dash' }, - { field: 'hv', label: 'hv' }, - { field: 'vh', label: 'vh' }, - { field: 'hvh', label: 'hvh' }, - { field: 'vhv', label: 'vhv' } - ] - } else if (card.chartType === 'bar') { - shapes = [ - { field: 'rect', label: 'rect' }, - { field: 'hollow-rect', label: 'hollow-rect' }, - { field: 'line', label: 'line' }, - { field: 'tick', label: 'tick' }, - { field: 'funnel', label: 'funnel' }, - { field: 'pyramid', label: 'pyramid' } - ] - } else if (card.chartType === 'pie') { - shapes = [ - { field: 'pie', label: '楗煎浘' }, - { field: 'ring', label: '鐜浘' } - ] - } - - return [ - { - type: 'radio', - key: 'datatype', - label: '鏁版嵁绫诲瀷', - initVal: card.datatype || 'query', - tooltip: '缁熻鍥捐〃閫傜敤浜庤〃鏍间笉鍒嗛〉锛屼笖鏁版嵁闇�瑕佽浆鎹�', - required: false, - readonly: !(setting.laypage === 'false'), - forbid: !['line', 'bar'].includes(card.chartType), - options: [ - { value: 'query', text: '鏌ヨ' }, - { value: 'statistics', text: '缁熻' } - ] - }, - { - type: 'select', - key: 'Xaxis', - label: card.chartType === 'pie' ? 'Text' : 'X-杞�', - initVal: card.Xaxis || '', - required: true, - options: columns.filter(col => col.type === 'text') - }, - { - type: 'select', - key: 'Yaxis', - label: card.chartType === 'pie' ? 'Value' : 'Y-杞�', - initVal: card.chartType === 'pie' ? card.Yaxis || '' : card.Yaxis || [], - multi: card.chartType !== 'pie', - hidden: card.datatype === 'statistics', - required: true, - options: columns.filter(col => col.type === 'number') - }, - { - type: 'select', - key: 'InfoType', - label: '绫诲瀷', - initVal: card.InfoType || '', - forbid: !['line', 'bar'].includes(card.chartType), - hidden: card.datatype !== 'statistics', - required: true, - options: columns.filter(col => col.type === 'text') - }, - { - type: 'select', - key: 'InfoValue', - label: '鍊�', - initVal: card.InfoValue || '', - forbid: !['line', 'bar'].includes(card.chartType), - hidden: card.datatype !== 'statistics', - required: true, - options: columns.filter(col => col.type === 'number') - }, - { - type: 'select', - key: 'legend', - label: '鍥句緥浣嶇疆', - initVal: card.legend || 'bottom', - required: false, - options: [ - { field: 'top', label: 'top' }, - { field: 'top-left', label: 'top-left' }, - { field: 'top-right', label: 'top-right' }, - { field: 'right', label: 'right' }, - { field: 'right-top', label: 'right-top' }, - { field: 'right-bottom', label: 'right-bottom' }, - { field: 'left', label: 'left' }, - { field: 'left-top', label: 'left-top' }, - { field: 'left-bottom', label: 'left-bottom' }, - { field: 'bottom', label: 'bottom' }, - { field: 'bottom-left', label: 'bottom-left' }, - { field: 'bottom-right', label: 'bottom-right' }, - { field: 'hidden', label: 'hidden' } - ] - }, - { - type: 'select', - key: 'shape', - label: '褰㈢姸', - initVal: card.shape || (shapes[0] && shapes[0].field), - required: false, - forbid: !['line', 'bar', 'pie'].includes(card.chartType), - options: shapes - }, - { - type: 'radio', - key: 'tooltip', - label: '鎻愮ず淇℃伅', - initVal: card.tooltip || 'true', - required: false, - options: [{ - value: 'true', - text: '鏄剧ず' - }, { - value: 'false', - text: '闅愯棌' - }] - }, - { - type: 'radio', - key: 'coordinate', - label: '鍧愭爣', - initVal: card.coordinate || 'angle', - required: false, - forbid: !['line', 'bar'].includes(card.chartType), - options: [{ - value: 'angle', - text: '浜岀淮鍧愭爣' - }, { - value: 'polar', - text: '鏋佸潗鏍�' - }] - }, - { - type: 'radio', - key: 'point', - label: '鐐瑰浘', - initVal: card.point || 'false', - required: false, - forbid: !['line'].includes(card.chartType), - options: [{ - value: 'true', - text: '鏄剧ず' - }, { - value: 'false', - text: '闅愯棌' - }] - }, - { - type: 'radio', - key: 'transpose', - label: '鍙樻崲', - initVal: card.transpose || 'false', - required: false, - forbid: !['line', 'bar'].includes(card.chartType), - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] - }, - { - type: 'radio', - key: 'pieshow', - label: '鏄剧ず鍊�', - initVal: card.pieshow || 'percent', - required: false, - forbid: !['pie'].includes(card.chartType), - options: [{ - value: 'percent', - text: '鐧惧垎姣�' - }, { - value: 'value', - text: '鏁板��' - }] - }, - { - type: 'radio', - key: 'label', - label: '鏍囨敞-鍊�', - initVal: card.label || (card.chartType === 'pie' ? 'true' : 'false'), - required: false, - forbid: !['pie', 'bar', 'line'].includes(card.chartType), - options: [{ - value: 'true', - text: '鏄剧ず' - }, { - value: 'false', - text: '闅愯棌' - }] - }, { - type: 'radio', - key: 'labelLayout', - label: '鏍囩甯冨眬', - initVal: card.labelLayout || 'normal', - required: false, - forbid: !['pie'].includes(card.chartType), - options: [{ - value: 'normal', - text: '甯歌' - }, { - value: 'overlap', - text: '闃查噸鍙�' - }] - }, { - type: 'radio', - key: 'adjust', - label: '澶氭煴鎺掑垪', - initVal: card.adjust || 'dodge', - required: false, - forbid: !['bar'].includes(card.chartType), - options: [{ - value: 'dodge', - text: '鍒嗙粍' - }, { - value: 'stack', - text: '鍫嗗彔' - }] - }, { - type: 'radio', - key: 'repeat', - label: '閲嶅鏁版嵁', - initVal: card.repeat || 'unrepeat', - required: false, - options: [{ - value: 'unrepeat', - text: '鍘婚噸' - }, { - value: 'average', - text: '骞冲潎' - }, { - value: 'cumsum', - text: '绱姞' - }] - }, { - type: 'number', - key: 'InfoDefNumber', - label: '灞曠ず鏁�', - tooltip: '榛樿鏄剧ず绫诲瀷鏁伴噺', - min: 1, - max: 50, - decimal: 0, - initVal: card.InfoDefNumber || 5, - forbid: !['line', 'bar'].includes(card.chartType), - hidden: card.datatype !== 'statistics', - required: true - }, { - type: 'number', - key: 'barSize', - label: '鏌卞舰瀹藉害', - tooltip: '绌哄�兼椂锛屽搴﹁嚜閫傚簲銆�', - min: 5, - max: 100, - decimal: 0, - initVal: card.barSize, - forbid: !['bar'].includes(card.chartType), - required: false - } - ] -} - -/** * @description 鑾峰彇琛ㄥ崟閰嶇疆淇℃伅 * @param {*} card // 琛ㄥ崟瀵硅薄 * @param {*} inputfields // 鍙啓鍏ヨ〃鍗� @@ -2956,19 +1128,6 @@ text: '16:9' }] }, - // { - // type: 'radio', - // key: 'setAll', - // label: '璁剧疆绌哄��', - // initVal: card.setAll || 'false', - // options: [{ - // value: 'true', - // text: '鏄�' - // }, { - // value: 'false', - // text: '鍚�' - // }] - // }, { type: 'codemirror', key: 'dataSource', @@ -3034,7 +1193,6 @@ {value: 'left', text: '灞呭乏'}, {value: 'center', text: '灞呬腑'}, {value: 'right', text: '灞呭彸'}, - // {value: 'justify', text: 'justify'} ], render: (text, record) => { if (text === 'center') { @@ -4464,328 +2622,5 @@ options: roleList, forbid: appType === 'mob' } - ] -} - -/** - * @description 鑾峰彇瀛愯彍鍗曞熀鏈俊鎭〃鍗曢厤缃俊鎭� - * @param {object} card // 鏍囩閰嶇疆淇℃伅 - * @param {string} supMenu // 涓婄骇鑿滃崟ID - * @param {array} menus // 鍙�夌殑涓婄骇鑿滃崟鍒楄〃 - * @param {array} equalTab // 鍚岀骇鑿滃崟IDs - * @param {array} equalTabs // 鍙�夌殑鍚岀骇鑿滃崟鍒楄〃 - * @param {string} type // 鑿滃崟绫诲瀷锛屼富琛ㄦ垨鏍戝舰缁撴瀯 - */ -export function getTabForm (card, supMenu, menus, equalTab, equalTabs, type) { - return [ - { - type: 'text', - key: 'label', - label: '鏍囩鍚嶇О', - initVal: card.label || '', - required: true - }, - { - type: 'select', - key: 'linkTab', - label: '鍏宠仈鏍囩', - initVal: card.linkTab || '', - required: false, - options: [] - }, - { - type: 'icon', - key: 'icon', - label: '鍥炬爣', - initVal: card.icon || '', - required: false - }, - { - type: 'select', - key: 'supMenu', - label: '涓婄骇鏍囩', - initVal: supMenu, - required: false, - options: menus - }, - { - type: 'mutilselect', - key: 'equalTab', - label: '鍚岀骇鏍囩', - tooltip: '濡傛灉瀛愭爣绛句腑鍚湁鍒锋柊鍚岀骇鏍囩鐨勬寜閽紝鍦ㄦ澶勬坊鍔犻渶瑕佸埛鏂扮殑鏍囩銆�', - initVal: equalTab, - required: false, - options: equalTabs - }, - { - type: 'text', - key: 'foreignKey', - label: '澶栭敭', - tooltip: '澶栭敭鏃ㄥ湪鏍囩椤典腑鎵ц榛樿鍑芥暟锛堟坊鍔狅級鏃讹紝鏇挎崲BID瀛楁', - initVal: card.foreignKey || '', - required: false - }, - { - type: 'number', - key: 'level', - label: '鏄剧ず绾у埆', - tooltip: '鏍囩鏄剧ず鎺у埗锛岄�夋嫨鎸囧畾绾у埆鏃舵樉绀烘爣绛撅紝绾у埆涓虹┖鏃跺缁堟樉绀恒��', - initVal: card.level, - min: 0, - max: 10, - required: false, - forbid: type !== 'TreePage', - }, - { - type: 'radio', - key: 'searchPass', - label: '涓昏〃鎼滅储', - initVal: card.searchPass || 'false', - tooltip: '浣跨敤涓昏〃鎼滅储鏉′欢鏃讹紝涓昏〃鐨勬悳绱㈡潯浠朵細浼犲叆瀛愯〃涓��', - required: false, - forbid: type !== 'CommonTable', - options: [{ - value: 'true', - text: '浣跨敤' - }, { - value: 'false', - text: '涓嶄娇鐢�' - }] - } - ] -} - -/** - * @description 鑾峰彇鍗$墖璇︽儏琛ㄥ崟閰嶇疆淇℃伅 - * @param {object} card // 鏍囩閰嶇疆淇℃伅 - * @param {array} _columns // 鏄剧ず鍒� - * @param {string} _type // 绫诲瀷锛屽崱鐗囩殑閮ㄤ綅 - * @param {array} _actions // 鎸夐挳鍒楄〃 - */ -export function getCardDetailForm (card, _columns, _type, _actions = []) { - let actions = '' - if (_type === 'bottom') { - actions = card.actions ? card.actions.map(cell => cell.value) : [] - } else if (_type === 'header') { - _actions.unshift({ - value: '', - text: '绌�' - }) - actions = card.actions[0] ? card.actions[0].value : '' - } - return [ - { - type: 'radio', - key: 'datatype', - label: '鏁版嵁绫诲瀷', - initVal: card.datatype || 'dynamic', - required: true, - forbid: !['detail', 'header'].includes(_type), - options: [{ - value: 'dynamic', - text: '鍔ㄦ��' - }, { - value: 'static', - text: '闈欐��' - }] - }, - { - type: 'radio', - key: 'type', - label: '绫诲瀷', - initVal: card.type || 'picture', - required: true, - forbid: !['avatar'].includes(_type), - options: [{ - value: 'picture', - text: '鍥剧墖' - }, { - value: 'icon', - text: '鍥炬爣' - }] - }, - { - type: 'text', - key: 'content', - label: '鍐呭', - initVal: card.content || '', - required: _type !== 'header', - forbid: !['detail', 'header'].includes(_type), - }, - { - type: 'select', - key: 'field', - label: '瀛楁', - initVal: card.field || '', - required: true, - forbid: !['detail', 'header', 'avatar'].includes(_type), - options: _columns - }, - { - type: 'number', - key: 'fontSize', - min: 12, - max: 50, - label: '瀛椾綋澶у皬', - initVal: card.fontSize || 14, - required: true, - forbid: !['detail'].includes(_type) - }, - { - type: 'select', - key: 'fontWeight', - label: '瀛椾綋绮楃粏', - initVal: card.fontWeight || 'normal', - required: true, - forbid: !['detail'].includes(_type), - options: [{ - value: 'normal', - text: '姝e父' - }, { - value: 'bold', - text: 'bold' - }, { - value: 'bolder', - text: 'bolder' - }, { - value: 'lighter', - text: 'lighter' - }, { - value: '100', - text: '100' - }, { - value: '200', - text: '200' - }, { - value: '300', - text: '300' - }, { - value: '400', - text: '400' - }, { - value: '500', - text: '500' - }, { - value: '600', - text: '600' - }, { - value: '700', - text: '700' - }, { - value: '800', - text: '800' - }, { - value: '900', - text: '900' - }] - }, - { - type: 'number', - key: 'width', - min: 10, - max: 100, - precision: 1, - label: '瀹藉害(%)', - initVal: card.width || 100, - required: true, - forbid: !['detail', 'avatar'].includes(_type) - }, - { - type: 'number', - key: 'height', - min: 1, - max: 10, - label: '楂樺害(琛�)', - initVal: card.height || 1, - required: true, - forbid: !['detail'].includes(_type) - }, - { - type: 'radio', - key: 'radius', - label: '鍦嗚', - initVal: card.radius || 'true', - required: false, - forbid: !['avatar'].includes(_type), - options: [{ - value: 'true', - text: '鏈�' - }, { - value: 'false', - text: '鏃�' - }] - }, - { - type: 'number', - key: 'size', - label: '瀛椾綋澶у皬', - initVal: card.size || 28, - min: 12, - max: 500, - required: false, - hidden: true, - forbid: !['avatar'].includes(_type) - }, - { - type: 'radio', - key: 'align', - label: '瀵归綈', - initVal: card.align || 'left', - required: false, - forbid: !['detail'].includes(_type), - options: [{ - value: 'left', - text: '宸�' - }, { - value: 'align-center', - text: '灞呬腑' - }, { - value: 'align-right', - text: '鍙�' - }] - }, - { - type: _type === 'bottom' ? 'multiselect' : 'select', - key: 'actions', - label: '鎸夐挳缁�', - tooltip: '', - initVal: actions, - required: false, - forbid: !['header', 'bottom'].includes(_type), - options: _actions - }, - { - type: 'radio', - key: 'show', - label: '鏄剧ず', - initVal: card.show || 'icon', - required: false, - forbid: !['bottom', 'header'].includes(_type), - options: [{ - value: 'icon', - text: '鍥炬爣' - }, { - value: 'text', - text: '鏂囧瓧' - }, { - value: 'all', - text: '鍏ㄩ儴' - }] - }, - { - type: 'radio', - key: 'display', - label: '鏄剧ず', - initVal: card.display || 'inline', - required: false, - forbid: !['avatar'].includes(_type), - options: [{ - value: 'block', - text: '鏁磋' - }, { - value: 'inline', - text: '鑷姩' - }] - }, ] } \ No newline at end of file -- Gitblit v1.8.0