From d06d06ada314ee7a7e9ecfcffe7cee374ada8267 Mon Sep 17 00:00:00 2001 From: Zhang HaoYang <1304907854@qq.com> Date: Sun, 9 Jul 2023 00:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Ranking/Ranking.vue | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/components/Ranking/Ranking.vue b/src/components/Ranking/Ranking.vue index b66e558..139ff99 100644 --- a/src/components/Ranking/Ranking.vue +++ b/src/components/Ranking/Ranking.vue @@ -53,7 +53,7 @@ -
+
@@ -67,7 +67,7 @@ import RightTools from "@/components/Home/RightTools.vue"; import axios from 'axios'; // 安装axios后引入 import Vue from "vue"; Vue.prototype.$axios = axios; // 将axios挂载到原型上方便使用 -import echarts from 'echarts'; +import * as echarts from 'echarts' Vue.prototype.$echarts = echarts; export default { @@ -86,7 +86,7 @@ export default { // 星数数据按季度趋势: starNumByMon:[], // 项目拉取数: - pullNum:[], + // pullNum:[], // 星数数据按年份: pullNumByYear:[], // 星数数据按季度趋势: @@ -140,30 +140,29 @@ export default { that.starNum = res.data; }) }, - computed:{ - }, mounted() { this.initPage(); - this.FreshPage(this.selectedValue); - - + window.open('/', '_self'); + console.log(this.showData); }, methods: { goBack() { window.history.go(-1); }, test(){ - // console.log(this.value1); + console.log(this.showData); }, // 用户改变分类榜单时,刷新页面: initPage(){ var that = this; - - this.getRenderer(); - that.formName=['语言种类','获得星数'] + that.formName=['语言种类','获得星数']; + this.getNumData(2023,false); + setTimeout(()=>{ + this.getRenderer(); + },1000); }, + FreshPage(type){ - // history.go(0); var that = this; // console.log(that.selectedValueByYear); type = type[type.length-1] - 1; @@ -214,14 +213,14 @@ export default { }, getRenderer() { var that = this; - var manuChart = that.$echarts.init(document.getElementById("EChart")); + var manuChart = this.$echarts.init(this.$refs.EChart); let name = []; let value = []; for(let i=0;i < that.showData.length;i++){ name.push(that.showData[i]['name']); value.push(that.showData[i]['count']); } - const option = { + var option = { tooltip: { trigger: "axis" },