|
@@ -62,8 +62,24 @@ export default {
|
|
|
currentIndex: 0, // 默认索引
|
|
currentIndex: 0, // 默认索引
|
|
|
tableData: [], // 数据
|
|
tableData: [], // 数据
|
|
|
originalChartStyle: {}, // 用于存储原始样式
|
|
originalChartStyle: {}, // 用于存储原始样式
|
|
|
|
|
+ // 控制标注的显示/隐藏
|
|
|
|
|
+ markPointVisible: false,
|
|
|
|
|
+ markLineVisible: false,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ // 监听标注的显示状态变化
|
|
|
|
|
+ markPointVisible(newVal, oldVal) {
|
|
|
|
|
+ if (newVal !== oldVal) {
|
|
|
|
|
+ this.updateChart(); // 更新图表
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ markLineVisible(newVal, oldVal) {
|
|
|
|
|
+ if (newVal !== oldVal) {
|
|
|
|
|
+ this.updateChart(); // 更新图表
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.initializeChart();
|
|
this.initializeChart();
|
|
|
// 监听键盘事件
|
|
// 监听键盘事件
|
|
@@ -78,6 +94,7 @@ export default {
|
|
|
initializeChart() {
|
|
initializeChart() {
|
|
|
const chartDom = this.$refs.chart;
|
|
const chartDom = this.$refs.chart;
|
|
|
this.chartInstance = echarts.init(chartDom);
|
|
this.chartInstance = echarts.init(chartDom);
|
|
|
|
|
+
|
|
|
const defaultData = [
|
|
const defaultData = [
|
|
|
Math.floor(Math.random() * 300),
|
|
Math.floor(Math.random() * 300),
|
|
|
Math.floor(Math.random() * 300),
|
|
Math.floor(Math.random() * 300),
|
|
@@ -103,70 +120,20 @@ export default {
|
|
|
(_, index) => `2024/1/${index + 1}`
|
|
(_, index) => `2024/1/${index + 1}`
|
|
|
);
|
|
);
|
|
|
const option = {
|
|
const option = {
|
|
|
- color: ["#9CC5AF", "#C9866B", "#709EA6", "#344453", "#B34138"],
|
|
|
|
|
- // title: [
|
|
|
|
|
- // {
|
|
|
|
|
- // text: "",
|
|
|
|
|
- // left: "center",
|
|
|
|
|
- // // subtext: '纯属虚构'
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // text: "",
|
|
|
|
|
- // // subtext:'实线',
|
|
|
|
|
- // textStyle: {
|
|
|
|
|
- // color: "#c23531",
|
|
|
|
|
- // // }
|
|
|
|
|
- // },
|
|
|
|
|
- // right: 35,
|
|
|
|
|
- // top: 275,
|
|
|
|
|
- // // subtext: '纯属虚构'
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // text: "",
|
|
|
|
|
- // right: 3,
|
|
|
|
|
- // top: 280,
|
|
|
|
|
- // textStyle: {
|
|
|
|
|
- // color: "#c23531",
|
|
|
|
|
- // fontSize: 12,
|
|
|
|
|
- // },
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
- // {
|
|
|
|
|
- // text: "",
|
|
|
|
|
- // textStyle: {
|
|
|
|
|
- // color: "#2f4554",
|
|
|
|
|
- // },
|
|
|
|
|
- // right: 35,
|
|
|
|
|
- // top: 295,
|
|
|
|
|
- // // subtext: '纯属虚构'
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // text: "",
|
|
|
|
|
- // textStyle: {
|
|
|
|
|
- // // fontSize:12,
|
|
|
|
|
- // color: "#d48265",
|
|
|
|
|
- // },
|
|
|
|
|
- // right: 0,
|
|
|
|
|
- // top: 219,
|
|
|
|
|
- // // subtext: '纯属虚构'
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // text: "",
|
|
|
|
|
- // textStyle: {
|
|
|
|
|
- // color: "#61a0a8",
|
|
|
|
|
- // },
|
|
|
|
|
- // right: 35,
|
|
|
|
|
- // top: 410,
|
|
|
|
|
- // // subtext: '纯属虚构'
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // top: 510,
|
|
|
|
|
- // left: 50,
|
|
|
|
|
- // subtextStyle: {
|
|
|
|
|
- // fontWeight: "bold",
|
|
|
|
|
- // },
|
|
|
|
|
- // },
|
|
|
|
|
- // ],
|
|
|
|
|
|
|
+ color: [
|
|
|
|
|
+ "#D7EFB7",
|
|
|
|
|
+ // "#9CD9BD",
|
|
|
|
|
+ // "#7ACCC1",
|
|
|
|
|
+ // "#5DBFC4",
|
|
|
|
|
+ "#46AFC5",
|
|
|
|
|
+ // "#379CC2",
|
|
|
|
|
+ // "#3286BB",
|
|
|
|
|
+ // "#406DAB",
|
|
|
|
|
+ "#3856A0",
|
|
|
|
|
+ // "#314291",
|
|
|
|
|
+ // "#28357A",
|
|
|
|
|
+ "#1A285E",
|
|
|
|
|
+ ],
|
|
|
toolbox: {
|
|
toolbox: {
|
|
|
feature: {
|
|
feature: {
|
|
|
dataZoom: { yAxisIndex: "none" },
|
|
dataZoom: { yAxisIndex: "none" },
|
|
@@ -186,14 +153,22 @@ export default {
|
|
|
},
|
|
},
|
|
|
myCustomTool3: {
|
|
myCustomTool3: {
|
|
|
show: true,
|
|
show: true,
|
|
|
|
|
+ title: "标注",
|
|
|
|
|
+ icon: `image://${require("@/assets/analyse/mark.png")}`,
|
|
|
|
|
+ onclick: () => this.WhetherToDisplay(),
|
|
|
|
|
+ },
|
|
|
|
|
+ myCustomTool4: {
|
|
|
|
|
+ show: true,
|
|
|
title: "全屏",
|
|
title: "全屏",
|
|
|
icon: `image://${require("@/assets/analyse/fullScreen.png")}`,
|
|
icon: `image://${require("@/assets/analyse/fullScreen.png")}`,
|
|
|
|
|
+
|
|
|
onclick: () => this.fullScreen(),
|
|
onclick: () => this.fullScreen(),
|
|
|
},
|
|
},
|
|
|
- myCustomTool4: {
|
|
|
|
|
|
|
+ myCustomTool5: {
|
|
|
show: true,
|
|
show: true,
|
|
|
title: "退出全屏",
|
|
title: "退出全屏",
|
|
|
icon: `image://${require("@/assets/analyse/exitFullScreen.png")}`, // 替换为你自己的图标路径
|
|
icon: `image://${require("@/assets/analyse/exitFullScreen.png")}`, // 替换为你自己的图标路径
|
|
|
|
|
+
|
|
|
onclick: () => this.exitFullScreen(),
|
|
onclick: () => this.exitFullScreen(),
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -232,24 +207,16 @@ export default {
|
|
|
name: "叶片2根部轮廓",
|
|
name: "叶片2根部轮廓",
|
|
|
type: "line",
|
|
type: "line",
|
|
|
showSymbol: false,
|
|
showSymbol: false,
|
|
|
- lineStyle: {
|
|
|
|
|
- // type: "dashed",
|
|
|
|
|
- },
|
|
|
|
|
data: [
|
|
data: [
|
|
|
12.84, 13.03, 13.05, 13.89, 13.72, 12.97, 13.21, 14.02, 14.54,
|
|
12.84, 13.03, 13.05, 13.89, 13.72, 12.97, 13.21, 14.02, 14.54,
|
|
|
15.07, 14.94, 14.55, 13.84, 12.7, 12.06, 11.93, 11.6, 10.84,
|
|
15.07, 14.94, 14.55, 13.84, 12.7, 12.06, 11.93, 11.6, 10.84,
|
|
|
10.26, 10.18, 10.21, 9.86, 10.1, 9.96, 10.25, 11.1, 11.08, 10.7,
|
|
10.26, 10.18, 10.21, 9.86, 10.1, 9.96, 10.25, 11.1, 11.08, 10.7,
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
{
|
|
{
|
|
|
name: "叶片3根部轮廓",
|
|
name: "叶片3根部轮廓",
|
|
|
showSymbol: false,
|
|
showSymbol: false,
|
|
|
- lineStyle: {
|
|
|
|
|
- // type: "dotted",
|
|
|
|
|
- },
|
|
|
|
|
type: "line",
|
|
type: "line",
|
|
|
-
|
|
|
|
|
data: [
|
|
data: [
|
|
|
7.38, 7.73, 7.46, 7.85, 7.68, 7.45, 6.94, 6.7, 5.98, 6.25, 6.28,
|
|
7.38, 7.73, 7.46, 7.85, 7.68, 7.45, 6.94, 6.7, 5.98, 6.25, 6.28,
|
|
|
5.74, 5.51, 5.35, 5.25, 5.03, 4.83, 4.57, 4.58, 4.33, 4.6, 4.42,
|
|
5.74, 5.51, 5.35, 5.25, 5.03, 4.83, 4.57, 4.58, 4.33, 4.6, 4.42,
|
|
@@ -293,8 +260,32 @@ export default {
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
|
|
|
+ // 切换标注的显示状态
|
|
|
|
|
+ option.series = option.series.map((serie) => ({
|
|
|
|
|
+ ...serie,
|
|
|
|
|
+ markPoint: this.markPointVisible
|
|
|
|
|
+ ? {
|
|
|
|
|
+ data: [
|
|
|
|
|
+ { type: "max", name: "Max" },
|
|
|
|
|
+ { type: "min", name: "Min" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ }
|
|
|
|
|
+ : { data: [] },
|
|
|
|
|
+ markLine: this.markLineVisible
|
|
|
|
|
+ ? {
|
|
|
|
|
+ data: [{ type: "average", name: "Avg" }],
|
|
|
|
|
+ }
|
|
|
|
|
+ : { data: [] },
|
|
|
|
|
+ }));
|
|
|
|
|
+ this.chartInstance.setOption(option, true); // 强制刷新
|
|
|
this.chartInstance.setOption(option);
|
|
this.chartInstance.setOption(option);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 标注是否显示
|
|
|
|
|
+ WhetherToDisplay() {
|
|
|
|
|
+ // 切换显示状态
|
|
|
|
|
+ this.markPointVisible = !this.markPointVisible;
|
|
|
|
|
+ this.markLineVisible = !this.markLineVisible;
|
|
|
|
|
+ },
|
|
|
previousRow() {
|
|
previousRow() {
|
|
|
let newIndex =
|
|
let newIndex =
|
|
|
this.currentIndex > 0
|
|
this.currentIndex > 0
|