|
|
@@ -306,6 +306,50 @@ test('home GIS overview aggregates facilities, devices and alarms with alarm pri
|
|
|
assert.deepEqual(empty, { points: [], lines: [] })
|
|
|
})
|
|
|
|
|
|
+test('home GIS facility points share device status color semantics by facility status', () => {
|
|
|
+ const overview = buildHomeGisOverview({
|
|
|
+ facilityPoints: [
|
|
|
+ { id: 'src-abnormal', type: 'source', name: '一水源地', lng: 110.08, lat: 28.05, status: 1 },
|
|
|
+ { id: 'src-normal', type: 'source', name: '二水源地', lng: 110.09, lat: 28.06, status: 0 },
|
|
|
+ { id: 'src-unknown', type: 'source', name: '三水源地', lng: 110.15, lat: 28.12 },
|
|
|
+ { id: 'plant-stopped', type: 'plant', name: '一水厂', lng: 110.1, lat: 28.07, status: 1 },
|
|
|
+ { id: 'pump-maintaining', type: 'pumpStation', name: '城南泵站', lng: 110.11, lat: 28.08, status: 2 },
|
|
|
+ { id: 'pump-fault', type: 'pumpStation', name: '城北泵站', lng: 110.12, lat: 28.09, status: 1 },
|
|
|
+ { id: 'user-arrears', type: 'user', name: '用水户A', lng: 110.13, lat: 28.1, status: 1 },
|
|
|
+ { id: 'user-stopped', type: 'user', name: '用水户B', lng: 110.14, lat: 28.11, status: 2 },
|
|
|
+ { id: 'pipe-point', type: 'pipe', name: '管网占位点', lng: 110.16, lat: 28.13 }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+
|
|
|
+ const byId = id => overview.points.find(point => point.id === id)
|
|
|
+
|
|
|
+ assert.equal(byId('src-abnormal').statusKey, 'alarm')
|
|
|
+ assert.equal(byId('src-abnormal').statusText, '异常')
|
|
|
+ assert.match(byId('src-abnormal').iconUrl, /T_MarkPoint_Red\.png/u)
|
|
|
+ assert.equal(byId('src-normal').statusKey, 'normal')
|
|
|
+ assert.equal(byId('src-normal').statusText, '正常')
|
|
|
+ assert.match(byId('src-normal').iconUrl, /T_MarkPoint_Green\.png/u)
|
|
|
+ assert.equal(byId('src-unknown').statusKey, 'normal')
|
|
|
+ assert.equal(byId('src-unknown').statusText, '正常')
|
|
|
+
|
|
|
+ assert.equal(byId('plant-stopped').statusKey, 'alarm')
|
|
|
+ assert.equal(byId('plant-stopped').statusText, '停产')
|
|
|
+
|
|
|
+ assert.equal(byId('pump-maintaining').statusKey, 'workOrder')
|
|
|
+ assert.equal(byId('pump-maintaining').statusText, '检修中')
|
|
|
+ assert.match(byId('pump-maintaining').iconUrl, /T_MarkPoint_Blue\.png/u)
|
|
|
+ assert.equal(byId('pump-fault').statusKey, 'alarm')
|
|
|
+ assert.equal(byId('pump-fault').statusText, '故障停运')
|
|
|
+
|
|
|
+ assert.equal(byId('user-arrears').statusKey, 'warning')
|
|
|
+ assert.equal(byId('user-arrears').statusText, '欠费')
|
|
|
+ assert.match(byId('user-arrears').iconUrl, /T_MarkPoint_Yellow\.png/u)
|
|
|
+ assert.equal(byId('user-stopped').statusKey, 'alarm')
|
|
|
+ assert.equal(byId('user-stopped').statusText, '停用')
|
|
|
+
|
|
|
+ assert.equal(byId('pipe-point'), undefined)
|
|
|
+})
|
|
|
+
|
|
|
test('home quick entries cover the four workbench jumps', () => {
|
|
|
assert.deepEqual(HOME_QUICK_ENTRIES.map(item => item.label), ['设备异常管理', '报警管理', '报警审核', '监测报警一张图'])
|
|
|
assert.ok(HOME_QUICK_ENTRIES.every(item => item.suffix.startsWith('/')))
|