From 26d0fa42ea8c63a87e8ef93d0915f75f46fb1f9c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 24 三月 2022 11:09:53 +0800 Subject: [PATCH] 2022-03-24 --- src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx | 124 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 122 insertions(+), 2 deletions(-) diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx index 3449d39..9a90e00 100644 --- a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx @@ -8,11 +8,12 @@ * @param {object} card // 鍥捐〃瀵硅薄 */ export function getBaseForm (card) { + let appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') if (roleList) { try { roleList = JSON.parse(roleList) - } catch { + } catch (e) { roleList = [] } } else { @@ -63,7 +64,8 @@ initVal: card.blacklist || [], multi: true, required: false, - options: roleList + options: roleList, + forbid: !!appType } ] } @@ -73,6 +75,7 @@ * @param {Array} columns // 鏄剧ず鍒� */ export function getOptionForm (card, columns) { + let appType = sessionStorage.getItem('appType') let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) return [ @@ -126,6 +129,20 @@ value: 'false', text: '涓嶄娇鐢�' }] + }, { + type: 'radio', + key: 'download', + label: '瀵煎嚭鍥剧墖', + initVal: card.download || 'forbid', + required: false, + forbid: appType === 'mob', + options: [{ + value: 'forbid', + text: '绂佺敤' + }, { + value: 'enable', + text: '鍚敤' + }] }, { type: 'color', @@ -143,3 +160,106 @@ } ] } + +/** + * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 + * @param {object} card // 鍥捐〃瀵硅薄 + * @param {Array} columns // 鏄剧ず鍒� + */ +export function getRadioOptionForm (card, columns) { + let appType = sessionStorage.getItem('appType') + let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) + let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) + + return [ + { + type: 'select', + key: 'labelField', + label: '鎸囨爣', + initVal: card.labelField || '', + required: true, + options: xfields + }, + { + type: 'select', + key: 'valueField', + label: '鍊�', + initVal: card.valueField || '', + required: true, + options: yfields + }, + { + type: 'number', + key: 'maxValue', + label: '鏈�澶у��', + initVal: card.maxValue || 100, + min: 0, + max: 999999, + decimal: 1, + required: true + }, + { + type: 'number', + key: 'radius', + label: '澶栫幆', + initVal: card.radius || 75, + tooltip: '鍥惧舰鎵�鍗犲尯鍩熺殑鐧惧垎鐜囥��', + min: 30, + max: 100, + decimal: 0, + required: true + }, + { + type: 'number', + key: 'fontSize', + label: '瀛椾綋澶у皬', + initVal: card.fontSize || 28, + min: 12, + max: 200, + decimal: 0, + required: true + }, + { + type: 'radio', + key: 'percent', + label: '鐧惧垎鐜�', + initVal: card.percent || 'true', + required: false, + options: [{ + value: 'true', + text: '浣跨敤' + }, { + value: 'false', + text: '涓嶄娇鐢�' + }] + }, { + type: 'radio', + key: 'download', + label: '瀵煎嚭鍥剧墖', + initVal: card.download || 'forbid', + required: false, + forbid: appType === 'mob', + options: [{ + value: 'forbid', + text: '绂佺敤' + }, { + value: 'enable', + text: '鍚敤' + }] + }, + { + type: 'color', + key: 'backColor', + label: '鑳屾櫙鑹�', + initVal: card.backColor || '#ebedf0', + required: false + }, + { + type: 'color', + key: 'labelColor', + label: '瀛椾綋棰滆壊', + initVal: card.labelColor || '#8c8c8c', + required: false + } + ] +} -- Gitblit v1.8.0