import {Button,Modal,message,Spin} from 'antd';
import {WeaDialog,WeaTab,WeaNewScroll,WeaRightMenu,WeaLocaleProvider,WeaFormItem,WeaInput,WeaSearchGroup } from 'ecCom';
import {observer} from "mobx-react";
import * as Apis from '../../apis/project';
import WbsFieldSet from '../common/wbsFieldSet'
const getLabel = WeaLocaleProvider.getLabel;
@observer
class WbsFieldSetDialog extends React.Component {
constructor(props) {
super(props);
this.state={
width:700,
height:500,
isDisabled: false
}
}
componentDidMount(){
this.computedWH();
}
computedWH=()=>{
const screenWidth = document.body.clientWidth;
const screenHeight = document.body.clientHeight;
if(screenWidth <= 700){
this.setState({width:screenWidth,})
}
if(screenHeight <= 500){
this.setState({ height :screenHeight})
}
}
render() {
const prjImportStore = this.props.contentStore;
const {visible} = prjImportStore;
const { width,height} = this.state;
return (
prjImportStore.handleDialog(false)}
buttons={this.getDialogButtons()}
>
{this.wbs = el}} wbsStore={prjImportStore}/>
)
}
getDialogButtons(){
const {contentStore} = this.props;
const {saveVisible} = contentStore;
let btn = [];
btn.push();
btn.push();
return btn
}
getRightMenu() {
const {contentStore} = this.props;
const {saveVisible} = contentStore;
let btns = [];
btns.push({
key: "taskwbssave",
icon: ,
content: getLabel(86,"保存"),
disabled: saveVisible,
onClick : () => {
this.wbs.wbsFieldSet.showErrors();
contentStore.saveTaskWbsField();
}
});
btns.push({
key: "taskwbsadd",
icon: ,
content: getLabel(611,"添加"),
onClick: () => {
this.wbs.wbsFieldSet.doAdd();
}
});
btns.push({
key: "taskwbsdel",
icon: ,
content: getLabel(91,"删除"),
onClick: () => {
this.wbs.wbsFieldSet.doDelete();
}
});
return btns;
}
}
export default WbsFieldSetDialog;