|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div
|
|
<div
|
|
|
class="single-item"
|
|
class="single-item"
|
|
|
- :style="`padding-bottom:${props.problemData.isReplied === REPLYSTATUS.replied ? '16px' : '38px'}`"
|
|
|
|
|
|
|
+ :style="`padding-bottom:${props.problemData.isReplied === REPLY_STATUS.REPLIED ? '16px' : '38px'}`"
|
|
|
>
|
|
>
|
|
|
<div v-show="props.problemData.isUserDeleted === 1" class="delete-label"></div>
|
|
<div v-show="props.problemData.isUserDeleted === 1" class="delete-label"></div>
|
|
|
<div :style="{ opacity: props.problemData.isUserDeleted === 1 ? 0.6 : 1 }">
|
|
<div :style="{ opacity: props.problemData.isUserDeleted === 1 ? 0.6 : 1 }">
|
|
@@ -13,31 +13,35 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="buttonBar">
|
|
<div class="buttonBar">
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-show="props.problemData.status === COMMENTSTATUS.passed"
|
|
|
|
|
|
|
+ v-show="props.problemData.status === COMMENT_STATUS.PASSED"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
style="width: 74px; margin-left: auto; margin-right: 0"
|
|
style="width: 74px; margin-left: auto; margin-right: 0"
|
|
|
@click="hideComment"
|
|
@click="hideComment"
|
|
|
- >隐藏</el-button
|
|
|
|
|
>
|
|
>
|
|
|
|
|
+ 隐藏
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-show="props.problemData.status === COMMENTSTATUS.rejected"
|
|
|
|
|
|
|
+ v-show="props.problemData.status === COMMENT_STATUS.REJECTED"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
style="width: 74px; margin-left: auto; margin-right: 0"
|
|
style="width: 74px; margin-left: auto; margin-right: 0"
|
|
|
@click="displayComment"
|
|
@click="displayComment"
|
|
|
- >显示</el-button
|
|
|
|
|
>
|
|
>
|
|
|
|
|
+ 显示
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-show="
|
|
v-show="
|
|
|
- props.problemData.isReplied === REPLYSTATUS.unReplied && props.problemData.status === COMMENTSTATUS.passed
|
|
|
|
|
|
|
+ props.problemData.isReplied === REPLY_STATUS.UN_REPLIED &&
|
|
|
|
|
+ props.problemData.status === COMMENT_STATUS.PASSED
|
|
|
"
|
|
"
|
|
|
style="width: 74px"
|
|
style="width: 74px"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="openReply = true"
|
|
@click="openReply = true"
|
|
|
- >回复</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button v-show="props.problemData.isReplied === REPLYSTATUS.replied" style="width: 74px" disabled
|
|
|
|
|
- >已回复</el-button
|
|
|
|
|
>
|
|
>
|
|
|
|
|
+ 回复
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button v-show="props.problemData.isReplied === REPLY_STATUS.REPLIED" style="width: 74px" disabled>
|
|
|
|
|
+ 已回复
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<el-divider />
|
|
<el-divider />
|
|
@@ -82,9 +86,9 @@
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
"
|
|
"
|
|
|
>
|
|
>
|
|
|
- <span style="line-height: normal" :style="replyContent.length === 200 ? 'color:red' : ''">{{
|
|
|
|
|
- replyContent.length
|
|
|
|
|
- }}</span>
|
|
|
|
|
|
|
+ <span style="line-height: normal" :style="replyContent.length === 200 ? 'color:red' : ''">
|
|
|
|
|
+ {{ replyContent.length }}
|
|
|
|
|
+ </span>
|
|
|
<span style="line-height: normal">/200</span>
|
|
<span style="line-height: normal">/200</span>
|
|
|
</span>
|
|
</span>
|
|
|
<div style="position: absolute; height: 32px; right: 10px; padding-bottom: 5px; bottom: 2px">
|
|
<div style="position: absolute; height: 32px; right: 10px; padding-bottom: 5px; bottom: 2px">
|
|
@@ -94,13 +98,14 @@
|
|
|
size="small"
|
|
size="small"
|
|
|
@click="submitReply"
|
|
@click="submitReply"
|
|
|
:disabled="replyContent.length === 0"
|
|
:disabled="replyContent.length === 0"
|
|
|
- >发布</el-button
|
|
|
|
|
>
|
|
>
|
|
|
|
|
+ 发布
|
|
|
|
|
+ </el-button>
|
|
|
<el-button style="margin-top: 3px" size="small" @click="openReply = false">取消</el-button>
|
|
<el-button style="margin-top: 3px" size="small" @click="openReply = false">取消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div v-if="props.problemData.isReplied === REPLYSTATUS.replied" style="position: relative">
|
|
|
|
|
|
|
+ <div v-if="props.problemData.isReplied === REPLY_STATUS.REPLIED" style="position: relative">
|
|
|
<el-input type="textarea" v-model="props.problemData.reply" rows="3" disabled> </el-input>
|
|
<el-input type="textarea" v-model="props.problemData.reply" rows="3" disabled> </el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -110,7 +115,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, computed } from 'vue';
|
|
import { ref, computed } from 'vue';
|
|
|
import { undateCommentStatus, replyComment } from '@/api/comments/comments';
|
|
import { undateCommentStatus, replyComment } from '@/api/comments/comments';
|
|
|
- import { REPLYSTATUS, COMMENTSTATUS } from '@/types/comments/constant';
|
|
|
|
|
|
|
+ import { REPLY_STATUS, COMMENT_STATUS } from '@/types/comments/constant';
|
|
|
import { Records } from '@/types/comments/type';
|
|
import { Records } from '@/types/comments/type';
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
problemData: Records;
|
|
problemData: Records;
|
|
@@ -124,12 +129,12 @@
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const hideComment = () => {
|
|
const hideComment = () => {
|
|
|
- undateCommentStatus({ id: props.problemData.id, status: COMMENTSTATUS.rejected }).then(() => {
|
|
|
|
|
|
|
+ undateCommentStatus({ id: props.problemData.id, status: COMMENT_STATUS.REJECTED }).then(() => {
|
|
|
emit('reFreshList');
|
|
emit('reFreshList');
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
const displayComment = () => {
|
|
const displayComment = () => {
|
|
|
- undateCommentStatus({ id: props.problemData.id, status: COMMENTSTATUS.passed }).then(() => {
|
|
|
|
|
|
|
+ undateCommentStatus({ id: props.problemData.id, status: COMMENT_STATUS.PASSED }).then(() => {
|
|
|
emit('reFreshList');
|
|
emit('reFreshList');
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|