1
PC-20250623MANY\Administrator
2025-08-10 9383bf5b9321361331c842352c871cb2693df693
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import * as api from "@/axios/api";
export default {
  data() {
    return {
      pageNum: 1,
      pageSize: 10,
      total: 1,
      tableData: [],
      apiInterface: null,
 
      // 词典
      dictionary: {
        // 股票类型
        gplx: {
          0: this.$t("日内"),
          2: "IPO",
          3: this.$t("hj621"),
          4: "AI",
        },
        // ipo类型
        ipolx: {
          1: this.$t("申购中"),
          2: this.$t("hj132"),
          3: this.$t("hj133"),
          4: this.$t("hj134"),
          5: this.$t("hj135"),
          6: this.$t("已上市"),
        },
        // 基金类型
        jjlx: {
          1: this.$t("进行中"),
          2: this.$t("已赎回"),
        },
      },
 
      utm: 1, // US转MX汇率
      mtu: 1, // MX转US汇率
    };
  },
  watch: {
    // pageNum() {
    //   this.getList();
    // },
    // pageSize() {
    //   this.init();
    // },
    opt: {
      handler() {
        this.init();
      },
      deep: true,
    },
  },
  methods: {
    // 初始化
    init() {
      this.pageNum = 1;
      this.getList();
    },
    // 获取列表
    async getList() {
      let option = {
        pageNum: this.pageNum,
        pageSize: this.pageSize,
      };
      if (this.opt) option = { ...option, ...this.opt };
      let data = await this.apiInterface(option);
      if (data.status === 0) {
        this.tableData = data.data.list || data.data.records || data.data;
        this.total = data.data.total;
 
        if (this.getListAfter) this.getListAfter(); // 获取列表后,如果方法getListAfter存在,则执行
      }
      // console.log("data", data);
    },
    // 翻页
    handleCurrentChange(val) {
      this.pageNum = val;
      this.getList();
    },
    // 获取汇率
    async getExchangeRate() {
      let data = await api.getRateInfo();
      data.data &&
        data.data.forEach((item) => {
          if (item.currency === "USD") {
            this.utm = item.rata;
          } else if (item.currency === "MXN") {
            this.mtu = item.rata;
          }
        });
    },
  },
};