Przeglądaj źródła

基础设施信息整合

zengy 1 dzień temu
rodzic
commit
b8a67be4ee
39 zmienionych plików z 2160 dodań i 3915 usunięć
  1. 0 81
      src/api/drainage.js
  2. 0 23
      src/api/pipeNetwork/basic.js
  3. 127 0
      src/api/pipeNetwork/facilities.js
  4. 0 53
      src/api/pipeNetwork/pipeInfo.js
  5. 0 63
      src/api/pipeNetwork/waterPumpStation.js
  6. 0 1
      src/api/pipeNetwork/waterSupply.js
  7. 1 1
      src/utils/waterFacilityGisModel.js
  8. 3 3
      src/utils/waterFacilityStatisticsModel.js
  9. 0 365
      src/views/subSystem/basic/PipeNetwork.vue
  10. 0 465
      src/views/subSystem/basic/pipeInfo/index.vue
  11. 0 465
      src/views/subSystem/basic/pumpStation/index.vue
  12. 25 29
      src/views/subSystem/drainage/jcsj/bzyxqk.vue
  13. 29 983
      src/views/subSystem/drainage/jcsj/gcssgl.vue
  14. 0 694
      src/views/subSystem/drainage/jcsj/psgwgl.vue
  15. 160 0
      src/views/subSystem/pipeNetwork/facilities/components/FacilityImportDialog.vue
  16. 273 0
      src/views/subSystem/pipeNetwork/facilities/components/FacilityLocationFields.vue
  17. 521 0
      src/views/subSystem/pipeNetwork/facilities/components/InfrastructureCrudPage.vue
  18. 69 0
      src/views/subSystem/pipeNetwork/facilities/drainageGate/index.vue
  19. 69 0
      src/views/subSystem/pipeNetwork/facilities/drainageStorage/index.vue
  20. 287 0
      src/views/subSystem/pipeNetwork/facilities/manhole/index.vue
  21. 126 101
      src/views/subSystem/pipeNetwork/facilities/pipeNetwork/index.vue
  22. 120 0
      src/views/subSystem/pipeNetwork/facilities/pumpStation/index.vue
  23. 75 0
      src/views/subSystem/pipeNetwork/facilities/waterFireHydrant/index.vue
  24. 51 117
      src/views/subSystem/pipeNetwork/facilities/waterPlant/index.vue
  25. 66 131
      src/views/subSystem/pipeNetwork/facilities/waterSource/index.vue
  26. 55 121
      src/views/subSystem/pipeNetwork/facilities/waterUser/index.vue
  27. 2 4
      src/views/subSystem/pipeNetwork/home/index.vue
  28. 1 1
      src/views/subSystem/waterSupply/components/WaterFacilityDashboard.vue
  29. 0 85
      src/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue
  30. 47 0
      src/views/subSystem/waterSupply/components/waterFacilityPageTheme.scss
  31. 0 1
      src/views/subSystem/waterSupply/facility/pipe.vue
  32. 0 1
      src/views/subSystem/waterSupply/facility/plant.vue
  33. 0 1
      src/views/subSystem/waterSupply/facility/pumpStation.vue
  34. 0 1
      src/views/subSystem/waterSupply/facility/source.vue
  35. 0 1
      src/views/subSystem/waterSupply/facility/user.vue
  36. 0 58
      tests/waterFacilityImportCoordinates.test.mjs
  37. 6 7
      tests/waterFacilityStatistics.test.mjs
  38. 0 59
      tests/waterPipeNetworkStatusThreeValues.test.mjs
  39. 47 0
      tests/waterPipeNetworkStatusTwoValues.test.mjs

+ 0 - 81
src/api/drainage.js

@@ -23,87 +23,6 @@ export function batchDeletePartition(ids) {
   return request({ url: '/api/drainage/partition/batch', method: 'delete', data: ids })
 }
 
-// ============ 排水管网(pipe_network_base,后端强制 network_type=1) ============
-export function getDrainagePipeNetworkPage(pageNum, pageSize, params = {}) {
-  return request({
-    url: '/api/drainage/pipeNetworkBase/page',
-    method: 'get',
-    params: { pageNum, pageSize, ...params }
-  })
-}
-
-// 地图数据:与分页查询同一套筛选条件,不分页,仅返回起终点带坐标的记录
-export function getDrainagePipeNetworkMap(params = {}) {
-  return request({
-    url: '/api/drainage/pipeNetworkBase/map',
-    method: 'get',
-    params,
-    headers: { 'X-Silent-Error': 'true' }
-  })
-}
-
-export function getDrainagePipeNetworkDetail(id) {
-  return request({
-    url: '/api/drainage/pipeNetworkBase/' + id,
-    method: 'get',
-    headers: { 'X-Silent-Error': 'true' }
-  })
-}
-
-// 筛选下拉项:材质、管养单位去重值
-export function getDrainagePipeNetworkFilterOptions() {
-  return request({
-    url: '/api/drainage/pipeNetworkBase/filterOptions',
-    method: 'get',
-    headers: { 'X-Silent-Error': 'true' }
-  })
-}
-
-// ============ 工程设施(闸门 / 调蓄设施 / 泵站) ============
-export function getFacilityPage(pageNum, pageSize, params = {}) {
-  return request({ url: '/api/drainage/facility/page', method: 'get', params: { pageNum, pageSize, ...params } })
-}
-
-// 地图数据:与分页查询同一套筛选条件,不分页,仅返回带坐标的记录
-export function getFacilityMap(params = {}) {
-  return request({
-    url: '/api/drainage/facility/map',
-    method: 'get',
-    params,
-    headers: { 'X-Silent-Error': 'true' }
-  })
-}
-
-export function getFacilityDetail(id) {
-  return request({
-    url: '/api/drainage/facility/' + id,
-    method: 'get',
-    headers: { 'X-Silent-Error': 'true' }
-  })
-}
-
-// 筛选下拉项:设施类型、等级、管理单位、状态去重值
-export function getFacilityFilterOptions() {
-  return request({
-    url: '/api/drainage/facility/filterOptions',
-    method: 'get',
-    headers: { 'X-Silent-Error': 'true' }
-  })
-}
-
-export function addFacility(data) {
-  return request({ url: '/api/drainage/facility', method: 'post', data })
-}
-export function updateFacility(data) {
-  return request({ url: '/api/drainage/facility', method: 'put', data })
-}
-export function deleteFacility(id) {
-  return request({ url: '/api/drainage/facility/' + id, method: 'delete' })
-}
-export function batchDeleteFacility(ids) {
-  return request({ url: '/api/drainage/facility/batch', method: 'delete', data: ids })
-}
-
 // ============ 易积水点 ============
 export function getWaterloggingPage(pageNum, pageSize, params = {}) {
   return request({ url: '/api/drainage/waterlogging/page', method: 'get', params: { pageNum, pageSize, ...params } })

+ 0 - 23
src/api/pipeNetwork/basic.js

@@ -1,28 +1,5 @@
 import request from '@/utils/request'
 
-// ============ 燃气管网基础数据 ============
-export function getPipeNetworkPage(pageNum, pageSize, params) {
-  return request({ url: '/api/pipe-network/findByPage', method: 'get', params: { pageNum, pageSize, ...params } })
-}
-export function getPipeNetworkById(id) {
-  return request({ url: '/api/pipe-network/getById/' + id, method: 'get' })
-}
-export function getPipeNetworkOptions() {
-  return request({ url: '/api/pipe-network/options', method: 'get' })
-}
-export function addPipeNetwork(data) {
-  return request({ url: '/api/pipe-network/save', method: 'post', data })
-}
-export function updatePipeNetwork(data) {
-  return request({ url: '/api/pipe-network/updateById', method: 'put', data })
-}
-export function deletePipeNetwork(id) {
-  return request({ url: '/api/pipe-network/deleteById', method: 'delete', params: { id } })
-}
-export function exportPipeNetwork(params) {
-  return request({ url: '/api/pipe-network/export', method: 'get', params, responseType: 'blob' })
-}
-
 // ============ 井盖监测设备阈值 ============
 // 窨井设备统计:区域分布(数量/占比)+ 类型分布(数量/占比)
 export function getManholeDeviceStatistics(data) {

+ 127 - 0
src/api/pipeNetwork/facilities.js

@@ -0,0 +1,127 @@
+import request from '@/utils/request'
+
+// ============================================================
+// 基础设施信息(管网基础设施信息 menu_id=2070)
+// 页面目录:src/views/subSystem/pipeNetwork/facilities/
+// 对应表:manhole_info / pump_station_info / water_fire_hydrant_info
+//        / drainage_gate_info / drainage_storage_info
+// ============================================================
+
+// ============ 窨井信息(app_user.manhole_info) ============
+export function listManholeInfo(params) {
+  return request({ url: '/api/manhole-info/findByPage', method: 'get', params })
+}
+export function getManholeInfo(id) {
+  return request({ url: '/api/manhole-info/getById/' + id, method: 'get' })
+}
+export function addManholeInfo(data) {
+  return request({ url: '/api/manhole-info/save', method: 'post', data })
+}
+export function updateManholeInfo(data) {
+  return request({ url: '/api/manhole-info/updateById', method: 'put', data })
+}
+export function delManholeInfo(id) {
+  return request({ url: '/api/manhole-info/deleteById', method: 'delete', params: { id } })
+}
+
+// 窨井-设备绑定(manhole_device_rel,仅窨井设备大类 parent_id=4)
+// 搜索可绑定设备(已按 parent_id=4 限制)
+export function searchManholeBindDevices(params) {
+  return request({ url: '/manhole/device/rel/search', method: 'get', params })
+}
+// 查询某窨井已绑定的设备(返回 equipmentCode / equipmentName)
+export function listManholeBoundDevices(manholeId) {
+  return request({ url: '/manhole/device/rel/list/' + manholeId, method: 'get' })
+}
+// 查询所有已绑定窨井的设备(一个设备只能绑定一个窨井)
+export function listManholeBoundEquipmentIds() {
+  return request({ url: '/manhole/device/rel/boundEquipmentIds', method: 'get' })
+}
+// 绑定设备
+export function bindManholeDevice(manholeId, equipmentId) {
+  return request({ url: '/manhole/device/rel/save', method: 'post', data: { manholeId, equipmentId } })
+}
+// 解绑设备
+export function unbindManholeDevice(relId) {
+  return request({ url: '/manhole/device/rel/delete', method: 'delete', params: { relId } })
+}
+
+// ============ 供水消火栓信息(app_user.water_fire_hydrant_info) ============
+export function listFireHydrant(params) {
+  return request({ url: '/api/water/fireHydrant/page', method: 'get', params })
+}
+export function getFireHydrant(id) {
+  return request({ url: '/api/water/fireHydrant/' + id, method: 'get' })
+}
+export function addFireHydrant(data) {
+  return request({ url: '/api/water/fireHydrant', method: 'post', data })
+}
+export function updateFireHydrant(data) {
+  return request({ url: '/api/water/fireHydrant', method: 'put', data })
+}
+export function delFireHydrant(ids) {
+  return request({ url: '/api/water/fireHydrant/batch', method: 'delete', data: ids })
+}
+
+// ============ 排水闸门 / 排水调蓄设施 ============
+// 两张表(drainage_gate_info / drainage_storage_info)共用同一套 CRUD 端点,
+// 仅 URL 前缀不同,用工厂生成避免重复代码。
+function createDrainageFacilityApi(base) {
+  return {
+    page: (params) => request({ url: base + '/page', method: 'get', params }),
+    get: (id) => request({ url: base + '/' + id, method: 'get' }),
+    add: (data) => request({ url: base, method: 'post', data }),
+    update: (data) => request({ url: base, method: 'put', data }),
+    remove: (id) => request({ url: base + '/' + id, method: 'delete' })
+  }
+}
+
+const gateApi = createDrainageFacilityApi('/api/drainage/gate')
+const storageApi = createDrainageFacilityApi('/api/drainage/storage')
+
+export const listDrainageGate = gateApi.page
+export const getDrainageGate = gateApi.get
+export const addDrainageGate = gateApi.add
+export const updateDrainageGate = gateApi.update
+export const delDrainageGate = gateApi.remove
+
+export const listDrainageStorage = storageApi.page
+export const getDrainageStorage = storageApi.get
+export const addDrainageStorage = storageApi.add
+export const updateDrainageStorage = storageApi.update
+export const delDrainageStorage = storageApi.remove
+
+// ============ 泵站(app_user.pump_station_info,供排水共用,station_type 区分) ============
+// 供水入口:/api/water/pumpStation(归属门禁 station_type = water_supply)
+export function listWaterPumpStation(params) {
+  return request({ url: '/api/water/pumpStation/page', method: 'get', params })
+}
+export function getWaterPumpStation(id) {
+  return request({ url: '/api/water/pumpStation/' + id, method: 'get' })
+}
+export function addWaterPumpStation(data) {
+  return request({ url: '/api/water/pumpStation', method: 'post', data })
+}
+export function updateWaterPumpStation(data) {
+  return request({ url: '/api/water/pumpStation', method: 'put', data })
+}
+export function delWaterPumpStation(ids) {
+  return request({ url: '/api/water/pumpStation/' + ids, method: 'delete' })
+}
+
+// 排水入口:/api/drainage/pumpStation(归属门禁 station_type = drainage)
+export function listDrainagePumpStation(params) {
+  return request({ url: '/api/drainage/pumpStation/page', method: 'get', params })
+}
+export function getDrainagePumpStation(id) {
+  return request({ url: '/api/drainage/pumpStation/' + id, method: 'get' })
+}
+export function addDrainagePumpStation(data) {
+  return request({ url: '/api/drainage/pumpStation', method: 'post', data })
+}
+export function updateDrainagePumpStation(data) {
+  return request({ url: '/api/drainage/pumpStation', method: 'put', data })
+}
+export function delDrainagePumpStation(ids) {
+  return request({ url: '/api/drainage/pumpStation/' + ids, method: 'delete' })
+}

+ 0 - 53
src/api/pipeNetwork/pipeInfo.js

@@ -1,53 +0,0 @@
-import request from '@/utils/request'
-
-// pipe_network_base 统一管网表接口(设施类型:2-供水设施)
-const basePrefix = '/PipeNetworkBase'
-const WATER_NETWORK_TYPE = '2'
-
-export function listPipeInfo(query) {
-  return request({
-    url: basePrefix + '/findByPage',
-    method: 'get',
-    params: { networkType: WATER_NETWORK_TYPE, ...query }
-  })
-}
-
-export function getPipeInfo(id) {
-  return request({
-    url: basePrefix + '/getById/' + id,
-    method: 'get'
-  })
-}
-
-export function addPipeInfo(data) {
-  return request({
-    url: basePrefix + '/save',
-    method: 'post',
-    data: data
-  })
-}
-
-export function updatePipeInfo(data) {
-  return request({
-    url: basePrefix + '/updateById',
-    method: 'put',
-    data: data
-  })
-}
-
-export function delPipeInfo(ids) {
-  return request({
-    url: basePrefix + '/deleteBatchById',
-    method: 'delete',
-    params: { ids: ids }
-  })
-}
-
-export function exportPipeInfo(query) {
-  return request({
-    url: basePrefix + '/export',
-    method: 'get',
-    params: { networkType: WATER_NETWORK_TYPE, ...query },
-    responseType: 'blob'
-  })
-}

+ 0 - 63
src/api/pipeNetwork/waterPumpStation.js

@@ -1,63 +0,0 @@
-import request from '@/utils/request'
-
-const urlPrefix = '/api/water/pumpStation'
-
-export function listPumpStation(query) {
-  return request({
-    url: urlPrefix + '/page',
-    method: 'get',
-    params: query
-  })
-}
-
-export function getPumpStation(id) {
-  return request({
-    url: urlPrefix + '/' + id,
-    method: 'get'
-  })
-}
-
-export function addPumpStation(data) {
-  return request({
-    url: urlPrefix,
-    method: 'post',
-    data: data
-  })
-}
-
-export function updatePumpStation(data) {
-  return request({
-    url: urlPrefix,
-    method: 'put',
-    data: data
-  })
-}
-
-export function delPumpStation(ids) {
-  return request({
-    url: urlPrefix + '/' + ids,
-    method: 'delete'
-  })
-}
-
-export function listRecyclePumpStation(query) {
-  return request({
-    url: urlPrefix + '/recycle/list',
-    method: 'get',
-    params: query
-  })
-}
-
-export function restorePumpStation(ids) {
-  return request({
-    url: urlPrefix + '/recycle/restore/' + ids,
-    method: 'post'
-  })
-}
-
-export function deletePhysicallyPumpStation(ids) {
-  return request({
-    url: urlPrefix + '/recycle/delete/' + ids,
-    method: 'delete'
-  })
-}

+ 0 - 1
src/api/pipeNetwork/waterSupply.js

@@ -33,5 +33,4 @@ export const getDeviceGisDetail = (id) => get(`/waterSupply/device/gis/detail/${
 // 供水设施基础信息批量导出(后端 WaterFacilityExportController)
 export const exportWaterSource = (params) => request({ url: '/api/water/sourceInfo/export', method: 'get', params, responseType: 'blob' })
 export const exportWaterPlant = (params) => request({ url: '/api/water/plantInfo/export', method: 'get', params, responseType: 'blob' })
-export const exportWaterPumpStation = (params) => request({ url: '/api/water/pumpStation/export', method: 'get', params, responseType: 'blob' })
 export const exportWaterUser = (params) => request({ url: '/api/water/userInfo/export', method: 'get', params, responseType: 'blob' })

+ 1 - 1
src/utils/waterFacilityGisModel.js

@@ -150,7 +150,7 @@ const facilityStatusLabels = {
   source: { 0: '正常', 1: '异常' },
   plant: { 0: '正常', 1: '停产' },
   pumpStation: { 0: '正常', 1: '故障停运', 2: '检修中' },
-  pipe: { 0: '正常', 1: '维护中', 2: '异常' },
+  pipe: { 0: '正常', 1: '异常' },
   user: { 0: '正常', 1: '欠费', 2: '停用' }
 }
 

+ 3 - 3
src/utils/waterFacilityStatisticsModel.js

@@ -2,8 +2,8 @@ export const FACILITY_STATUS_LABELS = {
   source: { '0': '正常', '1': '异常' },
   plant: { '0': '正常', '1': '停产' },
   pumpStation: { '0': '正常', '1': '故障停运', '2': '检修中' },
-  // 管网状态以当前数据库口径为准:0-正常 / 1-维护中 / 2-异常(#55)
-  pipe: { '0': '正常', '1': '维护中', '2': '异常' },
+  // 管网状态与其他设施统一:0-正常 / 1-异常
+  pipe: { '0': '正常', '1': '异常' },
   user: { '0': '正常', '1': '欠费', '2': '停用' }
 }
 
@@ -35,7 +35,7 @@ export const FACILITY_STATUS_TAG_TYPES = {
   source: { '0': 'success', '1': 'danger' },
   plant: { '0': 'success', '1': 'danger' },
   pumpStation: { '0': 'success', '1': 'danger', '2': 'warning' },
-  pipe: { '0': 'success', '1': 'warning', '2': 'danger' },
+  pipe: { '0': 'success', '1': 'danger' },
   user: { '0': 'success', '1': 'warning', '2': 'danger' }
 }
 

+ 0 - 365
src/views/subSystem/basic/PipeNetwork.vue

@@ -1,365 +0,0 @@
-<template>
-  <div class="app-container">
-    <!-- 燃气GIS一张图:自「燃气GIS图」页面复制至本页上半部分,数据同源 pipe_network_base(network_type=0) -->
-    <el-card shadow="never" class="gis-card">
-      <template #header>
-        <div class="gis-card-header">
-          <div class="gis-title">
-            <el-icon><MapLocation /></el-icon>
-            <span>燃气管网GIS一张图</span>
-            <span class="gis-stats">管线 {{ pipelineCount }} 段 / 总长度 {{ pipelineTotalLength }} km</span>
-          </div>
-          <el-button size="small" type="primary" plain :icon="Refresh" :loading="gisLoading" @click="loadPipelines">刷新地图</el-button>
-        </div>
-      </template>
-      <div class="gis-map-wrapper">
-        <GisMapCanvas ref="mapRef" :lines="visibleLines" :center="mapCenter" :zoom="14" :show-marker-name="false"
-          :enable-clustering="false" @line-click="showLineDetail" @error="gisError = $event" />
-        <div v-if="!gisLoading && !visibleLines.length" class="empty-map">暂无带起止坐标的燃气管线数据</div>
-        <div class="map-toolbar">
-          <el-button-group>
-            <el-button size="small" :icon="ZoomIn" @click="zoomIn">放大</el-button>
-            <el-button size="small" :icon="ZoomOut" @click="zoomOut">缩小</el-button>
-            <el-button size="small" :icon="Location" @click="fitBounds">全图</el-button>
-          </el-button-group>
-        </div>
-        <el-alert v-if="gisError" class="gis-error-alert" :title="gisError" type="warning" :closable="false" show-icon />
-      </div>
-    </el-card>
-
-    <!-- 查询条件 -->
-    <el-form ref="queryRef" :model="searchForm" :inline="true" v-show="showSearch" label-width="80px">
-      <el-form-item label="设施名称" prop="networkName">
-        <el-input v-model="searchForm.networkName" placeholder="请输入设施名称" clearable style="width: 180px"
-          @keyup.enter="handleSearch" />
-      </el-form-item>
-      <el-form-item label="管养单位" prop="managementUnit">
-        <el-input v-model="searchForm.managementUnit" placeholder="请输入管养单位" clearable style="width: 180px"
-          @keyup.enter="handleSearch" />
-      </el-form-item>
-      <el-form-item label="等级" prop="networkLevel">
-        <el-select v-model="searchForm.networkLevel" placeholder="请选择" clearable style="width: 160px">
-          <el-option v-for="d in pipeNetworkLevelDict" :key="d.dictValue" :label="d.dictLabel" :value="d.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="材质" prop="material">
-        <el-input v-model="searchForm.material" placeholder="请输入材质" clearable style="width: 160px"
-          @keyup.enter="handleSearch" />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="searchForm.status" placeholder="请选择" clearable style="width: 160px">
-          <el-option v-for="d in pipeNetworkStatusDict" :key="d.dictValue" :label="d.dictLabel" :value="d.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="Search" @click="handleSearch">搜索</el-button>
-        <el-button icon="Refresh" @click="handleReset">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <!-- 操作栏 -->
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
-      </el-col>
-      <right-toolbar v-model:showSearch="showSearch" @queryTable="loadData"></right-toolbar>
-    </el-row>
-
-    <!-- 管网清单 -->
-    <el-table ref="tableRef" v-loading="loading" :data="tableData" row-key="networkId" style="width: 100%"
-      @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="50" align="center" />
-      <el-table-column prop="networkCode" label="设施编码" min-width="120" show-overflow-tooltip />
-      <el-table-column prop="networkName" label="设施名称" min-width="150" show-overflow-tooltip />
-      <el-table-column prop="networkType" label="设施类型" width="100" align="center">
-        <template #default="{ row }">{{ getDictLabel(pipeNetworkTypeDict, row.networkType) }}</template>
-      </el-table-column>
-      <el-table-column prop="networkLevel" label="等级" width="90" align="center">
-        <template #default="{ row }">{{ getDictLabel(pipeNetworkLevelDict, row.networkLevel) }}</template>
-      </el-table-column>
-      <el-table-column prop="managementUnit" label="管养单位" min-width="150" show-overflow-tooltip />
-      <el-table-column prop="material" label="材质" width="100" align="center" />
-      <el-table-column prop="length" label="长度(m)" width="100" align="right" />
-      <el-table-column prop="diameter" label="管径(mm)" width="110" align="right" />
-      <el-table-column prop="location" label="位置" min-width="180" show-overflow-tooltip />
-      <el-table-column prop="buildDate" label="建设日期" width="120" align="center" />
-      <el-table-column label="状态" width="90" align="center">
-        <template #default="{ row }">
-          <el-tag size="small" :type="statusTagType(row.status)">
-            {{ getDictLabel(pipeNetworkStatusDict, row.status) }}
-          </el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" width="90" align="center" fixed="right">
-        <template #default="{ row }">
-          <el-button link type="primary" icon="View" @click="handleDetail(row)">详情</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination v-show="total > 0" :total="total" v-model:page="pageNum" v-model:limit="pageSize"
-      @pagination="loadData" />
-
-    <!-- 详情 -->
-    <el-drawer v-model="detailVisible" title="管网详情" size="640px" append-to-body destroy-on-close>
-      <el-descriptions :column="2" border>
-        <el-descriptions-item label="设施编码">{{ detailData.networkCode || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="设施名称">{{ detailData.networkName || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="设施类型">
-          {{ getDictLabel(pipeNetworkTypeDict, detailData.networkType) || '-' }}
-        </el-descriptions-item>
-        <el-descriptions-item label="等级">
-          {{ getDictLabel(pipeNetworkLevelDict, detailData.networkLevel) || '-' }}
-        </el-descriptions-item>
-        <el-descriptions-item label="管养单位">{{ detailData.managementUnit || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="材质">{{ detailData.material || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="长度(m)">{{ detailData.length ?? '-' }}</el-descriptions-item>
-        <el-descriptions-item label="管径(mm)">{{ detailData.diameter ?? '-' }}</el-descriptions-item>
-        <el-descriptions-item label="建设日期">{{ detailData.buildDate || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="状态">
-          <el-tag size="small" :type="statusTagType(detailData.status)">
-            {{ getDictLabel(pipeNetworkStatusDict, detailData.status) || '-' }}
-          </el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="位置" :span="2">{{ detailData.location || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="起点经度">{{ detailData.startLongitude ?? '-' }}</el-descriptions-item>
-        <el-descriptions-item label="起点纬度">{{ detailData.startLatitude ?? '-' }}</el-descriptions-item>
-        <el-descriptions-item label="终点经度">{{ detailData.endLongitude ?? '-' }}</el-descriptions-item>
-        <el-descriptions-item label="终点纬度">{{ detailData.endLatitude ?? '-' }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ detailData.remark || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间" :span="2">{{ detailData.createTime || '-' }}</el-descriptions-item>
-      </el-descriptions>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button @click="detailVisible = false">关 闭</el-button>
-        </div>
-      </template>
-    </el-drawer>
-    <!-- GIS管线详情(点击地图管线弹出,与列表详情抽屉独立) -->
-    <el-drawer v-model="lineDrawerVisible" :title="`管线详情 - ${currentLine?.name || ''}`" size="420px" direction="rtl" append-to-body>
-      <el-descriptions v-if="currentLine" :column="1" border size="small">
-        <el-descriptions-item label="设施名称">{{ currentLine.name || '—' }}</el-descriptions-item>
-        <el-descriptions-item label="设施编号">{{ currentLine.code || '—' }}</el-descriptions-item>
-        <el-descriptions-item label="设施类型">燃气设施(0)</el-descriptions-item>
-        <el-descriptions-item label="管网等级">{{ currentLine.level || '—' }}</el-descriptions-item>
-        <el-descriptions-item label="管径">{{ currentLine.diameter || '—' }} mm</el-descriptions-item>
-        <el-descriptions-item label="材质">{{ currentLine.material || '—' }}</el-descriptions-item>
-        <el-descriptions-item label="长度">{{ currentLine.length || '—' }} m</el-descriptions-item>
-        <el-descriptions-item label="位置描述">{{ currentLine.location || '—' }}</el-descriptions-item>
-      </el-descriptions>
-    </el-drawer>
-  </div>
-</template>
-
-<script setup>
-import { ref, reactive, computed, onMounted } from 'vue'
-import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'
-import { MapLocation, Refresh, ZoomIn, ZoomOut, Location } from '@element-plus/icons-vue'
-import { getPipeNetworkPage, exportPipeNetwork, getGisPipeLines } from '@/api/pipeNetwork/basic'
-import { getDicts } from '@/api/system/dict/data'
-import { saveAs } from 'file-saver'
-import GisMapCanvas from '@/components/GisMapCanvas.vue'
-
-defineOptions({ name: 'GasPipeNetwork' })
-
-/* ============ 上半部分:燃气GIS一张图(复制自「燃气GIS图」页面 gasPipelintNet.vue) ============ */
-const mapRef = ref(null)
-const gisLoading = ref(false)
-const gisError = ref('')
-const visibleLayers = ref(['highPressure', 'mediumPressure', 'lowPressure', 'other'])
-const pipelines = ref([])
-const currentLine = ref(null)
-const lineDrawerVisible = ref(false)
-const mapCenter = ref({ lng: 110.3965, lat: 28.4638 })
-
-function normalizeLevel(value) {
-  const text = String(value || '').trim().toLowerCase()
-  if (text.includes('高') || text.includes('high')) return { key: 'highPressure', name: '高压' }
-  if (text.includes('中') || text.includes('medium')) return { key: 'mediumPressure', name: '中压' }
-  if (text.includes('低') || text.includes('low')) return { key: 'lowPressure', name: '低压' }
-  return { key: 'other', name: value || '未分级' }
-}
-
-function normalizeFeature(feature) {
-  const p = feature?.properties || {}
-  const geometry = feature?.geometry
-  const coordinates = geometry?.type === 'LineString' ? geometry.coordinates : []
-  const start = coordinates[0] || [p.startLongitude, p.startLatitude]
-  const end = coordinates[coordinates.length - 1] || [p.endLongitude, p.endLatitude]
-  const points = [start, end].map(item => ({ lng: Number(item?.[0]), lat: Number(item?.[1]) }))
-    .filter(item => Number.isFinite(item.lng) && Number.isFinite(item.lat))
-  if (points.length < 2) return null
-  const level = normalizeLevel(p.networkLevel)
-  return {
-    id: p.networkId,
-    code: p.networkCode,
-    name: p.networkName || p.networkCode || p.networkId,
-    level: level.name,
-    layer: level.key,
-    material: p.material,
-    diameter: p.diameter,
-    length: p.length,
-    location: p.location,
-    points,
-    color: level.key === 'highPressure' ? '#e34d59' : level.key === 'mediumPressure' ? '#e6a23c' : level.key === 'lowPressure' ? '#32a852' : '#409eff',
-    strokeWeight: level.key === 'highPressure' ? 6 : 5,
-    strokeOpacity: 0.9
-  }
-}
-
-async function loadPipelines() {
-  gisLoading.value = true
-  gisError.value = ''
-  try {
-    const response = await getGisPipeLines({ networkType: '0' })
-    const features = Array.isArray(response?.data?.features) ? response.data.features : []
-    pipelines.value = features.map(normalizeFeature).filter(Boolean)
-    const firstPoint = pipelines.value[0]?.points?.[0]
-    if (firstPoint) mapCenter.value = firstPoint
-    fitBounds()
-  } catch (error) {
-    pipelines.value = []
-    gisError.value = '燃气管网数据加载失败,请检查服务或网络。'
-    ElMessage.error(gisError.value)
-  } finally {
-    gisLoading.value = false
-  }
-}
-
-const visibleLines = computed(() => pipelines.value.filter(item => visibleLayers.value.includes(item.layer)))
-const pipelineCount = computed(() => pipelines.value.length)
-const pipelineTotalLength = computed(() => (pipelines.value.reduce((sum, item) => sum + (Number(item.length) || 0), 0) / 1000).toFixed(2))
-
-function showLineDetail(line) { currentLine.value = line; lineDrawerVisible.value = true }
-function fitBounds() { mapRef.value?.fitBounds?.() }
-function zoomIn() { mapRef.value?.zoomIn?.() }
-function zoomOut() { mapRef.value?.zoomOut?.() }
-
-/* ============ 下半部分:管网数据列表(原有功能保持不变) ============ */
-const loading = ref(false)
-const showSearch = ref(true)
-const tableData = ref([])
-const pageNum = ref(1)
-const pageSize = ref(10)
-const total = ref(0)
-const queryRef = ref(null)
-const tableRef = ref(null)
-const selectedIds = ref([])
-
-const searchForm = reactive({
-  networkName: '', managementUnit: '', networkLevel: '', networkType: '', material: '', status: ''
-})
-
-const detailVisible = ref(false)
-const detailData = ref({})
-
-const pipeNetworkStatusDict = ref([])
-const pipeNetworkLevelDict = ref([])
-const pipeNetworkTypeDict = ref([])
-
-function getDictLabel(dict, value) {
-  const item = dict.find(d => d.dictValue === value)
-  return item ? item.dictLabel : value
-}
-
-// 管网状态颜色:0 绿(正常)、1 橙(维护中)、2 红(异常)
-function statusTagType(status) {
-  return { '0': 'success', '1': 'warning', '2': 'danger' }[String(status)] || 'info'
-}
-
-async function loadDicts() {
-  const [statusRes, levelRes, typeRes] = await Promise.all([
-    getDicts('pipe_network_status'),
-    getDicts('pipe_network_level'),
-    getDicts('pipe_network_type')
-  ])
-  pipeNetworkStatusDict.value = statusRes.data
-  pipeNetworkLevelDict.value = levelRes.data
-  pipeNetworkTypeDict.value = typeRes.data
-}
-
-async function loadData() {
-  loading.value = true
-  try {
-    const res = await getPipeNetworkPage(pageNum.value, pageSize.value, searchForm)
-    tableData.value = res.data.records || []
-    total.value = res.data.total || 0
-    // 列表数据变化后清空勾选,避免导出范围与界面不一致
-    tableRef.value?.clearSelection()
-    selectedIds.value = []
-  } catch (e) {
-    console.error(e)
-  } finally {
-    loading.value = false
-  }
-}
-
-function handleSearch() {
-  pageNum.value = 1
-  loadData()
-}
-
-function handleReset() {
-  queryRef.value?.resetFields()
-  Object.assign(searchForm, { networkName: '', managementUnit: '', networkLevel: '', networkType: '', material: '', status: '' })
-  handleSearch()
-}
-
-function handleSelectionChange(selection) {
-  selectedIds.value = selection.map(item => item.networkId)
-}
-
-function handleDetail(row) {
-  detailData.value = { ...row }
-  detailVisible.value = true
-}
-
-async function doExport(networkIds) {
-  const loadingInstance = ElLoading.service({ text: '正在导出数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' })
-  try {
-    const params = { ...searchForm }
-    // 未勾选时不传该参数,避免后端按空主键过滤
-    if (networkIds.length) {
-      params.networkIds = networkIds.join(',')
-    }
-    const blob = await exportPipeNetwork(params)
-    saveAs(new Blob([blob], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }), `燃气管网数据_${new Date().toISOString().slice(0, 10)}.xlsx`)
-    ElMessage.success('导出成功')
-  } catch (e) {
-    console.error(e)
-    ElMessage.error('导出失败,请稍后重试')
-  } finally {
-    loadingInstance.close()
-  }
-}
-
-function handleExport() {
-  const networkIds = selectedIds.value
-  const tip = networkIds.length
-    ? `是否确认导出选中的 ${networkIds.length} 条数据项?`
-    : '当前未勾选数据,是否确认导出所有符合条件的数据项?'
-  ElMessageBox.confirm(tip, '提示', {
-    type: 'warning',
-    confirmButtonText: '确定',
-    cancelButtonText: '取消'
-  }).then(() => doExport(networkIds)).catch(() => {})
-}
-
-onMounted(async () => { loadPipelines(); await loadDicts(); loadData() })
-</script>
-
-<style scoped>
-/* ============ 上半部分:GIS 一张图。浮动面板层级遵守 850~950,不盖缩放控件与抽屉 ============ */
-.gis-card { margin-bottom: 12px; }
-.gis-card-header { display: flex; justify-content: space-between; align-items: center; }
-.gis-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #1f2d3d; font-size: 15px; }
-.gis-stats { font-weight: normal; font-size: 13px; color: #909399; margin-left: 8px; }
-.gis-map-wrapper { position: relative; height: 46vh; min-height: 360px; }
-.map-toolbar { position: absolute; top: 12px; right: 12px; z-index: 900; }
-.empty-map { position: absolute; inset: 0; z-index: 900; display: grid; place-items: center; color: #909399; background: rgba(255, 255, 255, 0.6); pointer-events: none; }
-.gis-error-alert { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 920; width: 420px; }
-
-.dialog-footer {
-  text-align: right;
-}
-</style>

+ 0 - 465
src/views/subSystem/basic/pipeInfo/index.vue

@@ -1,465 +0,0 @@
-<template>
-  <div class="water-page facility-page">
-    <div v-if="errorMessage" class="facility-error">
-      <el-alert :title="errorMessage" type="error" show-icon :closable="false" />
-      <el-button type="primary" link size="small" @click="retryRequest">重试</el-button>
-    </div>
-    <!-- 页头 -->
-    <div class="page-heading">
-      <div class="page-title">
-        <span class="page-title-icon"><el-icon><Share /></el-icon></span>
-        <div><h2>管网信息查询</h2><span class="muted">管线档案、属性与状态查询</span></div>
-      </div>
-      <el-button class="heading-refresh" :icon="Refresh" :loading="loading" @click="getList">刷新</el-button>
-    </div>
-    <!-- 筛选卡 -->
-    <el-card shadow="never" class="filter-card">
-      <template #header>
-        <div class="filter-card-header">
-          <div class="card-title"><el-icon><Search /></el-icon><span>筛选</span></div>
-          <div class="card-actions">
-            <el-button type="primary" plain icon="Plus" size="small" @click="handleAdd" v-hasPermi="['waterSupply:pipeInfo:add']">新增</el-button>
-            <el-button type="danger" plain icon="Delete" size="small" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:pipeInfo:remove']">删除</el-button>
-            <el-button type="success" plain icon="Download" size="small" @click="handleExport" v-hasPermi="['waterSupply:waterPipe:export']">导出</el-button>
-            <el-button type="info" plain icon="Upload" size="small" @click="importVisible = true" v-hasPermi="['waterSupply:waterPipe:import']">导入</el-button>
-          </div>
-        </div>
-      </template>
-      <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="78px">
-        <el-form-item label="管网编号" prop="networkCode">
-          <el-input v-model="queryParams.networkCode" placeholder="请输入管网编号" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="管网名称" prop="networkName">
-          <el-input v-model="queryParams.networkName" placeholder="请输入管网名称" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="管道材质" prop="material">
-          <el-select v-model="queryParams.material" placeholder="请选择材质" clearable size="small" style="width: 120px">
-            <el-option label="铸铁" value="铸铁" />
-            <el-option label="PE" value="PE" />
-            <el-option label="钢管" value="钢管" />
-            <el-option label="球墨铸铁" value="球墨铸铁" />
-            <el-option label="PVC" value="PVC" />
-            <el-option label="混凝土" value="混凝土" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="管径(mm)" prop="diameter">
-          <el-input-number v-model="queryParams.diameter" :min="0" :precision="0" controls-position="right" size="small" />
-        </el-form-item>
-        <el-form-item label="建设年份" prop="buildYear">
-          <el-date-picker v-model="queryParams.buildYear" type="year" value-format="YYYY" placeholder="选择年份" size="small" />
-        </el-form-item>
-        <el-form-item label="状态" prop="status">
-          <el-select v-model="queryParams.status" placeholder="管网状态" clearable size="small" style="width: 120px">
-            <el-option
-              v-for="dict in statusDict"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value" 
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="创建时间">
-          <el-date-picker
-            v-model="dateRange"
-            size="small"
-            style="width: 240px"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            type="datetimerange"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
-        </el-form-item>
-      </el-form>
-    </el-card>
-
-    <!-- 表格卡 -->
-    <el-card shadow="never" class="table-card">
-      <template #header>
-        <div class="card-title"><el-icon><List /></el-icon><span>管网清单</span></div>
-      </template>
-      <el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="管网编号" align="center" prop="networkCode" :show-overflow-tooltip="true" min-width="120" />
-        <el-table-column label="管网名称" align="center" prop="networkName" :show-overflow-tooltip="true" min-width="140" />
-        <el-table-column label="等级" align="center" width="90">
-          <template #default="{ row }">{{ dictLabel(levelDict, row.networkLevel) || '-' }}</template>
-        </el-table-column>
-        <el-table-column label="管养单位" align="center" prop="managementUnit" :show-overflow-tooltip="true" min-width="120" />
-        <el-table-column label="管道材质" align="center" prop="material" width="100">
-          <template #default="{ row }">
-            <el-tag :type="materialTagType(row.material)" size="small">{{ row.material || '-' }}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="管径(mm)" align="center" prop="diameter" width="100" />
-        <el-table-column label="长度(m)" align="center" prop="length" width="100" />
-        <el-table-column label="位置描述" align="center" prop="location" :show-overflow-tooltip="true" min-width="140" />
-        <el-table-column label="起点经纬度" align="center" width="170">
-          <template #default="{ row }">{{ formatCoord(row.startLongitude, row.startLatitude) }}</template>
-        </el-table-column>
-        <el-table-column label="终点经纬度" align="center" width="170">
-          <template #default="{ row }">{{ formatCoord(row.endLongitude, row.endLatitude) }}</template>
-        </el-table-column>
-        <el-table-column label="建设日期" align="center" prop="buildDate" width="110" />
-        <el-table-column label="状态" align="center" width="80">
-          <template #default="{ row }">
-            <el-tag 
-              :type="statusTagType(row.status)"
-              size="small"
-            >
-              {{ dictLabel(statusDict, row.status) || '-' }}
-            </el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-        <el-table-column label="操作" align="center" width="168" fixed="right">
-          <template #default="{ row }">
-            <div class="facility-row-actions">
-              <el-tooltip content="查看详情" placement="top"><el-button class="facility-row-action is-detail" aria-label="查看详情" size="small" type="primary" plain circle icon="View" @click="handleDetail(row)" /></el-tooltip>
-              <el-tooltip content="修改信息" placement="top"><el-button class="facility-row-action is-edit" aria-label="修改信息" size="small" type="warning" plain circle icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:pipeInfo:edit']" /></el-tooltip>
-              <el-tooltip content="删除记录" placement="top"><el-button class="facility-row-action is-delete" aria-label="删除记录" size="small" type="danger" plain circle icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:pipeInfo:remove']" /></el-tooltip>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <!-- 分页 -->
-      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
-    </el-card>
-
-    <!-- 新增/修改抽屉 -->
-    <el-drawer :title="dialogTitle" v-model="dialogVisible" class="facility-form-drawer" direction="rtl" size="720px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="108px">
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="管网编号" prop="networkCode">
-              <el-input v-model="form.networkCode" placeholder="请输入管网编号" maxlength="50" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="管网名称" prop="networkName">
-              <el-input v-model="form.networkName" placeholder="请输入管网名称" maxlength="100" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="等级" prop="networkLevel">
-              <el-select v-model="form.networkLevel" placeholder="请选择管网等级" clearable style="width: 100%">
-                <el-option v-for="dict in levelDict" :key="dict.value" :label="dict.label" :value="dict.value" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="管养单位" prop="managementUnit">
-              <el-input v-model="form.managementUnit" placeholder="请输入管养单位" maxlength="100" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="管道材质" prop="material">
-              <el-select v-model="form.material" placeholder="请选择管道材质" style="width: 100%">
-                <el-option label="铸铁" value="铸铁" />
-                <el-option label="PE" value="PE" />
-                <el-option label="钢管" value="钢管" />
-                <el-option label="球墨铸铁" value="球墨铸铁" />
-                <el-option label="PVC" value="PVC" />
-                <el-option label="混凝土" value="混凝土" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="管径(mm)" prop="diameter">
-              <el-input-number v-model="form.diameter" :min="0" :precision="0" style="width: 100%" placeholder="请输入管径" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="管道长度(m)" prop="length">
-              <el-input-number v-model="form.length" :min="0" :precision="2" style="width: 100%" placeholder="请输入管道长度" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="建设日期" prop="buildDate">
-              <el-date-picker v-model="form.buildDate" type="date" placeholder="请选择建设日期" value-format="YYYY-MM-DD" style="width: 100%" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="运行状态" prop="status">
-              <el-radio-group v-model="form.status">
-                <el-radio v-for="dict in statusDict" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="位置描述" prop="location">
-              <el-input v-model="form.location" placeholder="请输入位置描述" maxlength="200" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12"><el-form-item label="起点经度" prop="startLongitude"><el-input-number v-model="form.startLongitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="起点纬度" prop="startLatitude"><el-input-number v-model="form.startLatitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="终点经度" prop="endLongitude"><el-input-number v-model="form.endLongitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="终点纬度" prop="endLatitude"><el-input-number v-model="form.endLatitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="24">
-            <el-form-item label="备注" prop="remark">
-              <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" maxlength="500" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="dialogVisible = false">取 消</el-button>
-      </template>
-    </el-drawer>
-
-    <!-- 详情抽屉 -->
-    <el-drawer title="管网详情" v-model="detailVisible" class="detail-drawer" direction="rtl" size="600px" append-to-body>
-      <el-descriptions :column="2" border>
-        <el-descriptions-item label="管网编号">{{ detailData.networkCode }}</el-descriptions-item>
-        <el-descriptions-item label="管网名称">{{ detailData.networkName }}</el-descriptions-item>
-        <el-descriptions-item label="等级">{{ dictLabel(levelDict, detailData.networkLevel) || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="管养单位">{{ detailData.managementUnit }}</el-descriptions-item>
-        <el-descriptions-item label="管道材质">{{ detailData.material }}</el-descriptions-item>
-        <el-descriptions-item label="管径(mm)">{{ detailData.diameter }}</el-descriptions-item>
-        <el-descriptions-item label="管道长度(m)">{{ detailData.length }}</el-descriptions-item>
-        <el-descriptions-item label="建设日期">{{ detailData.buildDate }}</el-descriptions-item>
-        <el-descriptions-item label="运行状态">
-          <el-tag :type="statusTagType(detailData.status)" size="small">
-            {{ dictLabel(statusDict, detailData.status) || '-' }}
-          </el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="位置描述" :span="2">{{ detailData.location }}</el-descriptions-item>
-        <el-descriptions-item label="起点经度">{{ detailData.startLongitude }}</el-descriptions-item>
-        <el-descriptions-item label="起点纬度">{{ detailData.startLatitude }}</el-descriptions-item>
-        <el-descriptions-item label="终点经度">{{ detailData.endLongitude }}</el-descriptions-item>
-        <el-descriptions-item label="终点纬度">{{ detailData.endLatitude }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ detailData.remark }}</el-descriptions-item>
-        <el-descriptions-item label="创建者">{{ detailData.createBy }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ detailData.createTime }}</el-descriptions-item>
-        <el-descriptions-item label="更新者">{{ detailData.updateBy }}</el-descriptions-item>
-        <el-descriptions-item label="更新时间">{{ detailData.updateTime }}</el-descriptions-item>
-      </el-descriptions>
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
-
-    <WaterFacilityImportDialog v-model="importVisible" title="管网信息" upload-url="/PipeNetworkBase/importData" template-url="/PipeNetworkBase/importTemplate" @imported="getList" />
-  </div>
-</template>
-
-<script>
-import { listPipeInfo, getPipeInfo, addPipeInfo, updatePipeInfo, delPipeInfo, exportPipeInfo } from '@/api/pipeNetwork/pipeInfo'
-import { getDicts } from '@/api/system/dict/data'
-import { saveAs } from 'file-saver'
-import { buildWaterFacilityQuery, getRequestErrorMessage } from '@/utils/waterFacilityQuery'
-import WaterFacilityImportDialog from '@/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue'
-
-export default {
-  name: 'WaterPipeInfo',
-  components: { WaterFacilityImportDialog },
-  data() {
-    return {
-
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 表格数据
-      tableData: [],
-      // 日期范围
-      dateRange: [],
-      // 弹出层标题
-      dialogTitle: '',
-      // 是否显示弹出层
-      dialogVisible: false,
-      // 详情显示
-      detailVisible: false,
-      importVisible: false,
-      // 详情数据
-      detailData: {},
-      errorMessage: '',
-      retryAction: null,
-      // 管网状态字典(pipe_network_status:0正常 1维护中 2异常)
-      statusDict: [],
-      // 管网等级字典(pipe_network_level)
-      levelDict: [],
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        networkCode: undefined,
-        networkName: undefined,
-        material: undefined,
-        diameter: undefined,
-        buildYear: undefined,
-        status: undefined
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        networkCode: [
-          { required: true, message: '管网编号不能为空', trigger: 'blur' }
-        ],
-        networkName: [
-          { required: true, message: '管网名称不能为空', trigger: 'blur' }
-        ],
-        material: [
-          { required: true, message: '请选择管道材质', trigger: 'change' }
-        ]
-      }
-    }
-  },
-  created() {
-    getDicts('pipe_network_status').then(response => {
-      this.statusDict = response.data
-    })
-    getDicts('pipe_network_level').then(response => {
-      this.levelDict = response.data
-    })
-    this.getList()
-  },
-  methods: {
-    /** 查询管网信息列表 */
-    getList() {
-      this.loading = true
-      this.errorMessage = ''
-      this.retryAction = this.getList
-      listPipeInfo(buildWaterFacilityQuery(this.queryParams, this.dateRange)).then(response => {
-        this.tableData = response.records
-        this.total = response.total
-        this.loading = false
-      }).catch(error => {
-        this.loading = false
-        this.errorMessage = getRequestErrorMessage(error, '管网信息查询失败,请稍后重试')
-      })
-    },
-    retryRequest() {
-      if (this.retryAction) this.retryAction()
-    },
-    /** 管道材质标签类型 */
-    materialTagType(material) {
-      const map = { '铸铁': '', 'PE': 'success', '钢管': 'warning', '球墨铸铁': 'info', 'PVC': 'danger', '混凝土': '' }
-      return map[material] || ''
-    },
-    /** 字典标签 */
-    dictLabel(options, value) {
-      const item = (options || []).find(d => String(d.value) === String(value))
-      return item ? item.label : ''
-    },
-    /** 管网状态颜色:0 绿(正常)、1 橙(维护中)、2 红(异常),与统计页口径一致 */
-    statusTagType(status) {
-      const map = { '0': 'success', '1': 'warning', '2': 'danger' }
-      return map[String(status)] || 'info'
-    },
-    /** 经纬度展示 */
-    formatCoord(lon, lat) {
-      if (lon === null || lon === undefined || lat === null || lat === undefined) return '-'
-      return lon + ', ' + lat
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1
-      this.getList()
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.dateRange = []
-      this.resetForm('queryForm')
-      this.handleQuery()
-    },
-    /** 多选框选中数据 */
-    /** 导出当前筛选结果 */
-    handleExport() {
-      this.errorMessage = ''
-      this.retryAction = this.handleExport
-      exportPipeInfo(buildWaterFacilityQuery(this.queryParams, this.dateRange)).then(blob => {
-        saveAs(new Blob([blob]), `管网信息_${new Date().toISOString().slice(0, 10)}.xlsx`)
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '管网信息导出失败,请稍后重试')
-      })
-    },
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.networkId)
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset()
-      this.dialogTitle = '新增管网信息'
-      this.dialogVisible = true
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset()
-      const id = row.networkId || this.ids
-      getPipeInfo(id).then(response => {
-        this.form = response.data
-        this.dialogTitle = '修改管网信息'
-        this.dialogVisible = true
-      })
-    },
-    /** 详情按钮操作 */
-    handleDetail(row) {
-      this.errorMessage = ''
-      this.retryAction = () => this.handleDetail(row)
-      getPipeInfo(row.networkId).then(response => {
-        this.detailData = response.data
-        this.detailVisible = true
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '管网详情查询失败,请稍后重试')
-      })
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs.form.validate(valid => {
-        if (valid) {
-          if (this.form.networkId != undefined) {
-            updatePipeInfo(this.form).then(() => {
-              this.$modal.msgSuccess('修改成功')
-              this.dialogVisible = false
-              this.getList()
-            })
-          } else {
-            addPipeInfo(this.form).then(() => {
-              this.$modal.msgSuccess('新增成功')
-              this.dialogVisible = false
-              this.getList()
-            })
-          }
-        }
-      })
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.networkId ? [row.networkId] : this.ids
-      this.$modal.confirm('是否确认删除管网编号为"' + ids.join(',') + '"的数据项?删除后不可恢复。').then(() => {
-        return delPipeInfo(ids.join(','))
-      }).then(() => {
-        this.getList()
-        this.$modal.msgSuccess('删除成功')
-      }).catch(() => {})
-    },
-    /** 表单重置 */
-    reset() {
-      this.form = {
-        status: '0',
-        networkType: '2'
-      }
-      this.resetForm('form')
-    }
-  }
-}
-</script>
-
-<style scoped lang="scss">
-@use '../../waterSupply/components/waterFacilityPageTheme.scss';
-</style>

+ 0 - 465
src/views/subSystem/basic/pumpStation/index.vue

@@ -1,465 +0,0 @@
-<template>
-  <div class="water-page facility-page">
-    <div v-if="errorMessage" class="facility-error">
-      <el-alert :title="errorMessage" type="error" show-icon :closable="false" />
-      <el-button type="primary" link size="small" @click="retryRequest">重试</el-button>
-    </div>
-    <!-- 页头 -->
-    <div class="page-heading">
-      <div class="page-title">
-        <span class="page-title-icon"><el-icon><Odometer /></el-icon></span>
-        <div><h2>泵站信息查询</h2><span class="muted">泵站档案、能力与运行状态维护</span></div>
-      </div>
-      <el-button class="heading-refresh" :icon="Refresh" :loading="loading" @click="getList">刷新</el-button>
-    </div>
-    <!-- 筛选卡 -->
-    <el-card shadow="never" class="filter-card">
-      <template #header>
-        <div class="filter-card-header">
-          <div class="card-title"><el-icon><Search /></el-icon><span>筛选</span></div>
-          <div class="card-actions">
-            <el-button type="primary" plain icon="Plus" size="small" @click="handleAdd" v-hasPermi="['waterSupply:pumpStation:add']">新增</el-button>
-            <el-button type="danger" plain icon="Delete" size="small" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:pumpStation:remove']">删除</el-button>
-            <el-button type="success" plain icon="Download" size="small" @click="handleExport" v-hasPermi="['waterSupply:waterPumpStation:export']">导出</el-button>
-            <el-button type="info" plain icon="Upload" size="small" @click="importVisible = true" v-hasPermi="['waterSupply:waterPumpStation:import']">导入</el-button>
-          </div>
-        </div>
-      </template>
-      <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="80px">
-        <el-form-item label="泵站编号" prop="stationCode">
-          <el-input v-model="queryParams.stationCode" placeholder="请输入泵站编号" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="泵站名称" prop="stationName">
-          <el-input v-model="queryParams.stationName" placeholder="请输入泵站名称" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="运行状态" prop="status">
-          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" style="width: 120px">
-            <el-option label="正常" value="0" />
-            <el-option label="故障停运" value="1" />
-            <el-option label="检修中" value="2" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="负责人" prop="principal">
-          <el-input v-model="queryParams.principal" placeholder="请输入负责人" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="创建时间">
-          <el-date-picker
-            v-model="dateRange"
-            size="small"
-            style="width: 240px"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            type="datetimerange"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
-        </el-form-item>
-      </el-form>
-    </el-card>
-
-    <!-- 表格卡 -->
-    <el-card shadow="never" class="table-card">
-      <template #header>
-        <div class="card-title"><el-icon><List /></el-icon><span>泵站清单</span></div>
-      </template>
-      <el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
-        <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="泵站编号" align="center" prop="stationCode" :show-overflow-tooltip="true" min-width="120" />
-        <el-table-column label="泵站名称" align="center" prop="stationName" :show-overflow-tooltip="true" min-width="140" />
-        <el-table-column label="泵站地址" align="center" prop="location" :show-overflow-tooltip="true" min-width="160" />
-        <el-table-column label="经度" align="center" prop="longitude" width="120" />
-        <el-table-column label="纬度" align="center" prop="latitude" width="120" />
-        <el-table-column label="水泵数量" align="center" prop="pumpCount" width="90" />
-        <el-table-column label="设计流量(m³/h)" align="center" prop="designFlow" width="130" />
-        <el-table-column label="设计扬程(m)" align="center" prop="designHead" width="110" />
-        <el-table-column label="装机容量(kW)" align="center" prop="powerCapacity" width="120" />
-        <el-table-column label="投运日期" align="center" prop="commissionDate" width="110" />
-        <el-table-column label="运行状态" align="center" width="100">
-          <template #default="{ row }">
-            <el-tag :type="statusTagType(row.status)" size="small">{{ statusLabel(row.status) }}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="负责人" align="center" prop="principal" width="100" />
-        <el-table-column label="联系电话" align="center" prop="contactPhone" width="120" />
-        <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-        <el-table-column label="操作" align="center" width="168" fixed="right">
-          <template #default="{ row }">
-            <div class="facility-row-actions">
-              <el-tooltip content="查看详情" placement="top"><el-button class="facility-row-action is-detail" aria-label="查看详情" size="small" type="primary" plain circle icon="View" @click="handleDetail(row)" /></el-tooltip>
-              <el-tooltip content="修改信息" placement="top"><el-button class="facility-row-action is-edit" aria-label="修改信息" size="small" type="warning" plain circle icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:pumpStation:edit']" /></el-tooltip>
-              <el-tooltip content="删除记录" placement="top"><el-button class="facility-row-action is-delete" aria-label="删除记录" size="small" type="danger" plain circle icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:pumpStation:remove']" /></el-tooltip>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <!-- 分页 -->
-      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
-    </el-card>
-
-    <!-- 新增/修改抽屉 -->
-    <el-drawer :title="dialogTitle" v-model="dialogVisible" class="facility-form-drawer" direction="rtl" size="760px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="泵站编号" prop="stationCode">
-              <el-input v-model="form.stationCode" placeholder="请输入泵站编号" maxlength="50" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="泵站名称" prop="stationName">
-              <el-input v-model="form.stationName" placeholder="请输入泵站名称" maxlength="100" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="泵站地址" prop="location">
-              <el-input v-model="form.location" placeholder="请输入泵站地址" maxlength="200" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12"><el-form-item label="经度" prop="longitude"><el-input-number v-model="form.longitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="纬度" prop="latitude"><el-input-number v-model="form.latitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12">
-            <el-form-item label="水泵数量" prop="pumpCount">
-              <el-input-number v-model="form.pumpCount" :min="0" :precision="0" style="width: 100%" placeholder="请输入水泵数量" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="设计流量(m³/h)" prop="designFlow">
-              <el-input-number v-model="form.designFlow" :min="0" :precision="2" style="width: 100%" placeholder="请输入设计流量" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="设计扬程(m)" prop="designHead">
-              <el-input-number v-model="form.designHead" :min="0" :precision="2" style="width: 100%" placeholder="请输入设计扬程" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="装机容量(kW)" prop="powerCapacity">
-              <el-input-number v-model="form.powerCapacity" :min="0" :precision="2" style="width: 100%" placeholder="请输入装机容量" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="投运日期" prop="commissionDate">
-              <el-date-picker v-model="form.commissionDate" type="date" placeholder="请选择投运日期" value-format="YYYY-MM-DD" style="width: 100%" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="运行状态" prop="status">
-              <el-radio-group v-model="form.status">
-                <el-radio label="0">正常</el-radio>
-                <el-radio label="1">故障停运</el-radio>
-                <el-radio label="2">检修中</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="负责人" prop="principal">
-              <el-input v-model="form.principal" placeholder="请输入负责人" maxlength="50" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="联系电话" prop="contactPhone">
-              <el-input v-model="form.contactPhone" placeholder="请输入联系电话" maxlength="20" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="备注" prop="remark">
-              <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" maxlength="500" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="dialogVisible = false">取 消</el-button>
-      </template>
-    </el-drawer>
-
-    <!-- 详情抽屉 -->
-    <el-drawer title="泵站详情" v-model="detailVisible" class="detail-drawer" direction="rtl" size="650px" append-to-body>
-      <el-descriptions :column="2" border>
-        <el-descriptions-item label="泵站编号">{{ detailData.stationCode }}</el-descriptions-item>
-        <el-descriptions-item label="泵站名称">{{ detailData.stationName }}</el-descriptions-item>
-        <el-descriptions-item label="泵站地址" :span="2">{{ detailData.location }}</el-descriptions-item>
-        <el-descriptions-item label="经度">{{ detailData.longitude }}</el-descriptions-item>
-        <el-descriptions-item label="纬度">{{ detailData.latitude }}</el-descriptions-item>
-        <el-descriptions-item label="水泵数量">{{ detailData.pumpCount }}</el-descriptions-item>
-        <el-descriptions-item label="设计流量(m³/h)">{{ detailData.designFlow }}</el-descriptions-item>
-        <el-descriptions-item label="设计扬程(m)">{{ detailData.designHead }}</el-descriptions-item>
-        <el-descriptions-item label="装机容量(kW)">{{ detailData.powerCapacity }}</el-descriptions-item>
-        <el-descriptions-item label="投运日期">{{ detailData.commissionDate }}</el-descriptions-item>
-        <el-descriptions-item label="运行状态">
-          <el-tag :type="statusTagType(detailData.status)" size="small">{{ statusLabel(detailData.status) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="负责人">{{ detailData.principal }}</el-descriptions-item>
-        <el-descriptions-item label="联系电话">{{ detailData.contactPhone }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ detailData.remark }}</el-descriptions-item>
-        <el-descriptions-item label="创建者">{{ detailData.createBy }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ detailData.createTime }}</el-descriptions-item>
-        <el-descriptions-item label="更新者">{{ detailData.updateBy }}</el-descriptions-item>
-        <el-descriptions-item label="更新时间">{{ detailData.updateTime }}</el-descriptions-item>
-      </el-descriptions>
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
-
-    <WaterFacilityImportDialog v-model="importVisible" title="泵站信息" upload-url="/api/water/pumpStation/importData" template-url="/api/water/pumpStation/importTemplate" @imported="getList" />
-
-    <!-- 回收站对话框 -->
-    <el-dialog title="回收站" v-model="recycleVisible" width="900px" append-to-body>
-      <el-form :model="recycleQuery" ref="recycleForm" :inline="true" size="small">
-        <el-form-item label="泵站编号" prop="stationCode">
-          <el-input v-model="recycleQuery.stationCode" placeholder="请输入编号" clearable />
-        </el-form-item>
-        <el-form-item label="泵站名称" prop="stationName">
-          <el-input v-model="recycleQuery.stationName" placeholder="请输入名称" clearable />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="Search" @click="getRecycleList">搜索</el-button>
-          <el-button icon="Refresh" @click="resetRecycleQuery">重置</el-button>
-        </el-form-item>
-      </el-form>
-      <el-table v-loading="recycleLoading" :data="recycleData" @selection-change="handleRecycleSelectionChange">
-        <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="泵站编号" align="center" prop="stationCode" />
-        <el-table-column label="泵站名称" align="center" prop="stationName" />
-        <el-table-column label="泵站地址" align="center" prop="location" :show-overflow-tooltip="true" />
-        <el-table-column label="负责人" align="center" prop="principal" width="100" />
-        <el-table-column label="运行状态" align="center" width="100">
-          <template #default="{ row }">
-            <el-tag :type="statusTagType(row.status)" size="small">{{ statusLabel(row.status) }}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="删除时间" align="center" prop="updateTime" width="160" />
-        <el-table-column label="操作" align="center" width="150">
-          <template #default="{ row }">
-            <el-button size="small" type="text" icon="RefreshLeft" @click="handleRestore(row)">恢复</el-button>
-            <el-button size="small" type="text" icon="Delete" @click="handleDeletePhysically(row)">
-              <span style="color: #F56C6C">彻底删除</span>
-            </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="recycleTotal > 0" :total="recycleTotal" v-model:page="recycleQuery.pageNum" v-model:limit="recycleQuery.pageSize" @pagination="getRecycleList" />
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { listPumpStation, getPumpStation, addPumpStation, updatePumpStation, delPumpStation, listRecyclePumpStation, restorePumpStation, deletePhysicallyPumpStation } from '@/api/pipeNetwork/waterPumpStation'
-import { saveAs } from 'file-saver'
-import { exportWaterPumpStation } from '@/api/pipeNetwork/waterSupply'
-import { buildWaterFacilityQuery, getRequestErrorMessage } from '@/utils/waterFacilityQuery'
-import WaterFacilityImportDialog from '@/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue'
-
-export default {
-  name: 'WaterPumpStation',
-  components: { WaterFacilityImportDialog },
-  data() {
-    return {
-      loading: true,
-      ids: [],
-      single: true,
-      multiple: true,
-      showSearch: true,
-      total: 0,
-      tableData: [],
-      dateRange: [],
-      dialogTitle: '',
-      dialogVisible: false,
-      detailVisible: false,
-      importVisible: false,
-      detailData: {},
-      recycleVisible: false,
-      recycleLoading: false,
-      recycleData: [],
-      recycleTotal: 0,
-      recycleIds: [],
-      errorMessage: '',
-      retryAction: null,
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        stationCode: undefined,
-        stationName: undefined,
-        status: undefined,
-        principal: undefined
-      },
-      recycleQuery: {
-        pageNum: 1,
-        pageSize: 10,
-        stationCode: undefined,
-        stationName: undefined
-      },
-      form: {},
-      rules: {
-        stationCode: [
-          { required: true, message: '泵站编号不能为空', trigger: 'blur' }
-        ],
-        stationName: [
-          { required: true, message: '泵站名称不能为空', trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  created() {
-    this.getList()
-  },
-  methods: {
-    getList() {
-      this.loading = true
-      this.errorMessage = ''
-      this.retryAction = this.getList
-      listPumpStation(buildWaterFacilityQuery(this.queryParams, this.dateRange)).then(response => {
-        this.tableData = response.data.records
-        this.total = response.data.total
-        this.loading = false
-      }).catch(error => {
-        this.loading = false
-        this.errorMessage = getRequestErrorMessage(error, '泵站信息查询失败,请稍后重试')
-      })
-    },
-    retryRequest() {
-      if (this.retryAction) this.retryAction()
-    },
-    statusTagType(status) {
-      const map = { '0': 'success', '1': 'danger', '2': 'warning' }
-      return map[status] || 'info'
-    },
-    statusLabel(status) {
-      const map = { '0': '正常', '1': '故障停运', '2': '检修中' }
-      return map[status] || '未知'
-    },
-    handleQuery() {
-      this.queryParams.pageNum = 1
-      this.getList()
-    },
-    resetQuery() {
-      this.dateRange = []
-      this.resetForm('queryForm')
-      this.handleQuery()
-    },
-    handleExport() {
-      this.errorMessage = ''
-      this.retryAction = this.handleExport
-      exportWaterPumpStation(buildWaterFacilityQuery(this.queryParams, this.dateRange)).then(blob => {
-        saveAs(new Blob([blob]), `泵站信息_${new Date().toISOString().slice(0, 10)}.xlsx`)
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '泵站信息导出失败,请稍后重试')
-      })
-    },
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length !== 1
-      this.multiple = !selection.length
-    },
-    handleRecycleSelectionChange(selection) {
-      this.recycleIds = selection.map(item => item.id)
-    },
-    handleAdd() {
-      this.reset()
-      this.dialogTitle = '新增泵站信息'
-      this.dialogVisible = true
-    },
-    handleUpdate(row) {
-      this.reset()
-      const id = row.id || this.ids
-      getPumpStation(id).then(response => {
-        this.form = response.data
-        this.dialogTitle = '修改泵站信息'
-        this.dialogVisible = true
-      })
-    },
-    handleDetail(row) {
-      this.errorMessage = ''
-      this.retryAction = () => this.handleDetail(row)
-      getPumpStation(row.id).then(response => {
-        this.detailData = response.data
-        this.detailVisible = true
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '泵站详情查询失败,请稍后重试')
-      })
-    },
-    submitForm() {
-      this.$refs.form.validate(valid => {
-        if (valid) {
-          if (this.form.id != undefined) {
-            updatePumpStation(this.form).then(() => {
-              this.$modal.msgSuccess('修改成功')
-              this.dialogVisible = false
-              this.getList()
-            })
-          } else {
-            addPumpStation(this.form).then(() => {
-              this.$modal.msgSuccess('新增成功')
-              this.dialogVisible = false
-              this.getList()
-            })
-          }
-        }
-      })
-    },
-    handleDelete(row) {
-      const ids = row.id ? [row.id] : this.ids
-      this.$modal.confirm('是否确认删除泵站编号为"' + ids.join(',') + '"的数据项?').then(() => {
-        return delPumpStation(ids.join(','))
-      }).then(() => {
-        this.getList()
-        this.$modal.msgSuccess('删除成功')
-      }).catch(() => {})
-    },
-    handleRecycle() {
-      this.recycleVisible = true
-      this.getRecycleList()
-    },
-    getRecycleList() {
-      this.recycleLoading = true
-      listRecyclePumpStation(this.recycleQuery).then(response => {
-        this.recycleData = response.data.records
-        this.recycleTotal = response.data.total
-        this.recycleLoading = false
-      }).catch(() => {
-        this.recycleLoading = false
-      })
-    },
-    resetRecycleQuery() {
-      this.resetForm('recycleForm')
-      this.getRecycleList()
-    },
-    handleRestore(row) {
-      const ids = row.id || this.recycleIds
-      this.$modal.confirm('是否确认恢复该数据?').then(() => {
-        return restorePumpStation(Array.isArray(ids) ? ids.join(',') : ids)
-      }).then(() => {
-        this.getRecycleList()
-        this.getList()
-        this.$modal.msgSuccess('恢复成功')
-      }).catch(() => {})
-    },
-    handleDeletePhysically(row) {
-      const ids = row.id || this.recycleIds
-      this.$modal.confirm('彻底删除后数据不可恢复,是否继续?').then(() => {
-        return deletePhysicallyPumpStation(Array.isArray(ids) ? ids.join(',') : ids)
-      }).then(() => {
-        this.getRecycleList()
-        this.$modal.msgSuccess('彻底删除成功')
-      }).catch(() => {})
-    },
-    reset() {
-      this.form = {
-        status: '0'
-      }
-      this.resetForm('form')
-    }
-  }
-}
-</script>
-
-<style scoped lang="scss">
-@use '../../waterSupply/components/waterFacilityPageTheme.scss';
-</style>

+ 25 - 29
src/views/subSystem/drainage/jcsj/bzyxqk.vue

@@ -5,7 +5,7 @@
       <div class="page-head-text">
         <div class="page-title">泵站运行情况GIS一张图</div>
         <div class="page-sub">
-          泵站 {{ total }} 座 · 正常 {{ normal }} · 检修 {{ repair }} · 停用 {{ stopped }} · 故障 {{ fault }}<span
+          泵站 {{ total }} 座 · 正常 {{ normal }} · 检修 {{ repair }} · 故障 {{ fault }}<span
             v-if="unlocatedCount"> · 未维护坐标 {{ unlocatedCount }} 座</span>
         </div>
       </div>
@@ -47,26 +47,24 @@ import { ref, reactive, computed, watch, onMounted, onUnmounted } from 'vue'
 import { ensureTdtMap } from '@/utils/mapApi'
 import { useDict } from '@/utils/dict'
 import { gisPointStatusColors, gisPointStatusIcons } from '@/utils/gisMapColors'
-import { getFacilityPage } from '@/api/drainage'
+import { listDrainagePumpStation } from '@/api/pipeNetwork/facilities'
 
 // ==================== 泵站状态口径 ====================
-// 泵站台账 = 工程设施表中 facility_type=2 的记录,状态走字典 drainage_facility_status
-// (0 正常 / 1 检修 / 2 停用 / 3 故障),颜色与图标复用全局 GIS 状态色
+// 泵站台账 = pump_station_info 中 station_type=drainage 的记录(后端门禁保证)。
+// 状态走泵站自身口径 0正常 / 1故障 / 2检修,映射为全局 GIS 状态色。
 const STATUS_FALLBACK = [
   { value: '0', label: '正常' },
-  { value: '1', label: '检修' },
-  { value: '2', label: '停用' },
-  { value: '3', label: '故障' }
+  { value: '1', label: '故障' },
+  { value: '2', label: '检修' }
 ]
 
 const STATUS_KEY_MAP = {
   '0': 'normal', // 绿
-  '1': 'workOrder', // 蓝
-  '2': 'offline', // 灰
-  '3': 'alarm' // 红
+  '1': 'alarm', // 红(故障)
+  '2': 'workOrder' // 蓝(检修)
 }
 
-const { drainage_facility_status: facilityStatusDict } = useDict('drainage_facility_status')
+const { infrastructure_status: facilityStatusDict } = useDict('infrastructure_status')
 
 const statusOptions = computed(() => (facilityStatusDict.value?.length ? facilityStatusDict.value : STATUS_FALLBACK))
 
@@ -86,19 +84,17 @@ const unlocatedCount = computed(() => pumpList.value.filter(p => !p.located).len
 const total = computed(() => pumpList.value.length)
 const normal = computed(() => pumpList.value.filter(p => p.statusKey === 'normal').length)
 const repair = computed(() => pumpList.value.filter(p => p.statusKey === 'workOrder').length)
-const stopped = computed(() => pumpList.value.filter(p => p.statusKey === 'offline').length)
 const fault = computed(() => pumpList.value.filter(p => p.statusKey === 'alarm').length)
 
 // 地图状态图例:颜色与标记图标同源,数量按当前台账实时统计
 const mapLegend = computed(() => [
   { key: 'normal', text: '正常', color: gisPointStatusColors.normal, count: normal.value },
   { key: 'workOrder', text: '检修', color: gisPointStatusColors.workOrder, count: repair.value },
-  { key: 'offline', text: '停用', color: gisPointStatusColors.offline, count: stopped.value },
   { key: 'alarm', text: '故障', color: gisPointStatusColors.alarm, count: fault.value }
 ])
 
 // 图例开关:点某一行可临时隐藏该状态,仅影响地图显示,不影响统计口径
-const legendVisible = reactive({ normal: true, workOrder: true, offline: true, alarm: true })
+const legendVisible = reactive({ normal: true, workOrder: true, alarm: true })
 
 // ==================== 搜索 ====================
 const searchKeyword = ref('')
@@ -116,16 +112,16 @@ function onSearchPump() {
 }
 
 // ==================== 数据加载 ====================
-// 台账归一化:只保留泵站(设施类型固定 2),坐标/设计参数/状态都取设施自身字段
+// 台账归一化:pump_station_info 字段口径与旧工程设施表不同,这里做兼容映射
 function normalizeFacility(item) {
   const statusValue = String(item.status ?? '0')
   const statusKey = STATUS_KEY_MAP[statusValue] || 'normal'
   const lng = Number(item.longitude) || 0
   const lat = Number(item.latitude) || 0
   return {
-    id: item.facilityId,
-    name: item.facilityName || '未命名泵站',
-    code: item.facilityCode || '',
+    id: item.stationId ?? item.id,
+    name: item.stationName || '未命名泵站',
+    code: item.stationCode || '',
     statusValue,
     statusKey,
     statusText: statusLabel(statusValue),
@@ -134,9 +130,9 @@ function normalizeFacility(item) {
     designFlow: formatDecimal(item.designFlow),
     designHead: formatDecimal(item.designHead),
     address: item.location || '',
-    managementUnit: item.managementUnit || '',
-    level: item.facilityLevel || '',
-    buildDate: item.buildDate || '',
+    managementUnit: item.principal || '',
+    level: item.pumpCount != null ? `${item.pumpCount}台泵` : '',
+    buildDate: item.commissionDate || '',
     lng,
     lat,
     located: lng > 0 && lat > 0
@@ -153,10 +149,10 @@ function formatDecimal(value) {
 async function loadData() {
   loading.value = true
   try {
-    // 排水侧泵站台账在工程设施表(facility_type=2),pump_station 共用表暂无排水泵站数据
-    const res = await getFacilityPage(1, 1000, { facilityType: '2' })
-    const page = res.code !== undefined ? res.data : res
-    const records = page?.records || page?.rows || []
+    // 排水泵站台账从 pump_station_info 读取,后端按 station_type=drainage 门禁过滤
+    const res = await listDrainagePumpStation({ pageNum: 1, pageSize: 1000 })
+    const page = res && res.code !== undefined ? (res.data || {}) : (res || {})
+    const records = page.records || page.rows || []
     pumpList.value = records.map(normalizeFacility)
     renderMapMarkers()
   } catch (e) {
@@ -281,10 +277,10 @@ function openPumpInfo(pump, point) {
   const content = `<div class="pump-info">
     <div class="pump-info-title" style="border-color:${pump.color}">${escapeHtml(pump.name)}</div>
     <div class="pump-info-row"><span>运行状态</span><b style="color:${pump.color}">${escapeHtml(pump.statusText)}</b></div>
-    ${row('设施编码', pump.code || '-')}
-    ${row('设施等级', pump.level || '-')}
-    ${row('管理单位', pump.managementUnit || '-')}
-    ${row('设施位置', pump.address || '-')}
+    ${row('泵站编号', pump.code || '-')}
+    ${row('水泵数量', pump.level || '-')}
+    ${row('负责人', pump.managementUnit || '-')}
+    ${row('泵站地址', pump.address || '-')}
     ${row('设计流量', pump.designFlow === '-' ? '-' : `${pump.designFlow} m³/h`)}
     ${row('设计扬程', pump.designHead === '-' ? '-' : `${pump.designHead} m`)}
     ${row('建成日期', pump.buildDate || '-')}

+ 29 - 983
src/views/subSystem/drainage/jcsj/gcssgl.vue

@@ -1,1002 +1,48 @@
 <template>
-  <div class="app-container drainage-facility-page">
-    <!-- 设施分布地图 -->
-    <el-card shadow="never" class="map-card">
-      <template #header>
-        <div class="card-header">
-          <div class="card-title">
-            <span>设施分布</span>
-            <span class="card-sub">按当前筛选条件叠加展示,共 {{ visibleMapRecords.length }} 个带坐标设施</span>
-          </div>
-          <div class="card-actions">
-            <el-button size="small" :icon="Refresh" :loading="loading" @click="loadAll">刷新</el-button>
-            <el-button size="small" :icon="Aim" @click="fitMap">全图</el-button>
-          </div>
-        </div>
-      </template>
-
-      <!-- 设施类型页签:只看某一类要素 -->
-      <div class="map-tabs">
-        <div class="map-tab" :class="{ active: activeType === '' }" @click="switchType('')">全部</div>
-        <div v-for="item in typeOptions" :key="item.value" class="map-tab"
-          :class="{ active: activeType === String(item.value) }" @click="switchType(String(item.value))">
-          {{ item.label }}
-        </div>
-      </div>
-
-      <div class="map-wrap">
-        <GisMapCanvas ref="mapRef" :points="mapPoints" :lines="[]" :enable-clustering="true"
-          cluster-label="设施" @ready="onMapReady" @point-click="handlePointClick" />
-        <div v-if="!mapPoints.length" class="map-empty">
-          {{ loading ? '正在加载…' : '当前筛选条件下没有可展示的设施(需录入经纬度)' }}
-        </div>
-      </div>
-
-      <div class="map-legend">
-        <span class="legend-title">图标颜色:</span>
-        <span v-for="item in statusOptions" :key="item.value" class="legend-item">
-          <i :style="{ background: statusColor(item.value) }"></i>{{ item.label }}
-        </span>
-      </div>
-    </el-card>
-
-    <!-- 查询条件 -->
-    <el-form ref="queryRef" :model="query" :inline="true" v-show="showSearch" label-width="80px">
-        <el-form-item label="设施编码">
-          <el-input v-model="query.facilityCode" placeholder="请输入" clearable style="width: 160px"
-            @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="设施名称">
-          <el-input v-model="query.facilityName" placeholder="请输入" clearable style="width: 160px"
-            @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="设施类型">
-          <el-select v-model="query.facilityType" placeholder="请选择" clearable style="width: 140px">
-            <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="设施等级">
-          <el-select v-model="query.facilityLevel" placeholder="请选择" clearable style="width: 140px">
-            <el-option v-for="item in levelOptions" :key="item.value" :label="item.label" :value="item.value" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="管理单位">
-          <el-input v-model="query.managementUnit" placeholder="请输入" clearable style="width: 170px"
-            @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="运行状态">
-          <el-select v-model="query.status" placeholder="请选择" clearable style="width: 130px">
-            <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="地点">
-          <el-input v-model="query.location" placeholder="请输入" clearable style="width: 160px"
-            @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-        </el-form-item>
-    </el-form>
-
-    <!-- 设施清单 -->
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button v-hasPermi="['drainage:facility:add']" type="primary" plain icon="Plus"
-          @click="handleAdd">新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button v-hasPermi="['drainage:facility:remove']" type="danger" plain icon="Delete"
-          :disabled="selectedIds.length === 0" @click="handleBatchDelete">
-          删除{{ selectedIds.length ? `(${selectedIds.length})` : '' }}
-        </el-button>
-      </el-col>
-      <right-toolbar v-model:showSearch="showSearch" @queryTable="loadAll"></right-toolbar>
-    </el-row>
-
-      <el-table v-loading="loading" :data="tableData" style="width: 100%"
-        @selection-change="handleSelectionChange" @row-dblclick="openDetail">
-        <el-table-column type="selection" width="50" align="center" />
-        <el-table-column label="设施编码" prop="facilityCode" min-width="120" show-overflow-tooltip />
-        <el-table-column label="设施名称" prop="facilityName" min-width="150" show-overflow-tooltip />
-        <el-table-column label="设施类型" width="110" align="center">
-          <template #default="{ row }">
-            <el-tag size="small" :type="typeTagType(row.facilityType)">{{ typeLabel(row.facilityType) }}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="等级" width="90" align="center">
-          <template #default="{ row }">
-            <span>{{ levelLabel(row.facilityLevel) || '-' }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="管理单位" prop="managementUnit" min-width="140" show-overflow-tooltip />
-        <el-table-column label="地点" prop="location" min-width="140" show-overflow-tooltip />
-        <el-table-column label="运行状态" width="100" align="center">
-          <template #default="{ row }">
-            <el-tag size="small" :type="statusTagType(row.status)">{{ statusLabel(row.status) }}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="建设日期" prop="buildDate" width="110" align="center" />
-        <el-table-column label="操作" width="170" align="center" fixed="right">
-          <template #default="{ row }">
-            <el-button link type="primary" @click="openDetail(row)">详情</el-button>
-            <el-button v-hasPermi="['drainage:facility:edit']" link type="primary" @click="handleEdit(row)">修改</el-button>
-            <el-button v-hasPermi="['drainage:facility:remove']" link type="danger" @click="handleDelete(row)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="total > 0" :total="total" v-model:page="pageNum" v-model:limit="pageSize"
-        @pagination="loadPage" />
-
-    <!-- 详情抽屉(只读) -->
-    <el-drawer v-model="detailVisible" title="工程设施详情" size="680px" direction="rtl"
-      @opened="onDetailOpened">
-      <el-descriptions :column="2" border class="detail-desc">
-        <el-descriptions-item label="设施编码">{{ fmt(detailRow.facilityCode) }}</el-descriptions-item>
-        <el-descriptions-item label="设施名称">{{ fmt(detailRow.facilityName) }}</el-descriptions-item>
-        <el-descriptions-item label="设施类型">
-          <el-tag size="small" :type="typeTagType(detailRow.facilityType)">{{ typeLabel(detailRow.facilityType) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="运行状态">
-          <el-tag size="small" :type="statusTagType(detailRow.status)">{{ statusLabel(detailRow.status) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="设施等级">{{ levelLabel(detailRow.facilityLevel) || '-' }}</el-descriptions-item>
-        <el-descriptions-item label="管理单位">{{ fmt(detailRow.managementUnit) }}</el-descriptions-item>
-        <el-descriptions-item label="建设日期">{{ fmt(detailRow.buildDate) }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ fmt(detailRow.createTime) }}</el-descriptions-item>
-        <el-descriptions-item v-if="isFlowType(detailRow.facilityType)" label="设计流量(m³/s)">
-          {{ fmt(detailRow.designFlow) }}
-        </el-descriptions-item>
-        <el-descriptions-item v-if="isPumpType(detailRow.facilityType)" label="设计扬程(m)">
-          {{ fmt(detailRow.designHead) }}
-        </el-descriptions-item>
-        <el-descriptions-item v-if="isStorageType(detailRow.facilityType)" label="调蓄容积(m³)">
-          {{ fmt(detailRow.storageCapacity) }}
-        </el-descriptions-item>
-        <el-descriptions-item label="经度">{{ fmt(detailRow.longitude) }}</el-descriptions-item>
-        <el-descriptions-item label="纬度">{{ fmt(detailRow.latitude) }}</el-descriptions-item>
-        <el-descriptions-item label="地点" :span="2">{{ fmt(detailRow.location) }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ fmt(detailRow.remark) }}</el-descriptions-item>
-      </el-descriptions>
-
-      <div class="detail-map-section">
-        <div class="detail-map-title">设施位置</div>
-        <div class="detail-map-wrap">
-          <GisMapCanvas v-if="detailVisible" ref="detailMapRef" :points="detailPoints" :lines="[]"
-            :enable-clustering="false" :show-marker-name="false" @ready="onDetailMapReady" />
-          <div v-if="!detailPoints.length" class="map-empty">该设施未录入坐标</div>
-        </div>
-      </div>
-
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
-
-    <!-- 新增 / 修改 -->
-    <el-dialog v-model="formVisible" :title="formTitle" width="860px" append-to-body
-      :close-on-click-modal="false" @opened="onFormOpened" @closed="onFormClosed">
-      <el-form ref="formRef" :model="form" :rules="formRules" label-width="110px">
-        <el-row :gutter="16">
-          <el-col :span="12">
-            <el-form-item label="设施编码" prop="facilityCode">
-              <el-input v-model="form.facilityCode" placeholder="请输入设施编码" maxlength="64" clearable />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="设施名称" prop="facilityName">
-              <el-input v-model="form.facilityName" placeholder="请输入设施名称" maxlength="200" clearable />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="16">
-          <el-col :span="12">
-            <el-form-item label="设施类型" prop="facilityType">
-              <el-select v-model="form.facilityType" placeholder="请选择设施类型" style="width: 100%">
-                <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="设施等级" prop="facilityLevel">
-              <el-select v-model="form.facilityLevel" placeholder="请选择设施等级" clearable style="width: 100%">
-                <el-option v-for="item in levelOptions" :key="item.value" :label="item.label" :value="item.value" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="16">
-          <el-col :span="12">
-            <el-form-item label="管理单位" prop="managementUnit">
-              <el-input v-model="form.managementUnit" placeholder="请输入管理单位" maxlength="200" clearable />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="运行状态" prop="status">
-              <el-select v-model="form.status" placeholder="请选择运行状态" style="width: 100%">
-                <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="16">
-          <el-col :span="12">
-            <el-form-item label="地点" prop="location">
-              <el-input v-model="form.location" placeholder="请输入位置描述" maxlength="500" clearable />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="建设日期" prop="buildDate">
-              <el-date-picker v-model="form.buildDate" type="date" placeholder="请选择建设日期"
-                value-format="YYYY-MM-DD" style="width: 100%" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="16">
-          <el-col v-if="isFlowType(form.facilityType)" :span="12">
-            <el-form-item label="设计流量(m³/s)" prop="designFlow">
-              <el-input-number v-model="form.designFlow" :min="0" :precision="2" :controls="false"
-                placeholder="请输入设计流量" style="width: 100%" />
-            </el-form-item>
-          </el-col>
-          <el-col v-if="isPumpType(form.facilityType)" :span="12">
-            <el-form-item label="设计扬程(m)" prop="designHead">
-              <el-input-number v-model="form.designHead" :min="0" :precision="2" :controls="false"
-                placeholder="请输入设计扬程" style="width: 100%" />
-            </el-form-item>
-          </el-col>
-          <el-col v-if="isStorageType(form.facilityType)" :span="12">
-            <el-form-item label="调蓄容积(m³)" prop="storageCapacity">
-              <el-input-number v-model="form.storageCapacity" :min="0" :precision="2" :controls="false"
-                placeholder="请输入调蓄容积" style="width: 100%" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="16">
-          <el-col :span="12">
-            <el-form-item label="经度" prop="longitude">
-              <el-input-number v-model="form.longitude" :precision="8" :controls="false" placeholder="地图点选或手输"
-                style="width: 100%" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="纬度" prop="latitude">
-              <el-input-number v-model="form.latitude" :precision="8" :controls="false" placeholder="地图点选或手输"
-                style="width: 100%" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" type="textarea" :rows="2" maxlength="500" show-word-limit
-            placeholder="请输入备注" />
-        </el-form-item>
-      </el-form>
-
-      <div class="form-map-section">
-        <div class="form-map-title">
-          <span>位置标注</span>
-          <span class="form-map-tip">在地图上点击可定位,坐标自动回填(内部按 WGS84 存储)</span>
-        </div>
-        <div class="form-map-wrap">
-          <GisMapCanvas v-if="formVisible" ref="formMapRef" :points="formPoints" :lines="[]"
-            :enable-clustering="false" :show-marker-name="false" @ready="onFormMapReady"
-            @map-click="handleMapPick" />
-        </div>
-      </div>
-
-      <template #footer>
-        <el-button @click="formVisible = false">取 消</el-button>
-        <el-button type="primary" :loading="submitting" @click="submitForm">确 定</el-button>
-      </template>
-    </el-dialog>
+  <div class="app-container facility-tab-page">
+    <el-tabs v-model="activeTab" class="facility-tabs">
+      <el-tab-pane :label="tabLabel('0')" name="gate">
+        <DrainageGatePage v-if="activeTab === 'gate'" />
+      </el-tab-pane>
+      <el-tab-pane :label="tabLabel('1')" name="storage">
+        <DrainageStoragePage v-if="activeTab === 'storage'" />
+      </el-tab-pane>
+      <el-tab-pane :label="tabLabel('2')" name="pump">
+        <PumpStationPage v-if="activeTab === 'pump'" fixed-station-type="1" />
+      </el-tab-pane>
+    </el-tabs>
   </div>
 </template>
 
 <script setup name="Gcssgl">
-import { computed, nextTick, onMounted, ref, watch } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Aim, Refresh } from '@element-plus/icons-vue'
-import GisMapCanvas from '@/components/GisMapCanvas.vue'
+import { ref } from 'vue'
 import { useDict } from '@/utils/dict'
-import {
-  getFacilityPage,
-  getFacilityMap,
-  getFacilityDetail,
-  addFacility,
-  updateFacility,
-  deleteFacility,
-  batchDeleteFacility
-} from '@/api/drainage'
-
-const { drainage_facility_type: typeDict, drainage_facility_status: statusDict } =
-  useDict('drainage_facility_type', 'drainage_facility_status')
-
-/** 字典未配置时的兜底,保证下拉与页签不会空白 */
-const TYPE_FALLBACK = [
-  { value: '0', label: '闸门' },
-  { value: '1', label: '调蓄设施' },
-  { value: '2', label: '泵站' }
-]
-const STATUS_FALLBACK = [
-  { value: '0', label: '正常' },
-  { value: '1', label: '检修' },
-  { value: '2', label: '停用' },
-  { value: '3', label: '故障' }
-]
-
-const typeOptions = computed(() => (typeDict.value && typeDict.value.length ? typeDict.value : TYPE_FALLBACK))
-const statusOptions = computed(() => (statusDict.value && statusDict.value.length ? statusDict.value : STATUS_FALLBACK))
-
-// ==================== 查询条件 ====================
-const emptyQuery = () => ({
-  facilityCode: '',
-  facilityName: '',
-  facilityType: '',
-  facilityLevel: '',
-  managementUnit: '',
-  location: '',
-  status: ''
-})
-const query = ref(emptyQuery())
-const showSearch = ref(true)
-const queryRef = ref()
-
-// 设施等级:前端写死可选项,落库存编码(不存中文)
-const levelOptions = [
-  { value: '1', label: '一级' },
-  { value: '2', label: '二级' },
-  { value: '3', label: '三级' }
-]
-
-// ==================== 列表 ====================
-const tableData = ref([])
-const total = ref(0)
-const pageNum = ref(1)
-const pageSize = ref(10)
-const loading = ref(false)
-const selectedIds = ref([])
-
-// ==================== 地图 ====================
-const mapRecords = ref([])
-const mapRef = ref(null)
-const activeType = ref('')
-
-// ==================== 详情 ====================
-const detailVisible = ref(false)
-const detailRow = ref({})
-const detailMapRef = ref(null)
-
-/** 组装请求参数:空值不下发 */
-function buildParams() {
-  const params = {}
-  Object.keys(query.value).forEach((key) => {
-    const value = query.value[key]
-    if (value !== '' && value !== null && value !== undefined) {
-      params[key] = value
-    }
-  })
-  return params
-}
-
-/** 列表与地图共用一套筛选条件,一起刷新 */
-async function loadAll() {
-  loading.value = true
-  const params = buildParams()
-  try {
-    const [pageRes, mapRes] = await Promise.all([
-      getFacilityPage(pageNum.value, pageSize.value, params),
-      getFacilityMap(params)
-    ])
-    // 分页接口直接返回 Page 对象,地图接口返回 AjaxResult
-    const pageData = pageRes && pageRes.code !== undefined ? (pageRes.data || {}) : (pageRes || {})
-    tableData.value = pageData.records || []
-    total.value = pageData.total || 0
-    const mapData = mapRes && mapRes.code !== undefined ? (mapRes.data || []) : (mapRes || [])
-    mapRecords.value = Array.isArray(mapData) ? mapData : []
-  } catch (error) {
-    console.error('加载工程设施数据失败', error)
-    ElMessage.error('工程设施数据加载失败,请稍后重试')
-    tableData.value = []
-    mapRecords.value = []
-    total.value = 0
-  } finally {
-    loading.value = false
-  }
-}
-
-/** 只翻页时不动地图数据 */
-async function loadPage() {
-  loading.value = true
-  try {
-    const res = await getFacilityPage(pageNum.value, pageSize.value, buildParams())
-    const pageData = res && res.code !== undefined ? (res.data || {}) : (res || {})
-    tableData.value = pageData.records || []
-    total.value = pageData.total || 0
-  } catch (error) {
-    console.error('加载工程设施列表失败', error)
-    ElMessage.error('工程设施列表加载失败,请稍后重试')
-  } finally {
-    loading.value = false
-  }
-}
-
-function handleQuery() {
-  pageNum.value = 1
-  loadAll()
-}
-
-function handleSizeChange() {
-  pageNum.value = 1
-  loadPage()
-}
-
-function resetQuery() {
-  query.value = emptyQuery()
-  pageNum.value = 1
-  loadAll()
-}
-
-// ==================== 地图数据 ====================
-/** 坐标:非法或 (0,0) 视为无坐标 */
-function toCoord(lng, lat) {
-  const x = Number(lng)
-  const y = Number(lat)
-  if (!Number.isFinite(x) || !Number.isFinite(y)) return null
-  if (x === 0 && y === 0) return null
-  return { lng: x, lat: y }
-}
-
-/** 运行状态 → 地图图标状态(与列表标签同一口径) */
-const STATUS_KEY_MAP = { '0': 'normal', '1': 'workOrder', '2': 'offline', '3': 'alarm' }
-
-function statusKeyOf(status) {
-  return STATUS_KEY_MAP[String(status)] || 'normal'
-}
-
-/** 图例色块取 gisPointStatusColors 的同色值,避免与地图图标不一致 */
-const STATUS_COLORS = {
-  normal: '#2ecc71',
-  alarm: '#e74c3c',
-  workOrder: '#3498db',
-  offline: '#95a5a6'
-}
-
-function statusColor(value) {
-  return STATUS_COLORS[statusKeyOf(value)] || '#2ecc71'
-}
-
-/** 当前页签下的设施 */
-const visibleMapRecords = computed(() => {
-  if (!activeType.value) return mapRecords.value
-  return mapRecords.value.filter((row) => String(row.facilityType) === activeType.value)
-})
-
-const mapPoints = computed(() =>
-  visibleMapRecords.value
-    .map((row) => {
-      const coord = toCoord(row.longitude, row.latitude)
-      if (!coord) return null
-      return {
-        id: row.facilityId,
-        name: row.facilityName || row.facilityCode || '设施',
-        ...coord,
-        statusKey: statusKeyOf(row.status),
-        raw: row
-      }
-    })
-    .filter(Boolean)
-)
-
-function switchType(value) {
-  activeType.value = value
-}
-
-function fitMap() {
-  mapRef.value?.fitBounds()
-}
-
-// 地图实例就绪后再贴合视野:地图初始化可能晚于接口数据返回
-function onMapReady() {
-  nextTick(() => fitMap())
-}
-
-watch(
-  mapPoints,
-  () => {
-    nextTick(() => fitMap())
-  },
-  { flush: 'post' }
-)
-
-// ==================== 详情 ====================
-const detailPoints = computed(() => {
-  const coord = toCoord(detailRow.value.longitude, detailRow.value.latitude)
-  if (!coord) return []
-  return [{
-    id: detailRow.value.facilityId,
-    name: detailRow.value.facilityName || '设施',
-    ...coord,
-    statusKey: statusKeyOf(detailRow.value.status)
-  }]
-})
-
-/** 地图点位点击:直接打开该设施详情 */
-function handlePointClick(point) {
-  const row = point?.raw || point
-  if (row && row.facilityId) openDetail(row)
-}
-
-async function openDetail(row) {
-  detailRow.value = { ...row }
-  detailVisible.value = true
-  // 列表字段已够用,再取一次详情兜底(失败则沿用列表数据)
-  try {
-    const res = await getFacilityDetail(row.facilityId)
-    const data = res && res.code !== undefined ? res.data : res
-    if (data && typeof data === 'object') {
-      detailRow.value = data
-    }
-  } catch (error) {
-    console.warn('工程设施详情接口未取到数据,使用列表数据展示', error)
-  }
-}
-
-function onDetailOpened() {
-  nextTick(() => {
-    setTimeout(() => detailMapRef.value?.fitBounds(), 200)
-  })
-}
-
-function onDetailMapReady() {
-  nextTick(() => {
-    setTimeout(() => detailMapRef.value?.fitBounds(), 120)
-  })
-}
-
-// ==================== 新增 / 修改 ====================
-const formVisible = ref(false)
-const formTitle = ref('新增工程设施')
-const formRef = ref(null)
-const submitting = ref(false)
-const editingId = ref('')
-const formMapRef = ref(null)
-
-const emptyForm = () => ({
-  facilityId: '',
-  facilityCode: '',
-  facilityName: '',
-  facilityType: '',
-  facilityLevel: '',
-  managementUnit: '',
-  location: '',
-  longitude: null,
-  latitude: null,
-  status: '0',
-  buildDate: '',
-  designFlow: null,
-  designHead: null,
-  storageCapacity: null,
-  remark: ''
-})
-const form = ref(emptyForm())
-
-const formRules = {
-  facilityCode: [{ required: true, message: '请输入设施编码', trigger: 'blur' }],
-  facilityName: [{ required: true, message: '请输入设施名称', trigger: 'blur' }],
-  facilityType: [{ required: true, message: '请选择设施类型', trigger: 'change' }],
-  status: [{ required: true, message: '请选择运行状态', trigger: 'change' }]
-}
-
-function isFlowType(value) {
-  return ['0', '2'].includes(String(value))
-}
-
-function isPumpType(value) {
-  return String(value) === '2'
-}
-
-function isStorageType(value) {
-  return String(value) === '1'
-}
-
-/** 表单里的坐标标记(内部已是 WGS84,与天地图坐标系一致) */
-const formPoints = computed(() => {
-  const coord = toCoord(form.value.longitude, form.value.latitude)
-  if (!coord) return []
-  return [{
-    id: 'form',
-    name: form.value.facilityName || '待保存设施',
-    ...coord,
-    statusKey: statusKeyOf(form.value.status)
-  }]
-})
-
-function handleAdd() {
-  editingId.value = ''
-  formTitle.value = '新增工程设施'
-  form.value = emptyForm()
-  formVisible.value = true
-}
-
-function handleEdit(row) {
-  editingId.value = row.facilityId
-  formTitle.value = '修改工程设施'
-  form.value = {
-    ...emptyForm(),
-    ...row,
-    facilityLevel: normalizeLevel(row.facilityLevel),
-    buildDate: row.buildDate || '',
-    longitude: row.longitude === null || row.longitude === undefined ? null : Number(row.longitude),
-    latitude: row.latitude === null || row.latitude === undefined ? null : Number(row.latitude),
-    designFlow: row.designFlow === null || row.designFlow === undefined ? null : Number(row.designFlow),
-    designHead: row.designHead === null || row.designHead === undefined ? null : Number(row.designHead),
-    storageCapacity: row.storageCapacity === null || row.storageCapacity === undefined ? null : Number(row.storageCapacity)
-  }
-  formVisible.value = true
-}
-
-/** 类型切换后清掉该类型不适用的参数,避免脏值落库 */
-watch(() => form.value.facilityType, (type) => {
-  if (!formVisible.value) return
-  if (!isFlowType(type)) form.value.designFlow = null
-  if (!isPumpType(type)) form.value.designHead = null
-  if (!isStorageType(type)) form.value.storageCapacity = null
-})
-
-function onFormOpened() {
-  nextTick(() => {
-    setTimeout(() => formMapRef.value?.fitBounds(), 200)
-  })
-}
-
-function onFormClosed() {
-  formRef.value?.resetFields()
-  form.value = emptyForm()
-  editingId.value = ''
-}
+import DrainageGatePage from '@/views/subSystem/pipeNetwork/facilities/drainageGate/index.vue'
+import DrainageStoragePage from '@/views/subSystem/pipeNetwork/facilities/drainageStorage/index.vue'
+import PumpStationPage from '@/views/subSystem/pipeNetwork/facilities/pumpStation/index.vue'
 
-function onFormMapReady() {
-  nextTick(() => {
-    setTimeout(() => formMapRef.value?.fitBounds(), 120)
-  })
+const { drainage_facility_type: typeDict } = useDict('drainage_facility_type')
+const TYPE_FALLBACK = {
+  '0': '闸门',
+  '1': '调蓄设施',
+  '2': '泵站'
 }
-
-/** 地图点选:坐标直接回填,WGS84 与 CGCS2000 口径一致 */
-function handleMapPick(point) {
-  const lng = Number(point?.lng)
-  const lat = Number(point?.lat)
-  if (!Number.isFinite(lng) || !Number.isFinite(lat)) return
-  const wgsLng = Number(lng), wgsLat = Number(lat)
-  form.value.longitude = Number(wgsLng.toFixed(8))
-  form.value.latitude = Number(wgsLat.toFixed(8))
-}
-
-/** 只提交实体字段,避免把列表里的额外字段带进后端 */
-function buildPayload() {
-  const source = form.value
-  return {
-    facilityCode: source.facilityCode,
-    facilityName: source.facilityName,
-    facilityType: source.facilityType,
-    facilityLevel: source.facilityLevel || null,
-    managementUnit: source.managementUnit || null,
-    location: source.location || null,
-    longitude: source.longitude,
-    latitude: source.latitude,
-    status: source.status,
-    buildDate: source.buildDate || null,
-    designFlow: source.designFlow,
-    designHead: source.designHead,
-    storageCapacity: source.storageCapacity,
-    remark: source.remark || null
-  }
-}
-
-function submitForm() {
-  formRef.value?.validate(async (valid) => {
-    if (!valid) return
-    submitting.value = true
-    try {
-      const payload = buildPayload()
-      const res = editingId.value
-        ? await updateFacility({ ...payload, facilityId: editingId.value })
-        : await addFacility(payload)
-      if (res && (res.code === 0 || res.code === 200)) {
-        ElMessage.success(editingId.value ? '修改成功' : '新增成功')
-        formVisible.value = false
-        loadAll()
-      } else {
-        ElMessage.error(res?.msg || (editingId.value ? '修改失败' : '新增失败'))
-      }
-    } catch (error) {
-      console.error('保存工程设施失败', error)
-      ElMessage.error('操作失败')
-    } finally {
-      submitting.value = false
-    }
-  })
-}
-
-// ==================== 删除 ====================
-function handleSelectionChange(selection) {
-  selectedIds.value = selection.map((item) => item.facilityId)
-}
-
-function handleDelete(row) {
-  ElMessageBox.confirm(`确认删除设施「${row.facilityName}」吗?`, '提示', {
-    confirmButtonText: '确定',
-    cancelButtonText: '取消',
-    type: 'warning'
-  }).then(async () => {
-    try {
-      const res = await deleteFacility(row.facilityId)
-      if (res && (res.code === 0 || res.code === 200)) {
-        ElMessage.success('删除成功')
-        // 删掉当前页最后一条时回退一页,避免停在空页
-        if (tableData.value.length === 1 && pageNum.value > 1) pageNum.value -= 1
-        loadAll()
-      } else {
-        ElMessage.error(res?.msg || '删除失败')
-      }
-    } catch (error) {
-      console.error('删除工程设施失败', error)
-      ElMessage.error('删除失败')
-    }
-  }).catch(() => {})
-}
-
-function handleBatchDelete() {
-  const ids = [...selectedIds.value]
-  if (!ids.length) return
-  ElMessageBox.confirm(`确认删除选中的 ${ids.length} 条设施吗?`, '提示', {
-    confirmButtonText: '确定',
-    cancelButtonText: '取消',
-    type: 'warning'
-  }).then(async () => {
-    try {
-      const res = await batchDeleteFacility(ids)
-      if (!res || (res.code !== 0 && res.code !== 200)) {
-        ElMessage.error(res?.msg || '删除失败')
-        return
-      }
-      ElMessage.success('删除成功')
-      selectedIds.value = []
-      // 整页被删空时回退一页,避免停在空页
-      if (tableData.value.length === ids.length && pageNum.value > 1) pageNum.value -= 1
-      loadAll()
-    } catch (error) {
-      console.error('批量删除工程设施失败', error)
-      ElMessage.error('删除失败')
-    }
-  }).catch(() => {})
-}
-
-// ==================== 展示辅助 ====================
-function dictItem(dictRef, value) {
-  const list = dictRef?.value || []
-  return list.find((item) => String(item.value) === String(value))
-}
-
-function typeLabel(value) {
-  const fallback = TYPE_FALLBACK.find((item) => item.value === String(value))
-  return dictItem(typeDict, value)?.label || fallback?.label || '-'
-}
-
-/** 等级:库里存编码,展示转中文;兼容历史中文值原样显示 */
-function levelLabel(value) {
-  if (value === null || value === undefined || value === '') return ''
-  const hit = levelOptions.find((item) => item.value === String(value))
-  return hit ? hit.label : String(value)
-}
-
-/** 编辑回显用:把可能存在的历史中文等级归一成编码,保证下拉能选中 */
-function normalizeLevel(value) {
-  if (value === null || value === undefined || value === '') return ''
-  const hit = levelOptions.find((item) => item.value === String(value) || item.label === String(value))
-  return hit ? hit.value : ''
-}
-
-function typeTagType(value) {
-  const item = dictItem(typeDict, value)
-  const listClass = item?.listClass || item?.elTagType || ''
-  // Element Plus 没有 primary 类型,回落为默认样式
-  return ['success', 'warning', 'danger', 'info'].includes(listClass) ? listClass : ''
-}
-
-function statusLabel(value) {
-  const fallback = STATUS_FALLBACK.find((item) => item.value === String(value))
-  return dictItem(statusDict, value)?.label || fallback?.label || '-'
-}
-
-function statusTagType(value) {
-  const item = dictItem(statusDict, value)
-  const listClass = item?.listClass || item?.elTagType || ''
-  if (['success', 'warning', 'danger', 'info'].includes(listClass)) return listClass
-  const fallback = { '0': 'success', '1': 'warning', '2': 'info', '3': 'danger' }
-  return fallback[String(value)] || 'info'
+function tabLabel(value) {
+  const hit = (typeDict.value || []).find((item) => String(item.value) === String(value))
+  return hit?.label || TYPE_FALLBACK[value] || '-'
 }
 
-function fmt(value) {
-  if (value === null || value === undefined || value === '') return '-'
-  return value
-}
-
-onMounted(() => {
-  loadAll()
-})
+const activeTab = ref('gate')
 </script>
 
 <style scoped>
-.drainage-facility-page {
+.facility-tab-page {
   padding: 16px;
 }
 
-.card-header {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  gap: 12px;
-}
-
-.card-title {
-  display: flex;
-  align-items: baseline;
-  gap: 10px;
-  font-size: 15px;
-  font-weight: 600;
-  color: #303133;
-}
-
-.card-sub {
-  font-size: 12px;
-  font-weight: 400;
-  color: #909399;
-}
-
-.card-actions {
-  display: flex;
-  gap: 8px;
-}
-
-.map-card,
-.filter-card,
-.table-card {
-  margin-bottom: 16px;
-}
-
-.map-tabs {
-  display: flex;
-  background: #f5f7fa;
-  border: 1px solid #e4e7ed;
-  border-radius: 4px 4px 0 0;
-  border-bottom: none;
-}
-
-.map-tab {
-  padding: 8px 24px;
-  font-size: 14px;
-  cursor: pointer;
-  color: #606266;
-  transition: all 0.2s;
-  user-select: none;
-}
-
-.map-tab:hover {
-  color: #409eff;
-}
-
-.map-tab.active {
-  background: #409eff;
-  color: #fff;
-}
-
-.map-wrap {
-  position: relative;
-  height: 360px;
-  border: 1px solid #e4e7ed;
-  border-radius: 0 0 4px 4px;
-  overflow: hidden;
-}
-
-.map-empty {
-  position: absolute;
-  inset: 0;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  color: #909399;
-  font-size: 13px;
-  background: rgba(255, 255, 255, 0.72);
-  pointer-events: none;
-}
-
-.map-legend {
-  display: flex;
-  align-items: center;
-  flex-wrap: wrap;
-  gap: 16px;
-  padding: 8px 4px 0;
-  font-size: 12px;
-  color: #606266;
-}
-
-.legend-title {
-  color: #909399;
-}
-
-.legend-item {
-  display: inline-flex;
-  align-items: center;
-  gap: 6px;
-}
-
-.legend-item i {
-  display: inline-block;
-  width: 10px;
-  height: 10px;
-  border-radius: 50%;
-}
-
-.filter-form {
-  margin-bottom: -18px;
-}
-
-.toolbar {
-  margin-bottom: 12px;
-}
-
-.pager {
-  margin-top: 16px;
-  justify-content: flex-end;
-}
-
-.detail-desc {
-  margin-bottom: 16px;
-}
-
-.detail-map-section {
-  margin-top: 8px;
-}
-
-.detail-map-title {
-  margin-bottom: 8px;
-  font-size: 14px;
-  font-weight: 600;
-  color: #303133;
-}
-
-.detail-map-wrap {
-  position: relative;
-  height: 280px;
-  border: 1px solid #e4e7ed;
-  border-radius: 4px;
-  overflow: hidden;
-}
-
-.form-map-section {
-  margin-top: 4px;
-}
-
-.form-map-title {
-  display: flex;
-  align-items: baseline;
-  gap: 10px;
-  margin-bottom: 8px;
-  font-size: 14px;
-  font-weight: 600;
-  color: #303133;
-}
-
-.form-map-tip {
-  font-size: 12px;
-  font-weight: 400;
-  color: #909399;
-}
-
-.form-map-wrap {
-  height: 300px;
-  border: 1px solid #e4e7ed;
+.facility-tabs {
+  background: #fff;
+  padding: 16px;
   border-radius: 4px;
-  overflow: hidden;
 }
 </style>

+ 0 - 694
src/views/subSystem/drainage/jcsj/psgwgl.vue

@@ -1,694 +0,0 @@
-<template>
-  <div class="app-container drainage-network-page">
-    <!-- 管网分布地图 -->
-    <el-card shadow="never" class="map-card">
-      <template #header>
-        <div class="card-header">
-          <div class="card-title">
-            <span>管网分布</span>
-            <span class="card-sub">按当前筛选条件绘制,共 {{ mapRecords.length }} 条带坐标记录</span>
-          </div>
-          <div class="card-actions">
-            <el-button size="small" :icon="Refresh" :loading="loading" @click="loadAll">刷新</el-button>
-            <el-button size="small" :icon="Aim" @click="fitMap">全图</el-button>
-          </div>
-        </div>
-      </template>
-      <div class="map-wrap">
-        <GisMapCanvas
-          ref="mapRef"
-          :points="mapPoints"
-          :lines="mapLines"
-          :enable-clustering="true"
-          cluster-label="管线起点"
-          @ready="onMapReady"
-          @line-click="handleFeatureClick"
-          @point-click="handleFeatureClick" />
-        <div v-if="!mapLines.length" class="map-empty">
-          {{ loading ? '正在加载…' : '当前筛选条件下没有可绘制的管线段' }}
-        </div>
-      </div>
-      <div class="map-legend">
-        <span class="legend-title">管线颜色:</span>
-        <span class="legend-item">
-          <i :style="{ background: SEWAGE_COLORS['1'] }"></i>雨水 {{ rainCount }} 条
-        </span>
-        <span class="legend-item">
-          <i :style="{ background: SEWAGE_COLORS['0'] }"></i>污水 {{ sewageCount }} 条
-        </span>
-        <span class="legend-item">
-          <i :style="{ background: SEWAGE_COLORS.unknown }"></i>未识别 {{ unknownCount }} 条
-        </span>
-        <span class="legend-note">维护中 / 异常的管段显示为虚线</span>
-      </div>
-    </el-card>
-
-    <!-- 查询条件 -->
-    <el-form ref="queryRef" :model="query" :inline="true" v-show="showSearch" label-width="80px">
-        <el-form-item label="设施编码">
-          <el-input v-model="query.networkCode" placeholder="请输入" clearable style="width: 160px"
-            @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="设施名称">
-          <el-input v-model="query.networkName" placeholder="请输入" clearable style="width: 160px"
-            @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="管线类型">
-          <el-select v-model="query.sewageType" placeholder="请选择" clearable style="width: 120px">
-            <el-option v-for="item in sewageTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="管养单位">
-          <el-select v-model="query.managementUnit" placeholder="请选择" clearable filterable allow-create
-            style="width: 170px">
-            <el-option v-for="item in filterOptions.managementUnits" :key="item" :label="item" :value="item" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="材质">
-          <el-select v-model="query.material" placeholder="请选择" clearable filterable allow-create style="width: 140px">
-            <el-option v-for="item in filterOptions.materials" :key="item" :label="item" :value="item" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="状态">
-          <el-select v-model="query.status" placeholder="请选择" clearable style="width: 130px">
-            <el-option v-for="item in statusDict" :key="item.value" :label="item.label" :value="item.value" />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="管径(mm)">
-          <div class="range-input">
-            <el-input-number v-model="query.diameterMin" :min="0" :precision="0" :controls="false"
-              placeholder="最小" style="width: 80px" />
-            <span class="range-sep">~</span>
-            <el-input-number v-model="query.diameterMax" :min="0" :precision="0" :controls="false"
-              placeholder="最大" style="width: 80px" />
-          </div>
-        </el-form-item>
-        <el-form-item label="建设日期">
-          <el-date-picker v-model="buildRange" type="daterange" value-format="YYYY-MM-DD"
-            range-separator="-" start-placeholder="开始" end-placeholder="结束" style="width: 230px" />
-        </el-form-item>
-        <el-form-item>
-          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-        </el-form-item>
-    </el-form>
-
-    <!-- 管网清单 -->
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" plain icon="Refresh" :loading="loading" @click="loadAll">刷新</el-button>
-      </el-col>
-      <right-toolbar v-model:showSearch="showSearch" @queryTable="loadAll"></right-toolbar>
-    </el-row>
-
-      <el-table v-loading="loading" :data="tableData" style="width: 100%" @row-dblclick="openDetail">
-        <el-table-column label="设施编码" prop="networkCode" min-width="120" show-overflow-tooltip />
-        <el-table-column label="设施名称" prop="networkName" min-width="150" show-overflow-tooltip />
-        <el-table-column label="管线类型" width="90" align="center">
-          <template #default="{ row }">
-            <el-tag v-if="row.sewageType !== null && row.sewageType !== undefined && row.sewageType !== ''"
-              size="small" :type="sewageTagType(row.sewageType)">{{ sewageLabel(row.sewageType) }}</el-tag>
-            <span v-else class="text-muted">未识别</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="管养单位" prop="managementUnit" min-width="140" show-overflow-tooltip />
-        <el-table-column label="材质" prop="material" width="100" show-overflow-tooltip />
-        <el-table-column label="管径(mm)" prop="diameter" width="95" align="right" />
-        <el-table-column label="长度(m)" prop="length" width="95" align="right" />
-        <el-table-column label="位置描述" prop="location" min-width="150" show-overflow-tooltip />
-        <el-table-column label="状态" width="90" align="center">
-          <template #default="{ row }">
-            <el-tag size="small" :type="statusTagType(row.status)">{{ statusLabel(row.status) }}</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="建设日期" prop="buildDate" width="110" align="center" />
-        <el-table-column label="操作" width="90" align="center" fixed="right">
-          <template #default="{ row }">
-            <el-button link type="primary" @click="openDetail(row)">详情</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination v-show="total > 0" :total="total" v-model:page="pageNum" v-model:limit="pageSize"
-        @pagination="loadPage" />
-
-    <!-- 详情抽屉(只读) -->
-    <el-drawer v-model="detailVisible" title="排水管网详情" size="680px" direction="rtl"
-      @opened="onDetailOpened">
-      <el-descriptions :column="2" border class="detail-desc">
-        <el-descriptions-item label="设施编码">{{ fmt(detailRow.networkCode) }}</el-descriptions-item>
-        <el-descriptions-item label="设施名称">{{ fmt(detailRow.networkName) }}</el-descriptions-item>
-        <el-descriptions-item label="管线类型">
-          <el-tag v-if="detailRow.sewageType !== null && detailRow.sewageType !== undefined && detailRow.sewageType !== ''"
-            size="small" :type="sewageTagType(detailRow.sewageType)">{{ sewageLabel(detailRow.sewageType) }}</el-tag>
-          <span v-else>未识别</span>
-        </el-descriptions-item>
-        <el-descriptions-item label="状态">
-          <el-tag size="small" :type="statusTagType(detailRow.status)">{{ statusLabel(detailRow.status) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="管养单位">{{ fmt(detailRow.managementUnit) }}</el-descriptions-item>
-        <el-descriptions-item label="材质">{{ fmt(detailRow.material) }}</el-descriptions-item>
-        <el-descriptions-item label="管径(mm)">{{ fmt(detailRow.diameter) }}</el-descriptions-item>
-        <el-descriptions-item label="长度(m)">{{ fmt(detailRow.length) }}</el-descriptions-item>
-        <el-descriptions-item label="建设日期">{{ fmt(detailRow.buildDate) }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ fmt(detailRow.createTime) }}</el-descriptions-item>
-        <el-descriptions-item label="起点经度">{{ fmt(detailRow.startLongitude) }}</el-descriptions-item>
-        <el-descriptions-item label="起点纬度">{{ fmt(detailRow.startLatitude) }}</el-descriptions-item>
-        <el-descriptions-item label="终点经度">{{ fmt(detailRow.endLongitude) }}</el-descriptions-item>
-        <el-descriptions-item label="终点纬度">{{ fmt(detailRow.endLatitude) }}</el-descriptions-item>
-        <el-descriptions-item label="位置描述" :span="2">{{ fmt(detailRow.location) }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ fmt(detailRow.remark) }}</el-descriptions-item>
-      </el-descriptions>
-
-      <div class="detail-map-section">
-        <div class="detail-map-title">管段位置</div>
-        <div class="detail-map-wrap">
-          <GisMapCanvas v-if="detailVisible" ref="detailMapRef" :points="detailPoints" :lines="detailLines"
-            :enable-clustering="false" :show-marker-name="false" @ready="onDetailMapReady" />
-          <div v-if="!detailLines.length && !detailPoints.length" class="map-empty">该管网未录入起终点坐标</div>
-        </div>
-      </div>
-
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
-  </div>
-</template>
-
-<script setup name="Psgwgl">
-import { computed, nextTick, onMounted, ref, watch } from 'vue'
-import { ElMessage } from 'element-plus'
-import { Aim, Refresh } from '@element-plus/icons-vue'
-import GisMapCanvas from '@/components/GisMapCanvas.vue'
-import { useDict } from '@/utils/dict'
-import {
-  getDrainagePipeNetworkPage,
-  getDrainagePipeNetworkMap,
-  getDrainagePipeNetworkDetail,
-  getDrainagePipeNetworkFilterOptions
-} from '@/api/drainage'
-
-const { pipe_network_status: statusDict, drainage_sewage_type: sewageTypeDict } =
-  useDict('pipe_network_status', 'drainage_sewage_type')
-
-// ==================== 雨污配色(与参考色一致:雨水蓝、污水青) ====================
-// 值取自 pipe_network_base.network_level 注释:0=污水 1=雨水
-const SEWAGE_COLORS = { '0': '#35be83', '1': '#2f9be8', unknown: '#909399' }
-
-/** 雨污下拉项:字典优先,字典未配置时用内置两项兜底,保证筛选不空转 */
-const sewageTypeOptions = computed(() => {
-  const list = sewageTypeDict?.value || []
-  if (list.length) return list
-  return [
-    { label: '雨水', value: '1' },
-    { label: '污水', value: '0' }
-  ]
-})
-
-// ==================== 查询条件 ====================
-const query = ref({
-  networkCode: '',
-  networkName: '',
-  sewageType: '',
-  managementUnit: '',
-  material: '',
-  status: '',
-  diameterMin: null,
-  diameterMax: null
-})
-const buildRange = ref([])
-const showSearch = ref(true)
-const queryRef = ref()
-
-// 下拉项(材质、管养单位去重值)
-const filterOptions = ref({ materials: [], managementUnits: [] })
-
-// ==================== 列表 ====================
-const tableData = ref([])
-const total = ref(0)
-const pageNum = ref(1)
-const pageSize = ref(10)
-const loading = ref(false)
-
-// ==================== 地图 ====================
-const mapRecords = ref([])
-const mapRef = ref(null)
-
-// ==================== 详情 ====================
-const detailVisible = ref(false)
-const detailRow = ref({})
-const detailMapRef = ref(null)
-
-/** 组装请求参数:空值不下发 */
-function buildParams() {
-  const params = {}
-  Object.keys(query.value).forEach((key) => {
-    const value = query.value[key]
-    if (value !== '' && value !== null && value !== undefined) {
-      params[key] = value
-    }
-  })
-  const range = buildRange.value || []
-  if (range[0]) params.buildDateStart = range[0]
-  if (range[1]) params.buildDateEnd = range[1]
-  return params
-}
-
-/** 列表与地图共用一套筛选条件,一起刷新 */
-async function loadAll() {
-  loading.value = true
-  const params = buildParams()
-  try {
-    const [pageRes, mapRes] = await Promise.all([
-      getDrainagePipeNetworkPage(pageNum.value, pageSize.value, params),
-      getDrainagePipeNetworkMap(params)
-    ])
-    // 分页接口直接返回 Page 对象,地图接口返回 AjaxResult
-    const pageData = pageRes && pageRes.code !== undefined ? (pageRes.data || {}) : (pageRes || {})
-    tableData.value = pageData.records || []
-    total.value = pageData.total || 0
-    const mapData = mapRes && mapRes.code !== undefined ? (mapRes.data || []) : (mapRes || [])
-    mapRecords.value = Array.isArray(mapData) ? mapData : []
-  } catch (error) {
-    console.error('加载排水管网数据失败', error)
-    ElMessage.error('排水管网数据加载失败,请稍后重试')
-    tableData.value = []
-    mapRecords.value = []
-    total.value = 0
-  } finally {
-    loading.value = false
-  }
-}
-
-/** 只翻页时不动地图数据 */
-async function loadPage() {
-  loading.value = true
-  try {
-    const res = await getDrainagePipeNetworkPage(pageNum.value, pageSize.value, buildParams())
-    const pageData = res && res.code !== undefined ? (res.data || {}) : (res || {})
-    tableData.value = pageData.records || []
-    total.value = pageData.total || 0
-  } catch (error) {
-    console.error('加载排水管网列表失败', error)
-    ElMessage.error('排水管网列表加载失败,请稍后重试')
-  } finally {
-    loading.value = false
-  }
-}
-
-function handleQuery() {
-  pageNum.value = 1
-  loadAll()
-}
-
-function handleSizeChange() {
-  pageNum.value = 1
-  loadPage()
-}
-
-function resetQuery() {
-  query.value = {
-    networkCode: '',
-    networkName: '',
-    sewageType: '',
-    managementUnit: '',
-    material: '',
-    status: '',
-    diameterMin: null,
-    diameterMax: null
-  }
-  buildRange.value = []
-  pageNum.value = 1
-  loadAll()
-}
-
-async function loadFilterOptions() {
-  try {
-    const res = await getDrainagePipeNetworkFilterOptions()
-    const data = res && res.code !== undefined ? (res.data || {}) : (res || {})
-    filterOptions.value = {
-      materials: data.materials || [],
-      managementUnits: data.managementUnits || []
-    }
-  } catch (error) {
-    // 下拉项拿不到不影响主流程,允许手输
-    console.warn('排水管网筛选下拉项加载失败', error)
-  }
-}
-
-// ==================== 坐标与地图数据 ====================
-/** 单个端点坐标:非法或 (0,0) 视为无效 */
-function toCoord(lng, lat) {
-  const x = Number(lng)
-  const y = Number(lat)
-  if (!Number.isFinite(x) || !Number.isFinite(y)) return null
-  if (x === 0 && y === 0) return null
-  return { lng: x, lat: y }
-}
-
-/** 一条管网的可绘制坐标序列(起点在前、终点在后) */
-function buildRowPoints(row) {
-  if (!row) return []
-  const points = []
-  const start = toCoord(row.startLongitude, row.startLatitude)
-  const end = toCoord(row.endLongitude, row.endLatitude)
-  if (start) points.push(start)
-  if (end) points.push(end)
-  return points
-}
-
-/** 雨污类型 → 线条颜色(雨水蓝、污水青,未识别灰) */
-function sewageColor(value) {
-  const key = value === null || value === undefined ? '' : String(value)
-  return SEWAGE_COLORS[key] || SEWAGE_COLORS.unknown
-}
-
-/** 状态 → 线型:维护中/异常走虚线,颜色仍按雨污类型区分 */
-function lineStrokeStyle(status) {
-  return status === null || status === undefined || String(status) === '0' ? 'solid' : 'dashed'
-}
-
-/** 图例条数,按当前地图记录统计(network_level:0=污水 1=雨水) */
-const sewageSummary = computed(() => {
-  const summary = { rain: 0, sewage: 0, unknown: 0 }
-  mapRecords.value.forEach((row) => {
-    const type = row.sewageType === null || row.sewageType === undefined ? '' : String(row.sewageType)
-    if (type === '1') summary.rain += 1
-    else if (type === '0') summary.sewage += 1
-    else summary.unknown += 1
-  })
-  return summary
-})
-const rainCount = computed(() => sewageSummary.value.rain)
-const sewageCount = computed(() => sewageSummary.value.sewage)
-const unknownCount = computed(() => sewageSummary.value.unknown)
-
-const mapLines = computed(() =>
-  mapRecords.value
-    .map((row) => {
-      const points = buildRowPoints(row)
-      if (points.length < 2) return null
-      return {
-        id: row.networkId,
-        name: row.networkName || row.networkCode || '排水管线',
-        points,
-        color: sewageColor(row.sewageType),
-        strokeWeight: 5,
-        strokeStyle: lineStrokeStyle(row.status),
-        raw: row
-      }
-    })
-    .filter(Boolean)
-)
-
-const mapPoints = computed(() =>
-  mapRecords.value
-    .map((row) => {
-      const points = buildRowPoints(row)
-      if (!points.length) return null
-      return {
-        id: row.networkId,
-        name: row.networkName || row.networkCode || '起点',
-        lng: points[0].lng,
-        lat: points[0].lat,
-        raw: row
-      }
-    })
-    .filter(Boolean)
-)
-
-function fitMap() {
-  mapRef.value?.fitBounds()
-}
-
-// 地图实例就绪后再贴合视野:地图初始化可能晚于接口数据返回
-function onMapReady() {
-  nextTick(() => fitMap())
-}
-
-// 数据变化后自动缩放到全部管网
-watch(
-  mapLines,
-  () => {
-    nextTick(() => fitMap())
-  },
-  { flush: 'post' }
-)
-
-// ==================== 详情 ====================
-const detailPoints = computed(() => {
-  const points = buildRowPoints(detailRow.value)
-  return points.map((point, index) => ({
-    ...point,
-    name: index === 0 ? '起点' : '终点'
-  }))
-})
-
-const detailLines = computed(() => {
-  const points = buildRowPoints(detailRow.value)
-  if (points.length < 2) return []
-  return [{
-    id: 'detail',
-    name: '管段',
-    points,
-    color: sewageColor(detailRow.value.sewageType),
-    strokeWeight: 6,
-    strokeStyle: lineStrokeStyle(detailRow.value.status)
-  }]
-})
-
-/** 地图要素点击:直接打开对应管网详情 */
-function handleFeatureClick(feature) {
-  const row = feature?.raw || feature
-  if (row && row.networkId) openDetail(row)
-}
-
-async function openDetail(row) {
-  detailRow.value = { ...row }
-  detailVisible.value = true
-  // 列表字段已够用,再取一次详情兜底(失败则沿用列表数据)
-  try {
-    const res = await getDrainagePipeNetworkDetail(row.networkId)
-    const data = res && res.code !== undefined ? res.data : res
-    if (data && typeof data === 'object') {
-      detailRow.value = data
-    }
-  } catch (error) {
-    console.warn('排水管网详情接口未取到数据,使用列表数据展示', error)
-  }
-}
-
-function onDetailOpened() {
-  nextTick(() => {
-    setTimeout(() => detailMapRef.value?.fitBounds(), 200)
-  })
-}
-
-function onDetailMapReady() {
-  nextTick(() => {
-    setTimeout(() => detailMapRef.value?.fitBounds(), 120)
-  })
-}
-
-// ==================== 展示辅助 ====================
-function dictItem(dictRef, value) {
-  const list = dictRef?.value || []
-  return list.find((item) => String(item.value) === String(value))
-}
-
-function statusLabel(value) {
-  return dictItem(statusDict, value)?.label || '-'
-}
-
-function statusTagType(value) {
-  const map = { '0': 'success', '1': 'warning', '2': 'danger' }
-  return map[String(value)] || 'info'
-}
-
-/** 雨污类型文案:字典优先,字典未就绪时按编码兜底 */
-function sewageLabel(value) {
-  const label = dictItem(sewageTypeDict, value)?.label
-  if (label) return label
-  if (String(value) === '0') return '污水'
-  if (String(value) === '1') return '雨水'
-  return '未识别'
-}
-
-/** 雨污类型标签配色:雨水蓝(primary)、污水青(success) */
-function sewageTagType(value) {
-  const map = { '1': 'primary', '0': 'success' }
-  return map[String(value)] || 'info'
-}
-
-function fmt(value) {
-  if (value === null || value === undefined || value === '') return '-'
-  return value
-}
-
-onMounted(() => {
-  loadFilterOptions()
-  loadAll()
-})
-</script>
-
-<style scoped lang="scss">
-.drainage-network-page {
-  .card-header {
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    gap: 12px;
-  }
-
-  .card-title {
-    display: flex;
-    align-items: baseline;
-    gap: 10px;
-    font-size: 15px;
-    font-weight: 600;
-    color: #303133;
-  }
-
-  .card-sub {
-    font-size: 12px;
-    font-weight: 400;
-    color: #909399;
-  }
-
-  .card-actions {
-    display: flex;
-    gap: 8px;
-  }
-
-  .map-card {
-    margin-bottom: 16px;
-  }
-
-  .map-wrap {
-    position: relative;
-    height: 400px;
-    border-radius: 4px;
-    overflow: hidden;
-    background: #eef3f8;
-
-    :deep(.gis-map-canvas) {
-      min-height: 400px;
-    }
-  }
-
-  .map-empty {
-    position: absolute;
-    inset: 0;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    color: #909399;
-    font-size: 13px;
-    background: rgba(255, 255, 255, 0.72);
-    pointer-events: none;
-  }
-
-  .map-legend {
-    display: flex;
-    flex-wrap: wrap;
-    align-items: center;
-    gap: 14px;
-    margin-top: 10px;
-    font-size: 12px;
-    color: #606266;
-  }
-
-  .legend-title {
-    color: #909399;
-  }
-
-  .legend-item {
-    display: inline-flex;
-    align-items: center;
-    gap: 5px;
-
-    i {
-      display: inline-block;
-      width: 18px;
-      height: 4px;
-      border-radius: 2px;
-    }
-  }
-
-  .legend-note {
-    color: #a8abb2;
-
-    &::before {
-      content: '';
-      display: inline-block;
-      width: 18px;
-      height: 4px;
-      margin-right: 5px;
-      vertical-align: middle;
-      border-radius: 2px;
-      background: repeating-linear-gradient(90deg, #a8abb2 0 4px, transparent 4px 8px);
-    }
-  }
-
-  .filter-card {
-    margin-bottom: 16px;
-  }
-
-  .filter-form {
-    display: flex;
-    flex-wrap: wrap;
-    row-gap: 4px;
-
-    :deep(.el-form-item) {
-      margin-bottom: 12px;
-      margin-right: 16px;
-    }
-  }
-
-  .range-input {
-    display: flex;
-    align-items: center;
-    gap: 6px;
-  }
-
-  .range-sep {
-    color: #c0c4cc;
-  }
-
-  .table-card {
-    .pager {
-      margin-top: 16px;
-      justify-content: flex-end;
-    }
-  }
-
-  .text-muted {
-    color: #c0c4cc;
-  }
-
-  .detail-desc {
-    margin-bottom: 16px;
-  }
-
-  .detail-map-section {
-    .detail-map-title {
-      margin-bottom: 8px;
-      font-size: 14px;
-      font-weight: 600;
-      color: #303133;
-    }
-  }
-
-  .detail-map-wrap {
-    position: relative;
-    height: 300px;
-    border-radius: 4px;
-    overflow: hidden;
-    background: #eef3f8;
-
-    :deep(.gis-map-canvas) {
-      min-height: 300px;
-    }
-  }
-}
-</style>

+ 160 - 0
src/views/subSystem/pipeNetwork/facilities/components/FacilityImportDialog.vue

@@ -0,0 +1,160 @@
+<template>
+  <el-dialog
+    v-model="visible"
+    :title="`${title}批量导入`"
+    width="640px"
+    append-to-body
+    class="facility-import-dialog"
+    @closed="resetImport"
+  >
+    <el-upload
+      ref="uploadRef"
+      drag
+      :limit="1"
+      accept=".xlsx, .xls"
+      :action="actionUrl"
+      :headers="importHeaders"
+      :auto-upload="false"
+      :disabled="importUploading"
+      :before-upload="beforeImportUpload"
+      :on-progress="onImportProgress"
+      :on-success="onImportSuccess"
+      :on-error="onImportError"
+    >
+      <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+      <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+      <template #tip>
+        <div class="el-upload__tip">
+          <el-checkbox v-model="updateSupport">更新已存在的业务编码</el-checkbox>
+          <el-link type="primary" :underline="false" @click="downloadTemplate">下载模板</el-link>
+          <div>仅支持 xls、xlsx;模板中带红色 * 的列为必填;业务编码为空的行将被跳过。</div>
+          <div v-if="dictHint" class="import-dict-hint">{{ dictHint }}</div>
+        </div>
+      </template>
+    </el-upload>
+
+    <div v-if="importResult" class="import-result">
+      <div class="import-result-summary">
+        导入成功 <strong>{{ importResult.successCount }}</strong> 条,导入失败
+        <strong :class="{ 'is-failure': importResult.failureCount > 0 }">{{ importResult.failureCount }}</strong> 条
+      </div>
+      <el-table v-if="importResult.failures?.length" :data="importResult.failures" height="240" border size="small">
+        <el-table-column prop="row" label="行号" width="80" show-overflow-tooltip />
+        <el-table-column prop="name" label="业务编码" width="180" show-overflow-tooltip />
+        <el-table-column prop="reason" label="失败原因" show-overflow-tooltip />
+      </el-table>
+    </div>
+
+    <template #footer>
+      <el-button type="primary" :loading="importUploading" @click="submitImport">开始导入</el-button>
+      <el-button @click="visible = false">关 闭</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import { computed, ref } from 'vue'
+import { getToken } from '@/utils/auth'
+import { download } from '@/utils/request'
+import { ElMessage } from 'element-plus'
+
+const props = defineProps({
+  modelValue: { type: Boolean, default: false },
+  title: { type: String, required: true },
+  uploadUrl: { type: String, required: true },
+  templateUrl: { type: String, required: true },
+  /** 字典列说明,例如:窨井类型、状态请从模板下拉框中选择中文 */
+  dictHint: { type: String, default: '' }
+})
+const emit = defineEmits(['update:modelValue', 'imported'])
+
+const uploadRef = ref()
+const updateSupport = ref(false)
+const importUploading = ref(false)
+const importResult = ref(null)
+const importHeaders = { Authorization: `Bearer ${getToken()}` }
+const actionUrl = computed(
+  () => `${import.meta.env.VITE_APP_BASE_API}${props.uploadUrl}?updateSupport=${updateSupport.value}`
+)
+const visible = computed({
+  get: () => props.modelValue,
+  set: (value) => emit('update:modelValue', value)
+})
+
+function submitImport() {
+  importResult.value = null
+  uploadRef.value?.submit()
+}
+
+function beforeImportUpload(file) {
+  if (!/\.(xlsx|xls)$/iu.test(file?.name || '')) {
+    ElMessage.error('仅支持 xls、xlsx 文件')
+    return false
+  }
+  return true
+}
+
+function onImportProgress() {
+  importUploading.value = true
+}
+
+function onImportSuccess(response) {
+  importUploading.value = false
+  if (response?.code && response.code !== 200) {
+    ElMessage.error(response.msg || '导入失败,请检查文件格式')
+    return
+  }
+  const data = response.data
+  importResult.value = typeof data === 'object' && data !== null
+    ? { ...data, failures: data.failures || [] }
+    : null
+  uploadRef.value?.clearFiles()
+  const message = typeof data === 'string'
+    ? data
+    : (data?.message || `导入完成:成功 ${data?.successCount ?? 0} 条,失败 ${data?.failureCount ?? 0} 条`)
+  ElMessage.success(message)
+  emit('imported')
+}
+
+function onImportError(error) {
+  importUploading.value = false
+  ElMessage.error(error?.message || '导入失败,请检查文件格式')
+}
+
+function downloadTemplate() {
+  download(props.templateUrl, {}, `${props.title}导入模板.xlsx`)
+}
+
+function resetImport() {
+  updateSupport.value = false
+  importUploading.value = false
+  importResult.value = null
+  uploadRef.value?.clearFiles()
+}
+</script>
+
+<style scoped lang="scss">
+.import-dict-hint {
+  margin-top: 4px;
+  color: #606266;
+}
+
+.import-result {
+  margin-top: 16px;
+}
+
+.import-result-summary {
+  margin-bottom: 10px;
+  font-size: 14px;
+  color: #303133;
+}
+
+.import-result-summary strong {
+  color: #67c23a;
+  font-size: 16px;
+}
+
+.import-result-summary strong.is-failure {
+  color: #f56c6c;
+}
+</style>

+ 273 - 0
src/views/subSystem/pipeNetwork/facilities/components/FacilityLocationFields.vue

@@ -0,0 +1,273 @@
+<template>
+  <!-- 地址 + 地图坐标:上下两排,统一放在备注前一栏 -->
+  <el-col :span="24">
+    <el-form-item label="地址" :prop="addressProp">
+      <el-input
+        :model-value="modelValue[addressProp]"
+        placeholder="请输入或通过地图选择地址"
+        @update:model-value="updateAddress"
+      />
+    </el-form-item>
+    <el-form-item label="地图坐标">
+      <div class="coordinate-row">
+        <el-input-number
+          :model-value="modelValue[longitudeProp]"
+          :precision="6"
+          :step="0.000001"
+          controls-position="right"
+          placeholder="经度"
+          @update:model-value="(v) => updateField(longitudeProp, v)"
+        />
+        <el-input-number
+          :model-value="modelValue[latitudeProp]"
+          :precision="6"
+          :step="0.000001"
+          controls-position="right"
+          placeholder="纬度"
+          @update:model-value="(v) => updateField(latitudeProp, v)"
+        />
+        <el-button type="primary" plain @click="openMapPicker">地图选点</el-button>
+      </div>
+      <div class="coordinate-tip">{{ locationTip || '点击地图获取经纬度,地址将自动回填到地址栏,也可以直接手工修改。' }}</div>
+    </el-form-item>
+  </el-col>
+
+  <!-- 地图选点弹窗 -->
+  <el-dialog v-model="mapOpen" title="地图选点" width="760px" append-to-body>
+    <div class="map-picker-search">
+      <el-input
+        v-model="mapSearchKeyword"
+        placeholder="搜索地名或地址,如:沅陵县太常片区"
+        clearable
+        @keyup.enter="handleMapSearch"
+      />
+      <el-button type="primary" :loading="mapSearchLoading" @click="handleMapSearch">搜索</el-button>
+      <el-select
+        v-if="mapSearchResults.length"
+        v-model="mapSearchSelected"
+        placeholder="选择搜索结果"
+        style="width: 260px"
+        @change="handlePlaceSelect"
+      >
+        <el-option
+          v-for="(place, index) in mapSearchResults"
+          :key="index"
+          :label="place.name + (place.address ? ' · ' + place.address : '')"
+          :value="index"
+        />
+      </el-select>
+    </div>
+    <div class="map-picker-search-tip">{{ mapSearchTip }}</div>
+    <div class="map-picker">
+      <GisMapCanvas
+        ref="mapCanvasRef"
+        :center="mapCenter"
+        :zoom="mapZoom"
+        :points="mapPoints"
+        :enable-clustering="false"
+        :show-marker-name="false"
+        @map-click="handleMapClick"
+      />
+    </div>
+    <div class="map-picker-coordinates">当前坐标:经度 {{ modelValue[longitudeProp] ?? '-' }},纬度 {{ modelValue[latitudeProp] ?? '-' }}</div>
+    <div class="map-picker-coordinates">解析地址:{{ modelValue[addressProp] || '点击地图后自动解析' }}</div>
+    <template #footer>
+      <el-button @click="mapOpen = false">关 闭</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import { nextTick, ref } from 'vue'
+import GisMapCanvas from '@/components/GisMapCanvas.vue'
+import { lookupAddress, lookupPlaces, pickBestPlace } from '@/utils/mapApi'
+
+const props = defineProps({
+  modelValue: { type: Object, required: true },
+  addressProp: { type: String, default: 'location' },
+  longitudeProp: { type: String, default: 'longitude' },
+  latitudeProp: { type: String, default: 'latitude' }
+})
+const emit = defineEmits(['update:modelValue'])
+
+const DEFAULT_MAP_CENTER = { lng: 110.367622375, lat: 28.442230225 }
+const mapOpen = ref(false)
+const mapCenter = ref({ ...DEFAULT_MAP_CENTER })
+const mapPoints = ref([])
+const mapZoom = ref(15)
+const mapCanvasRef = ref(null)
+const mapSearchKeyword = ref('')
+const mapSearchResults = ref([])
+const mapSearchSelected = ref(null)
+const mapSearchLoading = ref(false)
+const mapSearchTip = ref('')
+const locationTip = ref('')
+
+function updateFields(patch) {
+  // 一次性提交所有变更,避免连续 updateField 时后一次基于旧 props 覆盖前一次(经度丢失)
+  emit('update:modelValue', { ...props.modelValue, ...patch })
+}
+
+function updateField(prop, value) {
+  updateFields({ [prop]: value })
+}
+
+function updateAddress(value) {
+  updateField(props.addressProp, value)
+}
+
+async function resolveAddressPatch(lng, lat) {
+  locationTip.value = '正在解析地址...'
+  const address = await lookupAddress(lng, lat)
+  if (address) {
+    locationTip.value = '已按选点回填地址,可手工修改。'
+    return { [props.addressProp]: address }
+  }
+  locationTip.value = '地址解析失败,请手动填写地址。'
+  return {}
+}
+
+function openMapPicker() {
+  const rawLng = props.modelValue[props.longitudeProp]
+  const rawLat = props.modelValue[props.latitudeProp]
+  const longitude = Number(rawLng)
+  const latitude = Number(rawLat)
+  const hasCoordinate = rawLng !== null && rawLng !== undefined && rawLng !== ''
+    && rawLat !== null && rawLat !== undefined && rawLat !== ''
+    && Number.isFinite(longitude) && Number.isFinite(latitude)
+  mapCenter.value = hasCoordinate ? { lng: longitude, lat: latitude } : { ...DEFAULT_MAP_CENTER }
+  mapPoints.value = hasCoordinate ? [{ lng: longitude, lat: latitude, name: '当前位置' }] : []
+  mapZoom.value = hasCoordinate ? 16 : 13
+  mapSearchKeyword.value = ''
+  mapSearchResults.value = []
+  mapSearchSelected.value = null
+  mapSearchTip.value = hasCoordinate
+    ? '已定位到当前坐标,可搜索地名或在地图上重新选点。'
+    : '默认定位到系统中心点,可搜索地名或在地图上选点。'
+  locationTip.value = ''
+  mapOpen.value = true
+}
+
+async function handleMapSearch() {
+  const keyword = mapSearchKeyword.value.trim()
+  if (!keyword) {
+    mapSearchResults.value = []
+    mapSearchSelected.value = null
+    mapSearchTip.value = '请输入地名或地址后再搜索。'
+    return
+  }
+  mapSearchLoading.value = true
+  mapSearchTip.value = '正在搜索...'
+  try {
+    const places = await lookupPlaces(keyword)
+    mapSearchResults.value = places
+    if (!places.length) {
+      mapSearchSelected.value = null
+      mapSearchTip.value = '未搜索到相关地点,请换个关键词重试。'
+      return
+    }
+    const best = pickBestPlace(places, keyword)
+    mapSearchSelected.value = Math.max(0, places.indexOf(best))
+    mapSearchTip.value = `找到 ${places.length} 个结果,已定位到「${best?.name || '第一个'}」,可下拉切换。`
+    applyMapPlace(best)
+  } catch (error) {
+    mapSearchResults.value = []
+    mapSearchSelected.value = null
+    mapSearchTip.value = '搜索服务调用失败,请检查 /tdtApi 代理与天地图 tk 配置。'
+  } finally {
+    mapSearchLoading.value = false
+  }
+}
+
+function handlePlaceSelect(index) {
+  const place = mapSearchResults.value[index]
+  if (place) applyMapPlace(place)
+}
+
+async function applyMapPlace(place) {
+  const lng = Number(place.lng)
+  const lat = Number(place.lat)
+  const point = { lng, lat }
+  mapCenter.value = point
+  mapZoom.value = 16
+  mapPoints.value = [{ ...point, name: place.name || '搜索结果' }]
+  nextTick(() => mapCanvasRef.value?.locatePoint(point))
+
+  const patch = {
+    [props.longitudeProp]: Number(lng.toFixed(6)),
+    [props.latitudeProp]: Number(lat.toFixed(6))
+  }
+  if (place.address) {
+    patch[props.addressProp] = place.address
+    locationTip.value = '已按搜索结果回填地址,可手工修改。'
+  } else {
+    Object.assign(patch, await resolveAddressPatch(lng, lat))
+  }
+  updateFields(patch)
+}
+
+async function handleMapClick(point) {
+  if (!point) return
+  const longitude = Number(point.lng)
+  const latitude = Number(point.lat)
+  mapPoints.value = [{ lng: longitude, lat: latitude, name: '当前位置' }]
+
+  const patch = {
+    [props.longitudeProp]: Number(longitude.toFixed(6)),
+    [props.latitudeProp]: Number(latitude.toFixed(6))
+  }
+  Object.assign(patch, await resolveAddressPatch(point.lng, point.lat))
+  updateFields(patch)
+}
+
+defineExpose({ resetTip: () => { locationTip.value = '' } })
+</script>
+
+<style scoped lang="scss">
+.coordinate-row {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  width: 100%;
+
+  :deep(.el-input-number) {
+    flex: 1;
+  }
+}
+
+.coordinate-tip {
+  margin-top: 6px;
+  color: #9ca3af;
+  font-size: 12px;
+}
+
+.map-picker-search {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  margin-bottom: 6px;
+
+  :deep(.el-input) {
+    flex: 1;
+  }
+}
+
+.map-picker-search-tip {
+  margin-bottom: 10px;
+  color: #9ca3af;
+  font-size: 12px;
+}
+
+.map-picker {
+  height: 420px;
+  overflow: hidden;
+  border: 1px solid #e5e7eb;
+  border-radius: 6px;
+}
+
+.map-picker-coordinates {
+  margin-top: 10px;
+  color: #6b7280;
+  font-size: 13px;
+}
+</style>

+ 521 - 0
src/views/subSystem/pipeNetwork/facilities/components/InfrastructureCrudPage.vue

@@ -0,0 +1,521 @@
+<template>
+  <div class="app-container infra-page">
+    <!-- 页头 -->
+    <div class="page-head">
+      <div class="page-title">
+        <span class="page-title-bar" />
+        <h2>{{ title || '设施信息' }}</h2>
+      </div>
+      <div class="page-actions">
+        <el-button v-if="showAdd" type="primary" plain icon="Plus" @click="handleAdd">{{ addText }}</el-button>
+        <el-button v-if="showDelete" type="danger" plain icon="Delete" :disabled="selection.length === 0" @click="handleDelete()">
+          删除
+        </el-button>
+        <el-button v-if="showImport" type="info" plain icon="Upload" @click="importVisible = true">导入</el-button>
+        <el-button v-if="showExport" type="success" plain icon="Download" :loading="exporting" @click="handleExport">导出</el-button>
+      </div>
+    </div>
+
+    <!-- 查询条件 -->
+    <el-card shadow="never" class="filter-card">
+      <el-form :inline="true" class="query-form" @submit.prevent>
+        <el-form-item v-for="field in queryFields" :key="field.prop" :label="field.label">
+          <el-select
+            v-if="field.type === 'dict'"
+            v-model="query[field.prop]"
+            clearable
+            :disabled="field.disabled"
+            :placeholder="field.placeholder || '请选择' + field.label"
+            style="width: 170px"
+          >
+            <el-option
+              v-for="option in dictOptions(field.dictType)"
+              :key="option.value"
+              :label="option.label"
+              :value="option.value"
+            />
+          </el-select>
+          <el-input
+            v-else
+            v-model="query[field.prop]"
+            clearable
+            :placeholder="field.placeholder || '请输入' + field.label"
+            style="width: 180px"
+            @keyup.enter="handleQuery"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+
+    <!-- 列表 -->
+    <el-card shadow="never" class="table-card">
+      <el-table v-loading="loading" :data="rows" border stripe @selection-change="onSelectionChange">
+        <el-table-column type="selection" width="48" align="center" />
+        <el-table-column
+          v-for="column in columns"
+          :key="column.prop"
+          :prop="column.prop"
+          :label="column.label"
+          :min-width="column.width || 120"
+          show-overflow-tooltip
+        >
+          <template #default="{ row }">
+            <el-tag v-if="column.dictType" :type="tagType(row[column.prop], column.dictType)">
+              {{ labelOf(row[column.prop], column.dictType) }}
+            </el-tag>
+            <span v-else>{{ display(row[column.prop]) }}</span>
+          </template>
+        </el-table-column>
+        <slot name="table-columns-extra" />
+        <el-table-column :label="actionColumnLabel" :width="actionColumnWidth" fixed="right" align="center">
+          <template #default="{ row }">
+            <slot name="row-actions" :row="row" :edit="handleEdit" :remove="handleDelete">
+              <el-button link type="primary" icon="Edit" @click="handleEdit(row)">修改</el-button>
+              <el-button link type="danger" icon="Delete" @click="handleDelete(row)">删除</el-button>
+            </slot>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        v-model:page="query.pageNum"
+        v-model:limit="query.pageSize"
+        @pagination="loadList"
+      />
+    </el-card>
+
+    <!-- 新增 / 修改 -->
+    <el-dialog v-model="dialogVisible" :title="dialogTitle" width="780px" append-to-body destroy-on-close>
+      <el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
+        <el-row :gutter="16">
+          <template v-for="field in formFields" :key="field.prop">
+            <!-- 位置描述字段由「地址 + 地图坐标」组件统一承载,放在备注上一栏 -->
+            <FacilityLocationFields
+              v-if="field.prop === 'location'"
+              :model-value="form"
+              address-prop="location"
+              @update:model-value="(val) => Object.assign(form, val)"
+            />
+            <el-col v-else :span="field.span || 12">
+              <el-form-item :label="field.label" :prop="field.prop">
+                <el-select
+                  v-if="field.type === 'dict'"
+                  v-model="form[field.prop]"
+                  clearable
+                  :disabled="field.disabled"
+                  :placeholder="field.placeholder || '请选择' + field.label"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="option in dictOptions(field.dictType)"
+                    :key="option.value"
+                    :label="option.label"
+                    :value="option.value"
+                  />
+                </el-select>
+                <el-input-number
+                  v-else-if="field.type === 'number'"
+                  v-model="form[field.prop]"
+                  :precision="field.precision === undefined ? 2 : field.precision"
+                  controls-position="right"
+                  style="width: 100%"
+                />
+                <el-date-picker
+                  v-else-if="field.type === 'date'"
+                  v-model="form[field.prop]"
+                  :type="field.dateType || 'date'"
+                  :value-format="field.valueFormat || (field.dateType === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')"
+                  :disabled="field.disabled"
+                  :placeholder="field.placeholder || '请选择' + field.label"
+                  style="width: 100%"
+                />
+                <el-input
+                  v-else-if="field.type === 'textarea'"
+                  v-model="form[field.prop]"
+                  type="textarea"
+                  :rows="3"
+                  :placeholder="field.placeholder || '请输入' + field.label"
+                />
+                <el-input
+                  v-else
+                  v-model="form[field.prop]"
+                  :placeholder="field.placeholder || '请输入' + field.label"
+                />
+              </el-form-item>
+            </el-col>
+          </template>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <el-button type="primary" :loading="submitting" @click="submitForm">确 定</el-button>
+        <el-button @click="dialogVisible = false">取 消</el-button>
+      </template>
+    </el-dialog>
+
+    <!-- 批量导入 -->
+    <FacilityImportDialog
+      v-if="showImport"
+      v-model="importVisible"
+      :title="importTitle || title"
+      :upload-url="importUrl"
+      :template-url="templateUrl"
+      :dict-hint="dictHint"
+      @imported="onImported"
+    />
+  </div>
+</template>
+
+<script setup>
+import { computed, getCurrentInstance, nextTick, onMounted, reactive, ref, watch } from 'vue'
+import { saveAs } from 'file-saver'
+import request from '@/utils/request'
+import { getDicts } from '@/api/system/dict/data'
+import FacilityImportDialog from './FacilityImportDialog.vue'
+import FacilityLocationFields from './FacilityLocationFields.vue'
+
+const props = defineProps({
+  /** 查询条件字段 */
+  queryFields: { type: Array, default: () => [] },
+  /** 表格列 */
+  columns: { type: Array, required: true },
+  /** 表单字段 */
+  formFields: { type: Array, default: () => [] },
+  /** 接口集合:{ page, detail, save, update, remove } */
+  api: { type: Object, required: true },
+  /** 主键字段名 */
+  idField: { type: String, default: 'id' },
+  /** 固定附加查询条件(如排水闸门固定 facilityType=0) */
+  extraQuery: { type: Object, default: () => ({}) },
+  /** 查询初值 */
+  defaultQuery: { type: Object, default: () => ({}) },
+  /** 标题文案(删除提示用) */
+  title: { type: String, default: '' },
+  /** 新增按钮文案 */
+  addText: { type: String, default: '新增' },
+  /** 是否展示新增 */
+  showAdd: { type: Boolean, default: true },
+  /** 是否展示批量删除 */
+  showDelete: { type: Boolean, default: true },
+  /** 是否展示导入 */
+  showImport: { type: Boolean, default: false },
+  /** 是否展示导出 */
+  showExport: { type: Boolean, default: false },
+  /** 导入地址,showImport=true 时必填 */
+  importUrl: { type: String, default: '' },
+  /** 模板下载地址,showImport=true 时必填 */
+  templateUrl: { type: String, default: '' },
+  /** 导出地址(GET,返回 xlsx) */
+  exportUrl: { type: String, default: '' },
+  /** 导入弹窗标题 */
+  importTitle: { type: String, default: '' },
+  /** 导入模板字典列说明 */
+  dictHint: { type: String, default: '' },
+  /** 导出文件名前缀 */
+  exportFileName: { type: String, default: '' },
+  /** 作为视图切换使用的查询字段名(变化时 emit switch-change) */
+  switchField: { type: String, default: '' },
+  /** 操作列表头/宽度 */
+  actionColumnLabel: { type: String, default: '操作' },
+  actionColumnWidth: { type: Number, default: 170 }
+})
+const emit = defineEmits(['switch-change'])
+
+const { proxy } = getCurrentInstance()
+
+// ==================== 字典 ====================
+const dictMap = reactive({})
+
+function loadDict(dictType) {
+  if (!dictType || dictMap[dictType]) return
+  getDicts(dictType)
+    .then((res) => {
+      dictMap[dictType] = (res.data || []).map((item) => ({
+        value: item.dictValue,
+        label: item.dictLabel,
+        listClass: item.listClass
+      }))
+    })
+    .catch(() => {
+      dictMap[dictType] = []
+    })
+}
+
+function dictOptions(dictType) {
+  return dictMap[dictType] || []
+}
+
+function labelOf(value, dictType) {
+  if (value === null || value === undefined || value === '') return '-'
+  const hit = dictOptions(dictType).find((option) => String(option.value) === String(value))
+  return hit ? hit.label : value
+}
+
+function tagType(value, dictType) {
+  if (value === null || value === undefined || value === '') return 'info'
+  const hit = dictOptions(dictType).find((option) => String(option.value) === String(value))
+  return (hit && hit.listClass) || 'info'
+}
+
+function display(value) {
+  return value === null || value === undefined || value === '' ? '-' : value
+}
+
+function collectDictTypes() {
+  const types = new Set()
+  const collect = (list) => (list || []).forEach((field) => field.dictType && types.add(field.dictType))
+  collect(props.queryFields)
+  collect(props.columns)
+  collect(props.formFields)
+  types.forEach(loadDict)
+}
+
+onMounted(() => {
+  collectDictTypes()
+  loadList()
+})
+
+// ==================== 列表 ====================
+const rows = ref([])
+const total = ref(0)
+const loading = ref(false)
+const selection = ref([])
+const query = reactive({
+  pageNum: 1,
+  pageSize: 10,
+  ...props.defaultQuery
+})
+
+if (props.switchField) {
+  watch(() => query[props.switchField], (value) => {
+    emit('switch-change', value)
+    nextTick(handleQuery)
+  })
+}
+
+function buildParams() {
+  const params = { ...query }
+  Object.keys(params).forEach((key) => {
+    if (params[key] === '' || params[key] === undefined || params[key] === null) {
+      delete params[key]
+    }
+  })
+  return { ...params, ...props.extraQuery }
+}
+
+async function loadList() {
+  loading.value = true
+  try {
+    const res = await props.api.page(buildParams())
+    const payload = res && res.data && res.data.records !== undefined ? res.data : res || {}
+    rows.value = payload.records || []
+    total.value = payload.total || 0
+  } catch (error) {
+    rows.value = []
+    total.value = 0
+  } finally {
+    loading.value = false
+  }
+}
+
+function handleQuery() {
+  query.pageNum = 1
+  loadList()
+}
+
+function resetQuery() {
+  Object.keys(query).forEach((key) => {
+    if (key !== 'pageNum' && key !== 'pageSize') {
+      query[key] = ''
+    }
+  })
+  query.pageNum = 1
+  loadList()
+}
+
+function onSelectionChange(list) {
+  selection.value = list
+}
+
+// ==================== 导入 / 导出 ====================
+const importVisible = ref(false)
+const exporting = ref(false)
+
+function onImported() {
+  handleQuery()
+}
+
+function handleExport() {
+  if (!props.exportUrl) {
+    proxy.$modal.msgError('未配置导出地址')
+    return
+  }
+  exporting.value = true
+  request({
+    url: props.exportUrl,
+    method: 'get',
+    params: buildParams(),
+    responseType: 'blob'
+  })
+    .then((blob) => {
+      const name = props.exportFileName || props.title || '设施信息'
+      saveAs(new Blob([blob]), `${name}_${new Date().toISOString().slice(0, 10)}.xlsx`)
+    })
+    .catch(() => proxy.$modal.msgError('导出失败,请稍后重试'))
+    .finally(() => {
+      exporting.value = false
+    })
+}
+
+// ==================== 表单 ====================
+const dialogVisible = ref(false)
+const dialogTitle = ref('')
+const submitting = ref(false)
+const formRef = ref()
+const form = reactive({})
+
+const rules = computed(() => {
+  const result = {}
+  props.formFields
+    .filter((field) => field.required)
+    .forEach((field) => {
+      result[field.prop] = [{ required: true, message: `请填写${field.label}`, trigger: 'blur' }]
+    })
+  return result
+})
+
+function emptyForm() {
+  const initial = { status: '0' }
+  props.formFields.forEach((field) => {
+    if (!(field.prop in initial)) {
+      initial[field.prop] = field.default !== undefined
+        ? field.default
+        : (field.type === 'number' ? undefined : '')
+    }
+  })
+  return initial
+}
+
+function handleAdd() {
+  Object.keys(form).forEach((key) => delete form[key])
+  Object.assign(form, emptyForm())
+  dialogTitle.value = props.addText
+  dialogVisible.value = true
+}
+
+function handleEdit(row) {
+  Object.keys(form).forEach((key) => delete form[key])
+  Object.assign(form, row)
+  dialogTitle.value = '修改'
+  dialogVisible.value = true
+}
+
+function submitForm() {
+  formRef.value.validate((valid) => {
+    if (!valid) return
+    submitting.value = true
+    const payload = { ...form }
+    const idValue = payload[props.idField]
+    const isEdit = idValue !== undefined && idValue !== null && idValue !== ''
+    const action = isEdit ? props.api.update(payload) : props.api.save(payload)
+    action
+      .then(() => {
+        proxy.$modal.msgSuccess(isEdit ? '修改成功' : '新增成功')
+        dialogVisible.value = false
+        loadList()
+      })
+      .catch((error) => {
+        proxy.$modal.msgError(error?.msg || (isEdit ? '修改失败' : '新增失败'))
+      })
+      .finally(() => {
+        submitting.value = false
+      })
+  })
+}
+
+function handleDelete(row) {
+  const ids = row && row[props.idField] ? [row[props.idField]] : selection.value.map((item) => item[props.idField])
+  if (!ids || ids.length === 0) {
+    proxy.$modal.msgError('请先选择要删除的数据')
+    return
+  }
+  proxy.$modal
+    .confirm(`是否确认删除选中的 ${ids.length} 条${props.title || ''}数据?`)
+    .then(() => props.api.remove(ids))
+    .then(() => {
+      proxy.$modal.msgSuccess('删除成功')
+      loadList()
+    })
+    .catch(() => {})
+}
+</script>
+
+<style scoped lang="scss">
+.infra-page {
+  background: #f5f8fc;
+}
+
+.page-head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 12px;
+  margin-bottom: 16px;
+}
+
+.page-title {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+
+.page-title-bar {
+  width: 4px;
+  height: 20px;
+  border-radius: 2px;
+  background: var(--el-color-primary);
+}
+
+.page-title h2 {
+  margin: 0;
+  font-size: 18px;
+  font-weight: 600;
+  color: #1f2937;
+}
+
+.page-actions {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  flex-wrap: wrap;
+}
+
+.filter-card {
+  margin-bottom: 16px;
+  border-radius: 12px;
+}
+
+.table-card {
+  border-radius: 12px;
+}
+
+.query-form {
+  margin-bottom: 0;
+
+  :deep(.el-form-item) {
+    margin-bottom: 0;
+  }
+}
+
+@media (max-width: 768px) {
+  .page-head {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+}
+</style>

+ 69 - 0
src/views/subSystem/pipeNetwork/facilities/drainageGate/index.vue

@@ -0,0 +1,69 @@
+<script setup>
+import InfrastructureCrudPage from '../components/InfrastructureCrudPage.vue'
+import {
+  addDrainageGate,
+  delDrainageGate,
+  getDrainageGate,
+  listDrainageGate,
+  updateDrainageGate
+} from '@/api/pipeNetwork/facilities'
+
+const queryFields = [
+  { prop: 'facilityCode', label: '闸门编号' },
+  { prop: 'facilityName', label: '闸门名称' },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' }
+]
+
+const columns = [
+  { prop: 'facilityCode', label: '闸门编号', width: 140 },
+  { prop: 'facilityName', label: '闸门名称', width: 160 },
+  { prop: 'facilityLevel', label: '设施等级', width: 100, dictType: 'drainage_facility_level' },
+  { prop: 'managementUnit', label: '管理单位', width: 160 },
+  { prop: 'location', label: '地址', width: 180 },
+  { prop: 'designFlow', label: '设计流量(m³/s)', width: 140 },
+  { prop: 'designHead', label: '设计水头(m)', width: 130 },
+  { prop: 'buildDate', label: '建设日期', width: 120 },
+  { prop: 'status', label: '状态', width: 90, dictType: 'infrastructure_status' }
+]
+
+const formFields = [
+  { prop: 'facilityCode', label: '闸门编号', required: true },
+  { prop: 'facilityName', label: '闸门名称', required: true },
+  { prop: 'facilityLevel', label: '设施等级', type: 'dict', dictType: 'drainage_facility_level' },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' },
+  { prop: 'managementUnit', label: '管理单位' },
+  { prop: 'buildDate', label: '建设日期', placeholder: '如 2026-01-01' },
+  { prop: 'designFlow', label: '设计流量(m³/s)', type: 'number' },
+  { prop: 'designHead', label: '设计水头(m)', type: 'number' },
+  { prop: 'equipmentId', label: '关联设备ID' },
+  { prop: 'location', label: '地址', span: 24 },
+  { prop: 'remark', label: '备注', type: 'textarea', span: 24 }
+]
+
+const api = {
+  page: listDrainageGate,
+  detail: getDrainageGate,
+  save: addDrainageGate,
+  update: updateDrainageGate,
+  remove: (ids) => Promise.all(ids.map((id) => delDrainageGate(id)))
+}
+</script>
+
+<template>
+  <InfrastructureCrudPage
+    title="排水闸门信息"
+    add-text="新增闸门"
+    id-field="facilityId"
+    :query-fields="queryFields"
+    :columns="columns"
+    :form-fields="formFields"
+    :api="api"
+    show-import
+    show-export
+    import-url="/api/infrastructure/gate/importData"
+    template-url="/api/infrastructure/gate/importTemplate"
+    export-url="/api/infrastructure/gate/export"
+    export-file-name="排水闸门信息"
+    dict-hint="设施等级、状态请从模板下拉框中选择中文"
+  />
+</template>

+ 69 - 0
src/views/subSystem/pipeNetwork/facilities/drainageStorage/index.vue

@@ -0,0 +1,69 @@
+<script setup>
+import InfrastructureCrudPage from '../components/InfrastructureCrudPage.vue'
+import {
+  addDrainageStorage,
+  delDrainageStorage,
+  getDrainageStorage,
+  listDrainageStorage,
+  updateDrainageStorage
+} from '@/api/pipeNetwork/facilities'
+
+const queryFields = [
+  { prop: 'facilityCode', label: '设施编号' },
+  { prop: 'facilityName', label: '设施名称' },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' }
+]
+
+const columns = [
+  { prop: 'facilityCode', label: '设施编号', width: 140 },
+  { prop: 'facilityName', label: '设施名称', width: 160 },
+  { prop: 'facilityLevel', label: '设施等级', width: 100, dictType: 'drainage_facility_level' },
+  { prop: 'managementUnit', label: '管理单位', width: 160 },
+  { prop: 'location', label: '地址', width: 180 },
+  { prop: 'storageCapacity', label: '调蓄容积(m³)', width: 140 },
+  { prop: 'designFlow', label: '设计流量(m³/s)', width: 140 },
+  { prop: 'buildDate', label: '建设日期', width: 120 },
+  { prop: 'status', label: '状态', width: 90, dictType: 'infrastructure_status' }
+]
+
+const formFields = [
+  { prop: 'facilityCode', label: '设施编号', required: true },
+  { prop: 'facilityName', label: '设施名称', required: true },
+  { prop: 'facilityLevel', label: '设施等级', type: 'dict', dictType: 'drainage_facility_level' },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' },
+  { prop: 'managementUnit', label: '管理单位' },
+  { prop: 'buildDate', label: '建设日期', placeholder: '如 2026-01-01' },
+  { prop: 'storageCapacity', label: '调蓄容积(m³)', type: 'number' },
+  { prop: 'designFlow', label: '设计流量(m³/s)', type: 'number' },
+  { prop: 'equipmentId', label: '关联设备ID' },
+  { prop: 'location', label: '地址', span: 24 },
+  { prop: 'remark', label: '备注', type: 'textarea', span: 24 }
+]
+
+const api = {
+  page: listDrainageStorage,
+  detail: getDrainageStorage,
+  save: addDrainageStorage,
+  update: updateDrainageStorage,
+  remove: (ids) => Promise.all(ids.map((id) => delDrainageStorage(id)))
+}
+</script>
+
+<template>
+  <InfrastructureCrudPage
+    title="排水调蓄设施信息"
+    add-text="新增调蓄设施"
+    id-field="facilityId"
+    :query-fields="queryFields"
+    :columns="columns"
+    :form-fields="formFields"
+    :api="api"
+    show-import
+    show-export
+    import-url="/api/infrastructure/storage/importData"
+    template-url="/api/infrastructure/storage/importTemplate"
+    export-url="/api/infrastructure/storage/export"
+    export-file-name="排水调蓄设施信息"
+    dict-hint="设施等级、状态请从模板下拉框中选择中文"
+  />
+</template>

+ 287 - 0
src/views/subSystem/pipeNetwork/facilities/manhole/index.vue

@@ -0,0 +1,287 @@
+<script setup>
+import { ref } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import InfrastructureCrudPage from '../components/InfrastructureCrudPage.vue'
+import {
+  addManholeInfo,
+  delManholeInfo,
+  getManholeInfo,
+  listManholeInfo,
+  updateManholeInfo,
+  searchManholeBindDevices,
+  listManholeBoundDevices,
+  listManholeBoundEquipmentIds,
+  bindManholeDevice,
+  unbindManholeDevice
+} from '@/api/pipeNetwork/facilities'
+
+const queryFields = [
+  { prop: 'manholeCode', label: '窨井编码' },
+  { prop: 'manholeName', label: '窨井名称' },
+  { prop: 'manholeType', label: '窨井类型', type: 'dict', dictType: 'manhole_type' },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' }
+]
+
+const columns = [
+  { prop: 'manholeCode', label: '窨井编码', width: 140 },
+  { prop: 'manholeName', label: '窨井名称', width: 160 },
+  { prop: 'manholeType', label: '窨井类型', width: 110, dictType: 'manhole_type' },
+  { prop: 'location', label: '地址', width: 200 },
+  { prop: 'longitude', label: '经度', width: 120 },
+  { prop: 'latitude', label: '纬度', width: 120 },
+  { prop: 'ownershipUnit', label: '权属单位', width: 160 },
+  { prop: 'status', label: '状态', width: 90, dictType: 'infrastructure_status' }
+]
+
+const formFields = [
+  { prop: 'manholeCode', label: '窨井编码', required: true },
+  { prop: 'manholeName', label: '窨井名称', required: true },
+  { prop: 'manholeType', label: '窨井类型', type: 'dict', dictType: 'manhole_type', required: true },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' },
+  { prop: 'manholeDepth', label: '井深(米)', type: 'number' },
+  { prop: 'manholeShape', label: '形状' },
+  { prop: 'material', label: '材质' },
+  { prop: 'ownershipUnit', label: '权属单位' },
+  { prop: 'location', label: '地址', span: 24 },
+  { prop: 'remark', label: '备注', type: 'textarea', span: 24 }
+]
+
+const api = {
+  page: listManholeInfo,
+  detail: getManholeInfo,
+  save: addManholeInfo,
+  update: updateManholeInfo,
+  remove: (ids) => Promise.all(ids.map((id) => delManholeInfo(id)))
+}
+
+// ==================== 设备绑定 ====================
+const currentManhole = ref({})
+const bindVisible = ref(false)
+const bindKeyword = ref('')
+const bindLoading = ref(false)
+const bindRows = ref([])
+const selectedEquipmentIds = ref([])
+const boundRows = ref([])
+const boundEquipmentIds = ref([])
+const allBoundDevices = ref([])
+const viewVisible = ref(false)
+const viewLoading = ref(false)
+
+function unwrap(res) {
+  const data = res?.data !== undefined ? res.data : res
+  return Array.isArray(data) ? data : (data?.records || [])
+}
+
+function sameId(a, b) {
+  return a !== undefined && a !== null && b !== undefined && b !== null && String(a) === String(b)
+}
+
+function findBinding(row) {
+  return allBoundDevices.value.find((item) => sameId(item.equipmentId, row?.equipmentId))
+}
+
+function isBoundToCurrentManhole(row) {
+  return boundEquipmentIds.value.some((id) => sameId(id, row?.equipmentId))
+}
+
+function isBoundToOtherManhole(row) {
+  const binding = findBinding(row)
+  return !!binding && !sameId(binding['manholeId'], currentManhole.value['manholeId'])
+}
+
+function isBoundEquipment(row) {
+  return isBoundToCurrentManhole(row) || isBoundToOtherManhole(row)
+}
+
+function bindStatus(row) {
+  if (isBoundToCurrentManhole(row)) return '已绑定本井'
+  if (isBoundToOtherManhole(row)) return '已绑定其他窨井'
+  return '可绑定'
+}
+
+async function openBind(row) {
+  currentManhole.value = row
+  bindKeyword.value = ''
+  selectedEquipmentIds.value = []
+  boundEquipmentIds.value = []
+  allBoundDevices.value = []
+  boundRows.value = []
+  bindRows.value = []
+  bindVisible.value = true
+  await loadBindDevices()
+}
+
+async function loadBindDevices() {
+  bindLoading.value = true
+  try {
+    const [all, bound, allBound] = await Promise.all([
+      searchManholeBindDevices({ keyword: bindKeyword.value }),
+      listManholeBoundDevices(currentManhole.value['manholeId']),
+      listManholeBoundEquipmentIds()
+    ])
+    const boundList = unwrap(bound)
+    boundRows.value = boundList
+    boundEquipmentIds.value = boundList.map((item) => item.equipmentId)
+    allBoundDevices.value = unwrap(allBound)
+    bindRows.value = unwrap(all)
+    selectedEquipmentIds.value = selectedEquipmentIds.value.filter((id) =>
+      !allBoundDevices.value.some((item) => sameId(item.equipmentId, id))
+    )
+  } catch (error) {
+    bindRows.value = []
+    boundEquipmentIds.value = []
+    allBoundDevices.value = []
+  } finally {
+    bindLoading.value = false
+  }
+}
+
+async function submitBind() {
+  const equipmentIds = selectedEquipmentIds.value.filter((id) =>
+    !allBoundDevices.value.some((item) => sameId(item.equipmentId, id))
+  )
+  if (!equipmentIds.length) {
+    ElMessage.warning('请先选择要绑定的设备')
+    return
+  }
+  bindLoading.value = true
+  try {
+    for (const equipmentId of equipmentIds) {
+      await bindManholeDevice(currentManhole.value['manholeId'], equipmentId)
+    }
+    ElMessage.success('绑定成功')
+    bindVisible.value = false
+  } catch (error) {
+    ElMessage.error(error?.msg || '绑定失败')
+  } finally {
+    bindLoading.value = false
+  }
+}
+
+async function openView(row) {
+  currentManhole.value = row
+  viewLoading.value = true
+  viewVisible.value = true
+  try {
+    boundRows.value = unwrap(await listManholeBoundDevices(row['manholeId']))
+  } catch (error) {
+    boundRows.value = []
+  } finally {
+    viewLoading.value = false
+  }
+}
+
+async function handleUnbind(row) {
+  try {
+    await ElMessageBox.confirm(`确认解绑设备「${row.equipmentName || row.equipmentCode}」?`, '提示', { type: 'warning' })
+    await unbindManholeDevice(row.relId)
+    ElMessage.success('解绑成功')
+    boundRows.value = unwrap(await listManholeBoundDevices(currentManhole.value['manholeId']))
+  } catch (error) {
+    if (error !== 'cancel' && error?.msg) ElMessage.error(error.msg)
+  }
+}
+</script>
+
+<template>
+  <div class="manhole-page">
+    <InfrastructureCrudPage
+      title="窨井信息"
+    add-text="新增窨井"
+    id-field="manholeId"
+    :query-fields="queryFields"
+    :columns="columns"
+    :form-fields="formFields"
+    :api="api"
+    :action-column-width="260"
+    show-import
+    show-export
+    import-url="/api/infrastructure/manhole/importData"
+    template-url="/api/infrastructure/manhole/importTemplate"
+    export-url="/api/infrastructure/manhole/export"
+    export-file-name="窨井信息"
+    dict-hint="窨井类型、状态请从模板下拉框中选择中文"
+  >
+    <template #table-columns-extra>
+      <el-table-column label="绑定设备" width="110" align="center">
+        <template #default="{ row }">
+          <el-button link type="primary" icon="View" @click="openView(row)">查看</el-button>
+        </template>
+      </el-table-column>
+    </template>
+    <template #row-actions="{ row, edit, remove }">
+      <el-button link type="primary" icon="Link" @click="openBind(row)">绑定设备</el-button>
+      <el-button link type="primary" icon="Edit" @click="edit(row)">修改</el-button>
+      <el-button link type="danger" icon="Delete" @click="remove(row)">删除</el-button>
+    </template>
+  </InfrastructureCrudPage>
+
+  <!-- 绑定设备弹窗 -->
+  <el-dialog v-model="bindVisible" title="绑定设备(窨井设备)" width="820px" append-to-body>
+    <div class="bind-toolbar">
+      <span class="bind-hint">仅可绑定窨井设备大类(equipment_type.parent_id=4);一个设备只能绑定一个窨井,已绑定设备不可重复选择</span>
+      <el-input v-model="bindKeyword" placeholder="搜索设备编码/名称/位置" clearable style="width: 260px" @keyup.enter="loadBindDevices" />
+      <el-button type="primary" icon="Search" @click="loadBindDevices">搜索</el-button>
+    </div>
+    <el-table
+      v-loading="bindLoading"
+      :data="bindRows"
+      :row-class-name="({ row }) => isBoundEquipment(row) ? 'bound-row' : ''"
+      height="380"
+      border
+      @selection-change="(list) => (selectedEquipmentIds = list.map((item) => item.equipmentId))"
+    >
+      <el-table-column type="selection" width="48" align="center" :selectable="(row) => !isBoundEquipment(row)" />
+      <el-table-column prop="equipmentCode" label="设备编码" min-width="140" show-overflow-tooltip />
+      <el-table-column prop="equipmentName" label="设备名称" min-width="160" show-overflow-tooltip />
+      <el-table-column prop="equipmentLocation" label="位置" min-width="180" show-overflow-tooltip />
+      <el-table-column label="绑定状态" width="130" align="center">
+        <template #default="{ row }">
+          <el-tag v-if="isBoundToCurrentManhole(row)" type="info" size="small">已绑定本井</el-tag>
+          <el-tag v-else-if="isBoundToOtherManhole(row)" type="warning" size="small">已绑定其他窨井</el-tag>
+          <span v-else>可绑定</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <template #footer>
+      <el-button type="primary" :loading="bindLoading" @click="submitBind">确 定</el-button>
+      <el-button @click="bindVisible = false">取 消</el-button>
+    </template>
+  </el-dialog>
+
+  <!-- 查看已绑定设备弹窗 -->
+  <el-dialog v-model="viewVisible" title="已绑定设备" width="640px" append-to-body>
+    <el-table v-loading="viewLoading" :data="boundRows" border>
+      <el-table-column prop="equipmentCode" label="设备编码" min-width="160" show-overflow-tooltip />
+      <el-table-column prop="equipmentName" label="设备名称" min-width="180" show-overflow-tooltip />
+      <el-table-column label="操作" width="90" align="center">
+        <template #default="{ row }">
+          <el-button link type="danger" @click="handleUnbind(row)">解绑</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <template #footer>
+      <el-button @click="viewVisible = false">关 闭</el-button>
+    </template>
+  </el-dialog>
+  </div>
+</template>
+
+<style scoped lang="scss">
+.bind-toolbar {
+  display: flex;
+  align-items: center;
+  gap: 10px;
+  margin-bottom: 12px;
+}
+
+.bind-hint {
+  flex: 1;
+  color: #909399;
+  font-size: 12px;
+}
+
+:deep(.bound-row) {
+  color: #a8abb2;
+}
+</style>

+ 126 - 101
src/views/subSystem/pipeNetwork/assetInfo/netWorkBase/index.vue → src/views/subSystem/pipeNetwork/facilities/pipeNetwork/index.vue

@@ -3,19 +3,19 @@
   <div class="app-container pipe-network-page">
     <div class="summary-grid">
       <el-card shadow="hover" class="summary-card primary">
-        <div class="summary-label">设施总数</div>
+        <div class="summary-label">管道总数</div>
         <div class="summary-value">{{ summary.totalNetworks }}</div>
-        <div class="summary-desc">已纳入平台的管网基础设施</div>
+        <div class="summary-desc">已纳入平台的管网基础管道</div>
       </el-card>
       <el-card shadow="hover" class="summary-card success">
         <div class="summary-label">正常运行</div>
         <div class="summary-value">{{ summary.activeNetworks }}</div>
-        <div class="summary-desc">状态为正常的设施</div>
+        <div class="summary-desc">状态为正常的管道</div>
       </el-card>
       <el-card shadow="hover" class="summary-card warning">
-        <div class="summary-label">设施类型</div>
+        <div class="summary-label">管道类型</div>
         <div class="summary-value">{{ summary.typeCount }}</div>
-        <div class="summary-desc">当前已覆盖的设施分类数</div>
+        <div class="summary-desc">当前已覆盖的管道分类数</div>
       </el-card>
       <el-card shadow="hover" class="summary-card info">
         <div class="summary-label">关联点位</div>
@@ -31,28 +31,29 @@
         :inline="true"
         v-show="showSearch"
       >
-        <el-form-item label="设施编码" prop="networkCode">
+        <el-form-item label="管道编码" prop="networkCode">
           <el-input
             v-model="queryParams.networkCode"
-            placeholder="请输入设施编码"
+            placeholder="请输入管道编码"
             clearable
             style="width: 220px"
             @keyup.enter="handleQuery"
           />
         </el-form-item>
-        <el-form-item label="设施名称" prop="networkName">
+        <el-form-item label="管道名称" prop="networkName">
           <el-input
             v-model="queryParams.networkName"
-            placeholder="请输入设施名称"
+            placeholder="请输入管道名称"
             clearable
             style="width: 220px"
             @keyup.enter="handleQuery"
           />
         </el-form-item>
-        <el-form-item label="设施类型" prop="networkType">
+        <el-form-item label="管道类型" prop="networkType">
           <el-select
             v-model="queryParams.networkType"
-            placeholder="请选择设施类型"
+            :disabled="lockedNetworkType"
+            placeholder="请选择管道类型"
             clearable
             filterable
             allow-create
@@ -99,9 +100,9 @@
           <template #header>
             <div class="card-header-row">
               <div>
-                <div class="card-title">设施台账</div>
+                <div class="card-title">管道台账</div>
                 <div class="card-subtitle">
-                  支持查询、新增、编辑、删除以及设施与点位联动查看
+                  支持查询、新增、编辑、删除以及管道与点位联动查看
                 </div>
               </div>
               <div class="card-actions">
@@ -116,6 +117,8 @@
                   @click="handleDelete()"
                   >删除</el-button
                 >
+                <el-button type="info" plain icon="Upload" @click="importVisible = true">导入</el-button>
+                <el-button type="success" plain icon="Download" :loading="exporting" @click="handleExport">导出</el-button>
                 <right-toolbar
                   v-model:showSearch="showSearch"
                   @queryTable="getList"
@@ -134,29 +137,23 @@
           >
             <el-table-column type="selection" width="55" align="center" />
             <el-table-column
-              label="设施编码"
+              label="管道编码"
               align="center"
               prop="networkCode"
               min-width="130"
             />
             <el-table-column
-              label="设施名称"
+              label="管道名称"
               align="center"
               prop="networkName"
               min-width="180"
               show-overflow-tooltip
             />
-            <el-table-column label="设施类型" align="center" min-width="120">
+            <el-table-column label="管道类型" align="center" min-width="120">
               <template #default="scope">
                 {{ getNetworkTypeText(scope.row.networkType) }}
               </template>
             </el-table-column>
-            <el-table-column
-              label="等级"
-              align="center"
-              prop="networkLevel"
-              width="90"
-            />
             <el-table-column
               label="管养单位"
               align="center"
@@ -211,9 +208,9 @@
           <template #header>
             <div class="card-header-row">
               <div>
-                <div class="card-title">设施详情</div>
+                <div class="card-title">管道详情</div>
                 <div class="card-subtitle">
-                  选中设施后可查看基础信息及下挂监测点位
+                  选中管道后可查看基础信息及下挂监测点位
                 </div>
               </div>
               <el-tag
@@ -227,7 +224,7 @@
 
           <el-empty
             v-if="!selectedNetwork.networkId"
-            description="请从左侧选择一条管网设施"
+            description="请从左侧选择一条管网管道"
           />
 
           <template v-else>
@@ -250,10 +247,10 @@
               size="small"
               class="detail-descriptions"
             >
-              <el-descriptions-item label="设施等级">{{
+              <el-descriptions-item label="管道等级">{{
                 selectedNetwork.networkLevel || "-"
               }}</el-descriptions-item>
-              <el-descriptions-item label="位置描述">{{
+              <el-descriptions-item label="地址">{{
                 selectedNetwork.location || "-"
               }}</el-descriptions-item>
               <el-descriptions-item label="经纬度">
@@ -289,26 +286,27 @@
       >
         <el-row :gutter="16">
           <el-col :span="12">
-            <el-form-item label="设施编码" prop="networkCode">
+            <el-form-item label="管道编码" prop="networkCode">
               <el-input
                 v-model="form.networkCode"
-                placeholder="请输入设施编码"
+                placeholder="请输入管道编码"
               />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="设施名称" prop="networkName">
+            <el-form-item label="管道名称" prop="networkName">
               <el-input
                 v-model="form.networkName"
-                placeholder="请输入设施名称"
+                placeholder="请输入管道名称"
               />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="设施类型" prop="networkType">
+            <el-form-item label="管道类型" prop="networkType">
               <el-select
                 v-model="form.networkType"
-                placeholder="请选择设施类型"
+                :disabled="lockedNetworkType"
+                placeholder="请选择管道类型"
                 filterable
                 default-first-option
                 style="width: 100%"
@@ -322,14 +320,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="设施等级" prop="networkLevel">
-              <el-input
-                v-model="form.networkLevel"
-                placeholder="请输入设施等级"
-              />
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="管养单位" prop="managementUnit">
               <el-input
@@ -356,31 +346,6 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item label="位置描述" prop="location">
-              <el-input v-model="form.location" placeholder="请输入位置描述" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="经度" prop="longitude">
-              <el-input-number
-                v-model="form.longitude"
-                :precision="6"
-                :step="0.000001"
-                style="width: 100%"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="纬度" prop="latitude">
-              <el-input-number
-                v-model="form.latitude"
-                :precision="6"
-                :step="0.000001"
-                style="width: 100%"
-              />
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="长度(米)" prop="length">
               <el-input-number
@@ -431,6 +396,11 @@
               />
             </el-form-item>
           </el-col>
+          <FacilityLocationFields
+            :model-value="form"
+            address-prop="location"
+            @update:model-value="(val) => Object.assign(form, val)"
+          />
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
               <el-input
@@ -450,6 +420,15 @@
         </div>
       </template>
     </el-dialog>
+
+    <FacilityImportDialog
+      v-model="importVisible"
+      title="管网基础信息"
+      upload-url="/api/infrastructure/pipeNetwork/importData"
+      template-url="/api/infrastructure/pipeNetwork/importTemplate"
+      dict-hint="管道类型、状态请从模板下拉框中选择中文"
+      @imported="onImported"
+    />
   </div>
 </template>
 
@@ -462,6 +441,7 @@ import {
   ref,
   toRefs,
 } from "vue";
+import { useRoute } from "vue-router";
 import {
   addPipeNetwork,
   delPipeNetwork,
@@ -471,10 +451,25 @@ import {
   listPipeNetworkAll,
   updatePipeNetwork,
 } from "@/api/pipeNetwork/pdeviceInform";
+import { getDicts } from "@/api/system/dict/data";
+import request from "@/utils/request";
+import { saveAs } from "file-saver";
+import FacilityImportDialog from "../components/FacilityImportDialog.vue";
+import FacilityLocationFields from "../components/FacilityLocationFields.vue";
 
 const { proxy } = getCurrentInstance();
 const { network_material } = proxy.useDict("network_material");
 
+// 供水菜单复用本页时,通过 sys_menu.query 下发 networkType=2 固定为供水管道。
+// 也支持父组件通过 fixedNetworkType 传入,便于嵌入式页面复用。
+const props = defineProps({
+  fixedNetworkType: { type: String, default: "" },
+});
+const route = useRoute();
+const queryNetworkType = String(route.query.networkType || "");
+const forcedNetworkType = String(props.fixedNetworkType || queryNetworkType);
+const lockedNetworkType = ["0", "1", "2"].includes(forcedNetworkType);
+
 const networkList = ref([]);
 const loading = ref(false);
 const open = ref(false);
@@ -484,23 +479,30 @@ const multiple = ref(true);
 const total = ref(0);
 const title = ref("");
 const selectedNetwork = ref({});
-const networkTypeOptions = [
-  { label: "燃气设施", value: "0" },
-  { label: "排水设施", value: "1" },
-  { label: "供水设施", value: "2" },
-];
-const statusOptions = [
-  { label: "正常", value: "0" },
-  { label: "维护中", value: "1" },
-  { label: "异常", value: "2" },
-];
-const networkTypeMap = { 0: "燃气设施", 1: "排水设施", 2: "供水设施" };
-const statusMap = { 0: "正常", 1: "维护中", 2: "异常" };
+const importVisible = ref(false);
+const exporting = ref(false);
+// 管道类型 / 状态选项与回显文本均取自字典;状态与其他设施统一使用 infrastructure_status(0正常 1异常)
+const networkTypeDict = ref([]);
+const statusDict = ref([]);
+const loadDict = (type, target) => getDicts(type)
+  .then((res) => { target.value = res.data || [] })
+  .catch(() => { target.value = [] });
+loadDict("pipe_network_facility_type", networkTypeDict);
+loadDict("infrastructure_status", statusDict);
+
+const networkTypeOptions = computed(() =>
+  (networkTypeDict.value || []).map((item) => ({ label: item.dictLabel, value: item.dictValue }))
+);
+const statusOptions = computed(() =>
+  (statusDict.value || []).map((item) => ({ label: item.dictLabel, value: item.dictValue }))
+);
 function getNetworkTypeText(val) {
-  return networkTypeMap[val] || val || "-";
+  const hit = (networkTypeDict.value || []).find((item) => String(item.dictValue) === String(val));
+  return hit ? hit.dictLabel : val || "-";
 }
 function getStatusText(val) {
-  return statusMap[val] || val || "-";
+  const hit = (statusDict.value || []).find((item) => String(item.dictValue) === String(val));
+  return hit ? hit.dictLabel : val || "-";
 }
 // 字典值转名称(兼容历史自由文本材质)
 function getDictLabel(dictData, val) {
@@ -523,19 +525,19 @@ const data = reactive({
     pageSize: 10,
     networkCode: undefined,
     networkName: undefined,
-    networkType: undefined,
+    networkType: lockedNetworkType ? forcedNetworkType : undefined,
     status: undefined,
   },
   form: {},
   rules: {
     networkCode: [
-      { required: true, message: "设施编码不能为空", trigger: "blur" },
+      { required: true, message: "管道编码不能为空", trigger: "blur" },
     ],
     networkName: [
-      { required: true, message: "设施名称不能为空", trigger: "blur" },
+      { required: true, message: "管道名称不能为空", trigger: "blur" },
     ],
     networkType: [
-      { required: true, message: "设施类型不能为空", trigger: "change" },
+      { required: true, message: "管道类型不能为空", trigger: "change" },
     ],
   },
 });
@@ -547,7 +549,7 @@ function createEmptyForm() {
     networkId: undefined,
     networkCode: undefined,
     networkName: undefined,
-    networkType: undefined,
+    networkType: lockedNetworkType ? forcedNetworkType : undefined,
     networkLevel: undefined,
     managementUnit: undefined,
     location: undefined,
@@ -563,16 +565,12 @@ function createEmptyForm() {
 }
 
 function getStatusTagType(status) {
-  if (status === "0") {
-    return "success";
+  const hit = (statusDict.value || []).find((item) => String(item.dictValue) === String(status));
+  const type = hit && hit.listClass;
+  if (type === "success" || type === "warning" || type === "danger" || type === "primary") {
+    return type;
   }
-  if (status === "1") {
-    return "warning";
-  }
-  if (status === "2") {
-    return "danger";
-  }
-  return "";
+  return "info";
 }
 
 function loadSummary() {
@@ -580,24 +578,29 @@ function loadSummary() {
     ([networkRes, pointRes]) => {
       const allNetworks = networkRes.data || [];
       const allPoints = pointRes.data || [];
-      summary.totalNetworks = allNetworks.length;
-      summary.activeNetworks = allNetworks.filter(
+      const scopedNetworks = lockedNetworkType
+        ? allNetworks.filter(
+            (item) => String(item.networkType) === String(forcedNetworkType),
+          )
+        : allNetworks;
+      summary.totalNetworks = scopedNetworks.length;
+      summary.activeNetworks = scopedNetworks.filter(
         (item) => item.status === "0",
       ).length;
       summary.typeCount = new Set(
-        allNetworks.map((item) => item.networkType).filter(Boolean),
+        scopedNetworks.map((item) => item.networkType).filter(Boolean),
       ).size;
       summary.totalPoints = allPoints.length;
 
       if (selectedNetwork.value.networkId) {
-        const refreshed = allNetworks.find(
+        const refreshed = scopedNetworks.find(
           (item) => item.networkId === selectedNetwork.value.networkId,
         );
         if (refreshed) {
           selectedNetwork.value = refreshed;
         }
-      } else if (allNetworks.length) {
-        selectedNetwork.value = allNetworks[0];
+      } else if (scopedNetworks.length) {
+        selectedNetwork.value = scopedNetworks[0];
       }
     },
   );
@@ -633,6 +636,7 @@ function handleQuery() {
 
 function resetQuery() {
   proxy.resetForm("queryRef");
+  queryParams.value.networkType = lockedNetworkType ? forcedNetworkType : undefined;
   handleQuery();
 }
 
@@ -703,7 +707,7 @@ function handleDelete(row) {
     return;
   }
   proxy.$modal
-    .confirm(`是否确认删除选中的 ${deleteIds.length} 条管网设施数据?`)
+    .confirm(`是否确认删除选中的 ${deleteIds.length} 条管网管道数据?`)
     .then(() => Promise.all(deleteIds.map((id) => delPipeNetwork(id))))
     .then(() => {
       proxy.$modal.msgSuccess("删除成功");
@@ -714,6 +718,27 @@ function handleDelete(row) {
     });
 }
 
+function handleExport() {
+  exporting.value = true;
+  request({
+    url: "/api/infrastructure/pipeNetwork/export",
+    method: "get",
+    params: { ...queryParams.value },
+    responseType: "blob"
+  })
+    .then((blob) => {
+      saveAs(new Blob([blob]), `管网基础信息_${new Date().toISOString().slice(0, 10)}.xlsx`);
+    })
+    .catch(() => proxy.$modal.msgError("导出失败,请稍后重试"))
+    .finally(() => {
+      exporting.value = false;
+    });
+}
+
+function onImported() {
+  Promise.all([getList(), loadSummary()]);
+}
+
 onMounted(() => {
   reset();
   Promise.all([getList(), loadSummary()]).then(() => {

+ 120 - 0
src/views/subSystem/pipeNetwork/facilities/pumpStation/index.vue

@@ -0,0 +1,120 @@
+<script setup>
+import { computed, reactive, ref } from 'vue'
+import { useRoute } from 'vue-router'
+import { getDicts } from '@/api/system/dict/data'
+import InfrastructureCrudPage from '../components/InfrastructureCrudPage.vue'
+import {
+  addDrainagePumpStation,
+  addWaterPumpStation,
+  delDrainagePumpStation,
+  delWaterPumpStation,
+  getDrainagePumpStation,
+  getWaterPumpStation,
+  listDrainagePumpStation,
+  listWaterPumpStation,
+  updateDrainagePumpStation,
+  updateWaterPumpStation
+} from '@/api/pipeNetwork/facilities'
+
+// 供水、排水泵站共用 app_user.pump_station_info,归属由后端写入 station_type。
+// 这里的取值来自字典 pump_station_type(0 供水泵站 / 1 排水泵站),仅用于切换调用接口。
+const dictOptions = reactive({})
+getDicts('pump_station_type')
+  .then((res) => { dictOptions.pump_station_type = res.data || [] })
+  .catch(() => { dictOptions.pump_station_type = [] })
+// 支持由 fixedStationType prop 或菜单 sys_menu.query 下发 stationType 锁定视图;
+// 供水菜单传 0,排水场景传 1;未配置时列表/表单不预选,内部接口默认走供水。
+const props = defineProps({
+  fixedStationType: { type: String, default: '' }
+})
+const route = useRoute()
+const queryStationType = String(route.query.stationType || '')
+const forcedType = String(props.fixedStationType || queryStationType)
+const lockedStationType = forcedType === '0' || forcedType === '1'
+const stationType = ref(lockedStationType ? forcedType : '0')
+
+const waterApi = {
+  page: listWaterPumpStation,
+  detail: getWaterPumpStation,
+  save: addWaterPumpStation,
+  update: updateWaterPumpStation,
+  remove: (ids) => delWaterPumpStation(ids.join(','))
+}
+
+const drainageApi = {
+  page: listDrainagePumpStation,
+  detail: getDrainagePumpStation,
+  save: addDrainagePumpStation,
+  update: updateDrainagePumpStation,
+  remove: (ids) => delDrainagePumpStation(ids.join(','))
+}
+
+const apiOf = (type) => (String(type) === '1' ? drainageApi : waterApi)
+const api = computed(() => apiOf(stationType.value))
+
+// 新增/修改弹窗里选的水/排水决定提交到哪套接口;归属仍由后端写入 station_type。
+const formAwareApi = computed(() => ({
+  ...api.value,
+  save: (data) => apiOf(data.stationType ?? stationType.value).save(data),
+  update: (data) => apiOf(data.stationType ?? stationType.value).update(data)
+}))
+
+const queryFields = computed(() => [
+  { prop: 'stationCode', label: '泵站编号' },
+  { prop: 'stationName', label: '泵站名称' },
+  { prop: 'stationType', label: '泵站类型', type: 'dict', dictType: 'pump_station_type', disabled: lockedStationType },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' }
+])
+
+const columns = [
+  { prop: 'stationCode', label: '泵站编号', width: 140 },
+  { prop: 'stationName', label: '泵站名称', width: 160 },
+  { prop: 'location', label: '地址', width: 200 },
+  { prop: 'pumpCount', label: '泵台数', width: 90 },
+  { prop: 'designFlow', label: '设计流量(m³/h)', width: 130 },
+  { prop: 'designHead', label: '设计扬程(m)', width: 120 },
+  { prop: 'principal', label: '责任人', width: 110 },
+  { prop: 'status', label: '状态', width: 90, dictType: 'infrastructure_status' }
+]
+
+const formFields = computed(() => [
+  { prop: 'stationCode', label: '泵站编号', required: true },
+  { prop: 'stationName', label: '泵站名称', required: true },
+  { prop: 'stationType', label: '泵站类型', type: 'dict', dictType: 'pump_station_type', required: true, default: lockedStationType ? forcedType : undefined, disabled: lockedStationType },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' },
+  { prop: 'principal', label: '责任人' },
+  { prop: 'contactPhone', label: '联系电话' },
+  { prop: 'pumpCount', label: '泵台数', type: 'number', precision: 0 },
+  { prop: 'designFlow', label: '设计流量(m³/h)', type: 'number' },
+  { prop: 'designHead', label: '设计扬程(m)', type: 'number' },
+  { prop: 'powerCapacity', label: '装机容量(kW)', type: 'number' },
+  { prop: 'commissionDate', label: '投运日期', type: 'date', placeholder: '请选择投运日期' },
+  { prop: 'location', label: '地址', span: 24 },
+  { prop: 'remark', label: '备注', type: 'textarea', span: 24 }
+])
+</script>
+
+<template>
+  <div class="pump-station-page">
+    <InfrastructureCrudPage
+      :key="lockedStationType ? 'locked' : 'free'"
+      title="泵站信息"
+      add-text="新增泵站"
+      id-field="id"
+      :query-fields="queryFields"
+      :columns="columns"
+      :form-fields="formFields"
+      :api="formAwareApi"
+      :default-query="lockedStationType ? { stationType: forcedType } : {}"
+      :switch-field="lockedStationType ? '' : 'stationType'"
+      @switch-change="stationType = $event"
+      show-import
+      show-export
+      :import-url="`/api/${stationType === '1' ? 'drainage' : 'water'}/pumpStation/importData`"
+      :template-url="`/api/${stationType === '1' ? 'drainage' : 'water'}/pumpStation/importTemplate`"
+      :export-url="`/api/${stationType === '1' ? 'drainage' : 'water'}/pumpStation/export`"
+      :export-file-name="stationType === '1' ? '排水泵站信息' : '供水泵站信息'"
+      dict-hint="状态请从模板下拉框中选择中文;供水/排水归属由当前切换的接口决定"
+    />
+  </div>
+</template>

+ 75 - 0
src/views/subSystem/pipeNetwork/facilities/waterFireHydrant/index.vue

@@ -0,0 +1,75 @@
+<script setup>
+import InfrastructureCrudPage from '../components/InfrastructureCrudPage.vue'
+import {
+  addFireHydrant,
+  delFireHydrant,
+  getFireHydrant,
+  listFireHydrant,
+  updateFireHydrant
+} from '@/api/pipeNetwork/facilities'
+
+const queryFields = [
+  { prop: 'hydrantCode', label: '消火栓编号' },
+  { prop: 'hydrantName', label: '消火栓名称' },
+  { prop: 'hydrantType', label: '消火栓类型', type: 'dict', dictType: 'water_fire_hydrant_type' },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' }
+]
+
+const columns = [
+  { prop: 'hydrantCode', label: '消火栓编号', width: 140 },
+  { prop: 'hydrantName', label: '消火栓名称', width: 160 },
+  { prop: 'hydrantType', label: '消火栓类型', width: 140, dictType: 'water_fire_hydrant_type' },
+  { prop: 'model', label: '型号', width: 110 },
+  { prop: 'inletPipeDiameter', label: '进水主管管径', width: 130 },
+  { prop: 'outletSpec', label: '出水口规格', width: 110 },
+  { prop: 'location', label: '地址', width: 180 },
+  { prop: 'ownershipUnit', label: '产权单位', width: 150 },
+  { prop: 'maintenanceUnit', label: '管护单位', width: 150 },
+  { prop: 'principal', label: '责任人', width: 100 },
+  { prop: 'contactPhone', label: '联系电话', width: 120 },
+  { prop: 'status', label: '状态', width: 90, dictType: 'infrastructure_status' }
+]
+
+const formFields = [
+  { prop: 'hydrantCode', label: '消火栓编号', required: true },
+  { prop: 'hydrantName', label: '消火栓名称', required: true },
+  { prop: 'hydrantType', label: '消火栓类型', type: 'dict', dictType: 'water_fire_hydrant_type', required: true },
+  { prop: 'status', label: '状态', type: 'dict', dictType: 'infrastructure_status' },
+  { prop: 'model', label: '型号' },
+  { prop: 'inletPipeDiameter', label: '进水主管管径' },
+  { prop: 'outletSpec', label: '出水口规格' },
+  { prop: 'ownershipUnit', label: '产权单位' },
+  { prop: 'maintenanceUnit', label: '管护单位' },
+  { prop: 'principal', label: '责任人' },
+  { prop: 'contactPhone', label: '联系电话' },
+  { prop: 'location', label: '地址', span: 24 },
+  { prop: 'remark', label: '备注', type: 'textarea', span: 24 }
+]
+
+const api = {
+  page: listFireHydrant,
+  detail: getFireHydrant,
+  save: addFireHydrant,
+  update: updateFireHydrant,
+  remove: (ids) => delFireHydrant(ids)
+}
+</script>
+
+<template>
+  <InfrastructureCrudPage
+    title="消火栓信息"
+    add-text="新增消火栓"
+    id-field="hydrantId"
+    :query-fields="queryFields"
+    :columns="columns"
+    :form-fields="formFields"
+    :api="api"
+    show-import
+    show-export
+    import-url="/api/infrastructure/fireHydrant/importData"
+    template-url="/api/infrastructure/fireHydrant/importTemplate"
+    export-url="/api/infrastructure/fireHydrant/export"
+    export-file-name="消火栓信息"
+    dict-hint="消火栓类型、状态请从模板下拉框中选择中文"
+  />
+</template>

+ 51 - 117
src/views/subSystem/basic/waterPlant/index.vue → src/views/subSystem/pipeNetwork/facilities/waterPlant/index.vue

@@ -5,71 +5,46 @@
       <el-button type="primary" link size="small" @click="retryRequest">重试</el-button>
     </div>
     <!-- 页头 -->
-    <div class="page-heading">
+    <div class="page-head">
       <div class="page-title">
-        <span class="page-title-icon"><el-icon><House /></el-icon></span>
-        <div><h2>水厂信息查询</h2><span class="muted">水厂档案、能力与运行状态维护</span></div>
+        <span class="page-title-bar" />
+        <h2>水厂信息</h2>
+      </div>
+      <div class="page-actions">
+        <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['waterSupply:waterPlant:add']">新增</el-button>
+        <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:waterPlant:remove']">删除</el-button>
+        <el-button type="info" plain icon="Upload" @click="importVisible = true">导入</el-button>
+        <el-button type="success" plain icon="Download" @click="handleExport" v-hasPermi="['waterSupply:waterPlant:export']">导出</el-button>
       </div>
-      <el-button class="heading-refresh" :icon="Refresh" :loading="loading" @click="getList">刷新</el-button>
     </div>
-    <!-- 筛选卡 -->
+    <!-- 查询条件 -->
     <el-card shadow="never" class="filter-card">
-      <template #header>
-        <div class="filter-card-header">
-          <div class="card-title"><el-icon><Search /></el-icon><span>筛选</span></div>
-          <div class="card-actions">
-            <el-button type="primary" plain icon="Plus" size="small" @click="handleAdd" v-hasPermi="['waterSupply:waterPlant:add']">新增</el-button>
-            <el-button type="danger" plain icon="Delete" size="small" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:waterPlant:remove']">删除</el-button>
-            <el-button type="success" plain icon="Download" size="small" @click="handleExport" v-hasPermi="['waterSupply:waterPlant:export']">导出</el-button>
-            <el-button type="info" plain icon="Upload" size="small" @click="importVisible = true" v-hasPermi="['waterSupply:waterPlant:import']">导入</el-button>
-          </div>
-        </div>
-      </template>
-      <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="80px">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" class="query-form" @submit.prevent>
         <el-form-item label="水厂编号" prop="plantCode">
-          <el-input v-model="queryParams.plantCode" placeholder="请输入水厂编号" clearable size="small" @keyup.enter="handleQuery" />
+          <el-input v-model="queryParams.plantCode" placeholder="请输入水厂编号" clearable style="width: 180px" @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="水厂名称" prop="plantName">
-          <el-input v-model="queryParams.plantName" placeholder="请输入水厂名称" clearable size="small" @keyup.enter="handleQuery" />
+          <el-input v-model="queryParams.plantName" placeholder="请输入水厂名称" clearable style="width: 180px" @keyup.enter="handleQuery" />
         </el-form-item>
-        <el-form-item label="运行状态" prop="status">
-          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" style="width: 120px">
-            <el-option label="正常" value="0" />
-            <el-option label="停产" value="1" />
+        <el-form-item label="状态" prop="status">
+          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 170px">
+            <el-option v-for="item in plantStatusOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
           </el-select>
         </el-form-item>
-        <el-form-item label="负责人" prop="principal">
-          <el-input v-model="queryParams.principal" placeholder="请输入负责人" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="创建时间">
-          <el-date-picker
-            v-model="dateRange"
-            size="small"
-            style="width: 240px"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            type="datetimerange"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          />
-        </el-form-item>
         <el-form-item>
-          <el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
     </el-card>
 
     <!-- 表格卡 -->
     <el-card shadow="never" class="table-card">
-      <template #header>
-        <div class="card-title"><el-icon><List /></el-icon><span>水厂清单</span></div>
-      </template>
-      <el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
+      <el-table v-loading="loading" :data="tableData" border @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="水厂编号" align="center" prop="plantCode" :show-overflow-tooltip="true" min-width="120" />
         <el-table-column label="水厂名称" align="center" prop="plantName" :show-overflow-tooltip="true" min-width="140" />
-        <el-table-column label="水厂地址" align="center" prop="location" :show-overflow-tooltip="true" min-width="160" />
+        <el-table-column label="地址" align="center" prop="location" :show-overflow-tooltip="true" min-width="160" />
         <el-table-column label="经度" align="center" prop="longitude" width="120" />
         <el-table-column label="纬度" align="center" prop="latitude" width="120" />
         <el-table-column label="水源类型" align="center" prop="waterSourceType" width="100" />
@@ -86,13 +61,10 @@
         <el-table-column label="负责人" align="center" prop="principal" width="100" />
         <el-table-column label="联系电话" align="center" prop="contactPhone" width="120" />
         <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-        <el-table-column label="操作" align="center" width="168" fixed="right">
+        <el-table-column label="操作" width="170" fixed="right" align="center">
           <template #default="{ row }">
-            <div class="facility-row-actions">
-              <el-tooltip content="查看详情" placement="top"><el-button class="facility-row-action is-detail" aria-label="查看详情" size="small" type="primary" plain circle icon="View" @click="handleDetail(row)" /></el-tooltip>
-              <el-tooltip content="修改信息" placement="top"><el-button class="facility-row-action is-edit" aria-label="修改信息" size="small" type="warning" plain circle icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:waterPlant:edit']" /></el-tooltip>
-              <el-tooltip content="删除记录" placement="top"><el-button class="facility-row-action is-delete" aria-label="删除记录" size="small" type="danger" plain circle icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:waterPlant:remove']" /></el-tooltip>
-            </div>
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:waterPlant:edit']">修改</el-button>
+            <el-button link type="danger" icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:waterPlant:remove']">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -101,8 +73,8 @@
       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
     </el-card>
 
-    <!-- 新增/修改抽屉 -->
-    <el-drawer :title="dialogTitle" v-model="dialogVisible" class="facility-form-drawer" direction="rtl" size="760px" append-to-body>
+    <!-- 新增/修改弹窗 -->
+    <el-dialog :title="dialogTitle" v-model="dialogVisible" class="facility-form-dialog" width="760px" append-to-body destroy-on-close>
       <el-form ref="form" :model="form" :rules="rules" label-width="130px">
         <el-row :gutter="20">
           <el-col :span="12">
@@ -115,13 +87,6 @@
               <el-input v-model="form.plantName" placeholder="请输入水厂名称" maxlength="100" />
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item label="水厂地址" prop="location">
-              <el-input v-model="form.location" placeholder="请输入水厂地址" maxlength="200" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12"><el-form-item label="经度" prop="longitude"><el-input-number v-model="form.longitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="纬度" prop="latitude"><el-input-number v-model="form.latitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
           <el-col :span="12">
             <el-form-item label="水源类型" prop="waterSourceType">
               <el-input v-model="form.waterSourceType" placeholder="请输入水源类型" maxlength="50" />
@@ -155,8 +120,7 @@
           <el-col :span="12">
             <el-form-item label="运行状态" prop="status">
               <el-radio-group v-model="form.status">
-                <el-radio label="0">正常</el-radio>
-                <el-radio label="1">停产</el-radio>
+                <el-radio v-for="item in plantStatusOptions" :key="item.dictValue" :label="item.dictValue">{{ item.dictLabel }}</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -170,6 +134,10 @@
               <el-input v-model="form.contactPhone" placeholder="请输入联系电话" maxlength="20" />
             </el-form-item>
           </el-col>
+          <FacilityLocationFields
+            v-model="form"
+            address-prop="location"
+          />
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
               <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" maxlength="500" />
@@ -181,39 +149,9 @@
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="dialogVisible = false">取 消</el-button>
       </template>
-    </el-drawer>
-
-    <!-- 详情抽屉 -->
-    <el-drawer title="水厂详情" v-model="detailVisible" class="detail-drawer" direction="rtl" size="650px" append-to-body>
-      <el-descriptions :column="2" border>
-        <el-descriptions-item label="水厂编号">{{ detailData.plantCode }}</el-descriptions-item>
-        <el-descriptions-item label="水厂名称">{{ detailData.plantName }}</el-descriptions-item>
-        <el-descriptions-item label="水厂地址" :span="2">{{ detailData.location }}</el-descriptions-item>
-        <el-descriptions-item label="经度">{{ detailData.longitude }}</el-descriptions-item>
-        <el-descriptions-item label="纬度">{{ detailData.latitude }}</el-descriptions-item>
-        <el-descriptions-item label="水源类型">{{ detailData.waterSourceType }}</el-descriptions-item>
-        <el-descriptions-item label="设计能力(万m³/d)">{{ detailData.designCapacity }}</el-descriptions-item>
-        <el-descriptions-item label="实际能力(万m³/d)">{{ detailData.currentCapacity }}</el-descriptions-item>
-        <el-descriptions-item label="处理工艺" :span="2">{{ detailData.treatmentProcess }}</el-descriptions-item>
-        <el-descriptions-item label="投运日期">{{ detailData.commissionDate }}</el-descriptions-item>
-        <el-descriptions-item label="水质执行标准">{{ detailData.waterQualityStandard }}</el-descriptions-item>
-        <el-descriptions-item label="运行状态">
-          <el-tag :type="statusTagType(detailData.status)" size="small">{{ statusLabel(detailData.status) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="负责人">{{ detailData.principal }}</el-descriptions-item>
-        <el-descriptions-item label="联系电话">{{ detailData.contactPhone }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ detailData.remark }}</el-descriptions-item>
-        <el-descriptions-item label="创建者">{{ detailData.createBy }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ detailData.createTime }}</el-descriptions-item>
-        <el-descriptions-item label="更新者">{{ detailData.updateBy }}</el-descriptions-item>
-        <el-descriptions-item label="更新时间">{{ detailData.updateTime }}</el-descriptions-item>
-      </el-descriptions>
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
+    </el-dialog>
 
-    <WaterFacilityImportDialog v-model="importVisible" title="水厂信息" upload-url="/api/water/plantInfo/importData" template-url="/api/water/plantInfo/importTemplate" @imported="getList" />
+    <FacilityImportDialog v-model="importVisible" title="水厂信息" upload-url="/api/water/plantInfo/importData" template-url="/api/water/plantInfo/importTemplate" dict-hint="运行状态请从模板下拉框中选择中文" @imported="getList" />
 
     <!-- 回收站对话框 -->
     <el-dialog title="回收站" v-model="recycleVisible" width="900px" append-to-body>
@@ -233,7 +171,7 @@
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="水厂编号" align="center" prop="plantCode" />
         <el-table-column label="水厂名称" align="center" prop="plantName" />
-        <el-table-column label="水厂地址" align="center" prop="location" :show-overflow-tooltip="true" />
+        <el-table-column label="地址" align="center" prop="location" :show-overflow-tooltip="true" />
         <el-table-column label="负责人" align="center" prop="principal" width="100" />
         <el-table-column label="运行状态" align="center" width="100">
           <template #default="{ row }">
@@ -260,13 +198,16 @@ import { listWaterPlant, getWaterPlant, addWaterPlant, updateWaterPlant, delWate
 import { saveAs } from 'file-saver'
 import { exportWaterPlant } from '@/api/pipeNetwork/waterSupply'
 import { buildWaterFacilityQuery, getRequestErrorMessage } from '@/utils/waterFacilityQuery'
-import WaterFacilityImportDialog from '@/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue'
+import FacilityImportDialog from '../components/FacilityImportDialog.vue'
+import FacilityLocationFields from '../components/FacilityLocationFields.vue'
+import { getDicts } from '@/api/system/dict/data'
 
 export default {
-  name: 'WaterPlant',
-  components: { WaterFacilityImportDialog },
+  name: 'FacilityWaterPlant',
+  components: { FacilityImportDialog, FacilityLocationFields },
   data() {
     return {
+      plantStatusOptions: [],
       loading: true,
       ids: [],
       single: true,
@@ -277,9 +218,7 @@ export default {
       dateRange: [],
       dialogTitle: '',
       dialogVisible: false,
-      detailVisible: false,
       importVisible: false,
-      detailData: {},
       recycleVisible: false,
       recycleLoading: false,
       recycleData: [],
@@ -292,8 +231,7 @@ export default {
         pageSize: 10,
         plantCode: undefined,
         plantName: undefined,
-        status: undefined,
-        principal: undefined
+        status: undefined
       },
       recycleQuery: {
         pageNum: 1,
@@ -313,9 +251,15 @@ export default {
     }
   },
   created() {
+    this.loadDictOptions()
     this.getList()
   },
   methods: {
+    loadDictOptions() {
+      getDicts('water_plant_status')
+        .then(res => { this.plantStatusOptions = res.data || [] })
+        .catch(() => { this.plantStatusOptions = [] })
+    },
     getList() {
       this.loading = true
       this.errorMessage = ''
@@ -333,12 +277,12 @@ export default {
       if (this.retryAction) this.retryAction()
     },
     statusTagType(status) {
-      const map = { '0': 'success', '1': 'danger' }
-      return map[status] || 'info'
+      const hit = this.plantStatusOptions.find(item => String(item.dictValue) === String(status))
+      return (hit && hit.listClass) || 'info'
     },
     statusLabel(status) {
-      const map = { '0': '正常', '1': '停产' }
-      return map[status] || '未知'
+      const hit = this.plantStatusOptions.find(item => String(item.dictValue) === String(status))
+      return hit ? hit.dictLabel : status
     },
     handleQuery() {
       this.queryParams.pageNum = 1
@@ -380,16 +324,6 @@ export default {
         this.dialogVisible = true
       })
     },
-    handleDetail(row) {
-      this.errorMessage = ''
-      this.retryAction = () => this.handleDetail(row)
-      getWaterPlant(row.id).then(response => {
-        this.detailData = response.data
-        this.detailVisible = true
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '水厂详情查询失败,请稍后重试')
-      })
-    },
     submitForm() {
       this.$refs.form.validate(valid => {
         if (valid) {
@@ -466,5 +400,5 @@ export default {
 </script>
 
 <style scoped lang="scss">
-@use '../../waterSupply/components/waterFacilityPageTheme.scss';
+@use '../../../waterSupply/components/waterFacilityPageTheme.scss';
 </style>

+ 66 - 131
src/views/subSystem/basic/waterSource/index.vue → src/views/subSystem/pipeNetwork/facilities/waterSource/index.vue

@@ -5,73 +5,48 @@
       <el-button type="primary" link size="small" @click="retryRequest">重试</el-button>
     </div>
     <!-- 页头 -->
-    <div class="page-heading">
+    <div class="page-head">
       <div class="page-title">
-        <span class="page-title-icon"><el-icon><Drizzling /></el-icon></span>
-        <div><h2>水源地信息查询</h2><span class="muted">水源档案、类型与运行状态维护</span></div>
+        <span class="page-title-bar" />
+        <h2>水源地信息</h2>
+      </div>
+      <div class="page-actions">
+        <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['waterSupply:waterSource:add']">新增</el-button>
+        <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:waterSource:remove']">删除</el-button>
+        <el-button type="info" plain icon="Upload" @click="importVisible = true">导入</el-button>
+        <el-button type="success" plain icon="Download" @click="handleExport" v-hasPermi="['waterSupply:waterSource:export']">导出</el-button>
       </div>
-      <el-button class="heading-refresh" :icon="Refresh" :loading="loading" @click="getList">刷新</el-button>
     </div>
-    <!-- 筛选卡 -->
+    <!-- 查询条件 -->
     <el-card shadow="never" class="filter-card">
-      <template #header>
-        <div class="filter-card-header">
-          <div class="card-title"><el-icon><Search /></el-icon><span>筛选</span></div>
-          <div class="card-actions">
-            <el-button type="primary" plain icon="Plus" size="small" @click="handleAdd" v-hasPermi="['waterSupply:waterSource:add']">新增</el-button>
-            <el-button type="danger" plain icon="Delete" size="small" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:waterSource:remove']">删除</el-button>
-            <el-button type="success" plain icon="Download" size="small" @click="handleExport" v-hasPermi="['waterSupply:waterSource:export']">导出</el-button>
-            <el-button type="info" plain icon="Upload" size="small" @click="importVisible = true" v-hasPermi="['waterSupply:waterSource:import']">导入</el-button>
-          </div>
-        </div>
-      </template>
-      <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="88px">
-        <el-form-item label="水源地ID" prop="sourceId">
-          <el-input v-model="queryParams.sourceId" placeholder="请输入水源地ID" clearable size="small" @keyup.enter="handleQuery" />
+      <el-form :model="queryParams" ref="queryForm" :inline="true" class="query-form" @submit.prevent>
+        <el-form-item label="水源地编号" prop="sourceId">
+          <el-input v-model="queryParams.sourceId" placeholder="请输入水源地编号" clearable style="width: 180px" @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="水源地名称" prop="sourceName">
-          <el-input v-model="queryParams.sourceName" placeholder="请输入水源地名称" clearable size="small" @keyup.enter="handleQuery" />
+          <el-input v-model="queryParams.sourceName" placeholder="请输入水源地名称" clearable style="width: 180px" @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="状态" prop="status">
-          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" style="width: 120px">
-            <el-option label="正常" value="0" />
-            <el-option label="异常" value="1" />
+          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 170px">
+            <el-option v-for="item in sourceStatusOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
           </el-select>
         </el-form-item>
-        <el-form-item label="所属单位" prop="unit">
-          <el-input v-model="queryParams.unit" placeholder="请输入所属单位" clearable size="small" @keyup.enter="handleQuery" />
-        </el-form-item>
-        <el-form-item label="创建时间">
-          <el-date-picker
-            v-model="dateRange"
-            size="small"
-            style="width: 240px"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            type="datetimerange"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          />
-        </el-form-item>
         <el-form-item>
-          <el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
     </el-card>
 
     <!-- 表格卡 -->
     <el-card shadow="never" class="table-card">
-      <template #header>
-        <div class="card-title"><el-icon><List /></el-icon><span>水源地清单</span></div>
-      </template>
-      <el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
+      <el-table v-loading="loading" :data="tableData" border @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="水源地ID" align="center" prop="sourceId" :show-overflow-tooltip="true" min-width="120" />
+        <el-table-column label="水源地编号" align="center" prop="sourceId" :show-overflow-tooltip="true" min-width="120" />
         <el-table-column label="水源地名称" align="center" prop="sourceName" :show-overflow-tooltip="true" min-width="140" />
         <el-table-column label="水源地类型" align="center" prop="sourceType" width="100" />
         <el-table-column label="所属单位" align="center" prop="unit" :show-overflow-tooltip="true" min-width="120" />
-        <el-table-column label="详细地址" align="center" prop="address" :show-overflow-tooltip="true" min-width="160" />
+        <el-table-column label="地址" align="center" prop="address" :show-overflow-tooltip="true" min-width="160" />
         <el-table-column label="经度" align="center" prop="longitude" width="120" />
         <el-table-column label="纬度" align="center" prop="latitude" width="120" />
         <el-table-column label="水源类型" align="center" prop="waterType" width="100" />
@@ -84,13 +59,10 @@
           </template>
         </el-table-column>
         <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-        <el-table-column label="操作" align="center" width="168" fixed="right">
+        <el-table-column label="操作" width="180" fixed="right" align="center">
           <template #default="{ row }">
-            <div class="facility-row-actions">
-              <el-tooltip content="查看详情" placement="top"><el-button class="facility-row-action is-detail" aria-label="查看详情" size="small" type="primary" plain circle icon="View" @click="handleDetail(row)" /></el-tooltip>
-              <el-tooltip content="修改信息" placement="top"><el-button class="facility-row-action is-edit" aria-label="修改信息" size="small" type="warning" plain circle icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:waterSource:edit']" /></el-tooltip>
-              <el-tooltip content="删除记录" placement="top"><el-button class="facility-row-action is-delete" aria-label="删除记录" size="small" type="danger" plain circle icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:waterSource:remove']" /></el-tooltip>
-            </div>
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:waterSource:edit']">修改</el-button>
+            <el-button link type="danger" icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:waterSource:remove']">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -100,12 +72,12 @@
     </el-card>
 
     <!-- 新增/修改抽屉 -->
-    <el-drawer :title="dialogTitle" v-model="dialogVisible" class="facility-form-drawer" direction="rtl" size="760px" append-to-body>
+    <el-dialog :title="dialogTitle" v-model="dialogVisible" class="facility-form-dialog" width="760px" append-to-body destroy-on-close>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item label="水源地ID" prop="sourceId">
-              <el-input v-model="form.sourceId" placeholder="请输入水源地ID" maxlength="50" />
+            <el-form-item label="水源地编号" prop="sourceId">
+              <el-input v-model="form.sourceId" placeholder="请输入水源地编号" maxlength="50" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -123,36 +95,24 @@
               <el-input v-model="form.unit" placeholder="请输入所属单位" maxlength="100" />
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item label="详细地址" prop="address">
-              <el-input v-model="form.address" placeholder="请输入详细地址" maxlength="200" />
-            </el-form-item>
-          </el-col>
           <el-col :span="12">
             <el-form-item label="水源类型" prop="waterType">
               <el-select v-model="form.waterType" placeholder="请选择水源类型" style="width: 100%">
-                <el-option label="地表水" value="地表水" />
-                <el-option label="地下水" value="地下水" />
+                <el-option v-for="item in waterTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="保护等级" prop="protectionLevel">
               <el-select v-model="form.protectionLevel" placeholder="请选择保护等级" style="width: 100%">
-                <el-option label="一级" value="一级" />
-                <el-option label="二级" value="二级" />
-                <el-option label="准保护区" value="准保护区" />
+                <el-option v-for="item in protectionLevelOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="水质等级" prop="waterQualityLevel">
               <el-select v-model="form.waterQualityLevel" placeholder="请选择水质等级" style="width: 100%">
-                <el-option label="Ⅰ类" value="Ⅰ类" />
-                <el-option label="Ⅱ类" value="Ⅱ类" />
-                <el-option label="Ⅲ类" value="Ⅲ类" />
-                <el-option label="Ⅳ类" value="Ⅳ类" />
-                <el-option label="Ⅴ类" value="Ⅴ类" />
+                <el-option v-for="item in qualityGradeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -164,18 +124,19 @@
           <el-col :span="12">
             <el-form-item label="状态" prop="status">
               <el-radio-group v-model="form.status">
-                <el-radio label="0">正常</el-radio>
-                <el-radio label="1">异常</el-radio>
+                <el-radio v-for="item in sourceStatusOptions" :key="item.dictValue" :label="item.dictValue">{{ item.dictLabel }}</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
-          <el-col :span="12"><el-form-item label="经度" prop="longitude"><el-input-number v-model="form.longitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="纬度" prop="latitude"><el-input-number v-model="form.latitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
           <el-col :span="24">
             <el-form-item label="保护范围" prop="protectionScope">
               <el-input v-model="form.protectionScope" placeholder="请输入保护范围描述" maxlength="500" />
             </el-form-item>
           </el-col>
+          <FacilityLocationFields
+            v-model="form"
+            address-prop="address"
+          />
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
               <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" maxlength="500" />
@@ -187,43 +148,14 @@
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="dialogVisible = false">取 消</el-button>
       </template>
-    </el-drawer>
-
-    <!-- 详情抽屉 -->
-    <el-drawer title="水源地详情" v-model="detailVisible" class="detail-drawer" direction="rtl" size="650px" append-to-body>
-      <el-descriptions :column="2" border>
-        <el-descriptions-item label="水源地ID">{{ detailData.sourceId }}</el-descriptions-item>
-        <el-descriptions-item label="水源地名称">{{ detailData.sourceName }}</el-descriptions-item>
-        <el-descriptions-item label="水源地类型">{{ detailData.sourceType }}</el-descriptions-item>
-        <el-descriptions-item label="所属单位">{{ detailData.unit }}</el-descriptions-item>
-        <el-descriptions-item label="详细地址" :span="2">{{ detailData.address }}</el-descriptions-item>
-        <el-descriptions-item label="水源类型">{{ detailData.waterType }}</el-descriptions-item>
-        <el-descriptions-item label="保护等级">{{ detailData.protectionLevel }}</el-descriptions-item>
-        <el-descriptions-item label="水质等级">{{ detailData.waterQualityLevel }}</el-descriptions-item>
-        <el-descriptions-item label="上报时间">{{ detailData.reportTime }}</el-descriptions-item>
-        <el-descriptions-item label="保护范围" :span="2">{{ detailData.protectionScope }}</el-descriptions-item>
-        <el-descriptions-item label="状态">
-          <el-tag :type="statusTagType(detailData.status)" size="small">{{ statusLabel(detailData.status) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="经度">{{ detailData.longitude }}</el-descriptions-item>
-        <el-descriptions-item label="纬度">{{ detailData.latitude }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ detailData.remark }}</el-descriptions-item>
-        <el-descriptions-item label="创建者">{{ detailData.createBy }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ detailData.createTime }}</el-descriptions-item>
-        <el-descriptions-item label="更新者">{{ detailData.updateBy }}</el-descriptions-item>
-        <el-descriptions-item label="更新时间">{{ detailData.updateTime }}</el-descriptions-item>
-      </el-descriptions>
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
+    </el-dialog>
 
-    <WaterFacilityImportDialog v-model="importVisible" title="水源地信息" upload-url="/api/water/sourceInfo/importData" template-url="/api/water/sourceInfo/importTemplate" @imported="getList" />
+    <FacilityImportDialog v-model="importVisible" title="水源地信息" upload-url="/api/water/sourceInfo/importData" template-url="/api/water/sourceInfo/importTemplate" dict-hint="水源类型、保护等级、水质等级、状态请从模板下拉框中选择中文" @imported="getList" />
 
     <!-- 回收站对话框 -->
     <el-dialog title="回收站" v-model="recycleVisible" width="900px" append-to-body>
       <el-form :model="recycleQuery" ref="recycleForm" :inline="true" size="small">
-        <el-form-item label="水源地ID" prop="sourceId">
+        <el-form-item label="水源地编号" prop="sourceId">
           <el-input v-model="recycleQuery.sourceId" placeholder="请输入ID" clearable />
         </el-form-item>
         <el-form-item label="水源地名称" prop="sourceName">
@@ -236,7 +168,7 @@
       </el-form>
       <el-table v-loading="recycleLoading" :data="recycleData" @selection-change="handleRecycleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="水源地ID" align="center" prop="sourceId" />
+        <el-table-column label="水源地编号" align="center" prop="sourceId" />
         <el-table-column label="水源地名称" align="center" prop="sourceName" />
         <el-table-column label="所属单位" align="center" prop="unit" :show-overflow-tooltip="true" />
         <el-table-column label="水源类型" align="center" prop="waterType" width="100" />
@@ -265,13 +197,19 @@ import { listWaterSource, getWaterSource, addWaterSource, updateWaterSource, del
 import { saveAs } from 'file-saver'
 import { exportWaterSource } from '@/api/pipeNetwork/waterSupply'
 import { buildWaterFacilityQuery, getRequestErrorMessage } from '@/utils/waterFacilityQuery'
-import WaterFacilityImportDialog from '@/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue'
+import FacilityImportDialog from '../components/FacilityImportDialog.vue'
+import FacilityLocationFields from '../components/FacilityLocationFields.vue'
+import { getDicts } from '@/api/system/dict/data'
 
 export default {
-  name: 'WaterSource',
-  components: { WaterFacilityImportDialog },
+  name: 'FacilityWaterSource',
+  components: { FacilityImportDialog, FacilityLocationFields },
   data() {
     return {
+      sourceStatusOptions: [],
+      waterTypeOptions: [],
+      protectionLevelOptions: [],
+      qualityGradeOptions: [],
       loading: true,
       ids: [],
       single: true,
@@ -282,9 +220,7 @@ export default {
       dateRange: [],
       dialogTitle: '',
       dialogVisible: false,
-      detailVisible: false,
       importVisible: false,
-      detailData: {},
       recycleVisible: false,
       recycleLoading: false,
       recycleData: [],
@@ -297,8 +233,7 @@ export default {
         pageSize: 10,
         sourceId: undefined,
         sourceName: undefined,
-        status: undefined,
-        unit: undefined
+        status: undefined
       },
       recycleQuery: {
         pageNum: 1,
@@ -309,7 +244,7 @@ export default {
       form: {},
       rules: {
         sourceId: [
-          { required: true, message: '水源地ID不能为空', trigger: 'blur' }
+          { required: true, message: '水源地编号不能为空', trigger: 'blur' }
         ],
         sourceName: [
           { required: true, message: '水源地名称不能为空', trigger: 'blur' }
@@ -318,9 +253,19 @@ export default {
     }
   },
   created() {
+    this.loadDictOptions()
     this.getList()
   },
   methods: {
+    loadDictOptions() {
+      const load = (type, key) => getDicts(type)
+        .then(res => { this[key] = res.data || [] })
+        .catch(() => { this[key] = [] })
+      load('infrastructure_status', 'sourceStatusOptions')
+      load('water_source_type', 'waterTypeOptions')
+      load('water_source_protection_level', 'protectionLevelOptions')
+      load('water_quality_grade', 'qualityGradeOptions')
+    },
     getList() {
       this.loading = true
       this.errorMessage = ''
@@ -338,12 +283,12 @@ export default {
       if (this.retryAction) this.retryAction()
     },
     statusTagType(status) {
-      const map = { '0': 'success', '1': 'danger' }
-      return map[status] || 'info'
+      const hit = this.sourceStatusOptions.find(item => String(item.dictValue) === String(status))
+      return (hit && hit.listClass) || 'info'
     },
     statusLabel(status) {
-      const map = { '0': '正常', '1': '异常' }
-      return map[status] || '未知'
+      const hit = this.sourceStatusOptions.find(item => String(item.dictValue) === String(status))
+      return hit ? hit.dictLabel : status
     },
     handleQuery() {
       this.queryParams.pageNum = 1
@@ -385,16 +330,6 @@ export default {
         this.dialogVisible = true
       })
     },
-    handleDetail(row) {
-      this.errorMessage = ''
-      this.retryAction = () => this.handleDetail(row)
-      getWaterSource(row.id).then(response => {
-        this.detailData = response.data
-        this.detailVisible = true
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '水源地详情查询失败,请稍后重试')
-      })
-    },
     submitForm() {
       this.$refs.form.validate(valid => {
         if (valid) {
@@ -416,7 +351,7 @@ export default {
     },
     handleDelete(row) {
       const ids = row.id ? [row.id] : this.ids
-      this.$modal.confirm('是否确认删除水源地ID为"' + ids.join(',') + '"的数据项?').then(() => {
+      this.$modal.confirm('是否确认删除水源地编号为"' + ids.join(',') + '"的数据项?').then(() => {
         return delWaterSource(ids.join(','))
       }).then(() => {
         this.getList()
@@ -471,5 +406,5 @@ export default {
 </script>
 
 <style scoped lang="scss">
-@use '../../waterSupply/components/waterFacilityPageTheme.scss';
+@use '../../../waterSupply/components/waterFacilityPageTheme.scss';
 </style>

+ 55 - 121
src/views/subSystem/basic/waterUserInfo/index.vue → src/views/subSystem/pipeNetwork/facilities/waterUser/index.vue

@@ -5,78 +5,52 @@
       <el-button type="primary" link size="small" @click="retryRequest">重试</el-button>
     </div>
     <!-- 页头 -->
-    <div class="page-heading">
+    <div class="page-head">
       <div class="page-title">
-        <span class="page-title-icon"><el-icon><User /></el-icon></span>
-        <div><h2>用水户信息查询</h2><span class="muted">用水户档案、类型与状态维护</span></div>
+        <span class="page-title-bar" />
+        <h2>用水户信息</h2>
+      </div>
+      <div class="page-actions">
+        <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['waterSupply:waterUser:add']">新增</el-button>
+        <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:waterUser:remove']">删除</el-button>
+        <el-button type="info" plain icon="Upload" @click="importVisible = true">导入</el-button>
+        <el-button type="success" plain icon="Download" @click="handleExport" v-hasPermi="['waterSupply:waterUser:export']">导出</el-button>
       </div>
-      <el-button class="heading-refresh" :icon="Refresh" :loading="loading" @click="getList">刷新</el-button>
     </div>
-    <!-- 筛选卡 -->
+    <!-- 查询条件 -->
     <el-card shadow="never" class="filter-card">
-      <template #header>
-        <div class="filter-card-header">
-          <div class="card-title"><el-icon><Search /></el-icon><span>筛选</span></div>
-          <div class="card-actions">
-            <el-button type="primary" plain icon="Plus" size="small" @click="handleAdd" v-hasPermi="['waterSupply:waterUser:add']">新增</el-button>
-            <el-button type="danger" plain icon="Delete" size="small" :disabled="multiple" @click="handleDelete" v-hasPermi="['waterSupply:waterUser:remove']">删除</el-button>
-            <el-button type="success" plain icon="Download" size="small" @click="handleExport" v-hasPermi="['waterSupply:waterUser:export']">导出</el-button>
-            <el-button type="info" plain icon="Upload" size="small" @click="importVisible = true" v-hasPermi="['waterSupply:waterUser:import']">导入</el-button>
-          </div>
-        </div>
-      </template>
-      <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="88px">
+      <el-form :model="queryParams" ref="queryForm" :inline="true" class="query-form" @submit.prevent>
         <el-form-item label="用水户编号" prop="userCode">
-          <el-input v-model="queryParams.userCode" placeholder="请输入用水户编号" clearable size="small" @keyup.enter="handleQuery" />
+          <el-input v-model="queryParams.userCode" placeholder="请输入用水户编号" clearable style="width: 180px" @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="用水户名称" prop="userName">
-          <el-input v-model="queryParams.userName" placeholder="请输入用水户名称" clearable size="small" @keyup.enter="handleQuery" />
+          <el-input v-model="queryParams.userName" placeholder="请输入用水户名称" clearable style="width: 180px" @keyup.enter="handleQuery" />
         </el-form-item>
         <el-form-item label="用水户类型" prop="userType">
-          <el-select v-model="queryParams.userType" placeholder="请选择类型" clearable size="small" style="width: 120px">
-            <el-option label="居民" value="居民" />
-            <el-option label="工业" value="工业" />
-            <el-option label="商业" value="商业" />
-            <el-option label="行政事业" value="行政事业" />
+          <el-select v-model="queryParams.userType" placeholder="请选择类型" clearable style="width: 170px">
+            <el-option v-for="item in userTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
           </el-select>
         </el-form-item>
-        <el-form-item label="用水户状态" prop="status">
-          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" style="width: 120px">
-            <el-option label="正常" value="0" />
-            <el-option label="欠费" value="1" />
-            <el-option label="停用" value="2" />
+        <el-form-item label="状态" prop="status">
+          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable style="width: 170px">
+            <el-option v-for="item in userStatusOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
           </el-select>
         </el-form-item>
-        <el-form-item label="创建时间">
-          <el-date-picker
-            v-model="dateRange"
-            size="small"
-            style="width: 240px"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            type="datetimerange"
-            range-separator="-"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-          />
-        </el-form-item>
         <el-form-item>
-          <el-button type="primary" icon="Search" size="small" @click="handleQuery">搜索</el-button>
-          <el-button icon="Refresh" size="small" @click="resetQuery">重置</el-button>
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
     </el-card>
 
     <!-- 表格卡 -->
     <el-card shadow="never" class="table-card">
-      <template #header>
-        <div class="card-title"><el-icon><List /></el-icon><span>用水户清单</span></div>
-      </template>
-      <el-table v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
+      <el-table v-loading="loading" :data="tableData" border @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="用水户编号" align="center" prop="userCode" :show-overflow-tooltip="true" min-width="120" />
         <el-table-column label="用水户名称" align="center" prop="userName" :show-overflow-tooltip="true" min-width="140" />
         <el-table-column label="用水户类型" align="center" prop="userType" width="100" />
-        <el-table-column label="用水地址" align="center" prop="address" :show-overflow-tooltip="true" min-width="160" />
+        <el-table-column label="地址" align="center" prop="address" :show-overflow-tooltip="true" min-width="160" />
         <el-table-column label="经度" align="center" prop="longitude" width="120" />
         <el-table-column label="纬度" align="center" prop="latitude" width="120" />
         <el-table-column label="联系人" align="center" prop="contactPerson" width="100" />
@@ -91,13 +65,10 @@
           </template>
         </el-table-column>
         <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-        <el-table-column label="操作" align="center" width="168" fixed="right">
+        <el-table-column label="操作" width="180" fixed="right" align="center">
           <template #default="{ row }">
-            <div class="facility-row-actions">
-              <el-tooltip content="查看详情" placement="top"><el-button class="facility-row-action is-detail" aria-label="查看详情" size="small" type="primary" plain circle icon="View" @click="handleDetail(row)" /></el-tooltip>
-              <el-tooltip content="修改信息" placement="top"><el-button class="facility-row-action is-edit" aria-label="修改信息" size="small" type="warning" plain circle icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:waterUser:edit']" /></el-tooltip>
-              <el-tooltip content="删除记录" placement="top"><el-button class="facility-row-action is-delete" aria-label="删除记录" size="small" type="danger" plain circle icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:waterUser:remove']" /></el-tooltip>
-            </div>
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(row)" v-hasPermi="['waterSupply:waterUser:edit']">修改</el-button>
+            <el-button link type="danger" icon="Delete" @click="handleDelete(row)" v-hasPermi="['waterSupply:waterUser:remove']">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -107,7 +78,7 @@
     </el-card>
 
     <!-- 新增/修改抽屉 -->
-    <el-drawer :title="dialogTitle" v-model="dialogVisible" class="facility-form-drawer" direction="rtl" size="760px" append-to-body>
+    <el-dialog :title="dialogTitle" v-model="dialogVisible" class="facility-form-dialog" width="760px" append-to-body destroy-on-close>
       <el-form ref="form" :model="form" :rules="rules" label-width="110px">
         <el-row :gutter="20">
           <el-col :span="12">
@@ -123,29 +94,17 @@
           <el-col :span="12">
             <el-form-item label="用水户类型" prop="userType">
               <el-select v-model="form.userType" placeholder="请选择用水户类型" style="width: 100%">
-                <el-option label="居民" value="居民" />
-                <el-option label="工业" value="工业" />
-                <el-option label="商业" value="商业" />
-                <el-option label="行政事业" value="行政事业" />
+                <el-option v-for="item in userTypeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="用水户状态" prop="status">
               <el-radio-group v-model="form.status">
-                <el-radio label="0">正常</el-radio>
-                <el-radio label="1">欠费</el-radio>
-                <el-radio label="2">停用</el-radio>
+                <el-radio v-for="item in userStatusOptions" :key="item.dictValue" :label="item.dictValue">{{ item.dictLabel }}</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item label="用水地址" prop="address">
-              <el-input v-model="form.address" placeholder="请输入用水地址" maxlength="200" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12"><el-form-item label="经度" prop="longitude"><el-input-number v-model="form.longitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
-          <el-col :span="12"><el-form-item label="纬度" prop="latitude"><el-input-number v-model="form.latitude" :precision="8" :step="0.00000001" controls-position="right" style="width: 100%" /></el-form-item></el-col>
           <el-col :span="12">
             <el-form-item label="联系人" prop="contactPerson">
               <el-input v-model="form.contactPerson" placeholder="请输入联系人" maxlength="50" />
@@ -176,6 +135,10 @@
               <el-input-number v-model="form.annualWaterConsumption" :min="0" :precision="2" style="width: 100%" placeholder="请输入年用水量" />
             </el-form-item>
           </el-col>
+          <FacilityLocationFields
+            v-model="form"
+            address-prop="address"
+          />
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
               <el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" maxlength="500" />
@@ -187,38 +150,9 @@
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="dialogVisible = false">取 消</el-button>
       </template>
-    </el-drawer>
-
-    <!-- 详情抽屉 -->
-    <el-drawer title="用水户详情" v-model="detailVisible" class="detail-drawer" direction="rtl" size="650px" append-to-body>
-      <el-descriptions :column="2" border>
-        <el-descriptions-item label="用水户编号">{{ detailData.userCode }}</el-descriptions-item>
-        <el-descriptions-item label="用水户名称">{{ detailData.userName }}</el-descriptions-item>
-        <el-descriptions-item label="用水户类型">{{ detailData.userType }}</el-descriptions-item>
-        <el-descriptions-item label="用水户状态">
-          <el-tag :type="statusTagType(detailData.status)" size="small">{{ statusLabel(detailData.status) }}</el-tag>
-        </el-descriptions-item>
-        <el-descriptions-item label="用水地址" :span="2">{{ detailData.address }}</el-descriptions-item>
-        <el-descriptions-item label="经度">{{ detailData.longitude }}</el-descriptions-item>
-        <el-descriptions-item label="纬度">{{ detailData.latitude }}</el-descriptions-item>
-        <el-descriptions-item label="联系人">{{ detailData.contactPerson }}</el-descriptions-item>
-        <el-descriptions-item label="联系电话">{{ detailData.contactPhone }}</el-descriptions-item>
-        <el-descriptions-item label="水表编号">{{ detailData.meterNumber }}</el-descriptions-item>
-        <el-descriptions-item label="初始读数(m³)">{{ detailData.initialReading }}</el-descriptions-item>
-        <el-descriptions-item label="当前读数(m³)">{{ detailData.currentReading }}</el-descriptions-item>
-        <el-descriptions-item label="年用水量(m³)">{{ detailData.annualWaterConsumption }}</el-descriptions-item>
-        <el-descriptions-item label="备注" :span="2">{{ detailData.remark }}</el-descriptions-item>
-        <el-descriptions-item label="创建者">{{ detailData.createBy }}</el-descriptions-item>
-        <el-descriptions-item label="创建时间">{{ detailData.createTime }}</el-descriptions-item>
-        <el-descriptions-item label="更新者">{{ detailData.updateBy }}</el-descriptions-item>
-        <el-descriptions-item label="更新时间">{{ detailData.updateTime }}</el-descriptions-item>
-      </el-descriptions>
-      <template #footer>
-        <el-button @click="detailVisible = false">关 闭</el-button>
-      </template>
-    </el-drawer>
+    </el-dialog>
 
-    <WaterFacilityImportDialog v-model="importVisible" title="用水户信息" upload-url="/api/water/userInfo/importData" template-url="/api/water/userInfo/importTemplate" @imported="getList" />
+    <FacilityImportDialog v-model="importVisible" title="用水户信息" upload-url="/api/water/userInfo/importData" template-url="/api/water/userInfo/importTemplate" dict-hint="用水户类型、状态请从模板下拉框中选择中文" @imported="getList" />
 
     <!-- 回收站对话框 -->
     <el-dialog title="回收站" v-model="recycleVisible" width="900px" append-to-body>
@@ -239,7 +173,7 @@
         <el-table-column label="用水户编号" align="center" prop="userCode" />
         <el-table-column label="用水户名称" align="center" prop="userName" />
         <el-table-column label="用水户类型" align="center" prop="userType" width="100" />
-        <el-table-column label="用水地址" align="center" prop="address" :show-overflow-tooltip="true" />
+        <el-table-column label="地址" align="center" prop="address" :show-overflow-tooltip="true" />
         <el-table-column label="联系电话" align="center" prop="contactPhone" width="120" />
         <el-table-column label="用水户状态" align="center" width="100">
           <template #default="{ row }">
@@ -266,13 +200,17 @@ import { listWaterUser, getWaterUser, addWaterUser, updateWaterUser, delWaterUse
 import { saveAs } from 'file-saver'
 import { exportWaterUser } from '@/api/pipeNetwork/waterSupply'
 import { buildWaterFacilityQuery, getRequestErrorMessage } from '@/utils/waterFacilityQuery'
-import WaterFacilityImportDialog from '@/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue'
+import FacilityImportDialog from '../components/FacilityImportDialog.vue'
+import FacilityLocationFields from '../components/FacilityLocationFields.vue'
+import { getDicts } from '@/api/system/dict/data'
 
 export default {
-  name: 'WaterUser',
-  components: { WaterFacilityImportDialog },
+  name: 'FacilityWaterUser',
+  components: { FacilityImportDialog, FacilityLocationFields },
   data() {
     return {
+      userTypeOptions: [],
+      userStatusOptions: [],
       loading: true,
       ids: [],
       single: true,
@@ -283,9 +221,7 @@ export default {
       dateRange: [],
       dialogTitle: '',
       dialogVisible: false,
-      detailVisible: false,
       importVisible: false,
-      detailData: {},
       recycleVisible: false,
       recycleLoading: false,
       recycleData: [],
@@ -319,9 +255,17 @@ export default {
     }
   },
   created() {
+    this.loadDictOptions()
     this.getList()
   },
   methods: {
+    loadDictOptions() {
+      const load = (type, key) => getDicts(type)
+        .then(res => { this[key] = res.data || [] })
+        .catch(() => { this[key] = [] })
+      load('water_user_type', 'userTypeOptions')
+      load('water_user_status', 'userStatusOptions')
+    },
     getList() {
       this.loading = true
       this.errorMessage = ''
@@ -339,12 +283,12 @@ export default {
       if (this.retryAction) this.retryAction()
     },
     statusTagType(status) {
-      const map = { '0': 'success', '1': 'warning', '2': 'danger' }
-      return map[status] || 'info'
+      const hit = this.userStatusOptions.find(item => String(item.dictValue) === String(status))
+      return (hit && hit.listClass) || 'info'
     },
     statusLabel(status) {
-      const map = { '0': '正常', '1': '欠费', '2': '停用' }
-      return map[status] || '未知'
+      const hit = this.userStatusOptions.find(item => String(item.dictValue) === String(status))
+      return hit ? hit.dictLabel : status
     },
     handleQuery() {
       this.queryParams.pageNum = 1
@@ -386,16 +330,6 @@ export default {
         this.dialogVisible = true
       })
     },
-    handleDetail(row) {
-      this.errorMessage = ''
-      this.retryAction = () => this.handleDetail(row)
-      getWaterUser(row.id).then(response => {
-        this.detailData = response.data
-        this.detailVisible = true
-      }).catch(error => {
-        this.errorMessage = getRequestErrorMessage(error, '用水户详情查询失败,请稍后重试')
-      })
-    },
     submitForm() {
       this.$refs.form.validate(valid => {
         if (valid) {
@@ -472,5 +406,5 @@ export default {
 </script>
 
 <style scoped lang="scss">
-@use '../../waterSupply/components/waterFacilityPageTheme.scss';
+@use '../../../waterSupply/components/waterFacilityPageTheme.scss';
 </style>

+ 2 - 4
src/views/subSystem/pipeNetwork/home/index.vue

@@ -109,7 +109,6 @@
               </button>
               <div class="pipe-legend">
                 <span><i class="pipe-swatch normal"></i>正常</span>
-                <span><i class="pipe-swatch maintain"></i>维护中</span>
                 <span><i class="pipe-swatch abnormal"></i>异常</span>
               </div>
             </div>
@@ -304,8 +303,8 @@ const DISTRICT_MAP = { 0: '城南', 1: '城北', 2: '太常' }
 /** 无设备数据时仍展示的区域维度,取自 DistrictEnum */
 const DEFAULT_DISTRICTS = ['城南', '城北', '太常']
 const TODO_ORDER_STATUS = ORDER_STATUS_GROUP.todo.join(',')
-/** 管网状态配色,取值见 pipe_network_status 字典:0-正常 1-维护中 2-异常;线型沿用原燃气大屏口径 */
-const PIPE_STATUS_COLOR = { 0: '#16a34a', 1: '#ffb020', 2: '#ef4444' }
+/** 管网状态配色与其他设施一致:0-正常 1-异常;线型沿用原燃气大屏口径 */
+const PIPE_STATUS_COLOR = { 0: '#16a34a', 1: '#ef4444' }
 /** 报警查询后端限制 pageSize 不超过 100 */
 const ALARM_PAGE_SIZE = 100
 const ALARM_MAX_PAGES = 3
@@ -832,7 +831,6 @@ watch(rootTypeId, () => {
 .pipe-legend span { display: inline-flex; align-items: center; gap: 3px; }
 .pipe-swatch { width: 8px; height: 8px; border-radius: 2px; }
 .pipe-swatch.normal { background: #16a34a; }
-.pipe-swatch.maintain { background: #ffb020; }
 .pipe-swatch.abnormal { background: #ef4444; }
 .map-error { position: absolute; left: 16px; bottom: 16px; width: 360px; z-index: 2; }
 .map-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; }

+ 1 - 1
src/views/subSystem/waterSupply/components/WaterFacilityDashboard.vue

@@ -128,7 +128,7 @@ const facilityTypes = [
 ]
 const STATUS_CATEGORY_LABELS = {
   abnormal: { source: '异常', plant: '停产', pumpStation: '故障停运', pipe: '异常', user: '停用' },
-  warning: { pumpStation: '检修中', pipe: '维护中', user: '欠费' }
+  warning: { pumpStation: '检修中', user: '欠费' }
 }
 const overview = ref([])
 const rows = ref([])

+ 0 - 85
src/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue

@@ -1,85 +0,0 @@
-<template>
-  <el-dialog v-model="visible" :title="`${title}批量导入`" width="460px" append-to-body @closed="reset">
-    <el-upload
-      ref="uploadRef"
-      drag
-      :limit="1"
-      accept=".xlsx, .xls"
-      :headers="headers"
-      :action="actionUrl"
-      :disabled="isUploading"
-      :auto-upload="false"
-      :before-upload="validateFile"
-      :on-progress="onProgress"
-      :on-success="onSuccess"
-      :on-error="onError"
-    >
-      <el-icon class="el-icon--upload"><upload-filled /></el-icon>
-      <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-      <template #tip>
-        <div class="el-upload__tip">
-          <el-checkbox v-model="updateSupport">更新已存在的业务编码</el-checkbox>
-          <el-link type="primary" :underline="false" @click="downloadTemplate">下载模板</el-link>
-          <div>仅支持 xls、xlsx,业务编码为空的行将被跳过。</div>
-        </div>
-      </template>
-    </el-upload>
-    <template #footer>
-      <el-button type="primary" :loading="isUploading" @click="submit">开始导入</el-button>
-      <el-button @click="visible = false">取消</el-button>
-    </template>
-  </el-dialog>
-</template>
-
-<script setup>
-import { computed, ref } from 'vue'
-import { getToken } from '@/utils/auth'
-import { download } from '@/utils/request'
-import { ElMessage } from 'element-plus'
-
-const props = defineProps({
-  modelValue: { type: Boolean, default: false },
-  title: { type: String, required: true },
-  uploadUrl: { type: String, required: true },
-  templateUrl: { type: String, required: true }
-})
-const emit = defineEmits(['update:modelValue', 'imported'])
-const uploadRef = ref()
-const updateSupport = ref(false)
-const isUploading = ref(false)
-const headers = { Authorization: `Bearer ${getToken()}` }
-const actionUrl = computed(() => `${import.meta.env.VITE_APP_BASE_API}${props.uploadUrl}?updateSupport=${updateSupport.value}`)
-const visible = computed({ get: () => props.modelValue, set: value => emit('update:modelValue', value) })
-
-function submit() { uploadRef.value?.submit() }
-function validateFile(file) {
-  if (!/\.(xlsx|xls)$/iu.test(file?.name || '')) {
-    ElMessage.error('仅支持 xls、xlsx 文件')
-    return false
-  }
-  return true
-}
-function onProgress() { isUploading.value = true }
-function onSuccess(response) {
-  isUploading.value = false
-  if (response?.code && response.code !== 200) {
-    ElMessage.error(response.msg || '导入失败,请检查文件格式')
-    return
-  }
-  ElMessage.success(response?.msg || '导入成功')
-  emit('imported')
-  visible.value = false
-}
-function onError(error) {
-  isUploading.value = false
-  ElMessage.error(error?.message || '导入失败,请检查文件格式')
-}
-function downloadTemplate() {
-  download(props.templateUrl, {}, `${props.title}导入模板.xlsx`)
-}
-function reset() {
-  updateSupport.value = false
-  isUploading.value = false
-  uploadRef.value?.clearFiles()
-}
-</script>

+ 47 - 0
src/views/subSystem/waterSupply/components/waterFacilityPageTheme.scss

@@ -26,6 +26,41 @@
   margin-bottom: 16px;
 }
 
+// 与其它设施页(InfrastructureCrudPage)一致的页头:蓝色竖条 + 标题 + 右侧操作区
+.page-head {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 12px;
+  margin-bottom: 16px;
+}
+
+.page-title-bar {
+  width: 4px;
+  height: 20px;
+  border-radius: 2px;
+  background: var(--el-color-primary);
+}
+
+.page-head .page-title h2 {
+  margin: 0;
+  font-size: 18px;
+}
+
+.page-actions {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  flex-wrap: wrap;
+}
+
+@media (max-width: 768px) {
+  .page-head {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+}
+
 .page-title {
   display: flex;
   align-items: center;
@@ -105,6 +140,18 @@
   color: #475569;
 }
 
+// 查询区输入控件高度与其它设施页(InfrastructureCrudPage 默认尺寸)统一为 32px。
+// 这些页面查询表单用了 size="small"(24px),视觉上偏矮;在此统一覆盖 wrapper 高度。
+.filter-card :deep(.el-input__wrapper),
+.filter-card :deep(.el-select__wrapper) {
+  min-height: 32px;
+}
+
+// 查询表单垂直居中,去掉行底多余留白。
+.filter-card .query-form :deep(.el-form-item) {
+  margin-bottom: 0;
+}
+
 .card-title {
   display: flex;
   align-items: center;

+ 0 - 1
src/views/subSystem/waterSupply/facility/pipe.vue

@@ -1 +0,0 @@
-<script setup>import Page from '@/views/subSystem/basic/pipeInfo/index.vue'</script><template><Page /></template>

+ 0 - 1
src/views/subSystem/waterSupply/facility/plant.vue

@@ -1 +0,0 @@
-<script setup>import Page from '@/views/subSystem/basic/waterPlant/index.vue'</script><template><Page /></template>

+ 0 - 1
src/views/subSystem/waterSupply/facility/pumpStation.vue

@@ -1 +0,0 @@
-<script setup>import Page from '@/views/subSystem/basic/pumpStation/index.vue'</script><template><Page /></template>

+ 0 - 1
src/views/subSystem/waterSupply/facility/source.vue

@@ -1 +0,0 @@
-<script setup>import Page from '@/views/subSystem/basic/waterSource/index.vue'</script><template><Page /></template>

+ 0 - 1
src/views/subSystem/waterSupply/facility/user.vue

@@ -1 +0,0 @@
-<script setup>import Page from '@/views/subSystem/basic/waterUserInfo/index.vue'</script><template><Page /></template>

+ 0 - 58
tests/waterFacilityImportCoordinates.test.mjs

@@ -1,58 +0,0 @@
-import assert from 'node:assert/strict'
-import fs from 'node:fs'
-import test from 'node:test'
-
-const facilities = [
-  {
-    path: 'src/views/subSystem/basic/waterSource/index.vue',
-    fields: ['longitude', 'latitude']
-  },
-  {
-    path: 'src/views/subSystem/basic/waterPlant/index.vue',
-    fields: ['longitude', 'latitude']
-  },
-  {
-    path: 'src/views/subSystem/basic/pumpStation/index.vue',
-    fields: ['longitude', 'latitude']
-  },
-  {
-    path: 'src/views/subSystem/basic/pipeInfo/index.vue',
-    fields: ['startLongitude', 'startLatitude', 'endLongitude', 'endLatitude']
-  },
-  {
-    path: 'src/views/subSystem/basic/waterUserInfo/index.vue',
-    fields: ['longitude', 'latitude']
-  }
-]
-
-test('all T1 facility pages expose Excel import through the shared dialog', () => {
-  for (const facility of facilities) {
-    const source = fs.readFileSync(facility.path, 'utf8')
-    assert.match(source, /WaterFacilityImportDialog/u, facility.path)
-    assert.match(source, />导入<\/el-button>/u, facility.path)
-    assert.match(source, /@imported="getList"/u, facility.path)
-  }
-
-  const dialog = fs.readFileSync('src/views/subSystem/waterSupply/components/WaterFacilityImportDialog.vue', 'utf8')
-  assert.match(dialog, /accept="\.xlsx, \.xls"/u)
-  assert.match(dialog, /:before-upload="validateFile"/u)
-  assert.match(dialog, /function validateFile/u)
-  assert.match(dialog, /\(xlsx\|xls\)/u)
-  assert.match(dialog, /updateSupport/u)
-  assert.match(dialog, /下载模板/u)
-  assert.match(dialog, /VITE_APP_BASE_API/u)
-  assert.match(dialog, /download\(props\.templateUrl/u)
-  assert.match(dialog, /response\.code !== 200/u)
-})
-
-test('all T1 facility pages expose coordinates in list, edit drawer, and detail drawer', () => {
-  for (const facility of facilities) {
-    const source = fs.readFileSync(facility.path, 'utf8')
-    for (const field of facility.fields) {
-      const occurrences = source.match(new RegExp(field, 'gu')) || []
-      assert.ok(occurrences.length >= 3, `${facility.path} must expose ${field} for list, form, and detail`)
-      assert.match(source, new RegExp(`v-model="form\\.${field}"`, 'u'), `${facility.path} must edit ${field}`)
-      assert.match(source, new RegExp(`detailData\\.${field}`, 'u'), `${facility.path} must show ${field} in details`)
-    }
-  }
-})

+ 6 - 7
tests/waterFacilityStatistics.test.mjs

@@ -104,8 +104,8 @@ test('facility status labels follow the per-facility-type contract', () => {
   assert.equal(resolveFacilityStatusLabel('plant', 1), '停产')
   assert.equal(resolveFacilityStatusLabel('pumpStation', 1), '故障停运')
   assert.equal(resolveFacilityStatusLabel('pumpStation', 2), '检修中')
-  assert.equal(resolveFacilityStatusLabel('pipe', 1), '维护中')
-  assert.equal(resolveFacilityStatusLabel('pipe', 2), '异常')
+  assert.equal(resolveFacilityStatusLabel('pipe', 1), '异常')
+  assert.equal(resolveFacilityStatusLabel('pipe', 2), '未知')
   assert.equal(resolveFacilityStatusLabel('user', 1), '欠费')
   assert.equal(resolveFacilityStatusLabel('user', 2), '停用')
   assert.equal(resolveFacilityStatusLabel('source', null), '未知')
@@ -122,8 +122,8 @@ test('dashboard sections map to the shared facility status contract', () => {
 
   assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.waterSource, 1), '异常')
   assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.waterPlant, 1), '停产')
-  assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.pipeNetwork, 1), '维护中')
-  assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.pipeNetwork, 2), '异常')
+  assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.pipeNetwork, 1), '异常')
+  assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.pipeNetwork, 2), '未知')
   assert.equal(resolveFacilityStatusLabel(FACILITY_SECTION_TYPES.waterUser, 1), '欠费')
   assert.deepEqual(FACILITY_SECTION_LABELS, {
     pipeNetwork: '管网',
@@ -144,8 +144,7 @@ test('facility status colors follow the per-facility-type contract', () => {
   })
   assert.deepEqual(FACILITY_STATUS_TAG_TYPES.pipe, {
     0: 'success',
-    1: 'warning',
-    2: 'danger'
+    1: 'danger'
   })
   assert.deepEqual(FACILITY_STATUS_TAG_TYPES.user, {
     0: 'success',
@@ -259,7 +258,7 @@ test('statistics detail rows render backend payload without english text', () =>
         { name: 'PE', value: 277, unit: '条' },
         { name: '铸铁', value: 183, unit: '条' }
       ],
-      statusDistribution: [{ name: '2', value: 4, unit: '条' }]
+      statusDistribution: [{ name: '1', value: 4, unit: '条' }]
     },
     waterPlant: {
       design_capacity: 5,

+ 0 - 59
tests/waterPipeNetworkStatusThreeValues.test.mjs

@@ -1,59 +0,0 @@
-import test from 'node:test'
-import assert from 'node:assert/strict'
-import fs from 'node:fs'
-
-import {
-  FACILITY_STATUS_LABELS,
-  FACILITY_STATUS_TAG_TYPES,
-  resolveFacilityStatusLabel,
-  resolveFacilityStatusTagType
-} from '../src/utils/waterFacilityStatisticsModel.js'
-import { formatFacilityDetail } from '../src/utils/waterFacilityGisModel.js'
-
-// Gogs #55:管网状态以数据库口径为准 —— 0-正常 / 1-维护中 / 2-异常。
-
-test('pipe status labels follow the three-value contract', () => {
-  assert.deepEqual(FACILITY_STATUS_LABELS.pipe, { 0: '正常', 1: '维护中', 2: '异常' })
-  assert.equal(resolveFacilityStatusLabel('pipe', '0'), '正常')
-  assert.equal(resolveFacilityStatusLabel('pipe', '1'), '维护中')
-  assert.equal(resolveFacilityStatusLabel('pipe', '2'), '异常')
-  assert.equal(resolveFacilityStatusLabel('pipe', 2), '异常')
-})
-
-test('pipe status colors are green / orange / red in both list and detail', () => {
-  assert.deepEqual(FACILITY_STATUS_TAG_TYPES.pipe, { 0: 'success', 1: 'warning', 2: 'danger' })
-  assert.equal(resolveFacilityStatusTagType('pipe', '0'), 'success')
-  assert.equal(resolveFacilityStatusTagType('pipe', '1'), 'warning')
-  assert.equal(resolveFacilityStatusTagType('pipe', '2'), 'danger')
-  assert.equal(resolveFacilityStatusTagType('pipe', null), 'info')
-})
-
-test('status 2 is no longer reported as unknown for pipes', () => {
-  assert.notEqual(resolveFacilityStatusLabel('pipe', '2'), '未知')
-  assert.notEqual(resolveFacilityStatusTagType('pipe', '2'), 'info')
-})
-
-test('pipe detail drawer resolves the same three-value labels', () => {
-  const detail = formatFacilityDetail({ status: 1, networkName: '输水干线' }, 'pipe')
-  assert.ok(detail.some(item => item.label === '运行状态' && item.value === '维护中'))
-  const abnormal = formatFacilityDetail({ status: 2 }, 'pipe')
-  assert.ok(abnormal.some(item => item.label === '运行状态' && item.value === '异常'))
-})
-
-test('pipe query page keeps dict-driven labels and a shared three-value color helper', () => {
-  const source = fs.readFileSync('src/views/subSystem/basic/pipeInfo/index.vue', 'utf8')
-
-  assert.match(source, /getDicts\('pipe_network_status'\)/u)
-  assert.match(source, /statusTagType\(row\.status\)/u)
-  assert.match(source, /statusTagType\(detailData\.status\)/u)
-  assert.match(source, /'0': 'success', '1': 'warning', '2': 'danger'/u)
-  assert.doesNotMatch(source, /status\) === '0' \? 'success' : 'danger'/u)
-})
-
-test('gas pipe network page shares the same three-value colors for the same table', () => {
-  const source = fs.readFileSync('src/views/subSystem/basic/PipeNetwork.vue', 'utf8')
-
-  assert.match(source, /statusTagType\(row\.status\)/u)
-  assert.match(source, /'0': 'success', '1': 'warning', '2': 'danger'/u)
-  assert.doesNotMatch(source, /row\.status === '0' \? 'success' : 'danger'/u)
-})

+ 47 - 0
tests/waterPipeNetworkStatusTwoValues.test.mjs

@@ -0,0 +1,47 @@
+import test from 'node:test'
+import assert from 'node:assert/strict'
+import fs from 'node:fs'
+
+import {
+  FACILITY_STATUS_LABELS,
+  FACILITY_STATUS_TAG_TYPES,
+  resolveFacilityStatusLabel,
+  resolveFacilityStatusTagType
+} from '../src/utils/waterFacilityStatisticsModel.js'
+import { formatFacilityDetail } from '../src/utils/waterFacilityGisModel.js'
+
+// 管网状态与其他设施统一为两值域:0-正常 / 1-异常。
+
+test('pipe status labels follow the two-value contract', () => {
+  assert.deepEqual(FACILITY_STATUS_LABELS.pipe, { 0: '正常', 1: '异常' })
+  assert.equal(resolveFacilityStatusLabel('pipe', '0'), '正常')
+  assert.equal(resolveFacilityStatusLabel('pipe', '1'), '异常')
+  assert.equal(resolveFacilityStatusLabel('pipe', 1), '异常')
+  assert.equal(resolveFacilityStatusLabel('pipe', '2'), '未知')
+})
+
+test('pipe status colors are green / red in both list and detail', () => {
+  assert.deepEqual(FACILITY_STATUS_TAG_TYPES.pipe, { 0: 'success', 1: 'danger' })
+  assert.equal(resolveFacilityStatusTagType('pipe', '0'), 'success')
+  assert.equal(resolveFacilityStatusTagType('pipe', '1'), 'danger')
+  assert.equal(resolveFacilityStatusTagType('pipe', '2'), 'info')
+  assert.equal(resolveFacilityStatusTagType('pipe', null), 'info')
+})
+
+test('pipe detail drawer resolves the same two-value labels', () => {
+  const normal = formatFacilityDetail({ status: 0, networkName: '输水干线' }, 'pipe')
+  assert.ok(normal.some(item => item.label === '运行状态' && item.value === '正常'))
+  const abnormal = formatFacilityDetail({ status: 1 }, 'pipe')
+  assert.ok(abnormal.some(item => item.label === '运行状态' && item.value === '异常'))
+})
+
+test('pipe query page uses shared status dict and hides networkLevel in list/form', () => {
+  const source = fs.readFileSync('src/views/subSystem/pipeNetwork/facilities/pipeNetwork/index.vue', 'utf8')
+
+  assert.match(source, /loadDict\("infrastructure_status", statusDict\)/u)
+  assert.match(source, /const type = hit && hit\.listClass/u)
+  assert.match(source, /getStatusTagType\(scope\.row\.status\)/u)
+  assert.match(source, /getStatusText\(scope\.row\.status\)/u)
+  assert.doesNotMatch(source, /prop="networkLevel"/u)
+  assert.doesNotMatch(source, /维护中/u)
+})