|
@@ -31,7 +31,7 @@ use([
|
|
MarkLineComponent,
|
|
MarkLineComponent,
|
|
]);
|
|
]);
|
|
|
|
|
|
-const list: number[] = [];
|
|
|
|
|
|
+const list = ref<number[]>([]);
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
data: MonitoringPointData;
|
|
data: MonitoringPointData;
|
|
@@ -44,13 +44,12 @@ const emit = defineEmits(['editorClick', 'historicalDataClick']);
|
|
const props = defineProps<Props>();
|
|
const props = defineProps<Props>();
|
|
|
|
|
|
const getCurvedData = () => {
|
|
const getCurvedData = () => {
|
|
|
|
+ list.value = [];
|
|
if (props.data.tempData) {
|
|
if (props.data.tempData) {
|
|
props.data.tempData.forEach((item) => {
|
|
props.data.tempData.forEach((item) => {
|
|
- list.push(item.value);
|
|
|
|
|
|
+ list.value.push(item.value);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
- return list;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
const getColor = (value: number) => {
|
|
const getColor = (value: number) => {
|
|
@@ -80,6 +79,7 @@ const getColor = (value: number) => {
|
|
};
|
|
};
|
|
|
|
|
|
const option = computed(() => {
|
|
const option = computed(() => {
|
|
|
|
+ getCurvedData();
|
|
if (!props.data) return {};
|
|
if (!props.data) return {};
|
|
return {
|
|
return {
|
|
backgroundColor: getColor(2),
|
|
backgroundColor: getColor(2),
|
|
@@ -99,7 +99,7 @@ const option = computed(() => {
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: getCurvedData(),
|
|
|
|
|
|
+ data: list.value,
|
|
symbol: 'none', // 不显示数据点
|
|
symbol: 'none', // 不显示数据点
|
|
color: getColor(1),
|
|
color: getColor(1),
|
|
lineStyle: {
|
|
lineStyle: {
|