app-base-web
Version:
web development common base package.
70 lines (68 loc) • 2.66 kB
JavaScript
import React from 'react';
import { Form, Row, Col, Button } from 'antd';
import api from '../../../library/util-axios';
import UtilDic from '../../../library/util-dic';
import UtilDate from '../../../library/util-date';
// 任务调度管理-调度管理
const title = "调度管理";
const url = "TsScheduler/";
export default class FormView extends React.Component {
constructor(props) {
super(props);
this.state = {
...props.values
};
}
componentDidMount() {
let me = this;
api.get(url + "getModel?id=" + this.state.id, {}, function (rs) {
me.setState({
...rs.data
})
});
}
render() {
return (
<Form className="form-view">
<div className="form-title">
<i>{title} - 详情</i>
<span><Button className="btn-edit" onClick={(e) => { this.props.onEdit(this.state) }}><i className="iconfont icon-edit"></i>编辑</Button></span>
</div>
<div className="form-content" style={{ height: this.props.height }}>
<Row>
<Col xs={12}><label>调度名称</label><span>{this.state.name}</span></Col>
<Col xs={12}><label>调度状态</label><span>{UtilDic.json("ts", "调度状态")[this.state.state]}</span></Col>
</Row>
<Row>
<Col xs={12}><label>任务组Id</label><span>{this.state.taskGroupId}</span></Col>
<Col xs={12}><label>任务Id</label><span>{this.state.taskId}</span></Col>
</Row>
<Row>
<Col xs={12}><label>上次完成时间</label><span>{this.state.lastTime}</span></Col>
<Col xs={12}><label>下次执行时间</label><span>{this.state.nextTime}</span></Col>
</Row>
<Row>
<Col xs={24}><label>调度类型</label><span>{UtilDic.json("ts", "调度类型")[this.state.type]}</span></Col>
</Row>
<Row>
<Col xs={12}><label>调度开始时间</label><span>{UtilDate.getDate(this.state.begTime)}</span></Col>
<Col xs={12}><label>调度结束时间</label><span>{UtilDate.getDate(this.state.endTime)}</span></Col>
</Row>
<Row>
<Col xs={24}><label>调度表达式</label><span>{this.state.cron}</span></Col>
</Row>
<Row>
<Col xs={12}><label>日期类型</label><span>{UtilDic.json("ts", "日期类型")[this.state.dateType]}</span></Col>
<Col xs={12}><label>特殊日期</label><span>{UtilDic.json("ts", "特殊日期")[this.state.specialDate]}</span></Col>
</Row>
<Row>
<Col xs={24}><label>执行时段</label><span>{this.state.period}</span></Col>
</Row>
</div>
<div className="form-toolbar">
<Button className="btn-return" onClick={this.props.onReturn}><i className="iconfont icon-return"></i>返回</Button>
</div>
</Form>
);
}
}