king
2023-07-07 ac4e2892a68bb4ef5b35e8e2e12e76d3ec3ede35
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -22,6 +22,7 @@
const AntvScatter = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-scatter'))
const TableCard = asyncComponent(() => import('@/tabviews/custom/components/card/table-card'))
const NormalTable = asyncComponent(() => import('@/tabviews/custom/components/table/normal-table'))
const DoubleDataCard = asyncComponent(() => import('@/tabviews/custom/components/card/double-data-card'))
const EditTable = asyncComponent(() => import('@/tabviews/custom/components/table/edit-table'))
const PropCard = asyncComponent(() => import('@/tabviews/custom/components/card/prop-card'))
const NormalGroup = asyncComponent(() => import('@/tabviews/custom/components/group/normal-group'))
@@ -38,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 = {
@@ -173,13 +176,10 @@
    })
  }
  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') {
@@ -202,6 +202,12 @@
        return (
          <Col span={item.width} style={style} key={item.uuid}>
            <NormalTable config={item} data={data} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'card' && item.subtype === 'dualdatacard') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
            <DoubleDataCard config={item} mainSearch={mainSearch}/>
          </Col>
        )
      } else if (item.type === 'bar' || item.type === 'line') {
@@ -305,6 +311,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}>
@@ -341,6 +353,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
      }
@@ -348,8 +366,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>
    )
  }
}