-
-
-
+
+
diff --git a/src/iscs_new/plugins/shapeContextMenu/index.js b/src/iscs_new/plugins/shapeContextMenu/index.js
new file mode 100644
index 000000000..f544a5dc6
--- /dev/null
+++ b/src/iscs_new/plugins/shapeContextMenu/index.js
@@ -0,0 +1,79 @@
+import Vue from 'vue';
+import events from '@/iscs_new/utils/events';
+import entry from './entry.vue';
+
+const elPage = Vue.extend(entry);
+
+const toggling = (page, e) => {
+ if (e&&e.code) {
+ Vue.nextTick(() => {
+ page.doShow({x: e.clientX, y: e.clientY});
+ });
+ } else {
+ page.doClose();
+ }
+};
+
+
+const handle = {
+ onClick(e) {
+ if (this.page) {
+ this.page.selected = e;
+ toggling(this.page, {});
+ }
+ },
+ onContextMenu(e) {
+ if (this.page) {
+ toggling(this.page, e);
+ }
+ }
+}
+
+class ShapeBuilder {
+ constructor(map) {
+ this.zr = map.getZr();
+ this.map = map;
+ this.page = this.initUI();
+ }
+
+ initUI() {
+ const el = this.zr.dom;
+ const page = new elPage({
+ el: document.createElement('div'),
+ data () {}
+ });
+ el.page = page;
+ el.dom = page.$el;
+ el.grSelectStyle = {};
+ el.appendChild(el.dom);
+ return page;
+ }
+
+ addEventListener() {
+ if (this.map) {
+ this.map.on(events.Click, handle.onClick, this);
+ this.map.on(events.ContextMenu, handle.onContextMenu, this);
+ }
+ }
+
+ removeEventListener() {
+ if (this.map) {
+ this.map.off(events.Click, handle.onClick, this);
+ this.map.off(events.ContextMenu, handle.onContextMenu, this);
+ }
+ }
+}
+
+export default {
+ el: null,
+ install(map) {
+ this.el = new ShapeBuilder(map);
+ this.el.addEventListener();
+ },
+ uninstall(map) {
+ if (this.el) {
+ this.el.removeEventListener();
+ this.el = null;
+ }
+ }
+}
diff --git a/src/iscs_new/plugins/shapeContextMenu/menu-item.vue b/src/iscs_new/plugins/shapeContextMenu/menu-item.vue
new file mode 100644
index 000000000..ec2687e95
--- /dev/null
+++ b/src/iscs_new/plugins/shapeContextMenu/menu-item.vue
@@ -0,0 +1,202 @@
+
+
+
+
+
+
+
+
diff --git a/src/iscs_new/plugins/shapeProperty/entry.vue b/src/iscs_new/plugins/shapeProperty/entry.vue
index c9eea5e49..dd8b046b5 100644
--- a/src/iscs_new/plugins/shapeProperty/entry.vue
+++ b/src/iscs_new/plugins/shapeProperty/entry.vue
@@ -1,21 +1,22 @@
- 我来啦!
+
+ 我来啦!
+
diff --git a/src/iscs_new/plugins/shapeProperty/index.js b/src/iscs_new/plugins/shapeProperty/index.js
index 29ba3ace5..6cfd56574 100644
--- a/src/iscs_new/plugins/shapeProperty/index.js
+++ b/src/iscs_new/plugins/shapeProperty/index.js
@@ -4,8 +4,8 @@ import entry from './entry.vue';
const elPage = Vue.extend(entry);
-const toggling = (page, show) => {
- if (show) {
+const toggling = (page, e) => {
+ if (!!e) {
Vue.nextTick(() => {
page.visible = true;
});
@@ -17,15 +17,13 @@ const toggling = (page, show) => {
const handle = {
onClick(e) {
- console.log(this)
- toggling(this.page, !!e);
- // console.log('onClick', this, e)
+ toggling(this.page, e);
},
onContextMenu(e) {
- // console.log('onContextMenu', this, e)
},
- onBuildShape(e) {
- // console.log('onBuildShape', this, e)
+ onModify(e) {
+ },
+ onDelete(e) {
}
}
@@ -53,7 +51,6 @@ class ShapeBuilder {
if (this.map) {
this.map.on(events.Click, handle.onClick, this);
this.map.on(events.ContextMenu, handle.onContextMenu, this);
- this.map.on(events.BuildShape, handle.onBuildShape, this);
}
}
@@ -61,7 +58,6 @@ class ShapeBuilder {
if (this.map) {
this.map.off(events.Click, handle.onClick, this);
this.map.off(events.ContextMenu, handle.onContextMenu, this);
- this.map.off(events.BuildShape, handle.onBuildShape, this);
}
}
}
diff --git a/src/iscs_new/selectingHandle.js b/src/iscs_new/selectingHandle.js
index 34f9910e0..92119c7cd 100644
--- a/src/iscs_new/selectingHandle.js
+++ b/src/iscs_new/selectingHandle.js
@@ -260,9 +260,9 @@ export default class SelectingHandle {
}
});
- if (['Alt'].includes(keyStr)) {
- this.$controller.trigger(events.BuildShape, {...selectingRect, option: this.$map.getOption()});
- }
+ // if (['Alt'].includes(keyStr)) {
+ // this.$controller.trigger(events.BuildShape, {...selectingRect, option: this.$map.getOption()});
+ // }
this.clear();
}
diff --git a/src/iscs_new/utils/events.js b/src/iscs_new/utils/events.js
index d0795bd07..8561a5d53 100644
--- a/src/iscs_new/utils/events.js
+++ b/src/iscs_new/utils/events.js
@@ -12,5 +12,5 @@ export default {
ViewUpdate: 'viewUpdate',
StateUpdate: 'stateUpdate',
OptionUpdate: 'optionUpdate',
- BuildShape: 'buildShape'
+ // BuildShape: 'buildShape'
}
diff --git a/src/views/iscs_new/components/dataForm.vue b/src/views/iscs_new/components/dataForm.vue
index a105268ff..e09147c94 100644
--- a/src/views/iscs_new/components/dataForm.vue
+++ b/src/views/iscs_new/components/dataForm.vue
@@ -16,8 +16,8 @@
{{ styleGroup.name }}