From 82f432136e457a0953e21f1feffb6ada439b51b8 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Wed, 31 Mar 2021 18:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs_new/factory/index.js | 1 + src/iscs_new/map.js | 3 +++ src/iscs_new/selectHandle.js | 4 ++-- src/views/test/index.vue | 21 ++++++++++++++++++--- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/iscs_new/factory/index.js b/src/iscs_new/factory/index.js index e015f6407..1aef635e9 100644 --- a/src/iscs_new/factory/index.js +++ b/src/iscs_new/factory/index.js @@ -23,6 +23,7 @@ function update2List(source, model, action, name='') { let updateModel = model; const i = list.findIndex(elem => { return elem.code == model.code; }) switch(action.order) { + case orders.BINDING: case orders.ADD: list.push(model); break; diff --git a/src/iscs_new/map.js b/src/iscs_new/map.js index 6908c3d38..ef38d9598 100644 --- a/src/iscs_new/map.js +++ b/src/iscs_new/map.js @@ -178,6 +178,9 @@ class JMap { case orders.UNBINDING: this.$painter.remove(oldShape); break; + case orders.BINDING: + // ζš‚δΈζ”―ζŒ + break; } } }); diff --git a/src/iscs_new/selectHandle.js b/src/iscs_new/selectHandle.js index 897077603..a8b9f0fa0 100644 --- a/src/iscs_new/selectHandle.js +++ b/src/iscs_new/selectHandle.js @@ -17,14 +17,12 @@ export default class SelectHandle { if (e.target) { this.e = {...e}; if (['Control'].includes(this.$controller.getKeyStr())) { - console.log(this.$controller.isSelected(e.target.model.code)); if (this.$controller.isSelected(e.target.model.code)) { this.delSelected(e.target); } else { this.addSelected(e.target); } } else { - console.log(2222) this.clear(); this.addSelected(e.target); } @@ -33,11 +31,13 @@ export default class SelectHandle { addSelected(target) { this.$controller.storage.set(target.model.code, target); + console.log(this.$controller.storage.values()); target.active(); } delSelected(target) { target.inactive(); + console.log('bug') this.$controller.storage.delete(target.model.code); } diff --git a/src/views/test/index.vue b/src/views/test/index.vue index 5467ee670..a957f182f 100644 --- a/src/views/test/index.vue +++ b/src/views/test/index.vue @@ -112,7 +112,7 @@ export default { fill: 'red', stroke: 'black' }, - composeCode: '4' + composeCode: '100' }, { code: '2', @@ -126,7 +126,7 @@ export default { fill: 'red', stroke: 'black' }, - composeCode: '4' + composeCode: '100' }, { code: '3', @@ -142,11 +142,26 @@ export default { stroke: 'black' }, composeCode: '' + }, + { + code: '4', + type: 'Droplet', + shape: { + cx: 400, + cy: 200, + width: 20, + height: 20, + }, + style: { + fill: 'red', + stroke: 'black' + }, + composeCode: '' } ], composeList: [ { - code: '4', + code: '100', type: 'Device', elementCodes: ['1', '2'] }