import { Button, Form, Input } from 'antd'; import React, { Component } from 'react'; import { ConfigItemProp } from '../../../component/chart.d'; import styles from "./index.module.css"; import { ConfigItemInterface } from "./configItem.d"; import { ColorResult, RGBColor, SketchPicker } from "react-color" interface Prop extends ConfigItemInterface { } interface State { showBoard : boolean ;//显示完整面板 } export default class ConfigItemColorSelector extends Component { state : State = { showBoard : false, } onChange = (color: ColorResult, event: React.ChangeEvent)=>{ const rgb:RGBColor = color.rgb; const t:string = `rgba(${rgb.r},${rgb.g},${rgb.b},${rgb.a||1})` ; this.props.onChange && this.props.onChange({ ...this.props.data, value : t }) } onChangeBoardStatus = ()=>{ this.setState({showBoard : !this.state.showBoard}) } render(){ const {data}= this.props; const {showBoard} = this.state; return ( { showBoard ?:null } ) } }