From a2da55bd9ec888766f01bda1ca5b383a4d6b9906 Mon Sep 17 00:00:00 2001 From: longdayi <13477510+longdayilongdayi@user.noreply.gitee.com> Date: Sat, 25 Jan 2025 20:48:16 +0800 Subject: [PATCH] 01252048 --- apps/web/src/app/auth/login.tsx | 10 +-- apps/web/src/app/auth/page.tsx | 34 +++++------ apps/web/src/app/auth/register.tsx | 2 +- apps/web/src/app/main/letter/editor/page.tsx | 2 +- apps/web/src/app/main/letter/list/page.tsx | 2 +- .../web/src/app/main/letter/progress/page.tsx | 61 ++++++++----------- .../src/app/main/letter/write/SendCard.tsx | 24 ++++---- .../src/app/main/letter/write/WriteHeader.tsx | 2 +- apps/web/src/app/main/letter/write/page.tsx | 7 ++- .../web/src/components/layout/main/Header.tsx | 3 +- .../editor/context/LetterEditorContext.tsx | 1 - .../post/editor/form/LetterBasicForm.tsx | 5 +- packages/theme/src/tailwind.ts | 24 +++++--- 13 files changed, 86 insertions(+), 91 deletions(-) diff --git a/apps/web/src/app/auth/login.tsx b/apps/web/src/app/auth/login.tsx index aee4144..2e97e75 100644 --- a/apps/web/src/app/auth/login.tsx +++ b/apps/web/src/app/auth/login.tsx @@ -31,12 +31,12 @@ export const LoginForm = ({ onSubmit, isLoading }: LoginFormProps) => { label="用户名" name="username" rules={[ - { required: true, message: "Username is required" }, - { min: 2, message: "Username must be at least 2 characters" } + { required: true, message: "请输入用户名" }, + { min: 2, message: "用户名至少需要2个字符" } ]} > @@ -45,11 +45,11 @@ export const LoginForm = ({ onSubmit, isLoading }: LoginFormProps) => { label="密码" name="password" rules={[ - { required: true, message: "Password is required" } + { required: true, message: "请输入密码" } ]} > diff --git a/apps/web/src/app/auth/page.tsx b/apps/web/src/app/auth/page.tsx index c4a3d27..ee304df 100644 --- a/apps/web/src/app/auth/page.tsx +++ b/apps/web/src/app/auth/page.tsx @@ -6,11 +6,6 @@ import { LoginForm } from "./login"; import { Card, Typography, Button, Spin, Divider } from "antd"; import { AnimatePresence, motion } from "framer-motion"; import { useAuthForm } from "./useAuthForm"; -import { - GithubOutlined, - GoogleOutlined, - LoadingOutlined -} from '@ant-design/icons'; const { Title, Text, Paragraph } = Typography; @@ -41,23 +36,22 @@ const AuthPage: React.FC = () => { animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5 }} > -
{/* Left Panel - Welcome Section */} -
+
-
- 欢迎来到 Leader Mail +
+ 首长机关信箱
- - 与领导者建立联系,分享见解,在专为职业发展设计的协作环境中共同成长。 + + 倾听官兵心声,及时响应诉求,竭诚为每一位战友解难题、办实事 {showLogin && ( )} @@ -88,13 +82,13 @@ const AuthPage: React.FC = () => { 登录 - 还没有账户?{' '} + 首次使用?{' '} @@ -113,15 +107,15 @@ const AuthPage: React.FC = () => { transition={{ duration: 0.3 }} > - 创建账户 + 注册账号 - 已有账户?{' '} + 已有账号?{' '} @@ -135,7 +129,7 @@ const AuthPage: React.FC = () => {
- +
diff --git a/apps/web/src/app/auth/register.tsx b/apps/web/src/app/auth/register.tsx index aa96c1a..57c4b0b 100644 --- a/apps/web/src/app/auth/register.tsx +++ b/apps/web/src/app/auth/register.tsx @@ -122,7 +122,7 @@ export const RegisterForm = ({ onSubmit, isLoading }: RegisterFormProps) => { loading={isLoading} className="w-full h-10 rounded-lg" > - {isLoading ? "正在创建账户..." : "创建账户"} + {isLoading ? "正在注册..." : "注册"} diff --git a/apps/web/src/app/main/letter/editor/page.tsx b/apps/web/src/app/main/letter/editor/page.tsx index 61bd7bc..4caa91f 100644 --- a/apps/web/src/app/main/letter/editor/page.tsx +++ b/apps/web/src/app/main/letter/editor/page.tsx @@ -9,7 +9,7 @@ export default function LetterEditorPage() { const termId = searchParams.get("termId"); return ( -
+
diff --git a/apps/web/src/app/main/letter/list/page.tsx b/apps/web/src/app/main/letter/list/page.tsx index 6d9fe18..9af1f9f 100644 --- a/apps/web/src/app/main/letter/list/page.tsx +++ b/apps/web/src/app/main/letter/list/page.tsx @@ -5,7 +5,7 @@ export default function LetterListPage() { return ( // 添加 flex flex-col 使其成为弹性布局容器 -
+
{/* 添加 flex-grow 使内容区域自动填充剩余空间 */} diff --git a/apps/web/src/app/main/letter/progress/page.tsx b/apps/web/src/app/main/letter/progress/page.tsx index 12e7d3b..7fb0805 100644 --- a/apps/web/src/app/main/letter/progress/page.tsx +++ b/apps/web/src/app/main/letter/progress/page.tsx @@ -63,44 +63,37 @@ export default function LetterProgressPage() { return (
{/* Main Content */} -
- {/* Search Section */} - -
- -
- - } - size="large" - value={feedbackId} - onChange={(e) => setFeedbackId(e.target.value)} - placeholder="e.g. USAF-2025-0123" - status={error ? "error" : ""} - className="border border-gray-300" - /> - -
- {error && ( -

{error}

- )} +
+
+
+ + } + size="large" + value={feedbackId} + onChange={(e) => setFeedbackId(e.target.value)} + placeholder="请输入信件编码查询处理状态" + status={error ? "error" : ""} + className="border border-gray-300" + /> +
- + {error && ( +

{error}

+ )} +
{/* Results Section */} {status && ( diff --git a/apps/web/src/app/main/letter/write/SendCard.tsx b/apps/web/src/app/main/letter/write/SendCard.tsx index 1099264..02d8a83 100644 --- a/apps/web/src/app/main/letter/write/SendCard.tsx +++ b/apps/web/src/app/main/letter/write/SendCard.tsx @@ -1,7 +1,7 @@ import { motion } from 'framer-motion'; import { StaffDto } from "@nice/common"; import { Button, Tooltip, Badge } from 'antd'; -import { SendOutlined } from '@ant-design/icons'; +import { BankFilled, SendOutlined } from '@ant-design/icons'; import { useNavigate } from 'react-router-dom'; export interface SendCardProps { @@ -13,15 +13,12 @@ export function SendCard({ staff, termId }: SendCardProps) { const navigate = useNavigate(); const handleSendLetter = () => { - navigate(`/editor?termId=${termId || ''}&receiverId=${staff.id}`); + window.open(`/editor?termId=${termId || ''}&receiverId=${staff.id}`, '_blank'); }; return ( -
{/* Image Container */} @@ -61,11 +58,14 @@ export function SendCard({ staff, termId }: SendCardProps) {

- {staff?.showname} + {staff?.showname || staff?.username}

- +
-

{staff.department?.name || '未设置部门'}

+

+ + + {staff.department?.name || '未设置部门'}

@@ -112,6 +112,6 @@ export function SendCard({ staff, termId }: SendCardProps) {
- +
); } diff --git a/apps/web/src/app/main/letter/write/WriteHeader.tsx b/apps/web/src/app/main/letter/write/WriteHeader.tsx index 33b166a..15d3598 100644 --- a/apps/web/src/app/main/letter/write/WriteHeader.tsx +++ b/apps/web/src/app/main/letter/write/WriteHeader.tsx @@ -1,6 +1,6 @@ import { TermDto } from "@nice/common"; -export default function WriteHeader({ term }: { term: TermDto }) { +export default function WriteHeader({ term }: { term?: TermDto }) { return
{/* 主标题 */} diff --git a/apps/web/src/app/main/letter/write/page.tsx b/apps/web/src/app/main/letter/write/page.tsx index c893211..cb8ffba 100644 --- a/apps/web/src/app/main/letter/write/page.tsx +++ b/apps/web/src/app/main/letter/write/page.tsx @@ -46,7 +46,7 @@ export default function WriteLetterPage() { }, [searchQuery, selectedDept, resetPage]); return ( -
+
@@ -121,7 +121,10 @@ export default function WriteLetterPage() { current={currentPage} total={data?.totalPages || 0} pageSize={pageSize} - onChange={(page) => setCurrentPage(page)} + onChange={(page) => { + setCurrentPage(page); + window.scrollTo(0, 0); + }} showSizeChanger={false} showTotal={(total) => `共 ${total} 条记录`} /> diff --git a/apps/web/src/components/layout/main/Header.tsx b/apps/web/src/components/layout/main/Header.tsx index 3590adf..5289417 100644 --- a/apps/web/src/components/layout/main/Header.tsx +++ b/apps/web/src/components/layout/main/Header.tsx @@ -5,13 +5,14 @@ import Navigation from "./navigation"; import { useAuth } from "@web/src/providers/auth-provider"; import { UserOutlined } from "@ant-design/icons"; import { UserMenu } from "../element/usermenu"; +import SineWavesCanvas from "../../animation/sine-wave"; interface HeaderProps { onSearch?: (query: string) => void; } export const Header = memo(function Header({ onSearch }: HeaderProps) { const { isAuthenticated } = useAuth() return ( -
+
diff --git a/apps/web/src/components/models/post/editor/context/LetterEditorContext.tsx b/apps/web/src/components/models/post/editor/context/LetterEditorContext.tsx index dba7d18..c5e83b3 100644 --- a/apps/web/src/components/models/post/editor/context/LetterEditorContext.tsx +++ b/apps/web/src/components/models/post/editor/context/LetterEditorContext.tsx @@ -68,7 +68,6 @@ export function LetterFormProvider({ }, state: PostState.PENDING, isPublic: data?.isPublic, - resources: data.resources?.length ? { connect: ( diff --git a/apps/web/src/components/models/post/editor/form/LetterBasicForm.tsx b/apps/web/src/components/models/post/editor/form/LetterBasicForm.tsx index 3b34b2e..e676314 100644 --- a/apps/web/src/components/models/post/editor/form/LetterBasicForm.tsx +++ b/apps/web/src/components/models/post/editor/form/LetterBasicForm.tsx @@ -2,7 +2,6 @@ import { Form, Input, Button, Checkbox, Select } from "antd"; import { useLetterEditor } from "../context/LetterEditorContext"; import { SendOutlined } from "@ant-design/icons"; import QuillEditor from "@web/src/components/common/editor/quill/QuillEditor"; -import { PostBadge } from "../../detail/badge/PostBadge"; import { TusUploader } from "@web/src/components/common/uploader/TusUploader"; import StaffSelect from "../../../staff/staff-select"; import TermSelect from "../../../term/term-select"; @@ -20,8 +19,8 @@ export function LetterBasicForm() { onFinish={handleFinish} initialValues={{ meta: { tags: [] }, - receiverId, - termId, + receivers: [receiverId], + terms: [termId], isPublic: true, }}>
diff --git a/packages/theme/src/tailwind.ts b/packages/theme/src/tailwind.ts index 28d0afa..d2daa6f 100644 --- a/packages/theme/src/tailwind.ts +++ b/packages/theme/src/tailwind.ts @@ -77,15 +77,21 @@ export const NiceTailwindConfig: Config = { solid: "2px 2px 0 0 rgba(0, 0, 0, 0.2)", glow: "0 0 8px rgba(230, 180, 0, 0.8)", inset: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.15)", - "elevation-1": "0 1px 2px 0 rgba(0, 0, 0, 0.1)", - "elevation-2": "0 2px 4px 0 rgba(0, 0, 0, 0.15)", - "elevation-3": "0 4px 8px 0 rgba(0, 0, 0, 0.2)", - "elevation-4": "0 8px 16px 0 rgba(0, 0, 0, 0.25)", - "elevation-5": "0 16px 32px 0 rgba(0, 0, 0, 0.3)", - panel: "0 4px 6px -1px rgba(0, 48, 138, 0.1), 0 2px 4px -2px rgba(0, 48, 138, 0.1)", - button: "0 2px 4px rgba(0, 48, 138, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1)", - card: "0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08)", - modal: "0 8px 32px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15)", + "elevation-1": "0 1px 2px rgba(0, 48, 138, 0.05), 0 1px 1px rgba(0, 0, 0, 0.05)", + "elevation-2": "0 2px 4px rgba(0, 48, 138, 0.1), 0 2px 2px rgba(0, 0, 0, 0.1)", + "elevation-3": "0 4px 8px rgba(0, 48, 138, 0.15), 0 4px 4px rgba(0, 0, 0, 0.15)", + "elevation-4": "0 8px 16px rgba(0, 48, 138, 0.2), 0 8px 8px rgba(0, 0, 0, 0.2)", + "elevation-5": "0 16px 32px rgba(0, 48, 138, 0.25), 0 16px 16px rgba(0, 0, 0, 0.25)", + panel: "0 4px 6px -1px rgba(0, 48, 138, 0.1), 0 2px 4px -2px rgba(0, 48, 138, 0.1), inset 0 -1px 2px rgba(255, 255, 255, 0.05)", + button: "0 2px 4px rgba(0, 48, 138, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1), 0 1px 1px rgba(0, 0, 0, 0.05)", + card: "0 4px 6px rgba(0, 48, 138, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08), inset 0 -1px 2px rgba(255, 255, 255, 0.05)", + modal: "0 8px 32px rgba(0, 48, 138, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15), inset 0 -2px 4px rgba(255, 255, 255, 0.05)", + "soft-primary": "0 2px 4px rgba(0, 48, 138, 0.1), 0 4px 8px rgba(0, 48, 138, 0.05)", + "soft-secondary": "0 2px 4px rgba(77, 77, 77, 0.1), 0 4px 8px rgba(77, 77, 77, 0.05)", + "soft-accent": "0 2px 4px rgba(230, 180, 0, 0.1), 0 4px 8px rgba(230, 180, 0, 0.05)", + "inner-glow": "inset 0 0 8px rgba(0, 48, 138, 0.1)", + "outer-glow": "0 0 16px rgba(0, 48, 138, 0.1)", + "elegant": "0 4px 24px rgba(0, 48, 138, 0.15), 0 2px 12px rgba(0, 48, 138, 0.1), 0 1px 6px rgba(0, 48, 138, 0.05), inset 0 -1px 2px rgba(255, 255, 255, 0.1)", }, animation: { "pulse-slow": "pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite",