nayota-show-sdk 1.3.85 → 1.3.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -193,7 +193,9 @@ function mapIotAreaToLegacy(item = {}) {
|
|
|
193
193
|
...entity,
|
|
194
194
|
depart: entity.hierarchyId,
|
|
195
195
|
visible: entity.isVisible,
|
|
196
|
-
|
|
196
|
+
area: normalizeLegacyNumber(entity.area),
|
|
197
|
+
areaSize: normalizeLegacyNumber(entity.area),
|
|
198
|
+
opacity: normalizeLegacyNumber(entity.opacity),
|
|
197
199
|
areaClass: entity.areaClassId,
|
|
198
200
|
targetDepartId: entity.targetHierarchyId,
|
|
199
201
|
type: metadata.legacyType || entity.type,
|
|
@@ -237,6 +237,27 @@ describe('iotModuleSpecs area space compatibility', () => {
|
|
|
237
237
|
expect(response.data.rows[0].centerCoordinate).toEqual([12, 34])
|
|
238
238
|
})
|
|
239
239
|
|
|
240
|
+
test('normalizes pg decimal strings to legacy numeric area fields', () => {
|
|
241
|
+
const response = area.list.fromResponse({
|
|
242
|
+
code: 0,
|
|
243
|
+
data: {
|
|
244
|
+
total: 1,
|
|
245
|
+
items: [
|
|
246
|
+
{
|
|
247
|
+
id: 'space-1',
|
|
248
|
+
name: '前厅区域',
|
|
249
|
+
area: '123.45',
|
|
250
|
+
opacity: '0.80'
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
expect(response.data.rows[0].area).toBe(123.45)
|
|
257
|
+
expect(response.data.rows[0].areaSize).toBe(123.45)
|
|
258
|
+
expect(response.data.rows[0].opacity).toBe(0.8)
|
|
259
|
+
})
|
|
260
|
+
|
|
240
261
|
test('does not clear areaClassId on partial statistics sync updates', () => {
|
|
241
262
|
const request = area.updateOne.toRequest({
|
|
242
263
|
_id: '4f168184-9ef0-4068-b494-2ee861db0c08',
|