Jing 3 месяцев назад
Родитель
Сommit
848e141710

+ 7 - 3
src/views/crawler/webCrawler.vue

@@ -23,7 +23,7 @@
             <button class="btn" @click="addWebsite">添加网站</button>
             <el-row>
                 <template>
-                    <el-table class="my-table" :data="tableData" style="width: 100%">
+                    <el-table class="my-table"  v-loading="loading" :data="tableData" style="width: 100%">
                         <el-table-column fixed prop="id" label="编号" width="100">
                         </el-table-column>
                         <el-table-column prop="name" label="网站名称" width="">
@@ -79,8 +79,8 @@
                     <el-form-item label="规则类型:" prop="ruleType" class="keywords">
                         <el-select v-model="ruleForm.ruleType" placeholder="请选择规则类型" :disabled="disabledType">
                             <el-option label="一般规则" value="1"></el-option>
-                            <el-option label="接口规则" value="2"></el-option>
-                            <el-option label="自定义规则" value="3"></el-option>
+                            <!-- <el-option label="接口规则" value="2"></el-option>
+                            <el-option label="自定义规则" value="3"></el-option> -->
                         </el-select>
                         <el-tooltip class="item" effect="dark" content="列表翻页后,网址变化的为一般接口;列表翻页后,网址没变化的为接口规则。"
                             placement="top-start">
@@ -118,6 +118,7 @@ export default {
             activeId: '', // 被编辑的网站的id
             activeType: '', //被编辑网站的type
             disabled: true, //是否禁用
+            loading:true,
 
 
             // 分页器相关
@@ -161,6 +162,9 @@ export default {
                 page: this.page,
                 pageSize: this.pageSize,
             }).then(data => {
+                if(data.code==200){
+                    this.loading=false
+                }
                 console.log(data);
                 this.tableData = data.data.rep
                 this.total = data.data.count

+ 11 - 7
src/views/crawler/webCrawlerList.vue

@@ -43,20 +43,20 @@
 
             <el-row>
                 <template>
-                    <el-table class="my-table" :data="tableData" style="width: 100%">
+                    <el-table class="my-table" v-loading="loading" :data="tableData" style="width: 100%">
                         <el-table-column fixed prop="id" label="编号" width="80">
                         </el-table-column>
                         <el-table-column prop="title" label="资讯题目" width="230">
                         </el-table-column>
                         <el-table-column prop="oldtitle" label="原始资讯题目" width="230">
                         </el-table-column>
-                        <el-table-column prop="category.name" label="导航池名称" width="90">
+                        <el-table-column prop="category.name" label="导航池名称" width="120">
                         </el-table-column>
-                        <el-table-column prop="source" label="来源" width="180">
+                        <el-table-column prop="source" label="来源" width="120">
                         </el-table-column>
-                        <el-table-column label="导入状态" width="80" prop="state">
+                        <el-table-column label="导入状态" prop="state" width="100">
                         </el-table-column>
-                        <el-table-column prop="author" label="作者" width="80">
+                        <el-table-column prop="author" label="作者" width="90">
                         </el-table-column>
                         <el-table-column prop="created_at" label="采集时间" width="160">
                         </el-table-column>
@@ -128,6 +128,7 @@ export default {
             tableDivTitle: "任务规则列表",//表格标题
             // searchWebName: "", //搜索网站名称
             // dialogName:'关联导航池',
+            loading: true,
 
             //跳转传递的参数
             ruleId: "", //规则id
@@ -190,6 +191,9 @@ export default {
                 pageSize: this.pageSize
             }).then(data => {
                 console.log(data);
+                if (data.code == 200) {
+                    this.loading = false
+                }
                 this.total = data.data.count
                 this.tableData = data.data.rep
 
@@ -402,7 +406,7 @@ export default {
     }
 
     .searchBox {
-        margin-right: 100px;
+        margin-right: 30px;
 
         .searchTitle {
             padding-bottom: 10px;
@@ -429,7 +433,7 @@ export default {
             height: 38px;
             border: none;
             border-radius: 8px;
-            padding: 0 30px;
+            padding: 0 20px;
         }
 
         .search {

+ 211 - 25
src/views/crawler/webCrawlerListEdit.vue

@@ -26,32 +26,34 @@
                             <el-option v-for="item in options" :key="item.value" :label="item.label"
                                 :value="item.value">
                             </el-option>
-
                         </el-select>
                     </el-form-item>
                     <!-- 缩略图 -->
-                    <el-form-item label="缩略图:" prop="imgSrc">
+                    <el-form-item label="缩略图:" prop="imgSrc" :label-width="formLabelWidth"
+                        :class="['custom-form-item']" class="custom-align-right">
                         <div class="uploaderBox">
+                            <!--图片上传组件 start ------------------------------------------------------------>
                             <div class="avatar-upload-container" @mouseenter="hovering = true"
                                 @mouseleave="hovering = false">
                                 <!-- 上传组件 -->
                                 <el-upload class="avatar-uploader" action="#" :show-file-list="false"
                                     :before-upload="beforeAvatarUpload">
                                     <!-- 预览图片 -->
-                                    <img v-if="imgSrc" :src="imgSrc" class="avatar">
+                                    <img v-if="logoUrl" :src="logoUrl" class="avatar">
                                     <div v-else class="chooseImgDiv">
                                         <div>
                                             <img src="@/assets/public/upload/noImage.png">
-                                            <div>选择缩略图</div>
+                                            <div>选择图</div>
                                         </div>
                                     </div>
+                                    <input type="hidden" name="logo" v-model="ruleForm.imgSrc">
                                 </el-upload>
                                 <!-- 删除按钮,当鼠标悬浮时显示 -->
-                                <div v-if="hovering && iconSrc" class="delete-button" @click="handleDelete">
+                                <div v-if="hovering && logoUrl" class="delete-button" @click="handleDelete">
                                     <i class="el-icon-delete"></i>
                                 </div>
                             </div>
-                            <p class="imgTips">图片长宽比例为16:9, 大小不能超过500K。</p>
+                            <!--图片上传组件 end ------------------------------------------------------------>
                         </div>
                     </el-form-item>
                     <el-form-item label="资讯关键词:" prop="keywords" class="keywords">
@@ -73,30 +75,26 @@
                             <i class="el-icon-warning"></i>
                         </el-tooltip>
                     </el-form-item>
-                    <!-- 富文本 -->
-                    <!-- <div class="QuillTitle">
-                        <span>* </span>资讯内容
+                    <!-- 富文本编辑器配置 -->
+                    <div class="QuillTitle">
+                        <span>* </span>资讯内容:
                         <div @click="toggleSourceMode" class="QuillModelBtn">
                             {{ showHtml ? '切换到编辑模式' : '切换到源码模式' }}
                         </div>
                     </div>
-                    <el-form-item label="" prop="content">
+                    <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="form.content" :options="editorOptions"
+                                <quill-editor ref="quillEditor" v-model="ruleForm.content" :options="editorOptions"
                                     class="my-quill-editor" />
-                            </div> -->
+                            </div>
                             <!-- 多图上传隐藏的input -->
-                            <!-- <input type="file" ref="multiFileInput" @change="handleMultipleFiles" multiple hidden
+                            <input type="file" ref="multiFileInput" @change="handleMultipleFiles" multiple hidden
                                 accept="image/jpeg, image/png" />
                         </div>
-                    </el-form-item> -->
-                    <el-form-item label="资讯内容:" prop="content">
-                        <el-input type="textarea" v-model="ruleForm.content" placeholder="请输入资讯内容..."
-                            maxlength="5000"></el-input>
                     </el-form-item>
                     <el-form-item label="作者:" prop="author">
                         <el-input v-model="ruleForm.author" placeholder="请输入发布资讯的作者"></el-input>
@@ -123,7 +121,7 @@
                             <!-- <el-checkbox v-model="disclaimer" disabled="disabled"></el-checkbox> -->
                         </div>
                         <div class="disclaimerText">
-                            本文来源于网络转载,仅供学习交流使用,不构成商业目的。版权归作者所有,如涉及原作者所有,如涉及作品内容、版权和其他问题,请在30日内与本站联系,我们将在第一时间处理。</div>
+                            本文来源于网络转载,仅供学习交流使用,不构成商业目的。版权归原作者所有,如涉及作品内容、版权和其它问题,请在30日内与本网联系,我们将在第一时间处理。</div>
                     </div>
                 </el-form>
             </el-row>
@@ -152,6 +150,9 @@ import Quill from 'quill';  // 引入 Quill
 import Delta from 'quill-delta'; // 引入 Delta,用于手动修改文档
 import { options } from 'dropzone';
 
+// 注册 Image Resize 模块
+Quill.register('modules/imageResize', ImageResize);
+
 export default {
     components: {
         quillEditor,
@@ -170,9 +171,10 @@ export default {
             ruleId: '',
             source: '',
 
-            // beforeAvatarUpload: '',
-            imgSrc: '',
-            hovering: '',
+            //3.4 上传logo图片
+            logoUrl: '',
+            hovering: false, // 鼠标悬浮状态 悬浮时显示删除
+            
             options: [
                 {
                     value: 0,
@@ -332,7 +334,6 @@ export default {
         }
     },
     methods: {
-
         beforeAvatarUpload(file) {
             const isJPG = file.type === 'image/jpeg';
             const isPNG = file.type === 'image/png';
@@ -351,8 +352,8 @@ export default {
             formData.append('file', file);
 
             this.$store.dispatch('pool/uploadFile', formData).then(res => {
-                this.imgUrl = res.data.imgUrl;//显示缩略图
-                this.form.imgurl = res.data.imgUrl;//提供表单地址
+                this.logoUrl = res.data.imgUrl;//显示缩略图
+                this.ruleForm.imgSrc = res.data.imgUrl;//提供表单地址
                 console.log(res.data.imgUrl)
             }).catch(() => {
                 this.$message({
@@ -364,6 +365,10 @@ export default {
             // 阻止默认的上传行为
             return false;
         },
+        handleDelete() {
+            // 删除图片
+            this.logoUrl = ''; // 清空图片 URL
+        },
         // 提交表单
         goSubmit() {
             updateInfo({
@@ -410,7 +415,112 @@ export default {
         handleChange(value) {
             console.log(value);
             this.ruleForm.count = value
+        },
+
+        //4.富文本编辑器 start ------------------------------------------------------------>
+        //4.1 编辑器点击上传图片
+        handleImageClick() {
+            this.$refs.multiFileInput.click(); // 打开文件选择框
+        },
+        handleMultipleFiles(event) {
+            const files = event.target.files;
+            if (files.length) {
+                this.uploadMultipleImages(files); // 处理多图片上传
+            }
+        },
+        uploadMultipleImages(files) {
+            const uploadPromises = [];
+            for (let i = 0; i < files.length; i++) {
+                uploadPromises.push(this.uploadImage(files[i]));
+            }
+
+            Promise.all(uploadPromises).then(urls => {
+                const quillEditor = this.$refs.quillEditor.quill;
+                urls.forEach(url => {
+                    const range = quillEditor.getSelection();
+                    quillEditor.insertEmbed(range.index, 'image', url); // 在编辑器中插入图片
+                });
+            }).catch(error => {
+                this.$message.error('图片上传失败,请重试!');
+            });
+        },
+        uploadImage(file) {
+            const formData = new FormData();
+            formData.append('file', file);
+            return this.$store.dispatch('pool/uploadFile', formData)
+                .then(res => {
+                    if (res && res.data && res.data.imgUrl) {
+                        return res.data.imgUrl;
+                    } else {
+                        throw new Error('图片上传失败');
+                    }
+                })
+                .catch(error => {
+                    this.$message.error('图片上传失败,请重试!');
+                    throw error;
+                });
+        },
+
+        //4.2 图片粘贴上传
+        // 处理从网页粘贴的图片 URL
+        handleImageFromWeb(imageUrl) {
+            return new Promise((resolve) => {
+                console.log('开始下载图片:', imageUrl);
+
+                this.fetchImageAsBlob(imageUrl).then((blob) => {
+                    console.log('图片已下载为 Blob:', blob);
+
+                    const formData = new FormData();
+                    formData.append('file', blob, 'image.jpg');
+
+                    this.$store.dispatch('pool/uploadFile', formData).then((res) => {
+                        if (res && res.data && res.data.imgUrl) {
+                            console.log('图片上传成功:', res.data.imgUrl);
+                            resolve(res.data.imgUrl);
+                        } else {
+                            console.log('图片上传失败,保留原 URL:', imageUrl);
+                            resolve(imageUrl);
+                        }
+                    }).catch((error) => {
+                        console.error('图片上传时出现错误:', error);
+                        resolve(imageUrl);
+                    });
+                }).catch((error) => {
+                    console.error('图片下载失败:', error);
+                    resolve(imageUrl);
+                });
+            });
+        },
+        fetchImageAsBlob(url) {
+            return fetch(url)
+                .then(response => {
+                    if (!response.ok) {
+                        throw new Error('Failed to fetch image');
+                    }
+                    return response.blob();
+                });
+        },
+        //编辑源码
+        toggleSourceMode() {
+            if (!this.showHtml) {
+                // 切换到源码模式,将编辑器内容同步到 textarea 中
+                this.editorHtml = this.$refs.quillEditor.quill.root.innerHTML;
+                this.showHtml = true; // 显示 textarea
+            } else {
+                // 切换回富文本模式,将 textarea 内容同步回编辑器
+                this.showHtml = false; // 显示 Quill 编辑器
+
+                // Quill 编辑器可能被销毁,所以使用 $nextTick 确保 DOM 渲染完成后再操作编辑器
+                this.$nextTick(() => {
+                    if (this.$refs.quillEditor) {
+                        this.$refs.quillEditor.quill.root.innerHTML = this.editorHtml;
+                    } else {
+                        console.error('Quill 编辑器实例未找到');
+                    }
+                });
+            }
         }
+        //富文本编辑器 end ------------------------------------------------------------>
     },
     mounted() {
         this.ruleId = this.$route.query.ruleId
@@ -428,7 +538,7 @@ export default {
             this.ruleForm.url = data.data.linkurl
             this.ruleForm.name = data.data.category //导航池名称
             this.ruleForm.grade = data.data.level
-            this.ruleForm.imgSrc = data.data.imgurl
+            this.logoUrl = data.data.imgurl
             this.ruleForm.keywords = data.data.keyword
             this.ruleForm.desc = data.data.introduce
             this.ruleForm.content = data.data.content  //内容
@@ -437,6 +547,42 @@ export default {
             this.ruleForm.source = data.data.source
             this.ruleForm.link = data.data.copyfrom
         })
+
+        //复制内容到富文本 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>
@@ -447,6 +593,42 @@ 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;
@@ -550,6 +732,10 @@ p {
 
     //缩略图
     .uploaderBox {
+        .avatar {
+            width: 140px;
+            height: auto;
+        }
 
         .chooseImgDiv {
             background-color: #fff;

+ 312 - 194
src/views/crawler/webRule.vue

@@ -23,7 +23,7 @@
             <button class="btn" @click="addCrawlerRule">设置采集规则</button>
             <el-row>
                 <template>
-                    <el-table class="my-table" :data="tableData" style="width: 100%">
+                    <el-table class="my-table" v-loading="loading" :data="tableData" style="width: 100%">
                         <el-table-column fixed prop="id" label="编号" width="100">
                         </el-table-column>
                         <el-table-column prop="name" label="任务规则名" width="">
@@ -78,7 +78,7 @@
 
         <!-- 弹出框 -->
         <el-dialog :title="dialogName" :visible.sync="dialogTableVisible" width="50%" :close-on-click-modal="false">
-            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
+            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
                 <div class="one" v-show="this.webType == 1">
                     <div class="dialogText">
                         <el-form-item label="任务规则名:" prop="ruleName" class="keywords">
@@ -99,17 +99,17 @@
                         </el-form-item>
                         <div class="pageTwo">
                             <el-form-item label="第2页网址:" required class="keywords">
-                                <el-col :span="6">
+                                <el-col :span="8">
                                     <el-form-item prop="second_start">
                                         <el-input v-model="ruleForm.second_start" placeholder="请输入网址开头"></el-input>
                                     </el-form-item>
                                 </el-col>
-                                <el-col :span="6">
+                                <el-col :span="8">
                                     <el-form-item prop="second_num">
                                         <el-input v-model="ruleForm.second_num" placeholder="请输入代码页数"></el-input>
                                     </el-form-item>
                                 </el-col>
-                                <el-col :span="6" class="el_col_6_end">
+                                <el-col :span="8" class="el_col_6_end">
                                     <el-form-item prop="second_end">
                                         <el-input v-model="ruleForm.second_end" placeholder="请输入网址结束字符串"
                                             class="lastInput"></el-input>
@@ -122,9 +122,6 @@
                                     </div>
                                     <i class="el-icon-warning"></i>
                                 </el-tooltip>
-                                <!-- <p class="tips" v-show="!this.ruleForm.second_start">请输入第2页网址</p>
-                                <p class="tips" v-show="!this.ruleForm.second_num">请输入第2页网址</p>
-                                <p class="tips" v-show="!this.ruleForm.second_end">请输入第2页网址</p> -->
                             </el-form-item>
                         </div>
                         <el-form-item label="起始代码:" prop="startCode" class="keywords">
@@ -132,8 +129,8 @@
                             <el-tooltip placement="top-start">
                                 <div slot="content">
                                     起始代码为文章列表第一篇文章上面几行代码中一段代码<br />
-                                    如<'div class="ej list box clear">,输入为 .ej list box clear 埴入输入框内<br />
-                                        如<'ul class="ej list box clear">,输入为 .ej list box clearul 埴入输入框内
+                                    如&lt;div class="ej list box clear">&lt;ul>&lt;li>,输入为 .ej list box clear ul li
+                                    埴入输入框内
                                 </div>
                                 <i class="el-icon-warning"></i>
                             </el-tooltip>
@@ -144,24 +141,48 @@
                     </div>
 
                     <div class="dialogText">
+                        <!-- start -->
+                        <el-form-item label="详情页网址前缀:" prop="webSite_start" class="keywords">
+                            <el-input v-model="ruleForm.webSite_start" placeholder=" 请输入详情页网址前缀"></el-input>
+                            <el-tooltip placement="top-start">
+                                <div slot="content">
+                                    网址1:https://www.mfa.gov.cn/web/wjdt_674879/gjldrhd_674881/202412/t20241205_11539110.shtml<br />
+                                    网址2:https://www.mfa.gov.cn/web/wjdt_674879/gjldrhd_674881/202412/t20241205_11539102.shtml<br />
+                                    详情页网址前缀为 https://www.mfa.gov.cn/web/wjdt_674879/gjldrhd_674881/202412/ 填入输入框<br />
+                                    (即重复代码之前的代码填入输入框)
+                                </div>
+                                <i class="el-icon-warning"></i>
+                            </el-tooltip>
+                        </el-form-item>
+                        <el-form-item label="详情页标签:" prop="" class="keywords">
+                            <el-input v-model="ruleForm.detailPage" placeholder=" 请输入详情页起始标签"></el-input>
+                            <el-tooltip placement="top-start">
+                                <div slot="content">
+                                    详情页两边有除资讯详情内容时,此项需要填写<br />
+                                    标签内容为&lt;div class="news_details">,详情页标签填入.news_details 填入框内
+                                </div>
+                                <i class="el-icon-warning"></i>
+                            </el-tooltip>
+                        </el-form-item>
+                        <!-- end -->
                         <el-form-item label="标题字符串:" prop="title" class="keywords">
-                            <el-input v-model="ruleForm.title" placeholder="请输入网站名称"></el-input>
+                            <el-input v-model="ruleForm.title" placeholder="请输入标题字符串"></el-input>
                             <el-tooltip placement="top-start">
                                 <div slot="content">
-                                    如标题代码:<'h1 class='news_art'>红枣滞销喂羊 电商帮忙促销</'h1>,标题字符串为 .news_art 填入输入框内<br />
-                                    如标题代码:<'h1 id='news at'>红枣滞销喂羊 电商帮忙促销</'h1>,标题字符串为 #news art 填入输入框内
+                                    如标题代码:&lt;h1 class='news_art'>红枣滞销喂羊 电商帮忙促销&lt;/h1>,标题字符串为 .news_art 填入输入框内<br />
+                                    如标题代码:&lt;h1 id='news at'>红枣滞销喂羊 电商帮忙促销&lt;/h1>,标题字符串为 #news art 填入输入框内
                                 </div>
                                 <i class="el-icon-warning"></i>
                             </el-tooltip>
                         </el-form-item>
                         <el-form-item label="内容字符串:" prop="content" class="keywords">
-                            <el-input v-model="ruleForm.content" placeholder="请输入标题字符串"></el-input>
+                            <el-input v-model="ruleForm.content" placeholder="请输入内容字符串"></el-input>
                             <el-tooltip placement="top-start">
                                 <div slot="content">
-                                    如内容代码:<'h1 class='news box'>
-                                        <' /h1>,内容字符串为.news box 填入输入框内<br />
-                                            如内容代码:<'h1 id='news_box'>
-                                                <' /h1>,内容字符串为 #news_box 填入输入框内
+                                    如内容代码:&lt;h1 class='news box'>
+                                    &lt;/h1>,内容字符串为.news box 填入输入框内<br />
+                                    如内容代码:&lt;h1 id='news_box'>
+                                    &lt;/h1>,内容字符串为 #news_box 填入输入框内
                                 </div>
                                 <i class="el-icon-warning"></i>
                             </el-tooltip>
@@ -262,7 +283,7 @@
 
                 <div class="three" v-show="this.webType == 3">
                     <div class="dialogText">
-                        <el-form-item label="任务规则名:" prop="ruleName" class="keywords">
+                        <el-form-item label="任务规则名:" prop="" class="keywords">
                             <el-input v-model="ruleForm.ruleName" placeholder="请输入任务规则名"></el-input>
                             <el-tooltip class="item" effect="dark" content="任务规则名,如中国农村网-时政要闻" placement="top-start">
                                 <i class="el-icon-warning"></i>
@@ -277,8 +298,9 @@
                 </div>
 
                 <div class="dialogBtn">
-                    <button class="cancel" @click="saveForm">保存</button>
-                    <button class="submit" @click="submitForm">确定</button>
+                    <el-button class="cancel" @click="saveForm">保存</el-button>
+                    <el-button type="primary" class="submit" :loading="submitDisabled"
+                        @click="submitForm('ruleForm')">确定</el-button>
                 </div>
             </el-form>
         </el-dialog>
@@ -300,139 +322,114 @@ export default {
     },
     data() {
         const validateCollect = (rule, value, callback) => {
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            }
-            else if (value.length == 0) {
+            // if (/\s/.test(value)) {
+            //     callback(new Error('输入的文字包含空格,请删除空格'))
+            // }else 
+            if (value.length == 0) {
                 callback(new Error('请输入请求网址'))
             } else {
                 callback()
             }
         }
         const validateStartLabel = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入列表开始标签'))
             } else {
                 callback()
             }
         }
         const validateRuleName = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入任务规则名'))
             } else {
                 callback()
             }
         }
         const validateFirst_url = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入第1页网址'))
             } else {
                 callback()
             }
         }
         const validateStartCode = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入起始代码'))
             } else {
                 callback()
             }
         }
         const validateEndCode = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入结束页数'))
             } else {
                 callback()
             }
         }
         const validatTitle = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入标题字符串'))
             } else {
                 callback()
             }
         }
         const validatcontent = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入内容字符串'))
             } else {
                 callback()
             }
         }
         const validatsource = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入来源字符串'))
             } else {
                 callback()
             }
         }
         const validatauthor = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入作者字符串'))
             } else {
                 callback()
             }
         }
         const validatauthorName = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入作者替换名称'))
             } else {
                 callback()
             }
         }
         const validatparameter = (rule, value, callback) => {
-            // const value = input.value;
-            if (/\s/.test(value)) {
-                callback(new Error('输入的文字包含空格,请删除空格'))
-            } else if (value.length == 0) {
+            if (value.length == 0) {
                 callback(new Error('请输入接口参数'))
             } else {
                 callback()
             }
         }
         const validatsecondWeb = (rule, value, callback) => {
-            // const value = input.value;
             if (value.length == 0) {
                 callback(new Error('请输入第2页网址'))
             } else {
                 callback()
             }
         }
+        const validat_webSite_start = (rule, value, callback) => {
+            if (value.length == 0) {
+                callback(new Error('请输入详情页网址前缀'))
+            } else {
+                callback()
+            }
+        }
         return {
             tableDivTitle: "任务规则列表",  //表格标题
             dialogTableVisible: false, //弹窗是否显示
             dialogName: '设置采集规则', //弹窗名称
             dialogBoo: 'add',//判断当前是添加还是编辑
             searchRuleName: '',  //任务规则名
+            loading: true,  //表格加载中
+            submitDisabled: false, //添加按钮防抖
 
             // 建立网站页面传递的参数
             webId: '',
@@ -464,11 +461,13 @@ export default {
                 endPage: '', //结束页数
                 title: '',  //标题字符串
                 content: '', //内容字符串
+                detailPage: '', //详情页标签
+                webSite_start: '',  //详情页网址前缀
                 source: '', // 来源字符串
                 author: '', // 作者字符串
                 authorName: '', // 作者替换名称
                 parameter: '',  //接口类2 接口参数
-                diy_rule: '' //自定义类
+                diy_rule: '', //自定义类
             },
 
             rules: {  //规则
@@ -480,9 +479,11 @@ export default {
                 // second_start:[{ required: true, trigger: 'blur', validator: validatsecondWeb }],
                 // second_num:[{ required: true, trigger: 'blur', validator: validatsecondWeb }],
                 // second_end:[{ required: true, trigger: 'blur', validator: validatsecondWeb }],
-                second_start:[{ required: true, trigger: 'blur', message: '请输入网址开头' }],
-                second_num:[{ required: true, trigger: 'blur', message: '请输入代码页数' }],
-                second_end:[{ required: true, trigger: 'blur', message: '请输入网址结束字符串' }],
+                second_start: [{ required: true, trigger: 'blur', message: '请输入网址开头' }],
+                second_num: [{ required: true, trigger: 'blur', message: '请输入代码页数' }],
+                second_end: [{ required: true, trigger: 'blur', message: '请输入网址结束字符串' }],
+
+                webSite_start: [{ required: true, trigger: 'blur', validator: validat_webSite_start }],
 
                 startCode: [{ required: true, trigger: 'blur', validator: validateStartCode }],
                 endPage: [{ required: true, trigger: 'blur', validator: validateEndCode }],
@@ -504,6 +505,9 @@ export default {
                 pageSize: this.pageSize,
                 page: this.page,
             }).then(data => {
+                if (data.code == 200) {
+                    this.loading = false
+                }
                 console.log(data.data.rep);
                 this.tableData = data.data.rep
                 this.total = data.data.count
@@ -601,22 +605,132 @@ export default {
             }
             if (this.webType) {
                 this.dialogTableVisible = true
-                this.ruleForm.ruleName = ''
-                this.ruleForm.first_url = ''
-                this.ruleForm.collect = ''
-                this.ruleForm.second_start = ''
-                this.ruleForm.second_num = ''
-                this.ruleForm.second_end = ''
-                this.ruleForm.startCode = ''
-                this.ruleForm.startLabel = ''
-                this.ruleForm.endPage = ''
-                this.ruleForm.title = ''
-                this.ruleForm.content = ''
-                this.ruleForm.source = ''
-                this.ruleForm.author = ''
-                this.ruleForm.authorName = ''
-                this.ruleForm.parameter = ''
-                this.ruleForm.diy_rule = ''
+                //任务规则名 ruleName
+                const ruleName = sessionStorage.getItem("ruleName");
+                if (ruleName !== null) {
+                    this.ruleForm.ruleName = ruleName
+                } else {
+                    this.ruleForm.ruleName = ''
+                }
+                //第1页网址  接口类的开始采集地址 first_url
+                const first_url = sessionStorage.getItem("first_url");
+                if (first_url !== null) {
+                    this.ruleForm.first_url = first_url
+                } else {
+                    this.ruleForm.first_url = ''
+                }
+                //接口类 采集地址 collect
+                const collect = sessionStorage.getItem("collect");
+                if (collect !== null) {
+                    this.ruleForm.collect = collect
+                } else {
+                    this.ruleForm.collect = ''
+                }
+                //第2页网址开头 second_start
+                const second_start = sessionStorage.getItem("second_start");
+                if (second_start !== null) {
+                    this.ruleForm.second_start = second_start
+                } else {
+                    this.ruleForm.second_start = ''
+                }
+                //第2页代码页数 second_num
+                const second_num = sessionStorage.getItem("second_num");
+                if (second_num !== null) {
+                    this.ruleForm.second_num = second_num
+                } else {
+                    this.ruleForm.second_num = ''
+                }
+                //第2页网址结束字符串 second_end
+                const second_end = sessionStorage.getItem("second_end");
+                if (second_end !== null) {
+                    this.ruleForm.second_end = second_end
+                } else {
+                    this.ruleForm.second_end = ''
+                }
+                //startCode: '', 起始代码
+                const startCode = sessionStorage.getItem("startCode");
+                if (startCode !== null) {
+                    this.ruleForm.startCode = startCode
+                } else {
+                    this.ruleForm.startCode = ''
+                }
+                // startLabel: '',列表开始标签
+                const startLabel = sessionStorage.getItem("startLabel");
+                if (startLabel !== null) {
+                    this.ruleForm.startLabel = startLabel
+                } else {
+                    this.ruleForm.startLabel = ''
+                }
+                //endPage: '', //结束页数
+                const endPage = sessionStorage.getItem("endPage");
+                if (endPage !== null) {
+                    this.ruleForm.endPage = endPage
+                } else {
+                    this.ruleForm.endPage = ''
+                }
+                //title: '',  //标题字符串
+                const title = sessionStorage.getItem("title");
+                if (title !== null) {
+                    this.ruleForm.title = title
+                } else {
+                    this.ruleForm.title = ''
+                }
+                // content: '', //内容字符串
+                const content = sessionStorage.getItem("content");
+                if (content !== null) {
+                    this.ruleForm.content = content
+                } else {
+                    this.ruleForm.content = ''
+                }
+                // detailPage: '', //详情页标签
+                const detailPage = sessionStorage.getItem("detailPage");
+                if (detailPage !== null) {
+                    this.ruleForm.detailPage = detailPage
+                } else {
+                    this.ruleForm.detailPage = ''
+                }
+                // webSite_start: '',  //详情页网址前缀
+                const webSite_start = sessionStorage.getItem("webSite_start");
+                if (webSite_start !== null) {
+                    this.ruleForm.webSite_start = webSite_start
+                } else {
+                    this.ruleForm.webSite_start = ''
+                }
+                //source: '', // 来源字符串
+                const source = sessionStorage.getItem("source");
+                if (source !== null) {
+                    this.ruleForm.source = source
+                } else {
+                    this.ruleForm.source = ''
+                }
+                //author: '', // 作者字符串
+                const author = sessionStorage.getItem("author");
+                if (author !== null) {
+                    this.ruleForm.author = author
+                } else {
+                    this.ruleForm.author = ''
+                }
+                //authorName: '', // 作者替换名称
+                const authorName = sessionStorage.getItem("authorName");
+                if (authorName !== null) {
+                    this.ruleForm.authorName = authorName
+                } else {
+                    this.ruleForm.authorName = ''
+                }
+                //parameter: '',  //接口类2 接口参数
+                const parameter = sessionStorage.getItem("parameter");
+                if (parameter !== null) {
+                    this.ruleForm.parameter = parameter
+                } else {
+                    this.ruleForm.parameter = ''
+                }
+                //diy_rule: '',自定义类
+                const diy_rule = sessionStorage.getItem("diy_rule");
+                if (diy_rule !== null) {
+                    this.ruleForm.diy_rule = diy_rule
+                } else {
+                    this.ruleForm.diy_rule = ''
+                }
             }
         },
         //1.9 编辑采集规则
@@ -650,6 +764,8 @@ export default {
                 this.ruleForm.authorName = val.writer
                 this.ruleForm.parameter = val.parameter
                 this.ruleForm.diy_rule = val.diy_rule
+                this.ruleForm.webSite_start = val.con_url
+                this.ruleForm.detailPage = val.con_start
 
             } else if (this.webType == 2) {
                 this.dialogBoo = "update"
@@ -680,10 +796,8 @@ export default {
                 this.dialogBoo = "update"
                 this.dialogTableVisible = true
                 this.ruleForm.ruleName = val.name
-                this.ruleForm.diy_rule=val.diy_rule
+                this.ruleForm.diy_rule = val.diy_rule
             }
-
-
         },
         //采集
         goCollect(id, status) {
@@ -722,10 +836,22 @@ export default {
                 type: 'error'
             })
         },
-
+        // ab(){
+        //     let name = this.ruleForm.ruleName.trim();
+        //     console.log(name)
+        // },
         // 弹出层相关方法
         // 提交表单
-        submitForm() {
+        submitForm(formName) {
+            this.$refs[formName].validate((valid) => {
+                if (valid) {
+                    console.log('submit!');
+                    this.submitDisabled = true
+                } else {
+                    console.log('error submit!!');
+                    return false;
+                }
+            });
             //添加
             if (this.dialogBoo == 'add') {
                 if (this.webType == 1) {
@@ -734,31 +860,29 @@ export default {
                             name: this.ruleForm.ruleName,
                             web_id: this.webId,
                             type: this.webType,
-                            first_url: this.ruleForm.first_url,//规则型1:第1页网址  接口型2:开始采集地址
-                            second_start: this.ruleForm.second_start,//规则型1:第2页网址开头
-                            second_num: this.ruleForm.second_num,//规则型1:第2页代码页数
-                            second_end: this.ruleForm.second_end,//规则型1:第2页网址结束字符串
-                            start: this.ruleForm.startCode, //规则型1:列表标签类名  接口型2:列表标签
-                            title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                            content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                            first_url: this.ruleForm.first_url.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                            second_start: this.ruleForm.second_start.trim(),//规则型1:第2页网址开头
+                            second_num: this.ruleForm.second_num.trim(),//规则型1:第2页代码页数
+                            second_end: this.ruleForm.second_end.trim(),//规则型1:第2页网址结束字符串
+                            start: this.ruleForm.startCode.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                            title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                            content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                             source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
                             // writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
-                            writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
-                            end_pagenum: this.ruleForm.endPage//规则型1:列表页结束页码
+                            writer: this.ruleForm.authorName.trim(),//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
+                            end_pagenum: this.ruleForm.endPage,//规则型1:列表页结束页码
+                            con_url: this.ruleForm.webSite_start.trim(), //详情页标签
+                            con_start: this.ruleForm.detailPage, //详情页网址前缀
                         }).then(data => {
                             this.getData()
                             console.log(data);
                             if (data.code == 200) {
                                 this.dialogTableVisible = false
+                                this.submitDisabled = false
                                 this.$message({
                                     message: '添加成功',
                                     type: 'success'
                                 })
-                            } else if (data.code == 0) {
-                                this.$message({
-                                    message: data.message,
-                                    type: 'error'
-                                })
                             }
                         })
                     } else {
@@ -766,31 +890,29 @@ export default {
                             name: this.ruleForm.ruleName,
                             web_id: this.webId,
                             type: this.webType,
-                            first_url: this.ruleForm.first_url,//规则型1:第1页网址  接口型2:开始采集地址
-                            second_start: this.ruleForm.second_start,//规则型1:第2页网址开头
-                            second_num: this.ruleForm.second_num,//规则型1:第2页代码页数
-                            second_end: this.ruleForm.second_end,//规则型1:第2页网址结束字符串
-                            start: this.ruleForm.startCode, //规则型1:列表标签类名  接口型2:列表标签
-                            title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                            content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                            first_url: this.ruleForm.first_url.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                            second_start: this.ruleForm.second_start.trim(),//规则型1:第2页网址开头
+                            second_num: this.ruleForm.second_num.trim(),//规则型1:第2页代码页数
+                            second_end: this.ruleForm.second_end.trim(),//规则型1:第2页网址结束字符串
+                            start: this.ruleForm.startCode.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                            title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                            content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                             source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
                             writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
-                            writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
-                            end_pagenum: this.ruleForm.endPage//规则型1:列表页结束页码
+                            writer: this.ruleForm.authorName.trim(),//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
+                            end_pagenum: this.ruleForm.endPage,//规则型1:列表页结束页码
+                            con_url: this.ruleForm.webSite_start.trim(), //详情页标签
+                            con_start: this.ruleForm.detailPage, //详情页网址前缀
                         }).then(data => {
                             this.getData()
                             console.log(data);
                             if (data.code == 200) {
                                 this.dialogTableVisible = false
+                                this.submitDisabled = false
                                 this.$message({
                                     message: '添加成功',
                                     type: 'success'
                                 })
-                            } else if (data.code == 0) {
-                                this.$message({
-                                    message: data.message,
-                                    type: 'error'
-                                })
                             }
                         })
                     }
@@ -800,29 +922,25 @@ export default {
                         name: this.ruleForm.ruleName,
                         web_id: this.webId,
                         type: this.webType,
-                        first_url: this.ruleForm.collect,//规则型1:第1页网址  接口型2:开始采集地址
-                        parameter: this.ruleForm.parameter,//接口型2:接口参数
-                        start: this.ruleForm.startLabel, //规则型1:列表标签类名  接口型2:列表标签
-                        title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                        content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                        first_url: this.ruleForm.collect.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                        parameter: this.ruleForm.parameter.trim(),//接口型2:接口参数
+                        start: this.ruleForm.startLabel.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                        title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                        content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                         source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
-                        writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
+                        writer_class: this.ruleForm.author.trim(),//规则型1:作者标签类名  接口型2:作者标签
                         // writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
                     }).then(data => {
                         this.getData()
                         console.log(data);
                         if (data.code == 200) {
+                            this.submitDisabled = false
                             this.dialogTableVisible = false
                             this.$message({
                                 message: '添加成功',
                                 type: 'success'
                             })
                             this.ruleForm.authorName = ''
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
                     })
 
@@ -831,29 +949,25 @@ export default {
                         name: this.ruleForm.ruleName,
                         web_id: this.webId,
                         type: this.webType,
-                        first_url: this.ruleForm.collect,//规则型1:第1页网址  接口型2:开始采集地址
-                        parameter: this.ruleForm.parameter,//接口型2:接口参数
-                        start: this.ruleForm.startLabel, //规则型1:列表标签类名  接口型2:列表标签
-                        title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                        content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                        first_url: this.ruleForm.collect.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                        parameter: this.ruleForm.parameter.trim(),//接口型2:接口参数
+                        start: this.ruleForm.startLabel.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                        title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                        content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                         source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
                         // writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
-                        writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
+                        writer: this.ruleForm.authorName.trim(),//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
                     }).then(data => {
                         this.getData()
                         console.log(data);
                         if (data.code == 200) {
                             this.dialogTableVisible = false
+                            this.submitDisabled = false
                             this.$message({
                                 message: '添加成功',
                                 type: 'success'
                             })
                             this.ruleForm.author = ''
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
                     })
 
@@ -868,17 +982,12 @@ export default {
                         this.getData()
                         if (data.code == 200) {
                             this.dialogTableVisible = false
+                            this.submitDisabled = false
                             this.$message({
                                 message: '添加成功',
                                 type: 'success'
                             })
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
-
                     })
                 }
             }
@@ -897,31 +1006,29 @@ export default {
                         name: this.ruleForm.ruleName,
                         id: this.activeId,
                         type: this.webType,
-                        first_url: this.ruleForm.first_url,//规则型1:第1页网址  接口型2:开始采集地址
-                        second_start: this.ruleForm.second_start,//规则型1:第2页网址开头
-                        second_num: this.ruleForm.second_num,//规则型1:第2页代码页数
-                        second_end: this.ruleForm.second_end,//规则型1:第2页网址结束字符串
-                        start: this.ruleForm.startCode, //规则型1:列表标签类名  接口型2:列表标签
-                        title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                        content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                        first_url: this.ruleForm.first_url.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                        second_start: this.ruleForm.second_start.trim(),//规则型1:第2页网址开头
+                        second_num: this.ruleForm.second_num.trim(),//规则型1:第2页代码页数
+                        second_end: this.ruleForm.second_end.trim(),//规则型1:第2页网址结束字符串
+                        start: this.ruleForm.startCode.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                        title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                        content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                         source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
                         writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
-                        writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
-                        end_pagenum: this.ruleForm.endPage//规则型1:列表页结束页码
+                        writer: this.ruleForm.authorName.trim(),//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
+                        end_pagenum: this.ruleForm.endPage,//规则型1:列表页结束页码
+                        con_url: this.ruleForm.webSite_start.trim(), //详情页标签
+                        con_start: this.ruleForm.detailPage, //详情页网址前缀
                     }).then(data => {
                         this.getData()
                         console.log(data);
                         if (data.code == 200) {
                             this.dialogTableVisible = false
+                            this.submitDisabled = false
                             this.$message({
                                 message: '修改成功',
                                 type: 'success'
                             })
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
                     })
                 } else if (this.webType == 2 && this.radio == 'true') {
@@ -929,29 +1036,25 @@ export default {
                         name: this.ruleForm.ruleName,
                         id: this.activeId,
                         type: this.webType,
-                        first_url: this.ruleForm.collect,//规则型1:第1页网址  接口型2:开始采集地址
-                        parameter: this.ruleForm.parameter,//接口型2:接口参数
-                        start: this.ruleForm.startCode, //规则型1:列表标签类名  接口型2:列表标签
-                        title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                        content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                        first_url: this.ruleForm.collect.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                        parameter: this.ruleForm.parameter.trim(),//接口型2:接口参数
+                        start: this.ruleForm.startCode.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                        title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                        content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                         source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
-                        writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
+                        writer_class: this.ruleForm.author.trim(),//规则型1:作者标签类名  接口型2:作者标签
                         // writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
                     }).then(data => {
                         this.getData()
                         console.log(data);
                         if (data.code == 200) {
                             this.dialogTableVisible = false
+                            this.submitDisabled = false
                             this.$message({
                                 message: '修改成功',
                                 type: 'success'
                             })
                             this.ruleForm.authorName = ""
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
                     })
                 } else if (this.webType == 2 && this.radio == 'false') {
@@ -960,29 +1063,25 @@ export default {
                         name: this.ruleForm.ruleName,
                         id: this.activeId,
                         type: this.webType,
-                        first_url: this.ruleForm.collect,//规则型1:第1页网址  接口型2:开始采集地址
-                        parameter: this.ruleForm.parameter,//接口型2:接口参数
-                        start: this.ruleForm.startCode, //规则型1:列表标签类名  接口型2:列表标签
-                        title: this.ruleForm.title, //规则型1:标题标签类名  接口型2:标题标签
-                        content: this.ruleForm.content,//规则型1:内容标签类名  接口型2:内容标签
+                        first_url: this.ruleForm.collect.trim(),//规则型1:第1页网址  接口型2:开始采集地址
+                        parameter: this.ruleForm.parameter.trim(),//接口型2:接口参数
+                        start: this.ruleForm.startCode.trim(), //规则型1:列表标签类名  接口型2:列表标签
+                        title: this.ruleForm.title.trim(), //规则型1:标题标签类名  接口型2:标题标签
+                        content: this.ruleForm.content.trim(),//规则型1:内容标签类名  接口型2:内容标签
                         source: this.ruleForm.source, //规则型1:来源标签类名  接口型2:来源标签
                         // writer_class: this.ruleForm.author,//规则型1:作者标签类名  接口型2:作者标签
-                        writer: this.ruleForm.authorName,//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
+                        writer: this.ruleForm.authorName.trim(),//规则型1:接口型2:作者默认名称(若未采集到则设置默认作者)
                     }).then(data => {
                         this.getData()
                         console.log(data);
                         if (data.code == 200) {
                             this.dialogTableVisible = false
+                            this.submitDisabled = false
                             this.$message({
                                 message: '修改成功',
                                 type: 'success'
                             })
                             this.ruleForm.author = ""
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
                     })
                 } else if (this.webType == 3) {
@@ -996,15 +1095,11 @@ export default {
                         this.getData()
                         if (data.code == 200) {
                             this.dialogTableVisible = false
+                            this.submitDisabled = false
                             this.$message({
                                 message: '修改成功',
                                 type: 'success'
                             })
-                        } else if (data.code == 0) {
-                            this.$message({
-                                message: data.message,
-                                type: 'error'
-                            })
                         }
                     })
                 }
@@ -1013,6 +1108,24 @@ export default {
         //保存
         saveForm() {
             this.dialogTableVisible = false
+            sessionStorage.setItem('ruleName', this.ruleForm.ruleName); //任务规则名
+            sessionStorage.setItem('first_url', this.ruleForm.first_url); //第一页网址 
+            sessionStorage.setItem('collect', this.ruleForm.collect); //接口类 采集地址
+            sessionStorage.setItem('second_start', this.ruleForm.second_start); //第2页网址开头
+            sessionStorage.setItem('second_num', this.ruleForm.second_num); //第2页代码页数
+            sessionStorage.setItem('second_end', this.ruleForm.second_end);//第2页网址结束字符串
+            sessionStorage.setItem('startCode', this.ruleForm.startCode);  //起始代码
+            sessionStorage.setItem('startLabel', this.ruleForm.startLabel); //列表开始标签
+            sessionStorage.setItem('endPage', this.ruleForm.endPage); //结束页数
+            sessionStorage.setItem('title', this.ruleForm.title); //标题字符串
+            sessionStorage.setItem('content', this.ruleForm.content); //内容字符串
+            sessionStorage.setItem('detailPage', this.ruleForm.detailPage); //详情页标签
+            sessionStorage.setItem('webSite_start', this.ruleForm.webSite_start); //详情页网址前缀
+            sessionStorage.setItem('source', this.ruleForm.source); // 来源字符串
+            sessionStorage.setItem('author', this.ruleForm.author); // 作者字符串
+            sessionStorage.setItem('authorName', this.ruleForm.authorName); // 作者替换名称
+            sessionStorage.setItem('parameter', this.ruleForm.parameter); //接口类2 接口参数
+            sessionStorage.setItem('diy_rule', this.ruleForm.diy_rule); //自定义类
         },
         // 查看
         goLook(id, val) {
@@ -1208,12 +1321,17 @@ export default {
     background-color: #f5f7fb;
 
     .pageTwo {
+        ::v-deep .el-col-8 {
+            height: 32px;
+        }
+
         ::v-deep .el-col-6 {
             width: 31%;
             height: 32px;
-            margin-right: 24px;
+            margin-right: 23px;
         }
-        .el_col_6_end{
+
+        .el_col_6_end {
             margin-right: 0;
         }