更新页面
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
</el-table>
|
||||
<el-button @click="test()"></el-button>
|
||||
|
||||
<div id="EChart" style="width: 700px; height: 700px;"></div>
|
||||
<div ref="EChart" style="width: 700px; height: 700px;"></div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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;
|
||||
|
||||
that.formName=['语言种类','获得星数'];
|
||||
this.getNumData(2023,false);
|
||||
setTimeout(()=>{
|
||||
this.getRenderer();
|
||||
that.formName=['语言种类','获得星数']
|
||||
},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"
|
||||
},
|
||||
|
Reference in New Issue
Block a user