import { Component, ReactNode } from "react"; import { Popup } from "@Context/Popups"; import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status"; import { Localization } from "@Component/Localization/Localization"; import { AttrInput } from "@Input/AttrInput/AttrInput"; import { Message } from "@Input/Message/Message"; import { ConfirmContent } from "@Component/ConfirmPopup/ConfirmPopup"; import { ProcessPopup } from "@Component/ProcessPopup/ProcessPopup"; import { Emitter } from "@Model/Emitter"; import "./OfflineRender.scss"; interface IOfflineRenderProps { close?: () => any; } interface IOfflineRenderState { time: number; fps: number; name: string; } class OfflineRender extends Popup { public minWidth: number = 250; public minHeight: number = 150; public width: number = 400; public height: number = 300; public maskForSelf: boolean = true; public onRenderHeader(): ReactNode { return } public render(): ReactNode { return { this.close(); }}/> } } @useStatusWithEvent() class OfflineRenderComponent extends Component { public constructor(props: IOfflineRenderProps & IMixinStatusProps) { super(props); this.state = { name: this.props.status?.getNewClipName() ?? "", time: 10, fps: 60 } } public render(): ReactNode { return { // 获取新实例 let newClip = this.props.status?.newClip(); if (newClip) { newClip.name = this.state.name; this.props.status?.actuator.offlineRender(newClip, this.state.time, this.state.fps); // 开启进度条弹窗 this.props.status?.popup.showPopup(ProcessPopup, {}); } // 关闭这个弹窗 this.props.close && this.props.close(); } }]} > { this.setState({ name: val }); }} /> { this.setState({ time: parseFloat(val) }); }} /> { this.setState({ fps: parseFloat(val) }); }} /> } } export { OfflineRender };