diff --git a/app/routes/documents.edit.tsx b/app/routes/documents.edit.tsx index a0ff6a5..9675ac9 100644 --- a/app/routes/documents.edit.tsx +++ b/app/routes/documents.edit.tsx @@ -240,7 +240,11 @@ export default function DocumentEdit() { // 从 actionData 初始化表单错误 useEffect(() => { if (actionData?.fieldErrors) { - // general 是loader的时候返回的错误信息 + // general 错误使用 toast 提示 + if (actionData.fieldErrors.general) { + toastService.error(actionData.fieldErrors.general); + } + // 其他字段错误设置到 formErrors setFormErrors(actionData.fieldErrors); } }, [actionData]); @@ -531,15 +535,7 @@ export default function DocumentEdit() {
您可以修改此文档的基本信息,但不能更改文档内容。如需修改内容,请删除后重新上传新文档。
- - {/* 错误提示 */} - {formErrors.general && ( -
- - {formErrors.general} -
- )} - +
diff --git a/app/routes/role-permissions._index.tsx b/app/routes/role-permissions._index.tsx index a38b8f3..c988d52 100644 --- a/app/routes/role-permissions._index.tsx +++ b/app/routes/role-permissions._index.tsx @@ -1742,7 +1742,7 @@ export default function RolePermissions() { 角色权限管理 -
+ {/*
-
+
*/}
diff --git a/app/routes/rule-groups._index.tsx b/app/routes/rule-groups._index.tsx index 0da8d38..b9b4f82 100644 --- a/app/routes/rule-groups._index.tsx +++ b/app/routes/rule-groups._index.tsx @@ -69,6 +69,7 @@ export async function loader({ request }: { request: Request }) { } catch (error) { console.error('加载评查点分组失败:', error); return Response.json({ + error: error, groups: [], totalCount: 0, page: 1, @@ -79,7 +80,7 @@ export async function loader({ request }: { request: Request }) { export default function RuleGroupsIndex() { const loaderData = useLoaderData(); - const { groups: initialGroups, frontendJWT } = loaderData; + const { groups: initialGroups, frontendJWT,error } = loaderData; const navigate = useNavigate(); const [searchParams, setSearchParams] = useSearchParams(); const [expandedGroups, setExpandedGroups] = useState([]); @@ -96,6 +97,12 @@ export default function RuleGroupsIndex() { const canDeleteGroup = canDelete('evaluation_group'); const canBatchOperation = canBatch('evaluation_group'); // ✅ 批量操作权限 + useEffect(() => { + if(error){ + toastService.error(error.message); + } + }, [error]); + // 初始加载时自动加载所有子分组 useEffect(() => { const loadAllChildGroups = async () => { diff --git a/技术栈.md b/技术栈.md new file mode 100644 index 0000000..5f1c31e --- /dev/null +++ b/技术栈.md @@ -0,0 +1,81 @@ +# 项目技术栈 + +## 核心框架 + +| 技术 | 版本 | 用途 | +|------|------|------| +| Remix | 2.16.2 | 全栈 React 框架 | +| React | 18.2.0 | UI 库 | +| TypeScript | 5.1.6 | 类型系统 | +| Vite | 6.0.0 | 构建工具 | + +## UI 组件库 + +| 技术 | 版本 | 用途 | +|------|------|------| +| Ant Design | 6.0.0 | UI 组件库 | +| Ant Design X | 2.0.0 | AI 对话组件 | +| Tailwind CSS | 3.4.17 | 原子化 CSS | +| RemixIcon | 4.6.0 | 图标库 | + +## 文档处理 + +| 技术 | 用途 | +|------|------| +| react-pdf | PDF 预览渲染 | +| pdf-lib | PDF 操作处理 | +| mammoth | Word 转 HTML | +| docx-preview | DOCX 预览 | +| docxtemplater | Word 模板生成 | +| JSZip / PizZip | 压缩文件处理 | + +## 代码编辑器 + +| 技术 | 用途 | +|------|------| +| Monaco Editor | 代码编辑器(VS Code 同款) | +| CodeMirror | 轻量代码编辑器 | + +## Markdown 渲染 + +| 技术 | 用途 | +|------|------| +| react-markdown | Markdown 渲染 | +| remark-gfm | GitHub 风格 Markdown | +| remark-math + rehype-katex | 数学公式渲染 | +| highlight.js / prismjs | 代码高亮 | + +## 数据与网络 + +| 技术 | 用途 | +|------|------| +| Axios | HTTP 请求 | +| pg | PostgreSQL 数据库客户端 | +| jsonwebtoken | JWT 认证 | + +## 工具库 + +| 技术 | 用途 | +|------|------| +| dayjs | 日期处理 | +| ahooks | React Hooks 工具库 | +| immer | 不可变数据 | +| uuid | UUID 生成 | +| diff | 文本差异对比 | + +## 部署运维 + +| 技术 | 用途 | +|------|------| +| PM2 | 进程管理(多实例部署) | +| Express | HTTP 服务器 | +| Docker | 容器化部署 | +| dotenv | 环境变量管理 | + +## 开发工具 + +| 技术 | 用途 | +|------|------| +| ESLint | 代码规范检查 | +| PostCSS + Autoprefixer | CSS 处理 | +| cross-env | 跨平台环境变量 |