<template>
  <div :class="$style.example">
    <a-spin tip="正在加载......" size="large" spinning />
  </div>
</template>

<script>
import ManageConfigService from '@/guide/manage-config-service'
import flowService from '@/webflow/flow-service'
import components from './_import-components/sd-flow-guide-import'
export default {
  name: 'SdFlowGuide',
  metaInfo: {
    title: '业务类型选择',
  },
  components,
  data() {
    return {}
  },
  created() {
    this.showYwlx()
  },
  methods: {
    showYwlx() {
      // 弹出业务类型
      ManageConfigService.selectYwlx({
        typeCode: this.$route.query.code,
        moduleId: this.$route.query.moduleId,
        autoSubmit: true,
        callback: true,
      }).then((data) => {
        if (data) {
          flowService.startProcessByBusinessTypeId(
            data.id,
            { ...this.$route.query },
            {
              newWindow: false,
            }
          )
        } else {
          window.close()
        }
      })
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.example {
  position: relative;
  height: 100%;
  :global .ant-spin {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    margin-top: -25px;
    .ant-spin-text {
      /* stylelint-disable-next-line */
      color: #000;
    }
  }
}
</style>
