|
@@ -132,8 +132,8 @@
|
|
<el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
|
|
<el-form-item label="来源名称:" prop="copyfrom" class="custom-align-right">
|
|
<el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"></el-input>
|
|
<el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称"></el-input>
|
|
</el-form-item>
|
|
</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 label="来源链接:" prop="fromurl" class="custom-align-right">
|
|
|
|
+ <el-input v-model="form.fromurl" autocomplete="off" placeholder="请输入来源链接"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div class="disclaimerBox">
|
|
<div class="disclaimerBox">
|
|
<div class="disclaimerTitle">
|
|
<div class="disclaimerTitle">
|
|
@@ -145,7 +145,7 @@
|
|
</div>
|
|
</div>
|
|
<div v-if="form.is_original==1">
|
|
<div v-if="form.is_original==1">
|
|
<el-form-item label="来源名称:" prop="linkurl" class="custom-align-right">
|
|
<el-form-item label="来源名称:" prop="linkurl" class="custom-align-right">
|
|
- <el-input v-model="form.linkurl" autocomplete="off" placeholder="请输入来源名称" disabled="disabled"></el-input>
|
|
|
|
|
|
+ <el-input v-model="form.copyfrom" autocomplete="off" placeholder="请输入来源名称" disabled="disabled"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -471,15 +471,14 @@ export default {
|
|
//不是原创的时候显示来源
|
|
//不是原创的时候显示来源
|
|
if(res.data.is_original==1){
|
|
if(res.data.is_original==1){
|
|
this.form.is_original = 1;
|
|
this.form.is_original = 1;
|
|
- this.form.linkurl = "本网";
|
|
|
|
|
|
+ this.form.copyfrom = "本网";
|
|
}else{
|
|
}else{
|
|
this.form.is_original = 0;
|
|
this.form.is_original = 0;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.form.is_original = 0;
|
|
this.form.is_original = 0;
|
|
console.log('is_original:', this.form.is_original); // 确保值已更新
|
|
console.log('is_original:', this.form.is_original); // 确保值已更新
|
|
});
|
|
});
|
|
- // <el-radio v-model="form.is_original" label="1">是</el-radio>
|
|
|
|
- // <el-radio v-model="form.is_original" label="0">不是</el-radio>
|
|
|
|
|
|
+ this.form.copyfrom = res.data.copyfrom;
|
|
this.form.linkurl = res.data.linkurl;
|
|
this.form.linkurl = res.data.linkurl;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -501,7 +500,7 @@ export default {
|
|
this.form.author = res.data.author;
|
|
this.form.author = res.data.author;
|
|
this.form.hits = res.data.hits;
|
|
this.form.hits = res.data.hits;
|
|
this.form.is_original = res.data.is_original;
|
|
this.form.is_original = res.data.is_original;
|
|
- this.form.copyfrom = res.data.copyfrom;
|
|
|
|
|
|
+ //this.form.copyfrom = res.data.copyfrom;
|
|
this.form.fromurl = res.data.fromurl;
|
|
this.form.fromurl = res.data.fromurl;
|
|
this.form.status = res.data.status;
|
|
this.form.status = res.data.status;
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
@@ -536,6 +535,7 @@ export default {
|
|
editToServe(){
|
|
editToServe(){
|
|
//提交之前先判断是否为外链
|
|
//提交之前先判断是否为外链
|
|
//如果使用了外链,清理掉除了外链以外的内容
|
|
//如果使用了外链,清理掉除了外链以外的内容
|
|
|
|
+ console.log(this.form)
|
|
if(this.form.islink==1){
|
|
if(this.form.islink==1){
|
|
this.cleatForm(1)
|
|
this.cleatForm(1)
|
|
}
|
|
}
|
|
@@ -546,14 +546,18 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
//console.log(this.form)
|
|
//console.log(this.form)
|
|
this.$store.dispatch('news/updateArticle',this.form).then(res=> {
|
|
this.$store.dispatch('news/updateArticle',this.form).then(res=> {
|
|
- //汇报结果
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '已成功添加资讯!'
|
|
|
|
- });
|
|
|
|
- this.cleatForm(2);
|
|
|
|
- //返回列表页
|
|
|
|
- this.returnPage()
|
|
|
|
|
|
+ if(res.code!=200){
|
|
|
|
+ this.$message.error("修改失败,请稍后再试!");
|
|
|
|
+ }else{
|
|
|
|
+ //汇报结果
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '已成功编辑资讯!'
|
|
|
|
+ });
|
|
|
|
+ this.cleatForm(2);
|
|
|
|
+ //返回列表页
|
|
|
|
+ this.returnPage()
|
|
|
|
+ }
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'info',
|
|
type: 'info',
|
|
@@ -566,10 +570,10 @@ export default {
|
|
//1.4 修改是否原创
|
|
//1.4 修改是否原创
|
|
changeIsOriginal(){
|
|
changeIsOriginal(){
|
|
if(this.form.is_original==1){
|
|
if(this.form.is_original==1){
|
|
- this.form.copyfrom = "";
|
|
|
|
- this.form.linkurl = "本网";
|
|
|
|
|
|
+ this.form.copyfrom = "本网";
|
|
}else{
|
|
}else{
|
|
- this.form.linkurl = "";
|
|
|
|
|
|
+ this.form.copyfrom = "";
|
|
|
|
+ this.form.fromurl = "";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//跳转操作 end ------------------------------------------------------------>
|
|
//跳转操作 end ------------------------------------------------------------>
|