|
@@ -24,7 +24,8 @@ const props = defineProps({
|
|
type: String,
|
|
type: String,
|
|
default: "300px",
|
|
default: "300px",
|
|
},
|
|
},
|
|
- // dataSets:[[28,38,45,32,25],[78,88,65,82,65]]
|
|
|
|
|
|
+ // dataSets:[[训练后],[训练前]]
|
|
|
|
+ // dataSets:[[78,88,65,82,65],[28,38,45,32,25]]
|
|
dataSets: {
|
|
dataSets: {
|
|
type: Array,
|
|
type: Array,
|
|
default: [] as Array<number>,
|
|
default: [] as Array<number>,
|
|
@@ -41,14 +42,15 @@ const props = defineProps({
|
|
});
|
|
});
|
|
// 是否有对比数据
|
|
// 是否有对比数据
|
|
const isCompare = props.dataSets?.length > 1;
|
|
const isCompare = props.dataSets?.length > 1;
|
|
-let defaultData;
|
|
|
|
-let beforeData;
|
|
|
|
-if (isCompare) {
|
|
|
|
- defaultData = toRefs(props.dataSets?.[1]);
|
|
|
|
- beforeData = toRefs(props.dataSets?.[0]);
|
|
|
|
-} else {
|
|
|
|
- defaultData = toRefs(props.dataSets?.[0]);
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+// let defaultData;
|
|
|
|
+// let beforeData;
|
|
|
|
+// if (isCompare) {
|
|
|
|
+// defaultData = props.dataSets?.[1];
|
|
|
|
+// beforeData = props.dataSets?.[0];
|
|
|
|
+// } else {
|
|
|
|
+// defaultData = props.dataSets?.[0];
|
|
|
|
+// }
|
|
|
|
|
|
const globalColor = {
|
|
const globalColor = {
|
|
default: "#ffb72d",
|
|
default: "#ffb72d",
|
|
@@ -189,7 +191,7 @@ const options = {
|
|
distance: 5,
|
|
distance: 5,
|
|
},
|
|
},
|
|
lineStyle: { width: 0 },
|
|
lineStyle: { width: 0 },
|
|
- data: positionFormatter(defaultData),
|
|
|
|
|
|
+ data: positionFormatter(props.dataSets?.[0]),
|
|
},
|
|
},
|
|
// 覆盖区域的样式
|
|
// 覆盖区域的样式
|
|
{
|
|
{
|
|
@@ -198,7 +200,7 @@ const options = {
|
|
symbolSize: 5,
|
|
symbolSize: 5,
|
|
data: [
|
|
data: [
|
|
{
|
|
{
|
|
- value: defaultData,
|
|
|
|
|
|
+ value: props.dataSets?.[0],
|
|
name: "训练后",
|
|
name: "训练后",
|
|
lineStyle: { color: globalColor.default },
|
|
lineStyle: { color: globalColor.default },
|
|
itemStyle: { color: globalColor.default },
|
|
itemStyle: { color: globalColor.default },
|
|
@@ -216,7 +218,7 @@ const getOptions = () => {
|
|
options.color = [globalColor.before, globalColor.default];
|
|
options.color = [globalColor.before, globalColor.default];
|
|
options.legend.show = true;
|
|
options.legend.show = true;
|
|
options.series[1].data.unshift({
|
|
options.series[1].data.unshift({
|
|
- value: beforeData,
|
|
|
|
|
|
+ value: props.dataSets?.[1],
|
|
name: "训练前",
|
|
name: "训练前",
|
|
lineStyle: { color: globalColor.before },
|
|
lineStyle: { color: globalColor.before },
|
|
itemStyle: { color: globalColor.before },
|
|
itemStyle: { color: globalColor.before },
|
|
@@ -236,7 +238,7 @@ const getOptions = () => {
|
|
//distance: 5
|
|
//distance: 5
|
|
},
|
|
},
|
|
lineStyle: { width: 0 },
|
|
lineStyle: { width: 0 },
|
|
- data: positionFormatter(beforeData),
|
|
|
|
|
|
+ data: positionFormatter(props.dataSets?.[1]),
|
|
});
|
|
});
|
|
}
|
|
}
|
|
return options;
|
|
return options;
|