|
@@ -16,8 +16,8 @@
|
|
|
<el-input v-model="queryParams.name" placeholder="请输入分区名称" clearable style="width: 200px"
|
|
<el-input v-model="queryParams.name" placeholder="请输入分区名称" clearable style="width: 200px"
|
|
|
@keyup.enter="handleQuery" />
|
|
@keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="地点">
|
|
|
|
|
- <el-input v-model="queryParams.district" placeholder="请输入地点" clearable style="width: 200px"
|
|
|
|
|
|
|
+ <el-form-item label="地址">
|
|
|
|
|
+ <el-input v-model="queryParams.district" placeholder="请输入地址" clearable style="width: 200px"
|
|
|
@keyup.enter="handleQuery" />
|
|
@keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="分区类型">
|
|
<el-form-item label="分区类型">
|
|
@@ -48,27 +48,8 @@
|
|
|
<el-table v-loading="loading" :data="filteredList" style="width: 100%" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" :data="filteredList" style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="分区名称" prop="name" min-width="160" />
|
|
<el-table-column label="分区名称" prop="name" min-width="160" />
|
|
|
- <el-table-column label="地点" prop="district" min-width="100" />
|
|
|
|
|
|
|
+ <el-table-column label="地址" prop="district" min-width="180" show-overflow-tooltip />
|
|
|
<el-table-column label="分区类型" prop="partitionType" min-width="100" />
|
|
<el-table-column label="分区类型" prop="partitionType" min-width="100" />
|
|
|
- <el-table-column label="数据时间" prop="time" min-width="120" />
|
|
|
|
|
- <el-table-column :label="`排水量(${DRAINAGE_UNIT})`" prop="drainage" min-width="120" align="right">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <span>{{ formatVolume(row.drainage) }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="`积水量(${WATERLOGGING_UNIT})`" prop="waterlogging" min-width="120" align="right">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <span>{{ formatVolume(row.waterlogging) }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="积水等级" prop="level" min-width="110" align="center">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-tag v-if="hasLevel(row.level)" :type="getLevelTagType(row.level)" effect="light" size="small">
|
|
|
|
|
- {{ getLevelLabel(row.level) }}
|
|
|
|
|
- </el-tag>
|
|
|
|
|
- <span v-else class="text-placeholder">--</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
<el-table-column label="关联设备" min-width="160">
|
|
<el-table-column label="关联设备" min-width="160">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
{{ equipmentNameMap[row.id] || '' }}
|
|
{{ equipmentNameMap[row.id] || '' }}
|
|
@@ -100,7 +81,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
|
- <span class="info-label">地点:</span>
|
|
|
|
|
|
|
+ <span class="info-label">地址:</span>
|
|
|
<span class="info-value">{{ currentRow.district }}</span>
|
|
<span class="info-value">{{ currentRow.district }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -108,33 +89,8 @@
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
|
- <span class="info-label">数据时间:</span>
|
|
|
|
|
- <span class="info-value">{{ currentRow.time }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <div class="info-item">
|
|
|
|
|
- <span class="info-label">排水量:</span>
|
|
|
|
|
- <span class="info-value">{{ formatVolume(currentRow.drainage) }} {{ DRAINAGE_UNIT }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row :gutter="20">
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <div class="info-item">
|
|
|
|
|
- <span class="info-label">积水量:</span>
|
|
|
|
|
- <span class="info-value">{{ formatVolume(currentRow.waterlogging) }} {{ WATERLOGGING_UNIT }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <div class="info-item">
|
|
|
|
|
- <span class="info-label">积水等级:</span>
|
|
|
|
|
- <span class="info-value">
|
|
|
|
|
- <el-tag v-if="hasLevel(currentRow.level)" :type="getLevelTagType(currentRow.level)" effect="light" size="small">
|
|
|
|
|
- {{ getLevelLabel(currentRow.level) }}
|
|
|
|
|
- </el-tag>
|
|
|
|
|
- <span v-else class="text-placeholder">--</span>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ <span class="info-label">分区类型:</span>
|
|
|
|
|
+ <span class="info-value">{{ currentRow.partitionType || '--' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -162,7 +118,7 @@
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
|
|
<!-- 新增/修改对话框 -->
|
|
<!-- 新增/修改对话框 -->
|
|
|
- <el-dialog v-model="editDialogVisible" :title="editDialogTitle" width="800px" :before-close="handleEditClose"
|
|
|
|
|
|
|
+ <el-dialog v-model="editDialogVisible" :title="editDialogTitle" width="640px" :before-close="handleEditClose"
|
|
|
@opened="onEditDialogOpened">
|
|
@opened="onEditDialogOpened">
|
|
|
<el-form ref="editFormRef" :model="editForm" :rules="editRules" label-width="100px">
|
|
<el-form ref="editFormRef" :model="editForm" :rules="editRules" label-width="100px">
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
@@ -171,19 +127,6 @@
|
|
|
<el-input v-model="editForm.name" placeholder="请输入分区名称" />
|
|
<el-input v-model="editForm.name" placeholder="请输入分区名称" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="地点" prop="district">
|
|
|
|
|
- <el-input v-model="editForm.district" placeholder="请输入地点" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row :gutter="20">
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="数据时间" prop="time">
|
|
|
|
|
- <el-date-picker v-model="editForm.time" type="date" placeholder="选择日期" value-format="YYYY-MM-DD"
|
|
|
|
|
- style="width: 100%" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="分区类型" prop="partitionType">
|
|
<el-form-item label="分区类型" prop="partitionType">
|
|
|
<el-select v-model="editForm.partitionType" placeholder="请选择分区类型" style="width:100%"
|
|
<el-select v-model="editForm.partitionType" placeholder="请选择分区类型" style="width:100%"
|
|
@@ -196,25 +139,8 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
- <el-form-item :label="`排水量(${DRAINAGE_UNIT})`" prop="drainage">
|
|
|
|
|
- <el-input-number v-model="editForm.drainage" :precision="2" :min="0" style="width:100%"
|
|
|
|
|
- placeholder="请输入排水量" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item :label="`积水量(${WATERLOGGING_UNIT})`" prop="waterlogging">
|
|
|
|
|
- <el-input-number v-model="editForm.waterlogging" :precision="2" :min="0" style="width:100%"
|
|
|
|
|
- placeholder="请输入积水量" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- <el-row :gutter="20">
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="积水等级" prop="level">
|
|
|
|
|
- <el-select v-model="editForm.level" placeholder="请选择积水等级" clearable style="width:100%">
|
|
|
|
|
- <el-option v-for="item in levelOptions" :key="item.value" :label="item.label"
|
|
|
|
|
- :value="normalizeLevelValue(item.value)" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-form-item label="地址" prop="district">
|
|
|
|
|
+ <el-input v-model="editForm.district" placeholder="请输入地址" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -288,7 +214,6 @@
|
|
|
<script setup name="Psfqgl">
|
|
<script setup name="Psfqgl">
|
|
|
import { ref, computed, nextTick, onMounted } from 'vue'
|
|
import { ref, computed, nextTick, onMounted } from 'vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import { useDict } from '@/utils/dict'
|
|
|
|
|
import locationIcon from '@/assets/images/location.png'
|
|
import locationIcon from '@/assets/images/location.png'
|
|
|
import {
|
|
import {
|
|
|
getPartitionPage,
|
|
getPartitionPage,
|
|
@@ -302,61 +227,6 @@ import {
|
|
|
getDrainageBoundEquipmentIds
|
|
getDrainageBoundEquipmentIds
|
|
|
} from '@/api/drainage'
|
|
} from '@/api/drainage'
|
|
|
|
|
|
|
|
-// ==================== 量纲 + 积水等级字典 ====================
|
|
|
|
|
-// 排水量 / 积水量 单位:业务口径若调整,只改这两处,表单、列表、详情同步生效
|
|
|
|
|
-const DRAINAGE_UNIT = 'm³'
|
|
|
|
|
-const WATERLOGGING_UNIT = 'm³'
|
|
|
|
|
-
|
|
|
|
|
-// 积水等级字典(sys_dict_type = drainage_waterlogging_level)
|
|
|
|
|
-// 与易积水点 waterlogging_level 口径保持一致:0未积水 / 1轻度 / 2中度 / 3严重
|
|
|
|
|
-const { drainage_waterlogging_level: levelDict } = useDict('drainage_waterlogging_level')
|
|
|
|
|
-
|
|
|
|
|
-// 字典表未配置时用内置口径兜底,避免页面无选项
|
|
|
|
|
-const LEVEL_FALLBACK = [
|
|
|
|
|
- { label: '未积水', value: '0', elTagType: 'success' },
|
|
|
|
|
- { label: '轻度积水', value: '1', elTagType: 'primary' },
|
|
|
|
|
- { label: '中度积水', value: '2', elTagType: 'warning' },
|
|
|
|
|
- { label: '严重积水', value: '3', elTagType: 'danger' }
|
|
|
|
|
-]
|
|
|
|
|
-
|
|
|
|
|
-const levelOptions = computed(() => {
|
|
|
|
|
- const list = levelDict.value
|
|
|
|
|
- return Array.isArray(list) && list.length ? list : LEVEL_FALLBACK
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-// 字典值统一成数字,保证 el-select 回显能与后端 Integer 字段匹配
|
|
|
|
|
-function normalizeLevelValue(value) {
|
|
|
|
|
- if (value === null || value === undefined || value === '') return value
|
|
|
|
|
- return Number.isNaN(Number(value)) ? value : Number(value)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function hasLevel(value) {
|
|
|
|
|
- return value !== null && value !== undefined && value !== ''
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function findLevelOption(value) {
|
|
|
|
|
- const key = String(value)
|
|
|
|
|
- return levelOptions.value.find(item => String(item.value) === key)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function getLevelLabel(value) {
|
|
|
|
|
- const option = findLevelOption(value)
|
|
|
|
|
- return option ? option.label : '--'
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 标签配色由字典 list_class 决定;primary / 空值走默认主题色
|
|
|
|
|
-function getLevelTagType(value) {
|
|
|
|
|
- const option = findLevelOption(value)
|
|
|
|
|
- const type = option ? (option.elTagType || option.listClass) : ''
|
|
|
|
|
- return !type || type === 'primary' || type === 'default' ? '' : type
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function formatVolume(value) {
|
|
|
|
|
- if (value === null || value === undefined || value === '') return '--'
|
|
|
|
|
- const num = Number(value)
|
|
|
|
|
- return Number.isFinite(num) ? num.toFixed(2) : String(value)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 地图标记创建(用Label+img代替Marker)
|
|
// 地图标记创建(用Label+img代替Marker)
|
|
|
function createMapMarker(map, bPoint, name, bgColor) {
|
|
function createMapMarker(map, bPoint, name, bgColor) {
|
|
|
const color = bgColor || '#409eff'
|
|
const color = bgColor || '#409eff'
|
|
@@ -626,19 +496,13 @@ const editForm = ref({
|
|
|
name: '',
|
|
name: '',
|
|
|
district: '',
|
|
district: '',
|
|
|
partitionType: '',
|
|
partitionType: '',
|
|
|
- time: '',
|
|
|
|
|
- drainage: 0,
|
|
|
|
|
- waterlogging: 0,
|
|
|
|
|
- level: 0,
|
|
|
|
|
longitude: null,
|
|
longitude: null,
|
|
|
latitude: null,
|
|
latitude: null,
|
|
|
points: ''
|
|
points: ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const editRules = {
|
|
const editRules = {
|
|
|
- name: [{ required: true, message: '请输入分区名称', trigger: 'blur' }],
|
|
|
|
|
- time: [{ required: true, message: '请选择数据时间', trigger: 'change' }],
|
|
|
|
|
- level: [{ required: true, message: '请选择积水等级', trigger: 'change' }]
|
|
|
|
|
|
|
+ name: [{ required: true, message: '请输入分区名称', trigger: 'blur' }]
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 编辑弹窗地图相关
|
|
// 编辑弹窗地图相关
|
|
@@ -659,10 +523,6 @@ function handleAdd() {
|
|
|
name: '',
|
|
name: '',
|
|
|
district: '',
|
|
district: '',
|
|
|
partitionType: '',
|
|
partitionType: '',
|
|
|
- time: '',
|
|
|
|
|
- drainage: 0,
|
|
|
|
|
- waterlogging: 0,
|
|
|
|
|
- level: 0,
|
|
|
|
|
longitude: null,
|
|
longitude: null,
|
|
|
latitude: null,
|
|
latitude: null,
|
|
|
points: ''
|
|
points: ''
|
|
@@ -678,10 +538,6 @@ function handleEdit(row) {
|
|
|
name: row.name,
|
|
name: row.name,
|
|
|
district: row.district,
|
|
district: row.district,
|
|
|
partitionType: row.partitionType,
|
|
partitionType: row.partitionType,
|
|
|
- time: row.time,
|
|
|
|
|
- drainage: row.drainage,
|
|
|
|
|
- waterlogging: row.waterlogging,
|
|
|
|
|
- level: hasLevel(row.level) ? normalizeLevelValue(row.level) : 0,
|
|
|
|
|
longitude: row.longitude,
|
|
longitude: row.longitude,
|
|
|
latitude: row.latitude,
|
|
latitude: row.latitude,
|
|
|
points: row.points || ''
|
|
points: row.points || ''
|
|
@@ -1038,10 +894,6 @@ async function submitBind() {
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.text-placeholder {
|
|
|
|
|
- color: #c0c4cc;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.map-section {
|
|
.map-section {
|
|
|
border: 1px solid #e4e7ed;
|
|
border: 1px solid #e4e7ed;
|
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|