From f012fbfcac198a1085604ea20695f2fd8d78993c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=AC=E8=BD=AE=E7=8C=AB?= <10928033@qq.com> Date: Fri, 2 Jul 2021 16:45:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=98=E5=88=B6=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babel.config.js | 3 + public/InterfaceReturn.json | 40 ++++-- src/components/LeftToolBar.vue | 61 +++++++-- src/components/SvgComponents.vue | 10 +- src/main.js | 5 + src/store/store.js | 31 +++++ src/views/CircuitEdit.vue | 214 ++++++++++++++++++++----------- src/vue.config.js | 3 + 8 files changed, 265 insertions(+), 102 deletions(-) create mode 100644 src/store/store.js create mode 100644 src/vue.config.js diff --git a/babel.config.js b/babel.config.js index e955840..0768f8e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,6 @@ +/* + * @Author: yaolunmao + */ module.exports = { presets: [ '@vue/cli-plugin-babel/preset' diff --git a/public/InterfaceReturn.json b/public/InterfaceReturn.json index 12d7ec9..62c9a78 100644 --- a/public/InterfaceReturn.json +++ b/public/InterfaceReturn.json @@ -1,22 +1,42 @@ [{ "type": "AlternatorSvg", "title": "发电机", - "template": "", - "props": ["svg_color"], - "default_color":"#00FF00", + "template": "", + "props": ["prop_data"], + "default_attr":{ + "color":"#FF0000" + }, + "create_type":"draggable", "priview_img":"/AlternatorSvg.png" }, { "type": "ArrowDownSvg", "title": "箭头向下", - "template": "", - "props": ["svg_color"], - "default_color":"#00FF00", + "template": "", + "props": ["prop_data"], + "default_attr":{ + "color":"#FF0000" + }, + "create_type":"draggable", "priview_img":"/ArrowDownSvg.png" }, { "type": "ArrowUpSvg", "title": "箭头向上", - "template": "", - "props": ["svg_color"], - "default_color":"#FF0000", + "template": "", + "props": ["prop_data"], + "default_attr":{ + "color":"#FF0000" + }, + "create_type":"draggable", "priview_img":"/ArrowUpSvg.png" -}] \ No newline at end of file +}, +{ + "type": "ConnLineSvg", + "title": "连接线", + "template": "", + "props": ["prop_data"], + "default_attr":{ + "color":"#FF0000" + }, + "create_type":"click", + "priview_img":"/VerticalLineSvg.png" +}] diff --git a/src/components/LeftToolBar.vue b/src/components/LeftToolBar.vue index 6807cfc..1962996 100644 --- a/src/components/LeftToolBar.vue +++ b/src/components/LeftToolBar.vue @@ -1,3 +1,4 @@ +