diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 4ff97292..e3486a31 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -1,20 +1,37 @@ import React from "react"; -import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal } from "ecCom"; +import { WeaSwitch } from "comsMobx"; // import FormalFormModal from "./formalFormModal"; // import SalaryItemForm from "./salaryItemForm"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; +@inject("salaryItemStore") +@observer export default class CustomSalaryItemSlide extends React.Component { constructor(props) { super(props); this.state = { + conditions: [], + showForm: false, formalModalVisible: false, salaryItemName: "" }; } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + document.querySelector(".custom_salaryItemSlide").classList.add("zIndex0-weaslide-title"); + this.initForm(nextProps); + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { + document.querySelector(".custom_salaryItemSlide").classList.remove("zIndex0-weaslide-title"); + this.props.salaryItemStore.initItemsForm(); + } + } + handleChange = (params) => { this.props.onChange({ ...this.props.request, ...params }); }; @@ -34,7 +51,29 @@ export default class CustomSalaryItemSlide extends React.Component { originSqlContent: data.referenceType === "sql" ? data.formula : "" }); }; - + renderForm = (form) => { + const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams(); + let group = []; + isFormInit && conditions.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + + { + fields.tip && + } + ), + hide: fields.hide + }); + }); + group.push(); + }); + return group; + }; renderTitle = () => { const { title, buttons } = this.props; return
@@ -51,7 +90,8 @@ export default class CustomSalaryItemSlide extends React.Component { const { valueType, dataType, formulaId } = request; const { formalModalVisible, salaryItemName } = this.state; return (
}/> diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index cc3a0214..45f30171 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -9,6 +9,9 @@ const { TableStore } = WeaTableNew; export class SalaryItemStore { @observable salarySetform = new WeaForm(); //同步薪资账套form + @observable itemsForm = new WeaForm(); //自定义薪资项目form + @action initItemsForm = () => this.itemsForm = new WeaForm(); + @observable tableStore = new TableStore(); // new table @observable sysListTableStore = new TableStore();