From d9a8baeb937fa033c9d6050e5f86e5a48f3357a9 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Wed, 31 Mar 2021 08:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=AE=E5=BD=95=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs_new/{parser/Shape.js => core/abstractShape.js} | 3 ++- src/iscs_new/{ => core}/form/form2Base.js | 0 src/iscs_new/{ => core}/form/form2ShapeStyle.js | 0 src/iscs_new/{ => core}/form/form2TextStyle.js | 0 src/iscs_new/{ => core}/form/form2TruncateStyle.js | 0 src/iscs_new/{ => core}/form/formBuilder.js | 0 src/iscs_new/{utils => core}/graphic.js | 0 src/iscs_new/{utils => core}/shape/Svg.js | 0 src/iscs_new/draggable/Image.js | 2 +- src/iscs_new/draggable/Line.js | 2 +- src/iscs_new/{parser => factory}/compose.js | 2 +- src/iscs_new/{parser => factory}/element.js | 4 ++-- src/iscs_new/{parser => factory}/index.js | 1 + src/iscs_new/map.js | 2 +- src/iscs_new/option.js | 4 ++-- src/iscs_new/painter.js | 2 +- src/iscs_new/selectHandle.js | 2 +- src/iscs_new/selectingHandle.js | 2 +- src/iscs_new/tipsHandle.js | 2 +- 19 files changed, 15 insertions(+), 13 deletions(-) rename src/iscs_new/{parser/Shape.js => core/abstractShape.js} (89%) rename src/iscs_new/{ => core}/form/form2Base.js (100%) rename src/iscs_new/{ => core}/form/form2ShapeStyle.js (100%) rename src/iscs_new/{ => core}/form/form2TextStyle.js (100%) rename src/iscs_new/{ => core}/form/form2TruncateStyle.js (100%) rename src/iscs_new/{ => core}/form/formBuilder.js (100%) rename src/iscs_new/{utils => core}/graphic.js (100%) rename src/iscs_new/{utils => core}/shape/Svg.js (100%) rename src/iscs_new/{parser => factory}/compose.js (91%) rename src/iscs_new/{parser => factory}/element.js (94%) rename src/iscs_new/{parser => factory}/index.js (99%) diff --git a/src/iscs_new/parser/Shape.js b/src/iscs_new/core/abstractShape.js similarity index 89% rename from src/iscs_new/parser/Shape.js rename to src/iscs_new/core/abstractShape.js index 3fabc6361..836bf20ea 100644 --- a/src/iscs_new/parser/Shape.js +++ b/src/iscs_new/core/abstractShape.js @@ -1,7 +1,7 @@ import shapeType from '../constant/shapeType'; // 图形抽象层 -export default class AbstractShape { +class AbstractShape { constructor({model, defaultStyle, option, shapeFactory}) { this.model = model; this.option = option; @@ -29,3 +29,4 @@ export default class AbstractShape { setState(state) {} } +export default AbstractShape; diff --git a/src/iscs_new/form/form2Base.js b/src/iscs_new/core/form/form2Base.js similarity index 100% rename from src/iscs_new/form/form2Base.js rename to src/iscs_new/core/form/form2Base.js diff --git a/src/iscs_new/form/form2ShapeStyle.js b/src/iscs_new/core/form/form2ShapeStyle.js similarity index 100% rename from src/iscs_new/form/form2ShapeStyle.js rename to src/iscs_new/core/form/form2ShapeStyle.js diff --git a/src/iscs_new/form/form2TextStyle.js b/src/iscs_new/core/form/form2TextStyle.js similarity index 100% rename from src/iscs_new/form/form2TextStyle.js rename to src/iscs_new/core/form/form2TextStyle.js diff --git a/src/iscs_new/form/form2TruncateStyle.js b/src/iscs_new/core/form/form2TruncateStyle.js similarity index 100% rename from src/iscs_new/form/form2TruncateStyle.js rename to src/iscs_new/core/form/form2TruncateStyle.js diff --git a/src/iscs_new/form/formBuilder.js b/src/iscs_new/core/form/formBuilder.js similarity index 100% rename from src/iscs_new/form/formBuilder.js rename to src/iscs_new/core/form/formBuilder.js diff --git a/src/iscs_new/utils/graphic.js b/src/iscs_new/core/graphic.js similarity index 100% rename from src/iscs_new/utils/graphic.js rename to src/iscs_new/core/graphic.js diff --git a/src/iscs_new/utils/shape/Svg.js b/src/iscs_new/core/shape/Svg.js similarity index 100% rename from src/iscs_new/utils/shape/Svg.js rename to src/iscs_new/core/shape/Svg.js diff --git a/src/iscs_new/draggable/Image.js b/src/iscs_new/draggable/Image.js index e3d0dd47a..81bcb0ad3 100644 --- a/src/iscs_new/draggable/Image.js +++ b/src/iscs_new/draggable/Image.js @@ -1,6 +1,6 @@ import _ from 'lodash'; -import * as graphic from '../utils/graphic'; +import * as graphic from '../core/graphic'; import * as eventTool from 'zrender/src/core/event'; import shapeRender from '../constant/shapeRender'; diff --git a/src/iscs_new/draggable/Line.js b/src/iscs_new/draggable/Line.js index 67053fe1b..f3fcfa59c 100644 --- a/src/iscs_new/draggable/Line.js +++ b/src/iscs_new/draggable/Line.js @@ -1,5 +1,5 @@ import _ from 'lodash'; -import * as graphic from '../utils/graphic'; +import * as graphic from '../core/graphic'; import * as eventTool from 'zrender/src/core/event'; import shapeRender from '../constant/shapeRender'; diff --git a/src/iscs_new/parser/compose.js b/src/iscs_new/factory/compose.js similarity index 91% rename from src/iscs_new/parser/compose.js rename to src/iscs_new/factory/compose.js index 58c3bce3b..e672e915e 100644 --- a/src/iscs_new/parser/compose.js +++ b/src/iscs_new/factory/compose.js @@ -1,4 +1,4 @@ -import AbstractShape from './Shape'; +import AbstractShape from '../core/abstractShape'; import Group from 'zrender/src/container/Group'; class Compose extends AbstractShape { diff --git a/src/iscs_new/parser/element.js b/src/iscs_new/factory/element.js similarity index 94% rename from src/iscs_new/parser/element.js rename to src/iscs_new/factory/element.js index 4e2201a2a..7547d23ea 100644 --- a/src/iscs_new/parser/element.js +++ b/src/iscs_new/factory/element.js @@ -1,5 +1,5 @@ -import AbstractShape from './Shape'; -import * as graphic from '../utils/graphic'; +import AbstractShape from '../core/abstractShape'; +import * as graphic from '../core/graphic'; class Element extends AbstractShape { constructor(args) { super(args); diff --git a/src/iscs_new/parser/index.js b/src/iscs_new/factory/index.js similarity index 99% rename from src/iscs_new/parser/index.js rename to src/iscs_new/factory/index.js index fd43c5792..b09fafb3a 100644 --- a/src/iscs_new/parser/index.js +++ b/src/iscs_new/factory/index.js @@ -9,6 +9,7 @@ const shapeBuilderMap = { [shapeType.Element]: Element, [shapeType.Compose]: Compose } + class ShapeFactory { constructor(map) { this.$map = map; diff --git a/src/iscs_new/map.js b/src/iscs_new/map.js index c0bc12ea5..4961de849 100644 --- a/src/iscs_new/map.js +++ b/src/iscs_new/map.js @@ -6,7 +6,7 @@ import Painter from './painter'; import Option from './option'; import Controller from './controller'; // 事件集合 import DefaultStyle from './config/defaultStyle'; // 样式集合 -import ShapeFactory from './parser'; +import ShapeFactory from './factory'; const renderer = 'canvas'; const devicePixelRatio = 1; diff --git a/src/iscs_new/option.js b/src/iscs_new/option.js index f047c14b2..e214aa06e 100644 --- a/src/iscs_new/option.js +++ b/src/iscs_new/option.js @@ -1,4 +1,4 @@ -class Options { +class Option { constructor(opts, trigger) { this.scaleIndex = 0; this.scaleList = [ @@ -82,4 +82,4 @@ class Options { } } -export default Options; +export default Option; diff --git a/src/iscs_new/painter.js b/src/iscs_new/painter.js index ce7f907e8..e34bdacb6 100644 --- a/src/iscs_new/painter.js +++ b/src/iscs_new/painter.js @@ -4,7 +4,7 @@ import Group from 'zrender/src/container/Group'; import TransformHandle from './transformHandle'; import StateHandle from './stateHandle'; import TipsHandle from './tipsHandle'; -import * as graphic from './utils/graphic'; +import * as graphic from './core/graphic'; class Painter extends Group { constructor(map) { diff --git a/src/iscs_new/selectHandle.js b/src/iscs_new/selectHandle.js index 86e58841d..0b7d02e91 100644 --- a/src/iscs_new/selectHandle.js +++ b/src/iscs_new/selectHandle.js @@ -1,6 +1,6 @@ import LineDraggable from './draggable/Line'; import ImageDraggable from './draggable/Image'; -import * as graphic from './utils/graphic'; +import * as graphic from './core/graphic'; export default class SelectHandle { constructor(map, controller) { diff --git a/src/iscs_new/selectingHandle.js b/src/iscs_new/selectingHandle.js index 65c963986..e70a1fead 100644 --- a/src/iscs_new/selectingHandle.js +++ b/src/iscs_new/selectingHandle.js @@ -1,4 +1,4 @@ -import * as graphic from './utils/graphic.js'; +import * as graphic from './core/graphic.js'; import shapeRender from './constant/shapeRender'; function shapeStyleBuilder() { diff --git a/src/iscs_new/tipsHandle.js b/src/iscs_new/tipsHandle.js index 796280d39..41b8a2f41 100644 --- a/src/iscs_new/tipsHandle.js +++ b/src/iscs_new/tipsHandle.js @@ -1,4 +1,4 @@ -import * as graphic from './utils/graphic'; +import * as graphic from './core/graphic'; import Eventful from 'zrender/src/mixin/Eventful'; import shapeRender from './constant/shapeRender';