浏览代码

🐛进度-按日期查看-昨日

shaogen1995 1 年之前
父节点
当前提交
150f964ae2
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/pages/B1Plan/PlanModal.tsx

+ 3 - 2
src/pages/B1Plan/PlanModal.tsx

@@ -158,8 +158,9 @@ function PlanModal({ title, closePageFu }: Props) {
     const numRes = nowTime - 86400000 * num;
     const arr = [
       dayjs(numRes).format("YYYY-MM-DD"),
-      dayjs(nowTime).format("YYYY-MM-DD"),
+      dayjs(num === 1 ? numRes : nowTime).format("YYYY-MM-DD"),
     ];
+
     const obj = {
       ...tableSelectRef.current,
       timeAll: arr,
@@ -202,7 +203,7 @@ function PlanModal({ title, closePageFu }: Props) {
   const deriveFu = useCallback(async () => {
     if (list.length === 0) return MessageFu.warning("当前搜索条件没有数据!");
     let name = title + dayjs(new Date()).format("YYYY-MM-DD HH:mm");
-    name=name.replaceAll('/','_')    
+    name = name.replaceAll("/", "_");
 
     const option = {
       fileName: name,