feature/2.15.1.2407.01-薪资项目以及字段管理页面改造
This commit is contained in:
parent
f03c187796
commit
50b4426a75
|
|
@ -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: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom">
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
|
||||
{
|
||||
fields.tip && <WeaHelpfulTip
|
||||
width={350} title={getLabel(fields.tipLanId, fields.tip)} placement="topLeft"/>
|
||||
}
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { title, buttons } = this.props;
|
||||
return <div className="titleDialog">
|
||||
|
|
@ -51,7 +90,8 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
const { valueType, dataType, formulaId } = request;
|
||||
const { formalModalVisible, salaryItemName } = this.state;
|
||||
return (<WeaSlideModal
|
||||
{...this.props} top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
|
||||
className="custom_salaryItemSlide"{...this.props}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
|
||||
direction="right" title={this.renderTitle()} onClose={this.handleClose}
|
||||
content={<div className="form-dialog-layout">
|
||||
</div>}/>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue