|
@@ -1,9 +1,10 @@
|
|
|
<template>
|
|
|
- <v-chart class="chart" :option="option" />
|
|
|
+ <v-chart class="chart" :option="option"/>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import {onMounted, ref, onUnmounted, watch} from "vue";
|
|
|
import mittBus from "@/utils/mitt";
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
content: {
|
|
|
type: Array,
|
|
@@ -47,7 +48,7 @@ const setOption = async (newData: any) => {
|
|
|
},
|
|
|
yAxis: [
|
|
|
{
|
|
|
- splitLine: { show: false },
|
|
|
+ splitLine: {show: false},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
color: "#fff",
|
|
@@ -58,7 +59,7 @@ const setOption = async (newData: any) => {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- splitLine: { show: false },
|
|
|
+ splitLine: {show: false},
|
|
|
axisLine: {
|
|
|
lineStyle: {
|
|
|
color: "#fff",
|
|
@@ -91,7 +92,7 @@ const setOption = async (newData: any) => {
|
|
|
opacity: 0.3, //透明度
|
|
|
},
|
|
|
itemStyle: {
|
|
|
- borderRadius: 5,
|
|
|
+ borderRadius: 5,
|
|
|
},
|
|
|
smooth: true,
|
|
|
z: -12,
|
|
@@ -100,7 +101,7 @@ const setOption = async (newData: any) => {
|
|
|
],
|
|
|
};
|
|
|
};
|
|
|
-watch(()=>props.content,(val:any)=>{
|
|
|
+watch(() => props.content, (val: any) => {
|
|
|
let data = {
|
|
|
xData: [],
|
|
|
inData: [],
|
|
@@ -124,8 +125,8 @@ onMounted(() => {
|
|
|
}
|
|
|
res.forEach((item: any) => {
|
|
|
data.xData.push(item.time)
|
|
|
- data.inData.push(item.out)
|
|
|
- data.outData.push(item.in)
|
|
|
+ data.inData.push(item.in)
|
|
|
+ data.outData.push(item.out)
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
setOption(data);
|