<template>
  <div class="template-editor-wrap">
      <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird"></bread-crumb>
      <div class="add-content screenSet" id="screenSet">
        <step-content
          :active="active"
          :fished="fished"
          @nextStep="nextStep"
          @complete="complete"
        />
        <!-- 基础组件 -->
        <base-message
          ref="baseMessage"
          v-if="active == 0 && formData"
          :formData="formData"
          :projectManger="projectManger"
        />

        <!-- 选择项目组件 -->
        <select-template v-if="active == 1" />


        <!-- 选择行政区 -->
        <!-- <select-region v-if="active == 1"></select-region> -->

        
        <!-- 设定机构 -->
        <!-- <set-Organization v-if="active == 0"></set-Organization> -->
      </div>
  </div>
</template>

<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import stepContent from "../../components/education/template/stepContent";
import baseMessage from "../../components/education/template/baseMessage";
import selectTemplate from "../../components/education/template/selectTemplate";
import selectRegion from "../../components/education/template/selectRegion";
import setOrganization from "../../components/education/template/setOrganization";
export default {
  data() {
    return {
      curmbFirst: "教培项目",
      curmbSecond: "模板管理",
      curmbThird: '新建项目模板',
      active: 0,
      fished: false,
      projectManger: false,
      formData: {
        projectName: "",
        projectBegintime: "",
        projectEndtime: "",
        projectIntro: "",
        type: 1,
        useTime: "",
        xueke: "",
        attachmentUrl1: "",
        attachmentUrl2: "",
        attachmentUrl3: "",
        attachmentMore1: {},
        attachmentMore2: {},
        scopeType: 0,
        organizationName: "",
        organizationNameList: [''],
        sendOption: 1,
        receiveOption: 1,
        visibleFlag: 1,
        learnableFlag: 2,
        authorityType: 1,
        allowLearn: 2,
        richContent: ''
      },
      formTemplate: {
        component: [],
        configure: 2,
        certificate: ""
      }
    }
  },
  components: {
    BreadCrumb,
    stepContent,
    baseMessage,
    selectTemplate,
    selectRegion,
    setOrganization
  },
  created() {},
  methods: {
    // 下一步
    nextStep() {
      // let flag = this.$refs.baseMessage.nextStep();
      // if (!flag) {
      //   return;
      // }
      this.active++;
      if (this.active == 1) {
        this.fished = true;
      }
    },
    complete() {
      console.log('完成');
    }
  }
}
</script>

<style lang="scss" scoped>
.template-editor-wrap {
  .add-content {
    background: #fff;
  }
}
</style>
