// 报表编辑 import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import moment from 'moment' import CompileDrawer from '../components/compileDrawer' import { Spin, Button, DatePicker, Space, Switch } from 'antd'; import ProTable from '@ant-design/pro-table'; import { Func } from '$utils'; const { RangePicker } = DatePicker; const Compile = (props) => { const { dispatch, actions, user, loading, reportRectify } = props const [searchTime, setSearchTime] = useState([moment(), moment()]) const [compileDrawerVis, setCompileDrawerVis] = useState(false) const [checkRow, setCheckRow] = useState({}) const [checkAction, setCheckAction] = useState('') const { report } = actions const getReportRectify = (searchTime) => { dispatch(report.reportRectify([moment(searchTime[0]).format('YYYY-MM-DD'), moment(searchTime[1]).format('YYYY-MM-DD')])) } useEffect(() => { getReportRectify(searchTime) }, []) const showCompileDrawerVis = (row, action) => { setCompileDrawerVis(true) setCheckRow(row) setCheckAction(action) } return ( { return } }, { title: '操作', dataIndex: 'option', render: (_, r) => { return [ {/* {Func.isAuthorized("REPORT_EDIT") && } */} ] } },]} dataSource={reportRectify} rowKey="index" search={false} options={false} headerTitle="合用场所安全隐患排查整治汇总表" toolBarRender={() => [ { setSearchTime(date) getReportRectify(dateString) }} />, ]} > { setCompileDrawerVis(false) setCheckRow({}) setCheckAction('') getReportRectify(searchTime) }} checkRow={checkRow} checkAction={checkAction} /> ) } function mapStateToProps(state) { const { auth, global, reportRectify } = state; console.log(reportRectify); return { user: auth.user, actions: global.actions, loading: reportRectify.isRequesting, reportRectify: reportRectify.data || [] }; } export default connect(mapStateToProps)(Compile);