From 4e974b7b54f3ee0561a7291e6fd60e4a4491c6de Mon Sep 17 00:00:00 2001
From: unknown <qq1940665526@163.com>
Date: 星期二, 28 五月 2024 16:39:35 +0800
Subject: [PATCH] 增加流程图

---
 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