ds1.0
fanluyan 2 years ago
parent a8c6a339c5
commit 56e425f513

@ -40,14 +40,20 @@ export default {
xData1: [], //
lineData1: [], //
yMax1: "", //y
channelCrests1: [], //
dataPointer1: [], //
xData2: [], //
lineData2: [], //
yMax2: "", //y
channelCrests2: [], //
dataPointer2: [], //
xData3: [], //
lineData3: [], //
yMax3: "", //y
channelCrests3: [], //
dataPointer3: [], //
};
},
created() {
@ -68,15 +74,27 @@ export default {
// console.log(this.qtOption);
this.lineData1 = res.data.data[0]; //
this.yMax1 = res.data.config.yMax; //y
this.channelCrests1 = res.data.config.channels[0].crests;
var timeSpan = 1; //
for (
var i = 0;
i < res.data.config.numberOfData * timeSpan;
i = i + timeSpan
) {
console.log(i);
this.xData1.push(i);
}
for (var i = 0; i < this.channelCrests1.length; i++) {
this.dataPointer1.push({
name: this.channelCrests1[i].groupName,
label: this.channelCrests1[i].crestNo + "",
xAxis: this.channelCrests1[i].crestTime,
yAxis: this.lineData1[this.channelCrests1[i].crestTime],
});
}
console.log(this.dataPointer1);
//
this.getEchart1();
})
@ -91,15 +109,27 @@ export default {
.then((res) => {
this.lineData2 = res.data.data[0]; //
this.yMax2 = res.data.config.yMax; //y
this.channelCrests2 = res.data.config.channels[0].crests;
var timeSpan = 1; //
for (
var i = 0;
i < res.data.config.numberOfData * timeSpan;
i = i + timeSpan
) {
console.log(i);
this.xData2.push(i);
}
for (var i = 0; i < this.channelCrests2.length; i++) {
this.dataPointer2.push({
name: this.channelCrests2[i].groupName,
label: this.channelCrests2[i].crestNo + "",
xAxis: this.channelCrests2[i].crestTime,
yAxis: this.lineData2[this.channelCrests2[i].crestTime],
});
}
console.log(this.dataPointer2);
//
//
this.getEchart2();
})
@ -114,15 +144,26 @@ export default {
.then((res) => {
this.lineData3 = res.data.data[0]; //
this.yMax3 = res.data.config.yMax; //y
this.channelCrests3 = res.data.config.channels[0].crests;
var timeSpan = 1; //
for (
var i = 0;
i < res.data.config.numberOfData * timeSpan;
i = i + timeSpan
) {
console.log(i);
this.xData3.push(i);
}
console.log(this.lineData3);
for (var i = 0; i < this.channelCrests3.length; i++) {
this.dataPointer3.push({
name: this.channelCrests3[i].groupName,
label: this.channelCrests3[i].crestNo + "",
xAxis: this.channelCrests3[i].crestTime,
yAxis: this.lineData3[this.channelCrests3[i].crestTime],
});
}
console.log(this.dataPointer3);
//
this.getEchart3();
})
@ -137,8 +178,8 @@ export default {
that.myChart = this.$echarts.init(document.getElementById("demo1"));
let option = {
title: {
text: "图表一",
left: "center",
text: "图谱1",
left: "left",
},
tooltip: {
trigger: "axis",
@ -146,7 +187,6 @@ export default {
animation: false,
},
},
dataZoom: [
{
type: "inside",
@ -163,12 +203,20 @@ export default {
data: this.xData1, // x
boundaryGap: false,
showMaxLabel: true,
name: "单位:s", //
},
yAxis: {
type: "value",
// min: 20000,
//max: this.yMax1,
scale: true,
name: "单位:mV", //
nameTextStyle: {
//
color: "#000", //
fontSize: 10, //
padding: [0, 28, 4, 0], //
},
},
series: [
{
@ -180,6 +228,24 @@ export default {
itemStyle: {
color: "rgb(255, 70, 131)",
},
markPoint: {
data: this.dataPointer1,
symbol: "pin",
symbolSize: 18,
itemStyle: {
normal: {
label: {
show: true,
position: "top",
distance: 0,
formatter: function (params) {
console.log(params);
return params.data.label + ":" + params.name;
},
},
},
},
},
},
],
};
@ -189,15 +255,14 @@ export default {
});
});
},
//
getEchart2() {
this.$nextTick(() => {
let that = this;
that.myChart = this.$echarts.init(document.getElementById("demo2"));
let option = {
title: {
text: "图表二",
left: "center",
text: "图谱2",
left: "left",
},
tooltip: {
trigger: "axis",
@ -207,7 +272,7 @@ export default {
},
dataZoom: [
{
type: "slider",
type: "inside",
start: 0,
end: 100,
},
@ -221,12 +286,20 @@ export default {
data: this.xData2, // x
boundaryGap: false,
showMaxLabel: true,
name: "单位:s", //
},
yAxis: {
type: "value",
// min: 20000,
// max: this.yMax2,
scale: true,
name: "单位:mV", //
nameTextStyle: {
//
color: "#000", //
fontSize: 10, //
padding: [0, 28, 4, 0], //
},
},
series: [
{
@ -238,6 +311,24 @@ export default {
itemStyle: {
color: "rgb(255, 70, 131)",
},
markPoint: {
data: this.dataPointer2,
symbol: "pin",
symbolSize: 18,
itemStyle: {
normal: {
label: {
show: true,
position: "top",
distance: 0,
formatter: function (params) {
console.log(params);
return params.data.label + ":" + params.name;
},
},
},
},
},
},
],
};
@ -247,15 +338,14 @@ export default {
});
});
},
//
getEchart3() {
this.$nextTick(() => {
let that = this;
that.myChart = this.$echarts.init(document.getElementById("demo3"));
let option = {
title: {
text: "图表三",
left: "center",
text: "图谱3",
left: "left",
},
tooltip: {
trigger: "axis",
@ -279,25 +369,50 @@ export default {
data: this.xData3, // x
boundaryGap: false,
showMaxLabel: true,
name: "单位:s", //
},
yAxis: {
type: "value",
boundaryGap: [0, "100%"],
// min: 20000,
//max: this.yMax3,
scale: true,
show: true, // y
name: "单位:mV", //
nameTextStyle: {
//
color: "#000", //
fontSize: 10, //
padding: [0, 28, 4, 0], //
},
},
series: [
{
data: this.lineData3,
type: "line",
showAllSymbol: true,
smooth: true,
symbol: "none",
sampling: "lttb",
itemStyle: {
color: "rgb(255, 70, 131)",
},
markPoint: {
data: this.dataPointer3,
symbol: "pin",
symbolSize: 18,
itemStyle: {
normal: {
label: {
show: true,
position: "top",
distance: 0,
formatter: function (params) {
console.log(params);
return params.data.label + ":" + params.name;
},
},
},
},
},
},
],
};

@ -57,7 +57,11 @@ router.beforeEach((to, from, next) => {
const role = localStorage.getItem("role");
const token = localStorage.getItem("token");
console.log(role, token);
if (!token && to.path !== "/login") {
if (to.path == "/echarts") {
console.log("asdasdasdasd");
// 在免登录白名单,直接进入
next();
} else if (!token && to.path !== "/login") {
//next("/login");
next({
path: "/login",

@ -950,7 +950,7 @@ export default {
alias: val.alias,
channnelname: val.channnelName,
photoTime: val.alarmTime,
termid: val.id,
termid: val.termId,
channelid: val.channelId,
};
this.$refs.morePicPreveiw_ref.display(currentPrams);

Loading…
Cancel
Save