<template>
  <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      width="50%"
      :before-close="handleClose">
    <div class="page">

      <block-header :title="title"/>
      <div class="b-table">
        <el-table
            size="small"
            border
            :data="records"
            stripe
            style="width: 100%;">
          <el-table-column align="center" prop="gmtCreated" label="签约时间" :formatter="dateFormat"></el-table-column>
          <el-table-column align="center" prop="operaterDesc" label="备注"></el-table-column>
        </el-table>
      </div>

    </div>
  </el-dialog>
</template>

<script>

export default {
  name: "BindBankRecords",
  props: {
    cardLogList: {
      type: Array
    },
    dialogVisible: {
      type: Boolean,
      required: true,
    },
    title: {
      type: String,
      required: true,
    },
    params: {
      type: Object,
      required: true
    },
  },
  data() {
    return {
      records: [],
    }
  },
  created() {
    if (this.params) {
      const {cardLogList} = this.params;
      this.records = cardLogList.length ? this.reverse(cardLogList) : [];
    }
  },
  methods: {
    handleClose() {
      this.$emit('handleClose')
    },
    reverse(array) {
      const newArr = [];
      for (let i = array.length - 1; i >= 0; i--) {
        newArr[newArr.length] = array[i];
      }
      return newArr;
    }
  }
}
</script>
