import Vue from "vue";

export default Vue.extend({
  data() {
    return {
      value: "",
      focusedTab: "txRecord",
      pages: {
        currentPage: 1,
        pageSize: 10,
        total: 0,
      },
      selectedOption: "1",
      loadingTxRecordTable: false,
      txRecordList: [] as any[],
      voteList: [
        {
          height: 30303,
          hash: "102931jlakjsdflkajsdf",
          sender: "alkdsjflkajsdf",
          receiver: "aldskfjalkdsjfa",
          reward: 987234,
          time: 17602983409,
        },
      ],
      packList: [],
      loadingVote: false,
      loadingPack: false,
    };
  },
  computed: {
    tabList() {
      return [
        {
          name: this.$t("lang.trade.txRecord"),
          value: "txRecord",
        },
        {
          name: this.$t("lang.address.votingRecord"),
          value: "votingRecord",
        },
        {
          name: this.$t("lang.address.packingRecord"),
          value: "packingRecord",
        },
      ];
    },
    optionList() {
      return [
        { name: this.$t("lang.trade.txRecord"), value: "1" },
        { name: this.$t("lang.trade.consensusNode"), value: "2" },
      ];
    },
  },
  methods: {
    setValue(v: string) {
      this.value = v;
    },
    sizeChange(size: number) {
      this.pages.pageSize = size;
    },
    pageChange(page: number) {
      this.pages.currentPage = page;
    },
    groupCellName(val: any) {
      switch (val.row.tradeG) {
        case 0:
          return "";
        case 1:
          return "tx-middle";
        case 2:
          return "tx-start";
        case 3:
          return "tx-end";
        default:
          return "";
      }
    },
  },
});
