Merge branch 'main' of http://113.45.157.195:3003/insiinc/leader-mail
This commit is contained in:
commit
18088dd732
|
@ -12,7 +12,7 @@
|
||||||
VITE_APP_VERSION: "$VITE_APP_VERSION",
|
VITE_APP_VERSION: "$VITE_APP_VERSION",
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<title>首长机关信箱</title>
|
<title>信箱</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { LoginForm } from "./login";
|
||||||
import { Card, Typography, Button, Spin, Divider } from "antd";
|
import { Card, Typography, Button, Spin, Divider } from "antd";
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
import { AnimatePresence, motion } from "framer-motion";
|
||||||
import { useAuthForm } from "./useAuthForm";
|
import { useAuthForm } from "./useAuthForm";
|
||||||
|
import { env } from "@web/src/env";
|
||||||
|
|
||||||
const { Title, Text, Paragraph } = Typography;
|
const { Title, Text, Paragraph } = Typography;
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ const AuthPage: React.FC = () => {
|
||||||
transition={{ delay: 0.2, duration: 0.5 }}
|
transition={{ delay: 0.2, duration: 0.5 }}
|
||||||
>
|
>
|
||||||
<div className="text-4xl text-white mb-4 font-serif">
|
<div className="text-4xl text-white mb-4 font-serif">
|
||||||
首长机关信箱
|
{env.APP_NAME || '信箱'}
|
||||||
</div>
|
</div>
|
||||||
<Paragraph className="text-lg mb-8 text-blue-100 leading-relaxed text-justify">
|
<Paragraph className="text-lg mb-8 text-blue-100 leading-relaxed text-justify">
|
||||||
聆音于微,润心以答,纾难化雨,解忧惟勤
|
聆音于微,润心以答,纾难化雨,解忧惟勤
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
|
@ -5,49 +5,46 @@ import Navigation from "./navigation";
|
||||||
import { useAuth } from "@web/src/providers/auth-provider";
|
import { useAuth } from "@web/src/providers/auth-provider";
|
||||||
import { UserOutlined } from "@ant-design/icons";
|
import { UserOutlined } from "@ant-design/icons";
|
||||||
import { UserMenu } from "../element/usermenu/usermenu";
|
import { UserMenu } from "../element/usermenu/usermenu";
|
||||||
|
import logo from "@web/src/assets/logo.png"
|
||||||
|
import { env } from "@web/src/env";
|
||||||
|
import { Button } from "antd";
|
||||||
export const Header = memo(function Header() {
|
export const Header = memo(function Header() {
|
||||||
const { isAuthenticated } = useAuth();
|
const { isAuthenticated } = useAuth();
|
||||||
|
const navigate = useNavigate()
|
||||||
return (
|
return (
|
||||||
<header className="sticky top-0 z-50 bg-gradient-to-br from-primary-500 to-primary-800 text-white shadow-lg">
|
<header className="sticky top-0 z-50 bg-gradient-to-br from-primary-500 to-primary-800 text-white shadow-lg">
|
||||||
<div className=" mx-auto px-4">
|
<div className="mx-auto px-4">
|
||||||
<div className="py-4">
|
<div className="py-2 relative"> {/* 添加relative定位上下文 */}
|
||||||
<div className="flex items-center justify-between gap-4">
|
<div className="flex items-center justify-between gap-4">
|
||||||
<div className="">
|
{/* 左侧logo部分 */}
|
||||||
<span className="text-xl font-bold">
|
<div className="flex items-center flex-shrink-0"> {/* 防止压缩 */}
|
||||||
首长机关信箱
|
<img className="w-24" src={logo} alt="logo" />
|
||||||
</span>
|
<div>
|
||||||
<p className=" text-sm text-secondary-50">
|
<span className="text-xl font-bold"> {env.APP_NAME || '信箱'}</span>
|
||||||
|
<p className="text-sm text-secondary-50">
|
||||||
聆怀若水,应语如风;纾难化困,践诺成春
|
聆怀若水,应语如风;纾难化困,践诺成春
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-grow max-w-2xl">
|
|
||||||
<SearchBar />
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center ">
|
|
||||||
{!isAuthenticated ? (
|
|
||||||
<Link
|
|
||||||
to="/auth"
|
|
||||||
className="group flex items-center gap-2 rounded-lg
|
|
||||||
bg-[#00539B]/90 px-5 py-2.5 font-medium
|
|
||||||
shadow-lg transition-all duration-300
|
|
||||||
hover:-translate-y-0.5 hover:bg-[#0063B8]
|
|
||||||
hover:shadow-xl hover:shadow-[#00539B]/30
|
|
||||||
focus:outline-none focus:ring-2
|
|
||||||
focus:ring-[#8EADD4] focus:ring-offset-2
|
|
||||||
focus:ring-offset-[#13294B]"
|
|
||||||
aria-label="Login">
|
|
||||||
<UserOutlined
|
|
||||||
className="h-5 w-5 transition-transform
|
|
||||||
group-hover:scale-110 group-hover:rotate-12"></UserOutlined>
|
|
||||||
|
|
||||||
<span>登录</span>
|
{/* 右侧登录部分 */}
|
||||||
</Link>
|
<div className="flex items-center flex-shrink-0"> {/* 防止压缩 */}
|
||||||
|
{!isAuthenticated ? (
|
||||||
|
<Button size="large" onClick={() => {
|
||||||
|
navigate("/auth")
|
||||||
|
}} type="primary" icon={<UserOutlined></UserOutlined>}>
|
||||||
|
|
||||||
|
登录
|
||||||
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<UserMenu />
|
<UserMenu />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 独立定位的搜索栏 */}
|
||||||
|
<div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-2xl px-4">
|
||||||
|
<SearchBar />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Navigation />
|
<Navigation />
|
||||||
|
|
|
@ -2,8 +2,13 @@ import { motion } from 'framer-motion'
|
||||||
import { Outlet } from 'react-router-dom'
|
import { Outlet } from 'react-router-dom'
|
||||||
import { Header } from './Header'
|
import { Header } from './Header'
|
||||||
import { Footer } from './Footer'
|
import { Footer } from './Footer'
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
import { env } from '@web/src/env'
|
||||||
|
|
||||||
export function MainLayout() {
|
export function MainLayout() {
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = env.APP_NAME || '信箱'
|
||||||
|
}, [])
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0 }}
|
initial={{ opacity: 0 }}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { Image, Button, Row, Col } from "antd";
|
import { Image, Button, Row, Col, Tooltip } from "antd";
|
||||||
import { DownloadOutlined } from "@ant-design/icons";
|
|
||||||
import { PostDto } from "@nice/common";
|
import { PostDto } from "@nice/common";
|
||||||
import { env } from "@web/src/env";
|
import { env } from "@web/src/env";
|
||||||
import { getFileIcon } from "./utils";
|
import { getFileIcon } from "./utils";
|
||||||
|
@ -79,47 +78,44 @@ export default function PostResources({ post }: { post: PostDto }) {
|
||||||
</Image.PreviewGroup>
|
</Image.PreviewGroup>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{fileResources.length > 0 && (
|
{fileResources.length > 0 && (
|
||||||
<div className="rounded-xl p-4 bg-gray-200">
|
<div className="rounded-xl p-1 border border-gray-100 bg-white">
|
||||||
<div className="space-y-2">
|
<div className="flex flex-nowrap overflow-x-auto scrollbar-hide gap-1.5">
|
||||||
{fileResources.map((resource) => (
|
{fileResources.map((resource) => {
|
||||||
<div
|
return (
|
||||||
|
<a
|
||||||
key={resource.url}
|
key={resource.url}
|
||||||
className="flex items-center justify-between p-3 hover:bg-gray-50 rounded-md transition-colors duration-200">
|
className="flex-shrink-0 relative active:scale-95 transition-transform select-none "
|
||||||
<div className="flex items-center space-x-3 min-w-0">
|
href={resource.originalUrl}
|
||||||
<span className="text-xl">
|
target="_blank"
|
||||||
|
download={true}
|
||||||
|
title="点击下载文件"
|
||||||
|
>
|
||||||
|
{/* 超紧凑卡片容器 */}
|
||||||
|
<div className="w-[120px] h-[80px] p-2 flex flex-col items-center justify-between rounded-xl hover:bg-primary-50/40 cursor-pointer">
|
||||||
|
{/* 微型文件图标 */}
|
||||||
|
<div className="text-primary-600 text-base">
|
||||||
{getFileIcon(resource.url)}
|
{getFileIcon(resource.url)}
|
||||||
</span>
|
</div>
|
||||||
<div className="min-w-0">
|
|
||||||
<p className="text-gray-800 truncate">
|
{/* 压缩信息展示 */}
|
||||||
{resource.title || "未命名文件"}
|
<div className="w-full text-center space-y-0.5">
|
||||||
|
<p className="text-xs font-medium text-gray-800 truncate">
|
||||||
|
{resource.title?.slice(0, 12) || "未命名"}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center justify-between text-xs text-gray-500">
|
||||||
<span className="text-xs text-gray-500">
|
<span className="bg-gray-100 px-0.5 rounded-sm">
|
||||||
{resource.url
|
{resource.url.split(".").pop()?.slice(0, 4).toUpperCase()}
|
||||||
.split(".")
|
|
||||||
.pop()
|
|
||||||
?.toUpperCase()}
|
|
||||||
文件
|
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-gray-400">
|
<span>
|
||||||
{resource.meta.size &&
|
{resource.meta.size && formatFileSize(resource.meta.size)}
|
||||||
formatFileSize(
|
|
||||||
resource.meta.size
|
|
||||||
)}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
</a>
|
||||||
icon={<DownloadOutlined />}
|
);
|
||||||
href={resource.url}
|
})}
|
||||||
download>
|
|
||||||
下载
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -108,6 +108,7 @@ export default function LetterList({
|
||||||
) : (
|
) : (
|
||||||
<div className="flex flex-col justify-center items-center pt-6">
|
<div className="flex flex-col justify-center items-center pt-6">
|
||||||
<Empty
|
<Empty
|
||||||
|
|
||||||
description={
|
description={
|
||||||
keyword ? "未找到相关信件" : "暂无信件"
|
keyword ? "未找到相关信件" : "暂无信件"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue