|
|
@@ -25,14 +25,16 @@ test('shared gis map canvas renders pipelines without endpoint markers', async (
|
|
|
assert.doesNotMatch(addLine, /终点/u)
|
|
|
})
|
|
|
|
|
|
-test('shared gis map canvas merges overlapping markers and emits cluster clicks', async () => {
|
|
|
+test('shared gis map canvas renders contextual clusters with colorful mixed icons', async () => {
|
|
|
const source = await readFile('src/components/GisMapCanvas.vue', 'utf8')
|
|
|
const addClusterMarker = source.match(/function addClusterMarker\(BMapGL, cluster\) \{[\s\S]*?\n\}/u)?.[0] || ''
|
|
|
|
|
|
assert.match(source, /import \{ mergeMapPoints \} from '@\/utils\/gisMapClustering'/u)
|
|
|
assert.match(source, /clusterRadius: \{ type: Number, default: 48 \}/u)
|
|
|
+ assert.match(source, /clusterLabel: \{ type: String, default: '点位集合' \}/u)
|
|
|
assert.match(source, /mergeMapPoints\(renderPoints, projectMapPoint, props\.clusterRadius\)/u)
|
|
|
assert.match(source, /getMapClusterIcon\(cluster\.points\)/u)
|
|
|
+ assert.match(source, /escapeHtml\(props\.clusterLabel\)/u)
|
|
|
assert.match(source, /focusCluster\(cluster\)/u)
|
|
|
assert.match(source, /emit\('cluster-click', cluster\)/u)
|
|
|
assert.match(source, /function isClusterUnexpandable\(cluster\)/u)
|
|
|
@@ -76,10 +78,10 @@ test('facility point icons follow the five-facility-type contract', () => {
|
|
|
assert.match(getFacilityPointIcon('unknown'), /T_MarkPoint_Green\.png/u)
|
|
|
})
|
|
|
|
|
|
-test('cluster icons reuse the single member icon or fall back to the white marker', () => {
|
|
|
+test('cluster icons reuse the single member icon or fall back to the colorful marker', () => {
|
|
|
assert.match(getMapClusterIcon([{ alarmStatus: 1 }, { alarmStatus: 1 }]), /T_MarkPoint_Red\.png/u)
|
|
|
assert.match(getMapClusterIcon([{ onlineStatus: 0 }, { onlineStatus: 0 }]), /T_MarkPoint_Grey\.png/u)
|
|
|
- assert.match(getMapClusterIcon([{ alarmStatus: 1 }, { onlineStatus: 0 }]), /T_MarkPoint_WhiteBackground\.png/u)
|
|
|
+ assert.match(getMapClusterIcon([{ alarmStatus: 1 }, { onlineStatus: 0 }]), /T_MarkPoint_Colorful\.png/u)
|
|
|
})
|
|
|
|
|
|
test('monitoring point colors follow the documented status semantics', () => {
|
|
|
@@ -113,6 +115,7 @@ test('water supply GIS pages share the common canvas component', async () => {
|
|
|
const facilitySource = await readFile('src/views/subSystem/waterSupply/facility/gis.vue', 'utf8')
|
|
|
|
|
|
assert.match(deviceSource, /<GisMapCanvas/u)
|
|
|
+ assert.match(deviceSource, /cluster-label="设备集合"/u)
|
|
|
assert.match(deviceSource, /value="workOrder">关联工单/u)
|
|
|
assert.match(deviceSource, /legend-dot warning/u)
|
|
|
assert.match(deviceSource, /getMonitoringPointTagType/u)
|
|
|
@@ -123,10 +126,12 @@ test('water supply GIS pages share the common canvas component', async () => {
|
|
|
assert.match(facilitySource, /:points="mapPoints"/u)
|
|
|
assert.match(facilitySource, /:lines="mapLines"/u)
|
|
|
assert.match(facilitySource, /iconUrl: getFacilityPointIcon\(point\.type\)/u)
|
|
|
+ assert.match(facilitySource, /cluster-label="设施集合"/u)
|
|
|
assert.match(facilitySource, /@point-click="locateFeature"/u)
|
|
|
const alarmSource = await readFile('src/views/subSystem/waterSupply/components/WaterAlarmPage.vue', 'utf8')
|
|
|
|
|
|
assert.match(alarmSource, /<GisMapCanvas/u)
|
|
|
+ assert.match(alarmSource, /cluster-label="报警集合"/u)
|
|
|
assert.match(alarmSource, /getMonitoringPointColor\(point\)/u)
|
|
|
assert.match(alarmSource, /一级报警/u)
|
|
|
assert.doesNotMatch(alarmSource, /color: point\.relatedOrderNo \?/u)
|