@kq_npm/client3d_webgl_vue 4.5.55 → 4.5.57

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.
Files changed (82) hide show
  1. package/adddata/index.js +189 -21
  2. package/airspacegridoccupancyquery/index.js +1977 -0
  3. package/airspacegridoccupancyquery/style/airspacegridoccupancyquery.css +1 -0
  4. package/airspacegridoccupancyquery/style/index.js +3 -0
  5. package/airspaceprofileanalysis/index.js +1870 -0
  6. package/airspaceprofileanalysis/style/airspaceprofileanalysis.css +1 -0
  7. package/airspaceprofileanalysis/style/index.js +3 -0
  8. package/aspectanalysis/index.js +25 -7
  9. package/baseterraingallery/index.js +16 -4
  10. package/boxclip/index.js +58 -16
  11. package/buildpointmodel/index.js +3207 -230
  12. package/buildpointmodel/style/buildpointmodel.css +1 -1
  13. package/buildpolygonmodel/index.js +205 -81
  14. package/buildpolylinemodel/index.js +346 -70
  15. package/clientPrint/index.js +32440 -2337
  16. package/comparemap/index.js +132 -60
  17. package/compass/index.js +16 -6
  18. package/excavatefillanalysis/index.js +51 -7
  19. package/fixedzoomin/index.js +24 -7
  20. package/fixedzoomout/index.js +25 -7
  21. package/flight/index.js +113 -26
  22. package/floodanalysis/index.js +79 -14
  23. package/geologicalbodyanalysis/index.js +41 -5
  24. package/gpuspatialquery/index.js +127 -19
  25. package/gridoccupancyquery/index.js +627 -0
  26. package/gridoccupancyquery/style/gridoccupancyquery.css +1 -0
  27. package/gridoccupancyquery/style/index.js +3 -0
  28. package/hawkeye/index.js +20 -2
  29. package/headertemp/index.js +7 -2
  30. package/heatmap3d/index.js +282 -158
  31. package/index.js +32440 -2337
  32. package/isolineanalysis/index.js +113 -38
  33. package/light/index.js +80 -22
  34. package/limitheightanalysis/index.js +30 -10
  35. package/lowaltitudefeature/index.js +5027 -0
  36. package/lowaltitudefeature/style/index.js +3 -0
  37. package/lowaltitudefeature/style/lowaltitudefeature.css +1 -0
  38. package/measure/index.js +60 -19
  39. package/modelFlat/index.js +48 -8
  40. package/modeledit/index.js +38 -4
  41. package/modelexcavate/index.js +48 -7
  42. package/modelfilter/index.js +51 -8
  43. package/modelmaterialedit/index.js +127 -25
  44. package/modelprofileanalysis/index.js +51 -14
  45. package/modelselect/index.js +34 -3
  46. package/modelstyleedit/index.js +39 -3
  47. package/modeltransform/index.js +79 -14
  48. package/package.json +1 -1
  49. package/particleeffect/index.js +83 -17
  50. package/planeclip/index.js +66 -17
  51. package/pointcloudrender/index.js +134 -15
  52. package/radarscananalysis/index.js +35 -3
  53. package/resetview/index.js +14 -6
  54. package/roller/index.js +55 -18
  55. package/scaneffect/index.js +98 -29
  56. package/sceneadvancedtoimage/index.js +32 -6
  57. package/sceneapp/index.js +32440 -2337
  58. package/sceneset/index.js +141 -71
  59. package/scenetohdimage/index.js +23 -3
  60. package/sceneview/index.js +32440 -2337
  61. package/sceneview/style/sceneview.css +1 -1
  62. package/screenshot/index.js +44 -11
  63. package/shadowanalysis/index.js +79 -19
  64. package/sightlineanalysis/index.js +66 -15
  65. package/skylineanalysis/index.js +20 -4
  66. package/slopeanalysis/index.js +75 -16
  67. package/slopeaspectanalysis/index.js +128 -26
  68. package/statusbar/index.js +80 -67
  69. package/style.css +1 -1
  70. package/terrainoperation/index.js +39 -7
  71. package/terrainprofileanalysis/index.js +43 -5
  72. package/toolbarapp/index.js +32440 -2337
  73. package/toolboxapp/index.js +32440 -2337
  74. package/typhoontrac/index.js +134 -16
  75. package/underground/index.js +8 -2
  76. package/videofusion/index.js +164 -79
  77. package/videoproject/index.js +77 -23
  78. package/viewshedanalysis/index.js +61 -14
  79. package/weathereffect/index.js +73 -18
  80. package/webgl.es.js +866 -16
  81. package/windyslicing/index.js +258 -54
  82. package/wireframesketch/index.js +25 -8
@@ -187,26 +187,52 @@ const Utils = {
187
187
  }
188
188
  };
189
189
  class WindySlicingViewModel {
190
+ // 当前绘制分组标识
191
+
192
+ /**
193
+ * @description 构造函数,初始化剖切管理对象及事件处理器
194
+ * @param {Object} scenceView 场景视图对象,包含 _viewer、_layerManager、_drawManager 属性
195
+ * @param {Object} options 剖切配置参数
196
+ * @param {Function} callbackParams 回调函数,用于通知外部状态变化
197
+ */
190
198
  constructor(scenceView, options, callbackParams) {
191
199
  // 类属性初始化(更清晰的声明)
192
200
  this._viewer = null;
201
+ // 三维viewer对象
193
202
  this._layerManager = null;
203
+ // 图层管理器对象
194
204
  this._options = null;
205
+ // 剖切配置参数对象
195
206
  this._windySlicingDrawManager = null;
207
+ // 绘制管理器对象
196
208
  this._windySlicingLayerconfig = null;
209
+ // 气象剖切图层配置
197
210
  this._windySlicingPolylineHandler = null;
211
+ // 线绘制屏幕事件处理器
198
212
  this._isDrawPolyline = false;
213
+ // 是否正在绘制线
199
214
  this._pointSlicingHtmlTag = null;
215
+ // 点剖切HTML标注对象
200
216
  this._volumePrimitives = [];
217
+ // 体剖切Primitive集合
201
218
  this._volumePrimitive = null;
219
+ // 当前体剖切Primitive
202
220
  this._volumePrimitiveVoxels = null;
221
+ // 体素剖切Primitive
203
222
  this._currentVolumeOption = null;
223
+ // 当前体剖切配置参数
204
224
  this._currentVolumePosition = null;
225
+ // 当前体剖切位置范围
205
226
  this._Kq3dWavePrimitive = null;
227
+ // 三维粒子(风场波浪)对象
206
228
  this.callbackParams = null;
229
+ // 回调参数函数
207
230
  this.volumelines = null;
231
+ // 剖面线数据
208
232
  this._language = null;
233
+ // 当前语言对象
209
234
  this._groupName = CONSTS.GROUP_NAME;
235
+ // 绘制分组名称
210
236
  this._currentGroupName = null;
211
237
  const {
212
238
  locale
@@ -232,6 +258,7 @@ class WindySlicingViewModel {
232
258
 
233
259
  // 切换剖切模式(逻辑保持,简化条件判断)
234
260
  changeSlicingMode() {
261
+ // 根据样式类型映射对应的剖切处理函数
235
262
  const modeMap = {
236
263
  '1': () => this._currentVolumePosition && this.windySlicingRectangleSlicing(this._currentVolumePosition),
237
264
  '2': () => this._currentVolumePosition && this.windySlicingSurfaceSection(this._currentVolumePosition, this._windySlicingLayerconfig),
@@ -243,7 +270,11 @@ class WindySlicingViewModel {
243
270
  handler && handler();
244
271
  }
245
272
 
246
- // 参数切换(拆分大函数,按功能模块化)
273
+ /**
274
+ * @description 参数切换(拆分大函数,按功能模块化)
275
+ * @param {String} key 改变的参数类型标识
276
+ * @param {*} val 改变的参数值
277
+ */
247
278
  paramsChanged(key, val) {
248
279
  if (!this._windySlicingLayerconfig && this._options.mode !== "clear") {
249
280
  this._showWarningTip();
@@ -276,7 +307,10 @@ class WindySlicingViewModel {
276
307
  const handler = handlerMap[key];
277
308
  handler ? handler() : null;
278
309
  }
279
- // 处理三维粒子参数
310
+ /**
311
+ * @description 处理三维粒子参数
312
+ * @param {String} key 粒子参数类型标识
313
+ */
280
314
  _changParticleParams(key) {
281
315
  const that = this;
282
316
  // 实例不存在直接退出
@@ -398,7 +432,12 @@ class WindySlicingViewModel {
398
432
  });
399
433
  }
400
434
 
401
- // 获取接口数据
435
+ /**
436
+ * @description 获取接口数据
437
+ * @param {String} var1 风场U方向变量名
438
+ * @param {String} var2 风场V方向变量名
439
+ * @returns {Promise<Array>} 风场数据数组
440
+ */
402
441
  async getKq3dWaveData(var1, var2) {
403
442
  if (!this._windySlicingLayerconfig) return [];
404
443
  const rect = JSON.stringify(this._currentVolumePosition);
@@ -463,6 +502,11 @@ class WindySlicingViewModel {
463
502
  }
464
503
  };
465
504
  }
505
+ /**
506
+ * @description 将角度矩形转换为弧度矩形
507
+ * @param {Object} degreeRectangle 角度矩形对象,包含 west/south/east/north
508
+ * @returns {Object} 弧度矩形对象
509
+ */
466
510
  degreesToRadiansRectangle(degreeRectangle) {
467
511
  return {
468
512
  west: Cesium.Math.toRadians(degreeRectangle.west),
@@ -471,7 +515,12 @@ class WindySlicingViewModel {
471
515
  north: Cesium.Math.toRadians(degreeRectangle.north)
472
516
  };
473
517
  }
474
- // 发送请求
518
+ /**
519
+ * @description 发送请求
520
+ * @param {String} url 请求地址
521
+ * @param {Object} data 请求数据
522
+ * @returns {Promise} 请求结果的Promise
523
+ */
475
524
  _getRequest(url, data) {
476
525
  return new Promise(resolve => {
477
526
  const xhr = new XMLHttpRequest();
@@ -503,7 +552,10 @@ class WindySlicingViewModel {
503
552
  this.changeSlicingMode();
504
553
  }
505
554
 
506
- // 处理高度控制切换
555
+ /**
556
+ * @description 处理高度控制切换
557
+ * @param {Array} val 高度值数组
558
+ */
507
559
  _handleAltitudeControlChange(val) {
508
560
  this.removeVolumePrimitive();
509
561
  if (this._currentVolumePosition) {
@@ -511,10 +563,18 @@ class WindySlicingViewModel {
511
563
  this.windySlicingSurfaceSection(this._currentVolumePosition, Object.assign(layerConfig, {
512
564
  zValues: val
513
565
  }));
566
+ this._handleSectionChange('long');
567
+ this._handleSectionChange('lat');
568
+ setTimeout(() => {
569
+ this._setgdVolumeVisible();
570
+ }, 200);
514
571
  }
515
572
  }
516
573
 
517
- // 处理经/纬度剖面切换
574
+ /**
575
+ * @description 处理经/纬度剖面切换
576
+ * @param {String} type 剖面类型:long-经度剖面,lat-纬度剖面
577
+ */
518
578
  _handleSectionChange(type) {
519
579
  const primitiveKey = type === 'long' ? '_volumePrimitive1' : '_volumePrimitive2';
520
580
  const valueKey = type === 'long' ? 'longSectionValue' : 'latSectionValue';
@@ -532,7 +592,10 @@ class WindySlicingViewModel {
532
592
  }
533
593
  }
534
594
 
535
- // 处理轴剖切
595
+ /**
596
+ * @description 处理轴剖切
597
+ * @param {String} axis 剖切轴:x/y/z
598
+ */
536
599
  _handleAxisClipping(axis) {
537
600
  if (!this._volumePrimitiveVoxels) return;
538
601
  const clipConfig = {
@@ -633,7 +696,7 @@ class WindySlicingViewModel {
633
696
  setjdVolumeVisible() {
634
697
  const line = JSON.parse(JSON.stringify(this.volumelines?.volumeLine1));
635
698
  line.forEach(item => {
636
- item.x = item.x - Number(this._options["longSectionValue"]);
699
+ item.x = item.x + Number(this._options["longSectionValue"]);
637
700
  });
638
701
  const zValues = this._options?.enableLayerings?.slice(0, this._options?.altitudeControl);
639
702
  this._volumePrimitive1 = this.getSlicingParams({
@@ -650,7 +713,7 @@ class WindySlicingViewModel {
650
713
  setwdVolumeVisible() {
651
714
  const line = JSON.parse(JSON.stringify(this.volumelines?.volumeLine2));
652
715
  line.forEach(item => {
653
- item.y = item.y - Number(this._options["latSectionValue"]);
716
+ item.y = item.y + Number(this._options["latSectionValue"]);
654
717
  });
655
718
  const zValues = this._options?.enableLayerings?.slice(0, this._options?.altitudeControl);
656
719
  this._volumePrimitive2 = this.getSlicingParams({
@@ -662,16 +725,27 @@ class WindySlicingViewModel {
662
725
  this._volumePrimitive2.showSection(line);
663
726
  });
664
727
  }
665
-
666
728
  // 高度剖面
667
- setgdVolumeVisible() {
668
- const zshowMax = this._options?.enableLayerings?.slice(0, this._options?.altitudeControl);
669
- const zVisibles = this._generateZVisibles(zshowMax, this._options["enableHeightSection"], this._options["heightSectionValue"] - 1);
670
- if (this._volumePrimitive) {
671
- this._volumePrimitive.updateVisibles(zVisibles);
729
+ _setgdVolumeVisible() {
730
+ let zshowMax = this._options?.enableLayerings?.slice(0, this._options?.altitudeControl);
731
+ let zVisibles = [];
732
+ if (this._options["enableHeightSection"]) {
733
+ for (let i = 0; i < zshowMax.length; i++) {
734
+ if (i == this._options["heightSectionValue"] - 1) {
735
+ zVisibles.push(true);
736
+ } else {
737
+ zVisibles.push(false);
738
+ }
739
+ }
740
+ if (this._windySlicingLayerconfig.unit == "hpa") zVisibles = zVisibles.reverse();
741
+ if (this._volumePrimitive) this._volumePrimitive.updateVisibles(zVisibles);
742
+ } else {
743
+ for (let i = 0; i < zshowMax.length; i++) {
744
+ zVisibles.push(false);
745
+ }
746
+ this._volumePrimitive && this._volumePrimitive.updateVisibles(zVisibles);
672
747
  }
673
748
  }
674
-
675
749
  // 分层显隐(重命名+简化逻辑)
676
750
  _setEnableLayeringVisible() {
677
751
  const zValues = this._windySlicingLayerconfig?.zValues || [];
@@ -681,7 +755,13 @@ class WindySlicingViewModel {
681
755
  }
682
756
  }
683
757
 
684
- // 生成Z轴显隐数组(复用逻辑)
758
+ /**
759
+ * @description 生成Z轴显隐数组(复用逻辑)
760
+ * @param {Array} zList Z轴值数组
761
+ * @param {Boolean} isEnable 是否启用
762
+ * @param {Number} targetIndex 目标索引
763
+ * @returns {Array} Z轴显隐数组
764
+ */
685
765
  _generateZVisibles(zList, isEnable, targetIndex) {
686
766
  if (!zList || zList.length === 0) return [];
687
767
  return zList.map((_, index) => {
@@ -768,7 +848,10 @@ class WindySlicingViewModel {
768
848
  }
769
849
  }
770
850
 
771
- // 两点绘制线结果
851
+ /**
852
+ * @description 两点绘制线结果
853
+ * @param {Function} callback 绘制完成回调函数
854
+ */
772
855
  drawPolylineHandler(callback) {
773
856
  let activeShapePoints = [];
774
857
  this._windySlicingPolylineHandler.setInputAction(event => {
@@ -813,7 +896,13 @@ class WindySlicingViewModel {
813
896
  this._sendPointRequest(requestData, unit, cartographic);
814
897
  }
815
898
 
816
- // 构建点剖切请求数据
899
+ /**
900
+ * @description 构建点剖切请求数据
901
+ * @param {Number} X 经度
902
+ * @param {Number} Y 纬度
903
+ * @param {Object} layer 图层对象
904
+ * @returns {Object} 请求参数对象
905
+ */
817
906
  _buildPointRequestData(X, Y, layer) {
818
907
  const baseData = {
819
908
  collectionName: this._windySlicingLayerconfig?.params?.layer,
@@ -843,7 +932,12 @@ class WindySlicingViewModel {
843
932
  return baseData;
844
933
  }
845
934
 
846
- // 发送点剖切请求
935
+ /**
936
+ * @description 发送点剖切请求
937
+ * @param {Object} data 请求数据
938
+ * @param {String} unit 单位
939
+ * @param {Object} cartographic 拾取点坐标
940
+ */
847
941
  _sendPointRequest(data, unit, cartographic) {
848
942
  const url = this._windySlicingLayerconfig?.url.replaceAll("/wmts", "").replace("/image", "/image/identify");
849
943
  const xhr = new XMLHttpRequest();
@@ -854,7 +948,12 @@ class WindySlicingViewModel {
854
948
  xhr.send(JSON.stringify(data));
855
949
  }
856
950
 
857
- // 处理点剖切响应
951
+ /**
952
+ * @description 处理点剖切响应
953
+ * @param {XMLHttpRequest} xhr 请求对象
954
+ * @param {String} unit 单位
955
+ * @param {Object} cartographic 拾取点坐标
956
+ */
858
957
  _handlePointResponse(xhr, unit, cartographic) {
859
958
  if (xhr.status < 200 || xhr.status >= 300) {
860
959
  console.error('Request error:', xhr.statusText);
@@ -868,7 +967,12 @@ class WindySlicingViewModel {
868
967
  this.setWindySlicingPointData(`${val}&nbsp;&nbsp;${unit}`, cartographic);
869
968
  }
870
969
 
871
- // 格式化点剖切数值(拆分复杂逻辑)
970
+ /**
971
+ * @description 格式化点剖切数值(拆分复杂逻辑)
972
+ * @param {String} layerName 图层名称
973
+ * @param {Array} getAllVal 获取到的所有值数组
974
+ * @returns {*} 格式化后的数值或文本
975
+ */
872
976
  _formatPointValue(layerName, getAllVal) {
873
977
  // 风场处理
874
978
  if (CONSTS.WIND_LAYERS.includes(layerName)) {
@@ -896,7 +1000,13 @@ class WindySlicingViewModel {
896
1000
  return Number(getAllVal[0].value);
897
1001
  }
898
1002
 
899
- // 计算风向
1003
+ /**
1004
+ * @description 计算风向
1005
+ * @param {Number} u U方向分量
1006
+ * @param {Number} v V方向分量
1007
+ * @param {Number} dir 方向角度(当u、v为空时使用)
1008
+ * @returns {Object} 包含风向文本和风速的对象
1009
+ */
900
1010
  direction(u, v, dir) {
901
1011
  let angles, speed;
902
1012
  if (u && v) {
@@ -912,7 +1022,11 @@ class WindySlicingViewModel {
912
1022
  };
913
1023
  }
914
1024
 
915
- // 获取风向文本(简化条件判断)
1025
+ /**
1026
+ * @description 获取风向文本(简化条件判断)
1027
+ * @param {Number} angle 角度值
1028
+ * @returns {String} 风向文本
1029
+ */
916
1030
  _getDirectionText(angle) {
917
1031
  const directionRanges = [{
918
1032
  min: 15,
@@ -963,7 +1077,11 @@ class WindySlicingViewModel {
963
1077
  });
964
1078
  }
965
1079
 
966
- // 构建点标注HTML(抽离静态内容)
1080
+ /**
1081
+ * @description 构建点标注HTML(抽离静态内容)
1082
+ * @param {String} val 显示的数值文本
1083
+ * @returns {String} HTML字符串
1084
+ */
967
1085
  _buildPointHtml(val) {
968
1086
  return `<div class="pickClass">
969
1087
  <div style="display: block;position: absolute;left: 0px;right: 0;width: 2px;height: 140px;background: rgba(68,65,65,.84)">
@@ -972,7 +1090,11 @@ class WindySlicingViewModel {
972
1090
  </div>`;
973
1091
  }
974
1092
 
975
- // 重构剖切参数
1093
+ /**
1094
+ * @description 重构剖切参数
1095
+ * @param {Object} [params] 自定义参数
1096
+ * @returns {Object} 体剖切Provider对象
1097
+ */
976
1098
  getSlicingParams(params = {}) {
977
1099
  if (!this._windySlicingLayerconfig) return;
978
1100
  const colors = this._windySlicingLayerconfig?.colors ?? [];
@@ -991,7 +1113,12 @@ class WindySlicingViewModel {
991
1113
  return new Cesium.Kq3dGridVolumeProvider(this._currentVolumeOption);
992
1114
  }
993
1115
 
994
- // 构建基础Volume配置
1116
+ /**
1117
+ * @description 构建基础Volume配置
1118
+ * @param {String} img 颜色表生成的图片
1119
+ * @param {Array} ranges 属性范围数组
1120
+ * @returns {Object} 基础配置对象
1121
+ */
995
1122
  _buildVolumeOption(img, ranges) {
996
1123
  return {
997
1124
  viewer: this._viewer,
@@ -1081,7 +1208,11 @@ class WindySlicingViewModel {
1081
1208
  this.setViewEntity(rect);
1082
1209
  }
1083
1210
 
1084
- // 获取面剖切Z轴值
1211
+ /**
1212
+ * @description 获取面剖切Z轴值
1213
+ * @param {Object} data 图层配置
1214
+ * @returns {Array} 排序后的Z轴值数组
1215
+ */
1085
1216
  _getSurfaceSectionZValues(data) {
1086
1217
  let zValues = JSON.parse(JSON.stringify(data.zValues));
1087
1218
  if (!zValues || zValues.length === 0) {
@@ -1090,12 +1221,20 @@ class WindySlicingViewModel {
1090
1221
  return data.unit !== CONSTS.REVERSE_UNIT ? zValues.sort((a, b) => a - b) : zValues.sort((a, b) => b - a);
1091
1222
  }
1092
1223
 
1093
- // 获取面剖切索引
1224
+ /**
1225
+ * @description 获取面剖切索引
1226
+ * @param {Object} data 图层配置
1227
+ * @param {Array} zValues Z轴值数组
1228
+ * @returns {Number} 面剖切索引
1229
+ */
1094
1230
  _getSurfaceSectionIndex(data, zValues) {
1095
1231
  return data.unit !== CONSTS.REVERSE_UNIT ? 0 : zValues.length - 1;
1096
1232
  }
1097
1233
 
1098
- // 创建面剖切辅助线
1234
+ /**
1235
+ * @description 创建面剖切辅助线
1236
+ * @param {Array} zValues Z轴值数组
1237
+ */
1099
1238
  _createSurfaceSectionLines(zValues) {
1100
1239
  this.volumelines = this.createXYVolume(this.getRectangle(this._currentVolumePosition));
1101
1240
  const options1 = {
@@ -1120,13 +1259,21 @@ class WindySlicingViewModel {
1120
1259
  }
1121
1260
  }
1122
1261
 
1123
- // 转换为Cesium Rectangle
1262
+ /**
1263
+ * @description 转换为Cesium Rectangle
1264
+ * @param {Object|String} rect 矩形四至对象或JSON字符串
1265
+ * @returns {Object} Cesium Rectangle对象
1266
+ */
1124
1267
  getRectangle(rect) {
1125
1268
  const rectObj = typeof rect === 'string' ? JSON.parse(rect) : rect;
1126
1269
  return new Cesium.Rectangle(Cesium.Math.toRadians(rectObj.minX), Cesium.Math.toRadians(rectObj.minY), Cesium.Math.toRadians(rectObj.maxX), Cesium.Math.toRadians(rectObj.maxY));
1127
1270
  }
1128
1271
 
1129
- // 创建XY轴剖面线
1272
+ /**
1273
+ * @description 创建XY轴剖面线
1274
+ * @param {Object} rectangle Cesium Rectangle对象
1275
+ * @returns {Object} 包含边界线和剖面线的对象
1276
+ */
1130
1277
  createXYVolume(rectangle) {
1131
1278
  // 获取矩形四个角点
1132
1279
  const southwest = Cesium.Rectangle.southwest(rectangle);
@@ -1180,7 +1327,13 @@ class WindySlicingViewModel {
1180
1327
  });
1181
1328
  }
1182
1329
 
1183
- // 生成值颜色数组
1330
+ /**
1331
+ * @description 生成值颜色数组
1332
+ * @param {Number} start 起始值
1333
+ * @param {Number} end 结束值
1334
+ * @param {String} color CSS颜色字符串
1335
+ * @returns {Array} 值颜色数组
1336
+ */
1184
1337
  getValueColor(start, end, color) {
1185
1338
  const arr = [];
1186
1339
  let num = start;
@@ -1272,7 +1425,10 @@ class WindySlicingViewModel {
1272
1425
  this.callbackParams && this.callbackParams("bodyDissectionZClipping", this._options.enableLayerings);
1273
1426
  }
1274
1427
 
1275
- // 设置entity视角缩放
1428
+ /**
1429
+ * @description 设置entity视角缩放
1430
+ * @param {Object} rect 矩形四至对象
1431
+ */
1276
1432
  setViewEntity(rect) {
1277
1433
  // 原逻辑注释保留,如需启用可取消注释
1278
1434
  // const rectangle = new Cesium.Rectangle(
@@ -1301,7 +1457,11 @@ class WindySlicingViewModel {
1301
1457
  // }, CONSTS.FLY_TO_DURATION);
1302
1458
  }
1303
1459
 
1304
- // 根据颜色表生成图片
1460
+ /**
1461
+ * @description 根据颜色表生成图片
1462
+ * @param {Array} colors 颜色数组
1463
+ * @returns {String} 图片的dataURL
1464
+ */
1305
1465
  generateImage(colors) {
1306
1466
  const canvas = document.createElement('canvas');
1307
1467
  canvas.width = CONSTS.CANVAS_SIZE.width;
@@ -1336,6 +1496,7 @@ class WindySlicingViewModel {
1336
1496
  this._windySlicingDrawManager.clearDrawGroup(this._groupName);
1337
1497
  }
1338
1498
  }
1499
+ // 销毁三维粒子实例
1339
1500
  destroyedKq3dWave() {
1340
1501
  if (this._Kq3dWavePrimitive) {
1341
1502
  if (this._Kq3dWavePrimitive.particleSystem) {
@@ -1520,14 +1681,14 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1520
1681
  locale
1521
1682
  } = (0, _useGlobalConfig.useLocale)();
1522
1683
  const props = __props;
1523
- let enableLayerings = (0, _vue.ref)([]);
1524
- let unit = (0, _vue.ref)("m");
1525
- let unitValue = (0, _vue.ref)("");
1526
- let showSlicingSetting = (0, _vue.ref)(false);
1527
- let showWindySlicing = (0, _vue.ref)(props.show);
1528
- const scrollcar_ref = (0, _vue.ref)();
1529
- const renderbox_ref = (0, _vue.ref)();
1530
- const isShowParticle3D = (0, _vue.ref)(true);
1684
+ let enableLayerings = (0, _vue.ref)([]); // 分层数据数组
1685
+ let unit = (0, _vue.ref)("m"); // 单位
1686
+ let unitValue = (0, _vue.ref)(""); // 单位值
1687
+ let showSlicingSetting = (0, _vue.ref)(false); // 是否显示剖切设置
1688
+ let showWindySlicing = (0, _vue.ref)(props.show); // 是否显示气象剖切组件
1689
+ const scrollcar_ref = (0, _vue.ref)(); // 滚动容器Ref
1690
+ const renderbox_ref = (0, _vue.ref)(); // 渲染容器Ref
1691
+ const isShowParticle3D = (0, _vue.ref)(true); // 是否显示三维粒子选项
1531
1692
  let formItem = (0, _vue.reactive)({
1532
1693
  collapseValue: props.settingParams?.collapseValue ?? "setting",
1533
1694
  mode: props.settingParams?.mode ?? "",
@@ -1611,13 +1772,14 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1611
1772
  // 创建深度复制
1612
1773
  let formItemDef = JSON.parse(JSON.stringify(formItem));
1613
1774
  delete formItemDef.collapseValue;
1614
- const layeredDisplayMax = (0, _vue.ref)(0);
1615
- let viewModel = null;
1775
+ const layeredDisplayMax = (0, _vue.ref)(0); // 分层显示最大索引
1776
+
1777
+ let viewModel = null; // 气象剖切视图模型对象
1616
1778
  // 组件容器Ref
1617
1779
  let boxRef = (0, _vue.ref)(null);
1618
1780
  // 生成组件默认header
1619
- let headerTemp = (0, _vue.ref)();
1620
- let headerTempRef = (0, _vue.ref)();
1781
+ let headerTemp = (0, _vue.ref)(); // 动态生成的Header组件
1782
+ let headerTempRef = (0, _vue.ref)(); // Header组件Ref
1621
1783
  (0, _vue.onMounted)(() => {
1622
1784
  (0, _util.updatePosition)(boxRef.value, props);
1623
1785
  (0, _vue.watch)(() => props.position, (newVal, oldVal) => {
@@ -1661,11 +1823,20 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1661
1823
  showWindySlicing.value = true;
1662
1824
  viewModel && viewModel.getWindySlicingLayer(data?.guid ?? "");
1663
1825
  };
1826
+ /**
1827
+ * @description 切换气象图层
1828
+ * @param {Object} data 图层配置对象
1829
+ */
1664
1830
  const changeWindyLayer = data => {
1665
1831
  clear();
1666
1832
  Object.assign(formItem, formItemDef);
1667
1833
  viewModel && viewModel.getWindySlicingLayer(null, data);
1668
1834
  };
1835
+ /**
1836
+ * @description 回调参数处理,根据key更新组件状态
1837
+ * @param {String} key 回调类型标识
1838
+ * @param {*} val 回调值
1839
+ */
1669
1840
  function callbackParams(key, val) {
1670
1841
  switch (key) {
1671
1842
  case "showSlicingSetting":
@@ -1718,24 +1889,35 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1718
1889
  break;
1719
1890
  }
1720
1891
  }
1721
- //切换类型
1892
+ /**
1893
+ * @description 切换绘制类型
1894
+ * @param {String} mode 绘制模式:point/line/polygon/delete
1895
+ */
1722
1896
  function changeMode(mode) {
1723
1897
  if (!viewModel) return;
1724
1898
  showSlicingSetting.value = false;
1725
1899
  formItem.mode = mode;
1726
1900
  viewModel._options.mode = formItem.mode;
1727
1901
  viewModel && viewModel.paramsChanged("mode");
1902
+ // 删除模式时重置参数
1728
1903
  if (mode == "delete") {
1729
1904
  Object.assign(formItem, formItemDef);
1730
1905
  }
1731
1906
  }
1907
+ // 应用剖切样式
1732
1908
  function applicationClick() {
1733
1909
  paramsChanged("styleType");
1734
1910
  }
1911
+
1912
+ // 应用分层显示配置
1735
1913
  function applicationLayeredDisplayClick() {
1736
1914
  paramsChanged("changParticleParams", "layeredDisplay");
1737
1915
  }
1738
- // 参数切换事件
1916
+ /**
1917
+ * @description 参数切换事件
1918
+ * @param {String} key 改变的参数类型标识
1919
+ * @param {*} val 改变的参数值
1920
+ */
1739
1921
  function paramsChanged(key, val) {
1740
1922
  if (!viewModel) return;
1741
1923
  viewModel._options[key] = formItem[key];
@@ -1793,20 +1975,28 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1793
1975
  formItem.bodyDissectionZClippingMax = 10;
1794
1976
  Object.assign(viewModel._options, formItem);
1795
1977
  }
1978
+ /**
1979
+ * @description 根据Z轴值更新剖面参数范围
1980
+ * @param {Array} gdzValues Z轴值数组
1981
+ */
1796
1982
  function changeParams(gdzValues) {
1797
1983
  formItem.heightSectionValueMax = gdzValues.length;
1984
+ // 根据单位判断高度剖面值
1798
1985
  if (unit.value != "hpa") {
1799
1986
  formItem.heightSectionValue = 1;
1800
1987
  } else {
1801
1988
  formItem.heightSectionValue = gdzValues.length;
1802
1989
  }
1803
1990
  if (!viewModel?.volumelines) return;
1991
+ // 计算经度剖面滑动条范围
1804
1992
  let jdValue = Math.abs(viewModel?.volumelines.line1[0].longitude - viewModel?.volumelines.line1[1].longitude);
1805
1993
  jdValue = jdValue.toFixed(3);
1806
1994
  formItem.longSectionValueStep = jdValue / 100;
1807
1995
  formItem.longSectionValueMin = -(jdValue / 2);
1808
1996
  formItem.longSectionValueMax = jdValue / 2;
1809
1997
  formItem.longSectionValue = 0;
1998
+
1999
+ // 计算纬度剖面滑动条范围
1810
2000
  let wdValue = Math.abs(viewModel?.volumelines.line4[0].latitude - viewModel?.volumelines.line4[1].latitude);
1811
2001
  wdValue = wdValue.toFixed(3);
1812
2002
  formItem.latSectionValueStep = wdValue / 100;
@@ -1815,15 +2005,24 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1815
2005
  formItem.latSectionValue = 0;
1816
2006
  Object.assign(viewModel._options, formItem);
1817
2007
  }
2008
+ // 清除剖切结果
1818
2009
  function clear() {
1819
2010
  showSlicingSetting.value = false;
1820
2011
  viewModel && viewModel.clear();
1821
2012
  }
1822
- // 显示提示信息
2013
+ /**
2014
+ * @description 显示提示信息
2015
+ * @param {Number} val 滑动条值
2016
+ * @returns {String} 提示文本
2017
+ */
1823
2018
  function formatTooltip(val) {
1824
2019
  return enableLayerings.value[val - 1] + " " + unit.value;
1825
2020
  }
1826
- // 显示提示信息
2021
+ /**
2022
+ * @description 显示提示信息
2023
+ * @param {Number} val 滑动条值
2024
+ * @returns {String} 提示文本
2025
+ */
1827
2026
  function formatTooltips(val) {
1828
2027
  return val + " " + unitValue.value;
1829
2028
  }
@@ -1837,12 +2036,17 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
1837
2036
  color: "#fdfd28"
1838
2037
  });
1839
2038
  };
2039
+ // 添加分层显示项
1840
2040
  const addLayeredDisplay = () => {
1841
2041
  formItem.layeredDisplay.push({
1842
2042
  value: 0,
1843
2043
  color: "#fdfd28"
1844
2044
  });
1845
2045
  };
2046
+ /**
2047
+ * @description 删除分层显示项
2048
+ * @param {Number} index 删除项的索引
2049
+ */
1846
2050
  const handleDeleteLayeredDisplay = index => {
1847
2051
  formItem.layeredDisplay.splice(index, 1);
1848
2052
  };
@@ -3020,11 +3224,11 @@ Object.defineProperty(exports, "__esModule", ({
3020
3224
  value: true
3021
3225
  }));
3022
3226
  exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
3023
- let kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
3227
+ const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
3024
3228
  __webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
3025
- let kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
3229
+ const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
3026
3230
  __webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
3027
- let kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
3231
+ const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
3028
3232
  __webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
3029
3233
 
3030
3234
  /***/ })