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

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

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

Loading…
Cancel
Save