bloc.vue 4.72 KB
<template>
  <div class="bloc-info-module">
    <div class="wrapper">
      <div class="wrap_left">
        <div class="out_box_wrap">
          <div class="fixed_widget">
            <div class="label_text">版本:{{ bloc.merchantModelName }}</div>
            <div class="label_text dr_top">
              开通门店数:
              <span class="num_text">{{ bloc.numberStores }}家</span>
            </div>
            <div class="label_text dr_top">门店详情</div>
          </div>
          <div :class="isOpen? 'table_wrapper_open' : 'table_wrapper_close'">
            <GLTable v-if="isOpen" :hasPage="false" :tableParams="tableParams" :tableData="list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></GLTable>
          </div>
          <div class="fixed_footer"  @click="changeRightOpenStatus(isOpen)">
            <i :class="isOpen ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
            <span class="dr_left">{{ isOpen ? '隐藏门店详情' : '展开门店详情' }}</span>
          </div>
        </div>
      </div>
      <!-- <div class="wrap_right">
        <div v-for="(item, index) in rightData" :key="index" class="out_box_wrap">
          <div class="fixed_widget">
            <div class="label_text">版本:{{ item.name }}</div>
            <div class="label_text dr_top">
              开通门店数:
              <span class="num_text">{{ item.num }}家</span>
            </div>
            <div class="label_text dr_top">门店详情</div>
          </div>
          <div :class="item.open ? 'table_wrapper_open' : 'table_wrapper_close'">
            <glsx-table v-if="item.open" :hasPage="false" :tableParams="tableParams" :tableData="item.list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></glsx-table>
          </div>
          <div class="fixed_footer" @click="changeRightOpenStatus(item, index)">
            <i :class="item.open ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
            <span class="dr_left">{{ item.open ? '隐藏门店详情' : '展开门店详情' }}</span>
          </div>
        </div>
      </div> -->
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      curOpenIndex: 0,
      dataList: [],
      leftData: [],
      rightData: [],
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '门店名称',
            prop: 'merchantName'
          },
          {
            label: '有效期',
            prop:'date'
          }
        ]
      },
      isOpen:false
    }
  },
  props:{
    list:Array,
    bloc:null
  },
  methods: {
    changeLeftOpenStatus(item, index) {
      this.leftData[index].open = !item.open
    },
    changeRightOpenStatus(isOpen) {
      this.isOpen = !isOpen
    },
    handlerData() {
      let arr = this.dataList
      let left = []
      let right = []
      arr.forEach((item, index) => {
        if (index % 2 == 0) {
          left.push(item)
        } else {
          right.push(item)
        }
      })
      this.leftData = left
      this.rightData = right
      console.log(left)
      console.log(right)
    },
  },
  mounted() {
    
  }
}
</script>
<style lang="scss" scoped>
.bloc-info-module {
  box-sizing: border-box;
  padding: 20px 0 0 40px;
}
.wrapper {
  display: flex;
  flex-wrap: wrap;
  .wrap_left,
  .wrap_right {
    width: 44.8%;
    min-height: 176px;
  }
  .wrap_left {
    margin-right: 40px;
  }
}
.out_box_wrap {
  width: 100%;
  min-height: 176px;
  box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
  border-radius: 10px;
  border: 1px solid #e5e4ff;
  margin: 0 40px 40px 0;
  .fixed_widget {
    width: 100%;
    height: 140px;
    box-sizing: border-box;
    padding: 20px 0 0 20px;
    .label_text {
      color: #333333;
      font-size: 14px;
      font-weight: 400;
    }
    .num_text {
      font-size: 14px;
      font-weight: 400;
      color: #5850ff;
    }
    .dr_top {
      margin-top: 20px;
    }
  }
  .table_wrapper_close {
    height: 0;
    // transition: height 0.1s ease-in-out;
  }
  .table_wrapper_open {
    height: 395px;
    // transition: height 0.1s ease-in-out;
  }
  .fixed_footer {
    width: 100%;
    height: 36px;
    background: #f4f6fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 400;
    color: #b9b8c7;
    border-radius: 0px 0px 10px 10px;
    cursor: pointer;
    .dr_left {
      margin-left: 12px;
    }
  }
}
.bloc-info-module /deep/ .el-table__body-wrapper{
  height: 352px;
  overflow-y: auto;
  overflow-x: hidden;
}
 .bloc-info-module /deep/ .el-table__body-wrapper::-webkit-scrollbar {
    display: none;
    width: 8px;
    background: #E9E8FF;
    border-radius: 7px;
  }
</style>