From f2914103477e253f8af4b9f847933c0c7848c330 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 29 六月 2023 18:21:31 +0800 Subject: [PATCH] 2023-06-29 --- src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx | 64 ++++++++++++++++++++++++++++---- 1 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx index 16e067f..d0b7f99 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx @@ -7,9 +7,12 @@ import './index.scss' +const { TextArea } = Input + class NodeUpdate extends Component { static propTpyes = { - node: PropTypes.object + node: PropTypes.object, + rolelist: PropTypes.array } state = { @@ -196,14 +199,30 @@ } ] } else if (node.shape === 'mk-text') { - let fontFill = '#262626' - if (node.attrs && node.attrs.text) { - fontFill = node.attrs.text.fill || '#262626' + if (node.attrs && node.attrs.label) { + title = node.attrs.label.text || '' } - let fontSize = 12 - if (node.attrs && node.attrs.text) { - fontSize = node.attrs.text.fontSize || 12 + let fill = '' + + if (node.attrs && node.attrs.body) { + fill = node.attrs.body.fill || '' + } + + let stroke = '' + + if (node.attrs && node.attrs.body) { + stroke = node.attrs.body.stroke || '' + } + + let fontFill = '#262626' + if (node.attrs && node.attrs.label) { + fontFill = node.attrs.label.style.color || '#262626' + } + + let fontSize = 14 + if (node.attrs && node.attrs.label) { + fontSize = node.attrs.label.style.fontSize || 14 } return [ { @@ -211,10 +230,26 @@ label: '鍐呭' }, { - type: 'text', + type: 'textarea', field: 'title', label: '鏍囩', initval: title + }, + { + type: 'title', + label: '鏍峰紡' + }, + { + type: 'color', + field: 'fill', + label: '鑳屾櫙', + initval: fill + }, + { + type: 'color', + field: 'stroke', + label: '杈规', + initval: stroke }, { type: 'title', @@ -306,6 +341,13 @@ label: '鏍囪', initval: node.mksign || '' }, + { + type: 'select', + field: 'mkroleid', + label: '瑙掕壊', + initval: node.mkroleid || '', + options: this.props.rolelist.map(item => ({value: item.RoleID, text: item.RoleName})) + }, ] } } @@ -347,6 +389,12 @@ </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}> -- Gitblit v1.8.0