import React from 'react';
import { getControl } from 'zorod/components/Zform/controls';
import { ZsearchListHOC } from 'zorod';
import api from '../Api';
import { Card, Form, Input, Button, message, Icon, Checkbox, Select, Cascader, DatePicker, Table } from 'antd';
import EcSummarize from '../EcSummarize/index';
require('./assets/TaskSelect.css')

const FormItem=Form.Item;
const TextArea=Input.TextArea;

const formItemLayout = {
    labelCol: { span: 4 },
    wrapperCol: { span: 12 },
  };
  const formTailLayout = {
    labelCol: { span: 4 },
    wrapperCol: { span: 12, offset: 4 },
  };
  const formButtom={
    wrapperCol: { span: 24, offset: 12 }
  }
const residences=["baijing","hunian","guangxi"];

class ZHzxjg extends React.Component {
	constructor(props) {
		super(props)
		this.state = {
			
			loading: false,
			title: this.props.title,
			
		}
	}
	componentDidMount() {
		
	}
	close = () => {
		this.props.onPopClose()
	}


	
	render() {
		let status1;//任务状态
		let result1;
		let zxjgUrl = this.props.Zxjg.batchResultReportUrl;
		const Zxjg = this.props.Zxjg.tashList.map(function (val, key) { 
			if(val.status==0){
               
                status1='待检测';
              
            }else if(val.status==1){
               
                status1='检测中';
               
            }else{
              
                status1='完成';
             
			};
			if(val.ruleDo.CLEAN_TYPE==0){
				result1="JAVA任务方式"
			}else if(val.ruleDo.CLEAN_TYPE==1){
				result1="调用shell方式"
			}else{
				result1="调用sql方式"
			}
			return(
				<tr>
					<td>{val.ruleDo.CLEAN_NAME}</td>
					<td>{result1}</td>
					<td>{status1}</td>
					<td>{val.descrit}</td>
					<td>{val.endTime}</td>
				</tr>
			)
		});
		return (
			<div>
				<div className='mask'></div>
				<div className='wrap'>
					<div className='topbar'>
						<div className='close' onClick={this.close}>x</div>
					</div>
					<div className='content'>
						<Card title={this.state.title}>
						<div className="testt-resule">
                                    <table>
                                        <thead>
                                        <tr>
                                            <th>任务名称</th>
                                            <th>任务类型</th>
                                            <th>任务状态</th>
                                            <th>结果描述</th>
											<th>结束时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                       {Zxjg} 
                                        </tbody>
                                    </table>
                                </div>
							<a href={zxjgUrl} className="dc-resule">导出结果</a>
							<FormItem {...formButtom}>
								
								<Button type='danger' onClick={this.close}>关闭</Button>
							</FormItem>
						</Card>
					</div>
				</div>
			</div>
		)
	}
}

export default Form.create({ name: 'ZHzxjg' })(ZHzxjg);