|
@@ -7,8 +7,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template #container>
|
|
<template #container>
|
|
|
<div class="container-t">
|
|
<div class="container-t">
|
|
|
- <ModuleHead :menuData="menuList" :timeDate="timeDate" :devID="devID" :devLabel="devLabel"
|
|
|
|
|
- @changeMenu="changeMenu" @changeTime="changeTime"></ModuleHead>
|
|
|
|
|
|
|
+ <ModuleHead :timeDate="timeDate" @changeTime="changeTime"></ModuleHead>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="container-b">
|
|
<div class="container-b">
|
|
|
<SingLineArea :option="option" :chartData="chartData" height="280px"></SingLineArea>
|
|
<SingLineArea :option="option" :chartData="chartData" height="280px"></SingLineArea>
|
|
@@ -21,7 +20,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template #container>
|
|
<template #container>
|
|
|
<div class="container-t">
|
|
<div class="container-t">
|
|
|
- <ModuleHead :menuData="gasMenuList" :timeDate="timeDate" :devLabel="gasDevLabel" @changeMenu="changeGasMenu"
|
|
|
|
|
|
|
+ <ModuleHead :isShowSelect="true" :menuData="gasMenuList" :timeDate="timeDate" :devLabel="gasDevLabel" @changeMenu="changeGasMenu"
|
|
|
@changeTime="changeTime"></ModuleHead>
|
|
@changeTime="changeTime"></ModuleHead>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="container-b">
|
|
<div class="container-b">
|
|
@@ -52,7 +51,7 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
|
|
|
|
-import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, } from 'vue';
|
|
|
|
|
|
|
+import { ref, onMounted, onUnmounted, reactive, defineProps,watchEffect } from 'vue';
|
|
|
import ventBox1 from '/@/components/vent/ventBox1.vue'
|
|
import ventBox1 from '/@/components/vent/ventBox1.vue'
|
|
|
import SingLineArea from '@/components/chart/SingLineArea.vue'
|
|
import SingLineArea from '@/components/chart/SingLineArea.vue'
|
|
|
import BarAndLine from '@/components/chart/BarAndLine.vue';
|
|
import BarAndLine from '@/components/chart/BarAndLine.vue';
|
|
@@ -61,17 +60,20 @@ import { option, gasMenuList, chartsColumns, echatsOption, optionGas } from '../
|
|
|
import { list, getCurveGraphData } from '../footage.api';
|
|
import { list, getCurveGraphData } from '../footage.api';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
|
|
|
|
+let props=defineProps({
|
|
|
|
|
+ optionValue:{
|
|
|
|
|
+ type:String,
|
|
|
|
|
+ default:''
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
let paramData = ref<any[]>([])
|
|
let paramData = ref<any[]>([])
|
|
|
-let menuList = ref<any[]>([])
|
|
|
|
|
-let devID = ref('')
|
|
|
|
|
-let devLabel = ref('')
|
|
|
|
|
let timeDate = reactive({
|
|
let timeDate = reactive({
|
|
|
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD'),
|
|
startTime: dayjs().subtract(7, 'day').format('YYYY-MM-DD'),
|
|
|
endTime: dayjs().format('YYYY-MM-DD'),
|
|
endTime: dayjs().format('YYYY-MM-DD'),
|
|
|
})
|
|
})
|
|
|
-const chartData = ref<any[]>([]);
|
|
|
|
|
let gasDevLabel = ref('T0(上隅角)')
|
|
let gasDevLabel = ref('T0(上隅角)')
|
|
|
-const xAxisPropType = ref('ttime');
|
|
|
|
|
|
|
+let xAxisPropType = ref('ttime');
|
|
|
|
|
+let chartData = ref<any[]>([]);
|
|
|
let gasList = ref<any[]>([]);
|
|
let gasList = ref<any[]>([]);
|
|
|
let chartGasData = ref<any[]>([])
|
|
let chartGasData = ref<any[]>([])
|
|
|
|
|
|
|
@@ -85,11 +87,11 @@ function getMonitor(flag?) {
|
|
|
timer = null;
|
|
timer = null;
|
|
|
}
|
|
}
|
|
|
await getMonitor();
|
|
await getMonitor();
|
|
|
- }, flag ? 0 : 10000);
|
|
|
|
|
|
|
+ }, flag ? 0 : 5000);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
async function getCurveGraphDataList() {
|
|
async function getCurveGraphDataList() {
|
|
|
- let res = await getCurveGraphData({ devId: devID.value, startTime: timeDate.startTime, endTime: timeDate.endTime })
|
|
|
|
|
|
|
+ let res = await getCurveGraphData({ devId: props.optionValue, startTime: timeDate.startTime, endTime: timeDate.endTime })
|
|
|
if (res.length) {
|
|
if (res.length) {
|
|
|
paramData.value = res
|
|
paramData.value = res
|
|
|
chartData.value = res.map(el => {
|
|
chartData.value = res.map(el => {
|
|
@@ -121,21 +123,6 @@ async function getCurveGraphDataList() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// async function getMenuList() {
|
|
|
|
|
-// let res = await list({ devicekind: 'footageGas' })
|
|
|
|
|
-// menuList.value = res.records.map(el => {
|
|
|
|
|
-// return {
|
|
|
|
|
-// label: el.strname,
|
|
|
|
|
-// value: el.id,
|
|
|
|
|
-// }
|
|
|
|
|
-// }) || []
|
|
|
|
|
-// devID.value = menuList.value[0].value
|
|
|
|
|
-// devLabel.value = menuList.value[0].label
|
|
|
|
|
-// }
|
|
|
|
|
-function changeMenu(param) {
|
|
|
|
|
- devID.value = param.id
|
|
|
|
|
- getCurveGraphDataList()
|
|
|
|
|
-}
|
|
|
|
|
function changeGasMenu(param) {
|
|
function changeGasMenu(param) {
|
|
|
gasDevLabel.value = param.label
|
|
gasDevLabel.value = param.label
|
|
|
switch (param.label) {
|
|
switch (param.label) {
|
|
@@ -184,9 +171,10 @@ function changeTime(param) {
|
|
|
getCurveGraphDataList()
|
|
getCurveGraphDataList()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+watchEffect(()=>{
|
|
|
|
|
+ props.optionValue && getCurveGraphDataList()
|
|
|
|
|
+})
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
- timer = null
|
|
|
|
|
- // await getMenuList()
|
|
|
|
|
await getMonitor(true)
|
|
await getMonitor(true)
|
|
|
});
|
|
});
|
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|