nayota-show-sdk 1.3.76 → 1.3.78

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.
@@ -7,7 +7,7 @@
7
7
  * const { list, getOne, create, updateOne, deleteOne, deleteMany } = alarmProgress
8
8
  * list({ page: 1, limit: 50 })
9
9
  */
10
- import { requestShow } from '../utils'
10
+ import requestAlarm from '../utils/alarm-request'
11
11
 
12
12
 
13
13
  /**
@@ -56,7 +56,7 @@ import { requestShow } from '../utils'
56
56
  ]}
57
57
  */
58
58
  export function list(query) {
59
- return requestShow({
59
+ return requestAlarm({
60
60
  url: '/alarm-progress',
61
61
  method: 'get',
62
62
  params: query
@@ -88,7 +88,7 @@ export function list(query) {
88
88
  * }
89
89
  */
90
90
  export function create(data) {
91
- return requestShow({
91
+ return requestAlarm({
92
92
  url: '/alarm-progress',
93
93
  method: 'post',
94
94
  data
@@ -115,7 +115,7 @@ export function create(data) {
115
115
  }
116
116
  */
117
117
  export function getOne(id) {
118
- return requestShow({
118
+ return requestAlarm({
119
119
  url: `/alarm-progress/${id}`,
120
120
  method: 'get'
121
121
  })
@@ -148,7 +148,7 @@ export function getOne(id) {
148
148
  * }
149
149
  */
150
150
  export function updateOne(data) {
151
- return requestShow({
151
+ return requestAlarm({
152
152
  url: `/alarm-progress/${data._id}`,
153
153
  method: 'put',
154
154
  data
@@ -175,7 +175,7 @@ export function updateOne(data) {
175
175
  * }
176
176
  */
177
177
  export function deleteOne(id) {
178
- return requestShow({
178
+ return requestAlarm({
179
179
  url: `/alarm-progress/${id}`,
180
180
  method: 'delete'
181
181
  })
@@ -194,7 +194,7 @@ export function deleteOne(id) {
194
194
  * }
195
195
  */
196
196
  export function deleteMany(ids) {
197
- return requestShow({
197
+ return requestAlarm({
198
198
  url: '/alarm-progress',
199
199
  method: 'delete',
200
200
  data: ids // delete传递主体要包含在data里
@@ -1,4 +1,4 @@
1
- import { requestShow } from '../utils'
1
+ import requestAlarm from '../utils/alarm-request'
2
2
  /**
3
3
  * @file 报警记录api
4
4
  * @module 报警记录接口
@@ -320,7 +320,7 @@ import { requestShow } from '../utils'
320
320
  }
321
321
  */
322
322
  export function list(query) {
323
- return requestShow({
323
+ return requestAlarm({
324
324
  url: '/alarm-records',
325
325
  method: 'get',
326
326
  params: query
@@ -373,7 +373,7 @@ export function list(query) {
373
373
  }
374
374
  */
375
375
  export function create(data) {
376
- return requestShow({
376
+ return requestAlarm({
377
377
  url: '/alarm-records',
378
378
  method: 'post',
379
379
  data
@@ -409,7 +409,7 @@ export function create(data) {
409
409
  * }
410
410
  */
411
411
  export function getOne(id) {
412
- return requestShow({
412
+ return requestAlarm({
413
413
  url: `/alarm-records/${id}`,
414
414
  method: 'get'
415
415
  })
@@ -461,7 +461,7 @@ export function getOne(id) {
461
461
  }
462
462
  */
463
463
  export function updateOne(data) {
464
- return requestShow({
464
+ return requestAlarm({
465
465
  url: `/alarm-records/${data._id}`,
466
466
  method: 'put',
467
467
  data
@@ -498,7 +498,7 @@ export function updateOne(data) {
498
498
  * }
499
499
  */
500
500
  export function deleteOne(id) {
501
- return requestShow({
501
+ return requestAlarm({
502
502
  url: `/alarm-records/${id}`,
503
503
  method: 'delete'
504
504
  })
@@ -516,7 +516,7 @@ export function deleteOne(id) {
516
516
  * }
517
517
  */
518
518
  export function deleteMany(ids) {
519
- return requestShow({
519
+ return requestAlarm({
520
520
  url: '/alarm-records',
521
521
  method: 'delete',
522
522
  data: ids // delete传递主体要包含在data里
@@ -563,7 +563,7 @@ export function deleteMany(ids) {
563
563
  }
564
564
  */
565
565
  export function getAlarmCount(data) {
566
- return requestShow({
566
+ return requestAlarm({
567
567
  url: '/alarm-records/alarm-count',
568
568
  method: 'post',
569
569
  data
@@ -593,7 +593,7 @@ export function getAlarmCount(data) {
593
593
  }
594
594
  */
595
595
  export function getAlarmTotalCount() {
596
- return requestShow({
596
+ return requestAlarm({
597
597
  url: '/alarm-records/alarm-total-count',
598
598
  method: 'post'
599
599
  })
@@ -638,7 +638,7 @@ export function getAlarmTotalCount() {
638
638
  }
639
639
  */
640
640
  export function processingManyAlarm(data) {
641
- return requestShow({
641
+ return requestAlarm({
642
642
  url: '/alarm-records/processing-many-alarm',
643
643
  method: 'post',
644
644
  data
@@ -668,7 +668,7 @@ export function processingManyAlarm(data) {
668
668
  }
669
669
  */
670
670
  export function exportAlarmRecord(data) {
671
- return requestShow({
671
+ return requestAlarm({
672
672
  url: '/alarm-records/export-alarm-excel',
673
673
  method: 'post',
674
674
  data
@@ -724,7 +724,7 @@ export function exportAlarmRecord(data) {
724
724
  ]}
725
725
  */
726
726
  export function getMoreAlarmCount(data) {
727
- return requestShow({
727
+ return requestAlarm({
728
728
  url: '/alarm-records/more-alarm-count',
729
729
  method: 'post',
730
730
  data
@@ -742,7 +742,7 @@ export function getMoreAlarmCount(data) {
742
742
  * @returns {Object} data - 统计结果
743
743
  */
744
744
  export function alarmStatistics(query) {
745
- return requestShow({
745
+ return requestAlarm({
746
746
  url: '/alarm-records/alarm-statistics',
747
747
  method: 'get',
748
748
  params: query
@@ -759,7 +759,7 @@ export function alarmStatistics(query) {
759
759
  * @returns {Object} data - 统计结果
760
760
  */
761
761
  export function alarmAverageResponseDuration(query) {
762
- return requestShow({
762
+ return requestAlarm({
763
763
  url: '/alarm-records/alarm-average-response-duration',
764
764
  method: 'get',
765
765
  params: query
@@ -779,7 +779,7 @@ export function alarmAverageResponseDuration(query) {
779
779
  * @returns {Array<Object>} data - 告警类型统计结果
780
780
  */
781
781
  export function alarmTypeCount(query) {
782
- return requestShow({
782
+ return requestAlarm({
783
783
  url: '/alarm-records/alarm-type-count',
784
784
  method: 'get',
785
785
  params: query
@@ -796,7 +796,7 @@ export function alarmTypeCount(query) {
796
796
  * @returns {Object} data - 查询结果
797
797
  */
798
798
  export function topDepart(query) {
799
- return requestShow({
799
+ return requestAlarm({
800
800
  url: '/alarm-records/top-depart',
801
801
  method: 'get',
802
802
  params: query
@@ -815,7 +815,7 @@ export function topDepart(query) {
815
815
  * @returns {Array<Object>} data - 排行榜结果
816
816
  */
817
817
  export function alarmRankingCount(query) {
818
- return requestShow({
818
+ return requestAlarm({
819
819
  url: '/alarm-records/alarm-ranking-count',
820
820
  method: 'get',
821
821
  params: query
package/api/upload.js CHANGED
@@ -1,4 +1,5 @@
1
- import { requestShow, requestForm } from '../utils'
1
+ import urlcfg from '../config/urlcfg'
2
+ import { requestShow, requestForm, requestIot } from '../utils'
2
3
  /**
3
4
  * @file 文件管理api
4
5
  * @module 文件管理接口
@@ -25,6 +26,67 @@ import { requestShow, requestForm } from '../utils'
25
26
  * }
26
27
  */
27
28
 
29
+ function getUploadPayload(response) {
30
+ if (response && typeof response === 'object') {
31
+ if (response.code === 0 && response.data) {
32
+ return response.data
33
+ }
34
+
35
+ if (typeof response.status === 'number' && response.data) {
36
+ return response.data
37
+ }
38
+ }
39
+
40
+ return response
41
+ }
42
+
43
+ function getUrlOrigin(baseUrl) {
44
+ if (!baseUrl) {
45
+ return typeof window !== 'undefined' && window.location ? window.location.origin : ''
46
+ }
47
+
48
+ if (/^https?:\/\//i.test(baseUrl)) {
49
+ try {
50
+ return new URL(baseUrl).origin
51
+ } catch (error) {
52
+ return ''
53
+ }
54
+ }
55
+
56
+ return typeof window !== 'undefined' && window.location ? window.location.origin : ''
57
+ }
58
+
59
+ function toAbsoluteConfigFileUrl(fileUrl) {
60
+ if (!fileUrl || /^https?:\/\//i.test(fileUrl)) {
61
+ return fileUrl
62
+ }
63
+
64
+ const origin = getUrlOrigin(urlcfg.getIotUrl())
65
+ if (!origin) {
66
+ return fileUrl
67
+ }
68
+
69
+ return `${origin}${fileUrl.startsWith('/') ? '' : '/'}${fileUrl}`
70
+ }
71
+
72
+ function normalizeV2UploadResponse(response) {
73
+ const payload = getUploadPayload(response) || {}
74
+ const id = payload.id || payload._id || payload.filename
75
+ const path = toAbsoluteConfigFileUrl(payload.path || payload.url)
76
+
77
+ return {
78
+ code: 0,
79
+ success: true,
80
+ data: {
81
+ ...payload,
82
+ _id: id,
83
+ id,
84
+ name: payload.name || payload.originalname || payload.filename,
85
+ path
86
+ }
87
+ }
88
+ }
89
+
28
90
  /**
29
91
  * 获取文件列表
30
92
  * @param {Object} query - 请求对象
@@ -50,6 +112,21 @@ export function list(query) {
50
112
  * @returns {string} data - 新增成功的数据,见表结构upload定义
51
113
  */
52
114
  export function upload(data) {
115
+ if (urlcfg.isV2()) {
116
+ if (!urlcfg.getIotUrl()) {
117
+ throw new Error('[nayota-show-sdk][v2] iotServer is required for upload module.')
118
+ }
119
+
120
+ return requestIot({
121
+ url: '/files/upload',
122
+ method: 'post',
123
+ data,
124
+ headers: {
125
+ 'Content-Type': 'multipart/form-data'
126
+ }
127
+ }).then(normalizeV2UploadResponse)
128
+ }
129
+
53
130
  return requestForm({
54
131
  url: '/uploads',
55
132
  method: 'post',
@@ -117,4 +194,3 @@ export default {
117
194
  deleteMany,
118
195
  getOne
119
196
  }
120
-
@@ -0,0 +1,81 @@
1
+ jest.mock('../utils', () => ({
2
+ requestShow: jest.fn(),
3
+ requestForm: jest.fn(),
4
+ requestIot: jest.fn()
5
+ }))
6
+
7
+ const urlcfg = require('../config/urlcfg').default
8
+ const { requestForm, requestIot } = require('../utils')
9
+ const { upload } = require('./upload')
10
+
11
+ describe('upload api compatibility', () => {
12
+ const originalVersion = urlcfg.version
13
+ const originalIotServer = urlcfg.iotServer
14
+
15
+ afterEach(() => {
16
+ urlcfg.version = originalVersion
17
+ urlcfg.iotServer = originalIotServer
18
+ jest.clearAllMocks()
19
+ })
20
+
21
+ test('uses legacy show uploads endpoint in v1', async () => {
22
+ const formData = { file: 'file-content' }
23
+ requestForm.mockResolvedValue({ code: 0, data: { path: '/uploads/a.svg' } })
24
+
25
+ const response = await upload(formData)
26
+
27
+ expect(requestForm).toHaveBeenCalledWith({
28
+ url: '/uploads',
29
+ method: 'post',
30
+ data: formData
31
+ })
32
+ expect(requestIot).not.toHaveBeenCalled()
33
+ expect(response).toEqual({ code: 0, data: { path: '/uploads/a.svg' } })
34
+ })
35
+
36
+ test('uses config v2 files upload endpoint and returns legacy path shape', async () => {
37
+ const formData = { file: 'file-content' }
38
+ urlcfg.version = 'v2'
39
+ urlcfg.iotServer = 'http://config.local/api/v1'
40
+ requestIot.mockResolvedValue({
41
+ status: 201,
42
+ data: {
43
+ filename: 'floor.svg',
44
+ url: '/api/v1/files/floor.svg'
45
+ }
46
+ })
47
+
48
+ const response = await upload(formData)
49
+
50
+ expect(requestIot).toHaveBeenCalledWith({
51
+ url: '/files/upload',
52
+ method: 'post',
53
+ data: formData,
54
+ headers: {
55
+ 'Content-Type': 'multipart/form-data'
56
+ }
57
+ })
58
+ expect(requestForm).not.toHaveBeenCalled()
59
+ expect(response).toEqual({
60
+ code: 0,
61
+ success: true,
62
+ data: {
63
+ _id: 'floor.svg',
64
+ id: 'floor.svg',
65
+ filename: 'floor.svg',
66
+ name: 'floor.svg',
67
+ path: 'http://config.local/api/v1/files/floor.svg',
68
+ url: '/api/v1/files/floor.svg'
69
+ }
70
+ })
71
+ })
72
+
73
+ test('requires iotServer for v2 uploads', () => {
74
+ urlcfg.version = 'v2'
75
+ urlcfg.iotServer = ''
76
+
77
+ expect(() => upload({ file: 'file-content' })).toThrow(
78
+ '[nayota-show-sdk][v2] iotServer is required for upload module.'
79
+ )
80
+ })
81
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nayota-show-sdk",
3
- "version": "1.3.76",
3
+ "version": "1.3.78",
4
4
  "description": "nayota-show-server rest-api",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -0,0 +1,22 @@
1
+ import urlcfg from '../config/urlcfg'
2
+ import { requestIot, requestShow } from './index'
3
+
4
+ export function getAlarmRequestTarget() {
5
+ if (!urlcfg.isV2()) {
6
+ return 'show'
7
+ }
8
+
9
+ if (!urlcfg.getIotUrl()) {
10
+ throw new Error('[nayota-show-sdk][v2] iotServer is required for alarm module.')
11
+ }
12
+
13
+ return 'iot'
14
+ }
15
+
16
+ export function requestAlarm(config) {
17
+ return getAlarmRequestTarget() === 'iot'
18
+ ? requestIot(config)
19
+ : requestShow(config)
20
+ }
21
+
22
+ export default requestAlarm
@@ -0,0 +1,35 @@
1
+ const urlcfg = require('../config/urlcfg').default
2
+ const { getAlarmRequestTarget } = require('./alarm-request')
3
+
4
+ describe('alarm request target', () => {
5
+ const originalVersion = urlcfg.version
6
+ const originalIotServer = urlcfg.iotServer
7
+
8
+ afterEach(() => {
9
+ urlcfg.version = originalVersion
10
+ urlcfg.iotServer = originalIotServer
11
+ })
12
+
13
+ test('uses show target by default', () => {
14
+ urlcfg.version = 'v1'
15
+ urlcfg.iotServer = ''
16
+
17
+ expect(getAlarmRequestTarget()).toBe('show')
18
+ })
19
+
20
+ test('uses iot target in v2', () => {
21
+ urlcfg.version = 'v2'
22
+ urlcfg.iotServer = '/iot-api'
23
+
24
+ expect(getAlarmRequestTarget()).toBe('iot')
25
+ })
26
+
27
+ test('requires iotServer in v2', () => {
28
+ urlcfg.version = 'v2'
29
+ urlcfg.iotServer = ''
30
+
31
+ expect(() => getAlarmRequestTarget()).toThrow(
32
+ '[nayota-show-sdk][v2] iotServer is required for alarm module.'
33
+ )
34
+ })
35
+ })
@@ -41,6 +41,37 @@ function normalizeAreaFloorPlan(data = {}) {
41
41
  return undefined
42
42
  }
43
43
 
44
+ function normalizeAreaCenterPoint(data = {}) {
45
+ if (data.centerPoint) {
46
+ return data.centerPoint
47
+ }
48
+
49
+ if (Array.isArray(data.centerCoordinate) && data.centerCoordinate.length >= 2) {
50
+ return removeUndefinedFields({
51
+ x: data.centerCoordinate[0],
52
+ y: data.centerCoordinate[1]
53
+ })
54
+ }
55
+
56
+ return undefined
57
+ }
58
+
59
+ function normalizeAreaCenterCoordinate(item = {}) {
60
+ if (Array.isArray(item.centerCoordinate)) {
61
+ return item.centerCoordinate
62
+ }
63
+
64
+ if (item.centerPoint && typeof item.centerPoint === 'object') {
65
+ const x = item.centerPoint.x != null ? item.centerPoint.x : item.centerPoint.longitude
66
+ const y = item.centerPoint.y != null ? item.centerPoint.y : item.centerPoint.latitude
67
+ if (x != null && y != null) {
68
+ return [x, y]
69
+ }
70
+ }
71
+
72
+ return undefined
73
+ }
74
+
44
75
  function mapAreaToIotQuery(query = {}) {
45
76
  const next = removeUndefinedFields({
46
77
  ...omitKeys(query, ['_id', 'depart', 'visible', 'areaClass', 'sort']),
@@ -74,7 +105,8 @@ function mapAreaToIotBody(data = {}) {
74
105
  'areaClass',
75
106
  'targetDepartId',
76
107
  'type',
77
- 'relationInfo'
108
+ 'relationInfo',
109
+ 'centerCoordinate'
78
110
  ]),
79
111
  code: data.code || fallbackCode(data.name || data._id, 'SPACE'),
80
112
  spaceType: data.spaceType || 'zone',
@@ -83,6 +115,7 @@ function mapAreaToIotBody(data = {}) {
83
115
  area: data.area != null ? data.area : data.areaSize,
84
116
  areaClassId: data.areaClassId || resolveLegacyReference(data.areaClass),
85
117
  targetHierarchyId: data.targetHierarchyId || resolveLegacyReference(data.targetDepartId),
118
+ centerPoint: normalizeAreaCenterPoint(data),
86
119
  floorPlan: normalizeAreaFloorPlan(data),
87
120
  statisticsJson: parseLegacyJson(data.statisticsJson),
88
121
  metadata: Object.keys(metadata).length ? metadata : undefined
@@ -105,6 +138,7 @@ function mapIotAreaToLegacy(item = {}) {
105
138
  areaClass: entity.areaClassId,
106
139
  targetDepartId: entity.targetHierarchyId,
107
140
  type: metadata.legacyType || entity.type,
141
+ centerCoordinate: normalizeAreaCenterCoordinate(entity),
108
142
  imageUrl: entity.imageUrl || getNestedValue(entity, 'floorPlan.url'),
109
143
  statisticsJson: stringifyLegacyJson(entity.statisticsJson),
110
144
  relationInfo
@@ -368,60 +402,6 @@ function normalizeLegacyPropLine(source = {}, prop = {}, row = {}) {
368
402
  return null
369
403
  }
370
404
 
371
- const LEGACY_SWITCH_STATUS_KEYWORDS = [
372
- '开关',
373
- '电源',
374
- '启停',
375
- '启动',
376
- '运行',
377
- 'switch',
378
- 'power'
379
- ]
380
-
381
- const LEGACY_SWITCH_STATUS_EXCLUDE_KEYWORDS = [
382
- '模式',
383
- '温度',
384
- '风速',
385
- '设定',
386
- '设置',
387
- '锁屏',
388
- '锁定',
389
- 'lock',
390
- 'mode',
391
- 'temp',
392
- 'speed',
393
- 'set'
394
- ]
395
-
396
- function isLegacyBinaryInterval(interval) {
397
- try {
398
- const payload = typeof interval === 'string' ? JSON.parse(interval) : interval
399
- return Array.isArray(payload) && Array.isArray(payload[0]) && payload[0].length === 2
400
- } catch {
401
- return false
402
- }
403
- }
404
-
405
- function isLegacySwitchOperateStatus(source = {}, interval = '') {
406
- if (source.propType !== 'Operate' || !isLegacyBinaryInterval(interval)) {
407
- return false
408
- }
409
-
410
- const normalized = [
411
- source.propertyKey,
412
- source.propName,
413
- source.name,
414
- source.code,
415
- source.shortAddress
416
- ].filter(Boolean).join(' ').toLowerCase()
417
-
418
- if (LEGACY_SWITCH_STATUS_EXCLUDE_KEYWORDS.some(keyword => normalized.includes(keyword))) {
419
- return false
420
- }
421
-
422
- return LEGACY_SWITCH_STATUS_KEYWORDS.some(keyword => normalized.includes(keyword))
423
- }
424
-
425
405
  function normalizeLegacyNumber(value) {
426
406
  if (value === undefined || value === null || value === '') {
427
407
  return null
@@ -530,7 +510,7 @@ function normalizeLegacyEasyListProp(source = {}, row = {}) {
530
510
  const interval = prop.interval || source.interval || source.valueMap || ''
531
511
  const line = normalizeLegacyPropLine(source, prop, row)
532
512
  const isMain = Boolean(source.isMain)
533
- const isStatus = Boolean(source.isStatus || isLegacySwitchOperateStatus(source, interval))
513
+ const isStatus = Boolean(source.isStatus)
534
514
  const isNumber = Boolean(source.isNumber)
535
515
  const isImport = Boolean(source.isImport || isMain || isStatus || isNumber)
536
516
 
@@ -556,7 +536,7 @@ function normalizeLegacyEasyListProp(source = {}, row = {}) {
556
536
  })
557
537
 
558
538
  return removeUndefinedFields({
559
- ...source,
539
+ ...omitKeys(source, ['isShow', 'isCensus']),
560
540
  _id: source._id || source.id,
561
541
  propId,
562
542
  devicePropertyId: source.devicePropertyId || propId,
@@ -127,6 +127,43 @@ describe('iotModuleSpecs departs hierarchy compatibility', () => {
127
127
  })
128
128
  })
129
129
 
130
+ describe('iotModuleSpecs area space compatibility', () => {
131
+ const area = iotModuleSpecs.area.operations
132
+
133
+ test('maps legacy centerCoordinate to space centerPoint when creating areas', () => {
134
+ const request = area.create.toRequest({
135
+ name: '前厅区域',
136
+ depart: 'hierarchy-1',
137
+ bounds: [[0, 0], [10, 0], [10, 10], [0, 10]],
138
+ centerCoordinate: [5, 5]
139
+ })
140
+
141
+ expect(request.url).toBe('/spaces')
142
+ expect(request.method).toBe('post')
143
+ expect(request.data.centerCoordinate).toBeUndefined()
144
+ expect(request.data.centerPoint).toEqual({ x: 5, y: 5 })
145
+ })
146
+
147
+ test('maps space centerPoint back to legacy centerCoordinate', () => {
148
+ const response = area.list.fromResponse({
149
+ code: 0,
150
+ data: {
151
+ total: 1,
152
+ items: [
153
+ {
154
+ id: 'space-1',
155
+ name: '前厅区域',
156
+ hierarchyId: 'hierarchy-1',
157
+ centerPoint: { x: 12, y: 34 }
158
+ }
159
+ ]
160
+ }
161
+ })
162
+
163
+ expect(response.data.rows[0].centerCoordinate).toEqual([12, 34])
164
+ })
165
+ })
166
+
130
167
  describe('iotModuleSpecs devices write compatibility', () => {
131
168
  const devices = iotModuleSpecs.devices.operations
132
169
 
@@ -238,11 +275,11 @@ describe('iotModuleSpecs devices easyList legacy compatibility', () => {
238
275
 
239
276
  expect(row._id).toBe('twin-1')
240
277
  expect(row.status).toEqual({
241
- value: 1,
242
- label: '',
243
- valueStr: '',
244
- total: 3,
245
- open: 1
278
+ value: 0,
279
+ label: '解锁',
280
+ valueStr: '解锁',
281
+ total: 2,
282
+ open: 0
246
283
  })
247
284
  expect(modeProp).toEqual(
248
285
  expect.objectContaining({
@@ -270,12 +307,14 @@ describe('iotModuleSpecs devices easyList legacy compatibility', () => {
270
307
  expect(switchProp).toEqual(
271
308
  expect.objectContaining({
272
309
  propType: 'Operate',
273
- isStatus: true,
274
- isImport: true,
310
+ isStatus: false,
311
+ isImport: false,
275
312
  value: 1,
276
313
  valueStr: '开'
277
314
  })
278
315
  )
316
+ expect(switchProp.isShow).toBeUndefined()
317
+ expect(switchProp.isCensus).toBeUndefined()
279
318
  expect(electricProp).toEqual(
280
319
  expect.objectContaining({
281
320
  isMain: true,