网络文章评价功能

Lvtianfang
许宏杰 2 years ago
parent de27609baf
commit ba1a4e799e

@ -132,7 +132,7 @@
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200"
width="260"
fixed="right"
>
<template slot-scope="scope">
@ -153,6 +153,7 @@
<el-button
type="success"
size="mini"
v-show="scope.row.status == 2"
@click="handleUpdate(scope.row)"
v-hasPermi="['zongzhi:article:edit']"
>修改</el-button
@ -288,6 +289,24 @@
<dict-tag :options="dict.type.tc_pj_status" :value="form.status" />
</el-descriptions-item>
</el-descriptions>
<div style="margin-top: 15px"></div>
<el-descriptions
v-if="form.status == 1"
title="评价详情"
:column="2"
border
labelClassName="desLable"
>
<el-descriptions-item label="评价人">{{
formPj.appraiserName
}}</el-descriptions-item>
<el-descriptions-item label="评价时间">{{
formPj.createTime
}}</el-descriptions-item>
<el-descriptions-item label="评价内容" :span="2">{{
formPj.pjContent
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
<el-dialog
@ -331,6 +350,11 @@ import {
updateArticle,
exportArticle,
} from "@/api/zongzhi/netZoology/netArticle/index.js";
import {
addEvaluate,
delEvaluate,
listEvaluate,
} from "@/api/zongzhi/netZoology/netP/index.js";
export default {
computed: {
...mapGetters(["townList", "name", "userId"]),
@ -381,6 +405,7 @@ export default {
//
rules: {},
formPj: {},
currentData: {},
};
},
created() {
@ -397,6 +422,7 @@ export default {
methods: {
/**评价 */
handPj(row) {
this.currentData = row;
this.formPj = {
appraiserId: this.userId,
appraiserName: this.name,
@ -409,12 +435,20 @@ export default {
articleUrl: row.url,
pjContent: "",
};
console.log(this.formPj);
this.pjShow = true;
},
submitFormPj() {
this.$refs["formPj"].validate((valid) => {
if (valid) {
addEvaluate(this.formPj).then((res) => {
this.currentData.status = 1;
updateArticle(this.currentData).then((response) => {
this.$modal.msgSuccess("评价成功");
this.pjShow = false;
this.currentData = {};
this.getList();
});
});
}
});
},
@ -439,6 +473,7 @@ export default {
},
//
reset() {
this.formPj = {};
this.form = {
id: null,
@ -493,8 +528,17 @@ export default {
const id = row.id || this.ids;
getArticle(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看网络文章详情";
if (row.status == 1) {
//
listEvaluate({ articleId: id }).then((res) => {
this.formPj = res.rows[0];
this.infoOpen = true;
this.infoTitle = "查看网络文章详情";
});
} else {
this.infoOpen = true;
this.infoTitle = "查看网络文章详情";
}
});
},
/** 新增按钮操作 */

Loading…
Cancel
Save