<template>
  <ConfigForms form-type="1" @addMethods="addMethods"></ConfigForms>
</template>

<script>
import ConfigForms from "./components/ConfigForms.vue"
export default {
  name: "ScreeningAdd",
  components: {
    ConfigForms,
  },
  provide() {
    const showIndex = true
    return {
      showIndex,
    }
  },
  data() {
    return {}
  },
  created() {
    sessionStorage.removeItem("survey_time")
    sessionStorage.removeItem("birthday")
    sessionStorage.removeItem("addSex")
    this.$store.commit("table/setAge", "")
  },
  methods: {
    // 处理部分逻辑
    addMethods(v) {
      console.log(v)
      if (v.activeName == "index0") {
        let data = {
          birthday: v.form.birthday,
          sex: v.form.sex,
          survey_time: v.form.survey_time,
        }
        sessionStorage.setItem("index1Data", JSON.stringify(data))
      }
    },
  },
  // beforeRouteEnter(to, from, next) {
  //   next()
  // },
}
</script>

<style lang="scss" scoped></style>
