<template>
  <view class="container">
    <view class="tabs">
      <u-tabs
        :list="tabsList"
        font-size="30"
        :current="current"
        active-color="#2a56f7"
        @change="fnTabsChange"
      />
    </view>
    <enterprise-inspect-list v-if="current === 0" />
    <enterprise-hidden-list v-if="current === 1" />
  </view>
</template>

<script>
import EnterpriseInspectList from "./enterprise_inspect_list.vue";
import EnterpriseHiddenList from "./enterprise_hidden_list.vue";
export default {
  components: {
    EnterpriseInspectList,
    EnterpriseHiddenList,
  },
  data() {
    return {
      tabsList: [{ name: "监管帮扶管理" }, { name: "监管帮扶隐患管理" }],
      current: 0,
      recordCurrent: -1,
    };
  },
  onHide() {
    this.recordCurrent = this.current;
    this.current = -1;
  },
  onShow() {
    if (this.recordCurrent === -1) return;
    this.current = this.recordCurrent;
    this.recordCurrent = -1;
  },
  methods: {
    fnTabsChange(event) {
      this.current = event.index;
    },
  },
};
</script>

<style scoped lang="scss">
.container {
  width: 100%;
  height: calc(100vh - 45px);
  background: #fafafa;

  .tabs {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
  }
}
</style>
