From 54eef21574110bb720d9b1f90211ea14417cf787 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Thu, 8 Apr 2021 15:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs_new/animateHandle.js | 4 +- src/iscs_new/core/abstractShape.js | 5 +- src/iscs_new/core/form/form2Base.js | 22 ++--- src/iscs_new/factory/compose.js | 4 +- src/iscs_new/factory/element.js | 2 +- src/iscs_new/transformHandle.js | 2 +- src/views/iscs_new/iscsDesign/index.vue | 14 --- src/views/iscs_new/iscsDraw/index.vue | 35 ++++++- src/views/test/index.vue | 116 ++++++++++++++---------- 9 files changed, 123 insertions(+), 81 deletions(-) diff --git a/src/iscs_new/animateHandle.js b/src/iscs_new/animateHandle.js index 4baac8218..ebc41a9c7 100644 --- a/src/iscs_new/animateHandle.js +++ b/src/iscs_new/animateHandle.js @@ -67,7 +67,7 @@ class Animate { const state = mapShape[name] const view = mapView[name]; if (view) { - shape.setInvisible(shape.model.sightless); + shape.setInvisible(shape.model.base.hide); view.attr({shape: state.default.shape, style: state.default.style}); view.dirty(); } @@ -78,7 +78,7 @@ class Animate { const view = mapView[name]; const model = frame[name]; if (view && model) { - shape.setInvisible(shape.model.sightless||model.sightless); + shape.setInvisible(model.hide); view.attr({shape: model.shape, style: model.style}); view.dirty(); } diff --git a/src/iscs_new/core/abstractShape.js b/src/iscs_new/core/abstractShape.js index 5aaada06d..d4ce84740 100644 --- a/src/iscs_new/core/abstractShape.js +++ b/src/iscs_new/core/abstractShape.js @@ -44,6 +44,7 @@ class AbstractShape extends Group { this.model.base.position[1] = this.model.base.position[1] + dy; this.instance.origin = utils.createOrigin(this.instance); this.instance.transform = utils.createTransform({scale: this.model.base.scale, position: this.model.base.position, rotation: this.model.base.rotation*Math.PI/180}); + this.setInvisible(this.model.base.hide) } // 修改属性 @@ -56,8 +57,8 @@ class AbstractShape extends Group { } // 设置显隐 - setInvisible(sightless) { - sightless ? this.hide(): this.show(); + setInvisible(hide) { + hide ? this.hide(): this.show(); } // 设置高亮 diff --git a/src/iscs_new/core/form/form2Base.js b/src/iscs_new/core/form/form2Base.js index 3a4ac96ce..d6faa7493 100644 --- a/src/iscs_new/core/form/form2Base.js +++ b/src/iscs_new/core/form/form2Base.js @@ -1,16 +1,16 @@ import types from './types'; export default [ - { - prop: 'name', - label: '名称', - type: types.String, - rules:[ - { required: true, message:'请输入名称', trigger: 'blur' } - ], - value: '<名称>', - description: '控制图形的前后顺序。' - }, + // { + // prop: 'name', + // label: '名称', + // type: types.String, + // rules:[ + // { required: true, message:'请输入名称', trigger: 'blur' } + // ], + // value: '<名称>', + // description: '控制图形的前后顺序。' + // }, { prop: 'z1', label: '层级z1', @@ -40,7 +40,7 @@ export default [ description: '控制图形的前后顺序。z2 值小的图形会被 z2 值大的图形覆盖。z2 相比 z1 优先级更低。' }, { - prop: 'sightless', + prop: 'hide', label: '是否隐藏', type: types.Boolean, rules:[ diff --git a/src/iscs_new/factory/compose.js b/src/iscs_new/factory/compose.js index 47faf680d..a122874df 100644 --- a/src/iscs_new/factory/compose.js +++ b/src/iscs_new/factory/compose.js @@ -52,7 +52,7 @@ class Compose extends AbstractShape { this.instance.origin = utils.createOrigin(this.instance); this.instance.transform = utils.createTransform({scale: this.model.base.scale, position: this.model.base.position, rotation: this.model.base.rotation*Math.PI/180}); this.add(this.instance); - this.setInvisible(this.model.sightless) + this.setInvisible(this.model.base.hide) } // 设置高亮 @@ -81,7 +81,7 @@ class Compose extends AbstractShape { el.model) { this.shapeFactory.removeFromLayer(el.type)(el); this.instance.add(el); - el.model.composeCode = this.type; + el.model.composeCode = this.code; el.attr(el.model); } }) diff --git a/src/iscs_new/factory/element.js b/src/iscs_new/factory/element.js index 82ec1d5ca..3141ea2cb 100644 --- a/src/iscs_new/factory/element.js +++ b/src/iscs_new/factory/element.js @@ -48,7 +48,7 @@ class Element extends AbstractShape { this.instance.origin = utils.createOrigin(this.instance); this.instance.transform = utils.createTransform({scale: this.model.base.scale, position: this.model.base.position, rotation: this.model.base.rotation*Math.PI/180}); this.add(this.instance); - this.setInvisible(this.model.sightless) + this.setInvisible(this.model.base.hide); } } diff --git a/src/iscs_new/transformHandle.js b/src/iscs_new/transformHandle.js index 8f466e80a..3046d9fff 100644 --- a/src/iscs_new/transformHandle.js +++ b/src/iscs_new/transformHandle.js @@ -15,7 +15,7 @@ export default class TransformHandle { // 检查显隐 checkVisible(shape) { - return shape.model && !shape.model.sightless || utils.createBoundingRectCheckVisible(shape, this.transform).intersect(this.rect); + return shape.model && !shape.model.base.hide || utils.createBoundingRectCheckVisible(shape, this.transform).intersect(this.rect); } // 重新计算显隐 diff --git a/src/views/iscs_new/iscsDesign/index.vue b/src/views/iscs_new/iscsDesign/index.vue index 5e8ebbbb4..a9e41d9ed 100644 --- a/src/views/iscs_new/iscsDesign/index.vue +++ b/src/views/iscs_new/iscsDesign/index.vue @@ -3,31 +3,20 @@