소스 검색

切换日报选项列表没数据时, 日报内容没重置

lxf 2 년 전
부모
커밋
22f83efa8b
1개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  1. 7 7
      src/views/oa/work/dailyPaper/index.vue

+ 7 - 7
src/views/oa/work/dailyPaper/index.vue

@@ -392,13 +392,13 @@ const getList = () => {
   proxy.post("/dailyReport/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = sourceList.value.data.concat(res.rows);
     sourceList.value.total = res.total;
-    if (
-      sourceList.value.data &&
-      sourceList.value.data.length > 0 &&
-      dailyPaperId.value !== sourceList.value.data[0].id &&
-      !sourceList.value.pagination.senderId
-    ) {
-      selectDailyPaper(sourceList.value.data[0]);
+    if (sourceList.value.data && sourceList.value.data.length > 0) {
+      if (dailyPaperId.value !== sourceList.value.data[0].id && !sourceList.value.pagination.senderId) {
+        selectDailyPaper(sourceList.value.data[0]);
+      }
+    } else {
+      dailyPaperDetail.value = {};
+      dailyPaperId.value = "";
     }
     if (sourceList.value.total > sourceList.value.pagination.pageNum * sourceList.value.pagination.pageSize) {
       load();