|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2024-09-11 14:32:12
|
|
|
- * @LastEditTime: 2025-07-10 11:09:31
|
|
|
+ * @LastEditTime: 2025-07-14 10:21:14
|
|
|
* @LastEditors: bogon
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
|
|
@@ -430,13 +430,13 @@ export default {
|
|
|
const pointIndex = data.points[0].pointIndex;
|
|
|
const xClick = data.points[0].x;
|
|
|
const yClick = data.points[0].y;
|
|
|
-
|
|
|
+ // console.log(data.points[0], "data.points[0]");
|
|
|
// 将点击的点添加到选中的点数组
|
|
|
this.selectedPoints.push({
|
|
|
x: xClick, // 点击点的 x 坐标
|
|
|
y: yClick, // 点击点的 y 坐标
|
|
|
index: pointIndex, // 点击点的索引
|
|
|
- time: data.points[0].text, // 点击点的时间信息
|
|
|
+ time: data.points[0].timeData, // 点击点的时间信息
|
|
|
});
|
|
|
|
|
|
// 初始化颜色和大小数组
|
|
@@ -469,6 +469,7 @@ export default {
|
|
|
if (inPolygon(xVal, yVal, xv, yv)) {
|
|
|
const pointKey = `${xVal}-${yVal}`;
|
|
|
if (!addedPoints[pointKey]) {
|
|
|
+ // console.log(gd.data[0], "gd.data[0]");
|
|
|
this.selectedPoints.push({
|
|
|
x: gd.data[0].x[i],
|
|
|
y: gd.data[0].y[i],
|
|
@@ -548,28 +549,34 @@ export default {
|
|
|
}
|
|
|
this.downloadCSV();
|
|
|
},
|
|
|
- downloadCSV() {
|
|
|
+ async downloadCSV() {
|
|
|
+ const paramValueTypes = await axios.get("/ETLapi/sysConf/getByType", {
|
|
|
+ params: { type: "en_cn_mapping" },
|
|
|
+ });
|
|
|
+ // console.log(paramValueTypes, "paramValueTypes");
|
|
|
const headers = [this.chartData.xaixs, this.chartData.yaixs];
|
|
|
const csvRows = [headers]; // 保存标头
|
|
|
// 使用 Set 或 Map 去重
|
|
|
const uniquePoints = [];
|
|
|
+
|
|
|
this.selectedPoints.forEach((point) => {
|
|
|
if (!uniquePoints.some((p) => p.x === point.x && p.y === point.y)) {
|
|
|
uniquePoints.push(point);
|
|
|
}
|
|
|
});
|
|
|
- // 将去重后的点加入 CSV 数据
|
|
|
- uniquePoints.forEach((point) => {
|
|
|
- csvRows.push(`${point.x},${point.y}`);
|
|
|
- });
|
|
|
- const csvString = csvRows.join("\n");
|
|
|
- const blob = new Blob([csvString], { type: "text/csv; charset=utf-8" });
|
|
|
- const url = URL.createObjectURL(blob);
|
|
|
- const a = document.createElement("a");
|
|
|
- a.href = url;
|
|
|
- a.download = "selected_data.csv";
|
|
|
- a.click();
|
|
|
- URL.revokeObjectURL(url);
|
|
|
+ console.log(uniquePoints, "uniquePoints");
|
|
|
+ // // 将去重后的点加入 CSV 数据
|
|
|
+ // uniquePoints.forEach((point) => {
|
|
|
+ // csvRows.push(`${point.x},${point.y}`);
|
|
|
+ // });
|
|
|
+ // const csvString = csvRows.join("\n");
|
|
|
+ // const blob = new Blob([csvString], { type: "text/csv; charset=utf-8" });
|
|
|
+ // const url = URL.createObjectURL(blob);
|
|
|
+ // const a = document.createElement("a");
|
|
|
+ // a.href = url;
|
|
|
+ // a.download = "selected_data.csv";
|
|
|
+ // a.click();
|
|
|
+ // URL.revokeObjectURL(url);
|
|
|
},
|
|
|
updateChartColor(color) {
|
|
|
// 更新图表颜色
|