indexControl.vue 1.67 KB
<!-- 门店预警管理 -->
<template>
  <div class="staffWarn">
    <div
      class="header"
      slot="header"
    >
      <el-tabs
        v-model="activeName"
        @tab-click="handleClickTabs"
      >
        <el-tab-pane
          label="预警看板"
          name="noticeBoard"
        />
        <el-tab-pane
          label="预警明细"
          name="details"
        />
      </el-tabs>
      <div v-if="initStatus">
        <notice-board
          v-if="activeName === 'noticeBoard'"
          @gotoDetail="gotoDetail"
        />
        <staff-detail
          v-if="activeName === 'details'"
          :params-obj="recordInfo"
          @openWindow="$emit('openWindow',$event)"
        />
      </div>
    </div>
  </div>
</template>

<script>
import noticeBoard from './noticeBoard'
import staffDetail from './details'
export default {
  name: 'StaffIndex',
  data () {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      activeName: 'noticeBoard',
      recordInfo: {},
      initStatus: false
    }
  },
  props: {
    show: Boolean
  },
  components: {
    noticeBoard,
    staffDetail
  },
  watch: {
    show (val) {
      if (val) this.initStatus = true
    }
  },
  mounted () {

  },

  methods: {
    handleClickTabs () {
      this.recordInfo = {}
    },
    gotoDetail (params) {
      this.activeName = 'details'
      this.recordInfo = params
      console.log(params)
    }
  }
}

</script>
<style lang="scss" scoped>
.staffWarn {
  padding: 0 20px;

  .header {
    ::v-deep .el-tabs__header {
      margin: 0;
      padding: 0 20px;
    }
    ::v-deep.el-tabs__nav-wrap{
      &::after{
        height: 1px !important;
      }
    }
  }
}
</style>