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 @@
- 查询 + 查询