From c268999fa9a5894289e436165730525c18be93aa Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 07 八月 2023 20:42:09 +0800
Subject: [PATCH] 2023-08-07

---
 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx |   72 ++++++++++++++++++++++++++----------
 1 files changed, 52 insertions(+), 20 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 d279a75..722012a 100644
--- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
@@ -1,10 +1,11 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Form, Row, Col, Input, Select, Radio, InputNumber } from 'antd'
+import { Form, Row, Col, Input, Select, Radio, InputNumber, Modal } from 'antd'
+import { FormOutlined } from '@ant-design/icons'
 
 import ColorSketch from '@/mob/colorsketch'
-
+import NodeForm from './nodeform'
 import './index.scss'
 
 const { TextArea } = Input
@@ -12,15 +13,19 @@
 class NodeUpdate extends Component {
   static propTpyes = {
     node: PropTypes.object,
-    rolelist: PropTypes.array
+    orgs: PropTypes.array
   }
 
   state = {
-    formlist: null
+    formlist: null,
+    mknode: null,
+    mkdata: null
   }
 
   UNSAFE_componentWillMount () {
     this.setState({
+      mknode: this.props.node,
+      mkdata: this.props.node.mkdata || '',
       formlist: this.getFormList(this.props.node)
     })
   }
@@ -31,6 +36,8 @@
         formlist: null
       }, () => {
         this.setState({
+          mknode: nextProps.node,
+          mkdata: nextProps.node.mkdata || '',
           formlist: this.getFormList(nextProps.node)
         })
       })
@@ -127,6 +134,10 @@
           field: 'fontFill',
           label: '棰滆壊',
           initval: font.fill || '#000000'
+        },
+        {
+          type: 'other',
+          label: '鑷畾涔変俊鎭�'
         }
       ]
     } else if (node.shape === 'lane') {
@@ -350,22 +361,9 @@
           initval: fontFill
         },
         {
-          type: 'title',
+          type: 'other',
           label: '鑷畾涔変俊鎭�'
-        },
-        {
-          type: 'text',
-          field: 'mksign',
-          label: '鏍囪',
-          initval: node.mksign || ''
-        },
-        {
-          type: 'select',
-          field: 'mkroleid',
-          label: '瑙掕壊',
-          initval: node.mkroleid || '',
-          options: this.props.rolelist.map(item => ({value: item.RoleID, text: item.RoleName}))
-        },
+        }
       ]
     }
   }
@@ -386,8 +384,15 @@
     this.props.onChange(value, key)
   }
 
+  confirm = () => {
+    this.nodeRef.handleConfirm().then(res => {
+      this.setState({visible: false, mkdata: res})
+      this.props.onChange(res, 'mkdata')
+    })
+  }
+
   getFields() {
-    const { formlist } = this.state
+    const { formlist, mkdata, mknode } = this.state
     const fields = []
 
     if (!formlist) return
@@ -462,17 +467,44 @@
             </Form.Item>
           </Col>
         )
+      } else if (item.type === 'other') {
+        fields.push(
+          <Col span={24} key={index}>
+            <span className="split-line">{item.label}锛�<FormOutlined onClick={() => {this.setState({visible: true})}}/></span>
+            {mkdata ? <div className="mk-data">
+              <div>鐘舵�侊細{mkdata.status}<span style={{float: 'right'}}>{mkdata.statusName}</span></div>
+              {mknode.shape !== 'edge' && !mknode.mknode ? <div>鏍囪锛歿mkdata.sign || ''}</div> : null}
+              {mkdata.roleId ? <div>瑙掕壊锛歿mkdata.roleName || ''}</div> : null}
+              {mkdata.depId ? <div>閮ㄩ棬锛歿mkdata.depName || ''}</div> : null}
+              <div>澶囨敞锛歿mkdata.remark || ''}</div>
+            </div> : null}
+          </Col>
+        )
       }
     })
     return fields
   }
 
   render() {
+    const { visible, mkdata, mknode } = this.state
+
     return (
       <div className="node-edit-form-wrap">
         <Form className="node-edit-form">
           <Row>{this.getFields()}</Row>
         </Form>
+        <Modal
+          title="鑺傜偣缂栬緫"
+          visible={visible}
+          closable={false}
+          maskClosable={false}
+          width={1000}
+          onOk={this.confirm}
+          onCancel={() => this.setState({visible: false})}
+          destroyOnClose
+        >
+          <NodeForm node={mknode} data={mkdata} orgs={this.props.orgs} handleSubmit={() => this.confirm()} wrappedComponentRef={(inst) => this.nodeRef = inst}/>
+        </Modal>
       </div>
     )
   }

--
Gitblit v1.8.0