Browse Source

init

newStyle
wangxiaohua 3 years ago
parent
commit
3d1ff76f7a
4 changed files with 140 additions and 41 deletions
  1. +67
    -29
      src/views/Statistics/MentoringAbility.vue
  2. +11
    -2
      src/views/Statistics/TrendAnalysis.vue
  3. +60
    -8
      src/views/Statistics/trend.vue
  4. +2
    -2
      vue.config.js

+ 67
- 29
src/views/Statistics/MentoringAbility.vue View File

@@ -851,9 +851,6 @@ export default {
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;
option = { option = {
tooltip: {
trigger: "axis",
},
legend: { legend: {
data: [this.consultantname,this.Packname], data: [this.consultantname,this.Packname],
top: "6", top: "6",
@@ -881,32 +878,6 @@ export default {
}, },
}, },
}, },
yAxis: {
type: "value",
splitNumber: 4,
axisLabel: {
//重点在这一块,其余可以忽略
textStyle: {
color: "#212121", //更改坐标轴文字颜色
},
},
axisLine: {
lineStyle: {
ype: "solid",
color: "#DDE1EE", //x线的颜色
width: "1", //坐标线的宽度
},
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
},
},
axisTick: {
//y轴刻度线
show: false,
},
},
series: [ series: [
{ {
name: this.consultantname, name: this.consultantname,
@@ -922,6 +893,73 @@ export default {
} }
], ],
}; };
if(data1=='data3'){
option.tooltip={
trigger: 'axis',
formatter: function (params) {
let src= '<p>'+params[0].seriesName+':'+params[0].data+'%'+'</p>'+'<p>'+params[1].seriesName+':'+ params[1].data+'%'+'</p>';
return src
}
};
option.yAxis={
type: 'value',
splitNumber:5,
max:100,
min:0,
axisLabel: { //重点在这一块,其余可以忽略
textStyle: {
color: '#212121', //更改坐标轴文字颜色
}
},
axisLine: {
lineStyle: {
ype: 'solid',
color: '#DDE1EE',//x线的颜色
width:'1'//坐标线的宽度
}
},
splitLine: {
lineStyle: {
type: 'dashed' // y轴分割线类型
}
},
axisTick: { //y轴刻度线
show: false
},
}
}else{
option.tooltip={
trigger: 'axis',
}
option.yAxis={
type: 'value',
splitNumber:5,
min:0,
minInterval: 1,
axisLabel: { //重点在这一块,其余可以忽略
textStyle: {
color: '#212121', //更改坐标轴文字颜色
}
},
axisLine: {
lineStyle: {
ype: 'solid',
color: '#DDE1EE',//x线的颜色
width:'1'//坐标线的宽度
}
},
splitLine: {
lineStyle: {
type: 'dashed' // y轴分割线类型
}
},
axisTick: { //y轴刻度线
show: false
},
};
}


option && myChart.setOption(option); option && myChart.setOption(option);
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
myChart.resize(); myChart.resize();


+ 11
- 2
src/views/Statistics/TrendAnalysis.vue View File

@@ -798,6 +798,7 @@ export default {
option = { option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
formatter: '{b0}: {c0}'+'%'
}, },
legend: { legend: {
data: ["起始时间"], data: ["起始时间"],
@@ -828,7 +829,9 @@ export default {
}, },
yAxis: { yAxis: {
type: "value", type: "value",
splitNumber: 4,
splitNumber:5,
max:100,
min:0,
axisLabel: { axisLabel: {
//重点在这一块,其余可以忽略 //重点在这一块,其余可以忽略
textStyle: { textStyle: {
@@ -876,6 +879,10 @@ export default {
option = { option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
formatter: function (params) {
let src= '<p>'+params[0].seriesName+':'+params[0].data+'%'+'</p>'+'<p>'+params[1].seriesName+':'+ params[1].data+'%'+'</p>';
return src
}
}, },
legend: { legend: {
data: ["起始时间","对比时间"], data: ["起始时间","对比时间"],
@@ -906,7 +913,9 @@ export default {
}, },
yAxis: { yAxis: {
type: "value", type: "value",
splitNumber: 4,
splitNumber:5,
max:100,
min:0,
axisLabel: { axisLabel: {
//重点在这一块,其余可以忽略 //重点在这一块,其余可以忽略
textStyle: { textStyle: {


+ 60
- 8
src/views/Statistics/trend.vue View File

@@ -689,15 +689,15 @@ export default {
}, },
//卡片下折线图 //卡片下折线图
SwitchCARDS(arr, str, timeDate, Strname) { SwitchCARDS(arr, str, timeDate, Strname) {
// console.log(arr,str,timeDate,Strname);
echarts.init(document.getElementById(str)).dispose(); // 销毁实例
var chartDom = document.getElementById(str); var chartDom = document.getElementById(str);
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;


option = { option = {
tooltip: {
trigger: "axis",
},
// tooltip: {
// trigger: "axis",
// },
legend: { legend: {
data: Strname, data: Strname,
bottom: "10", bottom: "10",
@@ -725,7 +725,57 @@ export default {
}, },
}, },
}, },
yAxis: {

series: arr,
};
if(this.secindex=='fraction'){
if(this.selectTime1){
option.tooltip={
trigger: 'axis',
formatter: function (params) {
let src= '<p>'+params[0].seriesName+':'+params[0].data+'%'+'</p>'+'<p>'+params[1].seriesName+':'+ params[1].data+'%'+'</p>';
return src
}
};
}else{
option.tooltip={
trigger: 'axis',
formatter: '{b0}:{c0}'+'%'
}
}

option.yAxis={
type: 'value',
splitNumber:5,
max:100,
min:0,
axisLabel: { //重点在这一块,其余可以忽略
textStyle: {
color: '#212121', //更改坐标轴文字颜色
}
},
axisLine: {
lineStyle: {
ype: 'solid',
color: '#DDE1EE',//x线的颜色
width:'1'//坐标线的宽度
}
},
splitLine: {
lineStyle: {
type: 'dashed' // y轴分割线类型
}
},
axisTick: { //y轴刻度线
show: false
},
}

}else{
option.tooltip={
trigger: "axis",
}
option.yAxis={
type: "value", type: "value",
splitNumber: 4, splitNumber: 4,
axisLabel: { axisLabel: {
@@ -750,9 +800,11 @@ export default {
//y轴刻度线 //y轴刻度线
show: false, show: false,
}, },
},
series: arr,
};
}
}



option && myChart.setOption(option); option && myChart.setOption(option);
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
myChart.resize(); myChart.resize();


+ 2
- 2
vue.config.js View File

@@ -3,8 +3,8 @@
* https://cli.vuejs.org/zh/config/ * https://cli.vuejs.org/zh/config/
*/ */
// const url = 'http://pigx-gateway' // const url = 'http://pigx-gateway'
const url = 'http://39.97.167.65:9999' //测试
// const url = 'http://192.168.31.169:9999' //长龙
// const url = 'http://39.97.167.65:9999' //测试
const url = 'http://192.168.31.169:9999' //长龙
// const url = 'http://192.168.31.134:9999' //嘉豪 // const url = 'http://192.168.31.134:9999' //嘉豪
// const url = 'http://192.168.31.100:9999' //王笑 // const url = 'http://192.168.31.100:9999' //王笑
// const url = 'http://nitu5e.natappfree.cc' //王笑 // const url = 'http://nitu5e.natappfree.cc' //王笑


Loading…
Cancel
Save