import React from 'react' import * as mobx from 'mobx' import { inject, observer } from 'mobx-react' import { WeaTop, WeaTab, WeaFormItem, WeaRightMenu, WeaAlertPage, WeaDatePicker } from 'ecCom' import { Row, Col, Spin, Modal, Button, message, Switch } from 'antd' import { WeaSwitch, WeaTableNew } from 'comsMobx' import { i18n } from '../../public/i18n'; import { renderNoright } from '../../util'; const toJS = mobx.toJS; const confirm = Modal.confirm; const WeaTable = WeaTableNew.WeaTable; @inject('snapshot') @observer export default class Snapshot extends React.Component { constructor(props) { super(props); } componentWillMount() { } componentDidMount() { this.init(); } componentWillUnmount() { } componentWillReceiveProps(nextProps) { const { snapshot } = this.props; if (this.props.location.key !== nextProps.location.key) { this.init(); } } init() { const { snapshot } = this.props; snapshot.getDatas(); snapshot.getTableInfo(); } getTopMenuBtns() { const { snapshot } = this.props; const { topMenu, } = snapshot; let btns = []; topMenu.map((item, i) => { btns.push(); }); return btns; } handleClick(item) { this[item.menuFun] && this[item.menuFun](); } getDropMenuDatas() { const { snapshot } = this.props; const { rightMenu } = snapshot; 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) { this[key] && this[key](); } custom = () => { const { snapshot } = this.props, { tableStore, } = snapshot; tableStore.setColSetVisible(true); tableStore.tableColSet(true); } reRenderColumns(columns) { columns.forEach((c, index) => { }) } //非空判断 isEmptyObject(obj) { for (let key in obj) { return false; } return true; } render() { const { snapshot } = this.props; const { tableStore, date, hasRight,datas } = snapshot; if (hasRight === false) { return renderNoright(); } const tabStyle = { height: "40px", textAlign: "center", lineHeight: "40px", color: "#4472c4", fontWeight: 900, fontSize: "16px" } const width = tableStore.columns.filter(c => c.display === "true").length * 50; return ( hasRight &&