|
@@ -102,10 +102,11 @@
|
|
|
|
|
|
|
|
<template #legend>
|
|
<template #legend>
|
|
|
<div class="panel-section legend-panel">
|
|
<div class="panel-section legend-panel">
|
|
|
- <h3>图例</h3>
|
|
|
|
|
- <div class="legend-row" v-for="item in facilityTypes" :key="item.value">
|
|
|
|
|
|
|
+ <h3>设施状态图例</h3>
|
|
|
|
|
+ <div class="legend-row" v-for="item in facilityStatusLegend" :key="item.label">
|
|
|
<i class="legend-dot" :style="{ background: item.color }"></i>{{ item.label }}
|
|
<i class="legend-dot" :style="{ background: item.color }"></i>{{ item.label }}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="legend-row"><i class="legend-dot" :style="{ background: colorMap.pipe }"></i>供水管网(仅管线)</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -122,9 +123,17 @@
|
|
|
/>
|
|
/>
|
|
|
<div v-else class="device-result-list">
|
|
<div v-else class="device-result-list">
|
|
|
<button v-for="feature in filteredFeatures" :key="feature.id || feature.name" type="button" @click="locateFeature(feature)">
|
|
<button v-for="feature in filteredFeatures" :key="feature.id || feature.name" type="button" @click="locateFeature(feature)">
|
|
|
- <span class="device-name">{{ feature.name }}</span>
|
|
|
|
|
|
|
+ <span class="device-name">
|
|
|
|
|
+ <i class="status-dot" :style="{ background: featureColor(feature) }"></i>
|
|
|
|
|
+ {{ feature.name }}
|
|
|
|
|
+ </span>
|
|
|
<span class="device-meta">{{ labelMap[feature.type] || '供水设施' }} · {{ feature.code || '-' }}</span>
|
|
<span class="device-meta">{{ labelMap[feature.type] || '供水设施' }} · {{ feature.code || '-' }}</span>
|
|
|
- <el-tag size="small" type="primary">{{ labelMap[feature.type] || '供水设施' }}</el-tag>
|
|
|
|
|
|
|
+ <!-- 管网只有管线、没有状态语义,这里回退展示设施类型 -->
|
|
|
|
|
+ <el-tag v-if="featureStatusMeta(feature)" size="small"
|
|
|
|
|
+ :type="gisPointStatusTagTypes[featureStatusMeta(feature).key] || 'info'">
|
|
|
|
|
+ {{ featureStatusMeta(feature).text }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ <el-tag v-else size="small" type="primary">{{ labelMap[feature.type] || '供水设施' }}</el-tag>
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -167,6 +176,7 @@
|
|
|
<p>{{ labelMap[detailTarget?.type] || '供水设施' }} · {{ detailTarget?.code || '-' }}</p>
|
|
<p>{{ labelMap[detailTarget?.type] || '供水设施' }} · {{ detailTarget?.code || '-' }}</p>
|
|
|
<div class="status-tags">
|
|
<div class="status-tags">
|
|
|
<el-tag type="primary">{{ labelMap[detailTarget?.type] || '供水设施' }}</el-tag>
|
|
<el-tag type="primary">{{ labelMap[detailTarget?.type] || '供水设施' }}</el-tag>
|
|
|
|
|
+ <el-tag :type="gisPointStatusTagTypes[detailStatusMeta.key] || 'info'">{{ detailStatusMeta.text }}</el-tag>
|
|
|
</div>
|
|
</div>
|
|
|
</section>
|
|
</section>
|
|
|
<section class="detail-section">
|
|
<section class="detail-section">
|
|
@@ -198,7 +208,7 @@ import { getWaterFacilityOverview, getWaterFacilityFeatures, getWaterFacilityDet
|
|
|
import { normalizeGeoJson, unwrapResponse } from '@/utils/waterSupplyModel'
|
|
import { normalizeGeoJson, unwrapResponse } from '@/utils/waterSupplyModel'
|
|
|
import { getRequestErrorMessage } from '@/utils/waterFacilityQuery'
|
|
import { getRequestErrorMessage } from '@/utils/waterFacilityQuery'
|
|
|
import { buildFacilityMapModel, filterFacilityMapModel, findFacilityFeature, formatFacilityDetail } from '@/utils/waterFacilityGisModel'
|
|
import { buildFacilityMapModel, filterFacilityMapModel, findFacilityFeature, formatFacilityDetail } from '@/utils/waterFacilityGisModel'
|
|
|
-import { getFacilityPointIcon } from '@/utils/gisMapColors'
|
|
|
|
|
|
|
+import { getFacilityStatusIcon, getFacilityStatusMeta, gisPointStatusColors, gisPointStatusTagTypes } from '@/utils/gisMapColors'
|
|
|
|
|
|
|
|
const centerPoint = { lng: 110.3965, lat: 28.4638 }
|
|
const centerPoint = { lng: 110.3965, lat: 28.4638 }
|
|
|
|
|
|
|
@@ -234,6 +244,14 @@ const labelMap = {
|
|
|
user: '用水户'
|
|
user: '用水户'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 顶部状态标识:与点位同源,绿-正常、红-报警/异常、蓝-检修中、黄-欠费
|
|
|
|
|
+const facilityStatusLegend = [
|
|
|
|
|
+ { label: '正常', color: gisPointStatusColors.normal },
|
|
|
|
|
+ { label: '异常 / 停产 / 故障停运 / 停用', color: gisPointStatusColors.alarm },
|
|
|
|
|
+ { label: '检修中', color: gisPointStatusColors.workOrder },
|
|
|
|
|
+ { label: '欠费', color: gisPointStatusColors.warning }
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
const gisMapRef = ref(null)
|
|
const gisMapRef = ref(null)
|
|
|
const searchKeyword = ref('')
|
|
const searchKeyword = ref('')
|
|
|
const selectedFacilityType = ref('')
|
|
const selectedFacilityType = ref('')
|
|
@@ -285,20 +303,36 @@ const filteredFeatures = computed(() => {
|
|
|
|
|
|
|
|
const mapPoints = computed(() => visibleMapModel.value.points.map(point => ({
|
|
const mapPoints = computed(() => visibleMapModel.value.points.map(point => ({
|
|
|
...point,
|
|
...point,
|
|
|
- color: colorMap[point.type] || '#457b9d',
|
|
|
|
|
- iconUrl: getFacilityPointIcon(point.type),
|
|
|
|
|
|
|
+ color: gisPointStatusColors[getFacilityStatusMeta(point.type, point.status).key],
|
|
|
|
|
+ iconUrl: getFacilityStatusIcon(point.type, point.status),
|
|
|
|
|
+ statusText: getFacilityStatusMeta(point.type, point.status).text,
|
|
|
name: point.name || point.code || '供水设施'
|
|
name: point.name || point.code || '供水设施'
|
|
|
})))
|
|
})))
|
|
|
|
|
|
|
|
const mapLines = computed(() => visibleMapModel.value.lines.map(line => ({
|
|
const mapLines = computed(() => visibleMapModel.value.lines.map(line => ({
|
|
|
...line,
|
|
...line,
|
|
|
color: colorMap[line.type] || '#fcbf49',
|
|
color: colorMap[line.type] || '#fcbf49',
|
|
|
- iconUrl: getFacilityPointIcon(line.type),
|
|
|
|
|
name: line.name || '供水管网'
|
|
name: line.name || '供水管网'
|
|
|
})))
|
|
})))
|
|
|
|
|
|
|
|
const detailEntries = computed(() => formatFacilityDetail(detailRecord.value, detailTarget.value?.type))
|
|
const detailEntries = computed(() => formatFacilityDetail(detailRecord.value, detailTarget.value?.type))
|
|
|
|
|
|
|
|
|
|
+// 管网只有管线、不参与设施状态语义;其余设施取状态元数据
|
|
|
|
|
+function featureStatusMeta(feature) {
|
|
|
|
|
+ return feature?.type === 'pipe' ? null : getFacilityStatusMeta(feature?.type, feature?.status)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function featureColor(feature) {
|
|
|
|
|
+ const meta = featureStatusMeta(feature)
|
|
|
|
|
+ return meta ? gisPointStatusColors[meta.key] : colorMap.pipe
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 详情顶部标签展示设施业务状态(异常/停产/故障停运/检修中/欠费/停用),与点位颜色同一口径
|
|
|
|
|
+const detailStatusMeta = computed(() => getFacilityStatusMeta(
|
|
|
|
|
+ detailTarget.value?.type,
|
|
|
|
|
+ detailRecord.value?.status ?? detailTarget.value?.status
|
|
|
|
|
+))
|
|
|
|
|
+
|
|
|
watch(layerState, () => {
|
|
watch(layerState, () => {
|
|
|
if (mapReady.value) nextTick(() => gisMapRef.value?.fitBounds())
|
|
if (mapReady.value) nextTick(() => gisMapRef.value?.fitBounds())
|
|
|
}, { deep: true })
|
|
}, { deep: true })
|
|
@@ -500,6 +534,18 @@ async function refreshScene() {
|
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+.device-name {
|
|
|
|
|
+ display: inline-flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+}
|
|
|
|
|
+.status-dot {
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ width: 8px;
|
|
|
|
|
+ height: 8px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ flex: none;
|
|
|
|
|
+}
|
|
|
.result-section {
|
|
.result-section {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
min-height: 0;
|
|
min-height: 0;
|