更新页面
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<el-button @click="test()"></el-button>
|
<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>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +67,7 @@ import RightTools from "@/components/Home/RightTools.vue";
|
|||||||
import axios from 'axios'; // 安装axios后引入
|
import axios from 'axios'; // 安装axios后引入
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
Vue.prototype.$axios = axios; // 将axios挂载到原型上方便使用
|
Vue.prototype.$axios = axios; // 将axios挂载到原型上方便使用
|
||||||
import echarts from 'echarts';
|
import * as echarts from 'echarts'
|
||||||
Vue.prototype.$echarts = echarts;
|
Vue.prototype.$echarts = echarts;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -86,7 +86,7 @@ export default {
|
|||||||
// 星数数据按季度趋势:
|
// 星数数据按季度趋势:
|
||||||
starNumByMon:[],
|
starNumByMon:[],
|
||||||
// 项目拉取数:
|
// 项目拉取数:
|
||||||
pullNum:[],
|
// pullNum:[],
|
||||||
// 星数数据按年份:
|
// 星数数据按年份:
|
||||||
pullNumByYear:[],
|
pullNumByYear:[],
|
||||||
// 星数数据按季度趋势:
|
// 星数数据按季度趋势:
|
||||||
@@ -140,30 +140,29 @@ export default {
|
|||||||
that.starNum = res.data;
|
that.starNum = res.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed:{
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initPage();
|
this.initPage();
|
||||||
this.FreshPage(this.selectedValue);
|
window.open('/', '_self');
|
||||||
|
console.log(this.showData);
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goBack() {
|
goBack() {
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
},
|
},
|
||||||
test(){
|
test(){
|
||||||
// console.log(this.value1);
|
console.log(this.showData);
|
||||||
},
|
},
|
||||||
// 用户改变分类榜单时,刷新页面:
|
// 用户改变分类榜单时,刷新页面:
|
||||||
initPage(){
|
initPage(){
|
||||||
var that = this;
|
var that = this;
|
||||||
|
that.formName=['语言种类','获得星数'];
|
||||||
this.getRenderer();
|
this.getNumData(2023,false);
|
||||||
that.formName=['语言种类','获得星数']
|
setTimeout(()=>{
|
||||||
|
this.getRenderer();
|
||||||
|
},1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
FreshPage(type){
|
FreshPage(type){
|
||||||
// history.go(0);
|
|
||||||
var that = this;
|
var that = this;
|
||||||
// console.log(that.selectedValueByYear);
|
// console.log(that.selectedValueByYear);
|
||||||
type = type[type.length-1] - 1;
|
type = type[type.length-1] - 1;
|
||||||
@@ -214,14 +213,14 @@ export default {
|
|||||||
},
|
},
|
||||||
getRenderer() {
|
getRenderer() {
|
||||||
var that = this;
|
var that = this;
|
||||||
var manuChart = that.$echarts.init(document.getElementById("EChart"));
|
var manuChart = this.$echarts.init(this.$refs.EChart);
|
||||||
let name = [];
|
let name = [];
|
||||||
let value = [];
|
let value = [];
|
||||||
for(let i=0;i < that.showData.length;i++){
|
for(let i=0;i < that.showData.length;i++){
|
||||||
name.push(that.showData[i]['name']);
|
name.push(that.showData[i]['name']);
|
||||||
value.push(that.showData[i]['count']);
|
value.push(that.showData[i]['count']);
|
||||||
}
|
}
|
||||||
const option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis"
|
trigger: "axis"
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user