Browse Source

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

lxf 2 years ago
parent
commit
22f83efa8b
1 changed files with 7 additions and 7 deletions
  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();