From 596cd0081e0eaa2e751ecaa6b007b564165c2f5c Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 29 二月 2024 16:11:20 +0800
Subject: [PATCH] mrshi

---
 admin/src/views/business/visitorSources.vue |   62 ++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 1 deletions(-)

diff --git a/admin/src/views/business/visitorSources.vue b/admin/src/views/business/visitorSources.vue
index ed83061..6c8e4e1 100644
--- a/admin/src/views/business/visitorSources.vue
+++ b/admin/src/views/business/visitorSources.vue
@@ -34,6 +34,9 @@
             <el-form-item label="璁垮绛旈璇存槑:" prop="description">
                 <el-input style="width: 50%;" type="textarea" v-model="form.description" placeholder="璇疯緭鍏�" v-trim/>
             </el-form-item>
+            <el-form-item label="鍏ュ巶椤荤煡:" prop="description">
+                <el-tiptap style="width: 50%;" v-model="form.description" :extensions="extensions" />
+            </el-form-item>
             <el-form-item>
                 <el-button type="primary" @click="submit">淇濆瓨閰嶇疆椤�</el-button>
             </el-form-item>
@@ -43,6 +46,31 @@
 
 <script>
 import { getVisitConfigDTO, updateVisitConfig } from '@/api/system/common'
+import {
+  // necessary extensions
+  Doc,
+  Text,
+  Paragraph,
+  Heading,
+  Bold,
+  Underline,
+  Italic,
+  Strike,
+  ListItem,
+  BulletList,
+  OrderedList,
+  Image,
+  Blockquote,
+  TextAlign,
+  Indent,
+  Table,
+  TableHeader,
+  TableCell,
+  TableRow,
+  TextColor,
+  HorizontalRule
+} from 'element-tiptap'
+import { upload } from '@/api/system/common'
 export default {
   name: 'visitorSources',
 
@@ -56,7 +84,39 @@
         isAnswer: 0,
         theme: '',
         description: ''
-      }
+      },
+      extensions: [
+        new Doc(),
+        new Text(),
+        new Paragraph(),
+        new Heading({ level: 5 }),
+        new Bold({ bubble: true }),
+        new Underline({ bubble: true, menubar: false }),
+        new Italic(),
+        new Strike(),
+        new ListItem(),
+        new BulletList(),
+        new OrderedList(),
+        new Image({
+          uploadRequest (file) {
+            const fd = new FormData()
+            fd.append('folder', 'visit')
+            fd.append('file', file)
+            return upload(fd).then(res => {
+              return res.url
+            })
+          }
+        }),
+        new Blockquote(),
+        new TextAlign(),
+        new Indent(),
+        new Table(),
+        new TableHeader(),
+        new TableCell(),
+        new TableRow(),
+        new HorizontalRule(),
+        new TextColor()
+      ]
     }
   },
 

--
Gitblit v1.9.3