zzzz
2024-03-31 2d608cb2ca627a127555a19869dedf363a025470
1
{"ast":null,"code":"//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport AsSets from \"@/components/assetsCenter/assets\";\nimport OverView from \"@/components/assetsCenter/overview\";\nimport Contract from \"@/components/assetsCenter/contract\";\nimport Financial from \"@/components/assetsCenter/financial\";\nimport Axios from \"@/API/assets\";\nexport default {\n  name: \"assets-index\",\n  components: {\n    AsSets,\n    OverView,\n    Contract,\n    Financial\n  },\n  data() {\n    return {\n      type: \"left\",\n      //left 从左往右 right 从有王座\n      list: [],\n      timer: null,\n      tab: 0,\n      index: 0,\n      // 每个组件的二级tab\n      funds: {},\n      typeList: [{\n        type: this.$t(\"总览\")\n      }, {\n        type: this.$t(\"现货账户\")\n      }, {\n        type: this.$t(\"合约\")\n      }, {\n        type: this.$t(\"理财\")\n      }]\n    };\n  },\n  methods: {\n    onTabs(val) {\n      if (this.tab < val) {\n        this.type = \"right\";\n      } else {\n        this.type = \"left\";\n      }\n      console.log(val);\n      this.tab = val;\n    },\n    getAssets() {\n      Axios.GetAllAssets().then(res => {\n        const {\n          code,\n          data\n        } = res;\n        if (code) {\n          //console.log('总资产数据',data)\n          this.funds = data;\n        }\n      });\n    }\n  },\n  created() {\n    this.getAssets();\n    this.timer = setInterval(() => {\n      this.getAssets();\n    }, 5000);\n    if (Object.hasOwnProperty.call(this.$route.query, \"tab\")) {\n      this.tab = this.$route.query.tab / 1;\n      this.index = this.$route.query.index ? this.$route.query.index * 1 : 0;\n    }\n  },\n  activated() {\n    clearInterval(this.timer);\n    this.timer = setInterval(() => {\n      this.getAssets();\n    }, 5000);\n    this.index = 0;\n  },\n  deactivated() {\n    clearInterval(this.timer);\n    this.timer = null;\n  },\n  beforeDestroy() {\n    clearInterval(this.timer);\n    this.timer = null;\n  }\n};","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}