gisviewer-vue3-arcgis 1.0.274 → 1.0.275
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,10 +7,16 @@ export default class EdpassDeviceController {
|
|
|
7
7
|
private kkAbnormalLayer;
|
|
8
8
|
private mapInitializer;
|
|
9
9
|
private watchHandle;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private currentShowParams;
|
|
11
|
+
private isCameraVisible;
|
|
12
|
+
private isKkVisible;
|
|
12
13
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
13
14
|
setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
|
|
15
|
+
/**
|
|
16
|
+
* 控制散点图层显示隐藏
|
|
17
|
+
* @param visible
|
|
18
|
+
*/
|
|
19
|
+
private showScatter;
|
|
14
20
|
private getLayerConfig;
|
|
15
21
|
private showClusterInExtent;
|
|
16
22
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { toRaw as
|
|
5
|
-
import
|
|
6
|
-
class
|
|
1
|
+
import * as v from "@arcgis/core/core/reactiveUtils.js";
|
|
2
|
+
import u from "@arcgis/core/Graphic";
|
|
3
|
+
import m from "@arcgis/core/layers/GraphicsLayer";
|
|
4
|
+
import { toRaw as p } from "vue";
|
|
5
|
+
import k from "../stores/index.mjs";
|
|
6
|
+
class S {
|
|
7
7
|
constructor(e) {
|
|
8
|
-
this.watchHandle = null, this.
|
|
9
|
-
const t =
|
|
10
|
-
this.mapInitializer =
|
|
8
|
+
this.watchHandle = null, this.currentShowParams = null, this.isCameraVisible = !1, this.isKkVisible = !1, this.view = e;
|
|
9
|
+
const t = k.useAppDataStore;
|
|
10
|
+
this.mapInitializer = p(t.mapInitializer), this.cameraNormalLayer = new m({
|
|
11
11
|
id: "cameraNormalLayer",
|
|
12
12
|
visible: !1
|
|
13
|
-
}), this.cameraAbnormalLayer = new
|
|
13
|
+
}), this.cameraAbnormalLayer = new m({
|
|
14
14
|
id: "cameraAbnormalLayer",
|
|
15
15
|
visible: !1
|
|
16
|
-
}), this.kkNormalLayer = new
|
|
16
|
+
}), this.kkNormalLayer = new m({
|
|
17
17
|
id: "kkNormalLayer",
|
|
18
18
|
visible: !1
|
|
19
|
-
}), this.kkAbnormalLayer = new
|
|
19
|
+
}), this.kkAbnormalLayer = new m({
|
|
20
20
|
id: "kkAbnormalLayer",
|
|
21
21
|
visible: !1
|
|
22
22
|
}), this.view.map.addMany([
|
|
@@ -28,34 +28,26 @@ class I {
|
|
|
28
28
|
}
|
|
29
29
|
async setEdpassLayerVisibility(e) {
|
|
30
30
|
var t;
|
|
31
|
-
if (
|
|
31
|
+
if (this.currentShowParams = e, e.deviceType !== "camera" && e.deviceType !== "kk")
|
|
32
32
|
return { status: -1, message: "不支持的设备类型" };
|
|
33
|
-
switch (e.style) {
|
|
34
|
-
case "scatter":
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
visible: e.visible
|
|
39
|
-
});
|
|
40
|
-
this.mapInitializer.setLayerVisibility({
|
|
41
|
-
id: `${e.deviceType}-normal`,
|
|
42
|
-
visible: e.visible
|
|
43
|
-
}), this.mapInitializer.setLayerVisibility({
|
|
44
|
-
id: `${e.deviceType}-abnormal`,
|
|
45
|
-
visible: e.visible
|
|
46
|
-
});
|
|
33
|
+
switch (e.deviceType === "camera" && (this.isCameraVisible = e.visible), e.deviceType === "kk" && (this.isKkVisible = e.visible), e.style) {
|
|
34
|
+
case "scatter": {
|
|
35
|
+
this.showScatter();
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
47
38
|
case "cluster": {
|
|
48
39
|
const { deviceLayer: i } = this.getLayerConfig(e);
|
|
49
|
-
i.visible = e.visible,
|
|
40
|
+
i.visible = e.visible, e.visible ? (await this.showClusterInExtent(e, this.view.extent), this.watchHandle || (this.watchHandle = v.when(
|
|
50
41
|
() => this.view.stationary,
|
|
51
42
|
async () => {
|
|
43
|
+
var r, s, o, l, c, a, y, h;
|
|
52
44
|
this.cameraNormalLayer.visible && await this.showClusterInExtent(
|
|
53
45
|
{
|
|
54
46
|
deviceType: "camera",
|
|
55
47
|
deviceState: "normal",
|
|
56
48
|
style: "cluster",
|
|
57
|
-
ddCode: this.
|
|
58
|
-
zdCode: this.
|
|
49
|
+
ddCode: ((r = this.currentShowParams) == null ? void 0 : r.ddCode) || "",
|
|
50
|
+
zdCode: ((s = this.currentShowParams) == null ? void 0 : s.zdCode) || "",
|
|
59
51
|
visible: !0
|
|
60
52
|
},
|
|
61
53
|
this.view.extent
|
|
@@ -64,8 +56,8 @@ class I {
|
|
|
64
56
|
deviceType: "camera",
|
|
65
57
|
deviceState: "abnormal",
|
|
66
58
|
style: "cluster",
|
|
67
|
-
ddCode: this.
|
|
68
|
-
zdCode: this.
|
|
59
|
+
ddCode: ((o = this.currentShowParams) == null ? void 0 : o.ddCode) || "",
|
|
60
|
+
zdCode: ((l = this.currentShowParams) == null ? void 0 : l.zdCode) || "",
|
|
69
61
|
visible: !0
|
|
70
62
|
},
|
|
71
63
|
this.view.extent
|
|
@@ -74,8 +66,8 @@ class I {
|
|
|
74
66
|
deviceType: "kk",
|
|
75
67
|
deviceState: "normal",
|
|
76
68
|
style: "cluster",
|
|
77
|
-
ddCode: this.
|
|
78
|
-
zdCode: this.
|
|
69
|
+
ddCode: ((c = this.currentShowParams) == null ? void 0 : c.ddCode) || "",
|
|
70
|
+
zdCode: ((a = this.currentShowParams) == null ? void 0 : a.zdCode) || "",
|
|
79
71
|
visible: !0
|
|
80
72
|
},
|
|
81
73
|
this.view.extent
|
|
@@ -84,8 +76,8 @@ class I {
|
|
|
84
76
|
deviceType: "kk",
|
|
85
77
|
deviceState: "abnormal",
|
|
86
78
|
style: "cluster",
|
|
87
|
-
ddCode: this.
|
|
88
|
-
zdCode: this.
|
|
79
|
+
ddCode: ((y = this.currentShowParams) == null ? void 0 : y.ddCode) || "",
|
|
80
|
+
zdCode: ((h = this.currentShowParams) == null ? void 0 : h.zdCode) || "",
|
|
89
81
|
visible: !0
|
|
90
82
|
},
|
|
91
83
|
this.view.extent
|
|
@@ -100,12 +92,32 @@ class I {
|
|
|
100
92
|
message: "Success"
|
|
101
93
|
};
|
|
102
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* 控制散点图层显示隐藏
|
|
97
|
+
* @param visible
|
|
98
|
+
*/
|
|
99
|
+
showScatter(e) {
|
|
100
|
+
const t = e ?? this.isCameraVisible, i = e ?? this.isKkVisible;
|
|
101
|
+
this.mapInitializer.setLayerVisibility({
|
|
102
|
+
id: "camera-normal",
|
|
103
|
+
visible: t
|
|
104
|
+
}), this.mapInitializer.setLayerVisibility({
|
|
105
|
+
id: "camera-abnormal",
|
|
106
|
+
visible: t
|
|
107
|
+
}), this.mapInitializer.setLayerVisibility({
|
|
108
|
+
id: "kk-normal",
|
|
109
|
+
visible: i
|
|
110
|
+
}), this.mapInitializer.setLayerVisibility({
|
|
111
|
+
id: "kk-abnormal",
|
|
112
|
+
visible: i
|
|
113
|
+
});
|
|
114
|
+
}
|
|
103
115
|
getLayerConfig(e) {
|
|
104
|
-
let t, i,
|
|
105
|
-
return e.deviceType === "camera" ? e.deviceState === "normal" ? (t = "/GisViewerAssets/Images/gis/gis_sxj_map.png", i = [45, 108, 196],
|
|
116
|
+
let t, i, r;
|
|
117
|
+
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), {
|
|
106
118
|
icon: t,
|
|
107
119
|
color: i,
|
|
108
|
-
deviceLayer:
|
|
120
|
+
deviceLayer: r
|
|
109
121
|
};
|
|
110
122
|
}
|
|
111
123
|
async showClusterInExtent(e, t) {
|
|
@@ -130,29 +142,29 @@ class I {
|
|
|
130
142
|
console.error(i.statusText);
|
|
131
143
|
return;
|
|
132
144
|
}
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
145
|
+
const r = await i.json();
|
|
146
|
+
if (r.code !== 200)
|
|
135
147
|
return;
|
|
136
|
-
const { icon:
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
var
|
|
140
|
-
const
|
|
148
|
+
const { icon: s, color: o, deviceLayer: l } = this.getLayerConfig(e);
|
|
149
|
+
l.removeAll();
|
|
150
|
+
const c = r.data.map((a) => {
|
|
151
|
+
var b;
|
|
152
|
+
const n = (a.count.toString().length * 6 + 6) / 2, d = new u({
|
|
141
153
|
geometry: {
|
|
142
154
|
type: "point",
|
|
143
|
-
x:
|
|
144
|
-
y:
|
|
155
|
+
x: a.lon,
|
|
156
|
+
y: a.lat
|
|
145
157
|
},
|
|
146
158
|
attributes: {
|
|
147
|
-
id: ((
|
|
159
|
+
id: ((b = a.devInfo) == null ? void 0 : b.deviceId) || a.key,
|
|
148
160
|
type: e.deviceType,
|
|
149
|
-
count:
|
|
161
|
+
count: a.count,
|
|
150
162
|
typeName: e.deviceType === "camera" ? "视频" : "卡口",
|
|
151
163
|
stateName: e.deviceState === "normal" ? "正常" : "异常",
|
|
152
|
-
...
|
|
164
|
+
...a.devInfo
|
|
153
165
|
}
|
|
154
166
|
});
|
|
155
|
-
return
|
|
167
|
+
return a.count > 1 ? d.symbol = {
|
|
156
168
|
type: "cim",
|
|
157
169
|
data: {
|
|
158
170
|
type: "CIMSymbolReference",
|
|
@@ -173,11 +185,11 @@ class I {
|
|
|
173
185
|
geometry: {
|
|
174
186
|
rings: [
|
|
175
187
|
[
|
|
176
|
-
[-
|
|
177
|
-
[
|
|
178
|
-
[
|
|
179
|
-
[-
|
|
180
|
-
[-
|
|
188
|
+
[-n, 30],
|
|
189
|
+
[n, 30],
|
|
190
|
+
[n, 15],
|
|
191
|
+
[-n, 15],
|
|
192
|
+
[-n, 30]
|
|
181
193
|
]
|
|
182
194
|
]
|
|
183
195
|
},
|
|
@@ -187,13 +199,13 @@ class I {
|
|
|
187
199
|
{
|
|
188
200
|
type: "CIMSolidFill",
|
|
189
201
|
enable: !0,
|
|
190
|
-
color:
|
|
202
|
+
color: o.concat([255])
|
|
191
203
|
},
|
|
192
204
|
{
|
|
193
205
|
type: "CIMSolidStroke",
|
|
194
206
|
enable: !0,
|
|
195
207
|
width: 3,
|
|
196
|
-
color:
|
|
208
|
+
color: o.concat([128])
|
|
197
209
|
}
|
|
198
210
|
]
|
|
199
211
|
}
|
|
@@ -222,7 +234,7 @@ class I {
|
|
|
222
234
|
},
|
|
223
235
|
verticalAlignment: "Center"
|
|
224
236
|
},
|
|
225
|
-
textString:
|
|
237
|
+
textString: a.count.toString()
|
|
226
238
|
}
|
|
227
239
|
],
|
|
228
240
|
scaleSymbolsProportionally: !0,
|
|
@@ -240,17 +252,17 @@ class I {
|
|
|
240
252
|
size: 24,
|
|
241
253
|
rotateClockwise: !0,
|
|
242
254
|
textureFilter: "Picture",
|
|
243
|
-
url:
|
|
255
|
+
url: s
|
|
244
256
|
}
|
|
245
257
|
]
|
|
246
258
|
}
|
|
247
259
|
}
|
|
248
|
-
} : (
|
|
260
|
+
} : (d.symbol = {
|
|
249
261
|
type: "picture-marker",
|
|
250
|
-
url:
|
|
262
|
+
url: s,
|
|
251
263
|
width: 18,
|
|
252
264
|
height: 18
|
|
253
|
-
},
|
|
265
|
+
}, d.popupTemplate = {
|
|
254
266
|
title: "视频信息",
|
|
255
267
|
content: [
|
|
256
268
|
{
|
|
@@ -275,11 +287,11 @@ class I {
|
|
|
275
287
|
]
|
|
276
288
|
}
|
|
277
289
|
]
|
|
278
|
-
}),
|
|
290
|
+
}), d;
|
|
279
291
|
});
|
|
280
|
-
|
|
292
|
+
l.addMany(c);
|
|
281
293
|
}
|
|
282
294
|
}
|
|
283
295
|
export {
|
|
284
|
-
|
|
296
|
+
S as default
|
|
285
297
|
};
|
|
@@ -7,10 +7,16 @@ export default class EdpassDeviceController {
|
|
|
7
7
|
private kkAbnormalLayer;
|
|
8
8
|
private mapInitializer;
|
|
9
9
|
private watchHandle;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private currentShowParams;
|
|
11
|
+
private isCameraVisible;
|
|
12
|
+
private isKkVisible;
|
|
12
13
|
constructor(view: __esri.MapView | __esri.SceneView);
|
|
13
14
|
setEdpassLayerVisibility(params: IShowEdpassDeviceParams): Promise<IResult>;
|
|
15
|
+
/**
|
|
16
|
+
* 控制散点图层显示隐藏
|
|
17
|
+
* @param visible
|
|
18
|
+
*/
|
|
19
|
+
private showScatter;
|
|
14
20
|
private getLayerConfig;
|
|
15
21
|
private showClusterInExtent;
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("@arcgis/core/core/reactiveUtils.js"),p=require("@arcgis/core/Graphic"),m=require("@arcgis/core/layers/GraphicsLayer"),f=require("vue"),k=require("../stores/index.js");function w(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const g=w(v);class C{constructor(e){this.watchHandle=null,this.currentShowParams=null,this.isCameraVisible=!1,this.isKkVisible=!1,this.view=e;const t=k.default.useAppDataStore;this.mapInitializer=f.toRaw(t.mapInitializer),this.cameraNormalLayer=new m({id:"cameraNormalLayer",visible:!1}),this.cameraAbnormalLayer=new m({id:"cameraAbnormalLayer",visible:!1}),this.kkNormalLayer=new m({id:"kkNormalLayer",visible:!1}),this.kkAbnormalLayer=new m({id:"kkAbnormalLayer",visible:!1}),this.view.map.addMany([this.cameraNormalLayer,this.cameraAbnormalLayer,this.kkNormalLayer,this.kkAbnormalLayer])}async setEdpassLayerVisibility(e){var t;if(this.currentShowParams=e,e.deviceType!=="camera"&&e.deviceType!=="kk")return{status:-1,message:"不支持的设备类型"};switch(e.deviceType==="camera"&&(this.isCameraVisible=e.visible),e.deviceType==="kk"&&(this.isKkVisible=e.visible),e.style){case"scatter":{this.showScatter();break}case"cluster":{const{deviceLayer:i}=this.getLayerConfig(e);i.visible=e.visible,e.visible?(await this.showClusterInExtent(e,this.view.extent),this.watchHandle||(this.watchHandle=g.when(()=>this.view.stationary,async()=>{var r,o,l,n,d,a,h,u;this.cameraNormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"normal",style:"cluster",ddCode:((r=this.currentShowParams)==null?void 0:r.ddCode)||"",zdCode:((o=this.currentShowParams)==null?void 0:o.zdCode)||"",visible:!0},this.view.extent),this.cameraAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"camera",deviceState:"abnormal",style:"cluster",ddCode:((l=this.currentShowParams)==null?void 0:l.ddCode)||"",zdCode:((n=this.currentShowParams)==null?void 0:n.zdCode)||"",visible:!0},this.view.extent),this.kkNormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"normal",style:"cluster",ddCode:((d=this.currentShowParams)==null?void 0:d.ddCode)||"",zdCode:((a=this.currentShowParams)==null?void 0:a.zdCode)||"",visible:!0},this.view.extent),this.kkAbnormalLayer.visible&&await this.showClusterInExtent({deviceType:"kk",deviceState:"abnormal",style:"cluster",ddCode:((h=this.currentShowParams)==null?void 0:h.ddCode)||"",zdCode:((u=this.currentShowParams)==null?void 0:u.zdCode)||"",visible:!0},this.view.extent)}))):(i.removeAll(),!this.cameraNormalLayer.visible&&!this.cameraAbnormalLayer.visible&&!this.kkNormalLayer.visible&&!this.kkAbnormalLayer.visible&&((t=this.watchHandle)==null||t.remove(),this.watchHandle=null));break}}return{status:0,message:"Success"}}showScatter(e){const t=e??this.isCameraVisible,i=e??this.isKkVisible;this.mapInitializer.setLayerVisibility({id:"camera-normal",visible:t}),this.mapInitializer.setLayerVisibility({id:"camera-abnormal",visible:t}),this.mapInitializer.setLayerVisibility({id:"kk-normal",visible:i}),this.mapInitializer.setLayerVisibility({id:"kk-abnormal",visible:i})}getLayerConfig(e){let t,i,r;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),{icon:t,color:i,deviceLayer:r}}async showClusterInExtent(e,t){const i=await fetch("/es/queryGeoAggregation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceType:e.deviceType,topLeftLat:t.ymax,topLeftLon:t.xmin,bottomRightLat:t.ymin,bottomRightLon:t.xmax,devStateSet:e.deviceState?[e.deviceState==="normal"?"1":"2"]:["1","2"],zdCode:e.zdCode||"",ddCode:e.ddCode||"",mapLevel:this.view.zoom+9})});if(i.status!==200){console.error(i.statusText);return}const r=await i.json();if(r.code!==200)return;const{icon:o,color:l,deviceLayer:n}=this.getLayerConfig(e);n.removeAll();const d=r.data.map(a=>{var b;const c=(a.count.toString().length*6+6)/2,y=new p({geometry:{type:"point",x:a.lon,y:a.lat},attributes:{id:((b=a.devInfo)==null?void 0:b.deviceId)||a.key,type:e.deviceType,count:a.count,typeName:e.deviceType==="camera"?"视频":"卡口",stateName:e.deviceState==="normal"?"正常":"异常",...a.devInfo}});return a.count>1?y.symbol={type:"cim",data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-c,30],[c,30],[c,15],[-c,15],[-c,30]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:l.concat([255])},{type:"CIMSolidStroke",enable:!0,width:3,color:l.concat([128])}]}},{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",fontFamilyName:"msyh",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:22,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},verticalAlignment:"Center"},textString:a.count.toString()}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:24,rotateClockwise:!0,textureFilter:"Picture",url:o}]}}}:(y.symbol={type:"picture-marker",url:o,width:18,height:18},y.popupTemplate={title:"视频信息",content:[{type:"fields",fieldInfos:[{fieldName:"deviceId",label:"设备编号"},{fieldName:"deviceName",label:"设备名称"},{fieldName:"typeName",label:"设备类型"},{fieldName:"stateName",label:"设备状态"}]}]}),y});n.addMany(d)}}exports.default=C;
|