From 6c2b4752134bd2536b2a674e33c025fbf262f338 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Fri, 9 Apr 2021 17:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs_new/core/form/form2Base.js | 10 ---------- src/iscs_new/map.js | 6 ------ src/iscs_new/plugins/shapeBuilder/entry.vue | 3 +-- .../plugins/shapeContextMenu/entry.vue | 20 +++++++++++++++++++ src/iscs_new/selectingHandle.js | 5 ----- src/iscs_new/utils/events.js | 3 +-- src/views/iscsSystem/index.vue | 2 -- src/views/iscs_new/iscsDraw/index.vue | 14 ++++++++----- src/views/iscs_new/iscsDraw/iscsCanvas.vue | 5 ++--- 9 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/iscs_new/core/form/form2Base.js b/src/iscs_new/core/form/form2Base.js index d6faa7493..02113be41 100644 --- a/src/iscs_new/core/form/form2Base.js +++ b/src/iscs_new/core/form/form2Base.js @@ -1,16 +1,6 @@ import types from './types'; export default [ - // { - // prop: 'name', - // label: '名称', - // type: types.String, - // rules:[ - // { required: true, message:'请输入名称', trigger: 'blur' } - // ], - // value: '<名称>', - // description: '控制图形的前后顺序。' - // }, { prop: 'z1', label: '层级z1', diff --git a/src/iscs_new/map.js b/src/iscs_new/map.js index ae55759aa..61e76f083 100644 --- a/src/iscs_new/map.js +++ b/src/iscs_new/map.js @@ -341,9 +341,6 @@ class JMap { case events.Keyup: this.$controller.on(events.Keyup, cb, context); break; - // case events.BuildShape: - // this.$controller.on(events.BuildShape, cb, context); - // break; } } } @@ -392,9 +389,6 @@ class JMap { case events.Keyup: this.$controller.off(events.Keyup, cb); break; - // case events.BuildShape: - // this.$controller.off(events.BuildShape, cb); - // break; } } } diff --git a/src/iscs_new/plugins/shapeBuilder/entry.vue b/src/iscs_new/plugins/shapeBuilder/entry.vue index f7ce0c83b..8845212e4 100644 --- a/src/iscs_new/plugins/shapeBuilder/entry.vue +++ b/src/iscs_new/plugins/shapeBuilder/entry.vue @@ -27,7 +27,6 @@ export default { }, methods: { doBuilder(type) { - console.log(elementConst, type) const form = formBuilder.buildForm(elementConst[type]); const model = utils.deepClone(form.model); model.code = utils.getUID(type); @@ -45,7 +44,7 @@ export default { .builder { background: #f1f1f1; height: 100%; - width: 120px; + width: 130px; position: absolute; top: 0; } diff --git a/src/iscs_new/plugins/shapeContextMenu/entry.vue b/src/iscs_new/plugins/shapeContextMenu/entry.vue index 5fac4b939..9d704ef0e 100644 --- a/src/iscs_new/plugins/shapeContextMenu/entry.vue +++ b/src/iscs_new/plugins/shapeContextMenu/entry.vue @@ -24,6 +24,7 @@ export default { x: 0, y: 0 }, + clipboardList: [], menus: [], list: [ { @@ -40,6 +41,21 @@ export default { disabledCb: selected => { return selected.shapeType != shapeType.Compose; } + }, + { + label: '复制', + handler: this.doCopy, + disabledCb: selected => { + const storage = this.$iscs.getController().getStorage(); + return storage.values().length <= 0; + } + }, + { + label: '粘贴', + handler: this.doParse, + disabledCb: selected => { + return this.clipboardList.length; + } } ] }; @@ -92,6 +108,10 @@ export default { } ]); } + }, + doCopy(el) { + }, + doParse(el) { } } }; diff --git a/src/iscs_new/selectingHandle.js b/src/iscs_new/selectingHandle.js index 92119c7cd..f6cdd9dd1 100644 --- a/src/iscs_new/selectingHandle.js +++ b/src/iscs_new/selectingHandle.js @@ -253,17 +253,12 @@ export default class SelectingHandle { this.$painter.addToLayer(shapeLayer.Selecting)(this.selecting); const selectingRect = this.selecting.getBoundingRect(); - const keyStr = this.$controller.getKeyStr(); Object.values(this.$map.getMapShape()).forEach(el => { if (el.model && !el.model.composeCode && this.checkSelectingRectContainShape(selectingRect, el)) { this.setSelected(el); } }); - // 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 8561a5d53..42c60dc0a 100644 --- a/src/iscs_new/utils/events.js +++ b/src/iscs_new/utils/events.js @@ -11,6 +11,5 @@ export default { StateLoaded: 'stateLoaded', ViewUpdate: 'viewUpdate', StateUpdate: 'stateUpdate', - OptionUpdate: 'optionUpdate', - // BuildShape: 'buildShape' + OptionUpdate: 'optionUpdate' } diff --git a/src/views/iscsSystem/index.vue b/src/views/iscsSystem/index.vue index 2b358bab4..6061195d4 100644 --- a/src/views/iscsSystem/index.vue +++ b/src/views/iscsSystem/index.vue @@ -233,10 +233,8 @@ export default { }, // 点击选择事件 onSelected(em) { - console.log(em); }, onDblclick(em) { - console.log(em); }, // 右键点击事件 onContextMenu(em) { diff --git a/src/views/iscs_new/iscsDraw/index.vue b/src/views/iscs_new/iscsDraw/index.vue index 4cdd2b926..cc9f39a60 100644 --- a/src/views/iscs_new/iscsDraw/index.vue +++ b/src/views/iscs_new/iscsDraw/index.vue @@ -86,13 +86,17 @@ export default { const source = this.$iscs.getSource(); if (id && source) { const elementList = source.elementList.map(el => { - return this.$iscs.getShapeByCode(el.code); + return this.$iscs.getShapeByCode(el.code).model; }); - const shapeList = elementList.map(el => el.model); - const rect = elementList.reduce( - (temp,el) => el&&temp? temp.union(el.getBoundingRect().clone()): el.getBoundingRect(), null); + const composeList = source.composeList.map(el => { + return this.$iscs.getShapeByCode(el.code).model; + }); + const rect = elementList.reduce((temp,el) => { + const shape = this.$iscs.getShapeByCode(el.code); + return shape&&temp? temp.union(shape.getBoundingRect().clone()): shape.getBoundingRect() + }, null); const position = rect? [(rect.x + rect.width)/2, (rect.y + rect.height)/2]: [0,0]; - const model = { id, name, type, shapeList, position }; + const model = { id, name, type, elementList, composeList, position }; Idb.delete('composeList', model.id); Idb.write('composeList', model); Idb.list('composeList').then(list => { diff --git a/src/views/iscs_new/iscsDraw/iscsCanvas.vue b/src/views/iscs_new/iscsDraw/iscsCanvas.vue index 5ee9582aa..ba4267463 100644 --- a/src/views/iscs_new/iscsDraw/iscsCanvas.vue +++ b/src/views/iscs_new/iscsDraw/iscsCanvas.vue @@ -101,8 +101,8 @@ export default { setTimeout(_ => { Idb.select('composeList', this.$route.query.id).then(resp => { this.$iscs.setMap([], { - elementList: resp.shapeList||[], - composeList: [] + elementList: resp.elementList||[], + composeList: resp.composeList||[] }, option); }).catch(error => { this.$iscs.setMap([], { @@ -137,7 +137,6 @@ export default { }, // 点击选择事件 onClick(em={}) { - console.log(em); this.$emit('selected', em); }, onReflect(em={}) {