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

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

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

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