import React from 'react'; import { Button } from 'antd'; import { WeaTools, WeaDialog, WeaSearchGroup, WeaFormItem, WeaInput } from 'ecCom'; import './style/'; import LicenseSubmit from './LicenseSubmit'; class WeaLicense extends React.Component { state = { visible: false, data: {} }; constructor(props) { super(props); this.getButtons = this.getButtons.bind(this); this.getLicenseInfo = this.getLicenseInfo.bind(this); this.onSubmit = this.onSubmit.bind(this); this.onCancel = this.onCancel.bind(this); this.onShow = this.onShow.bind(this); } render() { const { data } = this.state; const { companyName, licenseCode, hrmNum, scCount, expireDate, concurrentFlag, onlineusercount, licensenum, unusedlice } = data; const colProps = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; return ( ); } getButtons() { const { data } = this.state; let buttons = []; if (data.canEdit) { buttons.push(); } return buttons; } getLicenseInfo() { WeaTools.callApi('/api/system/license/licenseInfo', 'POST', {}).then((data) => { this.setState({ data }); }); } onSubmit() { this.refs.LicenseSubmit.onShow(); } onCancel() { this.setState({ visible: false }); } onShow() { this.setState({ visible: true }); this.getLicenseInfo(); } } export default WeaLicense;