<template>
    <div class="monitor-wechat">
      <el-table ref="refMonitorTable"
        :data-read-url="accountData"
        class="dimensionality-table"
        :page-size="20"
        tooltip-effect="dark">
       <el-table-column type="index" width="60" align="center" label="序号"></el-table-column>
        <el-table-column label="账号名称" width="200">
          <template slot-scope="scope">
              <img :src="`assets/images/socialmedia/${scope.row.PCode.toLowerCase()}-logo-18x18.png`" onerror="this.src='assets/images/picture404-'+((row.ID||row.$index) % 4)+'.png';" :title="scope.row.MName" /> {{scope.row.MName}}
          </template>
        </el-table-column>
        <el-table-column prop="name" header-align="center" label="监测数据(已用/最高)">
          <el-table-column prop="newsCount" label="图文" align="center">
            <template slot-scope="scope">
              {{scope.row.newsCount}}/{{scope.row.newsQuota}}
            </template>
          </el-table-column>
          <el-table-column prop="imageCount" label="图片" align="center">
            <template slot-scope="scope">
              {{scope.row.imageCount}}/{{scope.row.imageQuota}}
            </template>
          </el-table-column>
          <el-table-column prop="videoCount" label="视频" align="center">
            <template slot-scope="scope">
              {{scope.row.videoCount}}/{{scope.row.videoQuota}}
            </template>
          </el-table-column>
          <el-table-column prop="voiceCount" label="音频" align="center">
            <template slot-scope="scope">
              {{scope.row.voiceCount}}/{{scope.row.voiceQuota}}
            </template>
          </el-table-column>
          <el-table-column prop="clearQuotaCount" label="接口清零" align="center">
            <template slot-scope="scope">
              {{scope.row.clearQuotaCount}}/{{scope.row.clearQuota}}
            </template>
          </el-table-column>
        </el-table-column>
        <el-table-column prop="warningIndex" label="警报数量" align="center">
          <template slot-scope="scope">
            {{scope.row.newsCount + scope.row.imageCount + scope.row.videoCount + scope.row.voiceCount + scope.row.clearQuotaCount}}/{{scope.row.warningIndex}}
          </template>
        </el-table-column>
        <!-- <el-table-column prop="warningIndex" label="操作" align="center">
          <template slot-scope="scope">
            <el-button type="text" class="green" @click="toMaterial(scope.row.ID)">素材管理</el-button>
          </template>
        </el-table-column> -->
      </el-table>
    </div>
</template>
<script>
export default {
  methods: {
    // 刷新表格数据
    refresh() {
      this.$refs.refMonitorTable.getData()
    },
    accountData() {
      return ['/mediamonitor/weixin', {params: {}}]
    }
  }
}
</script>
<style>
  .el-button--text.green{
    color:#28b06e
  }
  .el-button--text.green span{
    color:inherit
  }
</style>
