From e41a64966b7832baffe96c21d1ea77ef6adb2905 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 14 十月 2021 18:31:55 +0800 Subject: [PATCH] 2021-10-14 --- src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 100 ++++++++++++++++++++++++++++++++++---------------- 1 files changed, 68 insertions(+), 32 deletions(-) diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 64cdddb..f3b35e2 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -8,40 +8,12 @@ * @param {object} card // 鍥捐〃瀵硅薄 */ 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 appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') if (roleList) { try { roleList = JSON.parse(roleList) - } catch { + } catch (e) { roleList = [] } } else { @@ -92,7 +64,8 @@ initVal: card.blacklist || [], multi: true, required: false, - options: roleList + options: roleList, + forbid: !!appType }, // { // type: 'cascader', @@ -135,6 +108,7 @@ * @param {Array} columns // 鏄剧ず鍒� */ export function getOptionForm (card, columns) { + let appType = sessionStorage.getItem('appType') let shapes = [] if (card.chartType === 'line') { @@ -311,7 +285,7 @@ text: '鐧惧垎姣�' }] }, { - type: labelOptions.length > 2 ? 'select' : 'radio', + type: labelOptions.length > 20 ? 'select' : 'radio', key: 'label', label: '鏍囩', initVal: card.label || 'false', @@ -364,6 +338,7 @@ key: 'area', label: '闈㈢Н鍥�', initVal: card.area || 'false', + // tooltip: '浠呭湪褰㈢姸涓簊mooth鏃舵湁鏁堛��', required: false, forbid: ['bar'].includes(card.chartType), options: [{ @@ -403,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: '鏌卞舰瀹藉害', @@ -425,11 +427,33 @@ 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', @@ -441,12 +465,24 @@ 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', key: 'interaction', label: '浜や簰鏁堟灉', initVal: card.interaction || [], multi: true, required: false, + forbid: appType === 'mob', options: [ { value: 'element-active', label: '鍏冪礌鑱氱劍' }, { value: 'element-selected', label: '鍏冪礌閫変腑锛堝閫夛級' }, -- Gitblit v1.8.0