From 2aa5ab63b4bbce5c36dbb3511b205b3b5f6af9bd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 07 五月 2024 11:34:20 +0800 Subject: [PATCH] 2024-05-07 --- src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 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 bf50398..80c4e33 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx @@ -6,6 +6,7 @@ import ColorSketch from '@/tabviews/zshare/mutilform/mkColor' import NodeForm from './nodeform' +import MKEmitter from '@/utils/events.js' import './index.scss' const { TextArea } = Input @@ -30,6 +31,10 @@ }) } + componentDidMount () { + MKEmitter.addListener('mk-x6-dbclick', this.trigger) + } + UNSAFE_componentWillReceiveProps(nextProps) { if (!is(fromJS(this.props.node), fromJS(nextProps.node))) { this.setState({ @@ -42,6 +47,25 @@ }) }) } + } + + /** + * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆 + */ + componentWillUnmount () { + this.setState = () => { + return + } + + MKEmitter.removeListener('mk-x6-dbclick', this.trigger) + } + + trigger = () => { + const { formlist } = this.state + + if (!formlist || formlist.findIndex(item => item.type === 'other') === -1) return + + this.setState({visible: true}) } getFormList = (node) => { @@ -496,10 +520,12 @@ </Form> <Modal title={mknode && mknode.shape === 'edge' ? '杩炵嚎缂栬緫' : '鑺傜偣缂栬緫'} + wrapClassName="mk-x6-modal" visible={visible} closable={false} maskClosable={false} - width={1000} + width={1070} + centered={true} onOk={this.confirm} onCancel={() => this.setState({visible: false})} destroyOnClose -- Gitblit v1.8.0