ym-giswidget-2d 1.0.57 → 1.0.58

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.
@@ -6,6 +6,8 @@ interface ITool extends IToolConfig {
6
6
  type __VLS_Props = {
7
7
  tools?: ITool[];
8
8
  map: OLMap;
9
+ fieldName?: string;
10
+ fieldValues?: any[];
9
11
  };
10
12
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
13
  loaded: (...args: any[]) => void;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./HorizontallyTopToolbar.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _HorizontallyTopToolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-647a59e2"]]);
4
+ const _HorizontallyTopToolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b9b182f8"]]);
5
5
  export {
6
6
  _HorizontallyTopToolbar as default
7
7
  };
@@ -139,7 +139,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
139
139
  id: "map-search"
140
140
  }
141
141
  ] },
142
- map: {}
142
+ map: {},
143
+ fieldName: {},
144
+ fieldValues: {}
143
145
  },
144
146
  emits: ["loaded"],
145
147
  setup(__props, { emit: __emit }) {
@@ -269,23 +271,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
269
271
  class: "component-position",
270
272
  map: props.map,
271
273
  data: reactiveValue.repelsComponents.data,
274
+ fieldName: props.fieldName,
275
+ fieldValues: props.fieldValues,
272
276
  onActiveInteraction: _cache[0] || (_cache[0] = ($event) => handleActiveInteraction($event, reactiveValue.repelsComponents))
273
- }, null, 40, ["map", "data"])) : createCommentVNode("", true),
277
+ }, null, 40, ["map", "data", "fieldName", "fieldValues"])) : createCommentVNode("", true),
274
278
  (openBlock(true), createElementBlock(Fragment, null, renderList(reactiveValue.components, (component) => {
275
279
  return openBlock(), createBlock(resolveDynamicComponent(component.component), {
276
280
  class: "component-position",
277
281
  map: props.map,
278
282
  data: component.data,
283
+ fieldName: props.fieldName,
284
+ fieldValues: props.fieldValues,
279
285
  onActiveInteraction: ($event) => handleActiveInteraction($event, component)
280
- }, null, 40, ["map", "data", "onActiveInteraction"]);
286
+ }, null, 40, ["map", "data", "fieldName", "fieldValues", "onActiveInteraction"]);
281
287
  }), 256)),
282
288
  (openBlock(true), createElementBlock(Fragment, null, renderList(reactiveValue.alwaysComponents, (component) => {
283
289
  return withDirectives((openBlock(), createBlock(resolveDynamicComponent(component.component), {
290
+ fieldName: props.fieldName,
291
+ fieldValues: props.fieldValues,
284
292
  map: props.map,
285
293
  data: component.data,
286
294
  onLoaded: handleLoaded,
287
295
  onActiveInteraction: ($event) => handleActiveInteraction($event, component)
288
- }, null, 40, ["map", "data", "onActiveInteraction"])), [
296
+ }, null, 40, ["fieldName", "fieldValues", "map", "data", "onActiveInteraction"])), [
289
297
  [vShow, reactiveValue.activeIds.indexOf(component.id) > -1]
290
298
  ]);
291
299
  }), 256))
@@ -1,4 +1,4 @@
1
- .toolbar-contain[data-v-647a59e2] {
1
+ .toolbar-contain[data-v-b9b182f8] {
2
2
  position: absolute;
3
3
  top: 44px;
4
4
  display: flex;
@@ -9,7 +9,7 @@
9
9
  border: 1px solid var(--system-primary-border-color);
10
10
  border-radius: 3px;
11
11
  }
12
- .toolbar-contain .toolbar-item-contain[data-v-647a59e2] {
12
+ .toolbar-contain .toolbar-item-contain[data-v-b9b182f8] {
13
13
  height: 43px;
14
14
  line-height: 43px;
15
15
  display: flex;
@@ -18,17 +18,17 @@
18
18
  align-items: center;
19
19
  cursor: pointer;
20
20
  }
21
- .toolbar-contain .toolbar-item-contain .toolbar-item[data-v-647a59e2] {
21
+ .toolbar-contain .toolbar-item-contain .toolbar-item[data-v-b9b182f8] {
22
22
  display: flex;
23
23
  align-items: center;
24
24
  padding: 0px 10px;
25
25
  }
26
- .toolbar-contain .toolbar-item-contain .toolbar-icon[data-v-647a59e2] {
26
+ .toolbar-contain .toolbar-item-contain .toolbar-icon[data-v-b9b182f8] {
27
27
  width: 24px;
28
28
  height: 24px;
29
29
  margin-right: 6px;
30
30
  }
31
- .toolbar-contain .toolbar-item-contain .toolbar-children-contain[data-v-647a59e2] {
31
+ .toolbar-contain .toolbar-item-contain .toolbar-children-contain[data-v-b9b182f8] {
32
32
  position: absolute;
33
33
  top: 50px;
34
34
  background: var(--system-primary-color);
@@ -36,24 +36,24 @@
36
36
  border-radius: 3px;
37
37
  margin: 0px -1px;
38
38
  }
39
- .toolbar-contain .active[data-v-647a59e2] {
39
+ .toolbar-contain .active[data-v-b9b182f8] {
40
40
  color: var(--system-primary-text-active-color);
41
41
  }
42
- .toolbar-contain .toolbar-split[data-v-647a59e2] {
42
+ .toolbar-contain .toolbar-split[data-v-b9b182f8] {
43
43
  width: 2px;
44
44
  height: 20px;
45
45
  background: #7EA08E;
46
46
  margin: auto;
47
47
  opacity: 0.5;
48
48
  }
49
- .toolbar-contain .toolbar-h-split[data-v-647a59e2] {
49
+ .toolbar-contain .toolbar-h-split[data-v-b9b182f8] {
50
50
  height: 2px;
51
51
  background: #7EA08E;
52
52
  margin: auto;
53
53
  opacity: 0.5;
54
54
  margin: 0px 10px;
55
55
  }
56
- .component-position[data-v-647a59e2] {
56
+ .component-position[data-v-b9b182f8] {
57
57
  position: absolute;
58
58
  right: 300px;
59
59
  }
@@ -12,13 +12,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  emits: ["activeInteraction"],
13
13
  setup(__props, { expose: __expose, emit: __emit }) {
14
14
  const props = __props;
15
+ const emit = __emit;
15
16
  const reactiveData = reactive({
16
17
  features: []
17
18
  });
18
19
  onMounted(() => {
19
20
  const featureManager = new FeatureManager(props.map);
20
21
  const editFeatures = featureManager.getEditFeatures(props.fieldName, props.fieldValues);
21
- reactiveData.modifyTool = new Modify({ feature: editFeatures });
22
+ if (!editFeatures || editFeatures.length === 0) {
23
+ emit("activeInteraction", { success: false, message: "请先选择可编辑的地块" });
24
+ return;
25
+ }
26
+ reactiveData.modifyTool = new Modify({ "editFeatures": editFeatures });
22
27
  props.map.interactionManager.addInteraction("modify", toRaw(reactiveData.modifyTool));
23
28
  });
24
29
  onUnmounted(() => {
@@ -21,7 +21,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  const featureManager = new FeatureManager(props.map);
22
22
  const editFeatures = featureManager.getEditFeatures(props.fieldName, props.fieldValues);
23
23
  if (!editFeatures || editFeatures.length === 0) {
24
- emit("activeInteraction", { success: false, message: "请先选择分割的地块" });
24
+ emit("activeInteraction", { success: false, message: "请先选择可编辑的地块" });
25
25
  return;
26
26
  }
27
27
  reactiveData.splitTool = new Split(editFeatures, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -10,6 +10,6 @@
10
10
  "element-plus": "^2.9.0",
11
11
  "jszip": "^3.10.1",
12
12
  "ol": "^9.2.4",
13
- "ym-gis-2d": "1.0.35"
13
+ "ym-gis-2d": "1.0.37"
14
14
  }
15
15
  }