From 2cb09105d702ccae0644126ca6ea7f85e1f218bc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 10 十二月 2021 14:06:14 +0800 Subject: [PATCH] 2021-12-10 --- src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 229 +++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 159 insertions(+), 70 deletions(-) diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index ae7e6fd..5be7778 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -9,39 +9,11 @@ */ export function getBaseForm (card) { let appType = sessionStorage.getItem('appType') - let menulist = null - - if (appType === 'pc') { - menulist = sessionStorage.getItem('appMenus') - if (Array.isArray(card.linkmenu)) { - card.linkmenu = '' - } - } else { - menulist = sessionStorage.getItem('fstMenuList') - } - - if (menulist) { - try { - menulist = JSON.parse(menulist) - if (appType === 'pc') { - menulist = menulist.map(item => { - item.value = item.MenuID - item.text = item.MenuName - return item - }) - } - } catch { - menulist = [] - } - } else { - menulist = [] - } - let roleList = sessionStorage.getItem('sysRoles') if (roleList) { try { roleList = JSON.parse(roleList) - } catch { + } catch (e) { roleList = [] } } else { @@ -92,40 +64,41 @@ initVal: card.blacklist || [], multi: true, required: false, - options: roleList + options: roleList, + forbid: !!appType }, - { - type: 'cascader', - key: 'linkmenu', - label: '鍏宠仈鑿滃崟', - initVal: card.linkmenu || [], - tooltip: '鍦ㄤ娇鐢ㄦ煴褰㈠浘涓旀湭鍚敤鑷畾涔夎缃椂鏈夋晥銆�', - required: false, - forbid: appType === 'pc' || appType === 'mob', - options: menulist - }, - { - type: 'select', - key: 'linkmenu', - label: '鍏宠仈鑿滃崟', - initVal: card.linkmenu || '', - tooltip: '鍙屽嚮鏌辩姸鍥撅紝浼氭墦寮�鍏宠仈鐨勮彍鍗曘��', - required: false, - forbid: appType !== 'pc', - options: menulist - }, - { - type: 'radio', - key: 'open', - label: '鎵撳紑鏂瑰紡', - initVal: card.open || 'blank', - required: false, - forbid: appType !== 'pc', - options: [ - { value: 'blank', text: '鏂扮獥鍙�' }, - { value: 'self', text: '褰撳墠绐楀彛' } - ] - } + // { + // type: 'cascader', + // key: 'linkmenu', + // label: '鍏宠仈鑿滃崟', + // initVal: card.linkmenu || [], + // tooltip: '鍦ㄤ娇鐢ㄦ煴褰㈠浘涓旀湭鍚敤鑷畾涔夎缃椂鏈夋晥銆�', + // required: false, + // forbid: appType === 'pc' || appType === 'mob', + // options: menulist + // }, + // { + // type: 'select', + // key: 'linkmenu', + // label: '鍏宠仈鑿滃崟', + // initVal: card.linkmenu || '', + // tooltip: '鍙屽嚮鏌辩姸鍥撅紝浼氭墦寮�鍏宠仈鐨勮彍鍗曘��', + // required: false, + // forbid: appType !== 'pc', + // options: menulist + // }, + // { + // type: 'radio', + // key: 'open', + // label: '鎵撳紑鏂瑰紡', + // initVal: card.open || 'blank', + // required: false, + // forbid: appType !== 'pc', + // options: [ + // { value: 'blank', text: '鏂扮獥鍙�' }, + // { value: 'self', text: '褰撳墠绐楀彛' } + // ] + // } ] } @@ -135,6 +108,7 @@ * @param {Array} columns // 鏄剧ず鍒� */ export function getOptionForm (card, columns) { + let appType = sessionStorage.getItem('appType') let shapes = [] if (card.chartType === 'line') { @@ -162,6 +136,28 @@ let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) + let labelOptions = [{ + value: 'false', + text: '闅愯棌' + }, { + value: 'true', + text: '鏄剧ず' + }] + + if (card.chartType === 'bar') { + labelOptions[1].text = '澶栭儴' + labelOptions.push(...[{ + value: 'top', + text: '椤堕儴' + }, { + value: 'middle', + text: '涓棿' + }, { + value: 'bottom', + text: '搴曢儴' + }]) + } + return [ { type: 'radio', @@ -171,8 +167,8 @@ tooltip: '缁熻鍥捐〃閫傜敤浜庡睍绀烘暟鎹被鍨嬩负鍔ㄦ�佸�笺��', required: false, options: [ - { value: 'query', text: Formdict['header.form.query'] }, - { value: 'statistics', text: Formdict['header.form.statistics'] } + { value: 'query', text: '鏌ヨ' }, + { value: 'statistics', text: '缁熻' } ] }, { type: 'select', @@ -289,17 +285,25 @@ text: '鐧惧垎姣�' }] }, { - type: 'radio', + type: labelOptions.length > 20 ? 'select' : 'radio', key: 'label', - label: '鏍囨敞鍊�', + label: '鏍囩', initVal: card.label || 'false', required: false, + options: labelOptions + }, { + type: 'radio', + key: 'labelColor', + label: '鏍囩棰滆壊', + initVal: card.labelColor || 'system', + tooltip: '浣跨敤绯荤粺鑹叉椂锛屼娇鐢ㄨ壊绯婚�夐」璁剧疆鐨勭郴缁熼鑹诧紝浣跨敤鑷畾涔変负棰滆壊璁剧疆涓畾涔夌殑鍥惧舰棰滆壊銆�', + required: false, options: [{ - value: 'true', - text: '鏄剧ず' + value: 'system', + text: '绯荤粺' }, { - value: 'false', - text: '闅愯棌' + value: 'custom', + text: '鑷畾涔�' }] // }, { // type: 'radio', @@ -331,6 +335,21 @@ }] }, { type: 'radio', + key: 'area', + label: '闈㈢Н鍥�', + initVal: card.area || 'false', + // tooltip: '浠呭湪褰㈢姸涓簊mooth鏃舵湁鏁堛��', + required: false, + forbid: ['bar'].includes(card.chartType), + options: [{ + value: 'true', + text: '鏄剧ず' + }, { + value: 'false', + text: '涓嶆樉绀�' + }] + }, { + type: 'radio', key: 'repeat', label: '閲嶅鏁版嵁', initVal: card.repeat || 'unrepeat', @@ -359,6 +378,33 @@ text: '鏋佸潗鏍�' }] }, { + type: 'radio', + key: 'grid', + label: '缃戞牸绾�', + initVal: card.grid || 'show', + required: false, + options: [{ + value: 'show', + text: '鏄剧ず' + }, { + value: 'hidden', + text: '闅愯棌' + }] + }, { + type: 'radio', + key: 'y_line', + label: 'y杞磋竟绾�', + initVal: card.y_line || 'hidden', + tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�', + required: false, + options: [{ + value: 'show', + text: '鏄剧ず' + }, { + value: 'hidden', + text: '闅愯棌' + }] + }, { type: 'number', key: 'barSize', label: '鏌卞舰瀹藉害', @@ -381,11 +427,53 @@ forbid: !['bar'].includes(card.chartType), required: false }, { + type: 'number', + key: 'min', + label: '鏈�灏忓��', + tooltip: 'y杞存渶灏忓�硷紝涓虹┖鏃惰嚜閫傚簲銆�', + initVal: card.min, + required: false + }, { + type: 'number', + key: 'max', + label: '鏈�澶у��', + tooltip: 'y杞存渶澶у�硷紝涓虹┖鏃惰嚜閫傚簲銆�', + initVal: card.max, + required: false + }, { type: 'color', key: 'color', label: '鑹茬郴', initVal: card.color || 'rgba(0, 0, 0, 0.65)', tooltip: '鍧愭爣杞存彁绀烘枃瀛楀強绀轰緥鐨勯鑹层��', + required: false + }, { + type: 'color', + key: 'lineColor', + label: '杞寸嚎棰滆壊', + initVal: card.lineColor, + tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞村強缃戞牸绾裤��', + allowClear: true, + required: false + }, { + type: 'color', + key: 'selectColor', + label: '閫変腑棰滆壊', + initVal: card.selectColor || '', + tooltip: '閫変腑鏌卞舰鍥剧殑棰滆壊锛屽湪浜や簰鏁堟灉銆婂厓绱犻�変腑锛堝閫夛級銆嬪拰銆婂厓绱犻�変腑锛堝崟閫夛級銆嬩腑鏈夋晥锛屽惎鐢ㄨ嚜瀹氫箟璁剧疆鏃舵棤鏁堛��', + forbid: !['bar'].includes(card.chartType), + allowClear: true, + required: false + }, { + type: 'number', + key: 'rotate', + label: '鏃嬭浆', + tooltip: '鍧愭爣杞存爣娉ㄦ枃鏈殑鏃嬭浆瑙掑害銆�', + min: 0, + max: 360, + decimal: 0, + initVal: card.rotate, + forbid: appType !== 'mob', required: false }, { type: 'select', @@ -394,6 +482,7 @@ initVal: card.interaction || [], multi: true, required: false, + forbid: appType === 'mob', options: [ { value: 'element-active', label: '鍏冪礌鑱氱劍' }, { value: 'element-selected', label: '鍏冪礌閫変腑锛堝閫夛級' }, -- Gitblit v1.8.0