Эх сурвалжийг харах

完成所有关于编辑器的修改

完成所有关于编辑器的修改
dangyunlong 1 долоо хоног өмнө
parent
commit
b7a4b547e3

+ 0 - 1
src/components/edit/myEditor.vue

@@ -16,7 +16,6 @@ export default {
   },
   data() {
     return {
-      editorInstance:{},
       componentKey: 0, // 用于强制重新渲染
       content: '',
       init: {

+ 0 - 87
src/styles/global.less

@@ -337,93 +337,6 @@
 
 /*页面布局 end------------------------------------------------------------>*/
 
-/*quill汉化 start------------------------------------------------------------>*/
-.ql-snow .ql-tooltip[data-mode=link]::before {
-  content: "请输入链接地址:" !important;
-}
-
-.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
-  border-right: 0px;
-  content: '保存' !important;
-  padding-right: 0px;
-}
-
-.ql-snow .ql-tooltip[data-mode=video]::before {
-  content: "请输入视频地址:" !important;
-}
-
-.ql-snow .ql-picker.ql-size .ql-picker-label::before,
-.ql-snow .ql-picker.ql-size .ql-picker-item::before {
-  content: '14px' !important;
-}
-
-.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,
-.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before {
-  content: '10px' !important;
-}
-
-.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,
-.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before {
-  content: '18px' !important;
-}
-
-.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,
-.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before {
-  content: '32px' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item::before {
-  content: '文本' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
-  content: '标题1' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
-  content: '标题2' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
-  content: '标题3' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
-  content: '标题4' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
-  content: '标题5' !important;
-}
-
-.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
-.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
-  content: '标题6' !important;
-}
-
-.ql-snow .ql-picker.ql-font .ql-picker-label::before,
-.ql-snow .ql-picker.ql-font .ql-picker-item::before {
-  content: '标准字体' !important;
-}
-
-.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,
-.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before {
-  content: '衬线字体' !important;
-}
-
-.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,
-.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before {
-  content: '等宽字体' !important;
-}
-
-/*quill汉化 end------------------------------------------------------------>*/
-
 // el-cascader高度 start
 .el-cascader-panel {
   height: 500px;

+ 10 - 35
src/views/chat/creatTopic.vue

@@ -16,7 +16,7 @@
               <el-input v-model="form.title" autocomplete="off" placeholder="请输入课题标题"></el-input>
             </el-form-item>
             <el-form-item label="课题内容:" prop="" class="custom-align-right">
-                <!--这里是富文本-->
+              <myEditor ref="myEditor" v-model="form.content"></myEditor>
             </el-form-item>
             <el-form-item label="建立群聊:" prop="is_group" class="custom-align-right">
               <el-radio-group v-model="form.is_group" :disabled="this.$route.query.id!=undefined">
@@ -49,10 +49,13 @@
 import tableTitle from './components/tableTitle';
 //引入公用样式
 import '@/styles/global.less';
+//引入富文本编辑器
+import myEditor from '../../components/edit/myEditor.vue';
 
 export default {
   components: {
-    tableTitle
+    tableTitle,
+    myEditor
   },
   data() {
     //0.全局操作 start ------------------------------------------------------------>
@@ -206,7 +209,10 @@ export default {
         console.log(res);
         this.form.title = res.data.title;
         this.form.type = res.data.type;
-        this.form.content = res.data.content;
+        //回显编辑器内容
+        this.$nextTick(() => {
+          this.form.content = res.data.content;
+        });
         this.form.is_group = res.data.is_group;
         this.form.group_name = res.data.group_name;
         this.form.author = res.data.author;
@@ -291,43 +297,12 @@ export default {
       this.editStatus = false;
       console.log("新建商圈!")
     }
-
-    //复制内容到富文本 start ------------------------------------------------------------>
-    
-    //复制富文本 end ------------------------------------------------------------>
   },
 };
 </script>
 
 <style scoped lang="less">
-  //文本编辑器
-  .QuillTitle {
-    line-height: 36px;
-    font-size: 14px;
-    color: #606266;
-    font-weight:bold;
-    padding-left: 30px;
-    span{
-      color: #ff4949
-    }
-    .QuillModelBtn {
-      display: inline-block;
-      margin-left: 10px;
-      font-size: 12px;
-      color: #999;
-      cursor: pointer;
-    }
-  }
-  .editor-container {
-    height: 420px;
-    padding-bottom:20px;
-  }
-  .my-quill-editor {
-    height: 320px;
-  }
-  .ql-editor {
-    height: 320px;
-  }
+ 
   //执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
   ::v-deep .custom-form-item > .el-form-item__label {
     line-height: 140px !important;

+ 9 - 97
src/views/crawler/webCrawlerListEdit.vue

@@ -75,31 +75,9 @@
                             <i class="el-icon-warning"></i>
                         </el-tooltip>
                     </el-form-item>
-                    <!-- 富文本编辑器配置 -->
-                    <div class="QuillTitle">
-                        <span>* </span>资讯内容:
-                        <div @click="toggleSourceMode" class="QuillModelBtn">
-                            {{ showHtml ? '切换到编辑模式' : '切换到源码模式' }}
-                        </div>
-                    </div>
-                    <el-form-item label="">
-                        <div class="editor-container">
-                            <div v-if="showHtml">
-                                <textarea v-model="editorHtml" style="width: 100%; height: 400px;"></textarea>
-                            </div>
-                            <div v-else>
-                                <quill-editor ref="quillEditor" v-model="ruleForm.content" :options="editorOptions"
-                                    class="my-quill-editor" />
-                            </div>
-                            <!-- 多图上传隐藏的input -->
-                            <input type="file" ref="multiFileInput" @change="handleMultipleFiles" multiple hidden
-                                accept="image/jpeg, image/png" />
-                        </div>
-                    </el-form-item>
-                    <el-form-item label="资讯内容:" prop="">
-                        <!--这里是富文本-->
+                    <el-form-item label="资讯内容:" prop="content">
+                        <myEditor ref="myEditor" v-model="ruleForm.content"></myEditor>
                     </el-form-item>
-                    
                     <el-form-item label="作者:" prop="author">
                         <el-input v-model="ruleForm.author" placeholder="请输入发布资讯的作者"></el-input>
                     </el-form-item>
@@ -148,11 +126,13 @@ import tableTitle from './webCrawlerListEdit/tableTitle.vue';
 //引入公用样式
 import '@/styles/global.less';
 import { updateInfo, getOneInfo } from '@/api/crawler'
-
+//引入富文本编辑器
+import myEditor from '../../components/edit/myEditor.vue';
 
 export default {
     components: {
         tableTitle,  //表格标题
+        myEditor
     },
     data() {
         return {
@@ -437,48 +417,16 @@ export default {
             this.logoUrl = data.data.imgurl
             this.ruleForm.keywords = data.data.keyword
             this.ruleForm.desc = data.data.introduce
-            this.ruleForm.content = data.data.content  //内容
+            //回显编辑器内容
+            this.$nextTick(() => {
+                this.ruleForm.content = data.data.content  //内容
+            });
             this.ruleForm.author = data.data.author
             this.ruleForm.count = data.data.hits
             this.ruleForm.source = data.data.copyfrom
             this.ruleForm.link = data.data.fromurl
         })
 
-        //复制内容到富文本 start ------------------------------------------------------------>
-        this.$nextTick(() => {
-            const quillEditor = this.$refs.quillEditor.quill;
-
-            if (quillEditor) {
-                console.log('Quill 编辑器已初始化');
-
-                // 在粘贴事件触发时,记录所有 img 的 src
-                quillEditor.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => {
-                    if (node.tagName === 'IMG') {
-                        const imageUrl = node.getAttribute('src');
-                        console.log('检测到粘贴的图片 URL:', imageUrl);
-
-                        if (imageUrl && !imageUrl.startsWith('data:') && !imageUrl.startsWith('file://')) {
-                            // 先处理图片上传
-                            this.handleImageFromWeb(imageUrl).then((uploadedImageUrl) => {
-                                // 查找编辑器中所有 img 标签并替换 src
-                                const imgs = quillEditor.root.querySelectorAll('img');
-                                imgs.forEach((img) => {
-                                    if (img.getAttribute('src') === imageUrl) {
-                                        img.setAttribute('src', uploadedImageUrl);  // 替换 src
-                                        console.log('图片 src 已替换为:', uploadedImageUrl);
-                                    }
-                                });
-                            });
-                        }
-                    }
-                    return delta;  // 返回原始 delta
-                });
-            } else {
-                console.error('Quill 初始化失败');
-            }
-
-        });
-        //复制富文本 end ------------------------------------------------------------>
     }
 }
 </script>
@@ -489,42 +437,6 @@ p {
     margin: 0;
 }
 
-//文本编辑器
-.QuillTitle {
-    line-height: 36px;
-    font-size: 14px;
-    color: #606266;
-    font-weight: bold;
-    padding-left: 30px;
-
-    span {
-        color: #ff4949
-    }
-
-    .QuillModelBtn {
-        display: inline-block;
-        margin-left: 10px;
-        font-size: 12px;
-        color: #999;
-        cursor: pointer;
-    }
-}
-
-.editor-container {
-    // height: 420px;
-    height: 375px;
-    padding-bottom: 20px;
-    background-color: #fff;
-}
-
-.my-quill-editor {
-    height: 320px;
-}
-
-.ql-editor {
-    height: 320px;
-}
-
 .layerBox {
     padding: 30px 20px;
     position: relative;

+ 9 - 154
src/views/news/addGood.vue

@@ -105,7 +105,6 @@
 
               </el-upload>
             </div>
-
           </el-form-item>
           <div class="imgBox" style="margin-left: 100px ;margin-bottom: 20px; padding-top: -20px;">
             最多可上传5张,每张图片大小不能超过500K,推荐上传图片尺寸
@@ -120,11 +119,11 @@
           </el-form-item>
           <el-form-item label="详情说明:" prop="description" class="custom-align-right">
             <!--这里是富文本-->
+            <myEditor ref="myEditor" v-model="form.detail"></myEditor>
           </el-form-item>
           <el-form-item label="浏览量:" prop="hits" class="custom-align-right">
             <el-input type="number" v-model="form.hits" autocomplete="off" placeholder="请输入浏览量"></el-input>
           </el-form-item>
-
           <el-form-item label="联系人:" prop="contact" class="custom-align-right">
             <el-input v-model="form.contact" autocomplete="off" placeholder="请输入联系人"></el-input>
           </el-form-item>
@@ -164,12 +163,14 @@ import tableTitle from './components/tableTitle';
 import '@/styles/global.less';
 //格式化时间
 import { formatLocalDate } from '@/utils/public';
-
+//引入富文本编辑器
+import myEditor from '../../components/edit/myEditor.vue';
 
 
 export default {
   components: {
-    tableTitle
+    tableTitle,
+    myEditor
   },
   data() {
     //0.全局操作 start ------------------------------------------------------------>
@@ -241,36 +242,6 @@ export default {
         city_id: '',
         imgurl: [],//缩略图
       },
-      // form: {
-      //   //1.1使用了外链
-      //   name: 'ceshi',//商品标题
-      //   type_id:1,//布类型:1:供应,2求购
-      //   city_arr_id: [1],//行政区划
-      //   cat_arr_id:'',//导航池名称
-      //   website_id: "2",
-      //   catid: "1",
-      //   cat_arr_id: [1],
-      //   name:"商品",
-      //   price:"100.00",
-      //   unit:"元",
-      //   min:"100",
-      //   max:"1000",
-      //   islong:"1",
-      //   validity:"2034-11-08 10:49:47",
-      //   // imgs: "",
-      //   keyword: "关键词",
-      //   description: "描述",
-      //   detail: "细节",
-      //   hits: "1",
-      //   contact: '联系人',
-      //   phone: '1800000000',
-      //   landline: '0511-12345678',
-      //   email: '123456@qq.com',
-      //   postal: '123456',
-      //   address: '详细地址',
-      //   city_id :1,
-      //   imgurl:['http://192.168.1.127:9501/image/20250227/1740674706184955.jpg','http://192.168.1.127:9501/image/20250227/1740674706184955.jpg'],//缩略图
-      // },
       //1.2 表单验证规则
       formRules: {
         type_id: [{ required: true, trigger: 'blur', validator: validateEmpty }],
@@ -607,7 +578,10 @@ export default {
         this.form.validity = res.data.validity;
         this.form.keyword = res.data.keyword;
         this.form.description = res.data.description;
-        this.form.detail = res.data.detail;
+        //回显编辑器内容
+        this.$nextTick(() => {
+          this.form.detail = res.data.detail;
+        });
         this.form.hits = res.data.hits;
         this.form.contact = res.data.contact;
         this.form.phone = res.data.phone;
@@ -615,7 +589,6 @@ export default {
         this.form.email = res.data.email;
         this.form.postal = res.data.postal;
         this.form.address = res.data.address;
-
       })
     },
     async loadCascaderPath(path) {
@@ -703,12 +676,6 @@ export default {
       })
     },
     //跳转操作 end ------------------------------------------------------------>
-
-    //4.富文本编辑器 start ------------------------------------------------------------>
-    //4.1 编辑器点击上传图片
-    
-    //富文本编辑器 end ------------------------------------------------------------>
-
   },
   watch: {
     'form.type_id': {
@@ -783,122 +750,10 @@ export default {
     }
     this.fetchWebsiteOptions();
     this.getUserInfo();
-
-    //复制内容到富文本 start ------------------------------------------------------------>
-    this.$nextTick(() => {
-      const quillEditor = this.$refs.quillEditor.quill;
-
-      if (quillEditor) {
-        console.log('Quill 编辑器已初始化');
-
-        // 在粘贴事件触发时,记录所有 img 的 src
-        quillEditor.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => {
-          if (node.tagName === 'IMG') {
-            const imageUrl = node.getAttribute('src');
-            console.log('检测到粘贴的图片 URL:', imageUrl);
-
-            if (imageUrl && !imageUrl.startsWith('data:') && !imageUrl.startsWith('file://')) {
-              // 先处理图片上传
-              this.handleImageFromWeb(imageUrl).then((uploadedImageUrl) => {
-                // 查找编辑器中所有 img 标签并替换 src
-                const imgs = quillEditor.root.querySelectorAll('img');
-                imgs.forEach((img) => {
-                  if (img.getAttribute('src') === imageUrl) {
-                    img.setAttribute('src', uploadedImageUrl);  // 替换 src
-                    console.log('图片 src 已替换为:', uploadedImageUrl);
-                  }
-                });
-              });
-            }
-          }
-          return delta;  // 返回原始 delta
-        });
-      } else {
-        console.error('Quill 初始化失败');
-      }
-
-    });
-    //复制富文本 end ------------------------------------------------------------>
   },
 };
 </script>
 <style scoped lang="less">
-//文本编辑器
-.QuillTitle {
-  line-height: 36px;
-  font-size: 14px;
-  color: #606266;
-  font-weight: bold;
-  padding-left: 30px;
-
-  span {
-    color: #ff4949
-  }
-
-  .QuillModelBtn {
-    display: inline-block;
-    margin-left: 10px;
-    font-size: 12px;
-    color: #999;
-    cursor: pointer;
-  }
-}
-
-.editor-container {
-  height: 420px;
-  padding-bottom: 20px;
-}
-
-.my-quill-editor {
-  height: 320px;
-}
-
-.ql-editor {
-  height: 320px;
-}
-
-/* 富文本对齐方式 */
-.ql-align-center {
-  text-align: center;
-}
-
-.ql-align-right {
-  text-align: right;
-}
-
-.ql-indent-1 {
-  padding-left: 16px;
-}
-
-.ql-indent-2 {
-  padding-left: 32px;
-}
-
-.ql-indent-3 {
-  padding-left: 48px;
-}
-
-.ql-indent-4 {
-  padding-left: 64px;
-}
-
-.ql-indent-5 {
-  padding-left: 80px;
-}
-
-.ql-indent-6 {
-  padding-left: 96px;
-}
-
-.ql-indent-7 {
-  padding-left: 112px;
-}
-
-.ql-indent-8 {
-  padding-left: 128px;
-}
-
-
 //执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
 ::v-deep .custom-form-item>.el-form-item__label {
   line-height: 140px !important;

+ 0 - 4
src/views/news/addJobHunting.vue

@@ -1048,10 +1048,6 @@ export default {
       this.editStatus = false;
       console.log("添加新闻!")
     }
-    //复制内容到富文本 start ------------------------------------------------------------>
-
-    
-    //复制富文本 end ------------------------------------------------------------>
   },
   watch: {
     'form.job_experience': {

+ 29 - 84
src/views/news/creatNews.vue

@@ -5,14 +5,6 @@
       <el-form :model="form" ref="form" :rules="formRules" label-position="left" label-width="120px">
         <div class="formDiv">
           <el-form-item label="资讯题目:" prop="title" class="custom-align-right">
-            <template #label>
-              <span class="askBox">
-                资讯题目:
-                <!-- <el-tooltip class="item" effect="dark" content="资讯标题,如:三农市场网_网站列表_全国信息一体化网络平台_项目大全。" placement="top">
-                  <i class="el-icon-question"></i>
-                </el-tooltip> -->
-              </span>
-            </template>
             <el-input v-model="form.title" autocomplete="off" placeholder="请输入资讯标题"></el-input>
             <el-checkbox v-model="form.islink">是否使用外链</el-checkbox>
           </el-form-item>
@@ -26,9 +18,6 @@
               <el-cascader :key="parentKey_2" v-model="form.cat_arr_id" placeholder="请选择要绑定的父级名称" :props="parentData_2"
                 popper-class="my_cascader" filterable clearable></el-cascader>
             </el-form-item>
-            <!-- <el-form-item label="导航池名称:" prop="cat_arr_id" class="custom-align-right">
-              <el-cascader :key="parentKey" v-model="form.cat_arr_id" placeholder="请选择要绑定的导航池名称" :props="parentData" filterable clearable></el-cascader>
-            </el-form-item> -->
             <el-form-item label="外链地址:" prop="linkurl" class="custom-align-right">
               <el-input v-model="form.linkurl" autocomplete="off" placeholder="请输入外链地址"></el-input>
             </el-form-item>
@@ -69,8 +58,6 @@
                     <el-option label="头条" :value="1"></el-option>
                     <el-option label="轮播图" :value="2"></el-option>
                     <el-option label="今日热点" :value="6"></el-option>
-                    <!-- <el-option label="热点资讯" :value="4"></el-option>
-                    <el-option label="资讯推荐" :value="5"></el-option> -->
                   </el-select>
                 </el-form-item>
               </div>
@@ -104,7 +91,6 @@
                   </span>
                 </template>
                 <tagInput :initialTags="tags" @tags-updated="updateTags"></tagInput>
-                <!-- <el-input v-model="form.keyword" autocomplete="off" placeholder="请输入资讯关键词"></el-input> -->
               </el-form-item>
               <el-form-item label="资讯描述:" prop="" class="custom-align-right">
                 <template #label>
@@ -154,45 +140,6 @@
               <el-form-item label="资讯内容:" prop="content" class="custom-align-right">
                 <myEditor ref="myEditor" v-model="form.content"></myEditor>
               </el-form-item> 
-              <!-- <el-form-item label="作者:" prop="author" class="custom-align-right">
-                <el-input v-model="form.author" autocomplete="off" placeholder="请输入作者"></el-input>
-              </el-form-item>
-              <el-form-item label="浏览量:" class="custom-align-right">
-                <el-input v-model="form.hits" autocomplete="off" placeholder="请输入浏览量"></el-input>
-              </el-form-item>
-              <el-form-item label="是否为原创:" prop="is_original" class="custom-align-right">
-                <el-radio-group v-model="form.is_original" @change="changeIsOriginal">
-                  <el-radio :label="1">是</el-radio>
-                  <el-radio :label="0">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-              <div v-if="form.is_original == 0">
-                <el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
-                  <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"></el-input>
-                </el-form-item>
-                <el-form-item label="来源链接:" prop="fromurl" class="custom-align-right">
-                  <el-input v-model="form.fromurl" autocomplete="off" placeholder="请输入来源链接"></el-input>
-                </el-form-item>
-                <div class="disclaimerBox">
-                  <div class="disclaimerTitle">
-                    <img src="@/assets/public/check.png" />同意《免责声明》:
-                  </div>
-                  <div class="disclaimerText">
-                    本文来源于网络转载,仅供学习交流使用,不构成商业目的。版权归原作者所有,如涉及作品内容、版权和其他问题,请在30日内与本站联系,我们将在第一时间处理。</div>
-                </div>
-              </div>
-              <div v-if="form.is_original == 1">
-                <el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
-                  <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"
-                    disabled="disabled"></el-input>
-                </el-form-item>
-              </div> -->
-              <!-- <el-form-item label="资讯状态:" class="custom-align-right" style="width: 100%;" v-if="creatNews_user_type == 10000">
-                <el-select v-model="form.status" placeholder="请选择..">
-                  <el-option label="已发布" :value="1"></el-option>
-                  <el-option label="待发布" :value="0"></el-option>
-                </el-select>
-              </el-form-item> -->
               <el-form-item label="是否开启投票:" prop="is_survey" class="custom-align-right">
                 <el-radio-group v-model="form.is_survey">
                   <el-radio :label="1">是</el-radio>
@@ -383,8 +330,7 @@ export default {
         //选项
         survey_type: [{ required: true, trigger: 'blur', validator: validateRadio }],
       },
-      //1.3富文本编辑器配置
-      //无需配置 已移除quill编辑器 2025-4-7
+
       //1.4图片上传
       imgUrl: "",//在页面上显示缩略图
       //获取父级导航池
@@ -488,29 +434,6 @@ export default {
 
   },
   methods: {
-
-    handleDelete() {
-      // 删除图片
-      this.imgUrl = ''; // 清空图片 URL
-      this.form.imgurl = ''; // 清空表单中的图片 URL
-    },
-    //---------------------------
-    addInput(index) {
-      // 在当前索引后插入一个新的输入框对象
-      if (this.inputList.length > 10) {
-        this.$message.warning('最多只能添加10个文本框');
-        return false;
-      }
-      this.inputList.splice(index + 1, 0, { value: '' });
-    },
-    deleteInput(index) {
-      if (this.inputList.length > 1) {
-        // 如果输入框数量大于 1,则删除当前索引对应的输入框对象
-        this.inputList.splice(index, 1);
-      } else {
-        this.$message.warning('至少保留一个输入框');
-      }
-    },
     //1.提交表单 start ------------------------------------------------------------>
     //1.1 直接上传图片
     beforeAvatarUpload(file) {
@@ -688,6 +611,12 @@ export default {
       console.log("行政区划ID已更新:", value);
       this.form.city_arr_id = value;
     },
+    //1.5 删除图片
+    handleDelete() {
+      // 删除图片
+      this.imgUrl = ''; // 清空图片 URL
+      this.form.imgurl = ''; // 清空表单中的图片 URL
+    },
     //提交表单 end ------------------------------------------------------------>
 
     //2.跳转操作 start ------------------------------------------------------------>
@@ -939,11 +868,8 @@ export default {
     },
     //跳转操作 end ------------------------------------------------------------>
 
-    //4.富文本编辑器 start ------------------------------------------------------------>
-    //无需配置 移除quill编辑器 2025-4-7
-    //4.富文本编辑器 end ------------------------------------------------------------>
 
-    //5.站点选择 start ------------------------------------------------------------>
+    //5.站点选择 曹国庆 start ------------------------------------------------------------>
     get_creatNews_form_id_fun() {
       //判断用户类型ajax
       this.$store.dispatch('public/getInfo').then(res => {
@@ -1006,8 +932,27 @@ export default {
     //推荐等级多选获取到的数据
     levelChange(value) {
       this.form.level = value;
-    }
-    //5.站点选择 end ------------------------------------------------------------>
+    },
+    //5.站点选择 曹国庆 end ------------------------------------------------------------>
+
+    //6.问卷 刘佳伟 start ------------------------------------------------------------>
+    addInput(index) {
+      // 在当前索引后插入一个新的输入框对象
+      if (this.inputList.length > 10) {
+        this.$message.warning('最多只能添加10个文本框');
+        return false;
+      }
+      this.inputList.splice(index + 1, 0, { value: '' });
+    },
+    deleteInput(index) {
+      if (this.inputList.length > 1) {
+        // 如果输入框数量大于 1,则删除当前索引对应的输入框对象
+        this.inputList.splice(index, 1);
+      } else {
+        this.$message.warning('至少保留一个输入框');
+      }
+    },
+    //6.问卷 刘佳伟 end ------------------------------------------------------------>
   },
   mounted() {
     this.creatNews_user_type = getUseType()

+ 1 - 7
vue.config.js

@@ -70,13 +70,7 @@ module.exports = {
       alias: {
         '@': resolve('src')
       }
-    },
-    plugins: [
-      new webpack.ProvidePlugin({
-        'window.Quill': 'quill/dist/quill.js',  // 确保 Quill 在全局作用域内可用
-        Quill: 'quill/dist/quill.js'  // 手动引入 Quill
-      })
-    ]
+    }
   },
   chainWebpack(config) {
     // it can improve the speed of the first screen, it is recommended to turn on preload