@kq_npm/client3d_webgl_vue 4.5.30 → 4.5.31

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.
@@ -221,7 +221,7 @@ class WindySlicingViewModel {
221
221
 
222
222
  (0,defineProperty/* default */.Z)(this, "callbackParams", null);
223
223
 
224
- (0,defineProperty/* default */.Z)(this, "currentSlicingUnit", "m");
224
+ (0,defineProperty/* default */.Z)(this, "volumelines", null);
225
225
 
226
226
  this._sceneView = scenceView;
227
227
  this._layerManager = scenceView._layerManager;
@@ -250,13 +250,8 @@ class WindySlicingViewModel {
250
250
 
251
251
  switch (key) {
252
252
  case "mode":
253
- that.removeInputAction();
254
-
255
- if (this._volumePrimitive) {
256
- this._viewer.scene.primitives.remove(this._volumePrimitive);
257
-
258
- this._volumePrimitive = null;
259
- }
253
+ this.removeInputAction();
254
+ this.removeVolumePrimitive();
260
255
 
261
256
  if (this._options.mode === "point") {
262
257
  this._windySlicingDrawManager.stopDraw();
@@ -282,12 +277,34 @@ class WindySlicingViewModel {
282
277
 
283
278
  break;
284
279
 
285
- case "showAxis":
286
- if (this._volumePrimitive) this._volumePrimitive.showAxis(this._options[key]);
280
+ case "slicingType":
281
+ this.removeVolumePrimitive();
282
+
283
+ if (this._options.slicingType == 1) {
284
+ if (this._options.styleType == "1") {
285
+ if (this._currentVolumePosition) this.windySlicingRectangleSlicing(this._currentVolumePosition);
286
+ }
287
+ } else {
288
+ this.windyVoxelsSingleSlicing();
289
+ }
290
+
287
291
  break;
288
292
 
289
- case "slicingType":
290
- this.windyVoxelsSingleSlicing();
293
+ case "styleType":
294
+ this.removeVolumePrimitive();
295
+
296
+ if (this._options.styleType == "1") {
297
+ if (this._currentVolumePosition) this.windySlicingRectangleSlicing(this._currentVolumePosition);
298
+ } else {
299
+ if (this._currentVolumePosition) {
300
+ this.windySlicingSurfaceSection(this._currentVolumePosition, this._windySlicingLayerconfig);
301
+ }
302
+ }
303
+
304
+ break;
305
+
306
+ case "showAxis":
307
+ if (this._volumePrimitive) this._volumePrimitive.showAxis(this._options[key]);
291
308
  break;
292
309
 
293
310
  case "enableLayering":
@@ -299,6 +316,18 @@ class WindySlicingViewModel {
299
316
  if (this._volumePrimitive) this._volumePrimitive.scale = this._options[key];
300
317
  break;
301
318
 
319
+ case "altitudeControl":
320
+ this.removeVolumePrimitive();
321
+
322
+ if (this._currentVolumePosition) {
323
+ let layerConfig = JSON.parse(JSON.stringify(this._windySlicingLayerconfig));
324
+ this.windySlicingSurfaceSection(this._currentVolumePosition, Object.assign(layerConfig, {
325
+ zValues: val
326
+ }));
327
+ }
328
+
329
+ break;
330
+
302
331
  case "destroy":
303
332
  this.destroy();
304
333
  break;
@@ -310,7 +339,7 @@ class WindySlicingViewModel {
310
339
 
311
340
 
312
341
  setEnableLayeringVisible() {
313
- let zValues = this._windySlicingLayerconfig?.params?.zValues;
342
+ let zValues = this._windySlicingLayerconfig?.zValues;
314
343
  let zVisibles = [];
315
344
 
316
345
  if (this._options?.enableLayering) {
@@ -322,7 +351,7 @@ class WindySlicingViewModel {
322
351
  }
323
352
  }
324
353
 
325
- this._volumePrimitive.updateVisibles(this.currentSlicingUnit == 'hpa' ? zVisibles.reverse() : zVisibles);
354
+ this._volumePrimitive.updateVisibles(this._windySlicingLayerconfig.unit == 'hpa' ? zVisibles.reverse() : zVisibles);
326
355
  } else {
327
356
  for (let i = zValues.length; i > 0; i--) {
328
357
  zVisibles.push(false);
@@ -348,16 +377,41 @@ class WindySlicingViewModel {
348
377
  console.warn('未找到匹配的气象剖切图层配置');
349
378
  }
350
379
 
351
- let groups = this._layerManager._windyViewModel?._PRODUCT_CONFIG[this._windySlicingLayerconfig?.params?.productType]?.groups ?? [];
380
+ this._windySlicingLayerconfig.groups = this._layerManager._windyViewModel?._PRODUCT_CONFIG[this._windySlicingLayerconfig?.params?.productType]?.groups ?? [];
381
+ this._windySlicingLayerconfig.colors = this._layerManager._windyViewModel?._PRODUCT_CONFIG[this._windySlicingLayerconfig?.params?.productType]?.colors ?? [];
382
+ this._windySlicingLayerconfig.ranges = this._layerManager._windyViewModel?._PRODUCT_CONFIG[this._windySlicingLayerconfig?.params?.productType]?.ranges ?? [];
383
+ this._windySlicingLayerconfig.unit = "m";
352
384
 
353
- if (groups.includes("AIR_PRESSURE")) {
354
- this.currentSlicingUnit = "hpa";
385
+ if (this._windySlicingLayerconfig.groups.includes("AIR_PRESSURE")) {
386
+ this._windySlicingLayerconfig.unit = "hpa";
355
387
  }
356
388
 
357
- this.callbackParams && this.callbackParams("enableLayerings", this._windySlicingLayerconfig?.params?.zValues ?? []);
358
- this.callbackParams && this.callbackParams("currentSlicingUnit", this.currentSlicingUnit);
389
+ this._windySlicingLayerconfig.zValues = this._windySlicingLayerconfig?.zValues ?? this._windySlicingLayerconfig?.params?.zValues ?? [];
390
+ this.callbackParams && this.callbackParams("slicingLayerConfig", this._windySlicingLayerconfig);
359
391
  return this._windySlicingLayerconfig;
360
- }
392
+ } // 清除剖切分析实例
393
+
394
+
395
+ removeVolumePrimitive() {
396
+ if (this._volumePrimitive) {
397
+ this._viewer.scene.primitives.remove(this._volumePrimitive);
398
+
399
+ this._volumePrimitive = null;
400
+ }
401
+
402
+ if (this._volumePrimitive1) {
403
+ this._viewer.scene.primitives.remove(this._volumePrimitive1);
404
+
405
+ this._volumePrimitive1 = null;
406
+ }
407
+
408
+ if (this._volumePrimitive2) {
409
+ this._viewer.scene.primitives.remove(this._volumePrimitive2);
410
+
411
+ this._volumePrimitive2 = null;
412
+ }
413
+ } // 清除左右鼠标点击事件及弹框
414
+
361
415
 
362
416
  removeInputAction() {
363
417
  if (this._windySlicingPolylineHandler) {
@@ -423,13 +477,7 @@ class WindySlicingViewModel {
423
477
  let that = this;
424
478
  let X = window.Cesium.Math.toDegrees(cartographic.longitude);
425
479
  let Y = window.Cesium.Math.toDegrees(cartographic.latitude);
426
- let groups = this._layerManager._windyViewModel._PRODUCT_CONFIG[this._windySlicingLayerconfig?.params?.productType]?.groups ?? [];
427
- let unit = 'm';
428
-
429
- if (groups.includes("AIR_PRESSURE")) {
430
- unit = "hpa";
431
- }
432
-
480
+ let unit = this._windySlicingLayerconfig.unit;
433
481
  let data = {
434
482
  "collectionName": that._windySlicingLayerconfig?.params?.layer,
435
483
  "point": {
@@ -517,13 +565,11 @@ class WindySlicingViewModel {
517
565
  } // 重构剖切参数
518
566
 
519
567
 
520
- getSlicingParams(position) {
568
+ getSlicingParams(position, params) {
521
569
  this._currentVolumePosition = position;
522
570
  if (!this._windySlicingLayerconfig) return;
523
- let proConfig = this._layerManager._windyViewModel._PRODUCT_CONFIG;
524
- if (!proConfig) return;
525
- let colors = proConfig[this._windySlicingLayerconfig?.params?.productType]?.colors;
526
- let ranges = proConfig[this._windySlicingLayerconfig?.params?.productType]?.ranges;
571
+ let colors = this._windySlicingLayerconfig?.colors ?? [];
572
+ let ranges = this._windySlicingLayerconfig?.ranges ?? [];
527
573
  let img = colors && this.generateImage(colors);
528
574
  if (!img) return;
529
575
  this._currentVolumeOption = {
@@ -532,21 +578,14 @@ class WindySlicingViewModel {
532
578
  collectionName: this._windySlicingLayerconfig?.params?.layer,
533
579
  image: img,
534
580
  // 高度偏移
535
- offset: 0,
581
+ offset: 10000,
536
582
  // 高度放大比例
537
- scale: this.currentSlicingUnit == 'hpa' ? 18 : 300,
538
- unit: this.currentSlicingUnit,
583
+ scale: this._windySlicingLayerconfig.unit == 'hpa' ? 18 : 300,
584
+ unit: this._windySlicingLayerconfig.unit,
539
585
  attrRange: [ranges[0], ranges[ranges.length - 1]],
540
586
  varName: this._windySlicingLayerconfig?.params?.varNames
541
587
  };
542
-
543
- if (this._volumePrimitive) {
544
- this._viewer.scene.primitives.remove(this._volumePrimitive);
545
-
546
- this._volumePrimitive = null;
547
- }
548
-
549
- this._volumePrimitive = new Cesium.Kq3dGridVolumeProvider(this._currentVolumeOption);
588
+ return new Cesium.Kq3dGridVolumeProvider(Object.assign({}, this._currentVolumeOption, params || {}));
550
589
  }
551
590
  /**
552
591
  * 创建线剖切
@@ -555,10 +594,13 @@ class WindySlicingViewModel {
555
594
 
556
595
 
557
596
  windySlicingPolylineSlicing(polyline) {
558
- this.getSlicingParams(polyline);
559
-
560
- this._volumePrimitive.showSection(polyline); // this._volumePrimitives.push(gridVolumePolyline)
597
+ this._volumePrimitive = this.getSlicingParams(polyline);
598
+ let that = this;
599
+ if (!this._volumePrimitive || !this._volumePrimitive.readyPromise) return;
561
600
 
601
+ this._volumePrimitive.readyPromise.then(() => {
602
+ that._volumePrimitive.showSection(polyline);
603
+ });
562
604
 
563
605
  this.setViewEntity(calculateBoundingBox(polyline)); // 核心计算方法
564
606
 
@@ -589,17 +631,169 @@ class WindySlicingViewModel {
589
631
  }
590
632
  }
591
633
  /**
592
- * 面剖切
634
+ * 面剖切-面分层
593
635
  * @param {Object} rect 矩形四至
594
636
  */
595
637
 
596
638
 
597
639
  windySlicingRectangleSlicing(rect) {
598
- this.getSlicingParams(rect);
640
+ this._volumePrimitive = this.getSlicingParams(rect);
641
+ let that = this;
642
+ if (!this._volumePrimitive || !this._volumePrimitive.readyPromise) return;
643
+
644
+ this._volumePrimitive.readyPromise.then(() => {
645
+ that._volumePrimitive.showSections(rect);
646
+ });
647
+
648
+ this.setViewEntity(rect);
649
+ }
650
+ /**
651
+ * 面剖切-面剖
652
+ * @param {Object} rect 矩形四至
653
+ */
654
+
655
+
656
+ windySlicingSurfaceSection(rect, data) {
657
+ let options = {};
658
+ let zValues = JSON.parse(JSON.stringify(data.zValues));
599
659
 
600
- this._volumePrimitive.showSections(rect);
660
+ if (!zValues || zValues?.length == 0) {
661
+ zValues = JSON.parse(JSON.stringify(data.ranges));
662
+ }
663
+
664
+ let index = zValues.length - 1;
665
+
666
+ if (data.unit != 'hpa') {
667
+ // options.isReverse = true;
668
+ index = 0;
669
+ zValues = zValues.sort((a, b) => a - b);
670
+ } else {
671
+ zValues = zValues.sort((a, b) => b - a);
672
+ }
673
+
674
+ options.zValues = zValues;
675
+ options.showAxis = true;
676
+ this._volumePrimitive = this.getSlicingParams(rect, options);
677
+ let that = this;
678
+ if (!this._volumePrimitive || !this._volumePrimitive.readyPromise) return;
679
+
680
+ this._volumePrimitive.readyPromise.then(() => {
681
+ if (typeof index != 'undefined') {
682
+ that._volumePrimitive.showPolygonSection(rect, index);
683
+ } else {
684
+ that._volumePrimitive.showPolygonSection(rect);
685
+ }
686
+ });
687
+
688
+ let options1 = JSON.parse(JSON.stringify(options));
689
+ this.volumelines = this.createXYVolume(this.getRectangle(rect));
690
+ options1.showAxis = false;
691
+ this._volumePrimitive1 = this.getSlicingParams(rect, options1);
692
+ if (!this._volumePrimitive1 || !this._volumePrimitive1.readyPromise) return;
693
+
694
+ this._volumePrimitive1.readyPromise.then(() => {
695
+ that._volumePrimitive1.showSection(that.volumelines?.volumeLine1);
696
+ });
697
+
698
+ this._volumePrimitive2 = this.getSlicingParams(rect, options1);
699
+ if (!this._volumePrimitive2 || !this._volumePrimitive2.readyPromise) return;
700
+
701
+ this._volumePrimitive2.readyPromise.then(() => {
702
+ that._volumePrimitive2.showSection(that.volumelines?.volumeLine2);
703
+ });
601
704
 
602
705
  this.setViewEntity(rect);
706
+ }
707
+
708
+ getRectangle(rect) {
709
+ if (typeof rect == 'string') {
710
+ rect = JSON.parse(rect);
711
+ }
712
+
713
+ let rectangle = new Cesium.Rectangle(Cesium.Math.toRadians(rect.minX), Cesium.Math.toRadians(rect.minY), Cesium.Math.toRadians(rect.maxX), Cesium.Math.toRadians(rect.maxY));
714
+ return rectangle;
715
+ }
716
+
717
+ createXYVolume(rectangle) {
718
+ // 获取矩形的四个角点
719
+ var southwest = Cesium.Rectangle.southwest(rectangle); // 西南角经纬度
720
+
721
+ var northwest = Cesium.Rectangle.northwest(rectangle); // 西北角经纬度
722
+
723
+ var northeast = Cesium.Rectangle.northeast(rectangle); // 东北角经纬度
724
+
725
+ var southeast = Cesium.Rectangle.southeast(rectangle); // 东南角经纬度
726
+
727
+ let line1 = [];
728
+ let line2 = [];
729
+ let line3 = [];
730
+ let line4 = []; // 上线
731
+
732
+ line1.push({
733
+ longitude: northeast.longitude / Math.PI * 180,
734
+ latitude: northeast.latitude / Math.PI * 180
735
+ });
736
+ line1.push({
737
+ longitude: northwest.longitude / Math.PI * 180,
738
+ latitude: northwest.latitude / Math.PI * 180
739
+ }); // 下线
740
+
741
+ line2.push({
742
+ longitude: southeast.longitude / Math.PI * 180,
743
+ latitude: southeast.latitude / Math.PI * 180
744
+ });
745
+ line2.push({
746
+ longitude: southwest.longitude / Math.PI * 180,
747
+ latitude: southwest.latitude / Math.PI * 180
748
+ }); // 左线
749
+
750
+ line3.push({
751
+ longitude: northeast.longitude / Math.PI * 180,
752
+ latitude: northeast.latitude / Math.PI * 180
753
+ });
754
+ line3.push({
755
+ longitude: southeast.longitude / Math.PI * 180,
756
+ latitude: southeast.latitude / Math.PI * 180
757
+ }); // 右线
758
+
759
+ line4.push({
760
+ longitude: northwest.longitude / Math.PI * 180,
761
+ latitude: northwest.latitude / Math.PI * 180
762
+ });
763
+ line4.push({
764
+ longitude: southwest.longitude / Math.PI * 180,
765
+ latitude: southwest.latitude / Math.PI * 180
766
+ });
767
+ let volumeLine1 = [],
768
+ volumeLine2 = [];
769
+ volumeLine1.push(this.getLineCenter(line1[0], line1[1]));
770
+ volumeLine1.push(this.getLineCenter(line2[0], line2[1]));
771
+ volumeLine2.push(this.getLineCenter(line3[0], line3[1]));
772
+ volumeLine2.push(this.getLineCenter(line4[0], line4[1]));
773
+ return {
774
+ line1,
775
+ line2,
776
+ line3,
777
+ line4,
778
+ volumeLine1,
779
+ volumeLine2
780
+ };
781
+ } // 获取线段中心点
782
+
783
+
784
+ getLineCenter(startPoint, endPoint) {
785
+ startPoint = Cesium.Cartesian3.fromDegrees(startPoint.longitude, startPoint.latitude);
786
+ endPoint = Cesium.Cartesian3.fromDegrees(endPoint.longitude, endPoint.latitude); // 计算线段中心点
787
+
788
+ let centerPoint = Cesium.Cartesian3.add(startPoint, endPoint, new Cesium.Cartesian3());
789
+ centerPoint = Cesium.Cartesian3.divideByScalar(centerPoint, 2.0, new Cesium.Cartesian3()); // 将中心点转换为经纬度
790
+
791
+ let centerPointCartographic = Cesium.Cartographic.fromCartesian(centerPoint);
792
+ let centerPointLatLon = {
793
+ y: Cesium.Math.toDegrees(centerPointCartographic.latitude),
794
+ x: Cesium.Math.toDegrees(centerPointCartographic.longitude)
795
+ };
796
+ return centerPointLatLon;
603
797
  } // 体剖切
604
798
 
605
799
 
@@ -609,15 +803,14 @@ class WindySlicingViewModel {
609
803
  return;
610
804
  }
611
805
 
612
- if (this._volumePrimitive) {
613
- this._viewer.scene.primitives.remove(this._volumePrimitive);
614
-
615
- this._volumePrimitive = null;
616
- }
617
-
618
806
  if (this._currentVolumeOption && this._currentVolumePosition) {
619
- this._volumePrimitive = new Cesium.Kq3dGridVoxelsSingleProviderExt(this.options);
620
- this.volumePrimitive.showVoxels(rect);
807
+ this._volumePrimitive = new Cesium.Kq3dGridVoxelsSingleProviderExt(this._currentVolumeOption);
808
+ let that = this;
809
+ if (!this._volumePrimitive || !this._volumePrimitive.readyPromise) return;
810
+
811
+ this._volumePrimitive.readyPromise.then(() => {
812
+ that._volumePrimitive.showVoxels(that._currentVolumePosition);
813
+ });
621
814
  }
622
815
  } // 设置entity视角缩放
623
816
 
@@ -674,15 +867,17 @@ class WindySlicingViewModel {
674
867
 
675
868
 
676
869
  clear() {
677
- if (this._volumePrimitive) this._viewer.scene.primitives.remove(this._volumePrimitive);
870
+ this.removeVolumePrimitive();
678
871
  this.removeInputAction();
679
872
  this._isDrawPolyline = false;
680
- this._viewer.scene.globe.showGroundAtmosphere = true;
681
- this._viewer.scene.screenSpaceCameraController.maximumZoomDistance = Number.POSITIVE_INFINITY;
682
873
 
683
874
  this._windySlicingDrawManager.stopDraw();
684
875
 
685
876
  this._windySlicingDrawManager.clear();
877
+
878
+ this._currentVolumePosition = null;
879
+ this._currentVolumeOption = null;
880
+ this.volumelines = null;
686
881
  } //销毁
687
882
 
688
883
 
@@ -695,6 +890,9 @@ class WindySlicingViewModel {
695
890
  this._windySlicingRemoveEventListener && this._windySlicingRemoveEventListener();
696
891
  this._windySlicingRemoveEventListener = null;
697
892
  }
893
+
894
+ this._viewer.scene.globe.showGroundAtmosphere = true;
895
+ this._viewer.scene.screenSpaceCameraController.maximumZoomDistance = Number.POSITIVE_INFINITY;
698
896
  }
699
897
 
700
898
  }
@@ -800,23 +998,37 @@ const __default__ = {
800
998
  maxLayerScale: props.settingParams?.maxLayerScale ?? 300,
801
999
  // 分层缩放最大值
802
1000
  altitudeControl: props.settingParams?.altitudeControl ?? 50,
1001
+ // 高度控制
1002
+ maxAltitudeControl: props.settingParams?.maxAltitudeControl ?? 100,
1003
+ // 高度控制
803
1004
  enableLongSection: props.settingParams?.enableLongSection ?? true,
804
1005
  // 是否启动经度剖面
805
1006
  longSectionValue: props.settingParams?.longSectionValue ?? 50,
806
1007
  // 经度剖面值
1008
+ longSectionValueStep: 1,
1009
+ longSectionValueMin: 1,
1010
+ longSectionValueMax: 10,
807
1011
  enableLatSection: props.settingParams?.enableLatSection ?? true,
808
1012
  // 是否启动纬度剖面
809
1013
  latSectionValue: props.settingParams?.latSectionValue ?? 50,
810
1014
  // 纬度剖面值
1015
+ latSectionValueStep: 1,
1016
+ latSectionValueMin: 1,
1017
+ latSectionValueMax: 10,
811
1018
  enableHeightSection: props.settingParams?.enableHeightSection ?? true,
812
1019
  // 高度剖面
1020
+ heightSectionValueMax: 10,
1021
+ //高度剖面最大值
813
1022
  heightSectionValue: props.settingParams?.heightSectionValue ?? 50,
814
1023
  // 等值面高度
815
1024
  bodyDissectionAxis: props.settingParams?.bodyDissectionAxis ?? true,
816
1025
  // 体剖切刻度线
817
1026
  bodyDissectionAlpha: props.settingParams?.bodyDissectionAlpha ?? 1 //体剖切透明度
818
1027
 
819
- });
1028
+ }); // 创建深度复制
1029
+
1030
+ let formItemDef = JSON.parse(JSON.stringify(formItem));
1031
+ delete formItemDef.collapseValue;
820
1032
  let viewModel = null; // 组件容器Ref
821
1033
 
822
1034
  let boxRef = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.ref)(null); // 生成组件默认header
@@ -873,8 +1085,8 @@ const __default__ = {
873
1085
 
874
1086
 
875
1087
  const handleWindyTypeChange = data => {
876
- console.log(data);
877
1088
  clear();
1089
+ Object.assign(formItem, formItemDef);
878
1090
 
879
1091
  if (data?.windyType == "exit") {
880
1092
  showWindySlicing.value = false;
@@ -893,14 +1105,19 @@ const __default__ = {
893
1105
  showSlicingSetting.value = val;
894
1106
  break;
895
1107
 
896
- case "enableLayerings":
897
- enableLayerings.value = val;
898
- formItem.enableLayerings = val;
899
- viewModel._options["enableLayerings"] = val;
900
- break;
1108
+ case "slicingLayerConfig":
1109
+ if (!Array.isArray(val.zValues) || val.zValues.length === 0) {
1110
+ showWindySlicing.value = false;
1111
+ } else {
1112
+ showWindySlicing.value = true;
1113
+ enableLayerings.value = val.zValues;
1114
+ formItem.enableLayerings = val.zValues;
1115
+ viewModel._options["enableLayerings"] = val.zValues;
1116
+ formItem.altitudeControl = val.zValues.length;
1117
+ formItem.maxAltitudeControl = val.zValues.length;
1118
+ }
901
1119
 
902
- case "currentSlicingUnit":
903
- unit.value = val;
1120
+ unit.value = val.unit;
904
1121
  break;
905
1122
 
906
1123
  default:
@@ -917,33 +1134,67 @@ const __default__ = {
917
1134
  formItem.mode = mode;
918
1135
  viewModel._options.mode = formItem.mode;
919
1136
  viewModel && viewModel.paramsChanged("mode");
1137
+
1138
+ if (mode == "delete") {
1139
+ Object.assign(formItem, formItemDef);
1140
+ }
920
1141
  }
921
1142
  }
922
1143
 
923
1144
  function paramsChanged(key) {
924
- if (!viewModel) return; // 统一使用可选链操作符和空值合并运算符处理参数更新
925
-
926
- viewModel._options[key] = formItem[key];
927
- viewModel.paramsChanged?.(key); // 使用可选链调用方法
928
- // 处理 slicingType 的特殊逻辑
929
-
930
- if (key === "slicingType") {
931
- const VALID_SLICING_TYPES = {
932
- 1: "1",
933
- 3: "3"
934
- };
935
- const newStyleType = VALID_SLICING_TYPES[formItem.slicingType];
936
-
937
- if (newStyleType) {
938
- // 同时更新表单数据和 viewModel 配置
939
- viewModel._options.styleType = formItem.styleType = newStyleType;
940
- }
1145
+ if (!viewModel) return;
1146
+ viewModel._options[key] = formItem[key]; // 处理 slicingType 的特殊逻辑
1147
+
1148
+ let defaultValues = null;
1149
+
1150
+ switch (key) {
1151
+ case "slicingType":
1152
+ const VALID_SLICING_TYPES = {
1153
+ 1: "1",
1154
+ 3: "3"
1155
+ };
1156
+ const newStyleType = VALID_SLICING_TYPES[formItem.slicingType];
1157
+
1158
+ if (newStyleType) {
1159
+ viewModel._options.styleType = formItem.styleType = newStyleType;
1160
+ }
1161
+
1162
+ break;
1163
+
1164
+ case "altitudeControl":
1165
+ let gdzValues = enableLayerings.value.slice(0, formItem.altitudeControl);
1166
+ formItem.heightSectionValueMax = gdzValues.length;
1167
+ defaultValues = gdzValues;
1168
+ if (!viewModel?.volumelines) return;
1169
+ let jdValue = Math.abs(viewModel?.volumelines.line1[0].longitude - viewModel?.volumelines.line1[1].longitude);
1170
+ jdValue = jdValue.toFixed(3);
1171
+ formItem.longSectionValueStep = jdValue / 100;
1172
+ formItem.longSectionValueMin = -(jdValue / 2);
1173
+ formItem.longSectionValueMax = jdValue / 2;
1174
+ formItem.longSectionValue = 0;
1175
+ let wdValue = Math.abs(viewModel?.volumelines.line4[0].latitude - viewModel?.volumelines.line4[1].latitude);
1176
+ wdValue = wdValue.toFixed(3);
1177
+ formItem.latSectionValueStep = wdValue / 100;
1178
+ formItem.latSectionValueMin = -(wdValue / 2);
1179
+ formItem.latSectionValueMax = wdValue / 2;
1180
+ formItem.latSectionValue = 0;
1181
+ break;
1182
+
1183
+ default:
1184
+ break;
941
1185
  }
1186
+
1187
+ viewModel.paramsChanged?.(key, defaultValues); // 使用可选链调用方法
942
1188
  }
943
1189
 
944
1190
  function clear() {
945
1191
  showSlicingSetting.value = false;
946
1192
  viewModel && viewModel.clear();
1193
+ } // 显示提示信息
1194
+
1195
+
1196
+ function formatTooltip(val) {
1197
+ return enableLayerings.value[val - 1] + unit.value;
947
1198
  } // 销毁
948
1199
 
949
1200
 
@@ -1346,14 +1597,14 @@ const __default__ = {
1346
1597
  default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_slider, {
1347
1598
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).altitudeControl,
1348
1599
  "onUpdate:modelValue": _cache[18] || (_cache[18] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).altitudeControl = $event),
1349
- "show-tooltip": false,
1350
1600
  step: 1,
1351
- min: 0,
1352
- max: 100,
1601
+ min: 1,
1602
+ "format-tooltip": formatTooltip,
1603
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).maxAltitudeControl,
1353
1604
  onChange: _cache[19] || (_cache[19] = $event => paramsChanged('altitudeControl'))
1354
1605
  }, null, 8
1355
1606
  /* PROPS */
1356
- , ["modelValue"])]),
1607
+ , ["modelValue", "max"])]),
1357
1608
  _: 1
1358
1609
  /* STABLE */
1359
1610
 
@@ -1363,14 +1614,14 @@ const __default__ = {
1363
1614
  default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_input_number, {
1364
1615
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).altitudeControl,
1365
1616
  "onUpdate:modelValue": _cache[20] || (_cache[20] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).altitudeControl = $event),
1366
- min: 0,
1367
- max: 100,
1617
+ min: 1,
1618
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).maxAltitudeControl,
1368
1619
  step: 1,
1369
1620
  "controls-position": "right",
1370
1621
  onChange: _cache[21] || (_cache[21] = $event => paramsChanged('altitudeControl'))
1371
1622
  }, null, 8
1372
1623
  /* PROPS */
1373
- , ["modelValue"])]),
1624
+ , ["modelValue", "max"])]),
1374
1625
  _: 1
1375
1626
  /* STABLE */
1376
1627
 
@@ -1427,13 +1678,13 @@ const __default__ = {
1427
1678
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValue,
1428
1679
  "onUpdate:modelValue": _cache[23] || (_cache[23] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValue = $event),
1429
1680
  "show-tooltip": false,
1430
- step: 1,
1431
- min: 0,
1432
- max: 100,
1681
+ step: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValueStep,
1682
+ min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValueMin,
1683
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValueMax,
1433
1684
  onChange: _cache[24] || (_cache[24] = $event => paramsChanged('longSectionValue'))
1434
1685
  }, null, 8
1435
1686
  /* PROPS */
1436
- , ["modelValue"])]),
1687
+ , ["modelValue", "step", "min", "max"])]),
1437
1688
  _: 1
1438
1689
  /* STABLE */
1439
1690
 
@@ -1443,14 +1694,14 @@ const __default__ = {
1443
1694
  default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_input_number, {
1444
1695
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValue,
1445
1696
  "onUpdate:modelValue": _cache[25] || (_cache[25] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValue = $event),
1446
- min: 0,
1447
- max: 100,
1448
- step: 1,
1697
+ step: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValueStep,
1698
+ min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValueMin,
1699
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).longSectionValueMax,
1449
1700
  "controls-position": "right",
1450
1701
  onChange: _cache[26] || (_cache[26] = $event => paramsChanged('longSectionValue'))
1451
1702
  }, null, 8
1452
1703
  /* PROPS */
1453
- , ["modelValue"])]),
1704
+ , ["modelValue", "step", "min", "max"])]),
1454
1705
  _: 1
1455
1706
  /* STABLE */
1456
1707
 
@@ -1507,13 +1758,13 @@ const __default__ = {
1507
1758
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValue,
1508
1759
  "onUpdate:modelValue": _cache[28] || (_cache[28] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValue = $event),
1509
1760
  "show-tooltip": false,
1510
- step: 1,
1511
- min: 0,
1512
- max: 100,
1761
+ step: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValueStep,
1762
+ min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValueMin,
1763
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValueMax,
1513
1764
  onChange: _cache[29] || (_cache[29] = $event => paramsChanged('latSectionValue'))
1514
1765
  }, null, 8
1515
1766
  /* PROPS */
1516
- , ["modelValue"])]),
1767
+ , ["modelValue", "step", "min", "max"])]),
1517
1768
  _: 1
1518
1769
  /* STABLE */
1519
1770
 
@@ -1523,14 +1774,14 @@ const __default__ = {
1523
1774
  default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_input_number, {
1524
1775
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValue,
1525
1776
  "onUpdate:modelValue": _cache[30] || (_cache[30] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValue = $event),
1526
- min: 0,
1527
- max: 100,
1528
- step: 1,
1777
+ step: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValueStep,
1778
+ min: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValueMin,
1779
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).latSectionValueMax,
1529
1780
  "controls-position": "right",
1530
1781
  onChange: _cache[31] || (_cache[31] = $event => paramsChanged('latSectionValue'))
1531
1782
  }, null, 8
1532
1783
  /* PROPS */
1533
- , ["modelValue"])]),
1784
+ , ["modelValue", "step", "min", "max"])]),
1534
1785
  _: 1
1535
1786
  /* STABLE */
1536
1787
 
@@ -1589,11 +1840,11 @@ const __default__ = {
1589
1840
  "show-tooltip": false,
1590
1841
  step: 1,
1591
1842
  min: 0,
1592
- max: 100,
1843
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).heightSectionValueMax,
1593
1844
  onChange: _cache[34] || (_cache[34] = $event => paramsChanged('heightSectionValue'))
1594
1845
  }, null, 8
1595
1846
  /* PROPS */
1596
- , ["modelValue"])]),
1847
+ , ["modelValue", "max"])]),
1597
1848
  _: 1
1598
1849
  /* STABLE */
1599
1850
 
@@ -1603,14 +1854,14 @@ const __default__ = {
1603
1854
  default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_input_number, {
1604
1855
  modelValue: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).heightSectionValue,
1605
1856
  "onUpdate:modelValue": _cache[35] || (_cache[35] = $event => (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).heightSectionValue = $event),
1606
- min: 0,
1607
- max: 100,
1608
1857
  step: 1,
1858
+ min: 0,
1859
+ max: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).heightSectionValueMax,
1609
1860
  "controls-position": "right",
1610
1861
  onChange: _cache[36] || (_cache[36] = $event => paramsChanged('heightSectionValue'))
1611
1862
  }, null, 8
1612
1863
  /* PROPS */
1613
- , ["modelValue"])]),
1864
+ , ["modelValue", "max"])]),
1614
1865
  _: 1
1615
1866
  /* STABLE */
1616
1867
 
@@ -1630,7 +1881,7 @@ const __default__ = {
1630
1881
 
1631
1882
  })], 64
1632
1883
  /* STABLE_FRAGMENT */
1633
- )) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)("v-if", true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)(" 提剖切设置 "), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).slicingType === 3 ? ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.Fragment, {
1884
+ )) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)("v-if", true), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createCommentVNode)(" 体剖切设置 "), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.unref)(formItem).slicingType === 3 ? ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createElementBlock)(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.Fragment, {
1634
1885
  key: 2
1635
1886
  }, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_.createVNode)(_component_kq_row, {
1636
1887
  class: "rowclass"