修改冀北现场问题
This commit is contained in:
@@ -1,520 +0,0 @@
|
||||
<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="subVStationValue" :title="harmonicValueTitle" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="subVoltage" title="变电站电压等级" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column title="操作" width="150" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small" type="primary" @click="showDetailDialog(row)">监测点详情</el-button>
|
||||
</template>
|
||||
</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]"
|
||||
background
|
||||
layout="sizes, total, prev, pager, next, jumper"
|
||||
:total="tableStore.table.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"/>
|
||||
</div>
|
||||
|
||||
<!-- 添加弹窗 -->
|
||||
<el-dialog draggable
|
||||
v-model="detailDialogVisible"
|
||||
:title="detailDialogTitle"
|
||||
width="1000px"
|
||||
|
||||
>
|
||||
<div v-loading="detailLoading">
|
||||
<div style="margin-bottom: 10px; text-align: right;">
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportDetailEvent">导出</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
ref="detailTableRef"
|
||||
:data="detailData"
|
||||
auto-resize
|
||||
v-bind="defaultAttribute"
|
||||
resizable
|
||||
show-overflow
|
||||
height="400px"
|
||||
>
|
||||
<vxe-column title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="devName" title="终端名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号" align="center" min-width="100"></vxe-column>
|
||||
<vxe-column field="manufacturer" title="终端厂家" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loginTime" title="投运时间" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="interval" title="统计间隔" align="center" min-width="100"></vxe-column>
|
||||
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
||||
<vxe-column field="vharmonicValue" title="监测点污染值" align="center" min-width="120"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import { ref, onMounted, provide, onBeforeUnmount, computed, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const props = defineProps({
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['initialized'])
|
||||
|
||||
const dictData = useDictData()
|
||||
const options = dictData.getBasicData('Pollution_Calc')
|
||||
const tableHeight = ref(500)
|
||||
const tableRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const detailTableRef = ref()
|
||||
const selectedArea = ref()
|
||||
const areOptions: any = dictData.state.area
|
||||
const allData = ref<PollutionItem[]>([])
|
||||
const searchKeyword = ref('')
|
||||
const harmonicValueTitle = ref('电站谐波电压污染值')
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailDialogTitle = ref('')
|
||||
const detailLoading = ref(false)
|
||||
const detailData = ref<PollutionItem[]>([])
|
||||
const originalTableData = ref<any[]>([])
|
||||
|
||||
// 方法
|
||||
const showDetailDialog = (row) => {
|
||||
detailDialogTitle.value = `${row.subStationName} - 监测点详情`
|
||||
loadDetailData(row)
|
||||
detailDialogVisible.value = true
|
||||
}
|
||||
|
||||
|
||||
const loadDetailData = async (row) => {
|
||||
detailLoading.value = true
|
||||
try {
|
||||
// 从原始数据中查找该变电站的详细信息
|
||||
const originalItem = originalTableData.value.find(
|
||||
item => item.subStationName === row.subStationName
|
||||
)
|
||||
|
||||
if (originalItem && originalItem.powerFlagPollutionList) {
|
||||
const detailList: PollutionItem[] = []
|
||||
originalItem.powerFlagPollutionList.forEach((point: any) => {
|
||||
detailList.push({
|
||||
|
||||
lineName: processNullValue(point.lineName),
|
||||
devName: processNullValue(point.devName),
|
||||
devType: processNullValue(point.devType),
|
||||
manufacturer: processNullValue(point.manufacturer),
|
||||
loginTime: processNullValue(point.loginTime),
|
||||
interval: processNullValue(point.interval),
|
||||
powerFlag: processNullValue(point.powerFlag),
|
||||
vharmonicValue: processNullValue(point.vharmonicValue)
|
||||
})
|
||||
})
|
||||
detailData.value = detailList
|
||||
} else {
|
||||
detailData.value = []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载详情数据失败:', error)
|
||||
detailData.value = []
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const cascaderProps = {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
emitPath: false
|
||||
}
|
||||
|
||||
interface PollutionItem {
|
||||
gdName?: string
|
||||
subStationName?: string
|
||||
subVStationValue?: string
|
||||
subVoltage?: string
|
||||
devName?: string
|
||||
lineName?: string
|
||||
powerFlag?: string
|
||||
devType?: string
|
||||
manufacturer?: string
|
||||
loginTime?: string
|
||||
interval?: string
|
||||
vharmonicValue?: string
|
||||
}
|
||||
|
||||
const handleSelectChange = (isExpanded: boolean) => {
|
||||
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 debouncedCalculateTableHeight = debounce(() => {
|
||||
calculateTableHeight()
|
||||
}, 300)
|
||||
|
||||
const filteredData = computed(() => {
|
||||
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 (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))
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
)
|
||||
}
|
||||
|
||||
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 updateTotal = computed(() => {
|
||||
return filteredData.value.length
|
||||
})
|
||||
|
||||
const processNullValue = (value: any) => {
|
||||
return value === null || value === undefined || value === '' || value === 'null'? '/' : value
|
||||
}
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/downPollutionSubCalc',
|
||||
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: () => {
|
||||
// 保存原始数据以便后续查询
|
||||
originalTableData.value = [...(tableStore.table.data || [])]
|
||||
|
||||
const expandedData: PollutionItem[] = [];
|
||||
|
||||
(tableStore.table.data || []).forEach((item: any) => {
|
||||
expandedData.push({
|
||||
gdName: processNullValue(item.gdName),
|
||||
subStationName: processNullValue(item.subStationName),
|
||||
subVStationValue: processNullValue(item.subVStationValue),
|
||||
subVoltage: processNullValue(item.subVoltage)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
allData.value = expandedData;
|
||||
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 }
|
||||
)
|
||||
|
||||
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 }
|
||||
)
|
||||
|
||||
tableStore.table.params.powerFlag = "0"
|
||||
tableStore.table.params.isUpToGrid = 0
|
||||
tableStore.table.params.type = 1
|
||||
|
||||
const handleStatisticalTypeChange = (newVal: { id: any }) => {
|
||||
if (newVal) {
|
||||
tableStore.table.params.statisticalType = newVal
|
||||
tableStore.table.params.ids = [newVal.id]
|
||||
if (newVal.name) {
|
||||
harmonicValueTitle.value = '电站' + newVal.name + '污染值'
|
||||
}
|
||||
}
|
||||
// 重新调用接口
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
const handleFilterChange = () => {
|
||||
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
|
||||
}
|
||||
|
||||
const handleCurrentChange = (val: number) => {
|
||||
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: any) {
|
||||
return !(
|
||||
column.column.title === '操作'
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 导出详情数据的方法
|
||||
const exportDetailEvent = () => {
|
||||
detailTableRef.value.exportData({
|
||||
filename: detailDialogTitle.value,
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: detailData.value,
|
||||
columnFilterMethod({ column }) {
|
||||
// 导出所有列,包括隐藏列
|
||||
return true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.active) {
|
||||
tableStore.index()
|
||||
emit('initialized', 'pollutionReport')
|
||||
}
|
||||
calculateTableHeight()
|
||||
window.addEventListener('resize', debouncedCalculateTableHeight)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
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 = ''
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
refresh: () => {
|
||||
clearQueryParams()
|
||||
tableHeaderRef.value.setTheDate(3)
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pagination-container {
|
||||
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;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__sizes) {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__total) {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__jump) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -85,7 +85,7 @@
|
||||
<el-pagination
|
||||
:current-page="tableStore.table.params.pageNum"
|
||||
:page-size="tableStore.table.params.pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-sizes="[10, 20, 50, 100,200]"
|
||||
background
|
||||
layout="sizes, total, prev, pager, next, jumper"
|
||||
:total="tableStore.table.total"
|
||||
@@ -272,6 +272,7 @@ 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]
|
||||
@@ -0,0 +1,510 @@
|
||||
<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="请选择统计类型"
|
||||
>
|
||||
<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="subVStationValue"
|
||||
:title="harmonicValueTitle"
|
||||
align="center"
|
||||
min-width="150"
|
||||
></vxe-column>
|
||||
<vxe-column field="subVoltage" title="变电站电压等级" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column title="操作" width="150" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small" type="primary" link @click="showDetailDialog(row)">
|
||||
监测点污染详情
|
||||
</el-button>
|
||||
</template>
|
||||
</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>
|
||||
|
||||
<!-- 添加弹窗 -->
|
||||
<el-dialog draggable v-model="detailDialogVisible" :title="detailDialogTitle" width="1000px">
|
||||
<div v-loading="detailLoading">
|
||||
<div style="margin-bottom: 10px; text-align: right">
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportDetailEvent">导出</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
ref="detailTableRef"
|
||||
:data="detailData"
|
||||
auto-resize
|
||||
v-bind="defaultAttribute"
|
||||
resizable
|
||||
show-overflow
|
||||
height="400px"
|
||||
>
|
||||
<vxe-column title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||
|
||||
<vxe-column title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
||||
<vxe-column field="vharmonicValue" title="监测点污染值" align="center" min-width="120"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, onBeforeUnmount, computed, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
const props = defineProps({
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['initialized'])
|
||||
|
||||
const dictData = useDictData()
|
||||
const options = dictData.getBasicData('Pollution_Calc')
|
||||
const tableHeight = ref(500)
|
||||
const tableRef = ref()
|
||||
const tableHeaderRef = ref()
|
||||
const detailTableRef = ref()
|
||||
const selectedArea = ref()
|
||||
const areOptions: any = dictData.state.area
|
||||
const allData = ref<PollutionItem[]>([])
|
||||
const searchKeyword = ref('')
|
||||
const harmonicValueTitle = ref('电站谐波电压污染值')
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailDialogTitle = ref('')
|
||||
const detailLoading = ref(false)
|
||||
const detailData = ref<PollutionItem[]>([])
|
||||
const originalTableData = ref<any[]>([])
|
||||
|
||||
// 方法
|
||||
const showDetailDialog = row => {
|
||||
detailDialogTitle.value = `${row.subStationName} - 监测点污染详情`
|
||||
loadDetailData(row)
|
||||
detailDialogVisible.value = true
|
||||
}
|
||||
|
||||
const loadDetailData = async row => {
|
||||
detailLoading.value = true
|
||||
try {
|
||||
// 从原始数据中查找该变电站的详细信息
|
||||
const originalItem = originalTableData.value.find(item => item.subStationName === row.subStationName)
|
||||
|
||||
if (originalItem && originalItem.powerFlagPollutionList) {
|
||||
const detailList: PollutionItem[] = []
|
||||
// originalItem.powerFlagPollutionList.forEach((point: any) => {
|
||||
// detailList.push({
|
||||
// lineName: processNullValue(point.lineName),
|
||||
// devName: processNullValue(point.devName),
|
||||
// devType: processNullValue(point.devType),
|
||||
// manufacturer: processNullValue(point.manufacturer),
|
||||
// loginTime: processNullValue(point.loginTime),
|
||||
// interval: processNullValue(point.interval),
|
||||
// powerFlag: processNullValue(point.powerFlag),
|
||||
// vharmonicValue: processNullValue(point.vharmonicValue)
|
||||
// })
|
||||
// })
|
||||
detailData.value = originalItem.powerFlagPollutionList //detailList
|
||||
} else {
|
||||
detailData.value = []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载详情数据失败:', error)
|
||||
detailData.value = []
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const cascaderProps = {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
checkStrictly: true,
|
||||
emitPath: false
|
||||
}
|
||||
|
||||
interface PollutionItem {
|
||||
gdName?: string
|
||||
subStationName?: string
|
||||
subVStationValue?: string
|
||||
subVoltage?: string
|
||||
devName?: string
|
||||
lineName?: string
|
||||
powerFlag?: string
|
||||
devType?: string
|
||||
manufacturer?: string
|
||||
loginTime?: string
|
||||
interval?: string
|
||||
vharmonicValue?: string
|
||||
}
|
||||
|
||||
const handleSelectChange = (isExpanded: boolean) => {
|
||||
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 debouncedCalculateTableHeight = debounce(() => {
|
||||
calculateTableHeight()
|
||||
}, 300)
|
||||
|
||||
const filteredData = computed(() => {
|
||||
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 (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))
|
||||
}
|
||||
}
|
||||
|
||||
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))
|
||||
)
|
||||
}
|
||||
|
||||
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 updateTotal = computed(() => {
|
||||
return filteredData.value.length
|
||||
})
|
||||
|
||||
const processNullValue = (value: any) => {
|
||||
return value === null || value === undefined || value === '' || value === 'null' ? '/' : value
|
||||
}
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/downPollutionSubCalc',
|
||||
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
|
||||
tableStore.table.params.ids = [tableStore.table.params.statisticalType.id]
|
||||
},
|
||||
loadCallback: () => {
|
||||
// 保存原始数据以便后续查询
|
||||
originalTableData.value = [...(tableStore.table.data || [])]
|
||||
|
||||
const expandedData: PollutionItem[] = []
|
||||
|
||||
;(tableStore.table.data || []).forEach((item: any) => {
|
||||
expandedData.push({
|
||||
gdName: processNullValue(item.gdName),
|
||||
subStationName: processNullValue(item.subStationName),
|
||||
subVStationValue: processNullValue(item.subVStationValue),
|
||||
subVoltage: processNullValue(item.subVoltage)
|
||||
})
|
||||
})
|
||||
harmonicValueTitle.value = tableStore.table.params.statisticalType.name + '污染值'
|
||||
allData.value = expandedData
|
||||
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 }
|
||||
)
|
||||
|
||||
watch(
|
||||
() => options,
|
||||
newOptions => {
|
||||
if (newOptions && newOptions.length > 0) {
|
||||
if (!tableStore.table.params.statisticalType) {
|
||||
tableStore.table.params.statisticalType = newOptions[0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.powerFlag = '0'
|
||||
tableStore.table.params.isUpToGrid = 0
|
||||
tableStore.table.params.type = 1
|
||||
|
||||
const handleFilterChange = () => {
|
||||
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
|
||||
}
|
||||
|
||||
const handleCurrentChange = (val: number) => {
|
||||
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: any) {
|
||||
return !(column.column.title === '操作')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 导出详情数据的方法
|
||||
const exportDetailEvent = () => {
|
||||
detailTableRef.value.exportData({
|
||||
filename: detailDialogTitle.value,
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: detailData.value,
|
||||
columnFilterMethod({ column }) {
|
||||
// 导出所有列,包括隐藏列
|
||||
return true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.active) {
|
||||
tableStore.index()
|
||||
emit('initialized', 'pollutionReport')
|
||||
}
|
||||
calculateTableHeight()
|
||||
window.addEventListener('resize', debouncedCalculateTableHeight)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
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 = ''
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
refresh: (statisticalType?: string) => {
|
||||
tableStore.table.params.statisticalType = options.filter(item => item.id === statisticalType)[0] || ''
|
||||
|
||||
clearQueryParams()
|
||||
tableHeaderRef.value.setTheDate(3)
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pagination-container {
|
||||
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;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__sizes) {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__total) {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination .el-pagination__jump) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker area ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
>
|
||||
<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="请选择电网标志">
|
||||
<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="tableStore.table.params.searchValue"
|
||||
placeholder="请输入变电站/终端/监测点"
|
||||
clearable
|
||||
:show-word-limit="true"
|
||||
:maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary">导出</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 添加弹窗 -->
|
||||
<el-dialog draggable v-model="detailDialogVisible" :title="detailDialogTitle" width="1000px">
|
||||
<div v-loading="detailLoading">
|
||||
<div style="margin-bottom: 10px; text-align: right">
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportDetailEvent">导出</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
ref="detailTableRef"
|
||||
:data="detailData"
|
||||
auto-resize
|
||||
v-bind="defaultAttribute"
|
||||
resizable
|
||||
show-overflow
|
||||
height="400px"
|
||||
>
|
||||
<vxe-column title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
||||
<vxe-column field="vharmonicValue" title="监测点污染值" align="center" min-width="120"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
||||
//
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailDialogTitle = ref('')
|
||||
const detailData = ref([])
|
||||
const dictData = useDictData()
|
||||
const detailTableRef = ref()
|
||||
const lineList = dictData.getBasicData('Line_Type')
|
||||
const options = dictData.getBasicData('Pollution_Calc')
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/getAreaPollution',
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '监测点台账',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'deptName',
|
||||
title: '区域',
|
||||
minWidth: 100
|
||||
},
|
||||
|
||||
{
|
||||
field: 'score',
|
||||
title: '污染值',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '监测点污染详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
|
||||
click: row => {
|
||||
detailDialogTitle.value = row.deptName + '监测点污染详情'
|
||||
detailLoading.value = true
|
||||
detailData.value = row.powerFlagPollutionList
|
||||
detailDialogVisible.value = true
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.id = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.ids = [tableStore.table.params.statisticalType?.id]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.column[2].title = tableStore.table.params.statisticalType.name + '污染值'
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.statisticalType = options[0]
|
||||
tableStore.table.params.searchState = '0'
|
||||
tableStore.table.params.lineRunFlag = 0
|
||||
|
||||
// 导出详情数据的方法
|
||||
const exportDetailEvent = () => {
|
||||
detailTableRef.value.exportData({
|
||||
filename: detailDialogTitle.value,
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: detailData.value,
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const setSearchValue = (val: string) => {
|
||||
tableStore.table.params.searchValue = val
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
setSearchValue
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker area ref="TableHeaderRef" showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
value-key="id"
|
||||
placeholder="请选择统计类型"
|
||||
>
|
||||
<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-input
|
||||
v-model="tableStore.table.params.searchValue"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
:show-word-limit="true"
|
||||
:maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary">导出</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 添加弹窗 -->
|
||||
<el-dialog draggable v-model="detailDialogVisible" :title="detailDialogTitle" width="1000px">
|
||||
<div v-loading="detailLoading">
|
||||
<div style="margin-bottom: 10px; text-align: right">
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportDetailEvent">导出</el-button>
|
||||
</div>
|
||||
<vxe-table
|
||||
ref="detailTableRef"
|
||||
:data="detailData"
|
||||
auto-resize
|
||||
v-bind="defaultAttribute"
|
||||
resizable
|
||||
show-overflow
|
||||
height="400px"
|
||||
>
|
||||
<vxe-column title="序号" width="60" type="seq" align="center"></vxe-column>
|
||||
<vxe-column field="subName" title="变电站名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
||||
<vxe-column field="vharmonicValue" title="监测点污染值" align="center" min-width="120"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
|
||||
//
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailDialogTitle = ref('')
|
||||
const detailData = ref([])
|
||||
const dictData = useDictData()
|
||||
const detailTableRef = ref()
|
||||
const lineList = dictData.getBasicData('Line_Type')
|
||||
const options = dictData.getBasicData('Pollution_Calc')
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/PollutionSubstation/downPollutionSensitiveUser',
|
||||
publicHeight: 65,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '监测点台账',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'gdName',
|
||||
title: '供电公司',
|
||||
minWidth: 100
|
||||
},
|
||||
|
||||
{ field: 'subStationName', title: '变电站', minWidth: 150 },
|
||||
{ field: 'projectName', title: '项目名称', minWidth: 150 },
|
||||
{ field: 'subStationName', title: '变电站名称', minWidth: 150 },
|
||||
{
|
||||
field: 'subValue',
|
||||
title: '污染值',
|
||||
width: 150,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == null ? '暂未安装监测点' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '监测点污染详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.subValue == null
|
||||
},
|
||||
click: row => {
|
||||
detailDialogTitle.value = '监测点污染详情'
|
||||
console.log('🚀 ~ row:', row)
|
||||
detailLoading.value = true
|
||||
detailData.value = row.powerFlagPollutionList
|
||||
detailDialogVisible.value = true
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.ids = [tableStore.table.params.statisticalType?.id]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.column[5].title = tableStore.table.params.statisticalType.name + '污染值'
|
||||
}
|
||||
})
|
||||
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.statisticalType = options[0]
|
||||
tableStore.table.params.powerFlag = 0
|
||||
tableStore.table.params.isUpToGrid = 0
|
||||
// 导出详情数据的方法
|
||||
const exportDetailEvent = () => {
|
||||
detailTableRef.value.exportData({
|
||||
filename: detailDialogTitle.value,
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: detailData.value,
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const setSearchValue = (val: string) => {
|
||||
tableStore.table.params.searchValue = val
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
setSearchValue
|
||||
})
|
||||
</script>
|
||||
@@ -1,30 +1,31 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="监测点评估" name="pollutionReport">
|
||||
<MonitoringPointTab
|
||||
ref="monitoringPointTabRef"
|
||||
:active="activeTab === 'pollutionReport'"
|
||||
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="场站级评估" name="anotherReport">
|
||||
<SubstationTab
|
||||
ref="substationTabRef"
|
||||
:active="activeTab === 'anotherReport'"
|
||||
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="default-main">
|
||||
<el-tabs v-model="activeTab" type="border-card" @tab-change="handleTabChange">
|
||||
<el-tab-pane label="监测点评估" name="pollutionReport">
|
||||
<MonitoringPointTab ref="monitoringPointTabRef" :active="activeTab === 'pollutionReport'" />
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="场站级评估" name="anotherReport">
|
||||
<SubstationTab ref="substationTabRef" :active="activeTab === 'anotherReport'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="区域级评估" name="3">
|
||||
<regionalAssessment v-if="activeTab == '3'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="敏感及重要用户评估" name="4">
|
||||
<userEvaluation v-if="activeTab == '4'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import MonitoringPointTab from './MonitoringPointTab.vue'
|
||||
import SubstationTab from './SubstationTab.vue'
|
||||
|
||||
import MonitoringPointTab from './components/MonitoringPointTab.vue'
|
||||
import SubstationTab from './components/SubstationTab.vue'
|
||||
import regionalAssessment from './components/regionalAssessment.vue'
|
||||
import userEvaluation from './components/userEvaluation.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport'
|
||||
})
|
||||
@@ -33,17 +34,27 @@ const activeTab = ref('pollutionReport')
|
||||
const monitoringPointTabRef = ref()
|
||||
const substationTabRef = ref()
|
||||
|
||||
|
||||
const handleTabChange = (tabName: string) => {
|
||||
if (tabName === 'pollutionReport' && monitoringPointTabRef.value) {
|
||||
|
||||
monitoringPointTabRef.value.refresh()
|
||||
monitoringPointTabRef.value.refresh()
|
||||
} else if (tabName === 'anotherReport' && substationTabRef.value) {
|
||||
substationTabRef.value.refresh()
|
||||
substationTabRef.value.refresh()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/qydetailedAnalysis/pollutionReport')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '2') {
|
||||
activeTab.value = 'anotherReport'
|
||||
substationTabRef.value.refresh((route.query.statisticalType as string) || 'null')
|
||||
} else if (type == '4') {
|
||||
activeTab.value = '4'
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -154,11 +154,7 @@
|
||||
<vxe-column type="seq" title="序号" width="80px">
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
{{
|
||||
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||
rowIndex +
|
||||
1
|
||||
}}
|
||||
{{ (pageNum - 1) * pageSize + rowIndex + 1 }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
@@ -216,7 +212,7 @@
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { onMounted, provide, ref } from 'vue'
|
||||
import { onMounted, provide, ref, watch } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
@@ -225,7 +221,8 @@ import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
const pageHeight = mainHeight(97)
|
||||
@@ -490,6 +487,23 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/harmonic/getIntegrityData')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
nextTick(() => {
|
||||
tableStore.table.params.searchValue = (route.query.name as string) || ''
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
</script>
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
{{
|
||||
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||
(pageNum - 1) * pageSize +
|
||||
rowIndex +
|
||||
1
|
||||
}}
|
||||
@@ -217,7 +217,8 @@ import { getMonitorVerifyDay } from '@/api/device-boot/dataVerify'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/harmonic/getIntegrityData'
|
||||
})
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
const pageHeight = mainHeight(97)
|
||||
@@ -480,6 +481,22 @@ onMounted(() => {
|
||||
|
||||
tableStore.index()
|
||||
})
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
if (route.fullPath.includes('harmonic-boot/area/OnlineRate')) {
|
||||
let type = (route.query.type as string) || 'null'
|
||||
if (type == 'null') {
|
||||
} else if (type == '1') {
|
||||
nextTick(() => {
|
||||
tableStore.table.params.searchValue = (route.query.name as string) || ''
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader datePicker ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="超标指标">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.targetId"
|
||||
clearable
|
||||
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择超标指标"
|
||||
>
|
||||
<el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const dictData = useDictData()
|
||||
const exceeded = dictData.getBasicData('Steady_Statis')
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/onlineMonitor/overLimitDetail',
|
||||
publicHeight: 80,
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
filename: '监测点台账',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 70,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'time',
|
||||
title: '日期',
|
||||
width: '140px'
|
||||
},
|
||||
{
|
||||
field: 'overLimitInfo',
|
||||
title: '越限详情'
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.lineId = monitoringPoint.state.lineId
|
||||
}
|
||||
})
|
||||
tableStore.table.params.targetId = exceeded.filter(item => item.code == 'Total_Indicator')[0].id
|
||||
? exceeded.filter(item => item.code == 'Total_Indicator')[0].id
|
||||
: ''
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
</script>
|
||||
<style></style>
|
||||
@@ -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 && VITE_FLAG">
|
||||
<el-tab-pane label="告警数据统计" name="5" lazy v-if="!isReload ">
|
||||
<Gaojingshujutongji v-if="activeName == '5'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="监测点运行状态" name="6" lazy v-if="!isReload">
|
||||
@@ -70,9 +70,10 @@ import Wentaizonghepinggu from './wentaizonghepinggu/index.vue'
|
||||
import Wentaizhibiaohegelv from './wentaizhibiaohegelv/index.vue'
|
||||
import Wentaishujufenxi from './wentaishujufenxi/index.vue'
|
||||
import Xiebopingpu from './xiebopingpu/index.vue'
|
||||
import Gaojingshujutongji from './gaojingshujutongji/index.vue'
|
||||
import Gaojingshujutongji from './gaojingshujutongji/index_JB.vue'
|
||||
import Yunxingzhuangtai from './yunxingzhuangtai/index.vue'
|
||||
import Shishishuju from './shishishuju/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import StatisticalReport from './statisticalReport/index.vue'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
import router from '@/router'
|
||||
@@ -80,7 +81,7 @@ import router from '@/router'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/monitor/online'
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const pointTree = ref()
|
||||
const size = ref(23)
|
||||
@@ -121,7 +122,9 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
watch(
|
||||
() => monitoringPoint.state.lineId,
|
||||
() => {
|
||||
return monitoringPoint.state.lineId
|
||||
},
|
||||
() => {
|
||||
// 刷新页面
|
||||
isReload.value = true
|
||||
@@ -130,6 +133,26 @@ watch(
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
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)
|
||||
activeName.value = type
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
const changeTab = (e: string) => {
|
||||
activeName.value = e
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user