import React from 'react';
import {Table, Row, Col, spin, Button, Spin} from 'antd';
import {inject, observer} from 'mobx-react';
import {toJS} from 'mobx';
import {WeaLocaleProvider, WeaRightMenu, WeaSelect, WeaTop, WeaDatePicker, WeaDialog} from 'ecCom';
import '../../style/prjReport.less';
import DialogPanel from "./dialogPanel";
import FeedBackInfoDialog from "./feedBackInfoDialog";
import FeedBackSettingDialog from "./feedBackSettingDialog";
import $ from 'jquery';
import reportStore from '../../stores/reportStore';
const getLabel = WeaLocaleProvider.getLabel;
const TitleInfo = props => {
const { monthOptions, openDialog, type, activity} = props;
return (
{getLabel('518181','反馈周期')}:{type}
{getLabel('518182','当前活动')}{type}:{activity}
{getLabel('33251','选择')}{type}:
{
let pos = 0;
_.forEach(monthOptions, (item, index) => {
if (item.key === val) {
pos = index;
return false;
}
});
$(".ant-table-body").scrollLeft(($(".ant-table-content .ant-table-header:eq(1) tr:first").find("th[colspan=6]:first").width() + 25) * pos+305);
}}
/>
)
}
@inject('ReportStore')
@observer
export default class Report extends React.Component {
constructor(props) {
super(props);
this.state = {
YHeight: 200
}
}
componentDidMount() {
const {init} = this.props.ReportStore;
const {prjid,location}= this.props;
// const {location:{query: {prjid}}}= this.props;
if(prjid==''||prjid==null){
init(location.query.prjid);
}else{
init(prjid);
}
window.onresize = () => {
this.getYHeight();
}
this.getYHeight();
}
onDataChange = () => {
return this.props.ReportStore.onDataChange;
}
getYHeight = () => {
this.setState({
YHeight: window.top.innerHeight - 300
})
}
componentWillReceiveProps(nextProps){
const {init} = nextProps.ReportStore;
const {prjid,location}= this.props;
if(prjid==''||prjid==null){
if(location.key != nextProps.location.key){
init(nextProps.location.query.prjid);
}
}else{
if(prjid != nextProps.prjid){
init(nextProps.prjid);
}
}
}
render() {
const {ReportStore} = this.props;
const {
columns, columnsWidth, tableForamtDatas, dialogVisible, expandedRowKeys, onExpandedRowKeysChange, projInfo,
onToggleDialog, dialogData, dialogSource, onDataChange, saveData, onEditionChange, nowVersionSelected, monthOptions,
submitLoading, submitTip, prjstatus, feedBackInfoStore, prjid, feedBackSettingStore, type, activity, setDialogData, saveMxDatas
} = ReportStore;
const menu = [
{
key: '1',
icon: ,
content: getLabel('725', '提交'),
onClick: key => {
saveData(key)
}
},
{
key: '2',
icon: ,
content: getLabel('30986', '保存'),
onClick: key => {
saveData(key)
}
}
];
if (!(tableForamtDatas && projInfo && projInfo.name)) {
return
}
return (
{feedBackSettingStore.handleFeedBackSettingDialog(true,{prjid:prjid})}}
type={type}
activity={activity}
/>
{
onExpandedRowKeysChange(keys)
}}
/>
)
}
}