From 333fe44c837afba40a8586c1fb4ebdb45cda16c0 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 28 五月 2024 16:43:04 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/components/drawflow/index.vue | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/components/drawflow/index.vue b/src/components/drawflow/index.vue index 36bdf97..8c8b594 100644 --- a/src/components/drawflow/index.vue +++ b/src/components/drawflow/index.vue @@ -1,18 +1,27 @@ <template> - <div class="drawflow"> - <div class="menu"> - <div class="menuItem"> + <div + class="drawflow" + :style="{ borderColor: primaryColor ? primaryColor : '#ccc' }" + > + <div + class="menu" + :style="{ borderColor: primaryColor ? primaryColor : '#ccc' }" + > + <div + class="menuItem" + :style="{ borderColor: primaryColor ? primaryColor : '#ccc' }" + > <div class="drag-drawflow" draggable="true" @dragstart="drag" data-node="template" > - <span>鑺傜偣</span> + <span>鎷栨嫿姝ゅ鍒涘缓</span> </div> </div> </div> - <div class="content" id="drawflow" @drop="drop" @dragover="allowDrop"> + <div class="content" :id="strId" @drop="drop" @dragover="allowDrop"> <div class="btn-export" @click="exportData">瀵煎嚭</div> <div class="btn-clear" @click="editor.clearModuleSelected()">娓呯┖</div> </div> @@ -34,17 +43,25 @@ importData: { type: Object, }, + primaryColor: { + type: String, + }, + strId: { + type: String, + default: "drawflow", + }, }, mounted() { this.init(); }, methods: { exportData() { - console.log(this.editor.export()); + let dataJ = this.editor.export(); + this.$emit("getDrawData", dataJ); }, init() { this.editor = new Drawflow( - document.getElementById("drawflow"), + document.getElementById(this.strId), Vue, this ); @@ -169,10 +186,10 @@ let noneEle = ` <div class="contentWall"> <div class="contentTitle"> - <input df-title /> + <input placeholder="璇疯緭鍏ユ爣棰�" df-title /> </div> <div class="contentText"> - <textarea rows="4" df-content></textarea> + <textarea rows="4" placeholder="璇疯緭鍏ユ弿杩�" df-content></textarea> </div> </div> `; @@ -200,7 +217,7 @@ </script> <style scoped> -@import 'drawflow/dist/drawflow.min.css'; +@import "drawflow/dist/drawflow.min.css"; .drawflow { width: 100%; height: 100%; -- Gitblit v1.9.1