|
| 1 | +import React, { Component, Fragment } from 'react'; |
| 2 | +import { observer, inject } from 'mobx-react'; |
| 3 | +import { Link } from 'react-router-dom'; |
| 4 | +import { translate } from 'react-i18next'; |
| 5 | +import classnames from 'classnames'; |
| 6 | + |
| 7 | +import { Icon, Button, Table, Popover, Select, Modal, Image } from 'components/Base'; |
| 8 | +import Layout, { Dialog, Grid, Row, Section, Card } from 'components/Layout'; |
| 9 | +import { getObjName, mappingStatus, getFilterObj } from 'utils'; |
| 10 | + |
| 11 | +import { records } from './record'; |
| 12 | +import styles from './index.scss'; |
| 13 | + |
| 14 | +@translate() |
| 15 | +@inject(({ rootStore }) => ({ |
| 16 | + rootStore, |
| 17 | + appVersionStore: rootStore.appVersionStore, |
| 18 | + appStore: rootStore.appStore |
| 19 | +})) |
| 20 | +@observer |
| 21 | +export default class AuditRecord extends Component { |
| 22 | + async componentDidMount() { |
| 23 | + const { appStore, match } = this.props; |
| 24 | + const { appId } = match.params; |
| 25 | + |
| 26 | + appStore.fetch(appId); |
| 27 | + } |
| 28 | + |
| 29 | + componentWillUnmount() { |
| 30 | + const { appVersionStore } = this.props; |
| 31 | + appVersionStore.reset(); |
| 32 | + } |
| 33 | + |
| 34 | + render() { |
| 35 | + const { appVersionStore, appStore, t } = this.props; |
| 36 | + const { appDetail } = appStore; |
| 37 | + const statusMap = { |
| 38 | + notStarted: '未开始', |
| 39 | + passed: '已通过', |
| 40 | + processing: '进行中', |
| 41 | + notPassed: '未通过' |
| 42 | + }; |
| 43 | + |
| 44 | + return ( |
| 45 | + <Layout className={styles.auditRecord} pageTitle="审核记录详情"> |
| 46 | + <Row> |
| 47 | + <Card className={styles.baseInfo}> |
| 48 | + <div className={styles.main}> |
| 49 | + <span className={styles.image}> |
| 50 | + <Image iconLetter={appDetail.name} iconSize={48} src={appDetail.icon} /> |
| 51 | + </span> |
| 52 | + <div className={styles.title}>{appDetail.name}</div> |
| 53 | + <div className={styles.word}> |
| 54 | + 交付方式:<label className={styles.value}>Helm</label> |
| 55 | + 版本:<label className={styles.value}>0.0.1</label> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + |
| 59 | + <div className={styles.secondary}> |
| 60 | + <p>申请编号:201810039282092</p> |
| 61 | + <p>提交时间:2018年10月23日 12:22:02</p> |
| 62 | + </div> |
| 63 | + </Card> |
| 64 | + </Row> |
| 65 | + |
| 66 | + <Row> |
| 67 | + <Grid> |
| 68 | + <Section size={12} className={styles.moduleOuter}> |
| 69 | + {records.map(record => ( |
| 70 | + <div |
| 71 | + key={record.title} |
| 72 | + className={classnames(styles.module, [styles[record.status]])} |
| 73 | + > |
| 74 | + <div className={styles.status}> |
| 75 | + <label>{statusMap[record.status]}</label> |
| 76 | + </div> |
| 77 | + <div className={styles.title}>{record.title}</div> |
| 78 | + |
| 79 | + <div className={styles.description}>{record.description}</div> |
| 80 | + <ul className={styles.steps}> |
| 81 | + {record.process.map(item => ( |
| 82 | + <li key={item.name} className={classnames(styles[item.status])}> |
| 83 | + <label className={styles.dot} /> |
| 84 | + {item.name} |
| 85 | + <span className={styles.arrow}> →</span> |
| 86 | + </li> |
| 87 | + ))} |
| 88 | + </ul> |
| 89 | + <div className={styles.info}> |
| 90 | + <p>审核人员:{record.auditor}</p> |
| 91 | + <p>通过时间:{record.passTime}</p> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + ))} |
| 95 | + |
| 96 | + <div className={styles.module}> |
| 97 | + <div className={styles.result}> |
| 98 | + <Icon name="error" size={36} type="dark" /> |
| 99 | + <div className={styles.title}>审核未通过</div> |
| 100 | + <div className={styles.reason}> |
| 101 | + 严格测试应用的功能性、稳定性,以及应用的各个信息。 |
| 102 | + </div> |
| 103 | + <Link to="#"> |
| 104 | + <Button className={styles.view}>查看版本</Button> |
| 105 | + </Link> |
| 106 | + </div> |
| 107 | + </div> |
| 108 | + </Section> |
| 109 | + </Grid> |
| 110 | + </Row> |
| 111 | + </Layout> |
| 112 | + ); |
| 113 | + } |
| 114 | +} |
0 commit comments