From 21167ece56edd628e6f6546d1d642947cc3a048f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 12 八月 2024 22:17:33 +0800 Subject: [PATCH] 2024-08-12 --- src/menu/components/card/cardsimplecomponent/options.jsx | 147 ++++++++++++++++++++++++++++++++---------------- 1 files changed, 97 insertions(+), 50 deletions(-) diff --git a/src/menu/components/card/cardsimplecomponent/options.jsx b/src/menu/components/card/cardsimplecomponent/options.jsx index 6c649dd..b23531a 100644 --- a/src/menu/components/card/cardsimplecomponent/options.jsx +++ b/src/menu/components/card/cardsimplecomponent/options.jsx @@ -1,7 +1,7 @@ /** * @description tablecard setting琛ㄥ崟閰嶇疆淇℃伅 */ -export function getTableSetting (setting, columns, buttons = []) { +export function getTableSetting (setting, columns, buttons = [], action = []) { let _columns = columns.map(item => ({value: item.field, label: item.label})) _columns.push({value: '$Index', label: '搴忓彿锛堝墠绔級'}) let appType = sessionStorage.getItem('appType') @@ -38,16 +38,18 @@ field: 'condition', label: '鏄剧ず鏉′欢', initval: setting.condition || 'false', - tooltip: '褰撻�夋嫨鈥滄湁鈥濇椂锛屽彧鏈夌鍚堟潯浠剁殑鏁版嵁鎵嶄細灞曠ず銆�', + tooltip: '褰撻�夋嫨鈥滆嚜瀹氫箟鈥濇椂锛屽彧鏈夌鍚堟潯浠剁殑鏁版嵁鎵嶄細灞曠ず銆傚綋閫夋嫨鈥滄爣棰樷�濇椂锛屽彧鏈夐琛屾墠浼氬睍绀�', required: false, options: [ - {value: 'true', label: '鏈�'}, - {value: 'false', label: '鏃�'}, + {value: 'false', label: '濮嬬粓鏄剧ず'}, + {value: 'true', label: '鑷畾涔�'}, + {value: 'title', label: '鏍囬'}, ], controlFields: [ {field: 'controlField', values: ['true']}, {field: 'controlType', values: ['true']}, {field: 'controlValue', values: ['true']}, + {field: 'click', values: ['true', 'false']}, ] }, { @@ -83,7 +85,7 @@ field: 'click', label: '鐐瑰嚮浜嬩欢', initval: setting.click || '', - tooltip: '褰撻�夋嫨瑙﹀彂鎸夐挳鏃讹紝鍙湁褰撳崱鐗囦腑鍙瓨鍦ㄤ竴涓寜閽椂鏈夋晥銆�', + // tooltip: '褰撻�夋嫨瑙﹀彂鎸夐挳鏃讹紝鍙湁褰撳崱鐗囦腑鍙瓨鍦ㄤ竴涓寜閽椂鏈夋晥銆�', required: false, options: [ {value: '', label: '鏃�'}, @@ -95,37 +97,8 @@ {field: 'menu', values: ['menu']}, {field: 'linkurl', values: ['link']}, {field: 'open', values: ['menu', 'link']}, - {field: 'joint', values: ['menu', 'link']}, {field: 'linkbtn', values: ['button']}, ] - }, - { - type: 'radio', - field: 'joint', - label: '鍙傛暟鎷兼帴', - initval: setting.joint || 'true', - required: false, - options: [ - {value: 'true', label: '鏄�'}, - {value: 'false', label: '鍚�'}, - ], - }, - { - type: appType ? 'select' : 'cascader', - field: 'menu', - label: '鍏宠仈鑿滃崟', - initval: setting.menu || (appType ? '' : []), - required: true, - options: appType ? appmenulist : menulist, - }, - { - type: 'textarea', - field: 'linkurl', - label: '閾炬帴', - initval: setting.linkurl || '', - required: true, - options: [], - span: 24 }, { type: 'radio', @@ -134,10 +107,31 @@ initval: setting.open || 'blank', required: false, options: [ - {value: 'blank', label: '鏂扮獥鍙�'}, - {value: 'self', label: '褰撳墠绐楀彛'}, + {value: 'blank', label: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'}, + {value: 'self', label: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'}, ], - forbid: appType !== 'pc' + forbid: appType !== 'pc' && appType !== 'mob' + }, + { + type: appType ? 'select' : 'cascader', + field: 'menu', + label: '鍏宠仈鑿滃崟', + initval: setting.menu || (appType ? '' : []), + tooltip: `琛屼俊鎭�${appType ? '锛堝瓧娈甸泦涓墠40涓暱搴︿笉瓒呰繃256鐨勫瓧娈碉級' : ''}灏嗕紶閫掕嚦姝よ彍鍗曪紝鍙湪url鍙橀噺銆佽〃鍗曪紙鍏宠仈涓昏〃锛夈�侀潤鎬佸睘鎬у崱銆佹诞鍔ㄥ崱涓娇鐢ㄣ�俙, + required: true, + extendName: 'MenuNo', + options: appType ? appmenulist : menulist, + }, + { + type: 'textarea', + field: 'linkurl', + label: '閾炬帴', + initval: setting.linkurl || '', + tooltip: '鍦ㄩ摼鎺ヤ腑浠***@褰㈠紡鎷兼帴鐨勫瓧娈碉紙瀛楁鏉ユ簮浜庡瓧娈甸泦涓紝姝ゅ id銆乤ppkey銆乽serid銆丩oginUID 涓虹郴缁熷瓧娈碉級锛岃烦杞椂灏嗘浛鎹负瀵瑰簲鍊硷紝渚嬪锛歨ttp://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@锛屽叾涓璦ppkey涓嶭oginUID灏嗚鏇挎崲銆�', + toolWidth: 350, + required: true, + options: [], + span: 24 }, { type: 'select', @@ -146,6 +140,18 @@ initval: setting.linkbtn || '', required: true, options: buttons + }, + { + type: 'radio', + field: 'swipe', + label: '婊戝姩鎸夐挳', + initval: setting.swipe || 'true', + required: false, + options: [ + {value: 'true', label: '鏄剧ず'}, + {value: 'false', label: '涓嶆樉绀�'}, + ], + forbid: action.length === 0 || appType !== 'mob' } ] @@ -185,6 +191,14 @@ } } + let ops = [] + let adapters = sessionStorage.getItem('adapter') || '' + if (adapters.indexOf('wxmini') > -1) { + ops.push({value: 'miniprogram', label: '灏忕▼搴�'}) + } else if (setting.click === 'miniprogram') { + setting.click = '' + } + const cardSettingForm = [ { type: 'text', @@ -197,6 +211,17 @@ }, { type: 'radio', + field: 'layout', + label: '鍏冪礌甯冨眬', + initval: setting.layout || 'grid', + required: false, + options: [ + {value: 'grid', label: '鏍呮牸甯冨眬'}, + {value: 'flex', label: '寮规�у竷灞�'}, + ] + }, + { + type: 'radio', field: 'click', label: '鐐瑰嚮浜嬩欢', initval: setting.click || '', @@ -205,12 +230,15 @@ {value: '', label: '鏃�'}, {value: 'menu', label: '鑿滃崟'}, {value: 'link', label: '閾炬帴'}, + ...ops ], controlFields: [ {field: 'menu', values: ['menu']}, {field: 'linkurl', values: ['link']}, {field: 'open', values: ['menu', 'link']}, - {field: 'joint', values: ['menu', 'link']}, + {field: 'joint', values: ['miniprogram']}, + {field: 'miniAppId', values: ['miniprogram']}, + {field: 'miniPath', values: ['miniprogram']}, ] }, { @@ -218,17 +246,10 @@ field: 'menu', label: '鍏宠仈鑿滃崟', initval: setting.menu || (appType ? '' : []), + tooltip: `琛屼俊鎭�${appType ? '锛堝瓧娈甸泦涓墠40涓暱搴︿笉瓒呰繃256鐨勫瓧娈碉級' : ''}灏嗕紶閫掕嚦姝よ彍鍗曪紝鍙湪url鍙橀噺銆佽〃鍗曪紙鍏宠仈涓昏〃锛夈�侀潤鎬佸睘鎬у崱銆佹诞鍔ㄥ崱涓娇鐢ㄣ�俙, required: true, + extendName: 'MenuNo', options: appType ? appmenulist : menulist, - }, - { - type: 'textarea', - field: 'linkurl', - label: '閾炬帴', - initval: setting.linkurl || '', - required: true, - options: [], - span: 24 }, { type: 'radio', @@ -237,10 +258,25 @@ initval: setting.open || 'blank', required: false, options: [ - {value: 'blank', label: '鏂扮獥鍙�'}, - {value: 'self', label: '褰撳墠绐楀彛'}, + {value: 'blank', label: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'}, + {value: 'self', label: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'}, ], - forbid: appType !== 'pc' + forbid: appType !== 'pc' && appType !== 'mob' + }, + { + type: 'text', + field: 'miniAppId', + label: '灏忕▼搴廇ppID', + initval: setting.miniAppId || '', + required: true + }, + { + type: 'text', + field: 'miniPath', + label: '椤甸潰璺緞', + initval: setting.miniPath || '', + tooltip: '鍙寚瀹氳烦杞皬绋嬪簭椤甸潰锛屼负绌烘椂鎵撳紑棣栭〉锛屾敞锛氬弬鏁版嫾鎺ュ湪鎸囧畾椤甸潰鏃舵湁鏁堛��', + required: false }, { type: 'radio', @@ -253,6 +289,17 @@ {value: 'false', label: '鍚�'}, ], }, + { + type: 'textarea', + field: 'linkurl', + label: '閾炬帴', + initval: setting.linkurl || '', + tooltip: '鍦ㄩ摼鎺ヤ腑浠***@褰㈠紡鎷兼帴鐨勫瓧娈碉紙瀛楁鏉ユ簮浜庡瓧娈甸泦涓紝姝ゅ id銆乤ppkey銆乽serid銆丩oginUID 涓虹郴缁熷瓧娈碉級锛岃烦杞椂灏嗘浛鎹负瀵瑰簲鍊硷紝渚嬪锛歨ttp://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@锛屽叾涓璦ppkey涓嶭oginUID灏嗚鏇挎崲銆�', + toolWidth: 350, + required: true, + options: [], + span: 24 + }, ] return cardSettingForm -- Gitblit v1.8.0