import React from "react"; import { Button, Card, Form as AntdForm, FormInstance, Popover, Space, Tooltip, } from "antd"; import { CalculatorOutlined, CloseOutlined } from "@ant-design/icons"; import { FieldConfig } from "../../tmpl/interface"; import "../pagination.css"; import FormItemGroup from "../../form/form-Item-group"; import HcserviceV3 from "../../tmpl/hcservice-v3"; import { LocaleContext } from "../../locale/LocaleProvider"; interface RestatProps { onfinish: (value) => void; fields: FieldConfig[]; value?: object; serverKey?: string; sourceId: string; } interface RestatStat { popoverOpen?: boolean; loading?: boolean; } class Restat extends React.PureComponent { static defaultProps = {}; state = { popoverOpen: false, loading: false, }; static contextType = LocaleContext; context: React.ContextType; formRef = React.createRef(); onRestat = async (val) => { const { sourceId, onfinish, serverKey } = this.props; this.setState({ loading: true, }); await HcserviceV3.increCalc(serverKey, sourceId, val); this.setState({ loading: false, }); onfinish(val); }; render() { const { popoverOpen, loading } = this.state; const { fields, value, serverKey } = this.props; const { translate } = this.context; return ( { } { } } > } placement="bottomLeft" trigger="click" > ); } } export default Restat;