| | |
| | | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class NodeUpdate extends Component { |
| | | static propTpyes = { |
| | | node: PropTypes.object, |
| | |
| | | lineType = 'dash' |
| | | } |
| | | |
| | | let font = node.labels && node.labels[0] ? node.labels[0].attrs.label : {} |
| | | |
| | | return [ |
| | | { |
| | | type: 'title', |
| | |
| | | type: 'text', |
| | | field: 'title', |
| | | label: '标签', |
| | | initval: title |
| | | initval: font.text || '' |
| | | }, |
| | | { |
| | | type: 'title', |
| | |
| | | {value: 'solid', text: '实线'}, |
| | | {value: 'dash', text: '虚线'} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'title', |
| | | label: '标签样式' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'fontSize', |
| | | label: '字号', |
| | | initval: font.fontSize || 14 |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'fontFill', |
| | | label: '颜色', |
| | | initval: font.fill || '#000000' |
| | | } |
| | | ] |
| | | } else if (node.shape === 'lane') { |
| | |
| | | label: '内容' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | type: 'textarea', |
| | | field: 'title', |
| | | label: '标签', |
| | | initval: title |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'textarea') { |
| | | fields.push( |
| | | <Col span={24} key={index} style={{padding: '0 12px'}}> |
| | | <TextArea defaultValue={item.initval} rows={3} onChange={(e) => this.change(e.target.value, item.field)} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |