From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 四月 2025 12:18:03 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/zshare/mutilform/mkColor/index.jsx | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/tabviews/zshare/mutilform/mkColor/index.jsx b/src/tabviews/zshare/mutilform/mkColor/index.jsx index d783e56..30f3cba 100644 --- a/src/tabviews/zshare/mutilform/mkColor/index.jsx +++ b/src/tabviews/zshare/mutilform/mkColor/index.jsx @@ -6,7 +6,7 @@ import './index.scss' const presetColors = [ - '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#2f54eb', '#722ed1', + '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#1890ff', '#3860f4', '#722ed1', '#eb2f96', '#595959', '#ffa39e', '#ffbb96', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', '#adc6ff', '#d3adf7', '#ffadd2', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' ] @@ -29,9 +29,17 @@ handleChange = (color) => { let _color = `rgba(${ color.rgb.r }, ${ color.rgb.g }, ${ color.rgb.b }, ${ color.rgb.a })` - this.setState({ color: _color }, () => { - this.props.onChange(_color) - }) + if (this.props.config.colorType !== 'hex') { + this.setState({ color: _color }, () => { + this.props.onChange(_color) + }) + } else { + let _hex = color.hex === 'transparent' ? '#ffffff' : color.hex + + this.setState({ color: _hex }, () => { + this.props.onChange(_hex) + }) + } } componentWillUnmount () { @@ -42,6 +50,7 @@ render() { const { color } = this.state + return ( <div className="color-sketch-block"> <Popover content={ -- Gitblit v1.8.0