@@ -193,41 +356,23 @@ const MaterialsList: React.FC = () => {
- {material.senderNickname}
+ {material.senderNickname || "系统创建"}
ID: {material.id}
+ {renderContentTypeTag(material.contentType)}
-
- {/* 主标题 */}
- {
- window.open(material.urls[0].url, "_blank");
- }}
- >
-
-

-
-
-
- {material.urls[0].desc}
-
-
- {material.urls[0].url}
-
-
+ {/* 标题 */}
+ {material.contentType != 4 && (
+
+ {material.content}
)}
+ {/* 内容预览 */}
+ {renderContentPreview(material)}
{/* 操作按钮区 */}
diff --git a/nkebao/vite.config.ts b/nkebao/vite.config.ts
index f1a085ec..921473b6 100644
--- a/nkebao/vite.config.ts
+++ b/nkebao/vite.config.ts
@@ -13,15 +13,29 @@ export default defineConfig({
open: true,
},
build: {
- chunkSizeWarningLimit: 1500, // 提高警告阈值,减少无关警告
+ chunkSizeWarningLimit: 2000,
rollupOptions: {
output: {
+ // 减少文件数量,合并更多依赖
manualChunks: {
- "react-vendor": ["react", "react-dom"],
- "antd-vendor": ["antd", "@ant-design/icons", "antd-mobile"],
- "echarts-vendor": ["echarts", "echarts-for-react"],
+ // 核心框架
+ vendor: ["react", "react-dom", "react-router-dom"],
+ // UI组件库
+ ui: ["antd", "@ant-design/icons", "antd-mobile"],
+ // 工具库
+ utils: ["axios", "dayjs", "zustand"],
+ // 图表库
+ charts: ["echarts", "echarts-for-react"],
},
+ // 文件名格式
+ chunkFileNames: "assets/[name]-[hash].js",
+ entryFileNames: "assets/[name]-[hash].js",
+ assetFileNames: "assets/[name]-[hash].[ext]",
},
},
+ // 启用压缩
+ minify: "esbuild",
+ // 启用源码映射(可选,生产环境可以关闭)
+ sourcemap: false,
},
});