<template>
  <div>
    <LowCodeRenderEnter v-if="render" :config="config"/>
    <a-card v-else>
      <a-empty description="未找到低代码页面配置！"/>
    </a-card>
  </div>
</template>

<script>
import LowCodeRenderEnter from '@vue2-client/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue'
import { getConfigByName } from '@vue2-client/services/api/common'

export default {
  name: 'LowCodeRender',
  data () {
    return {
      config: [],
      render: false
    }
  },
  components: {
    LowCodeRenderEnter
  },
  created () {
    const pageConfigName = this.$route.meta.pageConfig
    let serviceName
    if (this.$route.meta.serviceName) {
      serviceName = this.$route.meta.serviceName
    }
    if (pageConfigName) {
      getConfigByName(pageConfigName, serviceName, (res) => {
        this.config = res.config
        this.render = true
      })
    }
  },
}
</script>

<style scoped lang="less">

</style>
