/*
 * Author: 黎永顺
 * name: 我的薪资福利-移动端列表数据
 * Description:
 * Date: 2023/11/13
 */
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import moment from "moment";

const getLabel = WeaLocaleProvider.getLabel;

class Index extends Component {

  render() {
    const { dataSource, isMore, loading } = this.props;
    return (
      <ul className="payrollList-wrapper">
        {
          _.map(dataSource, it => {
            return <li className="item">
              <div className="salaryMonth">
                <span>{moment(it.salaryYearMonth).format("YYYY-MM")}</span>
                <span>{`${getLabel(15323, "第")}${it.acctTimes}${getLabel(18929, "次")}`}</span>
              </div>
              <div className="sendTime">
                <span>{getLabel(111, "发放时间")}</span>
                <span>{moment(it.sendTime).format("YYYY-MM")}</span>
              </div>
              <a
                href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=${it.id}&salaryCode=${it.salaryCode}&type=phone`}
                target="_blank">
                {`${getLabel(33564, "查看")}>`}
              </a>
            </li>;
          })
        }
        {
          loading && <li className="more">{getLabel(31230, "加载中")}</li>
        }
        {
          !isMore && <li className="empty">{getLabel(83553, "暂无数据")}</li>
        }
      </ul>
    );
  }
}

export default Index;
