import React, { Component } from "react"; import { WeaRightMenu, WeaTab, WeaTop,WeaLocaleProvider } from "ecCom"; import { inject, observer } from "mobx-react"; import { Button } from "antd"; import PermissionItem from "./permissionItem"; import DefineShowItems from "./defineShowItems"; import CustomItem from "./customItem"; import { i18n } from "../../public/i18n"; import { renderNoright } from "../../util"; const getLabel = WeaLocaleProvider.getLabel; @inject("columnSetting") @observer class ColumnSetting extends Component { componentDidMount() { this.init(); } init = () => { const { columnSetting } = this.props; columnSetting.getRight(); }; getTopMenuBtns = () => { return [ ]; }; getDropMenuDatas = () => { return [ { key: "save", icon: , content: getLabel('547360', "保存") } ]; }; getTabName = () => { return [{ key: "0", title: i18n.label.defineShowItems() }, { key: "1", title: i18n.label.columnPermission() }, { key: "2", title: i18n.label.columnCustom() }]; }; save = () => { const { columnSetting } = this.props; const { selectedKey } = columnSetting; selectedKey === "0" ? columnSetting.userDefineCardItemSave() : selectedKey === "1" ? columnSetting.columnPermissionSave() : columnSetting.customItemSave(); }; render() { const { columnSetting } = this.props; const { selectedKey, authorized } = columnSetting; if (authorized === false) { return renderNoright(); } return ( authorized &&
, content: getLabel('547360', "保存") }]} onClick={key => (key && this[key]())} > } iconBgcolor="#217346" loading={true} buttons={this.getTopMenuBtns()} showDropIcon={true} dropMenuDatas={this.getDropMenuDatas()} onDropMenuClick={(e) => (e && this[e]())} /> columnSetting.setSelectedKey(key)} /> { selectedKey === "0" ? : selectedKey === "1" ? : }
); } } export default ColumnSetting;