Jelajahi Sumber

feat: 初步完成评论中台,删除不必要的文件

kuanghua liu 1 tahun lalu
induk
melakukan
209c659e16

+ 0 - 25
src/views/system/comments/PageCommentsManage.vue

@@ -1,20 +1,7 @@
 <template>
   <div class="feedback-page">
     <div class="feedback-head">
-      <!-- <el-radio-group
-        v-model="problemStatus"
-        class="radio-button"
-        text-color="#1677FF"
-        fill="#1890FF26"
-        @change="handleClick"
-      >
-        <el-radio-button v-for="item in tabContent" :value="item.value" :key="item.value">{{
-          item.name
-        }}</el-radio-button>
-      </el-radio-group> -->
       <div class="search-input">
-        <!-- <el-input v-model="queryDescription" style="width: 294px" placeholder="请输入搜索内容" :prefix-icon="Search" />
-        <el-button type="primary" style="margin-left: 16px" @click="searchFeedback">搜索</el-button> -->
         <el-form :inline="true" :model="listFilter" class="demo-form-inline">
           <el-form-item label="审核状态:">
             <el-select v-model="listFilter.authStatus" placeholder="请选择审核状态" @change="getList">
@@ -57,8 +44,6 @@
 </template>
 
 <script setup lang="ts">
-  // import { Search } from '@element-plus/icons-vue';
-  // import { tabContent } from './constant.ts';
   import SingleComment from './component/SingleComment.vue';
   import useComments from './use-comments.ts';
   import { REPLYSTATUS, COMMENTSTATUS } from '@/api/comments/comments';
@@ -66,16 +51,6 @@
   const useCommentsList = useComments();
   const { commentsList, pageNumber, pageSize, totalRow, getList, listFilter } = useCommentsList;
 
-  // const handleClick = () => {
-  //   queryDescription.value = '';
-  //   getList();
-  // };
-
-  // const searchFeedback = () => {
-  //   pageNumber.value = 1;
-  //   getList();
-  // };
-
   const handleSizeChange = () => {
     pageNumber.value = 1;
     getList();

+ 0 - 48
src/views/system/comments/component/SingleComment.vue

@@ -39,10 +39,6 @@
     </div>
 
     <el-divider />
-    <!-- <div class="problem-type">
-      <div>问题类型:</div>
-      <div class="type-content">{{ problemTypeName[props.problemData.problemType] }}</div>
-    </div> -->
     <div class="problem-describe">
       <div>评论内容:</div>
       <div class="problem-content">{{ props.problemData.comment }}</div>
@@ -91,86 +87,42 @@
     <div v-if="props.problemData.isReplied === REPLYSTATUS.replied" style="position: relative">
       <el-input type="textarea" v-model="props.problemData.reply" rows="3" disabled> </el-input>
     </div>
-
-    <!-- <el-collapse v-if="props.problemData.problemStatus === STATUS.handled" v-model="activeNames">
-      <el-collapse-item name="1">
-        <template #title>
-          <div class="problem-describe">
-            <div>处理人:</div>
-            <div class="problem-content">{{ props.problemData.processorName }}</div>
-          </div>
-        </template>
-        <div class="problem-describe">
-          <div>处理措施:</div>
-          <div class="problem-content">{{ props.problemData.dealMethod }}</div>
-        </div>
-      </el-collapse-item>
-    </el-collapse> -->
   </div>
 </template>
 
 <script setup lang="ts">
   import { ref, computed } from 'vue';
-  // import { useRouter } from 'vue-router';
   import { Records, REPLYSTATUS, COMMENTSTATUS, undateCommentStatus, replyComment } from '@/api/comments/comments';
-  // import useHandleStore from '../useHandleStore';
-  // import { storeToRefs } from 'pinia';
-  // import { problemTypeName } from '../constant';
-
-  // const useSingle = useHandleStore();
-  // const { singleFeedback } = storeToRefs(useSingle);
-
-  // const router = useRouter();
   const props = defineProps<{
     problemData: Records;
     reFreshList: () => unknown;
   }>();
 
-  // const showComment = ref<boolean>(false);
-  // const replyed = ref<boolean>(false);
-
-  // const activeNames = ref<string>('');
   const problemImageUrls = computed(() => {
     const imageUrlString = props.problemData.picUrl;
     return imageUrlString ? imageUrlString.split(',') : [];
   });
 
-  // const handleProblem = () => {
-  //   singleFeedback.value = props.problemData;
-  //   router.push('/system/feedback-handle');
-  // };
   const hideComment = () => {
-    // showComment.value = false;
     undateCommentStatus({ id: props.problemData.id, status: COMMENTSTATUS.rejected }).then(() => {
       props.reFreshList();
-      // console.log('隐藏成功');
     });
-    // console.log('隐藏');
   };
   const displayComment = () => {
-    // showComment.value = true;
     undateCommentStatus({ id: props.problemData.id, status: COMMENTSTATUS.passed }).then(() => {
       props.reFreshList();
-      // console.log('显示成功');
     });
-    // console.log('显示');
   };
   const submitReply = () => {
-    // replyed.value = true;
     replyComment({ id: props.problemData.id, reply: replyContent.value }).then(() => {
       openReply.value = false;
       props.reFreshList();
-      // console.log('隐藏成功');
     });
-    // console.log('回复');
   };
 
   const openReply = ref(false);
 
   const replyContent = ref('回复:');
-  // const testContent = ref(
-  //   '回复:3月7日,中共中央政治局委员、外交部长王毅谈中美关系时对美国连发5问,并表示,相互尊重是中美关系的重要前提。',
-  // );
 </script>
 
 <style scoped>

+ 0 - 18
src/views/system/comments/constant.ts

@@ -1,18 +0,0 @@
-import { STATUS } from '@/api/feedback/feedback';
-
-export const tabContent = [
-  { name: '未处理yyds', value: STATUS.unhandled },
-  { name: '已处理亚克西', value: STATUS.handled },
-];
-
-enum ProblemType {
-  'system' = 1,
-  'product' = 2,
-  'other' = 3,
-}
-
-export const problemTypeName = {
-  [ProblemType.system]: '系统操作问题',
-  [ProblemType.product]: '产品内容问题',
-  [ProblemType.other]: '其他',
-};

+ 0 - 5
src/views/system/comments/use-comments.ts

@@ -1,4 +1,3 @@
-// import { STATUS, Records, QueryFeedback, getFeedbackList } from '@/api/feedback/feedback';
 import { REPLYSTATUS, COMMENTSTATUS, Records, CommentsQuery, getCommentsList } from '@/api/comments/comments';
 import { onMounted, ref } from 'vue';
 
@@ -6,8 +5,6 @@ export function useCommentsList() {
   const commentsList = ref<Records[]>([]);
   const pageNumber = ref<number>(1);
   const pageSize = ref<number>(10);
-  // const problemStatus = ref<STATUS>(STATUS.unhandled);
-  // const queryDescription = ref<string>('');
   const totalPage = ref<number>();
   const totalRow = ref<number>();
 
@@ -20,8 +17,6 @@ export function useCommentsList() {
     const params: CommentsQuery = {
       pageNumber: pageNumber.value,
       pageSize: pageSize.value,
-      //problemDescription: queryDescription.value
-      // problemStatus: problemStatus.value,
     };
     if (listFilter.value.authStatus !== COMMENTSTATUS.all) {
       //若传1,则拉取审核通过的;若传0,则拉取审核未通过的和未审核的

+ 0 - 11
src/views/system/comments/useHandleStore.ts

@@ -1,11 +0,0 @@
-import { ref } from 'vue';
-import { defineStore } from 'pinia';
-import { Records } from '@/api/feedback/feedback';
-
-export const useFeedbackHandled = defineStore('handle-feedback', () => {
-  const singleFeedback = ref<Records>({} as Records);
-
-  return { singleFeedback };
-});
-
-export default useFeedbackHandled;