<template>
  <section class="askForm">
    <template v-if="showDetail">
      <form-detail/>
    </template>
    <ai-loading v-else :tips="errMsg"/>
  </section>
</template>

<script>
import AiLoading from "../../components/AiLoading";
import {mapState} from "vuex";
import FormDetail from "./formDetail";

export default {
  name: "askForm",
  appName: "问卷表单",
  components: {FormDetail, AiLoading},
  computed: {
    ...mapState(['openUser', 'user']),
    showDetail() {
      return !!this.$route.query?.id
    },
  },
  data() {
    return {
      errMsg: "加载表单中..."
    }
  },
  onReachBottom() {
    this.$refs?.FormList?.reachBottom()
  }
}
</script>

<style lang="scss" scoped>
.askForm {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #fff;
}
</style>
