ym-giswidget-2d 1.0.5 → 1.0.8

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 (80) hide show
  1. package/_virtual/_commonjs-dynamic-modules.js +6 -0
  2. package/_virtual/_commonjsHelpers.js +8 -0
  3. package/_virtual/jszip.min.js +4 -0
  4. package/components/clear/Clear.vue.d.ts +6 -0
  5. package/components/clear/Clear.vue.js +19 -0
  6. package/components/clear/Clear.vue2.js +4 -0
  7. package/components/clear/index.d.ts +6 -0
  8. package/components/clear/index.js +8 -0
  9. package/components/draw/Draw.vue.d.ts +6 -0
  10. package/components/draw/Draw.vue.js +71 -0
  11. package/components/draw/Draw.vue2.js +4 -0
  12. package/components/draw/index.d.ts +6 -0
  13. package/components/draw/index.js +8 -0
  14. package/components/export/Export.vue.d.ts +154 -0
  15. package/components/export/Export.vue.js +7 -0
  16. package/components/export/Export.vue2.js +298 -0
  17. package/components/export/index.css +3 -0
  18. package/components/export/index.d.ts +154 -0
  19. package/components/export/index.js +8 -0
  20. package/components/horizontally-top-toolbar/{horizontallyTopToolbar.vue.js → HorizontallyTopToolbar.vue.js} +2 -2
  21. package/components/horizontally-top-toolbar/{horizontallyTopToolbar.vue2.js → HorizontallyTopToolbar.vue2.js} +3 -3
  22. package/components/horizontally-top-toolbar/index.css +9 -9
  23. package/components/horizontally-top-toolbar/index.js +1 -1
  24. package/components/identify/Identify.vue.d.ts +13 -0
  25. package/components/identify/Identify.vue.js +96 -0
  26. package/components/identify/Identify.vue2.js +4 -0
  27. package/components/identify/index.d.ts +18 -0
  28. package/components/identify/index.js +8 -0
  29. package/components/import/Import.vue.d.ts +13 -0
  30. package/components/import/Import.vue.js +162 -0
  31. package/components/import/Import.vue2.js +4 -0
  32. package/components/import/index.d.ts +15 -0
  33. package/components/import/index.js +8 -0
  34. package/components/layer-tree/{layerTree.vue.d.ts → LayerTree.vue.d.ts} +212 -186
  35. package/components/layer-tree/{layerTree.vue.js → LayerTree.vue.js} +2 -2
  36. package/components/layer-tree/{layerTree.vue2.js → LayerTree.vue2.js} +2 -2
  37. package/components/layer-tree/index.css +11 -11
  38. package/components/layer-tree/index.d.ts +194 -184
  39. package/components/layer-tree/index.js +1 -1
  40. package/components/multi-screen/MultiScreen.vue.d.ts +425 -0
  41. package/components/multi-screen/MultiScreen.vue2.js +1 -1
  42. package/components/multi-screen/index.d.ts +426 -0
  43. package/components/multi-screen-panel/PanelMultiScreen.vue2.js +1 -1
  44. package/components/popup/Popup.vue.d.ts +158 -0
  45. package/components/popup/Popup.vue.js +8 -0
  46. package/components/popup/Popup.vue2.js +266 -0
  47. package/components/popup/index.css +61 -0
  48. package/components/popup/index.d.ts +157 -0
  49. package/components/popup/index.js +8 -0
  50. package/components/popup/index2.css +5 -0
  51. package/components/select/Select.vue.d.ts +13 -0
  52. package/components/select/Select.vue.js +142 -0
  53. package/components/select/Select.vue2.js +4 -0
  54. package/components/select/index.d.ts +18 -0
  55. package/components/select/index.js +8 -0
  56. package/components/swipe-layer/SwipeLayer.vue.d.ts +6 -0
  57. package/components/swipe-layer/SwipeLayer.vue.js +24 -0
  58. package/components/swipe-layer/SwipeLayer.vue2.js +4 -0
  59. package/components/swipe-layer/index.d.ts +6 -0
  60. package/components/swipe-layer/index.js +8 -0
  61. package/components/toc-card/{tocCard.vue.js → TocCard.vue.js} +2 -2
  62. package/components/toc-card/{tocCard.vue2.js → TocCard.vue2.js} +2 -2
  63. package/components/toc-card/index.css +1 -1
  64. package/components/toc-card/index.js +1 -1
  65. package/config/Config.d.ts +13 -0
  66. package/config/Config.js +8 -0
  67. package/css/index.css +64 -14
  68. package/http/Axios.d.ts +14 -0
  69. package/http/Axios.js +37 -0
  70. package/http/LayerField.js +29 -0
  71. package/http/SpaceFile.d.ts +3 -0
  72. package/http/SpaceFile.js +38 -0
  73. package/http/layerField.d.ts +19 -0
  74. package/index.d.ts +7 -0
  75. package/index.js +14 -0
  76. package/package.json +2 -2
  77. package/panel/DraggablePanel.vue.d.ts +82 -0
  78. package/panel/DraggablePanel.vue2.js +1 -1
  79. /package/components/horizontally-top-toolbar/{horizontallyTopToolbar.vue.d.ts → HorizontallyTopToolbar.vue.d.ts} +0 -0
  80. /package/components/toc-card/{tocCard.vue.d.ts → TocCard.vue.d.ts} +0 -0
@@ -0,0 +1,8 @@
1
+ import "./index.css";
2
+ import { withInstall } from "../../utils/wthInstall.js";
3
+ import _sfc_main from "./Select.vue.js";
4
+ const Select = withInstall(_sfc_main);
5
+ export {
6
+ Select,
7
+ Select as default
8
+ };
@@ -0,0 +1,6 @@
1
+ import { default as OLMap } from 'ym-giscomm-2d/mapView/Map';
2
+ type __VLS_Props = {
3
+ map: OLMap;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import { defineComponent, onMounted, onUnmounted } from "vue";
2
+ import SwipeLayerControl from "ym-giscomm-2d/controls/SwipeLayerControl";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "SwipeLayer",
5
+ props: {
6
+ map: {}
7
+ },
8
+ setup(__props) {
9
+ const props = __props;
10
+ onMounted(() => {
11
+ const control = new SwipeLayerControl({ swipeLayer: props.map.getAllLayers()[0], dockedVisible: "Right", target: props.map.getTarget() });
12
+ props.map.controlManager.addControl("swipe", control);
13
+ });
14
+ onUnmounted(() => {
15
+ props.map.controlManager.removeControl("swipe");
16
+ });
17
+ return (_ctx, _cache) => {
18
+ return null;
19
+ };
20
+ }
21
+ });
22
+ export {
23
+ _sfc_main as default
24
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./SwipeLayer.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,6 @@
1
+ export declare const SwipeLayer: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
+ map: import('ym-giscomm-2d/mapView/Map').default;
3
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
4
+ map: import('ym-giscomm-2d/mapView/Map').default;
5
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
6
+ export default SwipeLayer;
@@ -0,0 +1,8 @@
1
+ import "./index.css";
2
+ import { withInstall } from "../../utils/wthInstall.js";
3
+ import _sfc_main from "./SwipeLayer.vue.js";
4
+ const SwipeLayer = withInstall(_sfc_main);
5
+ export {
6
+ SwipeLayer,
7
+ SwipeLayer as default
8
+ };
@@ -1,7 +1,7 @@
1
- import _sfc_main from "./tocCard.vue2.js";
1
+ import _sfc_main from "./TocCard.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _TocCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-92118f87"]]);
4
+ const _TocCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cdfeea6d"]]);
5
5
  export {
6
6
  _TocCard as default
7
7
  };
@@ -1,10 +1,10 @@
1
1
  import { ElCard } from "element-plus/es";
2
2
  import "element-plus/es/components/base/style/css";
3
3
  import "element-plus/es/components/card/style/css";
4
- import { defineComponent, openBlock, createBlock, withCtx, createVNode, unref } from "vue";
4
+ import { defineComponent, createBlock, openBlock, withCtx, createVNode, unref } from "vue";
5
5
  import { LayerTree } from "../layer-tree/index.js";
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
- __name: "tocCard",
7
+ __name: "TocCard",
8
8
  props: {
9
9
  data: {},
10
10
  map: {},
@@ -1,4 +1,4 @@
1
- .toc-card[data-v-92118f87] {
1
+ .toc-card[data-v-cdfeea6d] {
2
2
  background-color: var(--system-primary-color);
3
3
  position: absolute;
4
4
  width: 245px;
@@ -1,6 +1,6 @@
1
1
  import "./index.css";
2
2
  import { withInstall } from "../../utils/wthInstall.js";
3
- import _TocCard from "./tocCard.vue.js";
3
+ import _TocCard from "./TocCard.vue.js";
4
4
  const TocCard = withInstall(_TocCard);
5
5
  export {
6
6
  TocCard,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 配置
3
+ */
4
+ export default class Config {
5
+ /**
6
+ * 后端服务地址
7
+ */
8
+ static ServiceUrl: string;
9
+ /**
10
+ * gis数据分析处理服务地址
11
+ */
12
+ static GisServiceUrl: string;
13
+ }
@@ -0,0 +1,8 @@
1
+ const _Config = class _Config {
2
+ };
3
+ _Config.ServiceUrl = "";
4
+ _Config.GisServiceUrl = "";
5
+ let Config = _Config;
6
+ export {
7
+ Config as default
8
+ };
package/css/index.css CHANGED
@@ -1847,10 +1847,6 @@
1847
1847
  text-overflow: ellipsis;
1848
1848
  }
1849
1849
 
1850
- .el-cascader .el-input .el-input__suffix-inner .el-icon {
1851
- height: calc(100% - 2px);
1852
- }
1853
-
1854
1850
  .el-cascader .el-input .el-input__suffix-inner .el-icon svg {
1855
1851
  vertical-align: middle;
1856
1852
  }
@@ -1992,6 +1988,7 @@
1992
1988
 
1993
1989
  .el-cascader__tags .el-tag > span {
1994
1990
  flex: 1;
1991
+ line-height: normal;
1995
1992
  overflow: hidden;
1996
1993
  text-overflow: ellipsis;
1997
1994
  }
@@ -2041,6 +2038,7 @@
2041
2038
 
2042
2039
  .el-cascader__collapse-tags .el-tag > span {
2043
2040
  flex: 1;
2041
+ line-height: normal;
2044
2042
  overflow: hidden;
2045
2043
  text-overflow: ellipsis;
2046
2044
  }
@@ -5918,6 +5916,10 @@
5918
5916
  border-color: var(--el-color-primary);
5919
5917
  }
5920
5918
 
5919
+ .el-color-picker.is-disabled {
5920
+ pointer-events: none;
5921
+ }
5922
+
5921
5923
  .el-color-picker.is-disabled .el-color-picker__trigger {
5922
5924
  cursor: not-allowed;
5923
5925
  }
@@ -6733,6 +6735,7 @@
6733
6735
  background-color: var(--el-disabled-bg-color);
6734
6736
  color: var(--el-disabled-text-color);
6735
6737
  cursor: not-allowed;
6738
+ pointer-events: none;
6736
6739
  }
6737
6740
 
6738
6741
  .el-range-editor.is-disabled, .el-range-editor.is-disabled:focus, .el-range-editor.is-disabled:hover {
@@ -7437,6 +7440,7 @@
7437
7440
  .el-dialog.is-fullscreen {
7438
7441
  --el-dialog-width:100%;
7439
7442
  --el-dialog-margin-top:0;
7443
+ border-radius: 0;
7440
7444
  height: 100%;
7441
7445
  margin-bottom: 0;
7442
7446
  overflow: auto;
@@ -8246,7 +8250,6 @@
8246
8250
 
8247
8251
  .el-image-viewer__btn .el-icon {
8248
8252
  cursor: pointer;
8249
- font-size: inherit;
8250
8253
  }
8251
8254
 
8252
8255
  .el-image-viewer__close {
@@ -8278,7 +8281,6 @@
8278
8281
  left: 50%;
8279
8282
  padding: 0 23px;
8280
8283
  transform: translateX(-50%);
8281
- width: 282px;
8282
8284
  }
8283
8285
 
8284
8286
  .el-image-viewer__actions__inner {
@@ -8287,11 +8289,25 @@
8287
8289
  cursor: default;
8288
8290
  display: flex;
8289
8291
  font-size: 23px;
8292
+ gap: 22px;
8290
8293
  height: 100%;
8291
8294
  justify-content: space-around;
8295
+ padding: 0 6px;
8292
8296
  width: 100%;
8293
8297
  }
8294
8298
 
8299
+ .el-image-viewer__actions__divider {
8300
+ margin: 0 -6px;
8301
+ }
8302
+
8303
+ .el-image-viewer__progress {
8304
+ bottom: 90px;
8305
+ color: #fff;
8306
+ cursor: default;
8307
+ left: 50%;
8308
+ transform: translateX(-50%);
8309
+ }
8310
+
8295
8311
  .el-image-viewer__prev {
8296
8312
  left: 40px;
8297
8313
  }
@@ -8591,8 +8607,11 @@
8591
8607
  box-shadow: 0 0 0 1px var(--el-input-focus-border-color) inset;
8592
8608
  }
8593
8609
 
8594
- .el-input__inner {
8610
+ .el-input {
8595
8611
  --el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);
8612
+ }
8613
+
8614
+ .el-input__inner {
8596
8615
  -webkit-appearance: none;
8597
8616
  background: none;
8598
8617
  border: none;
@@ -8633,6 +8652,7 @@
8633
8652
  flex-shrink: 0;
8634
8653
  flex-wrap: nowrap;
8635
8654
  height: 100%;
8655
+ line-height: var(--el-input-inner-height);
8636
8656
  pointer-events: none;
8637
8657
  text-align: center;
8638
8658
  transition: all var(--el-transition-duration);
@@ -8660,6 +8680,7 @@
8660
8680
  flex-shrink: 0;
8661
8681
  flex-wrap: nowrap;
8662
8682
  height: 100%;
8683
+ line-height: var(--el-input-inner-height);
8663
8684
  pointer-events: none;
8664
8685
  text-align: center;
8665
8686
  transition: all var(--el-transition-duration);
@@ -8702,6 +8723,8 @@
8702
8723
  .el-input.is-disabled .el-input__wrapper {
8703
8724
  background-color: var(--el-disabled-bg-color);
8704
8725
  box-shadow: 0 0 0 1px var(--el-disabled-border-color) inset;
8726
+ cursor: not-allowed;
8727
+ pointer-events: none;
8705
8728
  }
8706
8729
 
8707
8730
  .el-input.is-disabled .el-input__inner {
@@ -8739,7 +8762,7 @@
8739
8762
  padding: 1px 15px;
8740
8763
  }
8741
8764
 
8742
- .el-input--large .el-input__inner {
8765
+ .el-input--large {
8743
8766
  --el-input-inner-height:calc(var(--el-input-height, 40px) - 2px);
8744
8767
  }
8745
8768
 
@@ -8752,7 +8775,7 @@
8752
8775
  padding: 1px 7px;
8753
8776
  }
8754
8777
 
8755
- .el-input--small .el-input__inner {
8778
+ .el-input--small {
8756
8779
  --el-input-inner-height:calc(var(--el-input-height, 24px) - 2px);
8757
8780
  }
8758
8781
 
@@ -8921,6 +8944,10 @@
8921
8944
  width: 40px;
8922
8945
  }
8923
8946
 
8947
+ .el-input-number--large.is-controls-right .el-input--large .el-input__wrapper {
8948
+ padding-right: 47px;
8949
+ }
8950
+
8924
8951
  .el-input-number--large .el-input--large .el-input__wrapper {
8925
8952
  padding-left: 47px;
8926
8953
  padding-right: 47px;
@@ -8936,6 +8963,10 @@
8936
8963
  width: 24px;
8937
8964
  }
8938
8965
 
8966
+ .el-input-number--small.is-controls-right .el-input--small .el-input__wrapper {
8967
+ padding-right: 31px;
8968
+ }
8969
+
8939
8970
  .el-input-number--small .el-input--small .el-input__wrapper {
8940
8971
  padding-left: 31px;
8941
8972
  padding-right: 31px;
@@ -8991,6 +9022,7 @@
8991
9022
 
8992
9023
  .el-input-tag {
8993
9024
  --el-input-tag-border-color-hover:var(--el-border-color-hover);
9025
+ --el-input-tag-placeholder-color:var(--el-text-color-placeholder);
8994
9026
  --el-input-tag-disabled-color:var(--el-disabled-text-color);
8995
9027
  --el-input-tag-disabled-border:var(--el-disabled-border-color);
8996
9028
  --el-input-tag-font-size:var(--el-font-size-base);
@@ -9030,6 +9062,7 @@
9030
9062
  .el-input-tag.is-disabled {
9031
9063
  background-color: var(--el-fill-color-light);
9032
9064
  cursor: not-allowed;
9065
+ pointer-events: none;
9033
9066
  }
9034
9067
 
9035
9068
  .el-input-tag.is-disabled, .el-input-tag.is-disabled:hover {
@@ -9127,6 +9160,14 @@
9127
9160
  width: 100%;
9128
9161
  }
9129
9162
 
9163
+ .el-input-tag__input::-moz-placeholder {
9164
+ color: var(--el-input-tag-placeholder-color);
9165
+ }
9166
+
9167
+ .el-input-tag__input::placeholder {
9168
+ color: var(--el-input-tag-placeholder-color);
9169
+ }
9170
+
9130
9171
  .el-input-tag__input-calculator {
9131
9172
  left: 0;
9132
9173
  max-width: 100%;
@@ -10080,8 +10121,10 @@
10080
10121
  }
10081
10122
 
10082
10123
  .el-notification__group {
10124
+ flex: 1;
10083
10125
  margin-left: var(--el-notification-group-margin-left);
10084
10126
  margin-right: var(--el-notification-group-margin-right);
10127
+ min-width: 0;
10085
10128
  }
10086
10129
 
10087
10130
  .el-notification__title {
@@ -10104,6 +10147,7 @@
10104
10147
  }
10105
10148
 
10106
10149
  .el-notification .el-notification__icon {
10150
+ flex-shrink: 0;
10107
10151
  font-size: var(--el-notification-icon-size);
10108
10152
  height: var(--el-notification-icon-size);
10109
10153
  width: var(--el-notification-icon-size);
@@ -11513,6 +11557,7 @@
11513
11557
  background-color: var(--el-fill-color-light);
11514
11558
  color: var(--el-text-color-placeholder);
11515
11559
  cursor: not-allowed;
11560
+ pointer-events: none;
11516
11561
  }
11517
11562
 
11518
11563
  .el-select__wrapper.is-disabled, .el-select__wrapper.is-disabled:hover {
@@ -11603,6 +11648,7 @@
11603
11648
  top: 50%;
11604
11649
  transform: translateY(-50%);
11605
11650
  width: 100%;
11651
+ z-index: -1;
11606
11652
  }
11607
11653
 
11608
11654
  .el-select__placeholder.is-transparent {
@@ -11642,12 +11688,13 @@
11642
11688
  }
11643
11689
 
11644
11690
  .el-select__input-wrapper {
11645
- max-width: 100%;
11691
+ flex: 1;
11646
11692
  }
11647
11693
 
11648
11694
  .el-select__input-wrapper.is-hidden {
11649
11695
  opacity: 0;
11650
11696
  position: absolute;
11697
+ z-index: -1;
11651
11698
  }
11652
11699
 
11653
11700
  .el-select__input {
@@ -11660,9 +11707,9 @@
11660
11707
  font-family: inherit;
11661
11708
  font-size: inherit;
11662
11709
  height: 24px;
11663
- max-width: 100%;
11664
11710
  outline: none;
11665
11711
  padding: 0;
11712
+ width: 100%;
11666
11713
  }
11667
11714
 
11668
11715
  .el-select__input.is-disabled {
@@ -12147,7 +12194,6 @@
12147
12194
 
12148
12195
  .el-step__icon.is-text {
12149
12196
  border: 2px solid;
12150
- border-color: inherit;
12151
12197
  border-radius: 50%;
12152
12198
  }
12153
12199
 
@@ -12177,13 +12223,12 @@
12177
12223
 
12178
12224
  .el-step__line {
12179
12225
  background-color: var(--el-text-color-placeholder);
12180
- border-color: inherit;
12226
+ border-color: currentColor;
12181
12227
  position: absolute;
12182
12228
  }
12183
12229
 
12184
12230
  .el-step__line-inner {
12185
12231
  border: 1px solid;
12186
- border-color: inherit;
12187
12232
  box-sizing: border-box;
12188
12233
  display: block;
12189
12234
  height: 0;
@@ -13571,6 +13616,7 @@
13571
13616
  color: var(--el-text-color-primary);
13572
13617
  cursor: pointer;
13573
13618
  display: flex;
13619
+ flex-shrink: 0;
13574
13620
  font-size: 12px;
13575
13621
  height: 20px;
13576
13622
  justify-content: center;
@@ -16409,6 +16455,10 @@
16409
16455
  border-top-color: transparent;
16410
16456
  }
16411
16457
 
16458
+ .el-mention.is-disabled {
16459
+ pointer-events: none;
16460
+ }
16461
+
16412
16462
  .el-mention-dropdown {
16413
16463
  --el-mention-font-size:var(--el-font-size-base);
16414
16464
  --el-mention-bg-color:var(--el-bg-color-overlay);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * get方法,对应get请求
3
+ * @param {String} url [请求的url地址]
4
+ * @param {Object} params [请求时携带的参数]
5
+ */
6
+ export declare function get<T>(url: string, params?: any, headers?: any): Promise<T>;
7
+ export declare function del<T>(url: string, params?: any, headers?: any): Promise<T>;
8
+ /**
9
+ * post方法,对应post请求
10
+ * @param {String} url [请求的url地址]
11
+ * @param {Object} params [请求时携带的参数]
12
+ */
13
+ export declare function post<T>(url: string, params: any, config?: any): Promise<T>;
14
+ export declare function postFormData<T>(url: string, formData: FormData): Promise<T>;
package/http/Axios.js ADDED
@@ -0,0 +1,37 @@
1
+ import { ElMessage } from "element-plus";
2
+ import "../node_modules/.pnpm/axios@1.8.3/node_modules/axios/index.js";
3
+ import axios from "../node_modules/.pnpm/axios@1.8.3/node_modules/axios/lib/axios.js";
4
+ let http = axios.create();
5
+ http.interceptors.response.use((res) => {
6
+ if (res.status !== 200) {
7
+ ElMessage.error(res.statusText);
8
+ return Promise.reject(res.statusText);
9
+ } else if (res.data.success == false) {
10
+ ElMessage.error(res.data.msg);
11
+ return Promise.reject(res.data.msg);
12
+ }
13
+ return res;
14
+ }, (err) => {
15
+ if (err.response && err.response.data) {
16
+ ElMessage.error(err);
17
+ }
18
+ return Promise.reject(err);
19
+ });
20
+ http.interceptors.request.use(function(config) {
21
+ return config;
22
+ }, function(error) {
23
+ return Promise.reject(error);
24
+ });
25
+ http.defaults.timeout = 6e4;
26
+ async function post(url, params, config) {
27
+ const res = await http.post(url, params, config);
28
+ return res.data.data;
29
+ }
30
+ async function postFormData(url, formData) {
31
+ const res = await http.post(url, formData);
32
+ return res.data.data;
33
+ }
34
+ export {
35
+ post,
36
+ postFormData
37
+ };
@@ -0,0 +1,29 @@
1
+ import { post } from "./Axios.js";
2
+ import Config from "../config/Config.js";
3
+ import { getSourceLayerFields } from "ym-giscomm-2d/capabilities";
4
+ async function list(layerId) {
5
+ if (!Config.ServiceUrl) {
6
+ return [];
7
+ }
8
+ return await post(`${Config.ServiceUrl}/layer-field/list?layerId=${layerId}`, {});
9
+ }
10
+ async function getLayerFields(layerInfo) {
11
+ if (layerInfo.fields) {
12
+ return layerInfo.fields;
13
+ }
14
+ let fields = await list(layerInfo.id);
15
+ if (fields && fields.length > 0) {
16
+ layerInfo.fields = fields;
17
+ return fields;
18
+ }
19
+ if (!layerInfo.url || !layerInfo.selectIndex || !layerInfo.layerType) {
20
+ return [];
21
+ }
22
+ fields = await getSourceLayerFields(layerInfo.url, layerInfo.selectIndex, layerInfo.layerType);
23
+ layerInfo.fields = fields;
24
+ return fields;
25
+ }
26
+ export {
27
+ getLayerFields,
28
+ list
29
+ };
@@ -0,0 +1,3 @@
1
+ import { Feature } from 'ol';
2
+ export declare function importFile(file: File, fileWkid?: number, toWkid?: number): Promise<any>;
3
+ export declare function exportFeatures(features: Feature[], wkid: number, fileName: string, extension: "shp", toWkid?: number): Promise<any>;
@@ -0,0 +1,38 @@
1
+ import { postFormData } from "./Axios.js";
2
+ import Config from "../config/Config.js";
3
+ import WKT from "../node_modules/.pnpm/ol@9.2.4/node_modules/ol/format/WKT.js";
4
+ async function importFile(file, fileWkid, toWkid) {
5
+ if (!Config.GisServiceUrl) {
6
+ return [];
7
+ }
8
+ const formData = new FormData();
9
+ formData.append("file", file);
10
+ if (toWkid) {
11
+ formData.append("toWkid", toWkid.toString());
12
+ }
13
+ return await postFormData(`${Config.GisServiceUrl}/space/import`, formData);
14
+ }
15
+ async function exportFeatures(features, wkid, fileName, extension, toWkid) {
16
+ if (!Config.GisServiceUrl) {
17
+ return [];
18
+ }
19
+ const wkt = new WKT();
20
+ const featureCollection = features.map((feature) => {
21
+ const properties = { ...feature.getProperties() };
22
+ delete properties.geometry;
23
+ return {
24
+ geometry: wkt.writeGeometry(feature.getGeometry()),
25
+ properties
26
+ };
27
+ });
28
+ const formData = new FormData();
29
+ formData.append("features", JSON.stringify(featureCollection));
30
+ formData.append("wkid", wkid.toString());
31
+ formData.append("fileName", fileName);
32
+ formData.append("extension", extension);
33
+ return await postFormData(`${Config.GisServiceUrl}/space/exportFeatures`, formData);
34
+ }
35
+ export {
36
+ exportFeatures,
37
+ importFile
38
+ };
@@ -0,0 +1,19 @@
1
+ import { IMapService, ILayerField } from 'ym-giscomm-2d/entity';
2
+ /**
3
+ * 根据地图服务id获取字段列表
4
+ * @param query
5
+ * @returns
6
+ */
7
+ export declare function list(layerId: string): Promise<ILayerField[]>;
8
+ /**
9
+ * 添加或更新地图服务字段
10
+ * @param mapService
11
+ * @returns
12
+ */
13
+ export declare function addOrUpdateFields(layerFields: ILayerField[], layerId: string): Promise<ILayerField[]>;
14
+ /**
15
+ * 获取图层字段信息
16
+ * @param layerInfo
17
+ * @returns
18
+ */
19
+ export declare function getLayerFields(layerInfo: IMapService): Promise<ILayerField[]>;
package/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
1
  export * from './components/multi-screen';
2
2
  export * from './components/horizontally-top-toolbar';
3
3
  export * from './components/toc-card';
4
+ export * from './components/clear';
5
+ export * from './components/select';
6
+ export * from './components/swipe-layer';
7
+ export * from './components/draw';
8
+ export * from './components/export';
9
+ export * from './components/import';
10
+ export * from './components/identify';
package/index.js CHANGED
@@ -2,8 +2,22 @@
2
2
  import { MultiScreen } from "./components/multi-screen/index.js";
3
3
  import { HorizontallyTopToolbar } from "./components/horizontally-top-toolbar/index.js";
4
4
  import { TocCard } from "./components/toc-card/index.js";
5
+ import { Clear } from "./components/clear/index.js";
6
+ import { Select } from "./components/select/index.js";
7
+ import { SwipeLayer } from "./components/swipe-layer/index.js";
8
+ import { Draw } from "./components/draw/index.js";
9
+ import { Export } from "./components/export/index.js";
10
+ import { Import } from "./components/import/index.js";
11
+ import { Identify } from "./components/identify/index.js";
5
12
  export {
13
+ Clear,
14
+ Draw,
15
+ Export,
6
16
  HorizontallyTopToolbar,
17
+ Identify,
18
+ Import,
7
19
  MultiScreen,
20
+ Select,
21
+ SwipeLayer,
8
22
  TocCard
9
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -10,6 +10,6 @@
10
10
  "ol": "^9.2.4",
11
11
  "@element-plus/icons-vue": "^2.3.1",
12
12
  "element-plus": "^2.9.0",
13
- "ym-giscomm-2d": "1.0.3"
13
+ "ym-giscomm-2d": "1.0.9"
14
14
  }
15
15
  }