diff --git a/pc4mobx/organization/components/office/components/leftTree.js b/pc4mobx/organization/components/office/components/leftTree.js index d84ffc5..3559189 100644 --- a/pc4mobx/organization/components/office/components/leftTree.js +++ b/pc4mobx/organization/components/office/components/leftTree.js @@ -1,11 +1,10 @@ import React, { Component } from "react"; -import { Input, Tree, Menu, message, Modal } from "antd"; +import { Menu, message, Modal, Tree } from "antd"; import { WeaInputSearch } from "ecCom"; import { i18n } from "../../../public/i18n"; import NewAndEditDialog from "../../NewAndEditDialog"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import _ from "lodash"; import "../index.less"; const confirm = Modal.confirm; @@ -26,10 +25,12 @@ class LeftTree extends Component { rightClickNodeTreeItem: null }; } + componentDidMount() { this.getTreeData(); document.addEventListener("click", this.handleClick); } + componentWillUnmount() { document.removeEventListener("click", this.handleClick); } @@ -71,9 +72,11 @@ class LeftTree extends Component { officeManageStore.setOfficeClassifyId( !postId ? officeManageStore.officeClassifyId - : postId != "-1" ? postId : "" + : postId !== "-1" ? postId : "" ); - officeManageStore.getPostInfoTable(postId); + officeManageStore.getPostInfoTable(!postId + ? officeManageStore.officeClassifyId + : postId !== "-1" ? postId : ""); this.setState({ rightClickNodeTreeItem: null }); @@ -234,10 +237,10 @@ class LeftTree extends Component { index > -1 ? {beforeStr} - + {searchValue} - {afterStr} + {afterStr} : {item.title} @@ -249,7 +252,7 @@ class LeftTree extends Component { ); } - return ; + return ; }); }; @@ -341,7 +344,7 @@ class LeftTree extends Component { {this.getNodeTreeRightClickMenu()} { const { officeManageStore } = this.props; const { rightMenu } = officeManageStore; @@ -43,7 +39,7 @@ export default class OfficeManage extends Component { toJS(rightMenu).map((item, index) => { let obj = { key: item.menuFun, - icon: , + icon: , content: item.menuName }; if ( @@ -97,9 +93,10 @@ export default class OfficeManage extends Component { this.setState({ loading: false }); if (code === 200) { message.success("编辑成功"); - this.props.officeManageStore.setVisible(false); - this.props.officeManageStore.getPostInfoTable(); - this.setState({ editId: "" }); + this.setState({ editId: "" }, () => { + this.props.officeManageStore.setVisible(false); + this.props.officeManageStore.getPostInfoTable(this.props.officeManageStore.officeClassifyId); + }); } else { message.error(msg || "编辑失败"); } @@ -110,9 +107,10 @@ export default class OfficeManage extends Component { this.setState({ loading: false }); if (code === 200) { message.success("新增成功"); - this.props.officeManageStore.setVisible(false); - this.props.officeManageStore.getPostInfoTable(); - this.setState({ editId: "" }); + this.setState({ editId: "" }, () => { + this.props.officeManageStore.setVisible(false); + this.props.officeManageStore.getPostInfoTable(this.props.officeManageStore.officeClassifyId); + }); } else { message.error(msg || "新增失败"); } @@ -123,6 +121,7 @@ export default class OfficeManage extends Component { } }); } + getTopMenuBtns = () => { const { officeManageStore } = this.props; const { topMenu, tableStore, officeClassifyId } = officeManageStore; @@ -137,7 +136,7 @@ export default class OfficeManage extends Component { const { officeManageStore } = this.props; if (item.menuFun == "new") { officeManageStore.isPanelShow && - officeManageStore.setPanelStatus(false); + officeManageStore.setPanelStatus(false); officeManageStore.getPostInfoForm(); officeManageStore.setVisible(true); officeManageStore.setNeDialogTitle(i18n.label.newOfficeName()); @@ -235,7 +234,7 @@ export default class OfficeManage extends Component { let _this = this; columns.forEach((c, index) => { if (c.dataIndex == "forbidden_tag") { - c.render = function(text, record) { + c.render = function (text, record) { return ( { - c.items.map((field, index) => { - arr.push( - -
- - { - - } - -
- - ); - }); + searchCondition.map(c => { + c.items.map((field, index) => { + arr.push( + +
+ + { + + } + +
+ + ); }); + }); if (searchConditionLoading) { return (
@@ -418,19 +417,19 @@ export default class OfficeManage extends Component { isNew={true} leftWidth={310} leftCom={ - + } onCollapse={showLeft => console.log("showLeft:", showLeft)}> this.handleMenuClick(key)}> } + icon={} iconBgcolor="#217346" loading={true} buttons={this.getTopMenuBtns()} @@ -439,7 +438,7 @@ export default class OfficeManage extends Component { onDropMenuClick={e => this.handleMenuClick(e)}> officeManageStore.setPanelStatus(bool)} hideSearchAd={() => officeManageStore.setPanelStatus(false)} - searchsAd={isPanelShow ? this.getPanelComponents() :
} + searchsAd={isPanelShow ? this.getPanelComponents() :
} advanceHeight={Math.ceil(conditionNum / 2) * 52 + 20} hasMask={false} buttonsAd={this.getTabBtn()} @@ -458,7 +457,7 @@ export default class OfficeManage extends Component { />