/* * Author: 黎永顺 * name: 薪资档案页面重构-高级查询 * Description: * Date: 2024/1/8 */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { Button } from "antd"; import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import * as API from "../../../../apis/payrollFiles"; import { salaryFileSearchConditions } from "../../config"; import { postFetch } from "../../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @inject("payrollFilesStore") @observer class salaryFileAdvanceSearchPannel extends Component { constructor(props) { super(props); this.state = { searchConditions: [] }; } async componentDidMount() { const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([ API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }), postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) ]); this.setState({ searchConditions: _.map(salaryFileSearchConditions, item => { return { ...item, items: _.map(item.items, child => { if (getKey(child) === "statuses") { return { ...child, options: _.map(userStatusList, o => ({ key: String(o.value), showname: o.defaultLabel })) }; } else if (getKey(child) === "taxAgentIds") { return { ...child, options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })) }; } return { ...child }; }) }; }) }, () => { const { payrollFilesStore: { salaryFileQueryForm } } = this.props; salaryFileQueryForm.initFormFields(this.state.searchConditions); }); } render() { const { searchConditions } = this.state; const { payrollFilesStore: { salaryFileQueryForm } } = this.props; return (
{getSearchs(salaryFileQueryForm, searchConditions, 2, false)}
); } } export default salaryFileAdvanceSearchPannel;