修改冀北现场反馈问题
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
贡献度计算
|
||||
<div style="font-size: 14px; font-weight: 500">
|
||||
<!-- {{ dotList.alias || '' }} -->
|
||||
<span class="monitoring-point">当前位置:{{ dotList.alias || '' }}</span>
|
||||
<span class="monitoring-point1">当前位置:{{ dotList.alias || '' }}</span>
|
||||
<back-component />
|
||||
</div>
|
||||
</div>
|
||||
@@ -598,7 +598,7 @@ onMounted(() => {
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
.monitoring-point {
|
||||
.monitoring-point1 {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--el-color-primary);
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<!-- 模版 -->
|
||||
<TableHeader datePicker showExport :showReset="false" ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<!-- <el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-CreditCard"
|
||||
|
||||
@@ -1,99 +1,117 @@
|
||||
<template>
|
||||
<div class="tab-content">
|
||||
<TableHeader datePicker ref="tableHeaderRef" @selectChange="handleSelectChange" >
|
||||
<template #select>
|
||||
<el-form-item label="区域">
|
||||
<el-cascader
|
||||
v-bind="$attrs"
|
||||
:options="areOptions"
|
||||
:props="cascaderProps"
|
||||
v-model="selectedArea"
|
||||
@change="handleFilterChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
@change="handleStatisticalTypeChange"
|
||||
>
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.powerFlag"
|
||||
placeholder="请选择电网标志"
|
||||
@change="handleFilterChange"
|
||||
>
|
||||
<el-option label="全部" value="0"></el-option>
|
||||
<el-option label="电网侧" value="1"></el-option>
|
||||
<el-option label="非电网侧" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="searchKeyword"
|
||||
placeholder="请输入变电站/终端/监测点"
|
||||
clearable
|
||||
@input="handleFilterChange"
|
||||
:show-word-limit=true
|
||||
:maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div v-loading="tableStore.table.loading" class="main-container">
|
||||
<vxe-table
|
||||
class="full-height-table"
|
||||
ref="tableRef"
|
||||
auto-resize
|
||||
:data="tableStore.table.data"
|
||||
v-bind="defaultAttribute"
|
||||
:height="tableHeight"
|
||||
resizable
|
||||
show-overflow
|
||||
>
|
||||
<vxe-column title="序号" width="80" type="seq" align="center"></vxe-column>
|
||||
<vxe-column field="gdName" title="供电公司" align="center" min-width="120" ></vxe-column>
|
||||
<vxe-column field="subStationName" :show-overflow="true" title="变电站" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="devName" title="终端名称" align="center" min-width="120"></vxe-column>
|
||||
<!-- <vxe-column field="devType" title="终端型号" align="center" min-width="150"></vxe-column> -->
|
||||
<!-- <vxe-column field="loginTime" title="投运时间" align="center" min-width="120"></vxe-column> -->
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="150" :formatter="formatMonitorId"></vxe-column>
|
||||
<!-- <vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="lineVoltage" title="监测点电压等级" align="center" min-width="120"></vxe-column> -->
|
||||
<!-- <vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column> -->
|
||||
<!-- <vxe-column field="objName" title="监测对象名称" align="center" min-width="150" :formatter="formatMonitorId"></vxe-column> -->
|
||||
<!-- <vxe-column field="interval" title="统计间隔" align="center" min-width="100" :formatter="formatMonitorId"></vxe-column> -->
|
||||
<!-- <vxe-column field="onlineRate" title="在线率(%)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="integrity" title="完整率(%)" align="center" min-width="100"></vxe-column> -->
|
||||
<vxe-column field="harmonicValue" :title="harmonicValueTitle" align="center" min-width="120"></vxe-column>
|
||||
<!-- <vxe-column field="upCounts" title="暂升次数(次)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="downCounts" title="电压暂降(次)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="breakCounts" title="短时中断(次)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="monitorId" title="一类监测点" align="center" min-width="120" :formatter="formatMonitorId"></vxe-column> -->
|
||||
</vxe-table>
|
||||
<div class="tab-content">
|
||||
<TableHeader datePicker ref="tableHeaderRef" @selectChange="handleSelectChange">
|
||||
<template #select>
|
||||
<el-form-item label="区域">
|
||||
<el-cascader
|
||||
v-bind="$attrs"
|
||||
:options="areOptions"
|
||||
:props="cascaderProps"
|
||||
v-model="selectedArea"
|
||||
@change="handleFilterChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
@change="handleStatisticalTypeChange"
|
||||
>
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.powerFlag"
|
||||
placeholder="请选择电网标志"
|
||||
@change="handleFilterChange"
|
||||
>
|
||||
<el-option label="全部" value="0"></el-option>
|
||||
<el-option label="电网侧" value="1"></el-option>
|
||||
<el-option label="非电网侧" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="searchKeyword"
|
||||
placeholder="请输入变电站/终端/监测点"
|
||||
clearable
|
||||
@input="handleFilterChange"
|
||||
:show-word-limit="true"
|
||||
:maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div v-loading="tableStore.table.loading" class="main-container">
|
||||
<vxe-table
|
||||
class="full-height-table"
|
||||
ref="tableRef"
|
||||
auto-resize
|
||||
:data="tableStore.table.data"
|
||||
v-bind="defaultAttribute"
|
||||
:height="tableHeight"
|
||||
resizable
|
||||
show-overflow
|
||||
>
|
||||
<vxe-column title="序号" width="80" type="seq" align="center"></vxe-column>
|
||||
<vxe-column field="gdName" title="供电公司" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column
|
||||
field="subStationName"
|
||||
:show-overflow="true"
|
||||
title="变电站"
|
||||
align="center"
|
||||
min-width="150"
|
||||
></vxe-column>
|
||||
<vxe-column field="devName" title="终端名称" align="center" min-width="120"></vxe-column>
|
||||
<!-- <vxe-column field="devType" title="终端型号" align="center" min-width="150"></vxe-column> -->
|
||||
<!-- <vxe-column field="loginTime" title="投运时间" align="center" min-width="120"></vxe-column> -->
|
||||
<vxe-column
|
||||
field="lineName"
|
||||
title="监测点名称"
|
||||
align="center"
|
||||
min-width="150"
|
||||
:formatter="formatMonitorId"
|
||||
></vxe-column>
|
||||
<!-- <vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="lineVoltage" title="监测点电压等级" align="center" min-width="120"></vxe-column> -->
|
||||
<!-- <vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column> -->
|
||||
<!-- <vxe-column field="objName" title="监测对象名称" align="center" min-width="150" :formatter="formatMonitorId"></vxe-column> -->
|
||||
<!-- <vxe-column field="interval" title="统计间隔" align="center" min-width="100" :formatter="formatMonitorId"></vxe-column> -->
|
||||
<!-- <vxe-column field="onlineRate" title="在线率(%)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="integrity" title="完整率(%)" align="center" min-width="100"></vxe-column> -->
|
||||
<vxe-column
|
||||
field="harmonicValue"
|
||||
:title="harmonicValueTitle"
|
||||
align="center"
|
||||
min-width="120"
|
||||
></vxe-column>
|
||||
<!-- <vxe-column field="upCounts" title="暂升次数(次)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="downCounts" title="电压暂降(次)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="breakCounts" title="短时中断(次)" align="center" min-width="100"></vxe-column> -->
|
||||
<!-- <vxe-column field="monitorId" title="一类监测点" align="center" min-width="120" :formatter="formatMonitorId"></vxe-column> -->
|
||||
</vxe-table>
|
||||
</div>
|
||||
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
:current-page="tableStore.table.params.pageNum"
|
||||
:page-size="tableStore.table.params.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100, 200]"
|
||||
background
|
||||
layout="sizes, total, prev, pager, next, jumper"
|
||||
:total="tableStore.table.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
:current-page="tableStore.table.params.pageNum"
|
||||
:page-size="tableStore.table.params.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100,200]"
|
||||
background
|
||||
layout="sizes, total, prev, pager, next, jumper"
|
||||
:total="tableStore.table.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -105,10 +123,10 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const props = defineProps({
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['initialized'])
|
||||
@@ -126,284 +144,287 @@ const searchKeyword = ref('')
|
||||
const harmonicValueTitle = ref('谐波电压污染值')
|
||||
|
||||
const cascaderProps = {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
emitPath: false
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
emitPath: false
|
||||
}
|
||||
|
||||
interface PollutionItem {
|
||||
gdName?: string
|
||||
subStationName?: string
|
||||
devName?: string
|
||||
lineName?: string
|
||||
powerFlag?: string
|
||||
gdName?: string
|
||||
subStationName?: string
|
||||
devName?: string
|
||||
lineName?: string
|
||||
powerFlag?: string
|
||||
}
|
||||
|
||||
const formatMonitorId = (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
|
||||
const handleSelectChange = (isExpanded: boolean) => {
|
||||
if (isExpanded) {
|
||||
tableHeight.value = tableHeight.value - 55
|
||||
} else {
|
||||
tableHeight.value = tableHeight.value + 55
|
||||
}
|
||||
if (isExpanded) {
|
||||
tableHeight.value = tableHeight.value - 55
|
||||
} else {
|
||||
tableHeight.value = tableHeight.value + 55
|
||||
}
|
||||
}
|
||||
|
||||
const calculateTableHeight = () => {
|
||||
const windowHeight = window.innerHeight
|
||||
const headerHeight = 160
|
||||
const paginationHeight = 120
|
||||
const padding = 30
|
||||
const calculatedHeight = windowHeight - headerHeight - paginationHeight - padding
|
||||
tableHeight.value = Math.max(calculatedHeight, 300)
|
||||
const windowHeight = window.innerHeight
|
||||
const headerHeight = 160
|
||||
const paginationHeight = 120
|
||||
const padding = 30
|
||||
const calculatedHeight = windowHeight - headerHeight - paginationHeight - padding
|
||||
tableHeight.value = Math.max(calculatedHeight, 300)
|
||||
}
|
||||
|
||||
const debouncedCalculateTableHeight = debounce(() => {
|
||||
calculateTableHeight()
|
||||
calculateTableHeight()
|
||||
}, 300)
|
||||
|
||||
const filteredData = computed(() => {
|
||||
let result = [...allData.value]
|
||||
let result = [...allData.value]
|
||||
|
||||
if (selectedArea.value) {
|
||||
let areaName = ''
|
||||
let areaLevel = -1
|
||||
const findAreaName = (areas: any[]) => {
|
||||
for (const area of areas) {
|
||||
if (area.id === selectedArea.value) {
|
||||
areaName = area.name
|
||||
areaLevel = area.level !== undefined ? area.level : -1
|
||||
break
|
||||
if (selectedArea.value) {
|
||||
let areaName = ''
|
||||
let areaLevel = -1
|
||||
const findAreaName = (areas: any[]) => {
|
||||
for (const area of areas) {
|
||||
if (area.id === selectedArea.value) {
|
||||
areaName = area.name
|
||||
areaLevel = area.level !== undefined ? area.level : -1
|
||||
break
|
||||
}
|
||||
if (area.children && area.children.length > 0) {
|
||||
findAreaName(area.children)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (area.children && area.children.length > 0) {
|
||||
findAreaName(area.children)
|
||||
findAreaName(areOptions)
|
||||
|
||||
if (areaName && areaLevel > 1) {
|
||||
result = result.filter(item => item.gdName && item.gdName.includes(areaName))
|
||||
}
|
||||
}
|
||||
}
|
||||
findAreaName(areOptions)
|
||||
|
||||
if (areaName && areaLevel > 1) {
|
||||
result = result.filter(item => item.gdName && item.gdName.includes(areaName))
|
||||
|
||||
if (tableStore.table.params.powerFlag === '1') {
|
||||
result = result.filter(item => item.powerFlag && !item.powerFlag.includes('非'))
|
||||
} else if (tableStore.table.params.powerFlag === '2') {
|
||||
result = result.filter(item => item.powerFlag && item.powerFlag.includes('非'))
|
||||
}
|
||||
}
|
||||
|
||||
if (tableStore.table.params.powerFlag === '1') {
|
||||
result = result.filter(item => item.powerFlag && !item.powerFlag.includes('非'))
|
||||
} else if (tableStore.table.params.powerFlag === '2') {
|
||||
result = result.filter(item => item.powerFlag && item.powerFlag.includes('非'))
|
||||
}
|
||||
if (searchKeyword.value) {
|
||||
const keyword = searchKeyword.value.toLowerCase()
|
||||
result = result.filter(
|
||||
item =>
|
||||
(item.subStationName && item.subStationName.toLowerCase().includes(keyword)) ||
|
||||
(item.devName && item.devName.toLowerCase().includes(keyword)) ||
|
||||
(item.lineName && item.lineName.toLowerCase().includes(keyword))
|
||||
)
|
||||
}
|
||||
|
||||
if (searchKeyword.value) {
|
||||
const keyword = searchKeyword.value.toLowerCase()
|
||||
result = result.filter(item =>
|
||||
(item.subStationName && item.subStationName.toLowerCase().includes(keyword)) ||
|
||||
(item.devName && item.devName.toLowerCase().includes(keyword)) ||
|
||||
(item.lineName && item.lineName.toLowerCase().includes(keyword))
|
||||
)
|
||||
}
|
||||
|
||||
return result
|
||||
return result
|
||||
})
|
||||
|
||||
const currentPageData = computed(() => {
|
||||
const pageSize = tableStore.table.params.pageSize
|
||||
const pageNum = tableStore.table.params.pageNum
|
||||
const start = (pageNum - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
return filteredData.value.slice(start, end)
|
||||
const pageSize = tableStore.table.params.pageSize
|
||||
const pageNum = tableStore.table.params.pageNum
|
||||
const start = (pageNum - 1) * pageSize
|
||||
const end = start + pageSize
|
||||
return filteredData.value.slice(start, end)
|
||||
})
|
||||
|
||||
const updateTotal = computed(() => {
|
||||
return filteredData.value.length
|
||||
return filteredData.value.length
|
||||
})
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/downPollutionLineCalc',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
delete tableStore.table.params.deptIndex
|
||||
delete tableStore.table.params.interval
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
allData.value = tableStore.table.data || []
|
||||
tableStore.table.total = updateTotal.value
|
||||
tableStore.table.data = currentPageData.value
|
||||
},
|
||||
resetCallback: () => {
|
||||
clearQueryParams()
|
||||
}
|
||||
url: '/harmonic-boot/PollutionSubstation/downPollutionLineCalc',
|
||||
method: 'POST',
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
delete tableStore.table.params.deptIndex
|
||||
delete tableStore.table.params.interval
|
||||
delete tableStore.table.params.searchEndTime
|
||||
delete tableStore.table.params.searchBeginTime
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
allData.value = tableStore.table.data || []
|
||||
tableStore.table.total = updateTotal.value
|
||||
tableStore.table.data = currentPageData.value
|
||||
},
|
||||
resetCallback: () => {
|
||||
clearQueryParams()
|
||||
}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
watch(
|
||||
() => areOptions,
|
||||
(newOptions) => {
|
||||
if (newOptions && newOptions.length > 0) {
|
||||
selectedArea.value = newOptions[0].id
|
||||
tableStore.table.params.id = newOptions[0].id
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
() => areOptions,
|
||||
newOptions => {
|
||||
if (newOptions && newOptions.length > 0) {
|
||||
selectedArea.value = newOptions[0].id
|
||||
tableStore.table.params.id = newOptions[0].id
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => options,
|
||||
(newOptions) => {
|
||||
if (newOptions && newOptions.length > 0) {
|
||||
if (!tableStore.table.params.statisticalType) {
|
||||
tableStore.table.params.statisticalType = newOptions[0]
|
||||
tableStore.table.params.ids = [newOptions[0].id]
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
() => options,
|
||||
newOptions => {
|
||||
if (newOptions && newOptions.length > 0) {
|
||||
if (!tableStore.table.params.statisticalType) {
|
||||
tableStore.table.params.statisticalType = newOptions[0]
|
||||
tableStore.table.params.ids = [newOptions[0].id]
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.powerFlag = "0"
|
||||
tableStore.table.params.powerFlag = '0'
|
||||
tableStore.table.params.isUpToGrid = 0
|
||||
tableStore.table.params.type = 1
|
||||
|
||||
const handleStatisticalTypeChange = (newVal: { id: any }) => {
|
||||
console.log("🚀 ~ handleStatisticalTypeChange ~ newVal:", newVal)
|
||||
if (newVal) {
|
||||
tableStore.table.params.statisticalType = newVal
|
||||
tableStore.table.params.ids = [newVal.id]
|
||||
if (newVal.name) {
|
||||
harmonicValueTitle.value = newVal.name + '污染值'
|
||||
console.log('🚀 ~ handleStatisticalTypeChange ~ newVal:', newVal)
|
||||
if (newVal) {
|
||||
tableStore.table.params.statisticalType = newVal
|
||||
tableStore.table.params.ids = [newVal.id]
|
||||
if (newVal.name) {
|
||||
harmonicValueTitle.value = newVal.name + '污染值'
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重新调用接口
|
||||
tableStore.index()
|
||||
// 重新调用接口
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
const handleFilterChange = () => {
|
||||
tableStore.table.params.pageNum = 1
|
||||
tableStore.table.data = currentPageData.value
|
||||
tableStore.table.total = updateTotal.value
|
||||
tableStore.table.params.pageNum = 1
|
||||
tableStore.table.data = currentPageData.value
|
||||
tableStore.table.total = updateTotal.value
|
||||
}
|
||||
|
||||
const handleSizeChange = (val: number) => {
|
||||
tableStore.table.params.pageSize = val
|
||||
tableStore.table.params.pageNum = 1
|
||||
tableStore.table.data = currentPageData.value
|
||||
tableStore.table.total = updateTotal.value
|
||||
tableStore.table.params.pageSize = val
|
||||
tableStore.table.params.pageNum = 1
|
||||
tableStore.table.data = currentPageData.value
|
||||
tableStore.table.total = updateTotal.value
|
||||
}
|
||||
|
||||
const handleCurrentChange = (val: number) => {
|
||||
tableStore.table.params.pageNum = val
|
||||
tableStore.table.data = currentPageData.value
|
||||
tableStore.table.total = updateTotal.value
|
||||
tableStore.table.params.pageNum = val
|
||||
tableStore.table.data = currentPageData.value
|
||||
tableStore.table.total = updateTotal.value
|
||||
}
|
||||
|
||||
const exportEvent = () => {
|
||||
const allFilteredData = filteredData.value
|
||||
tableRef.value.exportData({
|
||||
filename: '监测点评估-污染值报告',
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: allFilteredData,
|
||||
columnFilterMethod: function (column, $columnIndex) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
const allFilteredData = filteredData.value
|
||||
tableRef.value.exportData({
|
||||
filename: '监测点评估-污染值报告',
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: allFilteredData,
|
||||
columnFilterMethod: function (column, $columnIndex) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.active) {
|
||||
tableStore.index()
|
||||
emit('initialized', 'pollutionReport')
|
||||
}
|
||||
calculateTableHeight()
|
||||
window.addEventListener('resize', debouncedCalculateTableHeight)
|
||||
if (props.active) {
|
||||
tableStore.index()
|
||||
emit('initialized', 'pollutionReport')
|
||||
}
|
||||
calculateTableHeight()
|
||||
window.addEventListener('resize', debouncedCalculateTableHeight)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', debouncedCalculateTableHeight)
|
||||
window.removeEventListener('resize', debouncedCalculateTableHeight)
|
||||
})
|
||||
|
||||
|
||||
const clearQueryParams = () => {
|
||||
// 将区域恢复成第一层
|
||||
if (areOptions && areOptions.length > 0) {
|
||||
selectedArea.value = areOptions[0].id
|
||||
tableStore.table.params.id = areOptions[0].id
|
||||
}
|
||||
|
||||
// 清空搜索关键词
|
||||
searchKeyword.value = ''
|
||||
// 将区域恢复成第一层
|
||||
if (areOptions && areOptions.length > 0) {
|
||||
selectedArea.value = areOptions[0].id
|
||||
tableStore.table.params.id = areOptions[0].id
|
||||
}
|
||||
|
||||
// 清空搜索关键词
|
||||
searchKeyword.value = ''
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
refresh: () => {
|
||||
// 清空查询参数
|
||||
clearQueryParams()
|
||||
tableHeaderRef.value.setTheDate(3)
|
||||
tableStore.index()
|
||||
}
|
||||
refresh: (name?: any) => {
|
||||
// 清空查询参数
|
||||
clearQueryParams()
|
||||
tableHeaderRef.value.setTheDate(3)
|
||||
if (name) {
|
||||
searchKeyword.value = name
|
||||
}
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pagination-container {
|
||||
border: 1px solid #ebeef5;
|
||||
border-top: none;
|
||||
padding: 10px;
|
||||
margin: 0 0 5px 0;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-top: none;
|
||||
padding: 10px;
|
||||
margin: 0 0 5px 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination) {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__sizes) {
|
||||
margin-right: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__total) {
|
||||
margin-right: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__jump) {
|
||||
margin-left: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* 响应式处理 */
|
||||
@media screen and (max-width: 768px) {
|
||||
:deep(.custom-pagination) {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__total) {
|
||||
margin-right: 0;
|
||||
order: 1;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__sizes) {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .btn-prev),
|
||||
:deep(.custom-pagination .el-pager),
|
||||
:deep(.custom-pagination .btn-next),
|
||||
:deep(.custom-pagination .el-pagination__jump) {
|
||||
order: 3;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
:deep(.custom-pagination) {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__total) {
|
||||
margin-right: 0;
|
||||
order: 1;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__sizes) {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .btn-prev),
|
||||
:deep(.custom-pagination .el-pager),
|
||||
:deep(.custom-pagination .btn-next),
|
||||
:deep(.custom-pagination .el-pagination__jump) {
|
||||
order: 3;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -85,7 +85,7 @@ const tableStore = new TableStore({
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '监测点台账',
|
||||
filename: '区域级评估',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
|
||||
@@ -79,7 +79,7 @@ const tableStore = new TableStore({
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '监测点台账',
|
||||
filename: '敏感及重要用户评估',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<regionalAssessment v-if="activeTab == '3'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="敏感及重要用户评估" name="4">
|
||||
<userEvaluation v-if="activeTab == '4'" />
|
||||
<userEvaluation ref="userEvaluationRef" v-if="activeTab == '4'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -33,7 +33,7 @@ defineOptions({
|
||||
const activeTab = ref('pollutionReport')
|
||||
const monitoringPointTabRef = ref()
|
||||
const substationTabRef = ref()
|
||||
|
||||
const userEvaluationRef = ref()
|
||||
const handleTabChange = (tabName: string) => {
|
||||
if (tabName === 'pollutionReport' && monitoringPointTabRef.value) {
|
||||
monitoringPointTabRef.value.refresh()
|
||||
@@ -47,11 +47,21 @@ watch(
|
||||
if (route.fullPath.includes('harmonic-boot/qydetailedAnalysis/pollutionReport')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
activeTab.value = 'pollutionReport'
|
||||
setTimeout(() => {
|
||||
monitoringPointTabRef.value.refresh((route.query.name as string) || 'null')
|
||||
}, 500)
|
||||
} else if (type == '2') {
|
||||
activeTab.value = 'anotherReport'
|
||||
substationTabRef.value.refresh((route.query.statisticalType as string) || 'null')
|
||||
setTimeout(() => {
|
||||
substationTabRef.value.refresh((route.query.statisticalType as string) || 'null')
|
||||
}, 500)
|
||||
} else if (type == '4') {
|
||||
activeTab.value = '4'
|
||||
setTimeout(() => {
|
||||
userEvaluationRef.value.setSearchValue((route.query.name as string) || '')
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -494,10 +494,10 @@ watch(
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
tableStore.table.params.searchValue = (route.query.name as string) || ''
|
||||
tableStore.index()
|
||||
})
|
||||
tableStore.index()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -152,11 +152,7 @@
|
||||
<vxe-column type="seq" title="序号" width="80px">
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
{{
|
||||
(pageNum - 1) * pageSize +
|
||||
rowIndex +
|
||||
1
|
||||
}}
|
||||
{{ (pageNum - 1) * pageSize + rowIndex + 1 }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -488,10 +484,10 @@ watch(
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
tableStore.table.params.searchValue = (route.query.name as string) || ''
|
||||
tableStore.index()
|
||||
})
|
||||
tableStore.index()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<el-tab-pane label="谐波频谱" name="4" lazy v-if="!isReload">
|
||||
<Xiebopingpu v-if="activeName == '4'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="告警数据统计" name="5" lazy v-if="!isReload ">
|
||||
<el-tab-pane label="告警数据统计" name="5" lazy v-if="!isReload && VITE_FLAG">
|
||||
<Gaojingshujutongji v-if="activeName == '5'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="监测点运行状态" name="6" lazy v-if="!isReload">
|
||||
@@ -64,7 +64,7 @@ import { defineOptions, watch, onMounted, ref, nextTick } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import PointTree from '@/components/tree/pqs/pointTree.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import Wentaizonghepinggu from './wentaizonghepinggu/index.vue'
|
||||
import Wentaizhibiaohegelv from './wentaizhibiaohegelv/index.vue'
|
||||
@@ -77,7 +77,8 @@ import { useRoute } from 'vue-router'
|
||||
import StatisticalReport from './statisticalReport/index.vue'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
import router from '@/router'
|
||||
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import { id } from 'element-plus/es/locale'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/monitor/online'
|
||||
})
|
||||
@@ -140,19 +141,42 @@ watch(
|
||||
if (route.fullPath.includes('harmonic-boot/monitor/online')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
let lineId = (route.query.id as string) || 'null'
|
||||
console.log('🚀 ~ type:', type)
|
||||
if (type == 'null') {
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
monitoringPoint.setValue('lineId', lineId)
|
||||
//
|
||||
// pointTree.value.tree
|
||||
activeName.value = type
|
||||
setTimeout(() => {
|
||||
pointTree.value.scrollToNode(lineId)
|
||||
|
||||
monitoringPoint.setValue('lineName', findNodeByTreeId(pointTree.value.tree, lineId).alias)
|
||||
}, 500)
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
// 递归函数(同上)
|
||||
const findNodeByTreeId = (treeData: any, id: any) => {
|
||||
for (const node of treeData) {
|
||||
if (node.id == id) return node
|
||||
if (node.children && Array.isArray(node.children) && node.children.length) {
|
||||
const found: any = findNodeByTreeId(node.children, id)
|
||||
if (found) return found
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
// 调用示例
|
||||
const getTargetNode = () => {
|
||||
const targetId = '9b7adecf588b4110acb7018f297592a7'
|
||||
const node = findNodeByTreeId(treeData.value, targetId)
|
||||
console.log('Vue中找到的节点:', node)
|
||||
}
|
||||
const changeTab = (e: string) => {
|
||||
activeName.value = e
|
||||
}
|
||||
|
||||
@@ -140,11 +140,11 @@ const exportReport = () => {
|
||||
loading.value = true
|
||||
let form = new FormData()
|
||||
form.append('isUrl', false)
|
||||
form.append('lineIndex', dotList.value.id)
|
||||
form.append('lineIndex', monitoringPoint.state.lineId)
|
||||
form.append('startTime', TableHeaderRef.value.datePickerRef.timeValue[0])
|
||||
form.append('endTime', TableHeaderRef.value.datePickerRef.timeValue[1])
|
||||
form.append('type', 0)
|
||||
form.append('name', dotList.value.name)
|
||||
form.append('name', monitoringPoint.state.lineName.split('>').pop())
|
||||
ElMessage({
|
||||
message: '下载报告中,请稍等.....',
|
||||
duration: 1000
|
||||
@@ -159,7 +159,7 @@ const exportReport = () => {
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download =
|
||||
dotList.value.name +
|
||||
monitoringPoint.state.lineName.split('>').pop() +
|
||||
TableHeaderRef.value.datePickerRef.timeValue[0] +
|
||||
'_' +
|
||||
TableHeaderRef.value.datePickerRef.timeValue[1] // 设置下载的文件名
|
||||
|
||||
Reference in New Issue
Block a user