feat:增加查看反馈

This commit is contained in:
2025-12-18 19:33:13 +08:00
parent cc2bf59a19
commit 571518f1e5
2 changed files with 212 additions and 0 deletions

View File

@ -0,0 +1,197 @@
<template>
<el-dialog
v-model="dialogVisible"
title="查看反馈"
width="800px"
:before-close="handleClose"
>
<div class="feedback-container" v-loading="loading">
<!-- 反馈列表 -->
<div class="feedback-list" v-if="currFkListList.length > 0">
<div
v-for="(feedback, index) in currFkListList"
:key="index"
class="feedback-item"
>
<div class="feedback-header">
<div class="user-info">
<el-avatar :size="32" :src="feedback.avatar">
{{ feedback.fkrxm?.charAt(0) || '用' }}
</el-avatar>
<span class="username">{{ feedback.fkrxm || '匿名用户' }}</span>
</div>
<div class="feedback-time" v-if="feedback.fksj">
{{ formatTime(feedback.fksj) }}
</div>
</div>
<div class="feedback-content">
{{ feedback.fknr }}
</div>
</div>
</div>
<!-- 暂无反馈 -->
<el-empty
v-else
description="暂无反馈信息"
:image-size="120"
/>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleClose">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { ref, computed } from 'vue'
const dialogVisible = ref(false)
const loading = ref(false)
const currFkListList = ref([])
// // 计算所有反馈列表
// const currFkListList = computed(() => {
// let allFeedbacks = []
// if (currFkListList.value && Array.isArray(currFkListList.value)) {
// currFkListList.value.forEach(item => {
// if (item.fkList && Array.isArray(item.fkList)) {
// item.fkList.forEach(feedback => {
// allFeedbacks.push({
// ...feedback,
// // 如果有评论内容,也一并显示
// plnr: item.plnr
// })
// })
// }
// })
// }
// // 按时间排序(如果有时间字段)
// return allFeedbacks.sort((a, b) => {
// if (a.fksj && b.fksj) {
// return new Date(b.fksj) - new Date(a.fksj)
// }
// return 0
// })
// })
// 打开弹框
const open = (fkList) => {
currFkListList.value = fkList || []
dialogVisible.value = true
}
// 关闭弹框
const handleClose = () => {
dialogVisible.value = false
currFkListList.value = []
}
// 格式化时间
const formatTime = (timeStr) => {
if (!timeStr) return ''
try {
const date = new Date(timeStr)
return date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit'
})
} catch (error) {
return timeStr
}
}
defineExpose({
open
})
</script>
<style scoped>
.feedback-container {
max-height: 500px;
overflow-y: auto;
}
.feedback-list {
display: flex;
flex-direction: column;
gap: 16px;
}
.feedback-item {
border: 1px solid #e4e7ed;
border-radius: 8px;
padding: 16px;
background-color: #fafafa;
transition: all 0.3s ease;
}
.feedback-item:hover {
border-color: #409eff;
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
}
.feedback-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.user-info {
display: flex;
align-items: center;
gap: 8px;
}
.username {
font-weight: 500;
color: #303133;
font-size: 14px;
}
.feedback-time {
font-size: 12px;
color: #909399;
}
.feedback-content {
color: #606266;
line-height: 1.6;
font-size: 14px;
white-space: pre-wrap;
word-break: break-word;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
}
/* 滚动条样式 */
.feedback-container::-webkit-scrollbar {
width: 6px;
}
.feedback-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
.feedback-container::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 3px;
}
.feedback-container::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
</style>

View File

@ -38,6 +38,11 @@
</div> </div>
<div class="bottom"> <div class="bottom">
<el-link type="primary" @click="viewFeedback(item)">
<el-icon>
<View />
</el-icon>查看反馈
</el-link>
<el-popover placement="top" :visible="item.visible" :width="400" trigger="click"> <el-popover placement="top" :visible="item.visible" :width="400" trigger="click">
<template #reference> <template #reference>
<el-link type="primary"><el-icon> <el-link type="primary"><el-icon>
@ -79,6 +84,9 @@
<!-- 反馈弹窗 --> <!-- 反馈弹窗 -->
<FeedbackForm ref="feedbackFormRef" @success="getList" /> <FeedbackForm ref="feedbackFormRef" @success="getList" />
<!-- 查看反馈弹窗 -->
<ViewFeedback ref="viewFeedbackRef" />
</template> </template>
<script setup> <script setup>
@ -91,6 +99,7 @@ import Search from "@/components/aboutTable/Search.vue";
import DetailForm from "./components/detailForm.vue"; import DetailForm from "./components/detailForm.vue";
import RoomDetail from "./components/roomDetail.vue"; import RoomDetail from "./components/roomDetail.vue";
import FeedbackForm from "./components/FeedbackForm.vue"; import FeedbackForm from "./components/FeedbackForm.vue";
import ViewFeedback from "./components/ViewFeedback.vue";
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js"; import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
@ -104,6 +113,7 @@ const searchBox = ref(); //搜索框
const openMeeting = ref(false); // 打开会议窗口 const openMeeting = ref(false); // 打开会议窗口
const refMeetingView = ref() const refMeetingView = ref()
const feedbackFormRef = ref() // 反馈弹窗引用 const feedbackFormRef = ref() // 反馈弹窗引用
const viewFeedbackRef = ref() // 查看反馈弹窗引用
const searchConfiger = ref([ const searchConfiger = ref([
{ {
label: "会议主题", label: "会议主题",
@ -205,6 +215,11 @@ const feedBack = (item) => {
feedbackFormRef.value.open(item.id); feedbackFormRef.value.open(item.id);
}; };
// 查看反馈
const viewFeedback = (item) => {
viewFeedbackRef.value.open(item.fkList || []);
};
// 删除 // 删除
const delDictItem = (id) => { const delDictItem = (id) => {
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => { proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {