import React from 'react' import CustomTab from '../../components/customTab' import { Dropdown, Menu, Button, Table } from 'antd' import { WeaHelpfulTip, WeaInputSearch, WeaSlideModal, WeaTable } from 'ecCom' import { placeOnFileColumns, dataSource } from './columns' import SlideModalTitle from "../../components/slideModalTitle" import FileMergeDetail from './fileMergeDetail' import { getQueryString } from "../../util/url"; import { inject, observer } from 'mobx-react'; import CustomPaginationTable from '../../components/customPaginationTable' @inject('calculateStore') @observer export default class PlaceOnFileDetail extends React.Component { constructor(props) { super(props); placeOnFileColumns.map(item => { if(item.dataIndex == "username") { item.render = (text, record) => ( {this.onDetail()}}>{text} ) } }) this.state = { slideVisiable: false, selectedRowKeys: [], searchValue: "" } this.id = ""; this.length = 0 this.pageInfo = { current: 1, pageSize: 10 } } componentWillMount() { let id = getQueryString("id"); this.id = id; const { calculateStore: { getSalarySobCycle, acctResultList } } = this.props; getSalarySobCycle(id) acctResultList(id) } // 获取列表的列 getColumns() { const { calculateStore: {acctResultListTableStore, acctResultListColumns }} = this.props; let columns = acctResultListColumns ? acctResultListColumns : [] columns = columns.filter(item => item.hide == "FALSE").map(item => { let result = {...item} result.title = item.text; result.dataIndex = item.column result.oldWidth = result.width; result.width = null; this.length = 0 if(result.children) { result.children.map(child => { child.width = 150 child.title = child.text child.dataIndex = child.column this.length ++ }) } else { this.length ++ result.width = 150 } return result; }) columns.push({ title: '操作', key: "cz", render: (text, record) => { return {this.handleEdit(record)}}>编辑 } }) return columns; } onDetail() { this.setState({slideVisiable: true}) } handleSearch(value){ const { calculateStore: {acctResultList}} = this.props; acctResultList(this.id, value, this.pageInfo.current, this.pageInfo) } // 分页 handleDataPageChange(value) { const { calculateStore: {acctResultList}} = this.props; acctResultList(this.id, this.state.searchValue, value, this.pageInfo) } handleShowSizeChange(pageInfo) { const { calculateStore: {acctResultList}} = this.props; acctResultList(this.id, this.state.searchValue, pageInfo.current, pageInfo ) } handleMenuClick() { const {calculateStore: {exportAll}} = this.props; const { selectedRowKeys } = this.state; if(selectedRowKeys.length == 0) { message.warning("未选择条目") return } exportAll(this.id, selectedRowKeys.join(",")) } handleExportAll() { const {calculateStore: {exportAll}} = this.props; exportAll(this.id) } onSelectChange = selectedRowKeys => { this.setState({ selectedRowKeys }); } render() { const { calculateStore } = this.props; const { baseSalarySobCycle, acctResultListDateSource, acctResultListColumns, acctResultListPageInfo } = calculateStore const { selectedRowKeys } = this.state; const rowSelection = { selectedRowKeys, onChange: this.onSelectChange, }; const menu = (
); const renderRightOperation = () => { return (