From 5bed340320933c0d08a6c4516b3fbfe4088d0d2a Mon Sep 17 00:00:00 2001 From: guanj Date: Tue, 18 Nov 2025 14:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=87=E6=A0=87=E8=B6=8A?= =?UTF-8?q?=E9=99=90=E6=98=8E=E7=BB=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dailyTrendChart.vue | 83 ++-- .../cockpit/indicatorDetails/index.vue | 32 +- .../cockpit/indicatorDistribution/index.vue | 34 +- src/utils/pageBubble.ts | 218 ++++----- src/views/auth/userList/index.vue | 428 +++++++++--------- src/views/auth/userList/popupPwd.vue | 198 ++++---- 6 files changed, 499 insertions(+), 494 deletions(-) diff --git a/src/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue b/src/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue index 6985ad4..c761d21 100644 --- a/src/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue +++ b/src/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue @@ -15,13 +15,13 @@ import { mainHeight } from '@/utils/layout' import { limitExtentDayData } from '@/api/harmonic-boot/cockpit/cockpit' const prop = defineProps({ - width: { type: [String, Number] }, - height: { type: [String, Number] }, - timeKey: { type: [String, Number] }, + width: { type: [String, Number]}, + height: { type: [String, Number]}, + timeKey: { type: [String, Number]}, timeValue: { type: Object } }) -const pageHeight = mainHeight(0, 2) +const pageHeight = ref(mainHeight(332)) const dialogVisible: any = ref(false) @@ -36,44 +36,35 @@ const echartList = ref() const init = () => { echartList.value = { title: { - text: dialogText.value - }, - legend: { - itemWidth: 20, - itemHeight: 20, - itemStyle: { opacity: 0 }, //去圆点 - right: 70 - }, - tooltip: { - trigger: 'axis', - formatter: (params: any) => { - if (!params || params.length === 0) return '' - - // 使用第一个项目的轴标签作为时间标题 - let tooltipText = params[0].axisValueLabel + '
' - - // 遍历所有项目并累加到tooltipText中 - params.forEach((item: any) => { - // 将数值格式化为保留两位小数 - const formattedValue = Math.round(item.value[1] * 100) / 100 - tooltipText += `${item.marker} ${item.seriesName}: ${formattedValue}
` - }) - - return tooltipText - } - }, - xAxis: { - type: 'time', - axisLabel: { - formatter: { - day: '{MM}-{dd}', - month: '{MM}', - year: '{yyyy}' + text: dialogText.value, + textStyle: { + fontSize: 14, + rich: { + lineName: { + color: '#333', + fontSize: 14 + }, + timeLabel: { + color: '#333', + fontSize: 14, + padding: [0, 0, 0, 10] + }, + name: { + color: '#333', + fontSize: 14, + padding: [0, 0, 0, 10] + } } } }, - - yAxis: [{}, {}], + xAxis: { + type: 'category', + data: [] + }, + yAxis: { + type: 'value', + name: '数值' + }, grid: { left: '1%', right: '45px', @@ -121,17 +112,12 @@ const initData = async (row: any) => { // 处理每条相位数据 const seriesData = res.data.map((item: any) => { - const values = xAxisData.map((time: string, index: number) => { - // 将传入的日期与时间拼接成完整的时间字符串 - const fullTime = `${row.time} ${time}` - const value = parseFloat(item.value.split(',')[index]) || 0 - return [fullTime, value] - }) + const values = item.value.split(',').map((v: string) => parseFloat(v) || 0) return { name: `${item.phasic}相`, type: 'line', - showSymbol: false, + showSymbol: true, smooth: true, data: values, itemStyle: { @@ -144,17 +130,18 @@ const initData = async (row: any) => { }) // 更新图表配置 + echartList.value.xAxis.data = xAxisData echartList.value.options.series = seriesData - // 注意:使用时间轴时不需要设置 xAxis.data } }) } + onMounted(() => {}) const open = async (row: any) => { dialogVisible.value = true dialogTitle.value = row.name + '日趋势图' - dialogText.value = `监测点:${row.lineName} 时间:${row.time} 指标:${row.name}` + dialogText.value = `{lineName|${row.lineName}}{timeLabel|${row.time}}{name|${row.name}日趋势图}` nextTick(() => { initData(row) }) diff --git a/src/components/cockpit/indicatorDetails/index.vue b/src/components/cockpit/indicatorDetails/index.vue index 3805335..d42b074 100644 --- a/src/components/cockpit/indicatorDetails/index.vue +++ b/src/components/cockpit/indicatorDetails/index.vue @@ -5,12 +5,19 @@ @@ -36,7 +37,6 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue' import TableStore from '@/utils/tableStore' import TableHeader from '@/components/table/header/index.vue' import { dayjs } from 'element-plus' -import { overflow } from 'html2canvas/dist/types/css/property-descriptors/overflow' const prop = defineProps({ w: { type: [String, Number] }, @@ -92,6 +92,7 @@ const tableStore: any = new TableStore({ tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1] }, loadCallback: () => { + value.value = tableStore.table.params.searchBeginTime // 将后端返回的数据整合到 list 中 // tableStore.table.data = [ // { @@ -188,20 +189,25 @@ const addMenu = () => {}