import { Spin } from 'antd'; import React, { Component } from 'react'; import { GlobalItemProp } from '../App'; import styles from "./index.module.css"; import { PositionProp } from "./ComponentHOC.d"; import { ConfigItemProp, ConfigListProp } from './chart.d'; interface Prop { data: GlobalItemProp ; style : React.CSSProperties; } interface State { remoteData :any; } export default class ComponentHOC extends Component { state : State = { remoteData : undefined , } getPosition = (data:GlobalItemProp):PositionProp =>{ let [x,y,w,h]:number[]= [0,0,0,0]; const pd : any = data.data?.param?.config; x = pd['X位置'].value; y = pd['Y位置'].value; w = pd['宽度'].value; h = pd['高度'].value; return { x,y,w,h } } render(){ const {data,style} = this.props; const p : PositionProp = this.getPosition(data) return ( //overflow:"hidden" 不设置隐藏
{this.props.children}
) } }