From 31ec63f0419895876cbaba99637a884a32d33d0d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 01 九月 2021 10:31:45 +0800 Subject: [PATCH] 2021-09-01 --- src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx | 72 +---------------------------------- 1 files changed, 3 insertions(+), 69 deletions(-) diff --git a/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx b/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx index e530784..86b99e9 100644 --- a/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx +++ b/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx @@ -214,11 +214,7 @@ item.hidden = true } else if (item.key === 'height' && ['table', 'card'].includes(_type)) { item.hidden = true - } else if (item.key === 'widthType' && _type === 'card') { - item.hidden = false } else if (item.key === 'cardWidth' && _type === 'card') { - item.hidden = false - } else if (item.key === 'over' && _type === 'card') { item.hidden = false } else if (item.key === 'border' && _type === 'card') { item.hidden = false @@ -241,7 +237,7 @@ try { let _form = document.getElementById('title') _form.select() - } catch { + } catch (e) { console.warn('琛ㄥ崟focus澶辫触锛�') } } @@ -256,7 +252,6 @@ } typeChange = (key, value) => { - const { card } = this.props let formlist = JSON.parse(JSON.stringify(this.props.formlist)) if (key === 'chartType') { @@ -268,13 +263,7 @@ item.hidden = true } else if (item.key === 'height' && ['table', 'card'].includes(value)) { item.hidden = true - } else if (item.key === 'widthType' && value === 'card') { - item.hidden = false } else if (item.key === 'cardWidth' && value === 'card') { - item.min = card.widthType === 'absolute' ? 50 : 1 - item.max = card.widthType === 'absolute' ? 1000 : 24 - item.hidden = false - } else if (item.key === 'over' && value === 'card') { item.hidden = false } else if (item.key === 'border' && value === 'card') { item.hidden = false @@ -285,54 +274,6 @@ } else if (item.key === 'bgfield') { item.hidden = value !== 'card' } - return item - }) - }) - } - } - - radioChange = (val, key) => { - const { formlist } = this.state - - if (key === 'widthType') { - this.setState({ - formlist: formlist.map(item => { - if (item.key === 'cardWidth') { - item.min = val === 'absolute' ? 50 : 1 - item.max = val === 'absolute' ? 1000 : 24 - } - - return item - }) - }) - if (val === 'absolute') { - this.props.form.setFieldsValue({cardWidth: 250}) - } else { - this.props.form.setFieldsValue({cardWidth: 6}) - } - } else if (key === 'over' && val === 'roll') { - this.setState({ - formlist: formlist.map(item => { - if (item.key === 'cardWidth') { - item.min = 50 - item.max = 1000 - } else if (item.key === 'widthType') { - item.readonly = true - } - - return item - }) - }) - if (this.props.form.getFieldValue('widthType') !== undefined) { - this.props.form.setFieldsValue({widthType: 'absolute', cardWidth: 250}) - } - } else if (key === 'over' && val === 'whole') { - this.setState({ - formlist: formlist.map(item => { - if (item.key === 'widthType') { - item.readonly = false - } - return item }) }) @@ -451,7 +392,7 @@ } ] })( - <Radio.Group onChange={(e) => this.radioChange(e.target.value, item.key)} disabled={item.readonly}> + <Radio.Group disabled={item.readonly}> { item.options.map(option => { return ( @@ -510,7 +451,7 @@ card: 'credit-card' } - if (result.chartType === 'line' || result.chartType === 'bar' || result.chartType === 'line') { + if (result.chartType === 'line' || result.chartType === 'bar' || result.chartType === 'pie') { if (selectlegend && this.props.card.modelId !== selectlegend.uuid) { result = {...result, ...selectlegend.options} } @@ -527,11 +468,6 @@ } else if (result.chartType === 'card') { if (selectlegend) { result.subelement = selectlegend.subelement - } - - if (result.widthType === 'ratio' && result.avatar && result.avatar.widthType !== 'ratio') { - result.avatar.widthType = 'ratio' - result.avatar.width = 32 } if (!result.details) { @@ -557,9 +493,7 @@ type: 'picture', field: '', size: 14, - widthType: 'ratio', width: 32, - avatarWidth: 32, radius: 'true', display: 'inline' } -- Gitblit v1.8.0