king
2023-07-10 89a58758f2045daf62383dc993178d857f3bbc39
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -39,6 +39,8 @@
const CustomChart = asyncComponent(() => import('@/tabviews/custom/components/chart/custom-chart'))
const MkBaseTable = asyncComponent(() => import('@/tabviews/custom/components/table/base-table'))
const AntvG6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-G6'))
const AntvX6 = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-X6'))
const Calendar = asyncComponent(() => import('@/tabviews/custom/components/calendar'))
class TabTransfer extends Component {
  static propTpyes = {
@@ -174,17 +176,16 @@
    })
  }
  getComponents = () => {
    const { config } = this.props
  getComponents = (components) => {
    const { mainSearch, data } = this.state
    if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />)
    return config.components.map(item => {
    return components.map(item => {
      let style = null
      if (item.style && item.style.clear === 'left') {
        style = {clear: 'left'}
      } else if (item.style && item.style.clear === 'right') {
        style = {float: 'right'}
      }
      if (item.type === 'card' && item.subtype === 'datacard') {
@@ -312,6 +313,12 @@
            <NormalTree config={item} data={data} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'calendar') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
            <Calendar config={item} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'editor') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
@@ -348,6 +355,12 @@
            <AntvG6 config={item} data={data} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'antvX6') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
            <AntvX6 config={item}/>
          </Col>
        )
      } else {
        return null
      }
@@ -355,8 +368,12 @@
  }
  render() {
    const { config } = this.props
    if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />)
    return (
      <Row className="component-wrap" gutter={8}>{this.getComponents()}</Row>
      <Row className="component-wrap" id={'anchor' + config.uuid} gutter={8}>{this.getComponents(config.components)}</Row>
    )
  }
}