From 925c9c6f15d9492556e2954eccd5145798496079 Mon Sep 17 00:00:00 2001 From: stt Date: Tue, 25 Nov 2025 10:14:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=80=81=E4=BA=8B=E4=BB=B6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=A1=B5=E9=9D=A2=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/harmonic-boot/cockpit/cockpit.ts | 14 +- .../cockpit/sensitiveLoad/index.vue | 11 +- .../cockpit/transientStatistics/index.vue | 187 ++++++++---------- 3 files changed, 100 insertions(+), 112 deletions(-) diff --git a/src/api/harmonic-boot/cockpit/cockpit.ts b/src/api/harmonic-boot/cockpit/cockpit.ts index 08cbd00..afddff2 100644 --- a/src/api/harmonic-boot/cockpit/cockpit.ts +++ b/src/api/harmonic-boot/cockpit/cockpit.ts @@ -176,7 +176,7 @@ export function sensitiveUserTrendData(data: any) { return request({ url: '/cs-device-boot/csGroup/sensitiveUserTrendData', method: 'post', - params: data + data: data }) } @@ -185,7 +185,7 @@ export function getList(data: any) { return request({ url: '/cs-harmonic-boot/pqSensitiveUser/getList', method: 'post', - params: data + data: data }) } @@ -194,7 +194,7 @@ export function f47Curve(data: any) { return request({ url: '/cs-harmonic-boot/csevent/f47Curve', method: 'post', - params: data + data: data }) } @@ -203,7 +203,7 @@ export function getEventCoords(data: any) { return request({ url: '/cs-harmonic-boot/csevent/getEventCoords', method: 'post', - params: data + data: data }) } @@ -212,7 +212,7 @@ export function getEventDate(data: any) { return request({ url: '/cs-harmonic-boot/csevent/getEventDate', method: 'post', - params: data + data: data }) } @@ -221,7 +221,7 @@ export function netEventEcharts(data: any) { return request({ url: '/cs-harmonic-boot/csevent/netEventEcharts', method: 'post', - params: data + data: data }) } @@ -230,7 +230,7 @@ export function netEventTable(data: any) { return request({ url: '/cs-harmonic-boot/csevent/netEventTable', method: 'post', - params: data + data: data }) } diff --git a/src/components/cockpit/sensitiveLoad/index.vue b/src/components/cockpit/sensitiveLoad/index.vue index 673cbaa..76f4896 100644 --- a/src/components/cockpit/sensitiveLoad/index.vue +++ b/src/components/cockpit/sensitiveLoad/index.vue @@ -12,6 +12,7 @@ import Table from '@/components/table/index.vue' import TableHeader from '@/components/table/header/index.vue' import { useRoute } from 'vue-router' import { useTimeCacheStore } from '@/stores/timeCache' +import { useDictData } from '@/stores/dictData' const prop = defineProps({ w: { type: [String, Number]}, @@ -24,8 +25,9 @@ const prop = defineProps({ const headerHeight = ref(57) -const route = useRoute() -const timeCacheStore = useTimeCacheStore() +const dictData = useDictData() +const sensitiveUserType = dictData.getBasicData('Sensitive_User_Type') + const selectChange = (showSelect: any, height: any, datePickerValue?: any) => { headerHeight.value = height @@ -73,7 +75,10 @@ const tableStore: any = new TableStore({ { title: '敏感负荷类型', field: 'loadType', - minWidth: '70' + minWidth: '70', + formatter: row => { + return sensitiveUserType.filter(item => item.id == row.cellValue)[0]?.name + } }, { title: '是否监测', diff --git a/src/components/cockpit/transientStatistics/index.vue b/src/components/cockpit/transientStatistics/index.vue index 2fa1b98..9a3f897 100644 --- a/src/components/cockpit/transientStatistics/index.vue +++ b/src/components/cockpit/transientStatistics/index.vue @@ -30,6 +30,7 @@ import TransientStatisticsDetail from '@/components/cockpit/transientStatistics/ import TableHeader from '@/components/table/header/index.vue' import { useRoute } from 'vue-router' import { useTimeCacheStore } from '@/stores/timeCache' +import { netEventEcharts } from '@/api/harmonic-boot/cockpit/cockpit' const prop = defineProps({ w: { type: [String, Number] }, @@ -42,9 +43,6 @@ const prop = defineProps({ const headerHeight = ref(57) -const route = useRoute() -const timeCacheStore = useTimeCacheStore() - const selectChange = (showSelect: any, height: any, datePickerValue?: any) => { headerHeight.value = height @@ -68,79 +66,91 @@ const fullscreen = computed(() => { }) const config = useConfig() -const data = [ - { - name: '电压中断', - value: 4 - }, - { - name: '电压暂降', - value: 41 - }, - { - name: '电压暂升', - value: 46 - } -] -const echartList = ref({ - title: {}, +const data = ref() - tooltip: { - trigger: 'item' - }, - legend: { - orient: 'vertical', - top: 'center', - right: '5%', - formatter: function (e: any) { - return e + ' ' + data.filter(item => item.name == e)[0].value + '次' - } - }, - xAxis: { - show: false - }, - yAxis: { - show: false - }, - grid: { - left: '10px', - right: '20px' - }, - color: ['#FF9100', '#FFBF00', config.layout.elementUiPrimary[0]], - options: { - dataZoom: null, - title: [ +const echartList = ref() + +const eventEcharts = () => { + netEventEcharts({ + searchBeginTime: tableStore.table.params.searchBeginTime || prop.timeValue?.[0], + searchEndTime: tableStore.table.params.searchEndTime || prop.timeValue?.[1] + }).then(res => { + // 整理接口数据为图表所需格式 + const rawData = res.data || {}; + data.value = [ { - text: '暂态事件统计', - left: 'center' + name: '电压中断', + value: rawData.eventOff || 0 }, { - text: data[0].value + data[1].value + data[2].value + '次', - left: 'center', - top: 'center' - } - ], - series: [ + name: '电压暂降', + value: rawData.eventDown || 0 + }, { - type: 'pie', - center: 'center', - radius: ['50%', '70%'], - label: { - show: false, - position: 'outside', - textStyle: { - //数值样式 - } - }, - name: '事件统计', - data: data + name: '电压暂升', + value: rawData.eventUp || 0 } - ] - } -}) + ]; + + echartList.value = { + title: {}, + tooltip: { + trigger: 'item' + }, + legend: { + orient: 'vertical', + top: 'center', + right: '5%', + formatter: function (e: any) { + return e + ' ' + data.value.filter((item: any) => item.name == e)[0].value + '次' + } + }, + xAxis: { + show: false + }, + yAxis: { + show: false + }, + grid: { + left: '10px', + right: '20px' + }, + color: ['#FF9100', '#FFBF00', config.layout.elementUiPrimary[0]], + options: { + dataZoom: null, + title: [ + { + text: '暂态事件统计', + left: 'center' + }, + { + text: (rawData.eventOff + rawData.eventDown + rawData.eventUp) + '次', + left: 'center', + top: 'center' + } + ], + series: [ + { + type: 'pie', + center: 'center', + radius: ['50%', '70%'], + label: { + show: false, + position: 'outside' + }, + name: '事件统计', + data: data.value + } + ] + } + } + }) +} + const transientStatisticsDetailRef = ref() + const tableStore: any = new TableStore({ - url: '/user-boot/dept/deptTree', + url: '/cs-harmonic-boot/csevent/netEventTable', method: 'POST', showPage: false, @@ -162,29 +172,29 @@ const tableStore: any = new TableStore({ { title: '电压中断(次)', - field: 'type', + field: 'eventOff', minWidth: '70', render: 'customTemplate', customTemplate: (row: any) => { - return `${row.type}` + return `${row.eventOff}` } }, { title: '电压暂降(次)', - field: 'type1', + field: 'eventDown', minWidth: '80', render: 'customTemplate', customTemplate: (row: any) => { - return `${row.type1}` + return `${row.eventDown}` } }, { title: '电压暂升(次)', - field: 'type2', + field: 'eventUp', minWidth: '80', render: 'customTemplate', customTemplate: (row: any) => { - return `${row.type2}` + return `${row.eventUp}` } } ], @@ -193,32 +203,7 @@ const tableStore: any = new TableStore({ tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1] }, loadCallback: () => { - tableStore.table.data = [ - { - name: '35kV1进线', - type: '2', - type1: '38', - type2: '35' - }, - { - name: '35kV1变压器', - type: '2', - type1: '1', - type2: '3' - }, - { - name: '35kV1母线', - type: '0', - type1: '1', - type2: '4' - }, - { - name: '35kV2母线', - type: '0', - type1: '1', - type2: '4' - } - ] + eventEcharts() } }) @@ -259,7 +244,5 @@ watch( deep: true } ) - -const addMenu = () => {}