king
2023-08-04 465be8b618c1fb139d56ed779ff6f4dbc8d89b89
src/tabviews/custom/components/chart/antv-X6/nodeupdate/nodeform.jsx
@@ -12,9 +12,7 @@
    rolelist: PropTypes.array
  }
  state = {
    ctrlType: this.props.data.ctrlType || 'role'
  }
  state = {}
  handleConfirm = () => {
    const { rolelist } = this.props
@@ -49,7 +47,6 @@
  render() {
    const { node, rolelist } = this.props
    const { getFieldDecorator } = this.props.form
    const { ctrlType } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -61,6 +58,12 @@
      }
    }
    let data = this.props.data || {}
    let nodetype = node.shape !== 'edge' ? 'node' : 'edge'
    if (node.mknode === 'start') {
      nodetype = 'start'
    } else if (node.mknode === 'end') {
      nodetype = 'end'
    }
    return (
      <Form {...formItemLayout} className="normal-node-form">
@@ -68,7 +71,7 @@
          <Col span={12}>
            <Form.Item label="状态值">
              {getFieldDecorator('status', {
                initialValue: data.status || 0,
                initialValue: data.status === undefined ? 0 : data.status,
                rules: [
                  {
                    required: true,
@@ -89,7 +92,7 @@
              )}
            </Form.Item>
          </Col>
          {node.shape !== 'edge' ? <Col span={12}>
          {nodetype === 'node' ? <Col span={12}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="标记将作为节点ID">
                <QuestionCircleOutlined className="mk-form-tip" />
@@ -103,20 +106,32 @@
              )}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="类型">
              {getFieldDecorator('ctrlType', {
                initialValue: data.ctrlType || 'role'
          {nodetype === 'node' ? <Col span={12}>
            <Form.Item label="审批人">
              {getFieldDecorator('approver', {
                initialValue: data.approver || 'member'
              })(
                <Radio.Group onChange={(e) => this.setState({ctrlType: e.target.value})}>
                  <Radio value="role">角色</Radio>
                  <Radio value="department">部门</Radio>
                  <Radio value="none">无</Radio>
                <Radio.Group>
                  <Radio value="member">指定成员</Radio>
                  <Radio value="departmentManager">部门主管</Radio>
                  <Radio value="directManager">直属主管</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          {ctrlType === 'role' ? <Col span={12}>
          </Col> : null}
          {nodetype === 'node' ? <Col span={12}>
            <Form.Item label="审批方式">
              {getFieldDecorator('approvalMethod', {
                initialValue: data.approvalMethod || 'countersign'
              })(
                <Radio.Group>
                  <Radio value="countersign">会签</Radio>
                  <Radio value="orsign">或签</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="角色">
              {getFieldDecorator('roleId', {
                initialValue: data.roleId || '',
@@ -132,8 +147,8 @@
                </Select>
              )}
            </Form.Item>
          </Col> : null}
          {ctrlType === 'department' ? <Col span={12}>
          </Col>
          <Col span={12}>
            <Form.Item label="部门">
              {getFieldDecorator('depId', {
                initialValue: data.depId || '',
@@ -149,7 +164,7 @@
                </Select>
              )}
            </Form.Item>
          </Col> : null}
          </Col>
          <Col span={24}>
            <Form.Item label="备注">
              {getFieldDecorator('remark', {