<!--群发消息总数居-->
<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>
      <div class="detail" @click="$emit('toClue', '群发')"><i class="iconfont icon-chakanxiangqing"></i>查看详情</div>
    </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>
          <div class="detail" @click="$emit('toClue', '群发转话务')"><i class="iconfont icon-chakanxiangqing"></i>查看详情</div>
        </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: 32px;
    margin-bottom: 10px;
    line-height: 32px;
    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;
  }
  .detail {
    padding: 0 10px;
    background: rgba(47, 84, 235, 0.1);
    border-radius: 4px;
    height: 32px;
    color: #2f54eb;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    cursor: pointer;
    border: none;
    &:hover {
      color: #597ef7;
    }
    i {
      margin-right: 2px;
    }
  }
}
</style>
