优化页面

This commit is contained in:
guanj
2026-01-08 11:32:01 +08:00
parent 3db01fe32d
commit 0d155c8680
3 changed files with 46 additions and 9 deletions

View File

@@ -100,7 +100,10 @@ const tableStore: any = new TableStore({
{ {
title: '监测对象类型', title: '监测对象类型',
field: 'objType', field: 'objType',
minWidth: '90' minWidth: '90',
formatter: (row: any) => {
return row.cellValue || '/'
}
}, },
{ {
title: '是否治理', title: '是否治理',

View File

@@ -81,6 +81,7 @@
height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)` height: `calc(${prop.height} - ${headerHeight}px + ${fullscreen ? 0 : 56}px)`
}" }"
/> />
<!-- <el-empty description="暂无数据" /> -->
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -127,14 +128,16 @@ const echartList = ref()
const headerHeight = ref(57) const headerHeight = ref(57)
// 监测对象 // 监测对象
const idList = ref() const idList = ref([])
// 监测对象 // 监测对象
const initListByIds = () => { const initListByIds = () => {
getListByIds({}).then((res: any) => { getListByIds({}).then((res: any) => {
if (res.data.length > 0) { if (res.data?.length > 0) {
idList.value = res.data idList.value = res.data
initCode() initCode()
} else {
tableStore.index()
} }
}) })
} }
@@ -179,7 +182,7 @@ const setEchart = () => {
if (!beforeGroupedByPhase[phase]) { if (!beforeGroupedByPhase[phase]) {
beforeGroupedByPhase[phase] = [] beforeGroupedByPhase[phase] = []
} }
beforeGroupedByPhase[phase].push([item.time, item.statisticalData]) beforeGroupedByPhase[phase].push([item.time, item.statisticalData, item.unit, 'solid'])
}) })
// 处理治理后数据 // 处理治理后数据
@@ -188,7 +191,7 @@ const setEchart = () => {
if (!afterGroupedByPhase[phase]) { if (!afterGroupedByPhase[phase]) {
afterGroupedByPhase[phase] = [] afterGroupedByPhase[phase] = []
} }
afterGroupedByPhase[phase].push([item.time, item.statisticalData]) afterGroupedByPhase[phase].push([item.time, item.statisticalData, item.unit, 'dotted'])
}) })
// 构建系列数据 // 构建系列数据
@@ -293,6 +296,37 @@ const setEchart = () => {
title: { title: {
text: titleText text: titleText
}, },
tooltip: {
axisPointer: {
type: 'cross',
label: {
color: '#fff',
fontSize: 16
}
},
textStyle: {
color: '#fff',
fontStyle: 'normal',
opacity: 0.35,
fontSize: 14
},
backgroundColor: 'rgba(0,0,0,0.55)',
borderWidth: 0,
formatter(params: any) {
const xname = params[0].value[0]
let str = `${xname}<br>`
params.forEach((el: any, index: any) => {
let marker = ''
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
str += `${marker}${el.seriesName.split('(')[0]}${
el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == 'null' ? '' : el.value[2]) : '-'
}<br>`
})
return str
}
},
legend: { legend: {
data: legendData, data: legendData,
icon: 'rect', icon: 'rect',
@@ -368,8 +402,8 @@ const tableStore: any = new TableStore({
} }
}) })
tableStore.table.params.indicator = '1' tableStore.table.params.indicator = ''
tableStore.table.params.exceedingTheLimit = '1' tableStore.table.params.exceedingTheLimit = ''
tableStore.table.params.dataLevel = 'Primary' tableStore.table.params.dataLevel = 'Primary'
tableStore.table.params.valueType = 'avg' tableStore.table.params.valueType = 'avg'
provide('tableStore', tableStore) provide('tableStore', tableStore)

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="nav-menus" :class="configStore.layout.layoutMode"> <div class="nav-menus" :class="configStore.layout.layoutMode">
<div @click="savePng" class="nav-menu-item"> <!-- <div @click="savePng" class="nav-menu-item">
<Icon <Icon
:color="configStore.getColorVal('headerBarTabColor')" :color="configStore.getColorVal('headerBarTabColor')"
class="nav-menu-icon" class="nav-menu-icon"
@@ -23,7 +23,7 @@
name="fa-solid fa-expand" name="fa-solid fa-expand"
size="18" size="18"
/> />
</div> </div> -->
<el-dropdown style="height: 100%" @command="handleCommand"> <el-dropdown style="height: 100%" @command="handleCommand">
<div class="admin-info" :class="state.currentNavMenu == 'adminInfo' ? 'hover' : ''"> <div class="admin-info" :class="state.currentNavMenu == 'adminInfo' ? 'hover' : ''">