WarnGroup.vue 1.86 KB
<template>
  <div class="warn-group">
    <div class="tab">
      <el-tabs v-model="activeName">
        <el-tab-pane
          v-for="item in tabList"
          :key="item.id"
          :label="item.label"
          :name="item.id"
        />
      </el-tabs>

    </div>
    <div class="warn-component">
      <template v-for="i in tabList">
        <component
          :ref="i.name"
          :key="i.id"
          :is="i.componentName"
          v-show="activeName == i.id"
          :show="activeName == i.id"
          @openWindow="$emit('openWindow',$event)"
          :pageId="i.id"
          :businessType="businessType"
        />
      </template>
    </div>
  </div>
</template>

<script type='text/ecmascript-6'>
import WarnTable from './WarnTable'
import storeWarn from '../../../store/indexControl'
export default {
  name: '',
  components: {
    WarnTable,
    storeWarn
  },
  props:{
    businessType: [String, Number]
  },
  data () {
    return {
      activeName: '1',
      tabList: [
        {
          label: '业绩风险榜',
          componentName: 'WarnTable',
          id: '1'
        },
        {
          label: '新店风险榜',
          componentName: 'WarnTable',
          id: '2'
        },
        {
          label: '门店盯防预警',
          componentName: 'storeWarn',
          id: '3'
        }
      ]
    }
  },
  mounted () {
  },
  methods: {
  }
}
</script>

<style scoped lang='scss'>
.warn-group {
  margin-top: 16px;
  background: #fff;
  // height: calc(100% - 394px);
  height: 100%;
  border-radius: 4px;
  .tab {
    ::v-deep .el-tabs__nav-wrap {
      padding: 0 20px;
    }
    ::v-deep .el-tabs__item {
      height: 54px;
      line-height: 54px;
    }
    ::v-deep.el-tabs__nav-wrap::after {
      height: 1px;
      background: #e5e5e5;
    }
  }
  .warn-component {
    position: relative;
    height: calc(100% - 68px);
  }
}
</style>