/** * Created by TonyJiang on 16/8/26. */ import * as React from "react"; import SelectField from "material-ui/SelectField"; import MenuItem from "material-ui/MenuItem"; import {autobind} from "core-decorators"; import {LineStyleEnum} from "../../../../items/properties/enums"; export class StrokeStyleEditor extends React.Component { static propTypes = { value: React.PropTypes.number, onChange: React.PropTypes.func }; static defaultProps = { value: null, onChange: () => { } }; static SupportLineStyles = [ {label: "实线", value: LineStyleEnum.Solid, dasharray: ''}, {label: '虚线', value: LineStyleEnum.Dashed, dasharray: '10 4, 2 4, 10 4'}, {label: '点线', value: LineStyleEnum.Dotted, dasharray: '10'}, // {label: '双实线', value: LineStyleEnum.Double, dasharray: 'double'} ]; render() { const {value} = this.props; const selectStyle = {width: '100%', fontSize: '14px'}; const labelStyle = {top:'7px', paddingLeft:'5px', paddingRight: '30px'}; const items = StrokeStyleEditor.SupportLineStyles.map(item => { // const strokeColor = item.value === value ? '#FF4081' : '#000'; const strokeColor = '#999999'; const line = (
); return ; }); return (
{items}
); } @autobind onChange(event, oldValue, newValue) { const {onChange} = this.props; onChange(newValue); } }