微调
This commit is contained in:
@@ -294,7 +294,7 @@ const tableStore = new TableStore({
|
||||
// treeData = tree2List(tableStore.table.data)
|
||||
// tableStore.table.data = JSON.parse(JSON.stringify(treeData))
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
console.log('tableStore.table.params---2', tableStore.table.params)
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
|
||||
@@ -60,17 +60,17 @@
|
||||
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="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"></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"></vxe-column>
|
||||
<vxe-column field="interval" title="统计间隔" align="center" min-width="100"></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>
|
||||
@@ -141,7 +141,7 @@ interface PollutionItem {
|
||||
}
|
||||
|
||||
const formatMonitorId = (row: any) => {
|
||||
return row.row.monitorId || '/'
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
|
||||
const handleSelectChange = (isExpanded: boolean) => {
|
||||
@@ -302,7 +302,7 @@ const handleCurrentChange = (val: number) => {
|
||||
const exportEvent = () => {
|
||||
const allFilteredData = filteredData.value
|
||||
tableRef.value.exportData({
|
||||
filename: '污染值报告',
|
||||
filename: '监测点评估-污染值报告',
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<el-form-item label="筛选">
|
||||
<el-input
|
||||
v-model="searchKeyword"
|
||||
placeholder="请输入变电站/终端/监测点"
|
||||
placeholder="请输入变电站"
|
||||
clearable
|
||||
@input="handleFilterChange"
|
||||
:show-word-limit=true
|
||||
@@ -64,14 +64,11 @@
|
||||
<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 field="lineName" title="监测点名称" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="devName" title="终端名称" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号" align="center" min-width="120"></vxe-column>
|
||||
<vxe-column field="manufacturer" title="终端厂家" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="loginTime" title="投运时间" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="interval" title="统计间隔" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="150"></vxe-column>
|
||||
<vxe-column field="vharmonicValue" 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>
|
||||
|
||||
@@ -87,6 +84,33 @@
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"/>
|
||||
</div>
|
||||
|
||||
<!-- 添加弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailDialogVisible"
|
||||
:title="detailDialogTitle"
|
||||
width="80%"
|
||||
>
|
||||
<div v-loading="detailLoading">
|
||||
<vxe-table
|
||||
:data="detailData"
|
||||
auto-resize
|
||||
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>
|
||||
|
||||
@@ -119,6 +143,53 @@ 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',
|
||||
@@ -142,8 +213,6 @@ interface PollutionItem {
|
||||
vharmonicValue?: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
const handleSelectChange = (isExpanded: boolean) => {
|
||||
if (isExpanded) {
|
||||
tableHeight.value = tableHeight.value - 55
|
||||
@@ -220,7 +289,6 @@ const updateTotal = computed(() => {
|
||||
return filteredData.value.length
|
||||
})
|
||||
|
||||
|
||||
const processNullValue = (value: any) => {
|
||||
return value === null || value === undefined || value === '' || value === 'null'? '/' : value
|
||||
}
|
||||
@@ -237,37 +305,19 @@ const tableStore = new TableStore({
|
||||
delete tableStore.table.params.timeFlag
|
||||
},
|
||||
loadCallback: () => {
|
||||
// 展开数据
|
||||
// 保存原始数据以便后续查询
|
||||
originalTableData.value = [...(tableStore.table.data || [])]
|
||||
|
||||
const expandedData: PollutionItem[] = [];
|
||||
|
||||
(tableStore.table.data || []).forEach((item: any) => {
|
||||
if (item.powerFlagPollutionList && item.powerFlagPollutionList.length > 0) {
|
||||
// 为每个监测点创建一行数据
|
||||
item.powerFlagPollutionList.forEach((point: any) => {
|
||||
expandedData.push({
|
||||
gdName: processNullValue(item.gdName),
|
||||
subStationName: processNullValue(item.subStationName),
|
||||
subVStationValue: processNullValue(item.subVStationValue),
|
||||
subVoltage: processNullValue(item.subVoltage),
|
||||
devName: processNullValue(point.devName),
|
||||
lineName: processNullValue(point.lineName),
|
||||
powerFlag: processNullValue(point.powerFlag),
|
||||
devType: processNullValue(point.devType),
|
||||
manufacturer: processNullValue(point.manufacturer),
|
||||
loginTime: processNullValue(point.loginTime),
|
||||
interval: processNullValue(point.interval),
|
||||
vharmonicValue: processNullValue(point.vharmonicValue)
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// 如果没有监测点数据,也保留变电站基本信息行
|
||||
expandedData.push({
|
||||
gdName: processNullValue(item.gdName),
|
||||
subStationName: processNullValue(item.subStationName),
|
||||
subVStationValue: processNullValue(item.subVStationValue),
|
||||
subVoltage: processNullValue(item.subVoltage)
|
||||
});
|
||||
}
|
||||
expandedData.push({
|
||||
gdName: processNullValue(item.gdName),
|
||||
subStationName: processNullValue(item.subStationName),
|
||||
subVStationValue: processNullValue(item.subVStationValue),
|
||||
subVoltage: processNullValue(item.subVoltage)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
allData.value = expandedData;
|
||||
@@ -340,17 +390,21 @@ const handleCurrentChange = (val: number) => {
|
||||
const exportEvent = () => {
|
||||
const allFilteredData = filteredData.value
|
||||
tableRef.value.exportData({
|
||||
filename: '污染值报告',
|
||||
filename: '场战级评估-污染值报告',
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx',
|
||||
useStyle: true,
|
||||
data: allFilteredData,
|
||||
columnFilterMethod: function (column, $columnIndex) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(
|
||||
column.column.title === '操作'
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
if (props.active) {
|
||||
tableStore.index()
|
||||
|
||||
Reference in New Issue
Block a user