@@ -5,25 +6,34 @@
+ header="拖动组件">
- -
{{item.title}}
+ draggable="draggable">
- {{ text }}
+
+ -
+
{{item.title}}
+
+
+
+ header="图表">
{{ text }}
@@ -35,17 +45,39 @@ export default {
data () {
return {
activeKey: ['1'],//当前激活的key
- text: `这里是预留位置.`
+ text: `这里是预留位置.`,
+ draggableComponentList: [],//拖动组件
+ clickComponentList: [],//点击类型组件
};
},
+ watch: {
+ 'svgInfoData': function (val) {
+ this.draggableComponentList = val.filter(m => {
+ return m.create_type == 'draggable'
+ });
+ this.clickComponentList = val.filter(m => {
+ return m.create_type == 'click'
+ });
+ },
+ },
methods: {
- Mousedown (type, title, color) {
- window.CurrentlySelectedToolBar = {
+ /**
+ * @description: 点击左侧工具栏触发函数
+ * @param {*} type
+ * @param {*} title
+ * @param {*} default_attr 属性默认值
+ * @param {*} create_type 组件创建方式
+ * @return {*}
+ */
+ Mousedown (type, title, default_attr, create_type) {
+ let CurrentlySelectedToolBar = {
Type: type,//选中的工具栏svg类型
- TypeName:title,//选中的工具栏svg类型名称
- Title:title,//选中的工具栏svg标题
- Color:color//选中的工具栏svg颜色
+ TypeName: title,//选中的工具栏svg类型名称
+ Title: title,//选中的工具栏svg标题
+ Color: default_attr.color,//选中的工具栏svg颜色
+ CreateType: create_type//选中工具栏的创建方式
};
+ this.$store.setCurrentlySelectedToolBarAction(CurrentlySelectedToolBar);
},
}
};
@@ -128,4 +160,7 @@ export default {
}
}
}
+.toolbar-selected {
+ outline: 1px solid #0cf;
+}
\ No newline at end of file
diff --git a/src/components/SvgComponents.vue b/src/components/SvgComponents.vue
index f063a3b..fe1a96a 100644
--- a/src/components/SvgComponents.vue
+++ b/src/components/SvgComponents.vue
@@ -1,11 +1,14 @@
+
-
+