/* * Author: 黎永顺 * name: 移动端-工资单预览 * Description: * Date: 2023/10/19 */ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; import { dealTemplate } from "../pcTemplate"; import moment from "moment"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { const { theme, background, tip, tipPosi, itemTypeList } = this.props; const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "mobile"); return (
{getLabel(111, "薪酬预览")}
{theme || ""}
{moment().format("YYYY-MM-DD HH:mm:ss")}
{ background &&
logo
}
{ !onlyOneGrup && tipPosi === "1" && tip &&
{tip}
}
{ showData.map((groupItem, index) => { if (!groupItem) return null; const { groupId, groupName, items = [] } = groupItem; return (
{ groupName ?
{groupName}
: null }
{ (onlyOneGrup && tipPosi === "1" && tip) && (
{getLabel(111, "发放说明")}
{tip}
) } { items.map((templatItem, index) => { const { salaryItemValue, name } = templatItem || {}; return
{name || ""}
{salaryItemValue || "100"}
; }) } { (onlyOneGrup && tipPosi === "2" && tip) && (
{getLabel(111, "发放说明")}
{tip}
) }
); }) }
{ !onlyOneGrup && tipPosi === "2" && tip &&
{tip}
}
); } } export default Index;