From cdf86bb4d627156e1a32b5381e3e52f9cf477e82 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 24 四月 2024 16:05:08 +0800 Subject: [PATCH] 2024-04-24 --- src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 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 e125341..91c6cee 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({ @@ -44,6 +49,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) => { let roleList = sessionStorage.getItem('sysRoles') if (roleList) { -- Gitblit v1.8.0