/* * Author: 黎永顺 * name: 统计弹框 * Description: * Date: 2023/4/10 */ import React, { Component } from "react"; import { Button, message, Modal } from "antd"; import { WeaDialog, WeaLocaleProvider, WeaSlideModal } from "ecCom"; import { reportStatisticsReportSave } from "../../../apis/ruleconfig"; import "../index.less"; const { getLabel } = WeaLocaleProvider; class StatisticsModal extends Component { constructor(props) { super(props); this.state = { loading: false }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) { document.querySelector(".xc_tj_fx_wrapper").classList.add("zIndex0-statistics"); } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { document.querySelector(".xc_tj_fx_wrapper").classList.remove("zIndex0-statistics"); } } handleSaveReportList = () => { const { form, id, onCancel } = this.props; form.validateForm().then(f => { if (f.isValid) { const { dimensionIds, reportName } = form.getFormParams(); const payload = { id, reportName, dimensionIds: dimensionIds.split(",") }; this.setState({ loading: true }); reportStatisticsReportSave(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { onCancel(true); message.success(getLabel(111, "保存成功")); form.resetForm(); } else { message.error(errormsg || getLabel(111, "保存失败")); } }).catch(() => this.setState({ loading: false })); } else { Modal.warning({ title: getLabel(111, "信息确认"), content: getLabel(111, "必要信息不完整,红色*为必填项!") }); } }); }; renderTitle = () => { return