From d1d9dc29318cb2a9a466246adff7b78fe36cf623 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 11 三月 2023 17:51:29 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/pc/bgcontroller/index.jsx | 72 ++++++++++++++++++++++++++++++++++- 1 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/pc/bgcontroller/index.jsx b/src/pc/bgcontroller/index.jsx index 35def8d..35f3fd0 100644 --- a/src/pc/bgcontroller/index.jsx +++ b/src/pc/bgcontroller/index.jsx @@ -2,13 +2,14 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { Form, Select, Input } from 'antd' -import { ArrowUpOutlined, ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined } from '@ant-design/icons' +import { ArrowUpOutlined, ArrowDownOutlined, ArrowLeftOutlined, ArrowRightOutlined, BgColorsOutlined, ColumnWidthOutlined } from '@ant-design/icons' import asyncComponent from '@/utils/asyncComponent' import './index.scss' const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) const StyleInput = asyncComponent(() => import('@/menu/stylecontroller/styleInput')) +const SysColorSketch = asyncComponent(() => import('@/menu/stylecontroller/syscolorsketch')) const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) const { Option } = Select @@ -150,8 +151,52 @@ } } + /** + * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠� + */ + changeShadowColor = (val) => { + let config = fromJS(this.props.config).toJS() + config.style.shadowColor = val + config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}` + + this.props.updateConfig(config) + } + + /** + * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠� + */ + changeShadowBlur = (val) => { + let config = fromJS(this.props.config).toJS() + config.style.shadowBlur = val + config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}` + + this.props.updateConfig(config) + } + + /** + * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠� + */ + changeHShadow = (val) => { + let config = fromJS(this.props.config).toJS() + config.style.hShadow = val + config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}` + + this.props.updateConfig(config) + } + + /** + * @description 淇敼闃村奖棰滆壊 锛岄鑹叉帶浠� + */ + changeVShadow = (val) => { + let config = fromJS(this.props.config).toJS() + config.style.vShadow = val + config.style.boxShadow = `${config.style.hShadow || '0px'} ${config.style.vShadow || '0px'} ${config.style.shadowBlur || '0px'} ${config.style.shadowColor || 'transparent'}` + + this.props.updateConfig(config) + } + render () { - const { config } = this.props + const { config, type } = this.props const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat, backgroundPosition, background } = this.state const formItemLayout = { labelCol: { @@ -174,8 +219,11 @@ > <StyleInput defaultValue={config.style.width || '100%'} options={['px', '%', 'vw']} onChange={(val) => this.changePadding(val, 'width')}/> </Form.Item> */} - <Form.Item className="color-control" colon={false} label="鑳屾櫙鑹�"> + <Form.Item className="color-control" style={{marginBottom: '0px'}} colon={false} label="鑳屾櫙鑹�"> <ColorSketch value={backgroundColor} onChange={this.changeBackgroundColor} /> + </Form.Item> + <Form.Item colon={false} label="绯荤粺鑹�"> + <SysColorSketch onChange={this.changeBackgroundColor} /> </Form.Item> {window.develop === true ? <Form.Item colon={false} label="棰滆壊"> <Input value={background} onChange={(e) => this.changeBackground(e.target.value)} /> @@ -209,6 +257,24 @@ <Option value="bottom">bottom</Option> </Select> </Form.Item> + {type === 'mob_popview' ? <p className="normal-view" style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>闃村奖</p> : null} + {type === 'mob_popview' ? <> + <Form.Item colon={false} label={<BgColorsOutlined title="闃村奖棰滆壊"/>}> + <ColorSketch value={config.style.shadowColor || 'transparent'} onChange={this.changeShadowColor} /> + </Form.Item> + <Form.Item colon={false} label={<BgColorsOutlined title="绯荤粺鑹�"/>}> + <SysColorSketch onChange={this.changeShadowColor} /> + </Form.Item> + <Form.Item colon={false} label={<ColumnWidthOutlined title="妯$硦璺濈"/>}> + <StyleInput defaultValue={config.style.shadowBlur || '0px'} options={['px']} onChange={this.changeShadowBlur}/> + </Form.Item> + <Form.Item colon={false} label={<ArrowRightOutlined title="姘村钩浣嶇疆"/>}> + <StyleInput defaultValue={config.style.hShadow || '0px'} options={['px']} onChange={this.changeHShadow}/> + </Form.Item> + <Form.Item colon={false} label={<ArrowDownOutlined title="鍨傜洿浣嶇疆"/>}> + <StyleInput defaultValue={config.style.vShadow || '0px'} options={['px']} onChange={this.changeVShadow}/> + </Form.Item> + </> : null} <p className="normal-view" style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>鍐呰竟璺�</p> <Form.Item colon={false} -- Gitblit v1.8.0