@kq_npm/client3d_webgl_vue 4.5.37 → 4.5.38

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/measure/index.js CHANGED
@@ -635,7 +635,8 @@ return (_ctx, _cache) => {
635
635
  (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("p", _hoisted_4, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.toDisplayString)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(language).mode), 1 /* TEXT */),
636
636
  (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_select, {
637
637
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(mode),
638
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(mode) ? (mode).value = $event : mode = $event))
638
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.isRef)(mode) ? (mode).value = $event : mode = $event)),
639
+ disabled: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(isActive)
639
640
  }, {
640
641
  default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [
641
642
  ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.Fragment, null, (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.renderList)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(modeList), (item) => {
@@ -647,7 +648,7 @@ return (_ctx, _cache) => {
647
648
  }), 128 /* KEYED_FRAGMENT */))
648
649
  ]),
649
650
  _: 1 /* STABLE */
650
- }, 8 /* PROPS */, ["modelValue"])
651
+ }, 8 /* PROPS */, ["modelValue", "disabled"])
651
652
  ])
652
653
  ]),
653
654
  (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementVNode)("div", _hoisted_5, [
@@ -180,12 +180,13 @@ var gis_utils_ = __webpack_require__(7135);
180
180
  // EXTERNAL MODULE: ./src/common/_ui/message/index.js
181
181
  var message = __webpack_require__(1705);
182
182
  ;// CONCATENATED MODULE: ./src/webgl/modelfilter/ModelFilterViewModel.js
183
- /*
184
- * Copyright (C) 2019 KQ GEO Technologies Co., Ltd.
185
- * All rights reserved.
186
- */
183
+ /*
184
+ * Copyright (C) 2019 KQ GEO Technologies Co., Ltd.
185
+ * All rights reserved.
186
+ */
187
187
  //模型滤镜逻辑类
188
188
 
189
+
189
190
  class ModelFilterViewModel {
190
191
  _viewer = null; //三维viewer对象
191
192
  _options = {}; //Box裁剪存储参数对象
@@ -196,19 +197,31 @@ class ModelFilterViewModel {
196
197
  saturation:1,
197
198
  gamma: 1
198
199
  }
199
-
200
- constructor(scenceView, options) {
200
+ callbackParams = null;
201
+ constructor(scenceView, options, callbackParams) {
201
202
  this._options = Object.assign({}, options, this._defaultOptions);
202
203
  this._viewer = scenceView._viewer;
203
204
  this._options.viewer = this._viewer;
205
+ this.callbackParams = callbackParams;
206
+ // 事件绑定this
207
+ this._resetListData = this._resetListData.bind(this);
208
+ // 添加图层数据源变化监听
209
+ gis_utils_.mapViewUtils.bindViewEvents("resetLayerDatas", this._resetListData, scenceView._viewerId);
210
+ }
211
+ _resetListData(e) {
212
+ // 如果图层变化事件是自己触发的 则不继续执行 避免死循环
213
+ if (e.eventTarget && e.eventTarget === this) {
214
+ return;
215
+ }
216
+ this.callbackParams && this.callbackParams("setData")
204
217
  }
205
-
206
218
  // 查找所有3dtiles模型对象
207
219
  findLayers() {
208
220
  let tilesets = [];
209
221
  const primitives = this._viewer.scene.primitives._primitives;
210
222
  for (let m = 0; m < primitives.length; m++) {
211
223
  if (primitives[m] instanceof Cesium.Cesium3DTileset) {
224
+ if(!primitives[m].show) continue;
212
225
  tilesets.push({
213
226
  guid: primitives[m].guid,
214
227
  name: primitives[m].name ? primitives[m].name : primitives[m].guid
@@ -269,6 +282,7 @@ class ModelFilterViewModel {
269
282
 
270
283
  //销毁
271
284
  destroy() {
285
+ gis_utils_.mapViewUtils.offViewEvents("resetLayerDatas", this._resetListData, this._viewer._container.id);
272
286
  this.clear();
273
287
  }
274
288
  }
@@ -412,7 +426,7 @@ headerTempTitle.value = language.value.modelFilterPick;
412
426
  saturation: formItem.saturation,
413
427
  gamma: formItem.gamma
414
428
  };
415
- viewModel = new ModelFilterViewModel(scenceView, options);
429
+ viewModel = new ModelFilterViewModel(scenceView, options, callbackParams);
416
430
  }
417
431
  });
418
432
  setTimeout(() => {
@@ -421,7 +435,13 @@ headerTempTitle.value = language.value.modelFilterPick;
421
435
  }
422
436
  }, 1000);
423
437
  });
424
-
438
+ function callbackParams (key, val) {
439
+ if (viewModel) {
440
+ tiles.value = viewModel.findLayers(); // 获取所有tileset对象
441
+ formItem.tileset = "";
442
+ paramsChanged("tileset");
443
+ }
444
+ }
425
445
  /**
426
446
  * @description 监听header生成
427
447
  */
@@ -188,6 +188,9 @@ class ModelSelectViewModel {
188
188
  _modeFiledArray = null; // 模型属性唯一值字段集合
189
189
  _modeFiled = "id"; // 模型属性匹配字段
190
190
  _language = {};
191
+ selectedKey = null;
192
+ oldColor = null;
193
+ selectedFeature = null;
191
194
  constructor(scenceView, pickCallFunc) {
192
195
  this._language = scenceView._language;
193
196
  this._viewer = scenceView._viewer;
@@ -216,15 +219,30 @@ class ModelSelectViewModel {
216
219
  })
217
220
  }
218
221
  if (properties.indexOf(that._modeFiled) > -1) {
219
- let id = pickedObject.getProperty(that._modeFiled);
222
+ // let id = pickedObject.getProperty(that._modeFiled);
223
+ var newKey = pickedObject ? pickedObject.getProperty(that._modeFiled) : null;
224
+ if (newKey != that.selectedKey) {
225
+ if (that.selectedFeature) {
226
+ that.selectedFeature.color = that.oldColor;
227
+ that.selectedFeature = null;
228
+ that.selectedKey = null;
229
+ }
230
+
231
+ if (newKey != null) {
232
+ that.selectedKey = newKey;
233
+ that.selectedFeature = pickedObject;
234
+ that.oldColor = that.selectedFeature.color;
235
+ that.selectedFeature.color = Cesium.Color.fromCssColorString(that._highlightColor);
236
+ }
237
+ }
220
238
  // that.clear();
221
- that._highlight = new Cesium.Kq3dHighlight({
222
- viewer: that._viewer,
223
- tileset: pickedObject.tileset,
224
- attrName: that._modeFiled,
225
- attrValue: [id],
226
- color: [Cesium.Color.fromCssColorString(that._highlightColor)]
227
- });
239
+ // that._highlight = new Cesium.Kq3dHighlight({
240
+ // viewer: that._viewer,
241
+ // tileset: pickedObject.tileset,
242
+ // attrName: that._modeFiled,
243
+ // attrValue: [id],
244
+ // color: [Cesium.Color.fromCssColorString(that._highlightColor)]
245
+ // });
228
246
  let attrs = {};
229
247
  properties.forEach(prop => {
230
248
  attrs[prop] = pickedObject.getProperty(prop);
@@ -277,6 +295,11 @@ class ModelSelectViewModel {
277
295
  this._highlight = null;
278
296
  this.setCursor("default");
279
297
  this._isPick = false;
298
+ if (this.selectedFeature) {
299
+ this.selectedFeature.color = this.oldColor;
300
+ this.selectedFeature = null;
301
+ this.selectedKey = null;
302
+ }
280
303
  }
281
304
 
282
305
  //销毁
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"4.5.37","homepage":"","keywords":["KQGIS","webGL","Vue"],"sdkNames":["@kq_npm/client_icons_vue"],"restrictedVersion":true,"validateSDK":true,"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"KQWEB GROUP","license":"Apache-2.0","jsdelivr":"index.js","dependencies":{"html2canvas-pro":"1.5.10","save":"2.5.0","papaparse":"5.4.1"}}
1
+ {"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"4.5.38","homepage":"","keywords":["KQGIS","webGL","Vue"],"sdkNames":["@kq_npm/client_icons_vue"],"restrictedVersion":true,"validateSDK":true,"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"zhupc_npm","license":"Apache-2.0","jsdelivr":"index.js","dependencies":{"html2canvas-pro":"1.5.10","save":"2.5.0","papaparse":"5.4.1"}}
@@ -179,6 +179,7 @@ var message = __webpack_require__(1705);
179
179
  */
180
180
  //平面裁剪逻辑类
181
181
 
182
+
182
183
  class PlaneClipViewModel {
183
184
  _viewer = null; //三维viewer对象
184
185
  _options = {}; //平面裁剪存储参数对象
@@ -209,13 +210,15 @@ class PlaneClipViewModel {
209
210
  _drawManager = null; //绘制管理对象
210
211
  _removeEventListener = null; //绘制完成事件监听
211
212
  _language = {};
212
- constructor(scenceView, options) {
213
+ callbackParams = null;
214
+ constructor(scenceView, options, callbackParams) {
213
215
  this._options = Object.assign({}, options, this._defaultOptions);
214
216
  this._viewer = scenceView._viewer;
215
217
  // this._viewer.enabledFXAA = true;
216
218
  this._options.viewer = this._viewer;
217
219
  this._language = scenceView._language;
218
220
  this._drawManager = scenceView._drawManager;
221
+ this.callbackParams = callbackParams;
219
222
  let that = this;
220
223
  this._removeEventListener = this._drawManager.drawFinishedEvent.addEventListener(shape => {
221
224
  if (shape) {
@@ -225,14 +228,25 @@ class PlaneClipViewModel {
225
228
  that._drawManager.clear();
226
229
  }
227
230
  });
231
+ // 事件绑定this
232
+ this._resetListData = this._resetListData.bind(this);
233
+ // 添加图层数据源变化监听
234
+ gis_utils_.mapViewUtils.bindViewEvents("resetLayerDatas", this._resetListData, scenceView._viewerId);
235
+ }
236
+ _resetListData(e) {
237
+ // 如果图层变化事件是自己触发的 则不继续执行 避免死循环
238
+ if (e.eventTarget && e.eventTarget === this) {
239
+ return;
240
+ }
241
+ this.callbackParams && this.callbackParams("setData")
228
242
  }
229
-
230
243
  // 查找所有3dtiles模型对象
231
244
  findLayers() {
232
245
  let tilesets = [];
233
246
  const primitives = this._options.viewer.scene.primitives._primitives;
234
247
  for (let m = 0; m < primitives.length; m++) {
235
248
  if (primitives[m] instanceof Cesium.Cesium3DTileset) {
249
+ if(!primitives[m].show) continue;
236
250
  tilesets.push({
237
251
  guid: primitives[m].guid,
238
252
  name: primitives[m].name ? primitives[m].name : primitives[m].guid
@@ -257,7 +271,7 @@ class PlaneClipViewModel {
257
271
  var flag = false;
258
272
  var models = this._options.viewer.scene.primitives._primitives;
259
273
  for (let i = 0; i < models.length; i++) {
260
- if (models[i]._url) {
274
+ if (models[i]._url && models[i].show) {
261
275
  flag = true;
262
276
  }
263
277
  }
@@ -287,6 +301,7 @@ class PlaneClipViewModel {
287
301
  //移除监听事件
288
302
  this._removeEventListener && this._removeEventListener();
289
303
  this._removeEventListener = null;
304
+ gis_utils_.mapViewUtils.offViewEvents("resetLayerDatas", this._resetListData, this._viewer._container.id);
290
305
  }
291
306
 
292
307
  // 设置裁剪对象
@@ -473,20 +488,23 @@ headerTempTitle.value = language.value.planeClip;
473
488
  boxEnable: formItem.boxEnable,
474
489
  distance: formItem.clipDistance
475
490
  };
476
- viewModel = new PlaneClipViewModel(scenceView, options);
491
+ viewModel = new PlaneClipViewModel(scenceView, options, callbackParams);
477
492
  }
478
493
  });
479
494
  setTimeout(() => {
480
- if (viewModel) {
481
- tiles.value = viewModel.findLayers(); // 获取所有tileset对象
482
- if (tiles.value.length > 0) {
483
- formItem.tileset = tiles.value[0].guid;
484
- paramsChanged("tileset");
485
- }
486
- }
495
+ callbackParams();
487
496
  }, 1000);
488
497
  });
489
-
498
+ function callbackParams (key, val) {
499
+ if (viewModel) {
500
+ tiles.value = viewModel.findLayers(); // 获取所有tileset对象
501
+ formItem.tileset = "";
502
+ if (tiles.value.length > 0) {
503
+ formItem.tileset = tiles.value[0].guid;
504
+ }
505
+ paramsChanged("tileset");
506
+ }
507
+ }
490
508
  /**
491
509
  * @description 监听header生成
492
510
  */