// 核心库
import React from 'react'
import { connect } from 'dva'
// 组件库
import { Form, Icon, Table } from 'antd'
import { ExportToExcel, LayoutCard, Search } from '@woowalker/feui'
import EnergyDosageModel from './EDBenchMarkingModel'
// 工具库
import { addRuleAndGroups } from '../../../utils/common'
import moment from 'moment'
class EDBenchMarkingPage extends React.Component {
constructor(props) {
super(props)
this.state = {
head: [],
dataSource: [],
dateType: '0',
dateString: moment().format('YYYY'),
Searchvalue: {}
}
}
onModalRef = (ref) => {
this.modalChild = ref
}
showModal = () => {
this.modalChild.showModal()
}
handleSearch = (value) => {
this.setState({ Searchvalue: value })
this.getTableData(value)
}
getTableData = (value) => {
if (!value) value = this.state.Searchvalue
const json = {
OrgId: this.props.login.OrgId,
}
addRuleAndGroups(json, value)
this.props.dispatch({
type: 'app/getDataByPost',
url: 'ED/EDProdRecord/GetBenchMarkingData',
payload: json,
onlyData: false,
onComplete: (res) => {
if (res && res.IsSuccessful && res.Data && res.Data.tableHead && res.Data.tableData) {
const { tableHead, tableData } = res.Data
this.setState({
head: tableHead,
dataSource: tableData
})
}
}
})
};
render() {
const paginationConfig = {
pageSizeOptions: ['12', '24', '36'],
pageSize: 12,
total: this.state.dataSource.length,
showSizeChanger: true,
size: 'small',
showTotal: () => `共 ${this.state.dataSource.length} 条`
}
const { formId, formCode } = this.props
const columns = []
this.state.head.forEach((n, i) => {
var item = {
title: n.Title,
dataIndex: n.DataIndex
}
columns.push(item)
})
const { dispatch, login } = this.props
const exportInserTitle = this.state.dateType === '0' ? '年' : this.state.dateType === '1' ? '月' : '日'
return (
<>
配置
>
)
}
}
EDBenchMarkingPage.propTypes = {
}
export default connect(({ login, app }) => ({ login, app }))(Form.create()(EDBenchMarkingPage))