Files
dvcp_v2_webapp/project/fengdu/app/AppLearning/components/Detail.vue

123 lines
2.7 KiB
Vue
Raw Normal View History

2023-01-09 16:38:58 +08:00
<template>
<ai-detail>
<template slot="title">
<ai-title title="返回学习回答列表" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
2023-01-11 15:11:44 +08:00
<ai-card title="基本信息">
2023-01-09 16:38:58 +08:00
<template #content>
2023-01-11 15:11:44 +08:00
<p class="title">{{info.content}}</p>
<div class="title-text">{{info.createUserName}}发布于{{info.createTime}} <span>已有{{info.answerCount || 0}}个回答</span></div>
2023-01-10 10:40:01 +08:00
<div class="item" v-for="(item, index) in info.answers" :key="index">
2023-01-09 16:38:58 +08:00
<div class="flex">
2023-01-10 10:40:01 +08:00
<img :src="item.createUserAvatar" alt="">
2023-01-09 16:38:58 +08:00
<div class="user-info">
2023-01-10 10:40:01 +08:00
<h3>{{item.createUserName}}</h3>
<p>{{item.createUserDeptName}}</p>
2023-01-09 16:38:58 +08:00
</div>
</div>
2023-01-10 10:40:01 +08:00
<div class="content" v-html="item.content"></div>
<ai-uploader :instance="instance" disabled v-model="item.files"></ai-uploader>
<p class="time"><span>发布于 </span>{{item.createTime}}</p>
2023-01-09 16:38:58 +08:00
</div>
2023-01-11 10:59:56 +08:00
<ai-empty v-if="!info.answers.length">暂无回答</ai-empty>
2023-01-09 16:38:58 +08:00
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
2023-01-10 10:40:01 +08:00
info: {}
2023-01-09 16:38:58 +08:00
}
},
created () {
this.getInfo()
},
methods: {
getInfo () {
2023-01-10 10:40:01 +08:00
this.instance.post(`/app/applearningquestion/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code == 0) {
if (res.data) {
this.info = {...res.data}
}
}
})
2023-01-09 16:38:58 +08:00
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
2023-01-11 15:11:44 +08:00
.title {
font-size: 22px;
font-weight: 700;
line-height: 44px;
word-break: break-all;
}
.title-text {
2023-01-09 16:38:58 +08:00
color: #999!important;
2023-01-11 15:11:44 +08:00
margin-bottom: 24px;
2023-01-09 16:38:58 +08:00
span {
margin-left: 8px;
}
}
.item {
margin-bottom: 32px;
border-bottom: 1px solid #eee;
.flex {
display: flex;
img {
width: 80px;
height: 80px;
margin-right: 16px;
2023-01-11 14:57:19 +08:00
border-radius: 50%;
2023-01-09 16:38:58 +08:00
}
h3 {
line-height: 40px;
2023-01-11 15:11:44 +08:00
font-size: 20px;
font-weight: 400;
2023-01-09 16:38:58 +08:00
margin-bottom: 10px;
}
}
.content {
margin: 16px 0;
}
p {
line-height: 30px;
color: #999;
font-size: 14px;
}
.time {
margin-bottom: 16px;
}
2023-01-10 10:40:01 +08:00
.img-list {
img {
width: 300px;
height: 300px;
margin: 0 8px 8px 0;
}
}
2023-01-09 16:38:58 +08:00
}
.item:nth-last-of-type(1) {
border-bottom: 0;
margin-bottom: 0;
}
</style>