From 66a50043bc12d2c3f1ca1dacadbb30f23c7d48fa Mon Sep 17 00:00:00 2001 From: zhujiyan <17812234322@163.com> Date: Thu, 15 Aug 2024 15:20:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B2=BB=E7=90=86=E8=AE=BE=E5=A4=87=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B62.=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E5=80=BC=E4=BA=8C=E6=AC=A1=E5=80=BC=E4=BF=AE=E6=94=B93.?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E6=95=B0=E6=8D=AE=E6=8C=89=E9=92=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/govern/device/control/detail.vue | 52 ++++++++++++++++--- src/views/govern/device/control/index.vue | 7 ++- .../planData/components/device_back.vue | 2 +- src/views/govern/device/planData/index.vue | 10 ++-- 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/src/views/govern/device/control/detail.vue b/src/views/govern/device/control/detail.vue index 995f20b..de96a23 100644 --- a/src/views/govern/device/control/detail.vue +++ b/src/views/govern/device/control/detail.vue @@ -13,11 +13,21 @@ - + + + + + + 查询 @@ -36,11 +46,15 @@ import MyEchart from '@/components/echarts/MyEchart.vue' interface Props { detail: anyObj + dataLevel: string } const props = withDefaults(defineProps(), { detail: () => { return {} + }, + dataLevel: () => { + return '' } }) const datePickerRef = ref() @@ -54,26 +68,52 @@ const form: any = reactive({ remark: '', routeName: '', sort: 100, - type: 0, - dataLevel: '' + dataLevel: '', + statMethod: 'avg' }) +const typeOptions = [ + { + name: '平均值', + id: 'avg' + }, + { + name: '最大值', + id: 'max' + }, + { + name: '最小值', + id: 'min' + }, + { + name: 'CP95值', + id: 'cp95' + } +] const echartsData = ref(null) const dialogVisible = ref(false) const loading = ref(true) onMounted(() => { - form.dataLevel = props.detail.dataLevel + if (props.dataLevel == 'Secondary') { + form.dataLevel = 'Primary' + }else{ + form.dataLevel=props.dataLevel + } init() }) const init = () => { echartsData.value = null loading.value = true + console.log(props.detail.children, 'props.detail.children') + let statisticalParams = props.detail.children + statisticalParams[0].statMethod = form.statMethod getDeviceDataTrend({ devId: props.detail.devId, endTime: datePickerRef.value.timeValue[1], lineId: props.detail.lineId, startTime: datePickerRef.value.timeValue[0], - statisticalParams: props.detail.children, - dataLevel: form.dataLevel + statisticalParams: statisticalParams, + dataLevel: form.dataLevel, + statMethod: form.statMethod }).then(res => { if (res.data.length && res.data[0].length) { let arr: any[] = [] diff --git a/src/views/govern/device/control/index.vue b/src/views/govern/device/control/index.vue index dfc7e57..1134248 100644 --- a/src/views/govern/device/control/index.vue +++ b/src/views/govern/device/control/index.vue @@ -91,7 +91,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -382,6 +382,9 @@ const nodeClick = async (e: anyObj) => { deviceData.value = res.data formInline.dataLevel = res.data.dataLevel dataLevel.value = res.data.dataLevel + if (dataLevel.value == 'Secondary') { + formInline.dataLevel = 'Primary' + } if (!res.data.dataSetList) { dataSet.value = '' tableData.value = [] diff --git a/src/views/govern/device/planData/components/device_back.vue b/src/views/govern/device/planData/components/device_back.vue index 1eda561..121e822 100644 --- a/src/views/govern/device/planData/components/device_back.vue +++ b/src/views/govern/device/planData/components/device_back.vue @@ -66,7 +66,7 @@ @cancel="cancelDelete" > diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index 8fcc716..23de86b 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -5,8 +5,8 @@
@@ -83,10 +83,10 @@ {{ item.location }} - - @@ -150,7 +150,7 @@
- 查询 + 查询