feat:日历格式处理

This commit is contained in:
1708-huayu 2025-08-22 19:12:39 +08:00
parent 252b3f1478
commit 5eaf84df48
9 changed files with 63 additions and 23 deletions

View File

@ -31,4 +31,9 @@ docker run -d -p 3001:80 -p 3002:443 --network task-manager --restart unless-sto
# 复制证书到云服务器 # 复制证书到云服务器
scp -r cert/ root@121.36.71.28:/usr/local/software/nginx-1.28.0/ scp -r cert/ root@121.36.71.28:/usr/local/software/nginx-1.28.0/
scp -r out/ root@121.36.71.28:/usr/share/nginx/html
cp -rf ./* ../
``` ```

View File

@ -72,7 +72,28 @@ http {
try_files $uri $uri.html $uri/ =404; try_files $uri $uri.html $uri/ =404;
# try_files $uri $uri/ =404; # try_files $uri $uri/ =404;
} }
# 第二个页面的配置
location /todo {
# 关键配置:禁用重定向中的端口和绝对路径
absolute_redirect off;
port_in_redirect off;
# 指定根目录
alias /usr/share/nginx/html/todo;
index index.html index.htm;
# 正确的文件查找逻辑:所有路由都返回 index.html
try_files $uri $uri/ /todo/index.html;
# 安全头部
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
# 确保不会重定向到带端口的URL
add_header X-Forwarded-Host $host;
add_header X-Forwarded-Port 443;
add_header X-Forwarded-Proto https;
}
# 第二个页面的配置 # 第二个页面的配置
location ^~ /mobile/ { location ^~ /mobile/ {
# index index.html index.htm; # index index.html index.htm;
@ -95,19 +116,9 @@ http {
client_body_buffer_size 16k; client_body_buffer_size 16k;
client_max_body_size 100M; client_max_body_size 100M;
} }
location ^~ /todoWeb/ {
# 预检请求的处理
if ($request_method = 'OPTIONS') {
return 204;
}
# rewrite ^/todo-server/(.*)$ /$1 break;
proxy_pass http://localhost:8092/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_body_buffer_size 16k;
client_max_body_size 100M;
}
location ^~ /security-server/ { location ^~ /security-server/ {
# 预检请求的处理 # 预检请求的处理
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {

View File

@ -1,5 +1,11 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const isProduction = process.env.NODE_ENV === 'production'
const nextConfig = { const nextConfig = {
// 核心配置:构建前清空输出目录
cleanDistDir: true,
basePath: isProduction ? "/todo" : '',
// 静态文件前缀
assetPrefix: isProduction ? "/todo" : '',
// Middleware cannot be used with "output: export". // Middleware cannot be used with "output: export".
output: 'export', output: 'export',
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html` // Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
@ -7,15 +13,14 @@ const nextConfig = {
// Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href` // Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
// skipTrailingSlashRedirect: true, // skipTrailingSlashRedirect: true,
// Optional: Change the output directory `out` -> `dist` // Optional: Change the output directory `out` -> `dist`
distDir: 'docker/out', distDir: 'docker/outd',
// 严格模式下react-beautiful-dnd无法使用 // 严格模式下react-beautiful-dnd无法使用
reactStrictMode:false, reactStrictMode:false,
eslint: { eslint: {
// Warning: This allows production builds to successfully complete even if // Warning: This allows production builds to successfully complete even if
// your project has ESLint errors. // your project has ESLint errors.
// ignoreDuringBuilds: true, ignoreDuringBuilds: true,
}, },
}; };

View File

@ -17,6 +17,8 @@ export default function Home() {
}else { }else {
replace("/task/project") replace("/task/project")
} }
}else if (pathName =="/"){
replace("/task/project")
} }
}else { }else {
replace("/login") replace("/login")

View File

@ -1,6 +1,5 @@
import React, {Fragment} from 'react'; import React from 'react';
import {DateHeaderProps} from "react-big-calendar"; import {DateHeaderProps} from "react-big-calendar";
import {solarToLunar} from "lunar-calendar";
import {lunarDateShow} from "@/utils/timeFormatUtil"; import {lunarDateShow} from "@/utils/timeFormatUtil";
// 定义为 React 函数组件 // 定义为 React 函数组件

View File

@ -13,5 +13,5 @@ export const askLoginAPI = (data:{}):Promise<AxiosResponse<ResponseVO<AskLoginRe
} }
export const refreshTokenAPI = ():Promise<AxiosResponse<ResponseVO<string>>> =>{ export const refreshTokenAPI = ():Promise<AxiosResponse<ResponseVO<string>>> =>{
return httpReq.get(process.env.NEXT_PUBLIC_SECURITY_REQUEST_URL + "/V2/wx/login/refreshToken") return httpReq.post(process.env.NEXT_PUBLIC_SECURITY_REQUEST_URL + "/V2/wx/login/refreshToken")
} }

View File

@ -5,4 +5,5 @@ export interface TaskEvent extends Event {
state?:any; state?:any;
taskType?:string; taskType?:string;
priority?:any; priority?:any;
description?:string;
} }

View File

@ -170,8 +170,8 @@ const CalShow: React.FC = () => {
if (responseD.status.success) { if (responseD.status.success) {
let result: TaskEvent[] = responseD.data.content.map<TaskEvent>(taskState => { let result: TaskEvent[] = responseD.data.content.map<TaskEvent>(taskState => {
return { return {
start: taskState.expectedStartTime?dayjs(taskState.expectedStartTime).toDate():dayjs(taskState.expectedEndTime).startOf('day').toDate(), start: taskState.expectedStartTime ? dayjs(taskState.expectedStartTime).toDate() : dayjs(taskState.expectedEndTime).startOf('day').toDate(),
end: taskState.expectedEndTime?dayjs(taskState.expectedEndTime).toDate():dayjs(taskState.expectedStartTime).endOf('day').toDate(), end: taskState.expectedEndTime ? dayjs(taskState.expectedEndTime).toDate() : dayjs(taskState.expectedStartTime).endOf('day').toDate(),
title: <Fragment> title: <Fragment>
<div> <div>
<TaskNameAndIcon task={taskState}/> <TaskNameAndIcon task={taskState}/>
@ -193,7 +193,8 @@ const CalShow: React.FC = () => {
id: taskState.id, id: taskState.id,
state: taskState.state, state: taskState.state,
priority: taskState.priority, priority: taskState.priority,
taskType: taskState.taskType taskType: taskState.taskType,
description:taskState.description
} }
}); });
console.log('responseD.data.content:', result) console.log('responseD.data.content:', result)
@ -406,6 +407,21 @@ const CalShow: React.FC = () => {
} }
setRange({...range}) setRange({...range})
} }
const toolTipShow = (event:TaskEvent) =>{
console.log("toolTipShow", event)
let result=""
if (view!='month'){
result += "\n"
}
result += "计划:"+event.name
if (event.description){
result += "\n描述:"+event.description
}
return result;
}
return <div className="App" style={{height: '90vh'}}> return <div className="App" style={{height: '90vh'}}>
{open && <DetailModelForm operationId={operationId} {open && <DetailModelForm operationId={operationId}
description={description} description={description}
@ -471,6 +487,7 @@ const CalShow: React.FC = () => {
dateHeader: CalHeader dateHeader: CalHeader
} }
}} }}
tooltipAccessor={toolTipShow}
/> />
</div> </div>
} }

View File

@ -247,7 +247,7 @@ function lunarDateShow(date:Date){
if(lunarDate.term){ if(lunarDate.term){
return lunarDate.term; return lunarDate.term;
} }
if(lunarDate.lunarFestival){ if(lunarDate.lunarFestival && lunarDate.lunarMonthName.indexOf("闰")==-1){
return lunarDate.lunarFestival; return lunarDate.lunarFestival;
} }
if(lunarDate.solarFestival){ if(lunarDate.solarFestival){