【新增】 报告详情接口
This commit is contained in:
@@ -49,13 +49,13 @@ export default {
|
|||||||
params: id
|
params: id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
labelUpdate(data){
|
labelUpdate(data){
|
||||||
return request({
|
return request({
|
||||||
url: 'api/tree-label/update',
|
url: 'api/tree-label/update',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 新增或编辑报告
|
// 新增或编辑报告
|
||||||
reportAdd (data) {
|
reportAdd (data) {
|
||||||
@@ -151,6 +151,52 @@ labelUpdate(data){
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
//
|
// 点赞
|
||||||
|
goodLuck (data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/report/praise/'+data,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 取消点赞
|
||||||
|
NogoodLuck (data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/report/delPraise/'+data,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//删除评论 {id}
|
||||||
|
delJuggle (data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/report-comment/'+data,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 添加评论
|
||||||
|
addJuggle (data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/report-comment/add',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取评论
|
||||||
|
getJuggle (data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/report-comment/page',
|
||||||
|
method: 'get',
|
||||||
|
params:data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//评分
|
||||||
|
addScore(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/report-rating/rating',
|
||||||
|
method: 'put',
|
||||||
|
params:data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { instance as request } from '@/utils/request'
|
||||||
|
export default {
|
||||||
|
downFile (data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/sys/file/'+data,
|
||||||
|
method: 'GET',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -42,11 +42,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="report-jug">
|
<div class="report-jug">
|
||||||
<div class="report-jug-left">
|
<div class="report-jug-left">
|
||||||
报告满意度:<el-rate allow-half :max="10" v-model="value1" @click="saveScore"></el-rate>
|
报告满意度:<el-rate allow-half :max="5" v-model="userRating" @click.native="saveScore"></el-rate>
|
||||||
</div>
|
</div>
|
||||||
<div class="pointclick">
|
<div class="pointclick">
|
||||||
<svg-icon v-if="!isShow" icon-class="pointe" @click="isShow=!isShow" class-name="icon" ></svg-icon>
|
<svg-icon v-if="!isShow" icon-class="pointe" @click="pointZan('y')" class-name="icon" ></svg-icon>
|
||||||
<svg-icon v-else icon-class="pointe_fill" @click="isShow=!isShow" class-name="icon" ></svg-icon>
|
<svg-icon v-else icon-class="pointe_fill" @click="pointZan('n')" class-name="icon" ></svg-icon>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,19 +56,23 @@
|
|||||||
<span>评论</span>
|
<span>评论</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="21">
|
<el-col :span="21">
|
||||||
<el-input type="textarea" v-model="juggle" maxlength="1000" show-word-limit></el-input>
|
<el-input type="textarea" v-model="comment" maxlength="1000" show-word-limit></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<el-button size="medium" type="primary" class="fabiaoBtn" @click="">发表评论</el-button>
|
<el-button size="medium" type="primary" class="fabiaoBtn" @click="addJuggle">发表评论</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="all_juggle">
|
<div class="all_juggle" v-for="item in commonList" >
|
||||||
<div class="juggle_left">sss</div>
|
<div class="juggle_left">
|
||||||
|
<div class="nameCir">
|
||||||
|
{{item.userName.slice(0,1)}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="juggle_right">
|
<div class="juggle_right">
|
||||||
<div class="content">ssss</div>
|
<div class="content">{{ item.comment }}</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<div class="time">time</div>
|
<div class="time">{{ item.createTime }}</div>
|
||||||
<el-button class="delbtn" size="medium" plain type="primary" @click="">删除</el-button>
|
<el-button class="delbtn" size="medium" plain type="primary" @click="delJugg(item.id)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -89,13 +93,85 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
isShow: false,
|
isShow: false,
|
||||||
value1:'',
|
userRating:'',
|
||||||
watermarkText: '', // 水印
|
watermarkText: '', // 水印
|
||||||
content: '',
|
content: '',
|
||||||
row: {}
|
row: {},
|
||||||
|
comment:'',
|
||||||
|
reportId:'',
|
||||||
|
commonList:[],
|
||||||
|
q:{
|
||||||
|
pageNo:1,
|
||||||
|
pageSize:5,
|
||||||
|
|
||||||
|
},
|
||||||
|
userId:this.$store.getters.userInfo.USID,
|
||||||
|
userName:this.$store.getters.userInfo.USNAME,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//点赞
|
||||||
|
pointZan(type){
|
||||||
|
if(type== 'n'){
|
||||||
|
this.$api.report.NogoodLuck(this.reportId).then(res=>{
|
||||||
|
this.isShow=!this.isShow
|
||||||
|
this.$message.success("取消成功")
|
||||||
|
}).catch(()=>{
|
||||||
|
this.$message.warning("操作失败")
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$api.report.goodLuck(this.reportId).then(res=>{
|
||||||
|
this.isShow=!this.isShow
|
||||||
|
this.$message.success("点赞成功")
|
||||||
|
}).catch(()=>{
|
||||||
|
this.$message.warning("操作失败")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//评分
|
||||||
|
saveScore(){
|
||||||
|
this.$api.report.addScore({userRating:+this.userRating,reportId:this.reportId}).then(res=>{
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addJuggle(){
|
||||||
|
if(this.comment!=''){
|
||||||
|
this.$api.report.addJuggle({
|
||||||
|
comment:this.comment,
|
||||||
|
reportId:this.reportId,
|
||||||
|
userId: this.userId,
|
||||||
|
userName:this.userName
|
||||||
|
}).then(res=>{
|
||||||
|
this.$message.success("评论成功")
|
||||||
|
this.comment=''
|
||||||
|
this.getComment()
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
this.$message.warning("请填写评论")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除评论
|
||||||
|
delJugg(id) {
|
||||||
|
this.$confirm('确认删除该条评论?', '删除', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonClass: 'common-button-primary',
|
||||||
|
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$api.report.delJuggle(id).then(res=>{
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
this.getComment()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取评论
|
||||||
|
getComment(){
|
||||||
|
this.$api.report.getJuggle({...this.q,reportId:this.reportId}).then(res=>{
|
||||||
|
this.commonList=res.data.records
|
||||||
|
this.total=res.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
getKeyContent(list) {
|
getKeyContent(list) {
|
||||||
if (list) {
|
if (list) {
|
||||||
let keyContent = []
|
let keyContent = []
|
||||||
@@ -114,17 +190,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 预览
|
// 预览
|
||||||
previewRow () {
|
// previewRow () {
|
||||||
if (!this.$route.query.row) {
|
// if (!this.$route.query.row) {
|
||||||
this.$router.push({ path: '/report/list', query: { id: this.$route.query.id } })
|
// this.$router.push({ path: '/report/list', query: { id: this.$route.query.id } })
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}`
|
// this.watermarkText = `${this.$store.state.userInfo.usname} ${formatDate(+new Date(), 'yyyy年MM月dd日 hh:mm:ss')}`
|
||||||
this.row = JSON.parse(this.$route.query.row)
|
// this.row = JSON.parse(this.$route.query.row)
|
||||||
this.$api.report.reportGetReportHtmlId({ id: this.row.id }).then(({ data }) => {
|
// this.$api.report.reportGetReportHtmlId({ id: this.row.id }).then(({ data }) => {
|
||||||
this.content = data.content
|
// this.content = data.content
|
||||||
})
|
// })
|
||||||
},
|
// },
|
||||||
// 下载
|
// 下载
|
||||||
downloadRow (row) {
|
downloadRow (row) {
|
||||||
// this.$confirm('此操作将下载所选数据文件, 是否继续?', '提示', {
|
// this.$confirm('此操作将下载所选数据文件, 是否继续?', '提示', {
|
||||||
@@ -137,12 +213,11 @@ export default {
|
|||||||
})
|
})
|
||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
saveScore(){
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.previewRow()
|
this.reportId=this.$route.query.reportId
|
||||||
|
// this.previewRow()
|
||||||
|
this.getComment()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -255,6 +330,12 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
border-right: 1px solid #e6f6fe;
|
border-right: 1px solid #e6f6fe;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
.nameCir{
|
||||||
|
background-color: pink;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.juggle_right{
|
.juggle_right{
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 跳转到详情
|
// 跳转到详情
|
||||||
goReportDetail(row) {
|
goReportDetail(row) {
|
||||||
this.$router.push({path: '/report/detail', query: {id: this.$route.query.id, row: JSON.stringify(row)}})
|
this.$router.push({path: '/report/detail', query: {id: this.$route.query.id, reportId: row.id}})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<span class="uploadFile" v-if="form.fileName">
|
<span class="uploadFile" v-if="form.fileName">
|
||||||
<span :title="form.fileName">{{form.fileName}}</span>
|
<span :title="form.fileName">{{form.fileName}}</span>
|
||||||
<i class="el-icon-cloudy iconstyle"></i>
|
<i class="el-icon-cloudy iconstyle" @click="downFile(form.fileId)"></i>
|
||||||
<i class="el-icon-delete iconstyle" @click="delFile"></i>
|
<i class="el-icon-delete iconstyle" @click="delFile"></i>
|
||||||
</span>
|
</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -239,6 +239,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
downFile(id){
|
||||||
|
this.$api.reportProcess.downFile(id).then(res=>{
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
handleClick(){
|
handleClick(){
|
||||||
this.orgTableVal=this.form.department
|
this.orgTableVal=this.form.department
|
||||||
this.orgTableValName=this.form.departmentName
|
this.orgTableValName=this.form.departmentName
|
||||||
|
|||||||
Reference in New Issue
Block a user