From 50b4426a75d60a415b73174250b4c3c953feeedf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 20 Aug 2024 14:02:33 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.15.1.2407.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BB=A5=E5=8F=8A=E5=AD=97=E6=AE=B5=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/salaryItem/customSalaryItemSlide.js | 46 +++++++++++++++++-- pc4mobx/hrmSalary/stores/salaryItem.js | 3 ++ 2 files changed, 46 insertions(+), 3 deletions(-) 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();