<!--群发消息总数居-->
<template>
  <div class="dm-wrap batch_list">
    <div class="title flex_between">
      <div class="flex_between">
        <img :src="require('@/assets/img/icon-send.png')" class="img" />
        <h2>群发任务</h2>
      </div>
      <el-link type="primary" :underline="false" style="color: #1890ff" @click="$emit('toClue', '群发')">查看详情<i class="el-icon-arrow-right" style="margin-left: 10px"></i></el-link>
    </div>
    <batch-send-sum v-if="taskList" :data="taskList" />
    <div class="wrap" v-if="telTrafficList || msgList">
      <div v-if="telTrafficList">
        <div class="flex_between" style="margin-bottom: 12px;padding-right: 20px">
          <h3>群发失败-话务</h3>
          <el-link type="primary" :underline="false" style="color: #1890ff" @click="$emit('toClue', '群发转话务')">查看详情<i class="el-icon-arrow-right" style="margin-left: 10px"></i></el-link>
        </div>
        <div style="padding: 0px 20px"><batch-fail-phone :data="telTrafficList" /></div>
      </div>
      <div v-if="msgList" :style="{ marginTop: telTrafficList ? '26px' : '0' }">
        <h3 style="margin-bottom: 12px">群发失败-短信</h3>
        <div style="padding: 0px 20px"><batch-fail-msg :data="msgList" /></div>
      </div>
    </div>
  </div>
</template>

<script>
import formatterNum from '@/mixins/validateNum';
import batchSendSum from './batch-send-sum';
import batchFailPhone from './batch-fail-phone';
import batchFailMsg from './batch-fail-msg';
export default {
  name: 'batch-send',
  mixins: [formatterNum],
  components: { batchSendSum, batchFailPhone, batchFailMsg },
  data() {
    return {};
  },
  props: {
    taskList: {
      type: Object || undefined
    },
    telTrafficList: {
      type: Object || undefined
    },
    msgList: {
      type: Object || undefined
    }
  }
};
</script>

<style scoped lang="scss">
.batch_list {
  padding: 19px 20px 30px !important;
  margin-bottom: 10px !important;
  font-family: PingFangSC-Regular, PingFang SC;
  .title {
    height: 22px;
    margin-bottom: 10px;
    line-height: 22px;
    h2 {
      font-size: 16px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 700;
      color: #303133;
      margin-left: 2px;
    }
  }
  .img {
    transform: scale(0.5);
  }
  .flex_between {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .wrap {
    margin-top: 20px;
    padding: 20px 0 30px;
    border-radius: 2px;
    border: 2px dashed #c9dafd;
  }
  h3 {
    width: 139px;
    height: 25px;
    background: #bad9ff;
    line-height: 25px;
    text-align: center;
    border-radius: 2px;
    margin-left: -2px;
    color: #303133;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 600;
  }
}
</style>
