indexControl.vue 1.36 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>
        <notice-board v-if="activeName === 'noticeBoard'"
                      @gotoDetail="gotoDetail" />
        <staff-detail v-if="activeName === 'details'"
                      :params-obj="recordInfo" />
      </div>
    </div>
  </div>
</template>

<script>
import noticeBoard from './noticeBoard'
import staffDetail from './details'
import { deepClone } from '@/common/util'
export default {
  name: 'StaffIndex',
  data() {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      activeName: 'noticeBoard',
      recordInfo: {}
    }
  },

  components: {
    noticeBoard,
    staffDetail
  },

  mounted() {

  },

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

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

  .header {
    ::v-deep .el-tabs__header {
      margin: 0;
      padding: 0 20px;
    }
  }
}
</style>