forked from huge/frontEnd/hugeOA

Mr Ke
2020-05-27 fa71559c92ce8f7429971370ca4bd1139c903621
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import React from 'react';
import { Link } from 'react-router-dom';
import { Card, Row, Col, Icon, Button, Table, message,Breadcrumb,Layout } from 'antd';
import Fetch from '../fetch';
const { Column } = Table;
 
 
export default class ActivitiDetail extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      loading: true,
      tableData: [],
    };
  }
 
  componentDidMount() {
    const deploymentId = this.props.location.state.deploymentId;
    let _this = this;
    _this.setState({ loading: true });
    Fetch.getProcessDefinition({
      deploymentId
    }).then( res => {
      console.log(res)
      let tmpArr = [];
      res.map(e => {
        let obj = {
          key: e.id,
          _key:e.key, 
          id:e.id,
          version:e.version,
          status:e.status,
          name: e.name, 
          createTime: e.createTime,
        }
        tmpArr.push(obj)
      })
      this.setState({
        tableData: tmpArr,
        loading: false,
      });
    })
  }
 
  render() {
    return (
      <Layout className="h-100 page-table">
        <Row>
          <Breadcrumb className="breadcrumb-style">
            <Breadcrumb.Item>工作流管理</Breadcrumb.Item>
            <Breadcrumb.Item>流程部署管理</Breadcrumb.Item>
            <Breadcrumb.Item>详情</Breadcrumb.Item>
          </Breadcrumb>
        </Row>
        <Card style={{border:20, margin:20, padding:20}}>
        <Row>
        <Link to="/activitiManage/deploy"><Button type="default">返回</Button></Link>
        </Row>
          <Row>
            <Table dataSource={this.state.tableData} pagination={false}>
              <Column
                title="流程KEY"
                dataIndex="_key"
                key="_key"
              />
              <Column
                title="流程名称"
                dataIndex="name"
                key="name"
              />
              <Column
                title="流程版本"
                dataIndex="version"
                key="version"
              />
              <Column
                title="当前状态"
                dataIndex="status"
                key="status"
                render={(text, record) => text?"运行":"挂起"}
              />
              <Column
                title="操作"
                key="action"
                render={(text, record) => (
                  <span>
                    <Link to={{ pathname: "/activitiManage/activitiImg", state: { id: record.id} }}>流程图</Link>
                  </span>
                )}
              />
            </Table>
 
          </Row>
        </Card>
      </Layout>
    )
  } 
}