<template>
  <div class="content-main">
    <div v-if="state == 5">
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick(type)">
        <el-tab-pane label="盟市" name="first">
          <AutonomousList></AutonomousList>
        </el-tab-pane>
        <el-tab-pane label="自治区" name="second">
          <LeagueCityList></LeagueCityList>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div v-if="state == 8">
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
        <el-tab-pane label="旗县" name="first">
          <AutonomousList></AutonomousList>
        </el-tab-pane>
        <el-tab-pane label="旗县汇总" name="second">
          <LeagueCityList></LeagueCityList>
        </el-tab-pane>
        <el-tab-pane label="盟市上报" name="third">
          <CountyList></CountyList>
        </el-tab-pane>
      </el-tabs>
    </div>

    <div v-if="state == 11">
      <CountyList></CountyList>
    </div>
  </div>
</template>

<script>
import AutonomousList from "@/page/circulate/foodMarketConstruction/foodMarketSituation/autonomousList";
import LeagueCityList from "@/page/circulate/foodMarketConstruction/foodMarketSituation/leagueCityList";
import CountyList from "@/page/circulate/foodMarketConstruction/foodMarketSituation/countyList";

export default {
  components: {
    AutonomousList,
    LeagueCityList,
    CountyList
  },
  data() {
    return {
      state: sessionStorage.getItem("orgCode").length,
      activeName: "first"
      //
      
    };
  },
  created() {
    console.log(this.$route.query,'查看或者编辑页面')
    if(this.$route.query.status == "third"){
      this.activeName = "third"
    }else if(this.$route.query.status == "second"){
      this.activeName = "second"
    }
    console.log(this.$route.query)
    console.log(this.state);
  },
  methods: {
    handleClick(type) {
      console.log(this.activeName,321)
      if(type.name == this.activeName)
      console.log(type.name,123)
    }
  }
};
</script>
