<template>
  <!-- 币价当前市值排名 -->
  <div v-loading="coinmarketallLoading" class="main">
  
    <el-row>
      <el-col>
        <div class="navBox">
          <span >{{$t(`home.ranking`)}}</span>
          <span >{{$t(`home.date`)}}</span>
          <span >{{$t(`home.trading`)}}</span>
          <span >{{$t(`home.currency`)}}(USD)</span>
          <span >{{$t(`home.dayCurrency`)}}</span>
          
        </div>
        <!-- ----------手风琴------------------ -->
        <el-collapse accordion @change="handelChang" v-model="activeNames">
          <el-collapse-item
            v-for="(item, index) in allData"
            :key="item.id"
            @click.native="handelClick(item.param, item.id, index)"
            
          >
            <template slot="title">
              <div class="accordion">
                <span>{{ index+1 }}</span>
                <span>{{ item.time }}</span>
                <span class="currencyBox">
                  <img class="img" :src="item.src ? item.src : null" alt=""   @error="imageLoad" />
                  <!-- 拿到item.param的值 -->
                  <span>{{ item.param }}</span>
                </span>
                <span>{{ item.value }}  </span>
               
                <span>
                  <div
                    class="chart"
                    :id="'echartsBox' + item.id"
                    style="width: 200px; height: 30px"
                  ></div>
                </span>
              </div>
            </template>

            <div :id="'echarts' + item.id" class="DropDownChart" v-loading="chartLoading"></div>
          </el-collapse-item>
        </el-collapse>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import indexJs from "./index";
export default {
  mixins: [indexJs],
};
</script>

<style lang="scss" scoped>
.main {
  height: 100vh;
  padding: 0px 20px;
}
.navBox {
  // background: gold;
  width: 100%;
  height: 60px;
  line-height: 60px;
  // display: flex;
  // justify-content: space-around;
  background: rgba(247, 147, 27, 0.1);

}

.navBox span {
  display: inline-block;

  // width: 100px;
  width: calc(98.5% / 5);
  text-align: center;

    // outline: 1px solid red;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.accordion {
  display: flex;
  position: relative;
  // outline: 1px solid green;
  // background: gold;
  width: 100%;
  height: 100%;
  // height: 100px;

  justify-content: space-around;
}
.conent {
  height: 100px;
 
  // background: darkmagenta;
}
.accordion > span {
  // outline: 1px solid red;
  //  background: gold;
  width: calc(100% / 4);
  text-align: center;
  line-height: 59px;
  font-weight: 600;
}
// ------------交易对样式----------------------------
.currencyBox {
  // outline: 1px solid red;
  position: relative;
  // background: greenyellow;
  box-sizing: border-box;
  padding-left: 30px;
  
}
.img {
  width: 22px;
  // outline: 1px solid red;
  position: absolute;
  left: 108px;
  top: 19px;
  bottom: 0;
}
.currencyBox > span {
  // position: absolute;
  // outline: 1px solid red;
  // height: 100%;
  // left: 180px;
  // top: 0px;

  // bottom: 0;
  font-weight: 600;
}
.chart {
  // outline: 1px solid red;
  position: absolute;
  top: 10px;
  right: 50px;
}
// -----------------------------

.DropDownChart {
  width: 100%;
  height: 600px;
  // margin-left: 50px;
  // margin-top: 30px;
  // outline: 1px solid red;
}
</style>
<style  lang="scss">
.el-collapse-item__header {
  // outline: 1px solid red;
  height: 59px;
  display: flex;
  align-items: center;
}
.projectCost {
  margin-left: 40px;
  .container {
    display: flex;
    width: 680px;
    height: 240px;
    background-size: 100% 100%;
    // background-image: url('../../../assets/images/projectTest/costDetail.png');
    .wrapper {
      margin-top: 20px;
      width: 340px;
      height: 180px;
      border-right: 1px solid #0b61b3;
      // background: gold;
      .roseChart {
        width: 260px;
        height: 180px;
      }
    }
  }
}
</style>