|
@@ -21,16 +21,16 @@
|
|
|
<el-option label="区域二" value="beijing"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="推荐等级:" prop="grade">
|
|
|
- <el-select v-model="ruleForm.grade" placeholder="请选择推荐等级">
|
|
|
+ <el-form-item label="推荐等级:" prop="">
|
|
|
+ <el-select v-model="ruleForm.grade" clearable placeholder="请选择推荐等级">
|
|
|
<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" :label-width="formLabelWidth"
|
|
|
- :class="['custom-form-item']" class="custom-align-right">
|
|
|
+ <el-form-item label="缩略图:" prop="" :label-width="formLabelWidth" :class="['custom-form-item']"
|
|
|
+ class="custom-align-right">
|
|
|
<div class="uploaderBox">
|
|
|
<!--图片上传组件 start ------------------------------------------------------------>
|
|
|
<div class="avatar-upload-container" @mouseenter="hovering = true"
|
|
@@ -100,8 +100,8 @@
|
|
|
<el-input v-model="ruleForm.author" placeholder="请输入发布资讯的作者"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="浏览量:" prop="">
|
|
|
- <el-input-number v-model="ruleForm.count" @change="handleChange" :min="1" :max="10"
|
|
|
- label="描述文字"></el-input-number>
|
|
|
+ <el-input-number v-model="ruleForm.count" @change="handleChange" :min="0" :max="100000"
|
|
|
+ :step="1" label="描述文字"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="是否原创:" prop="original">
|
|
|
<el-radio v-model="ruleForm.original" label="true">是</el-radio>
|
|
@@ -168,18 +168,16 @@ export default {
|
|
|
|
|
|
activeid: '', //当前被选中的id
|
|
|
|
|
|
+ formLabelWidth: '', //广告示例图相关
|
|
|
+
|
|
|
ruleId: '',
|
|
|
source: '',
|
|
|
|
|
|
//3.4 上传logo图片
|
|
|
logoUrl: '',
|
|
|
hovering: false, // 鼠标悬浮状态 悬浮时显示删除
|
|
|
-
|
|
|
+
|
|
|
options: [
|
|
|
- {
|
|
|
- value: 0,
|
|
|
- label: '未分类'
|
|
|
- },
|
|
|
{
|
|
|
value: 1,
|
|
|
label: '头条'
|
|
@@ -206,13 +204,13 @@ export default {
|
|
|
title: '', // 资讯题目
|
|
|
url: '', // 外链地址
|
|
|
name: '', // 导航池名称
|
|
|
- grade: [], // 推荐等级
|
|
|
+ grade: 0, // 推荐等级
|
|
|
imgSrc: '', // 缩略图
|
|
|
keywords: '', // 关键词
|
|
|
desc: '', // 描述
|
|
|
content: '', // 内容
|
|
|
author: '', // 作者
|
|
|
- count: 1, // 浏览量
|
|
|
+ count: 0, // 浏览量
|
|
|
original: 'false', // 原创
|
|
|
source: '', // 来源
|
|
|
link: '' // 来源链接
|
|
@@ -371,37 +369,72 @@ export default {
|
|
|
},
|
|
|
// 提交表单
|
|
|
goSubmit() {
|
|
|
- updateInfo({
|
|
|
- art_id: this.activeid,
|
|
|
- title: this.ruleForm.title,
|
|
|
- level: this.ruleForm.grade,
|
|
|
- imgurl: this.ruleForm.imgSrc,
|
|
|
- keyword: this.ruleForm.keywords,
|
|
|
- introduce: this.ruleForm.desc,
|
|
|
- content: this.ruleForm.content,
|
|
|
- author: this.ruleForm.author,
|
|
|
- hits: this.ruleForm.count,
|
|
|
- is_original: this.ruleForm.original == 'false' ? 0 : 1, //是否原创
|
|
|
- fromurl: this.ruleForm.link, //来源链接
|
|
|
- copyfrom: this.ruleForm.source, //来源
|
|
|
- islink: this.checked == false ? 0 : 1,
|
|
|
- linkurl: this.ruleForm.url,
|
|
|
- }).then(data => {
|
|
|
- console.log(data);
|
|
|
- if (data.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: "修改成功",
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- this.$router.push(`/webCrawlerList?id=${this.ruleId}&source=${this.source}`)
|
|
|
- }
|
|
|
- if (data.code == 0) {
|
|
|
- this.$message({
|
|
|
- message: data.message,
|
|
|
- type: "error"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.ruleForm.grade == "") {
|
|
|
+ updateInfo({
|
|
|
+ art_id: this.activeid,
|
|
|
+ title: this.ruleForm.title,
|
|
|
+ level: 0,
|
|
|
+ imgurl: this.ruleForm.imgSrc,
|
|
|
+ keyword: this.ruleForm.keywords,
|
|
|
+ introduce: this.ruleForm.desc,
|
|
|
+ content: this.ruleForm.content,
|
|
|
+ author: this.ruleForm.author,
|
|
|
+ hits: this.ruleForm.count,
|
|
|
+ is_original: this.ruleForm.original == 'false' ? 0 : 1, //是否原创
|
|
|
+ fromurl: this.ruleForm.link, //来源链接
|
|
|
+ copyfrom: this.ruleForm.source, //来源
|
|
|
+ islink: this.checked == false ? 0 : 1,
|
|
|
+ linkurl: this.ruleForm.url,
|
|
|
+ }).then(data => {
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ this.$router.push(`/webCrawlerList?id=${this.ruleId}&source=${this.source}`)
|
|
|
+ }
|
|
|
+ if (data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: data.message,
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ updateInfo({
|
|
|
+ art_id: this.activeid,
|
|
|
+ title: this.ruleForm.title,
|
|
|
+ level: this.ruleForm.grade,
|
|
|
+ imgurl: this.ruleForm.imgSrc,
|
|
|
+ keyword: this.ruleForm.keywords,
|
|
|
+ introduce: this.ruleForm.desc,
|
|
|
+ content: this.ruleForm.content,
|
|
|
+ author: this.ruleForm.author,
|
|
|
+ hits: this.ruleForm.count,
|
|
|
+ is_original: this.ruleForm.original == 'false' ? 0 : 1, //是否原创
|
|
|
+ fromurl: this.ruleForm.link, //来源链接
|
|
|
+ copyfrom: this.ruleForm.source, //来源
|
|
|
+ islink: this.checked == false ? 0 : 1,
|
|
|
+ linkurl: this.ruleForm.url,
|
|
|
+ }).then(data => {
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ this.$router.push(`/webCrawlerList?id=${this.ruleId}&source=${this.source}`)
|
|
|
+ }
|
|
|
+ if (data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: data.message,
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
//取消添加或编辑
|
|
|
goCancel() {
|
|
@@ -537,15 +570,22 @@ export default {
|
|
|
this.ruleForm.title = data.data.title
|
|
|
this.ruleForm.url = data.data.linkurl
|
|
|
this.ruleForm.name = data.data.category //导航池名称
|
|
|
- this.ruleForm.grade = data.data.level
|
|
|
+
|
|
|
+ //推荐等级
|
|
|
+ if (data.data.level == 0) {
|
|
|
+ this.ruleForm.grade = ""
|
|
|
+ } else {
|
|
|
+ this.ruleForm.grade = data.data.level
|
|
|
+ }
|
|
|
+
|
|
|
this.logoUrl = data.data.imgurl
|
|
|
this.ruleForm.keywords = data.data.keyword
|
|
|
this.ruleForm.desc = data.data.introduce
|
|
|
this.ruleForm.content = data.data.content //内容
|
|
|
this.ruleForm.author = data.data.author
|
|
|
this.ruleForm.count = data.data.hits
|
|
|
- this.ruleForm.source = data.data.source
|
|
|
- this.ruleForm.link = data.data.copyfrom
|
|
|
+ this.ruleForm.source = data.data.copyfrom
|
|
|
+ this.ruleForm.link = data.data.fromurl
|
|
|
})
|
|
|
|
|
|
//复制内容到富文本 start ------------------------------------------------------------>
|