import React from 'react';
import moment from 'moment'
import './index.less'

const Index = (props) => {
    const {data} = props
    return (
        <div className="todo-card" onClick={props.onClick}>
            <div className="todo-title pos-aline">
                <div className="pos-aline">
                    <div className="todo-tag pos-aline">
                        {/*<img*/}
                            {/*alt=""*/}
                            {/*className="todo-tag-png"*/}
                            {/*src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591252471425&di=85236ae603ca74553adaca6e8c161a39&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fb912bf96dc19b3b23530ae2259b60eb6cf70083f6680b-H9l0ri_fw658"*/}
                        {/*/>*/}
                        {data.WD_MOD_NAME}
                    </div>
                    <p>{data.WD_TITLE}</p>
                </div>
                <span>
                    <img
                        alt=""
                        className="todo-read-png"
                        src={props.data && props.data.WD_FLAG === 'D' ? '/img/read.png' : '/img/unread.png'}
                    />
                </span>
            </div>
            <div className="todo-content">
                <p>当前状态：{data.WD_STATUS}</p>
                <p style={{marginTop: 15}}>发送人员：{data.WD_FROMUSER_ALIASED}</p>
            </div>
            <div className="todo-footer">
               <div>
                   <p className="pos-aline"><img alt="" src="/img/time.png" className="footer-mes-img"/>更新时间：{data.WD_RECEIVEDATE ? moment(data.WD_RECEIVEDATE).format("YYYY-MM-DD HH:mm:ss") : ''}</p>
                   <p className="pos-aline footer-mes-sec"><img alt="" src="/img/time-2.png" className="footer-mes-img"/>发起时间：{data.WD_SENDDATE ? moment(data.WD_SENDDATE).format("YYYY-MM-DD HH:mm:ss") : ''}</p>
               </div>
                {data && data.WD_JJCD !=='无' && data.WD_JJCD ==='紧急' &&  (
                    <img
                        alt=""
                        className="todo-footer-img"
                        src={'/img/serious.png'}
                    />
                )}
                {/*<img*/}
                    {/*alt=""*/}
                    {/*className="todo-footer-img"*/}
                    {/*src={props.data && props.data.read ? '/img/serious.png' : '/img/urgency.png'}*/}
                {/*/>*/}
            </div>
        </div>
    );
};

export default Index;
