Parcourir la source

fix: 修改移动端周报周日日期匹配错误问题

qiny il y a 1 an
Parent
commit
b9dd750cac

+ 1 - 1
client/src/views/OaSystem/personnelManagement/components/DetailBox.vue

@@ -73,6 +73,7 @@ const getCommentList = async () => {
   })
   commentList.value = result.map((item) => ({
     ...item,
+    commentContent: decodeURI(item.commentContent), // 将评论转换一下
     isReply: false
   }))
 }
@@ -99,7 +100,6 @@ const replyComment = (data: IComment, isCancel?) => {
   commentList.value = commentList.value.map((item) => {
     return {
       ...item,
-      commentContent: decodeURI(item.commentContent), // 将评论转换一下
       isReply: item.id == data.id
     }
   })

+ 19 - 6
client_h5/src/pages/myLogs/Weekly/index.vue

@@ -60,14 +60,27 @@ interface FormData {
   reportMonth: string | number; // 月
   reportWeek: string | number; // 周
 }
-
-// 页面数据
-const thisWeek = ref(
-  `${moment().startOf("week").add(1, "day").format("YYYY/MM/DD")} ~ ${moment()
+const defWeek = () => {
+  if (moment().day() == 0) {
+    const today = moment().subtract(1, "day");
+    return `${moment(today)
+      .startOf("week")
+      .add(1, "day")
+      .format("YYYY/MM/DD")} ~ ${moment(today)
+      .endOf("week")
+      .add(1, "day")
+      .format("YYYY/MM/DD")}`;
+  }
+  return `${moment()
+    .startOf("week")
+    .add(1, "day")
+    .format("YYYY/MM/DD")} ~ ${moment()
     .endOf("week")
     .add(1, "day")
-    .format("YYYY/MM/DD")}`
-);
+    .format("YYYY/MM/DD")}`;
+};
+// 页面数据
+const thisWeek = ref(defWeek());
 const formData = reactive<FormData>({
   reportContent: "",
   weeklyWorkloadList: [],