salary-management-front/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js

77 lines
2.6 KiB
JavaScript

/*
* Author: 黎永顺
* name: 薪资核算-高级搜索面板
* Description:
* Date: 2023/9/14
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import { Button } from "antd";
import { inject, observer } from "mobx-react";
import { editCalcSearchConditions } from "./condition";
import { getSearchs } from "../../../../../util";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("calculateStore")
@observer
class EditCalcAdvanceSearchPannel extends Component {
constructor(props) {
super(props);
this.state = {
searchConditions: []
};
}
componentDidMount() {
this.setState({
searchConditions: _.map(editCalcSearchConditions, item => {
return {
...item,
items: _.map(item.items, o => {
if (getKey(o) === "statuses") {
return {
...o,
options: [
{ key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") },
{ key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") },
{ key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") },
{ key: "6", showname: getLabel(6092, "退休") }
]
};
}
return { ...o };
}),
title: getLabel(32905, "常用条件")
};
})
}, () => {
const { calculateStore: { ECSearchForm } } = this.props;
ECSearchForm.initFormFields(this.state.searchConditions);
});
}
render() {
const { searchConditions } = this.state;
const { calculateStore: { ECSearchForm } } = this.props;
return (
<React.Fragment>
{getSearchs(ECSearchForm, searchConditions, 2, false)}
<div className="wea-search-buttons">
<div style={{ textAlign: "center" }}>
<span style={{ marginLeft: 15 }}><Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button></span>
<span style={{ marginLeft: 15 }}><Button type="ghost"
onClick={() => ECSearchForm.resetForm()}>{getLabel(2022, "重置")}</Button></span>
<span style={{ marginLeft: 15 }}><Button type="ghost"
onClick={this.props.onToggleSwitch}>{getLabel(31129, "取消")}</Button></span>
</div>
</div>
</React.Fragment>
);
}
}
export default EditCalcAdvanceSearchPannel;