From 2e27246b216d3d6bb2d7dc56c889c06ff5f4ea6d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 12 一月 2023 11:11:39 +0800 Subject: [PATCH] 2023-01-12 --- src/templates/zshare/modalform/index.jsx | 2 +- src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx | 4 ++-- src/tabviews/zshare/mutilform/mkColor/index.jsx | 2 +- src/mob/components/sharecode/options.jsx | 2 +- src/templates/zshare/formconfig.jsx | 13 +++++++++++++ src/components/mk-icon/index.jsx | 15 ++++++++++++++- src/templates/modalconfig/dragelement/index.scss | 3 +++ 7 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/components/mk-icon/index.jsx b/src/components/mk-icon/index.jsx index 939b7ff..42e8885 100644 --- a/src/components/mk-icon/index.jsx +++ b/src/components/mk-icon/index.jsx @@ -471,7 +471,20 @@ MkIcons[type](resProps) ) } else { - return <span className={'anticon anticon-mk ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: type }}></span> + let svg = type + + if (!/<svg/.test(svg)) { + try { + svg = window.decodeURIComponent(window.atob(svg)) + if (!/<svg/.test(svg)) { + svg = '' + } + } catch (e) { + svg = '' + } + } + + return <span className={'anticon anticon-mk ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: svg }}></span> } } } diff --git a/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx index aa28f53..9eed12a 100644 --- a/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx @@ -316,7 +316,7 @@ label: '鑺傜偣棰滆壊', initval: card.nodeColor || '#1890ff', tooltip: '鍙充晶鑺傜偣鐨勬爣璁伴鑹层��', - isHex: true, + colorType: 'hex', required: false }, { @@ -325,7 +325,7 @@ label: '宸﹁妭鐐归鑹�', initval: card.leftColor || '#26C281', tooltip: '宸︿晶鑺傜偣鐨勬爣璁伴鑹层��', - isHex: true, + colorType: 'hex', required: false }, { diff --git a/src/mob/components/sharecode/options.jsx b/src/mob/components/sharecode/options.jsx index 560efa3..afd57c9 100644 --- a/src/mob/components/sharecode/options.jsx +++ b/src/mob/components/sharecode/options.jsx @@ -48,7 +48,7 @@ field: 'color', label: '棰滆壊', initval: wrap.color || '#000000', - isHex: true, + colorType: 'hex', required: true }, ] diff --git a/src/tabviews/zshare/mutilform/mkColor/index.jsx b/src/tabviews/zshare/mutilform/mkColor/index.jsx index 562708b..e101e12 100644 --- a/src/tabviews/zshare/mutilform/mkColor/index.jsx +++ b/src/tabviews/zshare/mutilform/mkColor/index.jsx @@ -29,7 +29,7 @@ handleChange = (color) => { let _color = `rgba(${ color.rgb.r }, ${ color.rgb.g }, ${ color.rgb.b }, ${ color.rgb.a })` - if (!this.props.config.isHex) { + if (this.props.config.colorType !== 'hex') { this.setState({ color: _color }, () => { this.props.onChange(_color) }) diff --git a/src/templates/modalconfig/dragelement/index.scss b/src/templates/modalconfig/dragelement/index.scss index a221984..df834a2 100644 --- a/src/templates/modalconfig/dragelement/index.scss +++ b/src/templates/modalconfig/dragelement/index.scss @@ -124,6 +124,9 @@ width: 89.5%; } } + .ant-form-item label > .anticon { + vertical-align: middle; + } } .modal-fields-row.up_down { .ant-form-item { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index dc8dbdd..6626b9b 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3217,6 +3217,19 @@ }, { type: 'radio', + key: 'colorType', + label: '棰滆壊绫诲瀷', + initVal: card.colorType || 'hex', + options: [{ + value: 'hex', + text: '16杩涘埗' + }, { + value: 'rgba', + text: 'RGBA' + }] + }, + { + type: 'radio', key: 'allowHalf', label: '鍗婇��', initVal: card.allowHalf || 'false', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 2cd53c8..db416fb 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -34,7 +34,7 @@ datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom'], cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator'], - color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'], + color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'colorType', 'extra', 'marginTop', 'marginBottom'], rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'color', 'rateCount', 'character', 'place'], hint: ['label', 'field', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline'], -- Gitblit v1.8.0