gisviewer-vue3-arcgis 1.0.247 → 1.0.249

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.
@@ -1,24 +1,28 @@
1
1
  import * as h from "@arcgis/core/core/reactiveUtils.js";
2
- import d from "@arcgis/core/Graphic";
3
- import o from "@arcgis/core/layers/GraphicsLayer";
4
- import { toRaw as u } from "vue";
5
- import v from "../stores/index.mjs";
6
- class x {
2
+ import u from "@arcgis/core/Graphic";
3
+ import l from "@arcgis/core/layers/GraphicsLayer";
4
+ import { toRaw as v } from "vue";
5
+ import b from "../stores/index.mjs";
6
+ class I {
7
7
  constructor(e) {
8
- this.watchHandle = null, this.view = e;
9
- const t = v.useAppDataStore;
10
- this.mapInitializer = u(t.mapInitializer), this.cameraNormalLayer = new o({
11
- id: "cameraNormalLayer"
12
- }), this.kkNormalLayer = new o({
13
- id: "kkNormalLayer"
14
- }), this.cameraAbnormalLayer = new o({
15
- id: "cameraAbnormalLayer"
16
- }), this.kkAbnormalLayer = new o({
17
- id: "kkAbnormalLayer"
8
+ this.watchHandle = null, this.currentZdCode = "", this.currentDdCode = "", this.view = e;
9
+ const t = b.useAppDataStore;
10
+ this.mapInitializer = v(t.mapInitializer), this.cameraNormalLayer = new l({
11
+ id: "cameraNormalLayer",
12
+ visible: !1
13
+ }), this.cameraAbnormalLayer = new l({
14
+ id: "cameraAbnormalLayer",
15
+ visible: !1
16
+ }), this.kkNormalLayer = new l({
17
+ id: "kkNormalLayer",
18
+ visible: !1
19
+ }), this.kkAbnormalLayer = new l({
20
+ id: "kkAbnormalLayer",
21
+ visible: !1
18
22
  }), this.view.map.addMany([
19
23
  this.cameraNormalLayer,
20
- this.kkNormalLayer,
21
24
  this.cameraAbnormalLayer,
25
+ this.kkNormalLayer,
22
26
  this.kkAbnormalLayer
23
27
  ]);
24
28
  }
@@ -34,7 +38,7 @@ class x {
34
38
  });
35
39
  case "cluster": {
36
40
  const { deviceLayer: i } = this.getLayerConfig(e);
37
- i.visible = e.visible, e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = h.when(
41
+ i.visible = e.visible, this.currentDdCode = e.ddCode || "", this.currentZdCode = e.zdCode || "", e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = h.when(
38
42
  () => this.view.stationary,
39
43
  async () => {
40
44
  this.cameraNormalLayer.visible && await this.showClusterInExtent(
@@ -42,6 +46,8 @@ class x {
42
46
  deviceType: "camera",
43
47
  deviceState: "normal",
44
48
  mode: "cluster",
49
+ ddCode: this.currentDdCode,
50
+ zdCode: this.currentZdCode,
45
51
  visible: !0
46
52
  },
47
53
  this.view.extent
@@ -50,6 +56,8 @@ class x {
50
56
  deviceType: "camera",
51
57
  deviceState: "abnormal",
52
58
  mode: "cluster",
59
+ ddCode: this.currentDdCode,
60
+ zdCode: this.currentZdCode,
53
61
  visible: !0
54
62
  },
55
63
  this.view.extent
@@ -58,6 +66,8 @@ class x {
58
66
  deviceType: "kk",
59
67
  deviceState: "normal",
60
68
  mode: "cluster",
69
+ ddCode: this.currentDdCode,
70
+ zdCode: this.currentZdCode,
61
71
  visible: !0
62
72
  },
63
73
  this.view.extent
@@ -66,6 +76,8 @@ class x {
66
76
  deviceType: "kk",
67
77
  deviceState: "abnormal",
68
78
  mode: "cluster",
79
+ ddCode: this.currentDdCode,
80
+ zdCode: this.currentZdCode,
69
81
  visible: !0
70
82
  },
71
83
  this.view.extent
@@ -81,15 +93,14 @@ class x {
81
93
  };
82
94
  }
83
95
  getLayerConfig(e) {
84
- let t, i, r;
85
- return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196], r = this.cameraNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_sxj_yc.png", i = [189, 49, 50], r = this.cameraAbnormalLayer) : e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_kk_map.png", i = [45, 108, 196], r = this.kkNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_kk_yc.png", i = [189, 49, 50], r = this.kkAbnormalLayer), {
96
+ let t, i, a;
97
+ return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196], a = this.cameraNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_sxj_yc.png", i = [189, 49, 50], a = this.cameraAbnormalLayer) : e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_kk_map.png", i = [45, 108, 196], a = this.kkNormalLayer) : (t = "/GisViewerAssets/Images/gis/gis_kk_yc.png", i = [189, 49, 50], a = this.kkAbnormalLayer), {
86
98
  icon: t,
87
99
  color: i,
88
- deviceLayer: r
100
+ deviceLayer: a
89
101
  };
90
102
  }
91
103
  async showClusterInExtent(e, t) {
92
- console.time("request");
93
104
  const i = await fetch("/es/queryGeoAggregation", {
94
105
  method: "POST",
95
106
  headers: {
@@ -102,7 +113,8 @@ class x {
102
113
  bottomRightLat: t.ymin,
103
114
  bottomRightLon: t.xmax,
104
115
  devStateSet: [e.deviceState === "normal" ? "1" : "2"],
105
- // meter: Math.round(this.view.scale / 6)
116
+ zdCode: e.zdCode || "",
117
+ ddCode: e.ddCode || "",
106
118
  mapLevel: this.view.zoom + 9
107
119
  })
108
120
  });
@@ -110,128 +122,156 @@ class x {
110
122
  console.error(i.statusText);
111
123
  return;
112
124
  }
113
- const r = await i.json();
114
- if (r.code !== 200)
125
+ const a = await i.json();
126
+ if (a.code !== 200)
115
127
  return;
116
- console.timeEnd("request"), console.time("render");
117
- const { icon: l, color: n, deviceLayer: c } = this.getLayerConfig(e);
118
- c.removeAll();
119
- const m = r.data.map((a, y) => {
120
- const s = (a.count.toString().length * 6 + 6) / 2;
121
- return new d({
128
+ const { icon: n, color: c, deviceLayer: d } = this.getLayerConfig(e);
129
+ d.removeAll();
130
+ const m = a.data.map((r) => {
131
+ var y;
132
+ const o = (r.count.toString().length * 6 + 6) / 2, s = new u({
122
133
  geometry: {
123
134
  type: "point",
124
- x: a.lon,
125
- y: a.lat
135
+ x: r.lon,
136
+ y: r.lat
126
137
  },
127
138
  attributes: {
128
- gid: y,
129
- count: a.count
130
- },
131
- symbol: a.count > 1 ? {
132
- type: "cim",
133
- data: {
134
- type: "CIMSymbolReference",
135
- symbol: {
136
- type: "CIMPointSymbol",
137
- symbolLayers: [
138
- // 聚合数量
139
- {
140
- type: "CIMVectorMarker",
141
- size: 32,
142
- colorLocked: !0,
143
- anchorPointUnits: "Relative",
144
- frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
145
- markerGraphics: [
146
- // 数量文本框
147
- {
148
- type: "CIMMarkerGraphic",
149
- geometry: {
150
- rings: [
151
- [
152
- [-s, 30],
153
- [s, 30],
154
- [s, 15],
155
- [-s, 15],
156
- [-s, 30]
157
- ]
139
+ id: ((y = r.devInfo) == null ? void 0 : y.deviceId) || r.key,
140
+ type: e.deviceType,
141
+ count: r.count,
142
+ typeName: e.deviceType === "camera" ? "视频" : "卡口",
143
+ stateName: e.deviceState === "normal" ? "正常" : "异常",
144
+ ...r.devInfo
145
+ }
146
+ });
147
+ return r.count > 1 ? s.symbol = {
148
+ type: "cim",
149
+ data: {
150
+ type: "CIMSymbolReference",
151
+ symbol: {
152
+ type: "CIMPointSymbol",
153
+ symbolLayers: [
154
+ // 聚合数量
155
+ {
156
+ type: "CIMVectorMarker",
157
+ size: 32,
158
+ colorLocked: !0,
159
+ anchorPointUnits: "Relative",
160
+ frame: { xmin: -16, ymin: -16, xmax: 16, ymax: 16 },
161
+ markerGraphics: [
162
+ // 数量文本框
163
+ {
164
+ type: "CIMMarkerGraphic",
165
+ geometry: {
166
+ rings: [
167
+ [
168
+ [-o, 30],
169
+ [o, 30],
170
+ [o, 15],
171
+ [-o, 15],
172
+ [-o, 30]
158
173
  ]
159
- },
174
+ ]
175
+ },
176
+ symbol: {
177
+ type: "CIMPolygonSymbol",
178
+ symbolLayers: [
179
+ {
180
+ type: "CIMSolidFill",
181
+ enable: !0,
182
+ color: c.concat([255])
183
+ },
184
+ {
185
+ type: "CIMSolidStroke",
186
+ enable: !0,
187
+ width: 3,
188
+ color: c.concat([128])
189
+ }
190
+ ]
191
+ }
192
+ },
193
+ // 数量文字
194
+ {
195
+ type: "CIMMarkerGraphic",
196
+ primitiveName: "textGraphic",
197
+ geometry: { x: 0, y: 0 },
198
+ symbol: {
199
+ type: "CIMTextSymbol",
200
+ fontFamilyName: "msyh",
201
+ height: 12,
202
+ horizontalAlignment: "Center",
203
+ offsetX: 0,
204
+ offsetY: 22,
160
205
  symbol: {
161
206
  type: "CIMPolygonSymbol",
162
207
  symbolLayers: [
163
208
  {
164
209
  type: "CIMSolidFill",
165
210
  enable: !0,
166
- color: n.concat([255])
167
- },
168
- {
169
- type: "CIMSolidStroke",
170
- enable: !0,
171
- width: 3,
172
- color: n.concat([128])
211
+ color: [255, 255, 255, 255]
173
212
  }
174
213
  ]
175
- }
176
- },
177
- // 数量文字
178
- {
179
- type: "CIMMarkerGraphic",
180
- primitiveName: "textGraphic",
181
- geometry: { x: 0, y: 0 },
182
- symbol: {
183
- type: "CIMTextSymbol",
184
- fontFamilyName: "msyh",
185
- height: 12,
186
- horizontalAlignment: "Center",
187
- offsetX: 0,
188
- offsetY: 22,
189
- symbol: {
190
- type: "CIMPolygonSymbol",
191
- symbolLayers: [
192
- {
193
- type: "CIMSolidFill",
194
- enable: !0,
195
- color: [255, 255, 255, 255]
196
- }
197
- ]
198
- },
199
- verticalAlignment: "Center"
200
214
  },
201
- textString: a.count.toString()
202
- }
203
- ],
204
- scaleSymbolsProportionally: !0,
205
- respectFrame: !0
215
+ verticalAlignment: "Center"
216
+ },
217
+ textString: r.count.toString()
218
+ }
219
+ ],
220
+ scaleSymbolsProportionally: !0,
221
+ respectFrame: !0
222
+ },
223
+ // 聚合图标
224
+ {
225
+ type: "CIMPictureMarker",
226
+ enable: !0,
227
+ anchorPoint: {
228
+ x: 0,
229
+ y: 0
206
230
  },
207
- // 聚合图标
208
- {
209
- type: "CIMPictureMarker",
210
- enable: !0,
211
- anchorPoint: {
212
- x: 0,
213
- y: 0
214
- },
215
- anchorPointUnits: "Relative",
216
- size: 24,
217
- rotateClockwise: !0,
218
- textureFilter: "Picture",
219
- url: l
220
- }
221
- ]
222
- }
231
+ anchorPointUnits: "Relative",
232
+ size: 24,
233
+ rotateClockwise: !0,
234
+ textureFilter: "Picture",
235
+ url: n
236
+ }
237
+ ]
223
238
  }
224
- } : {
225
- type: "picture-marker",
226
- url: l,
227
- width: 24,
228
- height: 24
229
239
  }
230
- });
240
+ } : (s.symbol = {
241
+ type: "picture-marker",
242
+ url: n,
243
+ width: 18,
244
+ height: 18
245
+ }, s.popupTemplate = {
246
+ title: "视频信息",
247
+ content: [
248
+ {
249
+ type: "fields",
250
+ fieldInfos: [
251
+ {
252
+ fieldName: "deviceId",
253
+ label: "设备编号"
254
+ },
255
+ {
256
+ fieldName: "deviceName",
257
+ label: "设备名称"
258
+ },
259
+ {
260
+ fieldName: "typeName",
261
+ label: "设备类型"
262
+ },
263
+ {
264
+ fieldName: "stateName",
265
+ label: "设备状态"
266
+ }
267
+ ]
268
+ }
269
+ ]
270
+ }), s;
231
271
  });
232
- c.addMany(m), console.timeEnd("render");
272
+ d.addMany(m);
233
273
  }
234
274
  }
235
275
  export {
236
- x as default
276
+ I as default
237
277
  };
@@ -42,7 +42,11 @@ class w {
42
42
  }), a = new c({
43
43
  geometry: o,
44
44
  symbol: this.getLineSymbol(!0),
45
- attributes: { bandId: e.bandId }
45
+ attributes: {
46
+ bandId: e.bandId,
47
+ type: "greenWaveBand",
48
+ id: e.bandId
49
+ }
46
50
  });
47
51
  this.roadsectLayer.add(a), await this.view.goTo(a), e.nodeList.forEach((s) => {
48
52
  const i = new c({
@@ -23,6 +23,7 @@ export default class MapInitializer {
23
23
  * @returns
24
24
  */
25
25
  setMapCenter(params: ISetMapCenterParams): Promise<IResult>;
26
+ setMapZoom(zoom: number): IResult;
26
27
  /**
27
28
  * 在一定的高度,以一定的角度去观察某个坐标
28
29
  * */