新增绘制组件
parent
c85ec3b037
commit
f012fbfcac
@ -1,22 +1,42 @@
|
||||
[{
|
||||
"type": "AlternatorSvg",
|
||||
"title": "发电机",
|
||||
"template": "<ellipse id=\"c1\" cx=\"50\" cy=\"50\" rx=\"35\" ry=\"35\" fill=\"none\" :stroke=\"svg_color\" stroke-width=\"2\" transform=\"translate(-50,-50)\"></ellipse><path id=\"l1\" d=\"M30,50 C30,44 34,40 40,40 46,40 50,44 50,50 M50,50 C50,56 54,60 60,60 66,60 70,56 70,50 \" fill=\"none\" :stroke=\"svg_color\" stroke-width=\"2\" transform=\"translate(-50,-50)\"></path>",
|
||||
"props": ["svg_color"],
|
||||
"default_color":"#00FF00",
|
||||
"template": "<ellipse id=\"c1\" cx=\"50\" cy=\"50\" rx=\"35\" ry=\"35\" fill=\"none\" :stroke=\"prop_data.svgColor\" stroke-width=\"2\" transform=\"translate(-50,-50)\"></ellipse><path id=\"l1\" d=\"M30,50 C30,44 34,40 40,40 46,40 50,44 50,50 M50,50 C50,56 54,60 60,60 66,60 70,56 70,50 \" fill=\"none\" :stroke=\"prop_data.svgColor\" stroke-width=\"2\" transform=\"translate(-50,-50)\"></path>",
|
||||
"props": ["prop_data"],
|
||||
"default_attr":{
|
||||
"color":"#FF0000"
|
||||
},
|
||||
"create_type":"draggable",
|
||||
"priview_img":"/AlternatorSvg.png"
|
||||
}, {
|
||||
"type": "ArrowDownSvg",
|
||||
"title": "箭头向下",
|
||||
"template": "<polygon points=\"0,-8 5,0 10,-8\" :fill=\"svg_color\" :stroke=\"svg_color\" stroke-width=\"2\" transform=\"translate(-5,0)\"></polygon>",
|
||||
"props": ["svg_color"],
|
||||
"default_color":"#00FF00",
|
||||
"template": "<polygon points=\"0,-8 5,0 10,-8\" :fill=\"prop_data.svgColor\" :stroke=\"prop_data.svgColor\" stroke-width=\"2\" transform=\"translate(-5,0)\"></polygon>",
|
||||
"props": ["prop_data"],
|
||||
"default_attr":{
|
||||
"color":"#FF0000"
|
||||
},
|
||||
"create_type":"draggable",
|
||||
"priview_img":"/ArrowDownSvg.png"
|
||||
}, {
|
||||
"type": "ArrowUpSvg",
|
||||
"title": "箭头向上",
|
||||
"template": "<polygon points=\"0,8 5,0 10,8\" :fill=\"svg_color\" :stroke=\"svg_color\" stroke-width=\"2\" transform=\"translate(-5,0)\"></polygon>",
|
||||
"props": ["svg_color"],
|
||||
"default_color":"#FF0000",
|
||||
"template": "<polygon points=\"0,8 5,0 10,8\" :fill=\"prop_data.svgColor\" :stroke=\"prop_data.svgColor\" stroke-width=\"2\" transform=\"translate(-5,0)\"></polygon>",
|
||||
"props": ["prop_data"],
|
||||
"default_attr":{
|
||||
"color":"#FF0000"
|
||||
},
|
||||
"create_type":"draggable",
|
||||
"priview_img":"/ArrowUpSvg.png"
|
||||
},
|
||||
{
|
||||
"type": "ConnLineSvg",
|
||||
"title": "连接线",
|
||||
"template": "<line x1=\"0\" y1=\"0\" :x2=\"(prop_data.mPoint.endX-prop_data.mPoint.startX)\" :y2=\"(prop_data.mPoint.endY-prop_data.mPoint.startY)\" :fill=\"prop_data.svgColor\" :stroke=\"prop_data.svgColor\" stroke-width=\"2\"></line>",
|
||||
"props": ["prop_data"],
|
||||
"default_attr":{
|
||||
"color":"#FF0000"
|
||||
},
|
||||
"create_type":"click",
|
||||
"priview_img":"/VerticalLineSvg.png"
|
||||
}]
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* @Author: yaolunmao
|
||||
* 简单状态管理
|
||||
*/
|
||||
|
||||
import {reactive } from 'vue';
|
||||
export const store = {
|
||||
state: reactive({
|
||||
CurrentlySelectedToolBar : {
|
||||
Type: '',//选中的工具栏svg类型
|
||||
TypeName: '',//选中的工具栏svg类型名称
|
||||
Title: '',//选中的工具栏svg标题
|
||||
Color: '',//选中的工具栏svg颜色
|
||||
CreateType: ''//选中工具栏的创建方式
|
||||
}
|
||||
}),
|
||||
|
||||
setCurrentlySelectedToolBarAction(newValue) {
|
||||
this.state.CurrentlySelectedToolBar = newValue
|
||||
},
|
||||
|
||||
clearCurrentlySelectedToolBarAction() {
|
||||
this.state.CurrentlySelectedToolBar = {
|
||||
Type: '',//选中的工具栏svg类型
|
||||
TypeName: '',//选中的工具栏svg类型名称
|
||||
Title: '',//选中的工具栏svg标题
|
||||
Color: '',//选中的工具栏svg颜色
|
||||
CreateType: ''//选中工具栏的创建方式
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
productionSourceMap: false,
|
||||
}
|
Loading…
Reference in New Issue