import React, { Component } from "react";
import { toJS } from "mobx";
import { inject, observer } from "mobx-react";
import { i18n } from "../../public/i18n";
import LeftTree from "./components/leftTree";
import NewAndEditDialog from "../NewAndEditDialog";
import {
WeaTop,
WeaTab,
WeaFormItem,
WeaRightMenu,
WeaLeftRightLayout,
} from "ecCom";
import { Row, Col, Spin, Modal, Button, message, Switch } from "antd";
import { WeaSwitch, WeaTableNew } from "comsMobx";
import "./index.less";
@inject("officeManageStore")
@observer
export default class OfficeManage extends Component {
componentDidMount() {
const { officeManageStore } = this.props;
officeManageStore.getHasRight && officeManageStore.getHasRight();
}
getDropMenuDatas = () => {
const { officeManageStore } = this.props;
const { rightMenu } = officeManageStore;
let menus = [];
toJS(rightMenu).map((item, index) => {
let obj = {
key: item.menuFun,
icon: ,
content: item.menuName,
};
if (
item.menuFun == "collection" ||
item.menuFun == "help" ||
item.menuFun == "pageAddress"
) {
obj.disabled = true;
}
menus.push(obj);
});
return menus;
};
handleMenuClick = (key) => {};
getTopMenuBtns = () => {
const { officeManageStore } = this.props;
const { topMenu, tableStore, getPostInfoForm } = officeManageStore;
let btns = [];
topMenu.map((item, i) => {
if (item.menuFun !== "batchDelete") {
btns.push(
);
} else {
btns.push(
);
}
});
return btns;
};
getPanelComponents = () => {
const { officeManageStore } = this.props;
const { searchCondition, form2, searchConditionLoading } =
officeManageStore;
let arr = [];
let formParams = form2.getFormParams();
const { isFormInit } = form2;
isFormInit &&
searchCondition.map((c) => {
c.items.map((field, index) => {
arr.push(
{
}
);
});
});
if (searchConditionLoading) {
return (
);
} else {
return (
{
// if (e.keyCode == 13 && e.target.tagName === "INPUT") {
// officeManageStore.getTableInfo();
// officeManageStore.setPanelStatus(false);
// }
// }}
>
{arr}
);
}
};
getTabBtn = () => {
const { officeManageStore } = this.props;
const { form2, setPanelStatus } = officeManageStore;
const btn = [
,
,
,
];
return btn;
};
onSearchChange = (val) => {
const { officeManageStore } = this.props;
const { form2 } = officeManageStore;
officeManageStore.setSchemeName(val);
!_.isEmpty(form2.getFormParams()) && officeManageStore.updateFields(val);
};
render() {
const { officeManageStore } = this.props;
const {
isPanelShow,
form2,
schemeName,
conditionNum,
tableStore,
nEdialogTitle,
visible,
condition,
form,
dialogLoading,
} = officeManageStore;
return (
}
onCollapse={(showLeft) => console.log("showLeft:", showLeft)}>
this.handleMenuClick(key)}>
}
iconBgcolor="#217346"
loading={true}
buttons={this.getTopMenuBtns()}
showDropIcon={true}
dropMenuDatas={this.getDropMenuDatas()}
onDropMenuClick={(e) => this.handleMenuClick(e)}>
officeManageStore.setPanelStatus(bool)
}
hideSearchAd={() => officeManageStore.setPanelStatus(false)}
searchsAd={
isPanelShow ? this.getPanelComponents() :
}
advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20}
hasMask={false}
buttonsAd={this.getTabBtn()}
// onSearch={() => officeManageStore.getSearchCondition()}
onSearchChange={(val) => this.onSearchChange(val)}
/>
{/* this.reRenderColumns(c)}
onOperatesClick={(record, index, operate) =>
this.onOperatesClick(record, index, operate)
}
/> */}
this.handleSave()}
// onCancel={() => rankScheme.setVisible(false)}
/>
);
}
}