|
|
@@ -92,12 +92,15 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, computed } from 'vue';
|
|
|
- import { Records, REPLYSTATUS, COMMENTSTATUS, undateCommentStatus, replyComment } from '@/api/comments/comments';
|
|
|
+ import { undateCommentStatus, replyComment } from '@/api/comments/comments';
|
|
|
+ import { REPLYSTATUS, COMMENTSTATUS } from '@/types/comments/constant';
|
|
|
+ import { Records } from '@/types/comments/type';
|
|
|
const props = defineProps<{
|
|
|
problemData: Records;
|
|
|
- reFreshList: () => unknown;
|
|
|
}>();
|
|
|
|
|
|
+ const emit = defineEmits(['reFreshList']);
|
|
|
+
|
|
|
const problemImageUrls = computed(() => {
|
|
|
const imageUrlString = props.problemData.picUrl;
|
|
|
return imageUrlString ? imageUrlString.split(',') : [];
|
|
|
@@ -105,18 +108,18 @@
|
|
|
|
|
|
const hideComment = () => {
|
|
|
undateCommentStatus({ id: props.problemData.id, status: COMMENTSTATUS.rejected }).then(() => {
|
|
|
- props.reFreshList();
|
|
|
+ emit('reFreshList');
|
|
|
});
|
|
|
};
|
|
|
const displayComment = () => {
|
|
|
undateCommentStatus({ id: props.problemData.id, status: COMMENTSTATUS.passed }).then(() => {
|
|
|
- props.reFreshList();
|
|
|
+ emit('reFreshList');
|
|
|
});
|
|
|
};
|
|
|
const submitReply = () => {
|
|
|
replyComment({ id: props.problemData.id, reply: replyContent.value }).then(() => {
|
|
|
openReply.value = false;
|
|
|
- props.reFreshList();
|
|
|
+ emit('reFreshList');
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -205,3 +208,4 @@
|
|
|
border-top: none;
|
|
|
}
|
|
|
</style>
|
|
|
+@/types/comments/constant
|