Compare commits

...

358 Commits

Author SHA1 Message Date
66adf7f545 fix: 修正面包屑导航的显示逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m7s
- 竖屏下不显示面包屑导航
2025-12-27 17:06:03 +08:00
f87b977c87 fix: 调整面包屑导航的显示逻辑
- 在移动端隐藏面包屑导航
2025-12-27 17:05:41 +08:00
601c4abe53 fix: 修正计算器连接
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m3s
- 域名改为cal.jinshen.cn
2025-12-26 15:01:35 +08:00
b71ee98129 feat: 为Apple/PWA进行图标适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m23s
2025-12-24 14:56:28 +08:00
7611d4f079 fix: 调整页面渲染机制
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m9s
- 懒加载:部分页面添加懒加载机制,在用户访问时先加载静态资源在获取动态资源
- 骨架屏机制:各个页面的骨架屏渲染有el-skeleton自身模板控制
- 布局调整:部分页面布局调整
- i18n文本: 新增国际化文本redirecting
2025-12-19 13:28:54 +08:00
76fb3ddcb7 fix: 重定向页布局调整
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m54s
2025-12-19 13:26:48 +08:00
aa26731731 fix: 补全骨架屏渲染机制
- 补全各个页面的骨架屏渲染机制修改
2025-12-19 13:26:26 +08:00
f2533767d2 fix: 调整关于我们页面渲染机制
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m3s
- 骨架屏:骨架屏由el-skeleton模板控制
2025-12-19 12:53:01 +08:00
f1116491b6 fix: 调整解决方案列表渲染机制
- 骨架屏:解决方案列表页骨架屏渲染由el-skeleton模板控制
2025-12-19 12:48:36 +08:00
537a6b0bd6 fix: 调整产品列表页渲染机制
- 渲染机制:产品列表页懒加载采用el-skeleton自身模板机制
- 布局调整:调整产品页/骨架屏在竖屏下的布局
2025-12-19 12:00:42 +08:00
bcc08a53ea fix: 调整服务支持页面渲染模式
- 将条件渲染由div判断改为el-skeleton template
2025-12-19 11:38:33 +08:00
fa1a22b286 feat: 服务支持页懒加载
- 骨架屏调整:服务支持页骨架屏布局调整
- 懒加载:服务支持页添加懒加载机制
2025-12-19 11:17:32 +08:00
8c720b7ac3 fix: 修正查询/搜索无法完全显示的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m7s
- 扩大查询/搜索的最大条目数
2025-12-18 15:05:57 +08:00
33c0b9cc43 fix: 修正搜索条目无法完全显示的问题
- 为查询/搜索添加更大的limit
2025-12-18 15:05:17 +08:00
fcaf595b73 feat: 添加ICP跳转链接
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m13s
2025-12-13 16:08:38 +08:00
ef20832761 feat: 页脚添加ICP跳转链接
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m11s
- ICP跳转: 点击备案号跳转到工信部网站
2025-12-13 16:07:49 +08:00
03a692afb5 feat: 页面描述 & 停产产品标示
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 页面描述:产品列表与解决方案列表添加页面描述
- 停产标示:对于已停产产品,在产品详情页添加已停产标示
- 视图变更:产品视图添加Status字段,用于标示已停产产品
- 文案变更与补全:调整部分页面UI文案,并补全各个语言的新增文案
2025-12-10 14:10:03 +08:00
7b21def74f feat: 补全i18n翻译
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 翻译补全: 补全英语、西班牙语、俄语的翻译
2025-12-10 14:06:58 +08:00
783d482e0a feat: 产品/解决方案列表页描述
- 页面描述:为产品列表与解决方案列表添加页面描述
- 停产提示:在产品列表中提示停产产品使用搜索功能
2025-12-10 14:00:05 +08:00
62ec215340 feat: 产品视图模型添加状态
- 产品状态:从Directus Schema获取Product的Status字段
- 视图字段:添加Status字段用于标示产品状态
- 测试方法:为Status字段添加单元测试
2025-12-10 13:35:00 +08:00
e02f975217 fix: 修正计算器跳转链接
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m9s
- 修正页面在竖屏状态下页面无法正确跳转到计算器页面的问题
2025-12-08 13:48:25 +08:00
5530776035 feat: 搜索页图片预览 & 文档列表显示文档类型
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m21s
- 缩略图预览: 搜索页栏目右侧添加缩略图预览功能
- 细分类型: 搜索页栏目添加细分类型展示:如产品(原纸分切机)
- 接口调整:
调整可选字段类型使其符合搜索引擎索引格式;将搜索条目中的type改为sectionType用于大类分类,并将type作为细分类型使用
- 文档类型: 文档页添加文档类型展示功能,当用户未指定文档类型时,在标题右侧显示文档类型
- 查询调整: 产品查询添加文档类型查询

ISSUE: Resolve #94
2025-12-05 17:23:34 +08:00
63cdff9c41 feat: 为文档库添加文档类型显示功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m10s
- 功能添加:在文档列表中,当未指定文档类型时,在标题右侧显示文档类型
- 查询更改:产品查询添加文档类型查询方法
- mapper更改:productDocumentView添加文档类型
2025-12-05 17:18:48 +08:00
f1398a5545 feat: 为搜索条目添加细分类型
- 类型细分:有原先的四大分类添加细分类型,例如产品(原纸分切机)
- 接口调整:原先的type分类改为sectionType并将type作为细分类型使用
2025-12-05 16:49:09 +08:00
36d24a4740 fix: 可选字段处理
- 为搜索条目中的可选字段进行判断并处理
2025-12-05 16:25:57 +08:00
c9b5b1fad9 feat: 为搜索页栏目添加图片缩略图功能
- 图片预览:产品与解决方案栏目添加缩略图功能
- 组件提取:在搜索结果页,将单个搜索结果单独提取为组件SearchResultCard
2025-12-05 14:56:24 +08:00
246a0b9d4f refactor(mapper): 为Server端的Mapper添加空值处理与类型控制逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m53s
- 空值处理与类型控制:为相关关系型字段的数据处理添加空值处理与类型控制
- 目录结构调整:分离Product/ProductList与Solution/SolutionList
- 修复bug:修复产品页与解决方案页无法正常触发404逻辑的问题
2025-12-04 17:57:07 +08:00
c3ac7c0985 fix: 修正产品/解决方案在归档后无法正常触发404 UI的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m0s
2025-12-04 17:52:36 +08:00
63c3e2e364 refactor: 重构解决方案相关Mapper
- 空值处理与类型控制:为关系型字段添加空值处理与类型控制逻辑
- 目录结构调整:分离SolutionList与Solution相关的Mapper为不同的文件
2025-12-04 17:40:04 +08:00
1245df497b refactor: 重构产品相关Mapper
- 空值处理与类型控制:为相关关系型字段的数据处理添加空值处理与类型控制
- 调整目录结构:将文件目录按照实际查询划分为Product和ProductList两个文件
2025-12-04 17:38:43 +08:00
f081a3b33a feat(support): 为文档库/相关问题页面添加类型筛选功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m1s
- 功能添加:文档库/FAQ页添加类型筛选功能
- 类型同步:前端补全问题类型与文档类型的类型标注,与后端移至
- 查询变更:GraphQL查询增添文档/问题类型查询
- 组件分离:将原先文档库与FAQ页共用的ProductFilter分离为两个不同的组件:DocumentFilter与QuestionFilter
- i18n文本补全:为新增的相关文本补全国际化翻译
2025-12-03 18:00:03 +08:00
3c6bff4d31 chore: 删除无用组件
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
- 文档页与问题页的筛选器分离为两个不同的组件,原先product-filter删除
2025-12-03 17:58:26 +08:00
5011448902 chore: 补全i18n文本
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m55s
- 补全俄语与西班牙语的i18n翻译
2025-12-03 17:53:18 +08:00
53f3e99d90 feat: 文档库页面添加文档类型筛选功能
- 功能添加:添加按照文档类型筛选文档的功能
- 组件更改:将筛选器由product-filter改为document-filter
2025-12-03 17:47:57 +08:00
815df40745 style: 删除无用class 2025-12-03 17:33:28 +08:00
c27337a145 feat: 文档库查询添加文档类型字段
- graphQL查询修改:添加type字段查询
- 视图模型字段更新:添加DocumentTypeView视图模型并为DocumentList类型添加type字段
- mapper更新: 添加DocumentType的转换方法
2025-12-03 17:30:16 +08:00
3fb721f278 test: 修改测试用例 2025-12-03 17:17:34 +08:00
a4dc28fc97 feat: 问题列表添加问题类型筛选功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
- 功能添加:添加问题筛选功能
- 组件更改:将product-filter改为question-filter
- 文本添加:i18n文本添加
2025-12-03 16:59:11 +08:00
55a35b5498 chore: 调整字段名
- 将问题类型的类型名字段命名由type改为name
2025-12-03 16:56:57 +08:00
f4ec82a150 feat: 相关问题查询添加问题类型查询
- 查询语句更改:添加type字段
- mapper增添:添加type字段的mapper
- 视图模型更改:QuestionListView添加type字段
2025-12-03 15:53:20 +08:00
c82fea48b8 chore: 类型同步
- 后端CMS为问题/文档添加类型字段,前端同步更改
2025-12-03 14:26:20 +08:00
39a23fb382 feat: 计算器跳转链接修改
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m14s
- 将纸管计算工具跳转链接修改为正式版本版本
2025-12-02 17:03:47 +08:00
871b203a5e feat: 调整计算器URL
- 将计算器链接改为云服务器上的服务
2025-12-02 17:01:25 +08:00
b746247ccc feat(pagination): 问题库/文档库的分页功能实现
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m18s
- 为文档库/问题库实现分页功能,当前按照一页10个栏目分页
- 问题跳转时确保能够正常触发分页逻辑与聚焦逻辑
- 调整部分graphQL改动导致的类型匹配问题
2025-12-02 15:31:25 +08:00
97069815dc feat: 常见问题页面分页逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m31s
- el-pagination提供分页功能
- 从搜索页跳转到本路由时,自动跳转并聚焦指定问题
2025-12-02 15:29:06 +08:00
5194c72695 feat: 文档库分页功能
- el-pagination提供分页功能
2025-12-02 14:49:26 +08:00
dbe75ee080 fix: 调整变量类型
- 将id相关类型由number修改为string,符合graphQL规范
2025-12-02 14:33:10 +08:00
4471851c62 fix: 补全缺失的i18n文本
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m15s
- 搜索栏目与搜索卡片内部分文本补全
2025-11-24 14:23:13 +08:00
15a75f965b fix: 补全搜索页面缺失的翻译内容
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m13s
- 栏目标题、搜索卡片类型翻译
2025-11-24 14:18:41 +08:00
5a4cef52be feat: 添加西班牙语与俄语适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m5s
- 西班牙语与俄语i18n文本
- 对应语言切换选项
2025-11-21 16:53:03 +08:00
30ffc7e557 feat: 添加机器翻译标注
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m1s
2025-11-21 16:51:49 +08:00
c4b9ed7bae feat: 补全i18n文本
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
- 补全西班牙语与俄语文本
2025-11-21 16:50:05 +08:00
fc6c922ac3 feat: 站点的语言切换选项添加西班牙语与俄语选项
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m18s
- WIP: i18n文本尚未完善
2025-11-20 15:35:20 +08:00
54389b32ac fix: 修改地图开启逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m7s
- 当单击公司地址时,先在新标签页开启locate路由,再异步定向到合适的地图服务商页面
2025-11-19 15:04:51 +08:00
d8002a8265 fix: 修改地图开启逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
- 当单击公司地址时,先在新标签页开启locate路由,再异步定向到合适的地图服务商页面
2025-11-19 15:03:59 +08:00
51042c395a feat: 修改地图服务的跳转链接
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m45s
- 将高德地图改为百度地图
2025-11-19 14:06:47 +08:00
6cf964e8f7 feat: 修改地图服务跳转链接
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m57s
- 将高德地图改为百度地图
2025-11-19 14:05:28 +08:00
456f2c69f2 fix: 调整地图跳转逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m10s
- 新增locate页,用于地图跳转
- 调整about页卡片布局
2025-11-18 17:04:29 +08:00
6f005c1404 fix: 调整地图跳转逻辑
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
- 新增locate页,用于地图跳转
- 调整about页卡片布局
2025-11-18 17:03:40 +08:00
1ab6d92226 feat: about页面添加公司地址跳转功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m3s
- 外部链接跳转:点击公司地址时,跳转带外部地图服务商链接
- 智能跳转: 根据用户的连接情况,自动选择google地图或者高德地图
2025-11-18 14:16:39 +08:00
67629ed518 feat: about页面添加公司地址跳转功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m21s
- 外部链接跳转:点击公司地址时,跳转带外部地图服务商链接
- 智能跳转: 根据用户的连接情况,自动选择google地图或者高德地图
2025-11-18 14:11:43 +08:00
fe8a0e7656 fix: 修复specs无法正常转换的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
- 修正查询语句: 补全spces的id字段
2025-11-17 14:48:36 +08:00
a82872c1c1 fix: 修复specs无法正常转换的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m12s
- 修正GraphQL查询语句:补全Specs的id字段
2025-11-17 14:46:46 +08:00
02ecb18147 fix: 问题列表无法聚焦问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m20s
- 将类型标注中的id字段改为string,与GraphQL返回类型一致
- 问题id比较随之更改为字符串匹配
- 删除无用导出

ISSUE: Resolve #83
2025-11-15 16:39:06 +08:00
05c970d1e7 chore: 删除无用导出
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m19s
- 删除useMeilisearch
2025-11-15 16:33:52 +08:00
496548afa4 fix: 修复前端类型标注与GraphQL访问数据不同的问题
- 将类型标注中的id字段改为string
2025-11-15 16:33:30 +08:00
6f08701847 fix: 修复无法搜索问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m51s
- 将搜索服务移至Server端
2025-11-14 14:59:03 +08:00
17bb8adee3 fix: 修复Server搜索问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m7s
- 将meilisearch搜索服务移至Server端
2025-11-14 14:57:55 +08:00
b2b631ed46 fix: 暂时将html渲染回滚到v-html
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 暂时弃用html-renderer,改为v-html
- html-typography增添表格样式
2025-11-14 13:30:25 +08:00
ec9a097ef5 fix: 暂时弃用html-renderer将html渲染回滚到v-html
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- 增添table样式
2025-11-14 13:29:00 +08:00
3fb28c3f00 test: 优化测试代码
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m6s
- 显式导入相关依赖以避免Vitest的依赖问题

ISSUE: close: #46
2025-11-14 12:34:59 +08:00
d7bd034d7d test: 优化测试代码
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m5s
- 显式导入相关依赖以避免相关问题
2025-11-14 12:23:49 +08:00
341a9c4066 refactor: 将页面的Markdown渲染改为HTML渲染
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m57s
- 前后端通信:后端相关字段由Markdown改为WYSIWYG,前端做出响应更改
- 页面显示调整: 移除解决方案页创建日期显示
- 工具添加: 添加Asset处理方法,将CMS域名URL重写为Server API URL
- 代码整理:移除部分弃用代码

ISSUES: Close: #40 Resolve: #24
2025-11-14 11:48:17 +08:00
ee1597d2c3 fix: 调整URL转换的baseURL
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m54s
- 将baseURL由directus_url转为directus_public_url
2025-11-14 11:42:29 +08:00
17d10a7d80 chore: 移除部分无用代码
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m37s
2025-11-14 11:06:09 +08:00
54d0e297ea feat: 将Markdown渲染改为HTML渲染
- CMS相关字段由Markdown改为WYSIWYG,前端做出对应更改
- AssetUrl重写:将CMS地址重写为本地API
2025-11-14 11:06:00 +08:00
644dfa329c fix: 删除解决方案页的创建日期显示 2025-11-14 09:55:35 +08:00
100b79f99b feat: 将Solution的内容渲染有Markdown改为Html 2025-11-14 09:54:41 +08:00
f4f7e490b4 fix: 修正服务支持页面文本错误
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
2025-11-14 08:06:00 +08:00
6418587738 fix: 修正服务支持页面描述文本错误
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m0s
2025-11-14 08:04:34 +08:00
6983f6568d feat!: 将QuestionList的内容渲染由Markdown改为HTML
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m10s
- 后端CMS字段由Markdown改为WYSIWYG因此前端做出对应修改
2025-11-14 00:07:31 +08:00
c860621e7a feat!: 将QuestionList的内容渲染由Markdown改为HTML
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m51s
- 后端CMS字段由Markdown改为WYSIWYG因此前端做出对应修改
2025-11-14 00:00:05 +08:00
154943815d refactor: 将Data到ViewModel的转换由App转移至Server端
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m42s
- 将逻辑转移到Server端后,简化前端逻辑
2025-11-13 20:51:09 +08:00
23f2700c0f refactor: 将Data到ViewModel的转换由App转移至Server端
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m15s
- 将逻辑转移到Server端后,简化前端逻辑
2025-11-13 20:45:43 +08:00
e215a4d498 fix: 修正GraphQL无法正常读取的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
- 将graphql查询文件移至server/assets,他们在构建后会以二进制形式写入server的存储中
- 在server端通过storage读取数据
2025-11-12 19:51:14 +08:00
50f0779a8e fix: 修正无法正常读取GraphQL的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m22s
- 将GraphQL移至server/assets,在构建后会被写入server中
- 在server端通过storage读取数据
2025-11-12 19:49:17 +08:00
5ee6005ad1 refactor: 将前后端通信由app端移至server端
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m9s
- graphql请求的server端实现
- 文件请求的server端实现
2025-11-12 18:25:21 +08:00
a520775a8d refactor: 将文件请求由app端转到server端
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m2s
2025-11-12 18:19:21 +08:00
a5f3895794 refactor: 将数据获取从app端移至server端
- 调整数据获取位置以提升安全性
- 对于后端状态为Archived的数据,通过server控制不进行获取
2025-11-12 17:54:43 +08:00
58223734a2 feat: 前端请求添加Status控制
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m12s
- 产品页/解决方案页仅获取已发布条目
2025-11-12 14:50:55 +08:00
9163c7fe9a feat: 为前端请求添加Status控制
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m6s
- 在产品页/解决方案页等路由仅获取已发布条目
2025-11-12 14:48:51 +08:00
726c38a75d refactor: 重构项目的数据获取方法
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m1s
- 将相关数据获取由REST转为GraphQL
- 声明GraphQL模块
- 修改相关的Mapper与测试方法
2025-11-11 17:05:44 +08:00
81caa02d11 chore: 删除无用代码
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m30s
2025-11-11 17:02:02 +08:00
8213eec217 refactor: 关于我们页的API重构
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
2025-11-11 17:01:18 +08:00
ac9e7b4436 refactor: 联系信息页的API重构 2025-11-11 16:58:40 +08:00
5ad6133252 refactor: 文档资料页的API重构 2025-11-11 16:55:41 +08:00
a07d77dde7 refactor: 问题列表的API重构 2025-11-11 16:49:58 +08:00
3e7b195002 refactor: 解决方案页的API重构 2025-11-11 16:43:08 +08:00
706b754905 refactor: 解决方案列表的API重构 2025-11-11 16:35:20 +08:00
0d77e97ad5 test: 完善测试 2025-11-11 16:15:05 +08:00
ac658e01ae refactor: 调整首页数据获取API
- 将首页的数据获取由REST重构为GraphQL
2025-11-11 16:14:58 +08:00
a93f508e85 refactor: 调整GraphQL导入形式
- 以纯文本形式导入
2025-11-11 16:08:24 +08:00
1290189d84 style: 格式化graphql文件 2025-11-11 16:01:20 +08:00
691dd34127 refactor: 产品页与产品列表的API重构
- 将产品页与产品列表的API由REST重构为GraphQL
- 修改Mapper与单元测试
2025-11-11 15:58:15 +08:00
7e7775ccc6 feat: 为Directus插件提供GraphQL支持
- 在Nuxt中引入GraphQL加载模块
- 为Directus引入GraphQl, Query
2025-11-11 15:52:27 +08:00
b234018f72 fix: 调整筛选条目排序权重
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m46s
- 以搜索条目匹配程度为标准排序
- 移除拼音支持
2025-11-10 17:28:24 +08:00
7b19f59409 fix: 调整筛选条目排序权重
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m49s
- 以搜索条目匹配程度为标准排序
- 移除拼音支持
2025-11-10 17:26:23 +08:00
9de6ab8799 fix: 调整模糊匹配阈值
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m6s
- 将阈值由0.3调整为0.6
2025-11-10 16:42:56 +08:00
86b0c29dcf fix: 调整模糊匹配阈值
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
- 将阈值有0.3调整至0.6
2025-11-10 16:42:30 +08:00
352be1686a feat: 产品筛选器的模糊搜索
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m7s
- 引入前端依赖Fuse.js, pinyin-pro分别用于模糊匹配与拼音转换
- 新增Utils-fuzzyFilter,封装了Fuse的初始化/模糊匹配与相关工具函数
- 将前端由字符串匹配改为模糊匹配
2025-11-10 16:05:44 +08:00
710a0cdc5b feat: 支持拼音搜索
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m38s
- 使用pinyin-pro进行汉语拼音转换
- 调整搜索权重
2025-11-10 15:39:47 +08:00
4c8dfb5b56 feat: 产品筛选器的模糊搜索功能
- 引入纯前端依赖Fuse.js用于模糊匹配
- 新增Utils-fuzzyFilter封装Fuse的初始化与匹配
- 在前端将字符串匹配改为模糊匹配
2025-11-10 15:08:32 +08:00
007c8f9ce9 feat: 产品列表与解决方案列表的排序
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
- 为产品/解决方案类型添加sort字段用于排序
- 各个栏目的类型按照sort升序排序
- 更新directus类型
2025-11-08 15:51:33 +08:00
0363a88785 feat: 解决方案列表页标签排序
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m1s
- 为SolutionType添加Sort字段用于排序
- 解决方案列表按照sort升序排序
2025-11-08 15:46:37 +08:00
308a080ea4 docs: 为ProductTypeView添加注释 2025-11-08 15:42:40 +08:00
a34cfaff6f fix: 修正product-list的遍历问题 2025-11-08 15:42:03 +08:00
bd894d6f2e feat: 产品列表页排序
- 为ProductType添加sort字段用于排序
- 产品列表页项目按照sort升序排序
2025-11-08 15:34:42 +08:00
b4da838cae feat: 添加自定义logger用于输出日志
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m6s
- 使用自定义logger,自定义输出级别
- 添加eslint规则,禁用console输出
- 将项目的console输出改为logger输出
2025-11-08 14:42:35 +08:00
660892f9e7 fix: 将原项目的console输出改为logger输出
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m11s
- 添加eslint,不允许使用console输出
2025-11-08 14:40:41 +08:00
2a021cbaea feat: 添加自定义日志系统logger
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m15s
2025-11-08 14:22:31 +08:00
d55fe5cce2 fix: 补全i18n文本
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m9s
- 补全产品详情页的tab标签文本翻译
2025-11-08 10:46:12 +08:00
9313700660 fix: 补全i18n文本
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
- 补全产品详情页的i18n文本
2025-11-08 10:45:29 +08:00
9d3276a56a fix: 补全SEO&调整列表样式
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
- chore: 去除console.log输出
- fix: 补全SEO
- fix: 调整SpecTable表头样式
2025-11-08 10:15:19 +08:00
37e89c3eda chore: 去除console.log输出
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
2025-11-08 10:10:19 +08:00
b386d4e60d fix: 补全SEO
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m2s
- 关于我们页面的SEO信息补全
2025-11-08 10:05:32 +08:00
bfdae60910 fix: 调整SpecTable表头样式
- 加粗标题
2025-11-08 10:03:15 +08:00
e04b9d57da feat: 为各个页面补全标题与SEO
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m54s
- 添加Composable API: usePageSeo用于为路由页面添加SEO
- 为各个页面补全路由标题与SEO

ISSUE: resolve #52
2025-11-07 15:40:01 +08:00
0265ea4978 feat: 为各个页面补全标题与SEO
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
2025-11-07 15:37:18 +08:00
1cdc29b1ce fix: 调整部分图像显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m10s
- 产品/解决方案卡片图片宽度、比例调整
- 产品页竖屏是的文字边距调整
2025-11-07 14:38:07 +08:00
58e91ed67c fix: 调整部分图像显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 产品/解决方案卡片图片宽度调整为100%并将比例设定为16/10
- 产品页在竖屏状态下的文字边距
2025-11-07 14:36:21 +08:00
191459ec5c fix: 修复download页面的导航路由
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m57s
- 删除`文件下载`的导航链接
- 添加返回到`服务支持`与`文档资料`的链接
2025-11-07 14:15:32 +08:00
881c0ab61e fix: 修正download页面的breadcrumb导航
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m50s
- 增添返回到服务支持与文档资料的链接
2025-11-07 13:40:17 +08:00
f8c95207c2 build: doker镜像构建时记录构建时间与commit-sha
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m49s
- 镜像构建时会向项目目录内的version.json写入构建时间与commit-sha,并在镜像启动时输出日志
- 添加用于获取版本号的/api/version
2025-11-06 17:47:23 +08:00
aba3729335 build: doker镜像构建时记录构建时间与gitcommit
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 镜像构建时会向项目目录内的version.json写入构建时间与commit-sha,并在镜像启动时输出日志
- 添加用于获取版本号的server api
2025-11-06 17:45:09 +08:00
516ad9fa1c chore: 修复部分代码bug
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m0s
- 修正ProductView中的命名错误
- 移除弃置的Strapi方法
2025-11-06 16:58:00 +08:00
6a3493c7e1 chore: 修正部分代码bug
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- ProductView中faqs命名错误,修正为ProductQuestionView
- 移除useLocalizations中弃置的Strapi语言获取方法
2025-11-06 16:56:42 +08:00
a328414b4e build: 添加测试用compose
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m57s
2025-11-06 16:53:33 +08:00
e81532f920 test: 为mapper补全测试
Some checks are pending
deploy to server / build-and-deploy (push) Has started running
2025-11-06 16:52:50 +08:00
082fe9fea8 build: 增加测试用docker-compose文件
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m57s
2025-11-06 16:49:06 +08:00
7ba7f4a15a test: 为mapper补充测试
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
2025-11-06 16:46:56 +08:00
083a2695f3 fix: 暂时解决首页在切换语言时可能导致无法正常载入的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 当首页获取相关条目时,Translations未找到对应语言条目的情况下Fallback为默认值

ISSUE: resolve #55
2025-11-06 14:22:46 +08:00
06ab63b8e5 fix: 暂时解决首页切换语言时无法正常载入的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m9s
- 首页切换语言时当Translations为空时fallback为默认值
2025-11-06 13:08:19 +08:00
0950e32fe4 fix: 修正Dockerfile
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
2025-11-05 14:10:10 +08:00
04be130b6d build: 使用dockerfile构建docker镜像
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
- 添加dockerfile,基于node:22-alpine构建docker镜像
- 完善相关README文档
2025-11-05 14:08:05 +08:00
7aee68593c docs: 修正README文档显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m53s
2025-11-05 13:25:38 +08:00
7dbe85bdc7 docs: 修正README文档显示问题
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
2025-11-05 13:24:35 +08:00
2b3bf0f4a9 docs: 完善README文档
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
# 补全docker部署部分
2025-11-05 13:09:44 +08:00
daa22f8ff9 build: 添加Dockerfile用于构建docker镜像
- 基于node:22-alpine构建docker镜像
2025-11-05 13:09:25 +08:00
2d5c231e81 feat: 补全i18n适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m5s
- 为各个页面补全i18n文本
2025-11-04 14:37:06 +08:00
67a2b24e0b feat: 关于我们页面i18n适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m4s
2025-11-04 14:36:11 +08:00
edcf0ec99e fix: 修正spec-table样式
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m14s
- 将spec-table的label宽度限定为30%,统一页面显示
2025-11-04 14:31:27 +08:00
e7450005ab feat: 首页i18n适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m3s
2025-11-04 14:28:45 +08:00
128bdf5a16 feat: 文档预览器i18n适配 2025-11-04 14:20:55 +08:00
9460ad5249 feat: 移动端菜单i18n适配 2025-11-04 14:17:55 +08:00
b7bb0cfff8 feat: 文档下载页的i18n适配 2025-11-04 14:13:46 +08:00
085fd8bad3 feat: 文档列表的i18n适配 2025-11-04 14:09:06 +08:00
5990e000bc feat: 产品选择器的i18n适配 2025-11-04 14:07:02 +08:00
0403a83751 feat: support页i18n适配
- SupportTabs中英文文本添加
- SupportCard描述中英文文本
2025-11-04 13:52:35 +08:00
531f316026 fix: 调整规格表label宽度
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m23s
- 将label宽度固定为30%
2025-11-03 16:29:03 +08:00
7a15166281 feat: 竖屏适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m53s
- 为各个页面实现竖屏适配

ISSUE: resolve #53
2025-11-01 16:38:07 +08:00
853046d633 feat: 服务支持页面竖屏适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m7s
-竖屏是修改支持卡片布局
2025-11-01 16:32:37 +08:00
0996e910d9 feat: 产品筛选器竖屏适配
- 切换到竖屏是产品筛选器改为两行
2025-11-01 16:26:37 +08:00
52048fc2a6 feat: 产品详情页竖屏适配 2025-11-01 16:26:16 +08:00
fc164beaf3 fix: 移除console输出 2025-11-01 16:08:25 +08:00
3b6857637b fix: 调整footer行为 2025-11-01 16:05:59 +08:00
d076088747 feat: 首页竖屏适配
- 首页Carousel高度根据屏幕宽度变化
- 首页推荐栏目卡片数量随屏幕宽度改变
2025-11-01 15:32:15 +08:00
06c30a7ea3 feat: 页面布局的移动端适配
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m50s
- 当竖屏时隐藏footer
2025-10-31 17:04:12 +08:00
37da48c07e feat: header竖屏适配
- 在竖屏情况下将网站导航与部分顶部按钮挪到drawer内
2025-10-31 17:03:43 +08:00
51080849eb feat: 为网站添加图标
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m51s
- jinshen-logo.ico
- 修改nuxt.config应用网站图标
2025-10-31 15:25:42 +08:00
2b53d47c34 fix: 暂时移除footer中未实现的功能 2025-10-31 15:25:00 +08:00
959bcaee7c fix: 暂时禁用footer中未实现的功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m54s
2025-10-31 15:16:29 +08:00
149d05848e feat: 添加网站图标
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m52s
- 添加网站图标ico文件
- 修改nuxt配置,应用新的网站图标
2025-10-31 15:14:23 +08:00
e0df7ef063 fix(products): 修正产品规格值显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- 修复产品规格表中规格名显示不正确的问题
- 调整产品规格数据结构
2025-10-31 15:08:37 +08:00
dd7ac909fb fix: 修正产品规格值product_spec的显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
- subItem.value => subItem.key
- 调整后端CMS的结构,将规格值移入translations中
2025-10-31 15:06:08 +08:00
dbc84d5a21 fix(search): 修正路由跳转逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m5s
- 文档页跳转:当用户点击文档条目是跳转到download路由下的对应页面
- 问题页跳转:当用户点击问题条目时跳转到faq路由并使用focus query控制问题的展开
2025-10-30 14:37:04 +08:00
cea67404ed fix: 修正搜索页面相关问题路由跳转逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- 当用户点击问题条目时,生成一个带有query的url: faq?focus=[slug]自动展开faq页面中的对应词条
2025-10-30 14:06:43 +08:00
63491fd5f9 fix: 修正搜索页面文档路由跳转逻辑
- 点击文档条目时,跳转到对应的download路由
- 修改搜索条目转换逻辑,将product_documents类型条目的id有product_document的id改为文件uuid
2025-10-30 13:43:00 +08:00
03fff90091 docs: 更新README文档
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m3s
- 更新后端相关描述
2025-10-29 18:01:54 +08:00
e88d5f4534 docs: 更新README文档
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m45s
2025-10-29 18:00:37 +08:00
95252cd70a refactor: 对项目进行组件化重构
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
- 将各个路由中比较复杂的部分单独提取为组件以提高可维护性
2025-10-29 17:56:15 +08:00
84b99deef6 refactor: 重构搜索页
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
- 提取页面部分为SearchHeader与SearchTabs组件
2025-10-29 17:49:20 +08:00
667413dd12 refactor: 重构下载页
- 将download页的文件卡片单独提取为FileCard
2025-10-29 17:33:20 +08:00
00c4c80e49 refactor: 重构产品页
- 将产品详情页的相关部分提取为ProductHeader与ProductDetail两个组件
2025-10-29 17:19:49 +08:00
9982481c83 refactor: 将解决方案页文章提取为单独的组件 2025-10-29 17:03:28 +08:00
5f78c888a2 refactor: 重构faq与document页
- 将筛选器提取为单独的组件ProductFilters
2025-10-29 16:42:48 +08:00
c4e797500f refactor: 将支持页的相关部分提取为可复用的组件
- support页的el-card,单独提取为SupportCard组件
2025-10-29 16:08:33 +08:00
5920925ded refactor: 将首页各个部分重构为单独的组件
- 组件重构:将首页重构为HomepageCarousel, HomepageProductSection,
HomepageSolutionSection三个部分
2025-10-29 14:05:42 +08:00
300266d32c refactor: 将各个界面的notfound提示提取为单独的组件NotFoundResult
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m56s
2025-10-28 16:32:00 +08:00
c6e0ea2a47 refactor: 将各个页面的面包屑导航提取为单独组件AppBreadcrumb 2025-10-28 16:16:57 +08:00
dc90e1045b refactor: 调整components目录
- 将components根据作用范围/可复用性进行分类
2025-10-28 16:01:34 +08:00
8883dc3fcc feat(document): 为文档添加下载与预览界面:
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m58s
- 添加路由: download路由用于下载文件, preview路由用于文件预览
- 添加组件: FilePreviewer封装了若干格式文件的预览功能(目前支持pdf,
  image, text, video等)
- 服务端API: 添加download和file分别用于处理文件下载请求与元数据获取请求
- 类型标注调整:
  将原先位于app/types内的类型标注文件移至shared/types内,让app与server共享类型标注
- 国际化文本添加: 为相关页面添加国际化文本
2025-10-28 14:41:54 +08:00
ff143f980a feat: 添加preview路由用于文件预览
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- preview路由预览文件
- FilePreviewer组件
- 删除Document卡片的下载按钮,使用单独的页面用于文件下载
- preview布局
2025-10-28 14:35:50 +08:00
4e7131b291 feat: 添加download路由用于展示文档信息
All checks were successful
deploy to server / build-and-deploy (push) Successful in 5m4s
- 添加/download/documentID路由用于文档下载
- server端添加文档元数据获取与下载API
- 将app中的types移至shared,与server共享
2025-10-27 17:16:51 +08:00
5ab72111ca build: 新增单元测试框架
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m55s
- 使用nuxt test与vitest建立单元测试框架
- 创建部分单元测试
2025-10-27 14:16:18 +08:00
73e920cd8d feat: 添加单元测试
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m47s
2025-10-27 14:12:43 +08:00
9294cd3199 fix: 调整nuxt测试路径
- 将nuxt测试路径调整到组件旁
2025-10-27 13:50:36 +08:00
5be3c45ac5 fix: 修正nuxt测试路径 2025-10-25 16:29:15 +08:00
35bcdc0164 fix: 修正搜索页部分错误
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m14s
- 对于搜索页中的‘相关问题’与‘文档资料’,修正条目标签显示
- 调整页面刷新逻辑: 将用户刷新有PerformSearch改为useAsyncData的Refresh机制
2025-10-25 15:31:29 +08:00
75d4d40d39 fix: 修改文件拓展名获取逻辑
All checks were successful
deploy to server / build-and-deploy (push) Successful in 4m18s
- 若无扩展名则返回空字符串
2025-10-25 15:30:23 +08:00
f2634ca0f4 test: 调整单元测试
- 为单元测试添加分组
2025-10-25 15:30:00 +08:00
d33e7e1dd9 build: 调整测试目录 2025-10-25 14:56:02 +08:00
57f29e4c06 test: 为utils/file添加测试用例
- 容量进制转换
- 文件拓展名获取与格式化
2025-10-25 14:55:50 +08:00
a2c6006e37 build: 添加nuxt测试框架 2025-10-25 14:05:47 +08:00
772c25a41b fix: 修正搜索页部分错误
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
- 对于搜索页中的‘相关问题’与‘文档资料’,修正条目标签显示
- 调整页面刷新逻辑: 将用户刷新有PerformSearch改为useAsyncData的Refresh机制
2025-10-25 13:54:34 +08:00
088eee07bf feat(CMS)!: 将项目后端由Strapi迁移至Directus
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m49s
- 将项目后端由Strapi迁移至Directus
- 加强类型标注
- 调整部分路由名称
- 分离原始后端数据与视图对象数据

Issue: resolve #42
2025-10-24 17:21:16 +08:00
b1ff62a3bb fix: 修正Tab切换时的显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m46s
- 切换Tab时重置页码
2025-10-24 17:01:29 +08:00
e403252dba fix: 修正组件渲染bug
All checks were successful
deploy to server / build-and-deploy (push) Successful in 4m17s
2025-10-24 16:44:47 +08:00
393dc3885b fix: product命名修正
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
2025-10-24 16:42:39 +08:00
963690bf53 fix: 相关命名修正
- production -> product
2025-10-24 16:41:48 +08:00
e780997a69 build: 移除nuxt的strapi模块 2025-10-24 16:20:55 +08:00
4e88fd9bfb chore: 删除Strapi类型标注 2025-10-24 16:18:40 +08:00
f62c4a3987 feat: 将搜索页面由Strapi迁移至Direcuts
- 路由页面相关源码修改
- 类型标注与组合式API
- 相关工具函数
2025-10-24 16:18:26 +08:00
05938550e6 feat: 将首页由Strapi迁移至Directus
- 相关路由界面修改
- 增添响应的视图模型与转换方法
2025-10-20 15:07:37 +08:00
c156d1414c feat: 将/about界面由Strapi迁移至Directus
- 修改相关路由界面
- 增添相应的视图模型与转换方法
2025-10-20 13:48:57 +08:00
faf2eb4b44 chore: 更新directus类型
- 将CompanyProfileTranslation中content字段类型由json改为markdown文本
2025-10-20 13:46:06 +08:00
8269155ae3 chore: 更新directus类型
- 将ContactInfoTranslation的content由json改为markdown文本
2025-10-20 13:13:55 +08:00
e48c7fe238 feat: 将/support/contact-us由Strapi迁移至Directus
- 修改相关Vue路由
- 添加相应的视图模型与转换方法
2025-10-20 13:13:19 +08:00
440a46850a feat: 将/support/documents路由的数据获取由Strapi转为Directus
- 修改/support/documents.vue,将相关数据获取迁移到Directus
- 增添相应的视图模型与映射方法
2025-10-20 12:30:24 +08:00
bc625239cd chore: 更新directus类型标注
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m6s
- 更新types/directus/my-schema.ts
2025-10-18 16:58:16 +08:00
94d3f31cbd feat: 组件参数类型名更改
- QuestionList.vue: Array as PropType<QuestionView[]> => Array as
PropType<ProductQuestionView[]>
2025-10-18 16:26:08 +08:00
46e79f0b5c feat: 将/support/faq界面迁移至Directus
- 路由界面脚本修改
- 视图模型相关定义
2025-10-18 16:24:45 +08:00
f53b86cbb6 fix: 修正拼写错误
- 修改nuxt.config.ts
2025-10-18 15:28:08 +08:00
0ccd855472 feat: solution页composable API
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m22s
2025-10-17 16:24:13 +08:00
568701a80e feat: 将解决方案页迁移至directus
- 将/solutions与/solutions/[slug]页现在由Directus作为CMS
- 添加solution页的composable API
2025-10-17 16:23:48 +08:00
9abe6431a6 fix: 更新directus类型标注 2025-10-17 16:22:39 +08:00
227b537a0f feat: 产品页的组合式API
All checks were successful
deploy to server / build-and-deploy (push) Successful in 5m11s
- 为product和product-list添加组合式API
2025-10-16 16:02:20 +08:00
6c76d81a40 feat: 为directus做I18n适配
- 添加getDirectusLocale方法用于获取Directus本地化字段
2025-10-16 15:14:46 +08:00
202657e634 chore: 调整目录结构
- 将Directus相关的组合式API移入composables/direcuts
2025-10-16 14:56:46 +08:00
cb861bc955 fix: 修改file工具函数
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m20s
- 新增基于filename获取拓展名的函数
- 将文件大小格式化由以KB为基准修改为以Byte为基准
2025-10-15 16:50:27 +08:00
1704a7b5c1 feat: production页的CMS变更 2025-10-15 16:49:08 +08:00
98f978484c feat: directus视图与转换函数
- views: 用于前端渲染的视图模型
- mapper: 用于视图模型转换的转换函数
- utils: 相关工具函数
2025-10-15 16:48:38 +08:00
de7c03a7a9 feat: directus插件与组合式函数编写
- plugins:Directus插件
- composable:Directus图片/文件的相关组合式函数
2025-10-15 16:47:33 +08:00
e158ec8cf5 fix: directus类型标注更新
- 使用Directus-sdk-typegen生成Directus类型标注
2025-10-15 16:45:50 +08:00
33c94fb885 style(types): directus类型标注
All checks were successful
deploy to server / build-and-deploy (push) Successful in 5m24s
- 使用directus-sdk-typegen生成Directus类型
2025-10-13 16:56:28 +08:00
e05f248b66 chore: 导入Directus依赖
- 导入Directus SDK
- 配置Directus RuntimeConfig
2025-10-13 16:53:13 +08:00
a3defa4bd2 style(support): 调整下拉框样式
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m50s
- 将下拉框高度调整为40px
- 在下拉框上方添加label
2025-09-30 13:57:33 +08:00
c771e40f64 style: 调整下拉框样式
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m47s
- 将下拉框高度调整为40px
- 在下拉框上方添加label
2025-09-30 13:52:17 +08:00
137d9fd627 feat(support): 添加分类筛选的功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m51s
- 为常见问题&文档资料页面添加分类筛选功能
- 调整markdown中的表格渲染样式

Issue: Resolve #21
2025-09-29 16:14:27 +08:00
56dd57e244 feat(support): 添加分类筛选的功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m49s
- 为常见问题&文档资料页面添加分类筛选功能
- 调整markdown中的表格渲染样式
2025-09-29 16:09:48 +08:00
bbb0d71619 feat(SSR): 为站点添加SSR机制
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m46s
- 将CMS数据获取与MeiliSearch搜索从CSR改为SSR
- 添加i18n数据

Issue: Resolve #35
2025-09-28 16:57:26 +08:00
1c98921e01 feat: 为搜索页添加error监听
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m45s
2025-09-28 16:41:36 +08:00
1ac9c76c3e feat(SSR): 为搜索页启用SSR 2025-09-28 16:40:46 +08:00
9f2f7f6984 feat(SSR): 将关于我们页改为SSR 2025-09-28 16:30:23 +08:00
d4c079286e feat(SSR): 将服务支持页面改为SSR 2025-09-28 16:27:01 +08:00
a7a4551528 feat(SSR): 将解决方案页改为SSR
- 使用Nuxt的useAsyncData
- 添加i18n信息
2025-09-28 16:11:35 +08:00
dbd9346362 fix: 调整错误处理机制
- 移出抛出错误的方法
2025-09-28 15:57:40 +08:00
94196ffdfe feat(SSR): 将产品页改为SSR 2025-09-28 15:50:31 +08:00
ba31f0b644 chore: merge from branch 'master' 2025-09-28 14:37:38 +08:00
509a6fae36 feat(SSR): 将首页调整为SSR
- 将CMS数据的获取方式改为Nuxt的useAsyncData
- 将加载模式改为渐进式
2025-09-28 14:18:27 +08:00
b985749f5b feat: 添加计算工具跳转功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m44s
- 在header与foot中分别添加纸管计算工具的跳转链接
- 重构代码,提升语义化
- 添加i18n国际化数据

Issue: resolve #22
2025-09-27 15:10:27 +08:00
aafa5c8942 chore: merge from 'master'
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
2025-09-27 15:05:47 +08:00
ce975f7e3b feat(header): 修改header布局
- 在header的action区添加计算器的跳转链接
2025-09-27 15:04:59 +08:00
c7a8a96451 fix: 修正首页卡片在鼠标hover时的指针行为
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m29s
- 为recommend-card的hover样式添加cursor: pointer

Issue: Fixes #27
2025-09-27 14:35:19 +08:00
2f88b0b017 fix: 修正首页卡片在鼠标hover时的指针行为
- 为recommend-card的hover样式添加cursor: pointer
2025-09-27 14:32:36 +08:00
ddd4535707 fix: 修复客户端无法正常获取环境变量的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m46s
- 在nuxt.config.ts中禁用prerender

Issue: Fixes #33
2025-09-27 14:20:47 +08:00
67c732649f fix: 修正客户端无法正常获取环境变量问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m43s
- 在nuxt.config.ts中禁用prerender
2025-09-27 14:15:54 +08:00
5c9cc925de ci: 为workflow添加代理检测
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m32s
- 在workflow的开头添加了Check proxy的job,用于检测网络代理是否启用
2025-09-27 10:58:56 +08:00
6095fa47d4 chore: merge branch 'master' into ci/proxy
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m52s
2025-09-27 10:52:51 +08:00
8932b27134 fix(env): 修复构建版本无法正常获取环境变量的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 6m41s
- 在nuxt.config.ts中,将strapi配置项移至runnertimeConfig-public-strapi中

Issue: Fixes #29
2025-09-27 10:45:07 +08:00
06c79dc520 ci: 调整workflow
All checks were successful
deploy to server / build-and-deploy (push) Successful in 7m38s
- 添加为构建工作流添加检测代理是否启用的job
2025-09-27 10:30:27 +08:00
a4d3caeb6b fix: 修正构建版本无法正常获取环境变量的问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 10m0s
- 将nuxt.config.ts中的strapi配置移至runtimeConfig中
2025-09-26 17:28:54 +08:00
7fae419708 ci: 为项目添加CI/CD功能
All checks were successful
deploy to server / build-and-deploy (push) Successful in 4m17s
- 对于任何分支,push到仓库后执行构建测试
- 对于主分支,更新后自动构建并部署到指定服务器上
2025-09-26 17:13:30 +08:00
ef6877768a ci: 调整workflow
All checks were successful
deploy to server / build-and-deploy (push) Successful in 8m8s
- 只有master分支更新时执行项目部署操作
2025-09-26 14:33:45 +08:00
dbb10b7708 ci: 调整workflow
All checks were successful
deploy to server / build-and-deploy (push) Successful in 4m3s
- 在ssh部署到目标主机后,重启前端服务
2025-09-25 16:32:09 +08:00
f4145b911a ci: 测试自制镜像
All checks were successful
deploy to server / build-and-deploy (push) Successful in 8m18s
2025-09-25 14:57:10 +08:00
2251f076c6 ci: 测试镜像
Some checks failed
deploy to server / build-and-deploy (push) Has been cancelled
- 测试自制镜像
2025-09-25 14:56:28 +08:00
64b5f761d5 ci: 调整workflow
All checks were successful
deploy to server / build-and-deploy (push) Successful in 4m30s
- 修改部署所使用的action
2025-09-25 10:46:17 +08:00
39bede38d3 ci: 调整workflow
Some checks failed
deploy to server / build-and-deploy (push) Failing after 16s
- 修正语法错误
2025-09-24 17:25:33 +08:00
db49e74110 ci: 调整workflow
- 使用action进行rsync
2025-09-24 17:23:21 +08:00
ad66ae1b46 ci: 调整workflow
Some checks failed
deploy to server / build-and-deploy (push) Failing after 3m55s
- 修改.nuxt缓存位置
2025-09-24 17:12:08 +08:00
723c0cbb3a ci: 调整workflow
Some checks failed
deploy to server / deploy (push) Has been cancelled
deploy to server / build (push) Has started running
- 合并build与deploy
2025-09-24 17:08:01 +08:00
73620f0777 ci: 测试workflow
Some checks failed
deploy to server / build (push) Successful in 3m59s
deploy to server / deploy (push) Failing after 42s
- 为其他分支启用deploy进行测试
2025-09-24 17:00:13 +08:00
cbbae112dc ci: 调整workflow
All checks were successful
deploy to server / build (push) Successful in 4m8s
deploy to server / deploy (push) Has been skipped
- 启用缓存服务
2025-09-24 16:38:59 +08:00
7f28f7bf81 ci: 调整workflow
- 修改缩进格式
2025-09-24 16:25:04 +08:00
e54d5ef3c2 ci: 调整workflow
- 为deploy添加build的前置要求
2025-09-24 16:15:12 +08:00
d154fed609 ci: 调整workflow
- 添加构建产物的上传/下载
2025-09-24 16:13:21 +08:00
f12c8c050a ci: 调整workflow
Some checks failed
deploy to server / build (push) Has been cancelled
- 指定pnpm版本为10
2025-09-24 15:39:03 +08:00
3366b46039 ci: 调整workflow
Some checks failed
deploy to server / build (push) Failing after 1m17s
- 将workflow的启用分支改为所有分支
2025-09-24 15:18:30 +08:00
ec0608cc7c ci: 调整workflow
- 为workflow添加pnpm包管理器
- 调整workflow steps命名
2025-09-24 15:13:39 +08:00
00a0613f13 ci: 新建workflow
Some checks failed
deploy to server / build (push) Failing after 12s
- 测试构建工作流
2025-09-24 15:03:59 +08:00
d33007bcfb refactor(header): 使用<header>标签替换<div>
- 提高语义化,提高可读性
2025-09-24 14:45:43 +08:00
059b99b802 feat(footer): 修改footer布局
- 在footer中添加实用工具的跳转链接
2025-09-24 14:44:22 +08:00
04a2140213 fix(homepage): 调整首页文字布局
- 调整首页文字部分布局,在宽屏时,首页文字相对靠近页面中心
2025-09-24 13:05:23 +08:00
e7d2b28cb4 fix: 调整首页布局
- 调整首页文字布局
2025-09-24 12:00:38 +08:00
74c5d2447b fix(search): 修改搜索页的鼠标指针行为 & 调整搜索页组件样式
- 当鼠标指针进入搜索条目卡片时,鼠标指针修改为pointer样式
- 调整分页组件大小

Issue: fixes #20
2025-09-23 16:27:55 +08:00
dd05dc5175 feat: 修改搜索页的鼠标指针行为 & 调整搜索页组件样式
- 当鼠标指针进入搜索条目卡片时,鼠标指针修改为pointer样式
- 调整分页组件大小
2025-09-23 16:25:41 +08:00
66b9f91486 feat: 为搜索页添加分类功能
- 使用Element Plus的Tab组件为搜索页添加分类功能
- 重构搜索页代码,将搜索结果作为单独的组件
- 调整代码格式,去除部分无用代码

Issue: resolve #18
2025-09-22 16:55:21 +08:00
265bc5370a feat: 搜索页添加分类功能
- 使用Element Plus的tab组件搜索页添加了分类功能
- 重构搜索页代码,将搜索结果作为单独的组件
- 调整代码格式,去除部分无用代码
2025-09-22 16:44:01 +08:00
da7e8d31dd feat: 为搜索界面添加分页功能
- 限制搜索页面的显示条目数量为5条
- 为搜索页面添加分页功能
- 调整nuxt.config.ts,禁用ts类型检查

resolve #17
2025-09-20 14:31:23 +08:00
e4a140e216 chore: 请用typescript的类型检查 2025-09-20 14:26:15 +08:00
5617689343 feat: 搜索界面添加分页功能
- 为搜索界面限制每页显示条目数量,并添加分页功能
2025-09-20 14:25:59 +08:00
5762d447a3 fix: 调整搜索界面样式
- 调整Header组件中右侧图标大小
- 调整搜索页面的搜索框与组件大小
- 调整搜索界面内容显示逻辑,只有在用户通过搜索跳转是更新内容显示

Issue: fixes #14
2025-09-19 12:14:26 +08:00
78a5b9149b chore: 合并master分支的更新 2025-09-19 12:10:48 +08:00
6869ab64c2 chore: 调整PR模板
- 修正PR模板中部分组件缺少必要词条的问题
2025-09-19 12:10:07 +08:00
5db2c951b0 fix: 调整搜索界面样式
- 调整相关组件大小
- 调整文字显示逻辑
2025-09-19 12:04:32 +08:00
44732cf8ec chore: 创建Issue模板
- 创建Issue模板用于规范Issue提交
- 调整PR模板,增添截图提交项
2025-09-17 17:16:35 +08:00
7626476c46 chore: 修改PR模板
- 调整PR模板,删除部分不需要的选项
- 添加截图提交选项
2025-09-17 17:14:47 +08:00
ad96fc409b chore: 添加Issue模板
- Bug Report: 用于报告Bug
- Feature Request: 用于请求新功能与改进
2025-09-17 17:08:52 +08:00
b402ed0b1c chore(styles): 添加代码格式化依赖
- 为项目添加依赖ESLint、Prettier、Lint-Staged用于规范代码格式
- 创建pre-commit hook
- 根据格式化规则格式化整个项目的代码
2025-09-17 16:56:40 +08:00
e395e08102 chore: 修改PR模板
- 调整表单验证项
- 修改默认分支
2025-09-17 16:54:54 +08:00
444fa4ff9b docs: 创建合并请求模板 2025-09-17 16:54:54 +08:00
cc9c72be31 chore(pr): 添加Pull Request模板 2025-09-17 16:46:07 +08:00
da33726e39 chore: 修改PR模板
- 调整表单验证项
- 修改默认分支
2025-09-17 16:43:26 +08:00
752cbcd1a1 docs: 创建合并请求模板 2025-09-17 16:20:04 +08:00
04a57044eb chore: 修改git hook
- 将git hook的调用工具调整为npx
2025-09-17 16:10:28 +08:00
ba16879594 chore(styles): 为项目添加开发依赖
- 添加lint-staged用于创建pre-commithook
2025-09-17 16:05:14 +08:00
359aaec8a9 style: 格式化项目代码
- 根据prettier配置格式化整个项目的代码
2025-09-17 15:50:29 +08:00
bb89721f1c chore(styles): 调整格式化配置文件
- 修改prettier.config.mjs: 标签换行
- 修改eslint.config.mjs: 允许自闭合标签(如<br />)
2025-09-17 15:46:39 +08:00
e94dbf29a3 chore(styles): 调整格式化配置文件
- 调整prettier.config.mjs,强制css文件与scss文件使用双引号
2025-09-17 15:23:44 +08:00
bfad693bd0 chore(styles): 为项目添加开发依赖
- 添加Prettier、ESLint用于规范代码风格
- 添加Prettier配置文件
2025-09-17 14:47:56 +08:00
0af981cd32 feat: 添加搜索功能
- 基于meilisearch实现搜索
- 新增搜索界面
- 使用ESLint格式化代码
- 调整README文档内容
2025-09-16 16:09:02 +08:00
e0f86dab62 docs: 修改README
- 项目的包管理器由bun改为pnpm
2025-09-16 16:05:11 +08:00
ec2a3a7350 style: 调整代码格式
- 基于ESLint格式化代码
2025-09-16 16:03:53 +08:00
79d2d2e800 style: 调整代码格式
- 基于ESLint格式化代码
2025-09-16 16:02:59 +08:00
dba2cdf366 feat: 添加搜索功能
- 使用meilisearch进行搜索
- 增添搜索界面
2025-09-16 16:02:00 +08:00
92c5a3baab style: 调整代码格式
- 根据ESLint文件规范格式化app文件夹中的代码
2025-09-15 17:02:04 +08:00
67794e9523 build: 调整项目依赖
- 将搜索引擎由minisearch更换为meilisearch
2025-09-15 16:34:36 +08:00
8800266826 build: 更换包管理器
- 将包管理器从bun更换为pnpm
2025-09-15 16:32:38 +08:00
89deb20cf3 build: 为项目添加依赖
- 添加minisearch用于实现搜索功能
2025-09-13 09:13:43 +08:00
4833516ad5 feat: 为产品详情页添加内容
- 为产品详情页图片添加标签
- 调整代码格式
2025-09-13 09:05:10 +08:00
9e3a8f2889 style: 调整代码格式 2025-09-12 17:20:30 +08:00
cca2ab31f7 feat: 增加产品展示功能
- 为产品详情页添加图片轮播功能
- 调整产品详情页图片大小
- 调整产品列表卡片大小
2025-09-12 11:12:43 +08:00
8b763699ed feat: 修改图片详情页
- 为图片详情页添加图片轮播功能
2025-09-12 10:33:47 +08:00
39ebab92cd fix: 调整页面布局
- 产品列表卡片大小调整
- 产品详情页图片大小调整
2025-09-11 10:27:20 +08:00
1884c0a8e1 feat: 增添页面内容
- 首页增添内容:推荐解决方案
- 调整页面布局:当页面内容不足时自动调整页脚至页面底部
- 调整页首布局:将导航菜单置于页首中央
2025-09-09 16:47:17 +08:00
739d053cf0 feat: 首页添加内容
- 增添推荐解决方案的section
2025-09-09 16:45:30 +08:00
607ea47d72 fix: 调整页首布局
- 将菜单栏置于中央
2025-09-09 16:45:08 +08:00
b3a45db9bf fix: 修正页面布局
- 当页面内容不足时,将页脚固定在页面下方
2025-09-09 15:28:28 +08:00
75a4fc0701 fix: 调整页面样式
- 为页面添加1200px的宽度限制
- 调整样式命名
2025-09-08 16:47:56 +08:00
e6165b68b4 fix: 调整首页组件样式
- 统一相关组件样式,为后续功能开发做准备
2025-09-08 15:46:47 +08:00
031bf4a55e fix: 修正首页产品卡片样式
- 去除虚线边框
2025-09-08 15:23:56 +08:00
968fd1532f feat: 限制页面宽度
- 为页面添加1200px的宽度限制,提升其在宽屏下的观感
2025-09-06 17:20:17 +08:00
ed4b89f94c docs: 修改README文档 (#4)
- 修改默认的README文档,为项目提供部分说明

Reviewed-on: http://192.168.84.125:3030/remilia/jinshen-website/pulls/4
Co-authored-by: R2m1liA <15258427350@163.com>
Co-committed-by: R2m1liA <15258427350@163.com>
2025-09-06 16:59:21 +08:00
b8ce0450ed Merge pull request 'FEATURE: 网站的基本前端服务' (#2) from dev into master
Reviewed-on: http://192.168.84.125:3030/remilia/jinshen-website/pulls/2
2025-09-06 16:11:21 +08:00
c76eb0b59f Merge branch 'master' into dev 2025-09-06 16:07:24 +08:00
f957adfa5d feat: 完成网站前端的基本建设
- 网站内容展示:首页, 产品页, 解决方案, 联系信息等
- 网站跳转逻辑:通过Vue-Router实现路由跳转
- 后端通信: 通过Nuxt Strapi与后端Strapi服务进行通信
2025-09-06 15:59:52 +08:00
33bfc3ff73 fix: 修正每次启动服务时的网络问题
- 在nuxt.config.ts中将fonts-provider修改为'local',不再从google拉取资源
2025-09-06 15:40:43 +08:00
5ddb2265cf chore: 开启局域网监听 2025-09-05 13:00:25 +08:00
eb175889c6 feat: 网站首页添加新内容
- 首页推荐产品
2025-09-05 12:59:52 +08:00
6230c7ff17 feat: 新增页面内容
- 服务支持页面内容
2025-09-04 15:59:18 +08:00
eec2b0ae9f style: 调整代码格式 2025-09-04 15:06:09 +08:00
3be665449c feat: 增添新页面 & 修改样式
- 增添服务支持-常见问题 & 服务支持-文档资料
- 调整QuestionList样式
2025-09-04 14:56:46 +08:00
ea409d49b0 refactor(production): 重构产品页代码
- 将Production的documents类型改写为单独的interface:ProductionDocument
2025-09-04 14:55:32 +08:00
d8abb0a50e refactor(production): 重构产品详情页代码
- 将文档列表调整为单独的vue组件
2025-09-03 17:06:14 +08:00
80d2ade9bb style: 调整SpecTable样式
- 增大标题字体大小
2025-09-03 14:28:26 +08:00
e0c16c6391 refactor(production): 重构产品详情页代码
- 将问题列表调整为单独的Vue组件
2025-09-03 14:25:18 +08:00
1ac659cd68 refactor(support): 重构support页面代码
- 将segement tab移至单独的vue组件
- 增添部分i18n文本
2025-09-03 14:06:08 +08:00
530051fc2a chore: 去除冗余的debug输出 2025-08-30 13:43:03 +08:00
c36ab77318 chore(git): 为项目添加Husky & Commitlint用于管理commit message
项目采用Conventional Commit作为Commit Message编写规范:
----
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
----

详见:https://www.conventionalcommits.org/zh-hans/v1.0.0/
2025-08-30 13:36:35 +08:00
e79a69a997 Fix: 调整页面布局 & 调整页面跳转逻辑 2025-08-29 17:04:05 +08:00
91584096ba Feature: 产品常见问题 & 相关文档下载 2025-08-27 13:17:55 +08:00
2856f2c5a1 Fix: 调整样式 2025-08-26 15:22:10 +08:00
05d4b22c6c Fix: 调整部分样式 2025-08-25 17:32:23 +08:00
321e990dff Fix:修正前后端Bug 2025-08-25 16:21:19 +08:00
ad1e520c07 Feature: 解决方案页 & 调整部分样式 2025-08-22 16:33:10 +08:00
3d858e475e Feature: 解决方案列表 & 网页字体 2025-08-22 10:58:04 +08:00
e9b6409144 Fix: 修正部分加载Bug & 调整页面样式 2025-08-21 15:44:35 +08:00
2fe8797551 Feature: 产品列表增加页头 & Markdown渲染器增加图像Url转换功能 2025-08-21 14:26:58 +08:00
208 changed files with 24064 additions and 4138 deletions

58
.dockerignore Normal file
View File

@ -0,0 +1,58 @@
# ------------------------
# Node / Package Manager
# ------------------------
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.pnpm-store
# Nuxt build outputs
.output
.nuxt
dist
.cache
.unimport
.h3
.nitro
**/.nitro
# Dev tools / OS files
.DS_Store
Thumbs.db
# Logs
*.log
logs
!.gitkeep
# Local env files (runtime env should be provided by Docker/K8s)
.env
.env.*
!.env.example
# Git
.git
.gitignore
.gitattributes
# Editor / IDE
.vscode
.idea
*.swp
*.swo
# Tests
coverage
*.lcov
# Docker
Dockerfile*
docker-compose.yml
# CI / Local build artifacts
*.tgz
*.zip
*.tar
*.mdx

View File

@ -0,0 +1,61 @@
name: Bug报告
about: 用于报告项目中的Bug帮助我们改进项目
title: "[BUG] " # 新开 Issue 时默认加的前缀
body:
- type: markdown
attributes:
value: |
请在下方填写Bug的详细信息包括重现步骤、预期结果和实际结果等。
- type: textarea
id: summary
attributes:
label: "问题概述/Summary"
description: "简要描述遇到的问题"
placeholder: "输入问题概述"
validations:
required: true
- type: textarea
id: steps
attributes:
label: "重现步骤/Steps to Reproduce"
description: "列出重现该问题的具体步骤"
placeholder: "输入重现步骤"
validations:
required: true
- type: textarea
id: expected
attributes:
label: "预期结果/Expected Behavior"
description: "描述你期望看到的结果"
placeholder: "输入预期结果"
validations:
required: true
- type: textarea
id: actual
attributes:
label: "实际结果/Actual Behavior"
description: "描述实际发生的情况"
placeholder: "输入实际结果"
validations:
required: true
- type: textarea
id: environment
attributes:
label: "环境信息/Environment"
description: "提供相关环境信息,如操作系统、浏览器版本等"
placeholder: "输入环境信息"
validations:
required: false
- type: checkboxes
id: checklist
attributes:
label: "检查表/Checklist"
description: "提交前,请确认以下事项"
options:
- label: 已搜索过类似问题,确保不是重复报告
required: true
- label: 提供了足够的信息以帮助我们理解和重现问题
required: true
- label: 如果可能,已附上相关截图或日志文件
required: false

View File

@ -0,0 +1,53 @@
name: 功能请求
about: 用于提出新功能或改进建议
title: "[FEATURE] " # 新开 Issue 时默认加的前缀
body:
- type: markdown
attributes:
value: |
请在下方填写功能请求的详细信息,包括需求背景、预期效果和相关上下文。
- type: textarea
id: summary
attributes:
label: "功能概述/Summary"
description: "简要描述你希望添加的功能"
placeholder: "输入功能概述"
validations:
required: true
- type: textarea
id: motivation
attributes:
label: "需求背景/Motivation"
description: "说明为什么需要这个功能,它将如何帮助用户或改进现有流程"
placeholder: "输入需求背景"
validations:
required: true
- type: textarea
id: proposal
attributes:
label: "解决方案/Proposal"
description: "描述你对该功能的设想或建议的实现方式"
placeholder: "输入解决方案"
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: "替代方案/Alternatives"
description: "如果有其他可行的替代方案,请在此列出"
placeholder: "输入替代方案"
validations:
required: false
- type: checkboxes
id: checklist
attributes:
label: "检查表/Checklist"
description: "提交前,请确认以下事项"
options:
- label: 已搜索过类似功能请求,确保不是重复提交
required: true
- label: 提供了足够的信息以帮助我们理解和评估该请求
required: true
- label: 如果可能,已附上相关截图或示意图
required: false

View File

@ -0,0 +1,63 @@
name: "Standard PR 模板"
about: "用于提交新功能/修复bug/改进重构等合并请求"
title: "[PR] " # 新开 PR 时默认加的前缀
ref: "master" # 默认目标分支,可根据你们主分支改为 master/develop 等
body:
- type: markdown
attributes:
value: |
请在下方填写合并请求描述,包括变更目的、主要内容及相关上下文。
- type: textarea
attributes:
label: "关联Issue"
description: "比如: Fixes #123/Closes #456/如果没有可以留空"
placeholder: "输入关联 issue 编号"
validations:
required: false
- type: textarea
attributes:
label: "更改内容/What Changed"
description: "列出本次 PR 的主要变更项,便于 Review"
placeholder: "输入更改内容"
validations:
required: true
- type: textarea
attributes:
label: "测试步骤/How To Test"
description: "提供复现/验证更改的步骤,含环境/命令/预期结果等"
placeholder: "输入测试步骤"
validations:
required: false
- type: checkboxes
attributes:
label: "检查表/Checklist"
description: "提交前,请确认以下事项"
options:
- label: 代码格式符合团队规范
required: true
- label: 已添加或更新单元测试/集成测试
required: true
- label: 文档/README 已更新(如有必要)
required: false
- label: 所有测试通过
required: true
- label: 分支命名正确(feature/xxx或fix/xxx 等)
required: false
- label: 回归风险已评估
required: false
validations:
required: true
- type: textarea
id: impact
attributes:
label: "影响评估/Risk & Rollback"
description: "评估变更是否有破坏性风险,以及如何回滚/缓解"
placeholder: "例如:数据库迁移、依赖变动、兼容性问题等"
validations:
required: false
- type: textarea
attributes:
label: "可选:截图或 Demo(如界面/UI 有变化)"
description: "上传新的界面/UI"

View File

@ -0,0 +1,58 @@
name: deploy to server
on: push
jobs:
build-and-deploy:
runs-on: node22-build
steps:
- name: Check Proxy
run: |
echo "HTTP_PROXY = $HTTP_PROXY"
echo "HTTPS_PROXY = $HTTPS_PROXY"
# 测试网络是否能透过代理访问一个外部 URL比如 google.com
# 也可以换成你常用的 npm registry / GitHub
curl -I https://www.google.com --max-time 10 || echo "curl to google failed"
# 测试拉取 npm 包或 ping github.com
curl -I https://registry.npmjs.org --max-time 10 || echo "curl to registry.npmjs.org failed"
ping -c 3 github.com || echo "ping github.com failed"
- name: Checkout
uses: actions/checkout@v5
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup node 22
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'pnpm'
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
- name: Cache Nuxt build
uses: actions/cache@v4
with:
path: .nuxt
key: ${{ runner.os }}-nuxt-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-nuxt-
- name: Build project
run: pnpm run build
- name: Deploy to server
if: github.ref == 'refs/heads/master'
uses: easingthemes/ssh-deploy@main
with:
ARGS: "-rlgoDzvc -i --delete"
REMOTE_HOST: ${{ secrets.rsync_host }}
REMOTE_USER: ${{ secrets.rsync_username }}
SOURCE: ${{ secrets.rsync_source }}
TARGET: ${{ secrets.rsync_destination }}
SSH_PRIVATE_KEY: ${{ secrets.rsync_key }}
SCRIPT_AFTER: ${{ secrets.script_after_rsync }}

5
.graphqlrc.yaml Normal file
View File

@ -0,0 +1,5 @@
schema:
- 'http://192.168.86.5:8055/graphql':
headers:
Authorization: 'Bearer ixSWeViHIqwj6_r7NM-uZVR3NNOyBa_W'
documents: 'app/graphql/**/*.{graphql,js,ts,jsx,tsx}'

150
.husky/commit-msg Normal file
View File

@ -0,0 +1,150 @@
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
GRAY='\033[0;37m'
NC='\033[0m' # No Color
# 启用调试模式(可选)
DEBUG=${DEBUG:-false}
# 输出函数
print_info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_debug() {
if [ "$DEBUG" = "true" ]; then
echo -e "${GRAY}[DEBUG]${NC} $1"
fi
}
print_section() {
echo -e "${PURPLE}[SECTION]${NC} $1"
}
print_command() {
echo -e "${CYAN}[COMMAND]${NC} $1"
}
print_section "开始执行Commit Message Hook..."
print_info "时间: $(date)"
print_info "工作目录: $(pwd)"
print_info "用户: $(whoami)"
echo
# 调试信息
print_debug "接收到的参数: $*"
print_debug "参数数量: $#"
print_debug "第一个参数 (提交消息文件): $1"
print_debug "Shell: $SHELL"
print_debug "PATH: $PATH"
print_debug "当前进程ID: $"
# 检查 commitlint 是否可用
print_section "检查 commitlint..."
if npx commitlint --version >/dev/null 2>&1; then
COMMITLINT_VERSION=$(npx commitlint --version)
print_success "commitlint 可用: $COMMITLINT_VERSION"
else
print_error "commitlint 不可用或配置有误"
exit 1
fi
# 检查提交消息文件
echo
print_section "检查提交消息文件..."
if [ -f "$1" ]; then
print_success "文件存在: $1"
FILE_SIZE=$(wc -c < "$1")
print_info "文件大小: $FILE_SIZE 字节"
print_info "文件内容:"
echo -e "${CYAN}========================================${NC}"
cat "$1"
echo
echo -e "${CYAN}========================================${NC}"
# 检查文件权限
FILE_PERMS=$(ls -l "$1" | awk '{print $1}')
print_debug "文件权限: $FILE_PERMS"
# 检查文件内容是否为空
if [ "$FILE_SIZE" -eq 0 ] || [ -z "$(tr -d '[:space:]' < "$1")" ]; then
print_warning "提交消息为空"
fi
else
print_error "找不到提交消息文件: $1"
print_info "当前目录内容:"
ls -la
exit 1
fi
# 检查 commitlint 配置
echo
print_section "检查 commitlint 配置..."
if [ -f ".commitlintrc.js" ] || [ -f ".commitlintrc.json" ] || [ -f "commitlint.config.js" ] || [ -f "commitlint.config.mjs" ]; then
print_success "找到 commitlint 配置文件"
for config_file in .commitlintrc.js .commitlintrc.json commitlint.config.js; do
if [ -f "$config_file" ]; then
print_info "配置文件: $config_file"
print_debug "$config_file 内容预览:"
print_debug "$(head -10 "$config_file" 2>/dev/null || echo '无法读取文件')"
break
fi
done
else
print_warning "未找到 commitlint 配置文件"
print_info "建议创建 .commitlintrc.js 或 commitlint.config.js/commitlint.config.mjs"
fi
# 运行 commitlint
echo
print_section "执行 commitlint 检查..."
print_command "执行命令: npx commitlint --edit \"$1\""
# 显示详细的执行过程
if [ "$DEBUG" = "true" ]; then
print_debug "详细执行过程:"
npx commitlint --edit "$1" --verbose
RESULT=$?
else
npx commitlint --edit "$1"
RESULT=$?
fi
echo
if [ $RESULT -eq 0 ]; then
print_success "提交消息格式检查通过!"
print_info "准备提交到 Git 仓库..."
print_debug "Hook 执行成功,退出代码: 0"
else
print_error "提交消息格式检查失败! (退出代码: $RESULT)"
echo
print_warning "故障排查建议:"
echo "1. 检查提交消息是否符合约定式提交格式"
echo "2. 确认 commitlint 配置是否正确"
echo "3. 运行 'DEBUG=true git commit' 查看详细调试信息"
echo "4. 手动测试: npx commitlint --edit .git/COMMIT_EDITMSG"
echo
print_debug "Hook 执行失败,退出代码: $RESULT"
fi
print_info "Hook 执行完成: $(date)"
exit $RESULT

1
.husky/pre-commit Normal file
View File

@ -0,0 +1 @@
npx lint-staged

51
Dockerfile Normal file
View File

@ -0,0 +1,51 @@
# -------- Base image --------
FROM node:22-alpine AS base
ENV NODE_ENV=production
WORKDIR /app
# -------- Dependencies layer -------
FROM base AS deps
WORKDIR /app
RUN corepack enable
# Copy package.json and lockfile
COPY package.json pnpm-lock.yaml .npmrc ./
# Install dependencies with cache
RUN --mount=type=cache,target=/root/.local/share/pnpm/store pnpm install
# -------- Build layer -------
FROM deps AS build
# Copy entire project
COPY . ./
ENV NITRO_PRESET=node-server
# Build the project
RUN pnpm run build
# ------- Runtime layer -------
FROM base AS runtime
WORKDIR /app
# COPY .output folder
COPY --from=build /app/.output ./
ARG BUILD_TIME
ARG GIT_COMMIT
RUN echo "{\"buildTime\":\"$BUILD_TIME\",\"gitCommit\":\"$GIT_COMMIT\"}" > /app/version.json
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV PORT=3000
ENV NITRO_PRESET=node-server
ENV HOST=0.0.0.0
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["node", "/app/server/index.mjs"]

135
README.md
View File

@ -1,75 +1,104 @@
# Nuxt Minimal Starter # 金申机械制造有限公司官方网站——前端服务
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. 这是公司金申机械制造有限公司官网的前端服务。项目使用Nuxt.js与Element Plus进行开发后端服务使用Directus。旨在为客户提供直观的公司简介、产品信息、解决方案、联系方式等。
## Setup ## 站点内容
Make sure to install dependencies: - 首页
- 首页Banner
- 推荐产品
- 产品展示
- 产品列表分类展示
- 产品详情页
- 解决方案
- 以Markdown形式渲染解决方案文章
- 服务支持
- 常见问题列表
- 文档资料列表
- 联系信息
- 关于我们
- 公司基本信息
- 搜索页
- 使用Meilisearch作为搜索引擎进行搜索
## 安装与设置
> [!NOTE]
> 本项目默认使用pnpm作为包管理器
1. 克隆项目仓库:
```bash ```bash
# npm git clone http://192.168.84.125/remilia/jinshen-website.git
npm install ```
# pnpm 2. 进入项目目录:
```bash
cd jinshen-website
```
3. 安装依赖
```bash
pnpm install pnpm install
# yarn
yarn install
# bun
bun install
``` ```
## Development Server 4. 运行开发环境
Start the development server on `http://localhost:3000`:
```bash ```bash
# npm pnpm run dev
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run dev
``` ```
## Production 5. 访问开发环境
Build the application for production: 通过http://localhost:3000访问前端服务
### 配置说明
项目用到以下环境变量,请自行在项目中配置
> [!NOTE]
>
> - NUXT_PUBLIC_DIRECTUS_URL: 后端Directus服务URL
> - NUXT_PUBLIC_DIRECTUS_TOKEN: 后端Directus服务的API Token
> - MEILI_HOST: Meilisearch服务地址
> - MEILI_SEARCH_KEY: MeilisearchKey
## 构建与部署
1. 构建生产版本
项目构建
```bash ```bash
# npm pnpm run build
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run build
``` ```
Locally preview production build: 预览构建版本
```bash ```bash
# npm pnpm run preview
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run preview
``` ```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. 2. 部署
部署构建后的项目并推送到文件服务器中,具体步骤视服务器配置而定
## Dockerfile部署
1. 构建Docker镜像
在项目根目录执行docker build
```bash
docker build -t jinshen-website .
```
2. 运行docker容器
```bash
docker run --name <container-name> jinshen-website
```
网站默认在3000端口开放

View File

@ -9,29 +9,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ElConfigProvider } from 'element-plus'; import { ElConfigProvider } from 'element-plus';
const { login } = useStrapiAuth(); const { getElementPlusLocale } = useLocalizations();
const { getElementPlusLocale } = useLocalizations(); const elementPlusLocale = getElementPlusLocale();
const elementPlusLocale = getElementPlusLocale();
onMounted(() => {
// 检查用户是否已登录
const user = useStrapiUser();
if (!user.value) {
// 如果未登录,重定向到登录页面
login({ identifier: 'remilia', password: 'huanshuo51' })
.then(() => {
console.log('Login successful');
})
.catch((error) => {
console.error('Login failed:', error);
});
} else {
console.log('User is already logged in:', user.value);
}
});
</script> </script>

36
app/assets/css/fonts.css Normal file
View File

@ -0,0 +1,36 @@
@font-face {
font-family: "Source Han Sans CN";
src:
url("/fonts/source-han-sans/SourceHanSansCN-Regular-Alphabetic.woff2")
format("woff2"),
url("/fonts/source-han-sans/SourceHanSansCN-Regular-Alphabetic.woff")
format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Source Han Sans CN";
src:
url("/fonts/source-han-sans/SourceHanSansCN-Bold-Alphabetic.woff2")
format("woff2"),
url("/fonts/source-han-sans/SourceHanSansCN-Bold-Alphabetic.woff")
format("woff");
font-weight: 700;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Source Han Sans CN";
src:
url("/fonts/source-han-sans/SourceHanSansCN-Light-Alphabetic.woff2")
format("woff2"),
url("/fonts/source-han-sans/SourceHanSansCN-Light-Alphabetic.woff")
format("woff");
font-weight: 300;
font-style: normal;
font-display: swap;
}

View File

@ -0,0 +1,95 @@
.html-typography {
padding: 10px;
line-height: 1.6;
}
.html-typography h1 {
color: var(--el-color-primary);
font-size: 1.5em;
margin-bottom: 0.5em;
text-align: center;
}
.html-typography h2 {
color: var(--el-color-primary);
font-size: 1.5em;
margin-bottom: 0.5em;
}
.html-typography h3 {
color: var(--el-color-primary);
font-size: 1.2em;
margin-bottom: 0.5em;
}
.html-typography p {
text-indent: 2em;
text-align: justify;
margin: 0.5em 0;
margin-bottom: 1em;
}
.html-typography ol {
list-style-type: decimal;
padding-left: 2em;
margin-bottom: 1em;
}
.html-typography ul {
list-style-type: disc;
padding-left: 2em;
margin-bottom: 1em;
}
.html-typography hr {
border: none;
border-top: 1px solid var(--el-border-color);
margin: 20px 0;
}
/* 表格基础样式 */
.html-typography table {
width: 100%;
border-collapse: collapse;
border: 1px solid var(--el-border-color);
margin: 1em 0;
table-layout: auto;
font-size: 14px;
}
/* 单元格通用样式 */
.html-typography th,
.html-typography td {
border: 1px solid var(--el-border-color);
padding: 8px 12px;
text-align: left;
vertical-align: middle;
word-break: break-word;
}
/* 表头样式 */
.html-typography th {
background-color: var(--el-fill-color-light);
color: var(--el-text-color-primary);
font-weight: 600;
}
/* 行 hover 效果 */
.html-typography tbody tr:hover {
background-color: var(--el-fill-color-light-hover);
}
/* 交替行背景 */
.html-typography tbody tr:nth-child(odd) {
background-color: var(--el-fill-color-lighter);
}
/* 表格标题(如有 caption */
.html-typography table caption {
caption-side: top;
text-align: left;
padding: 8px 0;
font-size: 14px;
font-weight: 600;
color: var(--el-text-color-primary);
}

View File

@ -1,6 +1,6 @@
@forward 'element-plus/theme-chalk/src/dark/var.scss' with ( @forward "element-plus/theme-chalk/src/dark/var.scss" with (
$bg-color: ( $bg-color: (
'page': #0a0a0a, "page": #0a0a0a,
'overlay': #1d1e1f, "overlay": #1d1e1f,
) )
); );

View File

@ -1,26 +1,26 @@
$-colors: ( $-colors: (
'primary': ( "primary": (
'base': #177ee5, "base": #177ee5,
), ),
'success': ( "success": (
'base': green, "base": green,
), ),
'warning': ( "warning": (
'base': #f9a23c, "base": #f9a23c,
), ),
'danger': ( "danger": (
'base': #ff3300, "base": #ff3300,
), ),
'error': ( "error": (
'base': #f56c6c, "base": #f56c6c,
), ),
'info': ( "info": (
'base': #909399, "base": #909399,
), ),
); );
@forward 'element-plus/theme-chalk/src/common/var.scss' with ( @forward "element-plus/theme-chalk/src/common/var.scss" with (
$colors: $-colors $colors: $-colors
); );
@use './dark.scss'; @use "./dark.scss";

View File

@ -3,6 +3,7 @@ body,
#app { #app {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-family: var(--font-main);
} }
html.dark { html.dark {
@ -14,3 +15,8 @@ a {
font-weight: 400; font-weight: 400;
color: var(--el-color-primary); color: var(--el-color-primary);
} }
:root {
--font-main:
"Source Han Sans CN", "Noto Sans CJK SC", "Noto Sans CJK", sans-serif;
}

View File

@ -1,275 +0,0 @@
<template>
<footer class="jinshen-footer">
<div class="footer-container">
<!-- Logo 和公司信息 -->
<div class="footer-section">
<div class="footer-logo">
<img src="/jinshen-logo.png" alt="Jinshen Logo" class="logo-image">
<h3>{{ $t('company-name') }}</h3>
</div>
<p class="company-description">
{{ $t('company-description') }}
</p>
</div>
<!-- 快速链接 -->
<div class="footer-section">
<h4>{{ $t('quick-links') }}</h4>
<ul class="footer-links">
<li>
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
</li>
<li>
<NuxtLink :to="$localePath('/productions')">{{ $t('productions') }}</NuxtLink>
</li>
<li>
<NuxtLink :to="$localePath('/solutions')">{{ $t('solutions') }}</NuxtLink>
</li>
<li>
<NuxtLink :to="$localePath('/support')">{{ $t('support') }}</NuxtLink>
</li>
<li>
<NuxtLink :to="$localePath('/about')">{{ $t('about-us') }}</NuxtLink>
</li>
</ul>
</div>
<!-- 联系信息 -->
<div class="footer-section">
<h4>{{ $t('contact-info') }}</h4>
<div class="contact-item">
<el-icon><Phone /></el-icon>
<span>{{ $t('telephone') }}: 0573-88187988</span>
</div>
<div class="contact-item">
<el-icon><Message /></el-icon>
<span>{{ $t('email') }}: jinshen@wzjinshen.com</span>
</div>
<div class="contact-item">
<el-icon><Location /></el-icon>
<span>{{ $t('address') }}: {{ $t('company-address') }}</span>
</div>
</div>
<!-- 社交媒体 -->
<div class="footer-section">
<h4>{{ $t('follow-us') }}</h4>
<div class="social-links">
<a href="#" class="social-link" aria-label="WeChat">
<el-icon size="20"><ChatDotRound /></el-icon>
</a>
<a href="#" class="social-link" aria-label="Weibo">
<el-icon size="20"><Star /></el-icon>
</a>
<a href="#" class="social-link" aria-label="LinkedIn">
<el-icon size="20"><Link /></el-icon>
</a>
<a href="#" class="social-link" aria-label="Email">
<el-icon size="20"><Message /></el-icon>
</a>
</div>
</div>
</div>
<!-- 版权信息 -->
<div class="footer-bottom">
<div class="footer-container">
<div class="copyright">
<p>&copy; {{ currentYear }} {{ $t('company-name') }}. {{ $t('all-rights-reserved') }}</p>
<p>备案号: 浙ICP备12003709号-5</p>
</div>
<div class="footer-links-bottom">
<NuxtLink :to="$localePath('/privacy')">{{ $t('privacy-policy') }}</NuxtLink>
<span class="separator">|</span>
<NuxtLink :to="$localePath('/terms')">{{ $t('terms-of-service') }}</NuxtLink>
<span class="separator">|</span>
<NuxtLink :to="$localePath('/sitemap')">{{ $t('sitemap') }}</NuxtLink>
</div>
</div>
</div>
</footer>
</template>
<script setup lang="ts">
import {
Phone,
Message,
Location,
ChatDotRound,
Star,
Link
} from '@element-plus/icons-vue'
const currentYear = new Date().getFullYear()
</script>
<style scoped>
.jinshen-footer {
background: var(--el-bg-color-page);
border-top: 1px solid var(--el-border-color);
margin-top: auto;
}
.footer-container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem 1rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
}
.footer-section h3,
.footer-section h4 {
color: var(--el-text-color-primary);
margin-bottom: 1rem;
font-weight: 600;
}
.footer-logo {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1rem;
}
.logo-image {
width: 40px;
height: 40px;
object-fit: contain;
}
.company-description {
color: var(--el-text-color-regular);
line-height: 1.6;
margin: 0;
}
.footer-links {
list-style: none;
padding: 0;
margin: 0;
}
.footer-links li {
margin-bottom: 0.5rem;
}
.footer-links a {
color: var(--el-text-color-regular);
text-decoration: none;
transition: color 0.3s ease;
}
.footer-links a:hover {
color: var(--el-color-primary);
}
.contact-item {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
color: var(--el-text-color-regular);
}
.contact-item .el-icon {
color: var(--el-color-primary);
}
.social-links {
display: flex;
gap: 1rem;
}
.social-link {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: var(--el-fill-color-light);
border-radius: 50%;
color: var(--el-text-color-regular);
text-decoration: none;
transition: all 0.3s ease;
}
.social-link:hover {
background: var(--el-color-primary);
color: white;
transform: translateY(-2px);
}
.footer-bottom {
background: var(--el-fill-color-light);
border-top: 1px solid var(--el-border-color-lighter);
padding: 1rem 0;
}
.footer-bottom .footer-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 1rem;
grid-template-columns: none;
gap: 1rem;
}
.copyright p {
margin: 0;
color: var(--el-text-color-regular);
font-size: 0.875rem;
}
.footer-links-bottom {
display: flex;
align-items: center;
gap: 0.5rem;
}
.footer-links-bottom a {
color: var(--el-text-color-regular);
text-decoration: none;
font-size: 0.875rem;
transition: color 0.3s ease;
}
.footer-links-bottom a:hover {
color: var(--el-color-primary);
}
.separator {
color: var(--el-text-color-placeholder);
}
/* 响应式设计 */
@media (max-width: 768px) {
.footer-container {
grid-template-columns: 1fr;
padding: 1.5rem 1rem;
}
.footer-bottom .footer-container {
flex-direction: column;
text-align: center;
gap: 1rem;
}
.footer-links-bottom {
flex-wrap: wrap;
justify-content: center;
}
}
/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
.jinshen-footer {
background: var(--el-bg-color-page);
}
.footer-bottom {
background: var(--el-fill-color-darker);
}
}
</style>

View File

@ -1,112 +0,0 @@
<template>
<div class="header-container">
<div class="logo-section">
<NuxtLink :to="$localePath('/')" class="logo-link">
<el-image class="website-logo" src="/jinshen-logo.png" alt="Jinshen Logo" fit="contain" />
</NuxtLink>
</div>
<!-- 导航菜单 -->
<el-menu default-active="productions" class="header-menu" mode="horizontal" :ellipsis="false" router>
<el-menu-item :index="$localePath('/productions')">
<span class="title">{{ $t('productions') }}</span>
</el-menu-item>
<el-menu-item :index="$localePath('/solutions')">
<span class="title">{{ $t('solutions') }}</span>
</el-menu-item>
<el-menu-item :index="$localePath('/support')">
<span class="title">{{ $t('support') }}</span>
</el-menu-item>
<el-menu-item :index="$localePath('/about')">
<span class="title">{{ $t('about-us') }}</span>
</el-menu-item>
</el-menu>
<!-- 右侧功能区 -->
<div class="header-actions">
<el-input
v-model="searchQuery" class="search-input" :placeholder="$t('search-placeholder')"
:prefix-icon="Search" clearable @keyup.enter="handleSearch" />
<el-dropdown @command="setLocale">
<el-link type="info" :underline="false">
<el-icon class="mdi mdi-translate translate-link" />
</el-link>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="zh">简体中文</el-dropdown-item>
<el-dropdown-item command="en">English</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</template>
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue';
const { setLocale } = useI18n();
const searchQuery = ref('')
const handleSearch = () => {
if (searchQuery.value.trim()) {
// 这里可以添加搜索逻辑,例如导航到搜索结果页面
console.log('Searching for:', searchQuery.value);
// 示例:导航到搜索结果页面
// router.push({ path: '/search', query: { q: searchQuery.value } });
}
}
</script>
<style scoped>
.header-container {
margin: 0 auto;
padding: 0 10px;
display: flex;
align-items: center;
border-bottom: 1px solid #e0e0e0;
}
.logo-section {
display: flex;
flex: 1;
align-items: center;
}
.logo-link {
display: flex;
align-items: center;
text-decoration: none;
}
.website-logo {
height: 64px;
width: auto;
}
.header-menu {
margin-right: 40px;
border-bottom: none !important;
width: auto;
}
.header-menu .el-menu-item {
border-bottom: none !important;
}
.header-actions {
display: flex;
align-items: center;
gap: 16px;
}
.search-input {
width: 200px;
}
.translate-link {
font-size: 20px;
}
</style>

View File

@ -1,35 +0,0 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<!-- v-html 渲染解析后的 HTML -->
<div class="markdown-body" v-html="safeHtml"/>
</template>
<script setup lang="ts">
interface Props {
content: string
}
const props = defineProps<Props>()
// 将 Markdown 转换成 HTML
const safeHtml = computed(() => renderMarkdown(props.content))
</script>
<style>
.markdown-body {
padding: 10px;
line-height: 1.6;
}
.markdown-body h1,
.markdown-body h2 {
color: var(--el-color-primary);
font-size: 1.5em;
margin-bottom: 0.5em;
}
.markdown-body ol {
list-style-type: decimal;
padding-left: 2em;
}
</style>

View File

@ -1,74 +0,0 @@
<template>
<el-card class="production-card" @click="handleClick">
<!-- Image -->
<el-image class="production-image" :src="imageUrl" fit="contain" />
<template #footer>
<!-- Name -->
<div class="text-center mx-auto text-md">
<span class="production-name">{{ name }}</span>
</div>
<!-- Description -->
<div class="mx-auto mt-5 text-center text-sm opacity-25">{{ description }}</div>
</template>
</el-card>
</template>
<script setup lang="ts">
interface Props {
name: string
description: string
imageUrl: string
id?: string | number
slug?: string
}
const props = defineProps<Props>()
const localePath = useLocalePath()
const handleClick = () => {
// 优先使用 slug如果没有则使用 id
const routeParam = props.slug || props.id
if (routeParam) {
navigateTo(localePath(`/productions/${routeParam}`))
}
}
</script>
<style scoped>
.production-card {
width: 20%;
/* margin: 20px auto; */
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
}
.production-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.production-name {
font-weight: 600;
color: var(--el-text-color-primary);
}
.production-card .el-image {
height: 200px;
border-radius: 4px;
}
/* 响应式设计 */
@media (max-width: 1200px) {
.production-card {
width: 45%;
}
}
@media (max-width: 768px) {
.production-card {
width: 90%;
}
}
</style>

View File

@ -1,27 +0,0 @@
<template>
<div class="spec-collapse">
<el-collapse v-model="activeName">
<el-collapse-item v-for="item in data" :key="item.title" :title="item.title" :name="item.title">
<el-descriptions :column="1" border>
<el-descriptions-item v-for="subItem in item.items" :key="subItem.label" :label="subItem.label">
{{ subItem.value }}
</el-descriptions-item>
</el-descriptions>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script lang="ts" setup>
const props = defineProps({
data: {
type: Object as () => ProductionSpecGroup[],
required: true
}
})
// 默认全部展开
const activeName = ref<string[]>(props.data.map((item: ProductionSpecGroup) => {
return item.title
}) || [])
</script>

View File

@ -0,0 +1,107 @@
<template>
<component
:is="wrapperTag"
v-bind="wrapperProps"
class="learn-more-wrapper"
@click="handleAsyncClick"
>
<el-card class="learn-more-card">
<el-icon class="icon" size="80">
<component :is="icon" />
</el-icon>
<br />
{{ title }}
</el-card>
</component>
</template>
<script setup lang="ts">
const props = defineProps({
title: {
type: String,
default: '',
},
icon: {
type: Object,
default: null,
},
to: {
type: String,
default: null,
},
href: {
type: [String, Function],
default: null,
},
});
// 包裹器标签
const wrapperTag = computed(() => {
if (props.to) return resolveComponent('NuxtLink');
if (props.href) return 'a';
return 'div';
});
// 包裹器属性
const wrapperProps = computed(() => {
// Nuxt 内部跳转
if (props.to) {
return { to: props.to };
}
// 外部跳转(字符串)
if (typeof props.href === 'string') {
return {
href: props.href,
target: '_blank',
rel: 'noopener noreferrer',
};
}
// 其他情况href 是异步函数 → 不在这里处理
return { href: '#' };
});
async function handleAsyncClick(event: Event) {
if (typeof props.href === 'function') {
event.preventDefault();
const url = await props.href();
window.open(url, '_blank', 'noopener,noreferrer');
}
}
</script>
<style scoped>
.learn-more-card {
width: 20%;
min-width: 200px;
padding: 20px;
margin: 0 auto;
cursor: pointer;
text-align: center;
font-size: 1.5em;
}
.learn-more-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.icon {
padding: 10px;
}
@media (max-width: 768px) {
.learn-more-wrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.learn-more-card {
width: 80%;
min-width: 0;
}
}
</style>

View File

@ -0,0 +1,87 @@
<template>
<el-card shadow="hover" class="p-4">
<template #header>
<div class="header-content">
<el-icon class="header-icon"><ElIconDocument /></el-icon>
<span class="truncate font-medium">{{ file.filename_download }}</span>
</div>
</template>
<dl class="text-gray-600 space-y-1 mb-6">
<div>
<dt class="font-semibold inline">{{ $t('document-meta.type') }}</dt>
<dd class="inline">{{ file.type }}</dd>
</div>
<div>
<dt class="font-semibold inline">{{ $t('document-meta.size') }}</dt>
<dd class="inline">{{ formatFileSize(file.filesize) }}</dd>
</div>
<div>
<dt class="font-semibold inline">
{{ $t('document-meta.upload-at') }}
</dt>
<dd class="inline">
{{ new Date(file.uploaded_on).toLocaleDateString() }}
</dd>
</div>
</dl>
<template #footer>
<div class="button-group">
<el-button type="primary" @click="handleDownload">{{
$t('document-action.download')
}}</el-button>
<el-button v-if="file.previewable" @click="handlePreview">{{
$t('document-action.preview')
}}</el-button>
</div>
</template>
</el-card>
</template>
<script setup lang="ts">
const props = defineProps({
fileId: {
type: String,
required: true,
},
file: {
type: Object as PropType<FileMeta>,
required: true,
},
});
const localePath = useLocalePath();
const router = useRouter();
function handleDownload() {
const link = document.createElement('a');
link.href = `/api/download/${props.fileId}`;
link.download = props.file?.filename_download ?? 'download';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
function handlePreview() {
router.push(localePath(`/preview/${props.fileId}`));
}
</script>
<style scoped>
.header-content {
display: flex;
align-items: center;
gap: 3px;
margin-bottom: 4px;
}
.header-icon {
font-size: 1.5rem;
margin-right: 0.5rem;
}
.button-group {
display: flex;
justify-content: flex-end;
align-items: baseline;
gap: 1rem;
}
</style>

View File

@ -0,0 +1,92 @@
<template>
<section v-if="!pending" class="carousel-section">
<el-carousel
class="homepage-carousel"
height="auto"
:interval="5000"
arrow="never"
autoplay
>
<el-carousel-item v-for="(item, index) in carousel" :key="index">
<div class="carousel-item">
<el-image
class="carousel-image"
:src="getImageUrl(item)"
:alt="`Carousel Image ${index + 1}`"
fit="contain"
lazy
/>
</div>
</el-carousel-item>
</el-carousel>
</section>
<section v-else>
<el-skeleton :rows="5" animated />
</section>
</template>
<script setup lang="ts">
const props = defineProps({
homepageData: {
type: Object as PropType<HomepageView>,
default: null,
},
pending: {
type: Boolean,
},
});
const { getImageUrl } = useDirectusImage();
const carousel = computed(() => props.homepageData?.carousel || []);
</script>
<style scoped>
.carousel-section {
padding: 0;
}
.homepage-carousel .el-carousel__item {
width: 100%;
height: 33vw;
/* 16:9 Aspect Ratio */
}
.el-carousel__item h3 {
display: flex;
color: #475669;
opacity: 0.8;
line-height: 300px;
margin: 0;
}
.homepage-carousel .carousel-item {
width: 100%;
height: 100%;
background-color: #f5f7fa;
}
.carousel-image {
position: relative;
width: 100%;
height: 100%;
}
.carousel-image-caption {
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
background-color: rgba(0, 0, 0, 0.5);
color: white;
padding: 5px 10px;
border-radius: 5px;
font-size: 14px;
}
@media (max-width: 768px) {
.homepage-carousel .el-carousel__item {
height: 50vw;
}
}
</style>

View File

@ -0,0 +1,228 @@
<template>
<section class="homepage-section">
<h2>{{ $t('homepage.recommended-products') }}</h2>
<p>
{{ $t('homepage.recommended-products-desc') }}
</p>
<div v-if="!pending">
<el-carousel
class="recommend-carousel"
:height="carouselHeight"
arrow="never"
indicator-position="outside"
:autoplay="false"
>
<el-carousel-item
v-for="n in pages"
ref="carouselItem"
:key="n"
class="recommend-list"
>
<div class="recommend-card-group">
<el-card
v-for="(item, index) in pageProducts(n)"
:key="index"
class="recommend-card"
@click="handleProductCardClick(item.id.toString() || '')"
>
<template #header>
<el-image
:src="getImageUrl(item.cover)"
:alt="item.name"
fit="cover"
lazy
/>
</template>
<div class="recommend-card-body">
<!-- Title -->
<div class="text-center">
<span class="recommend-card-title">{{ item.name }}</span>
</div>
<!-- Description -->
<div class="recommend-card-description text-left opacity-25">
{{ item.summary }}
</div>
</div>
</el-card>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div v-else>
<el-skeleton :rows="4" animated />
</div>
</section>
</template>
<script setup lang="ts">
const props = defineProps({
homepageData: {
type: Object as PropType<HomepageView>,
default: null,
},
pending: {
type: Boolean,
},
});
const carouselHeight = ref<string>('auto');
const perPage = ref(3);
const carouselItem = ref<HTMLElement | null>(null);
const { getImageUrl } = useDirectusImage();
const { height } = useElementSize(carouselItem);
const products = computed(() => props.homepageData?.recommendProducts || []);
const pages = computed(() =>
Math.ceil(products.value.length / perPage.value)
);
const updatePerPage = () => {
const width = window.innerWidth;
if (width < 768) {
perPage.value = 1;
} else if (width < 1024) {
perPage.value = 2;
} else {
perPage.value = 3;
}
};
const pageProducts = (n: number) => {
return products.value.slice((n - 1) * perPage.value, n * perPage.value);
};
const handleProductCardClick = (documentId: string) => {
// 使用路由导航到产品详情页
if (documentId) {
const localePath = useLocalePath();
const router = useRouter();
router.push(localePath(`/products/${documentId}`));
}
};
watch(height, (h) => {
if (h > 0) {
carouselHeight.value = h + 40 + 'px';
}
});
onMounted(() => {
updatePerPage();
window.addEventListener('resize', updatePerPage);
});
onBeforeUnmount(() => {
window.removeEventListener('resize', updatePerPage);
});
</script>
<style scoped>
section {
padding: 2rem;
}
section h2 {
color: var(--el-text-color-primary);
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
section p {
color: var(--el-text-color-regular);
line-height: 1.6;
}
.homepage-section {
max-width: 1200px;
margin: 0 auto;
}
.recommend-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #475669;
transition: all 0.3s ease;
}
.homepage-section {
max-width: 1200px;
margin: 0 auto;
}
.recommend-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #475669;
transition: all 0.3s ease;
}
.recommend-list {
display: flex;
padding: 1rem;
height: auto;
}
.recommend-card-group {
display: flex;
gap: 1rem;
width: 100%;
margin: 0 auto;
height: auto;
}
.recommend-card {
width: 33%;
transition: all 0.3s ease;
text-align: center;
}
.recommend-card :deep(.el-card__header) {
padding: 0;
border: none;
}
.recommend-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
cursor: pointer;
}
.recommend-card-body {
margin: 10px auto;
padding: 0px auto;
}
.recommend-card-title {
font-size: 1rem;
font-weight: 600;
}
.recommend-card-description {
font-size: 0.8rem;
margin-top: 5px;
}
.recommend-card .el-image {
width: 100%;
aspect-ratio: 16 / 10;
border-radius: 4px;
}
@media (max-width: 1024px) {
.recommend-card {
width: 50%;
}
}
@media (max-width: 768px) {
.recommend-card {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,228 @@
<template>
<section class="homepage-section">
<h2>{{ $t('homepage.recommended-solutions') }}</h2>
<p>{{ $t('homepage.recommended-solutions-desc') }}</p>
<div v-if="!pending">
<el-carousel
class="recommend-carousel"
:height="carouselHeight"
arrow="never"
indicator-position="outside"
:autoplay="false"
>
<el-carousel-item
v-for="n in pages"
ref="carouselItem"
:key="n"
class="recommend-list"
>
<div class="recommend-card-group">
<el-card
v-for="(item, index) in pageSolutions(n)"
:key="index"
class="recommend-card"
@click="handleSolutionCardClick(item.id.toString() || '')"
>
<template #header>
<el-image
:src="getImageUrl(item.cover)"
:alt="item.title"
fit="cover"
lazy
/>
</template>
<div class="recommend-card-body">
<!-- Title -->
<div class="text-center">
<span class="recommend-card-title">{{ item.title }}</span>
</div>
<!-- Description -->
<div class="recommend-card-description text-left opacity-25">
{{ item.summary }}
</div>
</div>
</el-card>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div v-else>
<el-skeleton :rows="4" animated />
</div>
</section>
</template>
<script setup lang="ts">
const props = defineProps({
homepageData: {
type: Object as PropType<HomepageView>,
default: null,
},
pending: {
type: Boolean,
},
});
const carouselHeight = ref<string>('auto');
const perPage = ref(3);
const carouselItem = ref<HTMLElement | null>(null);
const { getImageUrl } = useDirectusImage();
const { height } = useElementSize(carouselItem);
const solutions = computed(
() => props.homepageData?.recommendSolutions || []
);
const pages = computed(() =>
Math.ceil(solutions.value.length / perPage.value)
);
const updatePerPage = () => {
const width = window.innerWidth;
if (width < 768) {
perPage.value = 1;
} else if (width < 1024) {
perPage.value = 2;
} else {
perPage.value = 3;
}
};
const pageSolutions = (n: number) => {
return solutions.value.slice((n - 1) * perPage.value, n * perPage.value);
};
const handleSolutionCardClick = (documentId: string) => {
// 使用路由导航到产品详情页
if (documentId) {
const localePath = useLocalePath();
const router = useRouter();
router.push(localePath(`/solutions/${documentId}`));
}
};
watch(height, (h) => {
if (h > 0) {
carouselHeight.value = h + 40 + 'px';
}
});
onMounted(() => {
updatePerPage();
window.addEventListener('resize', updatePerPage);
});
onBeforeUnmount(() => {
window.removeEventListener('resize', updatePerPage);
});
</script>
<style scoped>
section {
padding: 2rem;
}
section h2 {
color: var(--el-text-color-primary);
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
section p {
color: var(--el-text-color-regular);
line-height: 1.6;
}
.homepage-section {
max-width: 1200px;
margin: 0 auto;
}
.recommend-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #475669;
transition: all 0.3s ease;
}
.homepage-section {
max-width: 1200px;
margin: 0 auto;
}
.recommend-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #475669;
transition: all 0.3s ease;
}
.recommend-list {
display: flex;
padding: 1rem;
height: auto;
}
.recommend-card-group {
display: flex;
gap: 1rem;
width: 100%;
margin: 0 auto;
height: auto;
}
.recommend-card {
width: 33%;
transition: all 0.3s ease;
text-align: center;
}
.recommend-card :deep(.el-card__header) {
padding: 0;
border: none;
}
.recommend-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
cursor: pointer;
}
.recommend-card-body {
margin: 10px auto;
padding: 0px auto;
}
.recommend-card-title {
font-size: 1rem;
font-weight: 600;
}
.recommend-card-description {
font-size: 0.8rem;
margin-top: 5px;
}
.recommend-card .el-image {
width: 100%;
aspect-ratio: 16 / 10;
border-radius: 4px;
}
@media (max-width: 1024px) {
.recommend-card {
width: 50%;
}
}
@media (max-width: 768px) {
.recommend-card {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<div class="product-detail">
<el-tabs v-model="activeName" class="product-tabs" stretch>
<el-tab-pane :label="$t('product-tab.details')" name="details">
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="html-typography" v-html="product?.description || ''" />
<!-- <div v-if="!hydrated" v-html="product.description || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="product.description || ''" -->
<!-- /> -->
<!-- </div> -->
</el-tab-pane>
<el-tab-pane :label="$t('product-tab.specs')" name="specs">
<spec-table :data="product.specs" />
</el-tab-pane>
<el-tab-pane :label="$t('product-tab.faq')" name="faq">
<question-list :questions="product.faqs" />
</el-tab-pane>
<el-tab-pane :label="$t('product-tab.documents')" name="documents">
<document-list :documents="product.documents" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts">
defineProps({
product: {
type: Object as PropType<ProductView>,
required: true,
},
});
const hydrated = ref(false);
const activeName = ref('details'); // 默认选中概览标签
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>
.product-tabs ::v-deep(.el-tabs__nav) {
min-width: 30%;
float: right;
}
.product-tabs ::v-deep(.el-tabs__content) {
padding: 10px;
}
.product-detail h2 {
color: var(--el-text-color-primary);
margin: 0;
}
@media (max-width: 768px) {
.product-tabs ::v-deep(.el-tabs__nav) {
float: none;
min-width: 100%;
}
}
</style>

View File

@ -0,0 +1,137 @@
<template>
<div class="product-header">
<div class="product-image">
<el-image
v-if="product.images.length <= 1"
:src="getImageUrl(product.images[0].image)"
:alt="product.name"
fit="contain"
/>
<el-carousel
v-else
class="product-carousel"
height="auto"
:autoplay="false"
:loop="false"
arrow="always"
>
<el-carousel-item
v-for="(item, index) in product.images || []"
:key="index"
class="product-carousel-item"
>
<div>
<el-image
:src="getImageUrl(item.image || '')"
:alt="product.name"
fit="contain"
lazy
/>
<p v-if="item.caption" class="product-image-caption">
{{ item.caption }}
</p>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div class="product-info">
<h1>{{ product.name }}</h1>
<p class="summary">{{ product.summary }}</p>
<p v-if="product.status === 'discontinued'" class="discontinued-warning">
<el-icon><ElIconWarning /></el-icon>
{{ $t('product-discontinued-warning') }}
</p>
</div>
</div>
</template>
<script setup lang="ts">
defineProps({
product: {
type: Object as PropType<ProductView>,
required: true,
},
});
const { getImageUrl } = useDirectusImage();
</script>
<style scoped>
.product-header {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 3rem;
}
.product-carousel-item {
height: 500px;
}
.product-image .el-image {
position: relative;
width: 100%;
height: 500px;
border-radius: 8px;
}
.product-image-caption {
position: absolute;
bottom: 10px;
/* left: 10%; */
background-color: rgba(0, 0, 0, 0.2);
border-radius: 5px;
padding: 5px 10px;
text-align: center;
color: white;
font-size: 0.8rem;
}
.product-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #475669;
transition: all 0.3s ease;
}
.product-info h1 {
margin-top: 2rem;
margin-bottom: 1rem;
font-size: 2rem;
}
.summary {
color: var(--el-color-info);
font-size: 1rem;
line-height: 1.6;
margin-bottom: 2rem;
}
.discontinued-warning {
color: var(--el-color-error);
}
@media (max-width: 768px) {
.product-header {
grid-template-columns: 1fr;
}
.product-carousel-item {
height: 300px;
}
.product-image .el-image {
height: 300px;
}
.product-info {
padding: 0 1rem;
}
.product-info h1 {
font-size: 1.5rem;
margin-top: 0;
}
}
</style>

View File

@ -0,0 +1,46 @@
<template>
<div class="spec-collapse">
<el-collapse v-model="activeName">
<el-collapse-item
v-for="item in data"
:key="item.name"
:title="item.name"
:name="item.name"
>
<el-descriptions :column="1" label-width="30%" border>
<el-descriptions-item
v-for="subItem in item.specs"
:key="subItem.key"
:label="subItem.key"
>
{{ subItem.value }}
</el-descriptions-item>
</el-descriptions>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script lang="ts" setup>
const props = defineProps({
data: {
type: Object as () => ProductSpecGroupView[],
required: true,
},
});
// 默认全部展开
const activeName = ref<string[]>(
props.data.map((item: ProductSpecGroupView) => {
return item.name;
}) || []
);
</script>
<style scoped>
.spec-collapse ::v-deep(.el-collapse-item__header) {
font-size: 1rem;
font-weight: 600;
padding: 1rem;
}
</style>

View File

@ -0,0 +1,78 @@
<template>
<div class="search-header">
<h1 class="page-title">{{ $t('search.title') }}</h1>
<div class="search-bar">
<el-input
v-model="keyword"
class="search-input"
:placeholder="$t('search-placeholder')"
:prefix-icon="Search"
clearable
@keyup.enter="navigateToQuery(keyword)"
@clear="handleClear"
/>
<el-button
type="primary"
class="search-button"
@click="navigateToQuery(keyword)"
>
{{ $t('search.search-button') }}
</el-button>
</div>
</div>
</template>
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue';
const keyword = defineModel<string>({ default: '' });
const localePath = useLocalePath();
const router = useRouter();
const navigateToQuery = (value: string) => {
const trimmed = value.trim();
if (!trimmed) return;
navigateTo({
path: localePath('/search'),
query: { query: trimmed },
});
};
const handleClear = () => {
keyword.value = '';
router.replace(localePath({ path: '/search' }));
};
</script>
<style scoped>
.search-header {
display: flex;
flex-direction: column;
gap: 1rem;
margin-bottom: 2rem;
}
.page-title {
font-size: 2.25rem;
font-weight: 600;
color: var(--el-text-color-primary);
}
.search-bar {
display: flex;
gap: 1rem;
align-items: center;
font-size: 16px;
}
.search-input {
flex: 1;
height: 50px;
}
.search-button {
height: 50px;
width: 100px;
font-size: 16px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<el-card class="result-card">
<el-row>
<el-col :span="12">
<h3 class="result-title">{{ item.title }}</h3>
<p v-if="item.summary" class="result-summary">
{{ item.summary }}
</p>
<p v-if="item.sectionType" class="result-type">
<span>{{ $t('search.section') }}: </span>
<span class="result-type-name">{{ typeLabel }}</span>
<span v-if="item.type" class="result-type-name"
>({{ item.type }})</span
>
</p>
</el-col>
<el-col :span="12" class="image-col">
<el-image
v-if="item.thumbnail"
:src="item.thumbnail"
:alt="item.title"
style="width: 150px"
/>
</el-col>
</el-row>
</el-card>
</template>
<script setup lang="ts">
defineProps<{
item: SearchItemView;
typeLabel: string;
}>();
</script>
<style scoped>
.result-card {
border-radius: 12px;
transition: box-shadow 0.2s ease;
}
.result-card:hover {
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}
.result-title {
font-size: 1.2rem;
font-weight: 600;
color: var(--el-color-primary);
display: inline-block;
}
.result-summary {
font-size: 0.95rem;
color: var(--el-text-color-regular);
margin-bottom: 0.5rem;
line-height: 1.6;
}
.result-type {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.result-type-name {
margin-left: 4px;
color: var(--el-color-primary);
}
.image-col {
display: flex;
justify-content: end;
align-items: center;
}
</style>

View File

@ -0,0 +1,201 @@
<template>
<div v-if="hasResults">
<div class="search-results">
<NuxtLink
v-for="hit in paginatedHits"
:key="`${hit.sectionType}-${hit.id}`"
:to="localePath(resolveHitLink(hit))"
>
<search-result-card
:item="hit"
:type-label="getIndexLabel(hit.sectionType)"
/>
</NuxtLink>
</div>
<!-- 分页组件 -->
<div class="pagination-container text-align-center mt-12">
<el-pagination
v-model:current-page="page"
class="justify-center"
layout="prev, pager, next"
hide-on-single-page
:page-size="pageSize"
:total="filteredHits.length"
@current-change="handleCurrentChange"
/>
</div>
</div>
<div v-else>
<el-empty
:description="
route.query.query
? $t('search.no-results', { query: route.query?.query })
: $t('search.no-query')
"
/>
</div>
</template>
<script setup lang="ts">
const props = defineProps<{
searchItems: SearchItemView[];
currentPage: number;
category?: string;
}>();
const emit = defineEmits(['update:current-page']);
// i18n相关
const { t } = useI18n();
// 路由相关
const localePath = useLocalePath();
const route = useRoute();
// 分页相关
const page = computed({
get: () => props.currentPage,
set: (val) => {
emit('update:current-page', val);
},
});
const pageSize = ref(5);
// 搜索相关
const items = props.searchItems;
const filteredHits = computed(() => {
if (props.category) {
return items.filter((item) => item.sectionType === props.category);
} else {
return items;
}
});
const paginatedHits = computed(() => {
const start = (page.value - 1) * pageSize.value;
const end = page.value * pageSize.value;
return filteredHits.value.slice(start, end);
});
const indexLabels = computed<Record<string, string>>(() => ({
product: t('search.sections.product'),
solution: t('search.sections.solution'),
question: t('search.sections.faq'),
document: t('search.sections.document'),
default: t('search.sections.default'),
}));
/**
* 根据indexUid获取标签名
* @param indexUid 搜索条目的IndexUid
*/
const getIndexLabel = (indexUid: string) =>
indexLabels.value[indexUid] || indexLabels.value.default;
const hasResults = computed(() => {
return filteredHits.value.length > 0;
});
/**
* 解析条目链接
* 根据条目类型返回正确的跳转链接
* @param item 搜索条目
*/
const resolveHitLink = (item: SearchItemView) => {
const slugCandidate = item.id;
if (!slugCandidate) {
return null;
}
const slug = String(slugCandidate);
if (item.sectionType === 'product') {
return localePath({ path: `/products/${slug}` });
}
if (item.sectionType === 'solution') {
return localePath({ path: `/solutions/${slug}` });
}
if (item.sectionType === 'document') {
return localePath({ path: `/download/${slug}` });
}
if (item.sectionType === 'question') {
return localePath({ path: `/support/faq`, query: { focus: slug } });
}
return null;
};
const handleCurrentChange = () => {};
</script>
<style scoped>
.search-results {
display: grid;
gap: 1.5rem;
padding: 0.5rem;
}
.result-card {
border-radius: 12px;
transition: box-shadow 0.2s ease;
}
.result-card:hover {
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}
.result-title {
font-size: 1.2rem;
font-weight: 600;
color: var(--el-color-primary);
display: inline-block;
}
.result-summary {
font-size: 0.95rem;
color: var(--el-text-color-regular);
margin-bottom: 0.5rem;
line-height: 1.6;
}
.result-type {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.result-type-name {
margin-left: 4px;
color: var(--el-color-primary);
}
:deep(.el-pagination) {
.btn-prev,
.btn-next {
.el-icon {
font-size: 24px;
}
}
.el-pager {
gap: 0.5rem;
}
.el-pager li {
font-size: 1rem;
/* border: 1px solid #409eff; */
border-radius: 50%;
&:hover {
background-color: #ecf5ff;
}
&.is-active {
background-color: var(--el-color-primary);
color: #fff;
}
}
}
</style>

View File

@ -0,0 +1,55 @@
<template>
<el-tabs v-model="activeTab">
<el-tab-pane
v-for="tab in tabs"
:key="tab.name"
:label="`${tab.label}(${resultCount[tab.name] || 0})`"
:name="tab.name"
>
<SearchResults
v-model:current-page="currentPage"
:search-items="searchItems"
:category="tab.name === 'all' ? undefined : tab.name"
/>
</el-tab-pane>
</el-tabs>
</template>
<script setup lang="ts">
const props = defineProps<{
// resultCount: Record<string, number>;
searchItems: SearchItemView[];
}>();
const tabs = [
{ name: 'all', label: $t('all') },
{ name: 'product', label: $t('search.sections.product') },
{ name: 'solution', label: $t('search.sections.solution') },
{ name: 'question', label: $t('search.sections.faq') },
{ name: 'document', label: $t('search.sections.document') },
];
const resultCount = computed(() => {
const map: Record<string, number> = { all: props.searchItems.length };
for (const item of props.searchItems) {
map[item.sectionType] = (map[item.sectionType] ?? 0) + 1;
}
return map;
});
// 分类控制
const activeTab = ref('all');
// 分页控制
const currentPage = ref(1);
watch(activeTab, () => {
currentPage.value = 1; // 重置页码
});
</script>
<style scoped>
.el-tabs {
width: 100%;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<article class="solution-defail">
<header class="solution-header">
<h1 class="solution-title">{{ solution.title }}</h1>
<p class="solution-summary">{{ solution.summary }}</p>
</header>
<section class="solution-content">
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="html-typography" v-html="solution?.content || ''" />
<!-- <div v-if="!hydrated" v-html="solution?.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer class="html-typography" :html="solution.content || ''" /> -->
<!-- </div> -->
</section>
</article>
</template>
<script setup lang="ts">
defineProps({
solution: {
type: Object as PropType<SolutionView>,
default: null,
},
});
const hydrated = ref(false);
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>
.solution-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
text-align: center;
}
.solution-meta {
display: flex;
justify-content: center;
gap: 1rem;
margin-bottom: 0.5rem;
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.solution-summary {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
text-align: center;
}
.solution-content {
margin-top: 1rem;
}
</style>

View File

@ -0,0 +1,113 @@
<template>
<div class="document-category">
<el-row :gutter="12">
<el-col :span="12" :xs="12">
<span class="select-label">{{
$t('product-filter.product-type')
}}</span>
<el-select
v-model="model.selectedProductType"
:placeholder="$t('product-filter.select-product-type')"
clearable
>
<el-option
v-for="type in productTypeOptions"
:key="type.id"
:label="type.name"
:value="type.id"
/>
</el-select>
</el-col>
<el-col :span="12" :xs="12">
<span class="select-label">{{
$t('product-filter.product-model')
}}</span>
<el-select
v-model="model.selectedProduct"
:placeholder="$t('product-filter.select-product-model')"
clearable
>
<el-option
v-for="product in productOptions"
:key="product.id"
:label="product.name"
:value="product.id"
/>
</el-select>
</el-col>
<el-col :span="12" :xs="24">
<span class="select-label">
{{ $t('product-filter.document-type') }}
</span>
<el-select
v-model="model.selectedDocumentType"
:placeholder="$t('product-filter.select-document-type')"
clearable
>
<el-option
v-for="questionType in documentTypeOptions"
:key="questionType.id"
:label="questionType.name"
:value="questionType.id"
/>
</el-select>
</el-col>
<el-col :span="12" :xs="24">
<span class="select-label">{{ $t('product-filter.keyword') }}</span>
<el-input
v-model="model.keyword"
:placeholder="$t('product-filter.enter-keyword')"
clearable
:prefix-icon="Search"
/>
</el-col>
</el-row>
</div>
</template>
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue';
defineProps({
productTypeOptions: {
type: Array as () => Array<DocumentListProductType>,
default: () => [],
},
productOptions: {
type: Array as () => Array<DocumentListProduct>,
default: () => [],
},
documentTypeOptions: {
type: Array as () => Array<DocumentTypeView>,
default: () => [],
},
});
const model = defineModel<{
selectedProduct: string | null;
selectedProductType: string | null;
selectedDocumentType: string | null;
keyword: string;
}>();
</script>
<style scoped>
.document-category {
margin-bottom: 1rem;
padding: 0 0;
}
.select-label {
color: var(--el-text-color-secondary);
font-size: 0.9rem;
}
:deep(.el-select__wrapper),
:deep(.el-input__wrapper) {
height: 40px;
font-size: 0.9rem;
}
</style>

View File

@ -0,0 +1,112 @@
<template>
<div class="question-category">
<el-row :gutter="12">
<el-col :span="12" :xs="12">
<span class="select-label">{{
$t('product-filter.product-type')
}}</span>
<el-select
v-model="model.selectedProductType"
:placeholder="$t('product-filter.select-product-type')"
clearable
>
<el-option
v-for="type in productTypeOptions"
:key="type.id"
:label="type.name"
:value="type.id"
/>
</el-select>
</el-col>
<el-col :span="12" :xs="12">
<span class="select-label">{{
$t('product-filter.product-model')
}}</span>
<el-select
v-model="model.selectedProduct"
:placeholder="$t('product-filter.select-product-model')"
clearable
>
<el-option
v-for="product in productOptions"
:key="product.id"
:label="product.name"
:value="product.id"
/>
</el-select>
</el-col>
<el-col :span="12" :xs="24">
<span class="select-label">
{{ $t('product-filter.question-type') }}
</span>
<el-select
v-model="model.selectedQuestionType"
:placeholder="$t('product-filter.select-question-type')"
clearable
>
<el-option
v-for="questionType in questionTypeOptions"
:key="questionType.id"
:label="questionType.name"
:value="questionType.id"
/>
</el-select>
</el-col>
<el-col :span="12" :xs="24">
<span class="select-label">{{ $t('product-filter.keyword') }}</span>
<el-input
v-model="model.keyword"
:placeholder="$t('product-filter.enter-keyword')"
clearable
:prefix-icon="Search"
/>
</el-col>
</el-row>
</div>
</template>
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue';
defineProps({
productTypeOptions: {
type: Array as () => Array<QuestionListProductType>,
default: () => [],
},
productOptions: {
type: Array as () => Array<QuestionListProduct>,
default: () => [],
},
questionTypeOptions: {
type: Array as () => Array<QuestionTypeView>,
default: () => [],
},
});
const model = defineModel<{
selectedProduct: string | null;
selectedProductType: string | null;
selectedQuestionType: string | null;
keyword: string;
}>();
</script>
<style scoped>
.question-category {
margin-bottom: 1rem;
}
.select-label {
color: var(--el-text-color-secondary);
font-size: 0.9rem;
}
:deep(.el-select__wrapper),
:deep(.el-input__wrapper) {
height: 40px;
font-size: 0.9rem;
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<el-card class="support-card">
<el-row>
<el-col :span="6">
<el-icon class="card-icon" size="80">
<component :is="iconComponent" />
</el-icon>
</el-col>
<el-col :span="18">
<div class="card-title">
<span>{{ title }}</span>
</div>
</el-col>
</el-row>
<el-row>
<div class="card-content">
<p>{{ description }}</p>
</div>
</el-row>
<el-row>
<NuxtLink class="card-link" :to="to">
<el-button class="card-button" round>
<span>{{ $t('learn-more') }} > </span>
</el-button>
</NuxtLink>
</el-row>
</el-card>
</template>
<script setup lang="ts">
defineProps({
title: {
type: String,
default: '',
},
description: {
type: String,
default: '',
},
to: {
type: String,
default: '',
},
iconComponent: {
type: Object,
default: null,
},
});
</script>
<style scoped>
.support-card {
width: 100%;
padding: 20px;
box-shadow: none;
border-radius: none;
}
.card-icon {
color: var(--el-color-primary);
}
.card-title {
display: flex;
height: 100%;
align-items: center;
margin-left: 2rem;
font-size: 1.5rem;
font-weight: bold;
color: var(--el-color-primary);
}
.card-link {
margin-left: auto;
}
.card-button {
cursor: pointer;
text-align: center;
font-size: 1rem;
color: var(--el-color-primary);
transition: all 0.3s ease;
}
.el-row {
margin-bottom: 20px;
}
.el-row:last-child {
margin-bottom: 0;
}
.el-col {
border-radius: 4px;
}
</style>

View File

@ -0,0 +1,64 @@
<template>
<div class="page-tab">
<el-segmented
v-model="activeTab"
class="segmented"
:options="options"
block
size="large"
@change="handleSegmentedChange"
/>
</div>
</template>
<script setup lang="ts">
const props = defineProps({
modelValue: {
type: String,
default: '',
},
});
const activeTab = ref(props.modelValue || '');
const options = [
{ label: $t('navigation.support'), value: '' },
{ label: $t('navigation.faq'), value: 'faq' },
{ label: $t('navigation.documents'), value: 'documents' },
{ label: $t('navigation.contact-info'), value: 'contact-us' },
];
const handleSegmentedChange = (value: string) => {
const localePath = useLocalePath();
navigateTo(localePath(`/support/${value}`));
};
</script>
<style scoped>
.segmented {
--el-segmented-bg-color: transparent;
--el-segmented-item-active-color: var(--el-color-primary);
--el-segmented-item-color: var(--el-text-color-secondary);
--el-segmented-item-hover-color: var(--el-color-primary);
--el-segmented-item-border-color: transparent;
--el-segmented-item-active-border-color: transparent;
border-bottom: 1px solid var(--el-border-color-light);
}
.segmented :deep(.el-segmented__item-selected) {
/* --el-border-radius-base: 16px; */
transition: none;
background: transparent;
}
.segmented :deep(.el-segmented__item) {
&:hover {
background: transparent;
color: var(--el-color-primary);
}
&.is-selected {
color: var(--el-color-primary-dark-2);
border-bottom: 4px solid var(--el-color-primary-dark-2);
}
}
</style>

View File

@ -0,0 +1,21 @@
<template>
<el-breadcrumb separator="/">
<el-breadcrumb-item
v-for="(item, index) in items"
:key="index"
class="text-md opacity-50"
>
<NuxtLink v-if="item.to" :to="item.to">{{ item.label }}</NuxtLink>
<span v-else>{{ item.label }}</span>
</el-breadcrumb-item>
</el-breadcrumb>
</template>
<script setup lang="ts">
defineProps({
items: {
type: Array as () => Array<{ label: string; to?: string }>,
required: true,
},
});
</script>

View File

@ -0,0 +1,98 @@
<template>
<div class="document-list">
<el-card
v-for="(doc, index) in documents"
:key="index"
class="document-card"
@click="handleClick(doc.fileId)"
>
<div class="document-info">
<div class="document-title">
<h3>
{{ doc.title }}
<span v-if="showCategory && doc.type" class="document-category">
|
</span>
<span v-if="showCategory && doc.type" class="document-category">
{{ doc.type.name }}
</span>
</h3>
</div>
<div class="document-content">
<span v-if="doc.size" class="document-meta"
>{{ $t('document-meta.size') }}: {{ formatFileSize(doc.size) }}
</span>
<span v-if="doc.filename" class="document-meta"
>{{ $t('document-meta.format') }}:
{{ formatFileExtension(getFileExtension(doc.filename)) }}</span
>
</div>
</div>
</el-card>
</div>
</template>
<script setup lang="ts">
defineProps({
documents: {
type: Array as () => Array<ProductDocumentView>,
default: () => [],
},
showCategory: {
type: Boolean,
default: true,
},
});
const localePath = useLocalePath();
const handleClick = (id: string) => {
// 获取路由参数
if (id) {
navigateTo(localePath(`/download/${id}`));
}
};
</script>
<style scoped>
.document-list {
display: flex;
flex-direction: column;
gap: 1rem;
width: 100%;
}
.document-card {
cursor: pointer;
transition: all 0.3s ease;
}
.document-card:hover {
transform: translateY(-1px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.document-meta {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.document-title {
margin-bottom: 0.5rem;
}
.document-category {
font-size: 0.75rem;
color: var(--el-text-color-secondary);
}
.download-button {
margin-left: auto;
}
.document-content {
display: flex;
align-items: center;
gap: 1rem;
}
</style>

View File

@ -0,0 +1,179 @@
<template>
<section class="h-screen flex flex-col">
<!-- 头部工具栏 -->
<header
v-if="showToolbar && fileMeta"
class="p-3 border-b flex items-center justify-between"
>
<div class="min-w-0">
<h2 class="truncate font-medium" :title="fileMeta.filename_download">
{{ fileMeta.filename_download }}
</h2>
<p class="text-xs text-gray-500">
{{ fileMeta.type }} · {{ formatedSize }} · {{ formatedDate }}
</p>
</div>
<div class="shrink-0 flex items-center gap-2">
<button
class="px-3 py-1.5 rounded border hover:bg-gray-50"
type="button"
:disabled="!fileMeta"
@click="openInNewTab"
>
{{ $t('document-action.open-in-new-tab') }}
</button>
<button
class="px-3 py-1.5 rounded bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50"
type="button"
:disabled="!fileMeta"
@click="download"
>
{{ $t('document-action.download') }}
</button>
</div>
</header>
<div class="flex-1 overflow-hidden">
<!-- 加载状态 -->
<div v-if="pending" class="h-48 grid place-items-center border rounded">
{{ $t('loading') }}
</div>
<div
v-else-if="errorText"
class="h-48 grid place-items-center border rounded text-red-600"
>
{{ errorText }}
</div>
<!-- 文件预览 -->
<ClientOnly v-else>
<div
v-if="fileMeta && previewable"
class="h-full w-full flex justify-center bg-gray-50"
>
<!-- 图片 -->
<el-image
v-if="isImage"
fit="contain"
class="max-w-full max-h-full select-none"
:src="src"
:alt="fileMeta.title || fileMeta.filename_download"
/>
<!-- PDF -->
<iframe
v-else-if="isPdf"
:src="src"
title="PDF 预览"
class="w-full h-full border-0"
/>
<!-- 视频 -->
<video
v-else-if="isVideo"
:src="src"
controls
class="w-full bg-black"
/>
<!-- 文本简单方式用 iframe如需代码高亮可改为拉取文本并渲染 <pre> -->
<iframe
v-else-if="isText"
:src="src"
title="文本预览"
class="w-full h-full border-0"
/>
</div>
</ClientOnly>
</div>
</section>
</template>
<script setup lang="ts">
const props = withDefaults(
defineProps<{
/** 预览的文件 ID */
fileId?: string;
file?: FileMeta;
/** 是否显示上方工具栏(文件名、大小、按钮) */
showToolbar?: boolean;
/** 下载 API 基础路径(你的后端流接口),用于“下载”按钮 */
downloadApiBase?: string;
/** 追加到 file.url 的查询(如临时 token形如 { token: 'xxx' } */
extraQuery?: Record<string, string | number | boolean>;
}>(),
{
fileId: undefined,
file: undefined,
showToolbar: true,
downloadApiBase: '/api/download',
extraQuery: undefined,
}
);
const { data, pending, error } = await useFetch<FileMeta>(
() => (props.file ? null : `/api/file/${props.fileId}`),
{ server: true }
);
const errorText = computed(() => error.value?.message ?? null);
const fileMeta = computed(() => props.file ?? data.value ?? null);
logger.debug('FilePreviewer - fileMeta:', fileMeta.value);
/** 预览源地址:支持在 file.url 上追加额外 query如临时 token、inline */
const src = computed<string>(() => {
if (!fileMeta.value) return '';
const url = new URL(fileMeta.value.url, window?.location?.origin);
if (props.extraQuery) {
Object.entries(props.extraQuery).forEach(([k, v]) =>
url.searchParams.set(k, String(v))
);
}
return url.toString();
});
/** 类型判定 */
const isImage = computed(
() => fileMeta.value?.type.startsWith('image/') === true
);
const isPdf = computed(() => fileMeta.value?.type === 'application/pdf');
const isVideo = computed(
() => fileMeta.value?.type.startsWith('video/') === true
);
const isText = computed(
() => fileMeta.value?.type.startsWith('text/') === true
);
const previewable = computed(() => fileMeta.value?.previewable === true);
const formatedSize = computed(() => {
const size = fileMeta.value?.filesize ?? 0;
return formatFileSize(size);
});
const formatedDate = computed(() => {
if (!fileMeta.value?.uploaded_on) return '';
return new Date(fileMeta.value.uploaded_on).toLocaleDateString();
});
/** 下载动作:走你自己的流式后端,避免直链暴露(便于权限与统计) */
function download(): void {
if (!fileMeta.value) return;
const id = fileMeta.value.id;
const a = document.createElement('a');
a.href = `${props.downloadApiBase}/${encodeURIComponent(id)}`;
a.download = fileMeta.value.filename_download;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
/** 新标签打开(直接访问直链,适合预览失败时的兜底体验) */
function openInNewTab(): void {
if (!src.value) return;
window.open(src.value, '_blank', 'noopener,noreferrer');
}
</script>

View File

@ -0,0 +1,30 @@
export default defineComponent({
name: 'HtmlRenderer',
props: {
html: {
type: String,
required: true,
},
map: {
type: Object as () => HtmlRenderMap,
default: () => defaultHtmlRenderMap,
},
allowUnknown: {
type: Boolean,
default: true,
},
},
setup(props, { attrs }) {
const nodes: VNode[] = useHtmlRenderer(props.html, {
map: props.map,
allowUnknownTags: props.allowUnknown,
});
logger.debug('nodes: ', nodes);
// 渲染函数:直接返回 VNode 数组
return () => h('div', { ...attrs }, nodes);
},
});

View File

@ -0,0 +1,289 @@
<template>
<footer class="jinshen-footer">
<div class="footer-container hide-on-mobile">
<!-- Logo 和公司信息 -->
<div class="footer-section">
<div class="footer-logo">
<img src="/jinshen-logo.png" alt="Jinshen Logo" class="logo-image" />
<h3>{{ $t('company-name') }}</h3>
</div>
<p class="company-description">
{{ $t('company-description') }}
</p>
</div>
<!-- 快速链接 -->
<div class="footer-section">
<h4>{{ $t('quick-links') }}</h4>
<ul class="footer-links">
<li>
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
</li>
<li>
<NuxtLink :to="$localePath('/products')">{{
$t('navigation.products')
}}</NuxtLink>
</li>
<li>
<NuxtLink :to="$localePath('/solutions')">{{
$t('navigation.solutions')
}}</NuxtLink>
</li>
<li>
<NuxtLink :to="$localePath('/support')">{{
$t('navigation.support')
}}</NuxtLink>
</li>
<li>
<NuxtLink :to="$localePath('/about')">{{
$t('navigation.about-us')
}}</NuxtLink>
</li>
</ul>
</div>
<!-- 实用工具 -->
<div class="footer-section">
<h4>{{ $t('utilities') }}</h4>
<ul class="footer-links">
<li>
<a
href="http://cal.jinshen.cn"
target="_blank"
rel="noopener noreferer"
>
{{ $t('navigation.calculator') }}
</a>
</li>
</ul>
</div>
<!-- 联系信息 -->
<div class="footer-section">
<h4>{{ $t('contact-info') }}</h4>
<div class="contact-item">
<el-icon><Phone /></el-icon>
<span>{{ $t('telephone') }}: 0573-88187988</span>
</div>
<div class="contact-item">
<el-icon><Message /></el-icon>
<span>{{ $t('email') }}: jinshen@wzjinshen.com</span>
</div>
<div class="contact-item">
<el-icon><Location /></el-icon>
<span>{{ $t('address') }}: {{ $t('company-address') }}</span>
</div>
</div>
</div>
<!-- 版权信息 -->
<div class="footer-bottom">
<div class="footer-container">
<div class="copyright">
<p>
&copy; {{ currentYear }} {{ $t('company-name') }}.
{{ $t('all-rights-reserved') }}
</p>
<p>
备案号:
<a href="https://beian.miit.gov.cn/" target="_blank"
>浙ICP备12003709号-5</a
>
</p>
</div>
<!-- <div class="footer-links-bottom"> -->
<!-- <NuxtLink :to="$localePath('/privacy')">{{ -->
<!-- $t('privacy-policy') -->
<!-- }}</NuxtLink> -->
<!-- <span class="separator">|</span> -->
<!-- <NuxtLink :to="$localePath('/terms')">{{ -->
<!-- $t('terms-of-service') -->
<!-- }}</NuxtLink> -->
<!-- <span class="separator">|</span> -->
<!-- <NuxtLink :to="$localePath('/sitemap')">{{ $t('sitemap') }}</NuxtLink> -->
<!-- </div> -->
</div>
</div>
</footer>
</template>
<script setup lang="ts">
import { Phone, Message, Location } from '@element-plus/icons-vue';
const currentYear = new Date().getFullYear();
</script>
<style scoped>
.jinshen-footer {
background: var(--el-bg-color-page);
border-top: 1px solid var(--el-border-color);
margin-top: auto;
}
.footer-container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem 1rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
}
.footer-section h3,
.footer-section h4 {
color: var(--el-text-color-primary);
margin-bottom: 1rem;
font-weight: 600;
}
.footer-logo {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1rem;
}
.logo-image {
width: 40px;
height: 40px;
object-fit: contain;
}
.company-description {
color: var(--el-text-color-regular);
line-height: 1.6;
margin: 0;
}
.footer-links {
list-style: none;
padding: 0;
margin: 0;
}
.footer-links li {
margin-bottom: 0.5rem;
}
.footer-links a {
color: var(--el-text-color-regular);
text-decoration: none;
transition: color 0.3s ease;
}
.footer-links a:hover {
color: var(--el-color-primary);
}
.contact-item {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
color: var(--el-text-color-regular);
}
.contact-item .el-icon {
color: var(--el-color-primary);
}
.social-links {
display: flex;
gap: 1rem;
}
.social-link {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: var(--el-fill-color-light);
border-radius: 50%;
color: var(--el-text-color-regular);
text-decoration: none;
transition: all 0.3s ease;
}
.social-link:hover {
background: var(--el-color-primary);
color: white;
transform: translateY(-2px);
}
.footer-bottom {
background: var(--el-fill-color-light);
border-top: 1px solid var(--el-border-color-lighter);
padding: 1rem 0;
}
.footer-bottom .footer-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 1rem;
grid-template-columns: none;
gap: 1rem;
}
.copyright p {
margin: 0;
color: var(--el-text-color-regular);
font-size: 0.875rem;
}
.footer-links-bottom {
display: flex;
align-items: center;
gap: 0.5rem;
}
.footer-links-bottom a {
color: var(--el-text-color-regular);
text-decoration: none;
font-size: 0.875rem;
transition: color 0.3s ease;
}
.footer-links-bottom a:hover {
color: var(--el-color-primary);
}
.separator {
color: var(--el-text-color-placeholder);
}
/* 响应式设计 */
@media (max-width: 768px) {
.hide-on-mobile {
display: none;
}
.footer-container {
grid-template-columns: 1fr;
padding: 1.5rem 1rem;
}
.footer-bottom .footer-container {
flex-direction: column;
text-align: center;
gap: 1rem;
}
.footer-links-bottom {
flex-wrap: wrap;
justify-content: center;
}
}
/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
.jinshen-footer {
background: var(--el-bg-color-page);
}
.footer-bottom {
background: var(--el-fill-color-darker);
}
}
</style>

View File

@ -0,0 +1,350 @@
<template>
<header class="header-container">
<!-- Logo -->
<div class="logo-section">
<NuxtLink :to="$localePath('/')" class="logo-link">
<el-image
class="website-logo"
src="/jinshen-logo.png"
alt="Jinshen Logo"
fit="contain"
/>
</NuxtLink>
</div>
<!-- 桌面菜单 -->
<div class="header-menu-section">
<!-- 导航菜单 -->
<el-menu
:default-active="activeName"
class="header-menu"
mode="horizontal"
:ellipsis="false"
:persistent="false"
router
>
<el-menu-item index="products" :route="$localePath('/products')">
<span class="title">{{ $t('navigation.products') }}</span>
</el-menu-item>
<el-menu-item index="solutions" :route="$localePath('/solutions')">
<span class="title">{{ $t('navigation.solutions') }}</span>
</el-menu-item>
<el-menu-item index="support" :route="$localePath('/support')">
<span class="title">{{ $t('navigation.support') }}</span>
</el-menu-item>
<el-menu-item index="about" :route="$localePath('/about')">
<span class="title">{{ $t('navigation.about-us') }}</span>
</el-menu-item>
</el-menu>
</div>
<!-- 右侧功能区 -->
<div class="header-actions">
<el-link
class="search-link"
:underline="false"
type="info"
@click="navigateTo(localePath('/search'))"
>
<el-icon class="mdi mdi-magnify action-icon" />
</el-link>
<el-link
class="hide-on-mobile"
type="info"
:underline="false"
href="http://cal.jinshen.cn"
target="_blank"
>
<el-icon class="mdi mdi-calculator action-icon" />
</el-link>
<el-dropdown class="hide-on-mobile" @command="setLocale">
<el-link type="info" :underline="false">
<el-icon class="mdi mdi-translate action-icon" />
</el-link>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="zh">简体中文</el-dropdown-item>
<el-dropdown-item command="en">English</el-dropdown-item>
<el-dropdown-item command="es"
>Español(Machine Translate)</el-dropdown-item
>
<el-dropdown-item command="ru"
>Русский(Machine Translate)</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
<!-- 汉堡按钮仅移动端显示 -->
<el-link type="info" :underline="false">
<el-icon
class="mdi mdi-menu mobile-menu-button"
@click="mobileMenuVisible = true"
/>
</el-link>
<!-- Drawer 抽屉菜单 -->
<client-only>
<el-drawer
v-model="mobileMenuVisible"
class="mobile-drawer"
direction="rtl"
size="70%"
>
<template #header>
<div class="drawer-header">
<h1>{{ $t('mobile-menu.title') }}</h1>
</div>
</template>
<div>
<h2>{{ $t('mobile-menu.navigation') }}</h2>
<el-menu
:default-active="activeName"
class="mobile-menu"
mode="vertical"
router
@select="mobileMenuVisible = false"
>
<el-menu-item index="products" :route="$localePath('/products')">
{{ $t('navigation.products') }}
</el-menu-item>
<el-menu-item
index="solutions"
:route="$localePath('/solutions')"
>
{{ $t('navigation.solutions') }}
</el-menu-item>
<el-menu-item index="support" :route="$localePath('/support')">
{{ $t('navigation.support') }}
</el-menu-item>
<el-menu-item index="about" :route="$localePath('/about')">
{{ $t('navigation.about-us') }}
</el-menu-item>
</el-menu>
<h2>{{ $t('mobile-menu.utilities') }}</h2>
<el-menu
:default-active="activeName"
class="mobile-menu"
mode="vertical"
@select="mobileMenuVisible = false"
>
<el-menu-item @click="openExternalLink('http://cal.jinshen.cn')">
{{ $t('navigation.calculator') }}
</el-menu-item>
</el-menu>
</div>
<template #footer>
<el-dropdown @command="setLocale">
<el-link type="info" :underline="false">
<el-icon class="mdi mdi-translate mobile-menu-button" />
</el-link>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="zh">简体中文</el-dropdown-item>
<el-dropdown-item command="en">English</el-dropdown-item>
<el-dropdown-item command="es"
>Español(Machine Translate)</el-dropdown-item
>
<el-dropdown-item command="ru"
>Русский(Machine Translate)</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-drawer>
</client-only>
</div>
</header>
</template>
<script setup lang="ts">
const router = useRouter();
const localePath = useLocalePath();
const { setLocale } = useI18n();
const activeName = ref<string | undefined>(undefined);
const mobileMenuVisible = ref(false);
const refreshMenu = () => {
const path = router.currentRoute.value.path;
if (path.startsWith('/products')) {
activeName.value = 'products';
} else if (path.startsWith('/solutions')) {
activeName.value = 'solutions';
} else if (path.startsWith('/support')) {
activeName.value = 'support';
} else if (path.startsWith('/about')) {
activeName.value = 'about';
} else {
activeName.value = undefined; // 默认不激活任何菜单项
}
};
const openExternalLink = (url: string) => {
window.open(url, '_blank');
};
onMounted(() => {
refreshMenu();
// 监听路由变化以更新激活状态
router.afterEach(() => {
refreshMenu();
});
});
</script>
<style scoped>
.header-container {
display: flex;
align-items: center;
height: 80px;
padding: 0 20px;
border-bottom: 1px solid #e0e0e0;
}
.logo-section {
display: flex;
flex: 1;
margin-left: 20px;
}
.logo-link {
display: flex;
align-items: center;
text-decoration: none;
}
.website-logo {
height: 64px;
width: auto;
}
.header-menu-section {
flex: 2;
display: flex;
justify-content: center;
height: 100%;
}
.header-menu {
margin-right: 40px;
border-bottom: none !important;
width: auto;
--el-menu-horizontal-height: 100%;
}
.header-menu .el-menu-item {
font-size: 16px;
background-color: transparent !important;
}
.header-menu .el-menu-item.is-active {
border-bottom: 2.5px solid var(--el-color-primary-dark-2);
color: var(--el-color-primary);
}
.header-menu .el-menu-item:hover {
border-bottom: 2.5px solid var(--el-color-primary);
}
.header-actions {
flex: 1;
justify-content: flex-end;
display: flex;
gap: 16px;
}
.action-icon {
font-size: 24px;
}
.mobile-menu-button {
display: none; /* 默认隐藏汉堡按钮 */
}
.drawer-header {
display: flex;
align-items: center;
justify-content: center;
}
:deep(.el-drawer__header) {
margin-bottom: 0;
}
:deep(.el-drawer__body) {
padding: 20px;
}
.mobile-drawer h1 {
font-size: 24px;
font-weight: bold;
}
.mobile-drawer h2 {
font-size: 20px;
margin-bottom: 16px;
font-weight: bold;
}
.mobile-menu {
border: none;
margin-bottom: 24px;
}
.mobile-menu .el-menu-item {
font-size: 16px;
background-color: transparent !important;
}
.mobile-menu .el-menu-item.is-active {
color: var(--el-color-primary);
}
.mobile-menu .el-menu-item:hover {
color: var(--el-color-primary);
}
@media (max-width: 1024px) {
.header-container {
height: 70px;
padding: 0 16px;
}
.website-logo {
height: 48px;
}
.header-menu-section .header-menu .el-menu-item {
font-size: 14px;
}
}
@media (max-width: 768px) {
.header-menu-section {
display: none; /* 隐藏横向菜单 */
}
.hide-on-mobile {
display: none; /* 隐藏部分图标 */
}
.header-actions {
gap: 12px;
}
.mobile-menu-button {
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
}
}
</style>

View File

@ -0,0 +1,104 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<!-- v-html 渲染解析后的 HTML -->
<div ref="container" class="markdown-body" v-html="safeHtml" />
</template>
<script setup lang="ts">
import { createApp } from 'vue';
import MarkdownTable from './MarkdownTable.vue';
interface Props {
content: string;
}
const props = defineProps<Props>();
// 将 Markdown 转换成 HTML
const safeHtml = computed(() => renderMarkdown(props.content));
const container = ref<HTMLElement | null>(null);
onMounted(async () => {
await nextTick();
if (!safeHtml.value) return;
// 查找所有 table
const tables = container.value.querySelectorAll('table');
tables.forEach((table) => {
// 1. 提取表头
const headers = Array.from(table.querySelectorAll('thead th')).map(
(th) => th.textContent?.trim() ?? ''
);
// 2. 提取行数据
const rows = Array.from(table.querySelectorAll('tbody tr')).map((tr) => {
const cells = Array.from(tr.querySelectorAll('td')).map(
(td) => td.textContent?.trim() ?? ''
);
const obj: Record<string, string> = {};
headers.forEach((h, i) => {
obj[h] = cells[i];
});
return obj;
});
// 3. 创建 Vue 子应用,把原生 table 替换成 <md-table>
const mountPoint = document.createElement('div');
table.replaceWith(mountPoint);
const app = createApp(MarkdownTable, { headers, rows });
app.mount(mountPoint);
});
});
</script>
<style>
.markdown-body {
padding: 10px;
line-height: 1.6;
}
.markdown-body h1 {
color: var(--el-color-primary);
font-size: 1.5em;
margin-bottom: 0.5em;
text-align: center;
}
.markdown-body h2 {
color: var(--el-color-primary);
font-size: 1.5em;
margin-bottom: 0.5em;
}
.markdown-body h3 {
color: var(--el-color-primary);
font-size: 1.2em;
margin-bottom: 0.5em;
}
.markdown-body p {
text-indent: 2em;
text-align: justify;
margin: 0.5em 0;
margin-bottom: 1em;
}
.markdown-body ol {
list-style-type: decimal;
padding-left: 2em;
margin-bottom: 1em;
}
.markdown-body ul {
list-style-type: disc;
padding-left: 2em;
margin-bottom: 1em;
}
.markdown-body hr {
border: none;
border-top: 1px solid var(--el-border-color);
margin: 20px 0;
}
</style>

View File

@ -0,0 +1,12 @@
<template>
<el-table :data="rows" border>
<el-table-column v-for="h in headers" :key="h" :prop="h" :label="h" />
</el-table>
</template>
<script setup lang="ts">
defineProps<{
headers: string[];
rows: Record<string, string>[];
}>();
</script>

View File

@ -0,0 +1,33 @@
<template>
<el-result icon="warning" :title="title" :sub-title="subTitle">
<template #extra>
<el-button type="primary" @click="onBack">
{{ backText || $t('back') }}
</el-button>
</template>
</el-result>
</template>
<script setup lang="ts">
defineProps({
title: {
type: String,
required: true,
},
subTitle: {
type: String,
required: false,
default: '',
},
backText: {
type: String,
required: false,
default: '',
},
onBack: {
type: Function as () => unknown,
required: false,
default: undefined,
},
});
</script>

View File

@ -0,0 +1,87 @@
<template>
<el-card class="product-card" @click="handleClick">
<template #header>
<!-- Image -->
<el-image class="product-image" :src="imageUrl" fit="contain" />
</template>
<div class="card-body">
<!-- Name -->
<div class="text-center">
<span class="product-name">{{ name }}</span>
</div>
<!-- Description -->
<div class="card-description text-left opacity-25">{{ description }}</div>
</div>
</el-card>
</template>
<script setup lang="ts">
interface Props {
name: string;
description: string;
imageUrl: string;
id?: string | number;
slug?: string;
}
const props = defineProps<Props>();
const localePath = useLocalePath();
const handleClick = () => {
// 优先使用 slug如果没有则使用 id
const routeParam = props.slug || props.id;
if (routeParam) {
navigateTo(localePath(`/products/${routeParam}`));
}
};
</script>
<style scoped>
.product-card {
width: 30%;
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
}
.product-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.product-name {
font-size: 1rem;
font-weight: 600;
}
.card-description {
font-size: 0.8rem;
margin-top: 5px;
}
.product-card .el-image {
width: 100%;
aspect-ratio: 16 / 10;
border-radius: 4px;
}
.card-body {
margin: 10px auto;
padding: 0px auto;
height: 100px;
}
/* 响应式设计 */
@media (max-width: 1200px) {
.product-card {
width: 45%;
}
}
@media (max-width: 768px) {
.product-card {
width: 90%;
}
}
</style>

View File

@ -0,0 +1,112 @@
<template>
<div class="question-list">
<el-collapse v-model="activeNames" class="question-collapse">
<el-collapse-item
v-for="question in questions"
:id="`q-${question.id}`"
:key="question.id"
:title="question.title"
:name="question.id"
>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="html-typography" v-html="question.content || ''" />
<!-- <div v-if="!hydrated" v-html="question.content" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="question.content || ''" -->
<!-- /> -->
<!-- </div> -->
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
const props = defineProps({
questions: {
type: Array as PropType<ProductQuestionView[]>,
default: () => [],
},
});
const route = useRoute();
const activeNames = ref<(string | number)[]>([]);
const hydrated = ref(false);
// 当路由变化(包括初次挂载)时,检查是否需要聚焦
watch(
() => route.query.focus,
async (focusId) => {
if (!focusId) return;
if (!import.meta.client) return;
// 确保渲染完成后再操作 DOM
await nextTick();
const target = props.questions.find((q) => q.id === focusId);
if (!target) return;
// 展开目标项
activeNames.value = [target.id];
await nextTick();
await new Promise((resolve) => setTimeout(resolve, 100)); // 等待动画完成
// 平滑滚动到对应位置
// const el = document.querySelector(`#q-${target.id}`);
// el?.scrollIntoView({ behavior: 'smooth', block: 'start' });
setTimeout(() => {
const el = document.querySelector(`#q-${target.id}`);
el?.scrollIntoView({
behavior: 'smooth',
block: 'start',
});
}, 200); // 与 el-collapse 的 transition 时间匹配
},
{ immediate: true }
);
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>
.question-list {
width: 100%;
}
.question-collapse {
border: none;
}
.question-collapse :deep(.el-collapse-item) {
margin-bottom: 1rem;
border-radius: 8px;
}
.question-collapse :deep(.el-collapse-item__header) {
font-size: 1rem;
padding: 1rem;
border-radius: 8px;
background-color: #f5f7fa;
transition: all 0.3s ease;
&.is-active {
background-color: #e1e6eb;
color: var(--el-color-primary);
}
}
.question-collapse :deep(.el-collapse-item__wrap) {
border: none;
}
.question-collapse :deep(.el-collapse-item__content) {
padding: 1rem;
font-size: 0.9rem;
}
</style>

View File

@ -0,0 +1,86 @@
<template>
<el-card
class="solution-card"
body-class="card-body"
header-class="card-header"
@click="handleClick"
>
<template #header>
<!-- Cover Image -->
<el-image class="solution-cover" :src="coverUrl" fit="cover" />
</template>
<!-- Title -->
<template #default>
<div class="text-center mx-auto text-md">
<span class="solution-title">{{ title }}</span>
</div>
<!-- Summary -->
<div class="mx-auto mt-5 text-left text-sm opacity-25">{{ summary }}</div>
</template>
</el-card>
</template>
<script setup lang="ts">
interface Props {
title: string;
summary: string;
coverUrl: string;
documentId?: string;
}
const props = defineProps<Props>();
const localePath = useLocalePath();
const handleClick = () => {
const routeParam = props.documentId;
if (routeParam) {
navigateTo(localePath(`/solutions/${routeParam}`));
}
};
</script>
<style scoped>
.solution-card {
width: 30%;
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
}
.solution-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.solution-title {
font-weight: 600;
}
:deep(.card-header) {
padding: 0;
border-bottom: none !important;
}
:deep(.card-body) {
margin: 10px auto;
padding: 1px auto;
}
.solution-card .el-image {
width: 100%;
aspect-ratio: 16 / 10;
}
@media (max-width: 1200px) {
.solution-card {
width: 45%;
}
}
@media (max-width: 768px) {
.solution-card {
width: 90%;
margin: 10px auto;
}
}
</style>

View File

@ -0,0 +1,11 @@
export * from './useDirectusImage';
export * from './useDirectusFiles';
export * from './useProductList';
export * from './useProduct';
export * from './useSolutionList';
export * from './useSolution';
export * from './useQuestionList';
export * from './useDocumentList';
export * from './useContactInfo';
export * from './useCompanyProfile';
export * from './useHomepage';

View File

@ -0,0 +1,17 @@
export const useCompanyProfile = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`company-profile-${locale}`, async () => {
try {
const data = await $fetch(`/api/cms/companyProfile`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching company profile: ', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useContactInfo = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`contact-info-${locale}`, async () => {
try {
const data = await $fetch('/api/cms/contactInfo', {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching contact info: ', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useDirectusFiles = () => {
const getFileUrl = (
id?: string | null,
options?: Record<string, string | number | boolean>
): string => {
if (!id) return '';
const params = new URLSearchParams(
options as Record<string, string>
).toString();
return `/api/assets/${id}${params ? `?${params}` : ''}`;
};
return {
getFileUrl,
};
};

View File

@ -0,0 +1,20 @@
export const useDirectusImage = () => {
type DirectusAssetParams = {
width?: number;
height?: number;
fit?: 'cover' | 'contain' | 'inside' | 'outside';
quality?: number;
format?: 'webp' | 'jpg' | 'png' | 'auto';
} & Record<string, string | number | boolean>;
const getImageUrl = (id?: string | null, options?: DirectusAssetParams) => {
if (!id) return '';
const params = new URLSearchParams(
options as Record<string, string>
).toString();
return `/api/assets/${id}${params ? `?${params}` : ''}`;
};
return { getImageUrl };
};

View File

@ -0,0 +1,17 @@
export const useDocumentList = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`document-list-${locale}`, async () => {
try {
const data = $fetch(`/api/cms/documentList`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching document list:', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useHomepage = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`homepage-${locale}`, async () => {
try {
const data = $fetch(`/api/cms/homepage`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching homepage:', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useProduct = (id: string) => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`product-${id}-${locale}`, async () => {
try {
const data = await $fetch(`/api/cms/product/${id}`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching product: ', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useProductList = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`product-list-${locale}`, async () => {
try {
const data = await $fetch(`/api/cms/productList`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching product list: ', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useQuestionList = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`question-list-${locale}`, async () => {
try {
const data = $fetch(`/api/cms/questionList`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching question list:', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useSolution = (id: string) => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`solution-${id}-${locale}`, async () => {
try {
const data = await $fetch(`/api/cms/solution/${id}`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching solution: ', error);
throw error;
}
});
};

View File

@ -0,0 +1,17 @@
export const useSolutionList = () => {
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
return useAsyncData(`solution-list-${locale}`, async () => {
try {
const data = $fetch(`/api/cms/solutionList`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching solution list:', error);
throw error;
}
});
};

2
app/composables/index.ts Normal file
View File

@ -0,0 +1,2 @@
export * from './directus';
export * from './useLocalizations';

View File

@ -0,0 +1,80 @@
import { h, type VNode } from 'vue';
import { parseDocument } from 'htmlparser2';
import type { Element, Text, Node } from 'domhandler';
/** 标签映射的类型key=标签名value=渲染函数 */
export type HtmlRenderMap = Record<
string,
(node: Element, children: VNode[]) => VNode
>;
export interface HtmlRenderOptions {
/** 自定义标签渲染映射 */
map?: HtmlRenderMap;
/** 默认是否将未知标签渲染为原生标签(默认 true */
allowUnknownTags?: boolean;
}
export const useHtmlRenderer = (
html: string,
options: HtmlRenderOptions = {}
) => {
const { map = {}, allowUnknownTags = true } = options;
const doc = parseDocument(html);
function render(node: Node): VNode | string | null {
// 文本节点
if (node.type === 'text') {
const textNode = node as Text;
const content = textNode.data;
// ❗忽略"纯空白" 文本(换行、空格)
if (!content || /^\s+$/.test(content)) {
return null;
}
return content;
}
// 标签节点
if (node.type === 'tag') {
const elem = node as Element;
const rawName = elem.name ?? '';
const name = rawName.trim().toLowerCase();
// 标签名有效性校验
const isValidTag = /^[a-zA-Z][a-zA-Z0-9-]*$/.test(name);
if (!isValidTag) {
logger.warn(`Invalid tag name ignored: "${rawName}"`);
return null;
}
const children: VNode[] = (elem.children || [])
.map((child) => render(child))
.filter(Boolean) as VNode[];
// 自定义映射
if (map[name]) {
return map[name](elem, children);
}
// 默认将未知标签渲染为原生标签
if (allowUnknownTags) {
return h(name, elem.attribs || {}, children);
}
// 忽略无法渲染节点
return null;
}
return null;
}
const nodes = doc.children
.map((child) => render(child))
.filter(Boolean) as VNode[];
return nodes;
};

View File

@ -1,39 +1,99 @@
import type { StrapiLocale } from '@nuxtjs/strapi';
import type { Language as ElementLanguage } from 'element-plus/es/locale'; import type { Language as ElementLanguage } from 'element-plus/es/locale';
import zhCn from 'element-plus/es/locale/lang/zh-cn'; import zhCn from 'element-plus/es/locale/lang/zh-cn';
import en from 'element-plus/es/locale/lang/en'; import en from 'element-plus/es/locale/lang/en';
import es from 'element-plus/es/locale/lang/es';
import ru from 'element-plus/es/locale/lang/ru';
// Strapi本地化映射 /**
export const strapiLocales: Record<string, StrapiLocale> = { * 应用语言映射结构
'zh': 'zh-Hans', * 用于统一 Strapi / Directus / Element Plus 的多语言配置
'en': 'en' */
export interface LocaleMapping {
/** 用于Directus translations.languages_code **/
directus: string;
/** Element Plus语言对象 **/
element: ElementLanguage;
} }
// Element Plus本地化映射 /**
export const elementPlusLocales: Record<string, ElementLanguage> = { * 应用支持的语言映射表。
'zh': zhCn, *
'en': en * 每个键(如 "zh"、"en")对应一套统一的本地化配置,
} * 方便在 Strapi / Directus / Element Plus 三方系统间保持一致。
*/
export const localeMap = {
zh: {
directus: 'zh-CN',
element: zhCn,
},
en: {
directus: 'en-US',
element: en,
},
es: {
directus: 'es-ES',
element: es,
},
ru: {
directus: 'ru-RU',
element: ru,
},
} satisfies Record<string, LocaleMapping>;
/** 应用支持的语言键类型 **/
export type AppLocale = keyof typeof localeMap;
/** 默认语言, 当找不到匹配语言时回退到默认语言 **/
const defaultLocale: AppLocale = 'zh';
/**
* 提供 Strapi、 Directus 与 Element Plus的国际化映射工具
*
* ---
* @example
* ``` ts
* const { locale, getStrapiLocale, getElementPlusLocale } = useLocalizations()
*
* const strapiLang = getStrapiLocale() // 当前 Strapi 语言码
* const elLocale = getElementPlusLocale('en') // 获取 Element Plus 英文对象
* const all = getLocaleMapping('zh') // 获取完整映射结构
* ```
* ---
*
* @returns 返回当前语言及各系统的本地化获取方法
*/
export const useLocalizations = () => { export const useLocalizations = () => {
const { locale } = useI18n(); const { locale } = useI18n<{ locale: Ref<AppLocale> }>();
// 获取Strapi本地化代码 /**
const getStrapiLocale = (nuxtLocale?: string): StrapiLocale => { * 获取对应语言的完整映射结构
const currentLocale = nuxtLocale || locale.value; *
return strapiLocales[currentLocale] || 'zh-Hans'; * @param nuxtLocale - 可选的语言码参数,若提供则使用该语言码,否则使用当前应用语言
} * @returns 返回当前语言的完整映射对象
*/
// 获取Element Plus本地化 const getMapping = (nuxtLocale?: AppLocale): LocaleMapping => {
const getElementPlusLocale = (nuxtLocale?: string) => { const current = nuxtLocale || locale.value;
const currentLocale = nuxtLocale || locale.value; return localeMap[current] || localeMap[defaultLocale];
const elementPlusLocale = elementPlusLocales[currentLocale] || elementPlusLocales['zh']; };
return elementPlusLocale;
}
return { return {
/** 当前Nuxt I18n语言(只读) **/
locale: readonly(locale), locale: readonly(locale),
getStrapiLocale, /** 获取Directus的本地化代码 **/
getElementPlusLocale, getDirectusLocale: (l?: AppLocale) => getMapping(l).directus,
} /** 获取Element Plus语言对象 **/
} getElementPlusLocale: (l?: AppLocale) => getMapping(l).element,
/**
* 获取完整的语言映射结构(Strapi / Directus / Element Plus)
*
* @param l: 指定语言默认为当前locale
* @returns 语言映射对象
*/
getLocaleMapping: getMapping,
/** 所有可用的Directus语言代码列表(只读) **/
availableDirectusLocales: readonly(
Object.values(localeMap).map((item) => item.directus)
),
};
};

View File

@ -0,0 +1,47 @@
/**
* 设置页面级 SEO 元数据(包含 title、description、OG/Twitter 等常用字段)。
*
* 该函数基于 `useSeoMeta` 封装,可用于 Nuxt 3 / Nuxt 4
* 配合 SSR/CSR 动态更新,可安全用于异步数据场景(如 CMS 内容页)。
*
* @param {Object} meta - 页面 SEO 配置对象
* @param {string} meta.title - 页面标题(会同时应用到 title / og:title
* @param {string} [meta.description] - 页面描述(会应用到 description / og:description
* @param {string} [meta.image] - 用于分享卡片的预览图og:image / twitter:image
*
* @example
* // 用于普通页面
* usePageSeo({
* title: '产品中心 - 金申机械',
* description: '查看全系列纸管机械产品',
* image: '/images/og/products.png'
* })
*
* @example
* // 用于动态内容(如产品详情页)
* const product = await fetchProduct()
* usePageSeo({
* title: product.name,
* description: product.summary,
* image: product.coverImage
* })
*
* @remarks
* - 自动生成以下 meta`title`, `description`, `og:title`, `og:description`, `og:image`, `twitter:card`
* - 默认使用 `summary_large_image` 作为 Twitter 卡片类型
* - 推荐与 `useHead()` 配合增加 canonical / alternate hreflang 等额外 SEO 标签
*/
export function usePageSeo(meta: {
title: string;
description?: string;
image?: string;
}) {
useSeoMeta({
title: meta.title,
ogTitle: meta.title,
description: meta.description,
ogDescription: meta.description,
ogImage: meta.image,
twitterCard: 'summary_large_image',
});
}

View File

@ -1,35 +1,48 @@
<template> <template>
<el-container class="app-container"> <el-container class="app-container">
<el-header class="page-header"> <el-header height="auto" class="page-header">
<jinshen-header /> <jinshen-header />
</el-header> </el-header>
<el-main class="main-content"> <el-main class="main-content">
<slot /> <slot />
</el-main> </el-main>
<el-footer class="page-footer"> <el-footer height="auto" class="page-footer">
<jinshen-footer /> <jinshen-footer />
</el-footer> </el-footer>
</el-container> </el-container>
</template> </template>
<script setup lang="ts">
const { t } = useI18n();
useHead(() => {
const siteTitle = t('company-name');
return {
titleTemplate: (title) => (title ? `${title} - ${siteTitle}` : siteTitle),
};
});
</script>
<style scoped> <style scoped>
.app-container { .app-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} min-height: 100vh;
padding: 0;
}
.page-header { .page-header {
padding: 0px; padding: 0px;
} margin-bottom: auto;
}
.main-content { .main-content {
flex: 1; flex: 1;
padding: 20px; padding: 0;
flex-direction: column; overflow-y: auto;
} }
.page-footer { .page-footer {
padding: 0px; padding: 0px;
} }
</style> </style>

16
app/layouts/preview.vue Normal file
View File

@ -0,0 +1,16 @@
<template>
<div>
<slot />
</div>
</template>
<script setup lang="ts">
const { t } = useI18n();
useHead(() => {
const siteTitle = `${$t('page-title.preview')} - ${t('company-name')}`;
return {
title: siteTitle,
};
});
</script>

View File

@ -1,17 +1,10 @@
<template> <template>
<main p="x4 y10" text="center teal-700 dark:gray-200"> <main p="x4 y10" text="center teal-700 dark:gray-200">
<div text4xl> <not-found-result
<div i-ep-warning inline-block /> :title="$t('page-not-found')"
</div> :sub-title="$t('page-not-found-desc')"
<div>{{ $t('not-found') }}</div> :back-text="$t('back-to-home')"
<div> :on-back="() => $router.push($localePath('/'))"
<button text-sm btn m="3 t8" @click="router.back()"> />
{{ $t('back') }} </main>
</button>
</div>
</main>
</template> </template>
<script setup lang="ts">
const router = useRouter()
</script>

View File

@ -1,60 +0,0 @@
<template>
<div>
<el-breadcrumb class="breadcrumb" separator="/">
<el-breadcrumb-item class="text-sm opacity-50" :to="{ path: $localePath('/') }">
{{ $t('navigation.home') }}
</el-breadcrumb-item>
<el-breadcrumb-item class="text-sm opacity-50">
{{ $t('contact-info') }}
</el-breadcrumb-item>
</el-breadcrumb>
<div class="content">
<markdown-renderer :content="content || ''" />
</div>
</div>
</template>
<script setup lang="ts">
const { findOne } = useStrapi()
const { getStrapiLocale } = useLocalizations()
const strapiLocale = getStrapiLocale()
const content = ref<string>('')
onMounted(async () => {
try {
const response = await findOne<StrapiContactInfo>('contact-info', undefined, {
populate: '*',
locale: strapiLocale,
})
if (response.data) {
content.value = response.data.content || ''
} else {
console.warn('No contact info data found')
}
} catch (error) {
console.error('Failed to fetch contact info:', error)
}
})
</script>
<style scoped>
.breadcrumb {
padding: 1rem 1rem;
}
.content {
padding: 1rem;
margin-bottom: 2rem;
}
:deep(.markdown-body p) {
margin-bottom: 1rem;
}
:deep(.markdown-body h2) {
text-align: center;
}
</style>

View File

@ -1,102 +1,117 @@
<template> <template>
<div> <div class="page-container">
<el-breadcrumb class="breadcrumb" separator="/"> <app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
<el-breadcrumb-item class="text-sm opacity-50" :to="{ path: $localePath('/') }">
{{ $t('navigation.home') }}
</el-breadcrumb-item>
<el-breadcrumb-item class="text-sm opacity-50">
{{ $t('about-us') }}
</el-breadcrumb-item>
</el-breadcrumb>
<div class="content"> <div class="content">
<markdown-renderer :content="content || ''" /> <el-skeleton :loading="pending" :rows="10" animated>
</div> <template #default>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="html-typography" v-html="companyProfile?.content || ''" />
<!-- <div v-if="!hydrated" v-html="companyProfile.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="companyProfile.content || ''" -->
<!-- /> -->
<!-- </div> -->
<el-divider content-position="left">更多信息</el-divider> <el-divider content-position="left">{{
$t('learn-more')
}}</el-divider>
<div class="button-group"> <div class="button-group">
<NuxtLink :to="$localePath('/about/contact-us')"> <learn-more-card
<el-card class="card-button"> :title="$t('navigation.contact-info')"
<el-icon class="icon" size="80"><ElIconService /></el-icon> :icon="ElIconService"
<br> :to="$localePath('/support/contact-us')"
联系信息 />
</el-card> <learn-more-card
</NuxtLink> :title="$t('navigation.address')"
:icon="ElIconMapLocation"
@click="openMap"
/>
</div>
</template>
</el-skeleton>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const { findOne } = useStrapi() const localePath = useLocalePath();
const { getStrapiLocale } = useLocalizations() const hydrated = ref(false);
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.about-us') },
];
const { data, pending, error } = useCompanyProfile();
const strapiLocale = getStrapiLocale() const companyProfile = computed(() => data.value ?? null);
const content = ref<string>('') const openMap = () => {
window.open(localePath('/locate'));
};
onMounted(async () => { watch(error, (value) => {
try { if (value) {
const response = await findOne<StrapiCompanyProfile>('company-profile', undefined, { logger.error('数据获取失败: ', value);
populate: '*',
locale: strapiLocale,
})
if (response.data) {
content.value = response.data.content || ''
} else {
console.warn('No company profile data found')
} }
} catch (error) { });
console.error('Failed to fetch company profile:', error)
} const pageTitle = computed(() => $t('page-title.about-us'));
}) useHead({
title: pageTitle,
});
onMounted(() => {
hydrated.value = true;
});
</script> </script>
<style scoped> <style scoped>
.breadcrumb { .page-container {
padding: 1rem 1rem; padding: 2rem 1rem;
} max-width: 1200px;
margin: 0 auto;
}
.content { .breadcrumb {
padding: 1rem 1rem;
}
.content {
padding: 1rem; padding: 1rem;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
:deep(.markdown-body p) { :deep(.el-divider__text) {
text-indent: 2em;
}
:deep(.markdown-body h2) {
text-align: center;
}
:deep(.el-divider__text) {
color: var(--el-color-info); color: var(--el-color-info);
font-size: 1em; font-size: 1em;
} }
.button-group { .button-group {
display: flex; display: flex;
justify-content: left; justify-content: left;
margin-top: 2rem; margin-top: 2rem;
margin-left: 2rem; margin-left: 2rem;
} gap: 2rem;
}
.card-button { .loading {
width: 20%; display: flex;
min-width: 200px; justify-content: center;
padding: 20px; align-items: center;
margin: 0 auto; margin-top: 1rem;
cursor: pointer; }
text-align: center;
font-size: 1.5em;
}
.card-button:hover { @media (max-width: 768px) {
transform: translateY(-4px); .button-group {
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); align-items: center;
} margin-left: 0;
gap: 0.5rem;
}
.icon { .breadcrumb {
padding: 10px; display: none;
} }
}
</style> </style>

View File

@ -0,0 +1,81 @@
<template>
<div class="page-container">
<div class="page-header">
<h1 class="page-title">{{ $t('navigation.downloads') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div class="page-content">
<el-skeleton
:loading="pending"
:rows="6"
animated
:throttle="{ leading: 500, trailing: 500 }"
>
<template #default>
<file-card :file-id="id" :file="file" />
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
const route = useRoute();
const localePath = useLocalePath();
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.support'), to: localePath('/support') },
{ label: $t('navigation.documents'), to: localePath('/support/documents') },
{ label: $t('navigation.downloads') },
];
const id = route.params.id as string;
const {
data: file,
pending,
error,
} = await useFetch<FileMeta>(`/api/file/${id}`);
if (error.value || !file.value) {
throw createError({
statusCode: 404,
statusMessage: '文件未找到',
});
}
const pageTitle = $t('page-title.download');
usePageSeo({
title: file.value.filename_download || pageTitle,
});
</script>
<style scoped>
.page-container {
padding: 2rem;
margin: 0 auto;
max-width: 1200px;
}
.page-header {
display: flex;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
margin-bottom: 1rem;
}
.breadcrumb {
margin-left: auto;
}
@media (max-width: 768px) {
.breadcrumb {
display: none;
}
}
</style>

View File

@ -1,76 +1,24 @@
<template> <template>
<div class="homepage"> <div class="homepage">
<div class="hero-section"> <homepage-carousel :homepage-data="data" :pending="pending" />
<h1>{{ $t('company-name') }}</h1> <homepage-product-section :homepage-data="data" :pending="pending" />
<p>{{ $t('company-description') }}</p> <homepage-solution-section :homepage-data="data" :pending="pending" />
<el-button type="primary" size="large">
{{ $t('learn-more') }}
</el-button>
</div>
<div class="content-sections">
<div class="section">
<h2>{{ $t('productions') }}</h2>
<p>{{ $t('productions-desc') }}</p>
</div>
<div class="section">
<h2>{{ $t('solutions') }}</h2>
<p>{{ $t('solutions-desc') }}</p>
</div>
<div class="section">
<h2>{{ $t('support') }}</h2>
<p>{{ $t('support-desc') }}</p>
</div>
</div>
</div> </div>
</template> </template>
<style scoped> <script setup lang="ts">
.homepage { const { data, pending, error } = await useHomepage();
padding: 2rem;
}
.hero-section { const pageTilte = $t('page-title.homepage');
text-align: center;
padding: 4rem 0;
background: linear-gradient(135deg, var(--el-color-primary-light-3), var(--el-color-primary));
border-radius: 8px;
margin-bottom: 3rem;
color: white;
}
.hero-section h1 { watch(error, (value) => {
font-size: 3rem; if (value) {
margin-bottom: 1rem; logger.error('数据获取失败: ', value);
} }
});
.hero-section p { useSeoMeta({
font-size: 1.2rem; title: pageTilte,
margin-bottom: 2rem; description: $t('company-description'),
} });
</script>
.content-sections {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.section {
padding: 2rem;
background: var(--el-bg-color);
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.section h2 {
color: var(--el-color-primary);
margin-bottom: 1rem;
}
.section p {
color: var(--el-text-color-regular);
line-height: 1.6;
}
</style>

28
app/pages/locate.vue Normal file
View File

@ -0,0 +1,28 @@
<template>
<div class="page-container">
<h1>{{ $t('redirecting') }}</h1>
</div>
</template>
<script setup lang="ts">
onMounted(async () => {
const platform = await getAutoMappedService();
// // ✔ 移动端能正常跳转
window.location.href = platform;
});
</script>
<style scoped>
.page-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 80vh;
}
h1 {
font-size: 1.5rem;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,13 @@
<template>
<file-previewer :file-id="id" />
</template>
<script setup lang="ts">
definePageMeta({
layout: 'preview',
});
const route = useRoute();
const id = computed(() => route.params.id as string);
</script>

View File

@ -1,188 +0,0 @@
<template>
<div class="production-detail">
<div v-if="production">
<!-- 面包屑导航 -->
<el-breadcrumb class="breadcrumb" separator="/">
<el-breadcrumb-item class="text-sm opacity-50" :to="{ path: $localePath('/') }">{{ $t('navigation.home')
}}</el-breadcrumb-item>
<el-breadcrumb-item class="text-sm opacity-50" :to="{ path: $localePath('/productions') }">{{ $t('productions')
}}</el-breadcrumb-item>
<el-breadcrumb-item class="text-sm opactiy-50">{{ production.title }}</el-breadcrumb-item>
</el-breadcrumb>
<!-- 产品详情内容 -->
<div class="production-header">
<div class="production-image">
<el-image
:src="useStrapiMedia(production?.production_image?.url || '')" :alt="production.title"
fit="contain" />
</div>
<div class="production-info">
<h1>{{ production.title }}</h1>
<p class="summary">{{ production.summary }}</p>
</div>
</div>
<!-- 产品详细描述 -->
<div class="production-content">
<el-tabs v-model="activeName">
<el-tab-pane label="产品详情" name="details">
<markdown-renderer :content="production.production_details || ''" />
</el-tab-pane>
<el-tab-pane label="技术规格" name="specs">
<spec-table :data="production.production_specs" />
</el-tab-pane>
<el-tab-pane label="相关文档" name="documents" />
</el-tabs>
</div>
</div>
<!-- 加载状态 -->
<div v-else-if="pending" class="loading">
<el-skeleton style="--el-skeleton-circle-size: 400px">
<template #template>
<el-skeleton-item variant="circle" />
</template>
</el-skeleton>
<el-skeleton :rows="5" animated />
</div>
<!-- 未找到产品 -->
<div v-else class="not-found">
<el-result icon="warning" :title="$t('product-not-found')" :sub-title="$t('product-not-found-desc')">
<template #extra>
<el-button type="primary" @click="$router.push('/productions')">
{{ $t('back-to-productions') }}
</el-button>
</template>
</el-result>
</div>
</div>
</template>
<script setup lang="ts">
import type { Production } from '~/types/strapi/production'
const route = useRoute()
const { findOne } = useStrapi()
const { getStrapiLocale } = useLocalizations()
const strapiLocale = getStrapiLocale()
const production = ref<Production | null>(null)
const pending = ref(true)
const activeName = ref('details') // 默认选中概览标签
// 获取路由参数slug 或 id
const documentId = computed(() => route.params.slug as string)
onMounted(async () => {
try {
const response = await findOne<Production>('productions', documentId.value, {
populate: {
production_specs: {
populate: '*',
},
production_image: {
populate: '*',
},
},
locale: strapiLocale,
})
if (response.data) {
const item = response.data
production.value = {
...item,
}
}
} catch (error) {
console.error('Failed to fetch production:', error)
} finally {
pending.value = false
}
})
// SEO
useHead({
title: computed(() => production.value?.title || 'Product Detail'),
meta: [
{
name: 'description',
content: computed(() => production.value?.summary || '')
}
]
})
</script>
<style scoped>
.production-detail {
min-height: 60vh;
}
.breadcrumb {
padding: 1rem 1rem;
margin-bottom: 2rem;
}
.production-header {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
margin-bottom: 3rem;
}
.production-image .el-image {
width: 100%;
height: 400px;
border-radius: 8px;
}
.production-info h1 {
margin-top: 2rem;
margin-bottom: 1rem;
font-size: 2rem;
}
.summary {
color: var(--el-color-info);
font-size: 1rem;
line-height: 1.6;
margin-bottom: 2rem;
}
.production-content {
margin-top: 2rem;
}
.production-content h2 {
color: var(--el-text-color-primary);
margin: 0;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
margin-top: 1rem;
}
.not-found {
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
}
/* 响应式设计 */
@media (max-width: 768px) {
.production-header {
grid-template-columns: 1fr;
gap: 2rem;
}
.production-info h1 {
font-size: 2rem;
}
}
</style>

View File

@ -1,110 +0,0 @@
<template>
<div class="productions-container">
<el-collapse v-model="activeNames" class="production-collapse">
<el-collapse-item
v-for="(group, type) in groupedProductions" :key="type" :title="type || '未分类'"
:name="type || 'no-category'">
<div class="group-list">
<production-card
v-for="production in group" :key="production.documentId || production.id"
:slug="production.documentId"
:image-url="useStrapiMedia(production?.production_image?.url || '')" :name="production.title"
:description="production.summary || ''" />
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script setup lang="ts">
const { find } = useStrapi()
const { getStrapiLocale } = useLocalizations()
const strapiLocale = getStrapiLocale()
const activeNames = ref<string[]>([])
const productions = ref<Production[]>([])
// 按类型分组
// 兼容 production_type 既可能为对象也可能为字符串
const groupedProductions = computed(() => {
const groups: Record<string, Production[]> = {}
for (const prod of productions.value) {
let typeKey = ''
if (typeof prod.production_type === 'string') {
typeKey = prod.production_type
} else if (prod.production_type && typeof prod.production_type === 'object' && 'type' in prod.production_type) {
typeKey = prod.production_type.type || ''
}
if (!groups[typeKey]) groups[typeKey] = []
groups[typeKey]?.push(prod)
}
return groups
})
onMounted(async () => {
try {
const response = await find<Production>('productions', {
populate: {
production_image: {
populate: '*',
},
production_type: {
populate: '*',
}
},
filters: {
show_in_production_list: {
$eq: true, // 只获取在产品列表中显示的产品
},
},
locale: strapiLocale,
})
productions.value = response.data.map((item: Production) => ({
...item,
// 保持 production_type 原始类型,兼容对象或字符串
production_type: item.production_type,
}))
// 默认展开所有分组
activeNames.value = Object.keys(groupedProductions.value)
activeNames.value.push('no-category') // 展开未分类
} catch (error) {
console.error('Failed to fetch productions:', error)
}
});
</script>
<style scoped>
.productions-container {
display: flex;
flex-direction: column;
gap: 40px;
padding: 20px;
}
.production-group {
margin-bottom: 32px;
}
.group-title {
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 16px;
color: var(--el-color-primary);
}
.group-list {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: flex-start;
}
:deep(.el-collapse-item__header) {
padding: 30px auto;
font-size: 1.5rem;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<div class="page-container">
<div v-if="product">
<!-- 面包屑导航 -->
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
<!-- 产品详情内容 -->
<product-header :product="product" />
<!-- 产品详细描述 -->
<product-detail :product="product" />
</div>
<!-- 未找到产品 -->
<div v-else class="not-found">
<not-found-result
:title="$t('product-not-found')"
:sub-title="$t('product-not-found-desc')"
:back-text="$t('back-to-products')"
:on-back="() => $router.push($localePath('/products'))"
/>
</div>
</div>
</template>
<script setup lang="ts">
const route = useRoute();
const localePath = useLocalePath();
// 获取路由参数
const id = route.params.slug as string;
const { data: product, error } = await useProduct(id);
const breadcrumbItems = computed(() => [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.products'), to: localePath('/products') },
{ label: product.value?.name || '' },
]);
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
// SEO
usePageSeo({
title: product.value?.name || $t('page-title.products'),
description: product.value?.summary || '',
});
</script>
<style scoped>
.page-container {
min-height: 80vh;
max-width: 1200px;
margin: 0 auto;
}
.breadcrumb {
padding: 2rem;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
margin-top: 1rem;
}
.not-found {
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
}
</style>

View File

@ -0,0 +1,220 @@
<template>
<div class="page-container">
<div class="page-header">
<div>
<h1 class="page-title">{{ $t('our-products') }}</h1>
<p class="page-subtitle">
{{ $t('products-desc') }}{{ $t('find-discontinued-products') }}
</p>
</div>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div>
<el-skeleton
animated
:loading="pending"
:throttle="{ leading: 500, trailing: 500 }"
>
<template #template>
<div v-for="i in 3" :key="i" class="products-container">
<el-skeleton-item variant="h1" class="skeleton-collapse" />
<div class="skeleton-group-list">
<el-skeleton-item
v-for="j in 3"
:key="j"
variant="rect"
class="skeleton-card"
/>
</div>
</div>
</template>
<template #default>
<div class="products-container">
<el-collapse v-model="activeNames" class="product-collapse">
<el-collapse-item
v-for="[key, value] in Object.entries(groupedProducts)"
:key="key"
:title="key || '未分类'"
:name="key || 'no-category'"
>
<div class="group-list">
<product-card
v-for="product in value.data"
:key="product.id"
:slug="product.id.toString()"
:image-url="getImageUrl(product.cover.toString())"
:name="product.name"
:description="product.summary || ''"
/>
</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const { getImageUrl } = useDirectusImage();
const { data: products, pending, error } = await useProductList();
const activeNames = ref<string[]>([]);
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.products') },
];
// 按类型分组
const groupedProducts = computed(() => {
const groups: Record<string, { data: ProductListView[]; sort: number }> =
{};
for (const prod of products.value) {
const typeKey = prod.product_type?.name ?? '';
if (!groups[typeKey]) {
groups[typeKey] = { data: [], sort: prod.product_type?.sort ?? 999 };
}
groups[typeKey]?.data.push(prod);
}
const sortedGroups = Object.fromEntries(
Object.entries(groups).sort(([, a], [, b]) => a.sort - b.sort)
);
return sortedGroups;
});
watch(groupedProducts, () => {
if (groupedProducts.value) {
activeNames.value = [
...Object.keys(groupedProducts.value),
'no-category',
];
}
});
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
onMounted(async () => {
if (groupedProducts.value) {
activeNames.value = [
...Object.keys(groupedProducts.value),
'no-category',
];
}
});
const pageTitle = $t('page-title.products');
usePageSeo({
title: pageTitle,
});
</script>
<style scoped>
.page-container {
padding: 2rem;
margin: 0 auto;
max-width: 1200px;
}
.page-header {
display: flex;
margin-bottom: 1rem;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
}
.page-subtitle {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.breadcrumb {
margin-left: auto;
}
.products-container {
display: flex;
flex-direction: column;
gap: 40px;
}
.product-group {
margin-bottom: 32px;
}
.group-title {
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 16px;
color: var(--el-color-primary);
}
.group-list {
display: flex;
flex-wrap: wrap;
padding-top: 1rem;
gap: 20px;
justify-content: flex-start;
}
.skeleton-collapse {
height: 50px;
width: 100%;
}
.skeleton-group-list {
display: flex;
flex-wrap: wrap;
gap: 40px;
justify-content: flex-start;
margin-bottom: 2rem;
}
.skeleton-card {
width: 30%;
height: 250px;
margin-right: 1rem;
}
@media (max-width: 1200px) {
.skeleton-card {
width: 45%;
}
}
@media (max-width: 768px) {
.group-list {
justify-content: center;
align-items: center;
}
.skeleton-group-list {
justify-content: center;
align-items: center;
}
.skeleton-card {
width: 90%;
}
.breadcrumb {
display: none;
}
}
:deep(.el-collapse-item__header) {
padding: 30px auto;
font-size: 1.5rem;
}
</style>

135
app/pages/search.vue Normal file
View File

@ -0,0 +1,135 @@
<template>
<div class="search-page">
<search-header v-model="keyword" />
<div class="search-state">
<el-skeleton
:loading="loading"
animated
:throttle="{ leading: 500, trailing: 500 }"
>
<template #template>
<el-skeleton-item
v-for="i in 10"
:key="i"
variant="rect"
class="skeleton-item"
/>
</template>
<template #default>
<search-tabs v-if="hasResults" :search-items="searchItems" />
<div v-else>
<el-empty
:description="
route.query.query
? $t('search.no-results', { query: route.query?.query })
: $t('search.no-query')
"
/>
</div>
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
// i18n相关
const { t } = useI18n();
const { getDirectusLocale } = useLocalizations();
const locale = getDirectusLocale();
// 路由相关
const route = useRoute();
// 搜索相关
const keyword = ref('');
if (typeof route.query.query === 'string' && route.query.query.trim()) {
keyword.value = route.query.query;
}
const {
data: searchItems,
pending: loading,
error,
refresh,
} = useAsyncData(`meilisearch-${keyword.value}-${locale}`, async () => {
try {
const data = await $fetch(`/api/search?query=${keyword.value}`, {
headers: { 'x-locale': locale },
});
return data;
} catch (error) {
logger.error('Error fetching search results: ', error);
throw error;
}
});
const hasResults = computed(() => searchItems.value.length > 0);
watch(
() => route.query.query,
async (newQuery) => {
if (typeof newQuery === 'string' && newQuery.trim()) {
keyword.value = newQuery;
await refresh();
}
}
);
watch(
() => locale,
async () => {
await refresh();
}
);
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
onMounted(() => {
if (typeof route.query.query === 'string' && route.query.query.trim())
keyword.value = route.query.query;
});
useHead(() => ({
title: t('search.head-title'),
}));
</script>
<style scoped>
.search-page {
margin: 0 auto;
max-width: 960px;
padding: 2.5rem 1.5rem 3rem;
min-height: 70vh;
}
.search-state {
display: flex;
justify-content: center;
}
.skeleton-item {
height: 80px;
margin-bottom: 1rem;
}
@media (max-width: 640px) {
.search-page {
padding: 2rem 1rem;
}
.search-bar {
flex-direction: column;
align-items: stretch;
}
.search-input {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,73 @@
<template>
<div class="page-container">
<div v-if="solution">
<div class="page-header">
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<solution-detail :solution="solution" />
</div>
<div v-else class="not-found">
<not-found-result
:title="$t('solution-not-found')"
:sub-title="$t('solution-not-found-desc')"
:back-text="$t('back-to-solutions')"
:on-back="() => $router.push($localePath('/solutions'))"
/>
</div>
</div>
</template>
<script setup lang="ts">
const route = useRoute();
const localePath = useLocalePath();
// 获取路由参数
const id = route.params.slug as string;
const { data: solution, error } = await useSolution(id);
const breadcrumbItems = computed(() => [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.solutions'), to: localePath('/solutions') },
{ label: solution.value ? solution.value.title : '' },
]);
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
usePageSeo({
title: solution.value?.title || $t('page-title.solutions'),
description: solution.value?.summary || '',
});
</script>
<style scoped>
.page-container {
padding: 1rem;
min-height: 80vh;
max-width: 1200px;
margin: 0 auto;
}
.breadcrumb {
padding: 1rem;
margin-bottom: 1rem;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
margin-top: 1rem;
}
.not-found {
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<div class="page-container">
<div class="page-header">
<div>
<h1 class="page-title">{{ $t('learn-our-solutions') }}</h1>
<p class="page-subtitle">{{ $t('solutions-desc') }}</p>
</div>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div class="solutions-container">
<el-skeleton
:loading="pending"
animated
:throttle="{
leading: 500,
trailing: 500,
}"
>
<template #template>
<div class="skeleton-group-list">
<el-skeleton-item
v-for="i in 12"
:key="i"
variant="rect"
class="skeleton-card"
/>
</div>
</template>
<template #default>
<el-tabs v-model="activeName" class="solutions-tabs">
<el-tab-pane :label="$t('all')" name="all">
<div class="solution-list">
<solution-card
v-for="solution in solutions"
:key="solution.id"
:title="solution.title"
:summary="solution.summary || ''"
:cover-url="getImageUrl(solution.cover || '')"
:document-id="solution.id.toString()"
/>
</div>
</el-tab-pane>
<el-tab-pane
v-for="[key, value] in Object.entries(groupedSolutions)"
:key="key"
:label="key || '未分类'"
:name="key || 'no-category'"
>
<div class="solution-list">
<solution-card
v-for="solution in value.data"
:key="solution.id"
:document-id="solution.id.toString()"
:cover-url="getImageUrl(solution.cover || '')"
:title="solution.title"
:summary="solution.summary || ''"
/>
</div>
</el-tab-pane>
</el-tabs>
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const { getImageUrl } = useDirectusImage();
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.solutions') },
];
const { data, pending, error } = useSolutionList();
const solutions = computed(() => data.value ?? []);
const activeName = ref<string>('all');
// 按类型分组
const groupedSolutions = computed(() => {
const groups: Record<string, { data: SolutionListView[]; sort: number }> =
{};
for (const sol of solutions.value) {
const typeKey = sol.solution_type?.name ?? '';
if (!groups[typeKey]) {
groups[typeKey] = { data: [], sort: sol.solution_type?.sort ?? 999 };
}
groups[typeKey]?.data.push(sol);
}
const sortedGroups = Object.fromEntries(
Object.entries(groups).sort(([, a], [, b]) => a.sort - b.sort)
);
return sortedGroups;
});
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
const pageTitle = $t('page-title.solutions');
usePageSeo({
title: pageTitle,
});
</script>
<style scoped>
.page-container {
padding: 2rem;
max-width: 1200px;
margin: 0 auto;
}
.page-header {
display: flex;
margin-bottom: 1rem;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
}
.page-subtitle {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.breadcrumb {
margin-left: auto;
}
.solution-list {
display: flex;
flex-wrap: wrap;
padding: 1rem;
margin-bottom: 2rem;
gap: 40px;
}
.skeleton-group-list {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: flex-start;
margin-bottom: 2rem;
}
.skeleton-card {
width: 30%;
height: 200px;
}
@media (max-width: 1200px) {
.skeleton-card {
width: 45%;
}
}
@media (max-width: 768px) {
.skeleton-group-list {
justify-content: center;
align-items: center;
}
.skeleton-card {
width: 90%;
}
.breadcrumb {
display: none;
}
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<div class="page-container">
<support-tabs model-value="contact-us" />
<div class="page-header">
<h1 class="page-title">{{ $t('navigation.contact-info') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div class="page-content">
<el-skeleton
:rows="10"
:loading="pending"
animated
:throttle="{ leading: 500, trailing: 500 }"
>
<template #default>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="html-typography" v-html="contactInfo?.content || ''" />
<!-- <div v-if="!hydrated" v-html="contactInfo?.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="contactInfo?.content || ''" -->
<!-- /> -->
<!-- </div> -->
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const hydrated = ref(false);
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.support'), to: localePath('/support') },
{ label: $t('navigation.contact-info') },
];
const { data, pending, error } = useContactInfo();
const contactInfo = computed(() => data.value ?? null);
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
const pageTitle = $t('page-title.contact-us');
usePageSeo({
title: pageTitle,
});
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header {
display: flex;
padding: 2rem 2rem 0rem;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
margin-bottom: 1rem;
}
.breadcrumb {
margin-left: auto;
}
.page-content {
padding: 2rem;
margin-bottom: 2rem;
}
:deep(.markdown-body ul) {
list-style-type: none;
}
@media (max-width: 768px) {
.breadcrumb {
display: none;
}
}
</style>

View File

@ -0,0 +1,261 @@
<template>
<div class="page-container">
<div>
<support-tabs model-value="documents" />
<div class="page-header">
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div class="page-content">
<document-filter
v-model="filters"
:product-type-options="productTypeOptions"
:product-options="productOptions"
:document-type-options="documentTypeOptions"
/>
<el-skeleton
:loading="pending"
animated
:throttle="{
leading: 500,
trailing: 500,
}"
>
<template #template>
<div class="flex flex-col gap-xl">
<el-skeleton-item
variant="rect"
style="width: 100%; height: 100px"
/>
<el-skeleton-item
v-for="i in 10"
:key="i"
variant="h1"
style="height: 60px"
/>
</div>
</template>
<template #default>
<document-list
:documents="paginatedDocuments"
:show-category="
filters.selectedDocumentType === null ||
filters.selectedDocumentType === undefined
"
/>
<el-pagination
v-model:current-page="page"
class="justify-center pagination-container"
layout="prev, pager, next"
hide-on-single-page
:page-size="documentsPerPage"
:total="filteredDocuments.length"
/>
</template>
</el-skeleton>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.support'), to: localePath('/support') },
{ label: $t('navigation.documents') },
];
const filters = reactive({
selectedDocumentType: null as string | null,
selectedProductType: null as string | null,
selectedProduct: null as string | null,
keyword: '',
});
const page = ref(1);
const documentsPerPage = 10;
const { data, pending, error } = useDocumentList();
const documents = computed(() => data.value ?? []);
const documentTypeOptions = computed(() => {
const types: DocumentTypeView[] = [];
documents.value.forEach((doc: DocumentListView) => {
if (!types.some((item) => item.id === doc.type.id)) {
if (doc.type.id === '-1') {
types.push({
id: '-1',
name: $t('product-filter.misc'),
});
} else {
types.push(doc.type);
}
}
});
return types;
});
const productTypeOptions = computed(() => {
const types: DocumentListProductType[] = [];
documents.value.forEach((doc: DocumentListView) => {
doc.products?.forEach((product: DocumentListProduct) => {
const productType = product.type;
if (!types.some((item) => item.id === productType.id)) {
types.push(productType);
}
});
});
return types;
});
const productOptions = computed(() => {
if (!filters.selectedProductType) return [];
const products: DocumentListProduct[] = [];
documents.value.forEach((doc: DocumentListView) => {
doc.products?.forEach((product: DocumentListProduct) => {
if (
product.type.id === filters.selectedProductType &&
!products.some((item) => item.id === product.id)
) {
products.push(product);
}
});
});
return products;
});
const filteredDocuments = computed(() => {
const fuzzyMatchedDocuments = fuzzyMatch(documents.value, {
keyword: filters.keyword,
keys: ['title'],
threshold: 0.6,
});
return fuzzyMatchedDocuments.filter((doc: DocumentListView) => {
const matchProduct = filters.selectedProduct
? doc.products?.some(
(product: DocumentListProduct) =>
product.id === filters.selectedProduct
)
: filters.selectedProductType
? doc.products?.some(
(product: DocumentListProduct) =>
product.type?.id === filters.selectedProductType
)
: true;
const matchDocumentType = filters.selectedDocumentType
? doc.type.id === filters.selectedDocumentType
: true;
return matchProduct && matchDocumentType;
});
});
const paginatedDocuments = computed(() => {
return filteredDocuments.value.slice(
(page.value - 1) * documentsPerPage,
page.value * documentsPerPage
);
});
watch(
() => filters.selectedProductType,
() => {
filters.selectedProduct = null;
}
);
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
const pageTitle = $t('page-title.documents');
usePageSeo({
title: pageTitle,
});
</script>
<style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header {
display: flex;
padding: 2rem 2rem 0rem;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
margin-bottom: 1rem;
}
.breadcrumb {
margin-left: auto;
}
.page-content {
padding: 1rem 2rem 2rem;
}
.select-label {
color: var(--el-text-color-secondary);
font-size: 0.9rem;
}
:deep(.el-select__wrapper),
:deep(.el-input__wrapper) {
height: 40px;
font-size: 0.9rem;
}
.pagination-container {
margin-top: 2rem;
}
@media (max-width: 768px) {
.breadcrumb {
display: none;
}
}
:deep(.el-pagination) {
.btn-prev,
.btn-next {
.el-icon {
font-size: 24px;
}
}
.el-pager {
gap: 0.5rem;
}
.el-pager li {
font-size: 1rem;
/* border: 1px solid #409eff; */
border-radius: 50%;
&:hover {
background-color: #ecf5ff;
}
&.is-active {
background-color: var(--el-color-primary);
color: #fff;
}
}
}
</style>

258
app/pages/support/faq.vue Normal file
View File

@ -0,0 +1,258 @@
<template>
<div class="page-container">
<support-tabs model-value="faq" />
<div class="page-header">
<h1 class="page-title">{{ $t('navigation.faq') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div class="page-content">
<question-filter
v-model="filters"
:product-type-options="productTypeOptions"
:product-options="productOptions"
:question-type-options="questionTypeOptions"
/>
<el-skeleton
:loading="pending"
animated
:throttle="{ leading: 500, trailing: 500 }"
>
<template #template>
<div class="flex flex-col gap-xl">
<el-skeleton-item
v-for="i in 10"
:key="i"
variant="h1"
style="height: 80px"
/>
</div>
</template>
<template #default>
<question-list :questions="paginatedQuestions" />
<el-pagination
v-model:current-page="page"
class="justify-center pagination-container"
layout="prev, pager, next"
hide-on-single-page
:page-size="questionsPerPage"
:total="filteredQuestions.length"
/>
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const route = useRoute();
const filters = reactive({
selectedQuestionType: null as string | null,
selectedProduct: null as string | null,
selectedProductType: null as string | null,
keyword: '',
});
const page = ref(1);
const questionsPerPage = 10;
const focusQuestionId = ref<string | null>(
route.query.focus as string | null
);
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.support'), to: localePath('/support') },
{ label: $t('navigation.faq') },
];
const { data, pending, error } = useQuestionList();
const questions = computed(() => data.value ?? []);
const questionTypeOptions = computed(() => {
const types: QuestionTypeView[] = [];
questions.value.forEach((q: QuestionListView) => {
if (!types.some((t) => t.id === q.type.id)) {
if (q.type.id === '-1') {
types.push({
id: '-1',
name: $t('product-filter.misc'),
});
} else {
types.push(q.type);
}
}
});
return types;
});
const productTypeOptions = computed(() => {
const types: QuestionListProductType[] = [];
questions.value.forEach((q: QuestionListView) => {
q.products.forEach((product: QuestionListProduct) => {
const productType = product.type;
if (!types.some((p) => p.id === productType.id)) {
types.push(productType);
}
});
});
return types;
});
const productOptions = computed(() => {
if (!filters.selectedProductType) return [];
const products: QuestionListProduct[] = [];
questions.value.forEach((q: QuestionListView) => {
q.products.forEach((product: QuestionListProduct) => {
if (
product.type.id === filters.selectedProductType &&
!products.some((p) => p.id === product.id)
) {
products.push(product);
}
});
});
return products;
});
const filteredQuestions = computed(() => {
const fuzzyMatchedQuestions = fuzzyMatch(questions.value, {
keyword: filters.keyword,
keys: ['title'],
threshold: 0.6,
});
return fuzzyMatchedQuestions.filter((question: QuestionListView) => {
const matchProduct = filters.selectedProduct
? question.products?.some(
(product: QuestionListProduct) =>
product.id === filters.selectedProduct
)
: filters.selectedProductType
? question.products?.some(
(product: QuestionListProduct) =>
product.type.id === filters.selectedProductType
)
: true;
const matchQuestionType = filters.selectedQuestionType
? question.type.id === filters.selectedQuestionType
: true;
return matchProduct && matchQuestionType;
});
});
const paginatedQuestions = computed(() => {
const start = (page.value - 1) * questionsPerPage;
const end = page.value * questionsPerPage;
return filteredQuestions.value.slice(start, end);
});
watch(
focusQuestionId,
async (focusId) => {
if (!focusId) return;
if (!import.meta.client) return;
await nextTick();
const question = filteredQuestions.value.find((q) => q.id === focusId);
if (!question) return;
const targetIndex = filteredQuestions.value.indexOf(question);
const targetPage = Math.floor(targetIndex / questionsPerPage) + 1;
onMounted(() => {
if (page.value !== targetPage) {
page.value = targetPage;
}
});
},
{ immediate: true }
);
watch(
() => filters.selectedProductType,
() => {
filters.selectedProduct = null;
}
);
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
const pageTitle = $t('page-title.faq');
usePageSeo({
title: pageTitle,
});
</script>
<style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header {
display: flex;
padding: 2rem 2rem 0rem;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
margin-bottom: 1rem;
}
.breadcrumb {
margin-left: auto;
}
.page-content {
padding: 1rem 2rem 2rem;
}
.pagination-container {
margin-top: 2rem;
}
@media (max-width: 768px) {
.breadcrumb {
display: none;
}
}
:deep(.el-pagination) {
.btn-prev,
.btn-next {
.el-icon {
font-size: 24px;
}
}
.el-pager {
gap: 0.5rem;
}
.el-pager li {
font-size: 1rem;
/* border: 1px solid #409eff; */
border-radius: 50%;
&:hover {
background-color: #ecf5ff;
}
&.is-active {
background-color: var(--el-color-primary);
color: #fff;
}
}
}
</style>

145
app/pages/support/index.vue Normal file
View File

@ -0,0 +1,145 @@
<template>
<div class="page-container">
<support-tabs />
<div class="page-header">
<h1 class="page-title">{{ $t('navigation.support') }}</h1>
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
</div>
<div class="page-content">
<section style="margin-bottom: 2rem">
<p>
{{ $t('support-page-desc') }}
</p>
</section>
<div class="card-group">
<support-card
v-for="(item, index) in supportItems"
:key="index"
:title="item.title"
:description="item.description"
:to="item.to"
:icon-component="item.iconComponent"
/>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.support') },
];
const supportItems = [
{
title: $t('navigation.faq'),
description: $t('support-card-desc.faq'),
to: localePath('/support/faq'),
iconComponent: ElIconQuestionFilled,
},
{
title: $t('navigation.documents'),
description: $t('support-card-desc.documents'),
to: localePath('/support/documents'),
iconComponent: ElIconDocumentChecked,
},
{
title: $t('navigation.contact-info'),
description: $t('support-card-desc.contact-info'),
to: localePath('/support/contact-us'),
iconComponent: ElIconService,
},
];
const pageTitle = $t('page-title.support');
usePageSeo({
title: pageTitle,
});
</script>
<style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header {
display: flex;
padding: 2rem 2rem 0rem;
}
.page-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
margin-bottom: 1rem;
}
.breadcrumb {
margin-left: auto;
}
.page-content {
padding: 1rem 2rem 2rem;
}
section {
line-height: 1.6;
width: 60%;
}
.card-group {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 50px;
justify-content: space-around;
margin-bottom: 2rem;
}
.el-card {
width: 100%;
padding: 20px;
box-shadow: none;
border-radius: 8px;
}
.card-icon {
color: var(--el-color-primary);
}
.card-title {
display: flex;
height: 100%;
align-items: center;
margin-left: 2rem;
font-size: 1.5rem;
font-weight: bold;
color: var(--el-color-primary);
}
.card-link {
margin-left: auto;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
@media (max-width: 768px) {
section {
width: 100%;
}
.card-group {
grid-template-columns: 1fr;
gap: 20px;
}
.breadcrumb {
display: none;
}
}
</style>

13
app/plugins/directus.ts Normal file
View File

@ -0,0 +1,13 @@
import { createDirectus, rest, staticToken, graphql } from '@directus/sdk';
export default defineNuxtPlugin(() => {
const config = useRuntimeConfig();
const directus = createDirectus<Schema>(config.public.directus.url)
.with(rest())
.with(graphql())
.with(staticToken(config.public.directus.token || ''));
return {
provide: { directus },
};
});

View File

@ -1,46 +0,0 @@
export interface StrapiEntity {
id: number;
documentId: string;
createdAt: string;
updatedAt: string;
publishedAt: string;
locale: string;
}
export interface StrapiMedia {
id: number;
url: string;
ext: string;
name: string;
alternativeText: string;
caption: string;
}
export interface StrapiImageFormat {
url: string;
width: number;
height: number;
size: number;
}
export interface StrapiImage extends StrapiMedia {
width: number;
height: number;
formats: {
small: StrapiImageFormat;
medium: StrapiImageFormat;
thumbnail: StrapiImageFormat;
}
}
export interface StrapiResponse<T> {
data: T;
meta: {
pagination: {
page: number;
pageSize: number;
pageCount: number;
total: number;
}
}
}

View File

@ -1,3 +0,0 @@
export * from './common';
export * from './production';
export * from './singleTypes';

View File

@ -1,26 +0,0 @@
import type { StrapiEntity, StrapiImage, StrapiMedia } from './common';
export interface ProductionType extends StrapiEntity {
type: string;
}
export interface ProductionSpecItem {
label: string;
value: string;
}
export interface ProductionSpecGroup {
title: string;
items: ProductionSpecItem[];
}
export interface Production extends StrapiEntity {
title: string;
summary: string;
production_type: ProductionType;
production_image: StrapiImage;
production_details: string;
production_specs: ProductionSpecGroup[];
documents: StrapiMedia[];
show_in_production_list: boolean;
}

View File

@ -1,7 +0,0 @@
export interface StrapiCompanyProfile extends StrapiEntity {
content: string;
}
export interface StrapiContactInfo extends StrapiEntity {
content: string;
}

45
app/utils/autoMap.ts Normal file
View File

@ -0,0 +1,45 @@
async function testSpeed(url: string, timeout = 1500) {
const start = performance.now();
try {
await Promise.race([
fetch(url, { method: 'HEAD', mode: 'no-cors' }),
new Promise((_, reject) => setTimeout(() => reject('timeout'), timeout)),
]);
return performance.now() - start;
} catch {
return Infinity; // unreachable or timed out
}
}
async function selectBestMap() {
const testTargets = {
// amap: 'https://www.amap.com/favicon.ico',
baidu: 'https://map.baidu.com/favicon.ico',
google: 'https://maps.google.com/favicon.ico',
};
const results: Record<string, number> = {};
for (const key in testTargets) {
results[key] = await testSpeed(testTargets[key]);
}
logger.debug(results);
// 根据延迟排序,选择最稳最快的平台
return Object.entries(results).sort((a, b) => a[1] - b[1])[0][0];
}
export async function getAutoMappedService(): Promise<string> {
const target = {
// amap: 'https://surl.amap.com/2dYNorIJ1dgoN',
baidu: 'https://j.map.baidu.com/f9/c3x',
google: 'https://maps.app.goo.gl/9LqvMwEq7VaRkqnM6',
};
const fastestMap = await selectBestMap();
return target[fastestMap];
}

47
app/utils/file.test.ts Normal file
View File

@ -0,0 +1,47 @@
import { expect, test, describe } from 'vitest';
import { formatFileSize, getFileExtension, formatFileExtension } from './file';
/**
* 单元测试: formatFileSize
*/
describe('formatFileSize', () => {
test('format bytes correctly', () => {
expect(formatFileSize(500)).toBe('500.00 B');
});
test('format kilobytes correctly', () => {
expect(formatFileSize(2048)).toBe('2.00 KB');
});
test('format megabytes correctly', () => {
expect(formatFileSize(5 * 1024 * 1024)).toBe('5.00 MB');
});
});
/**
* 单元测试: getFileExtension
*/
describe('getFileExtension', () => {
test('extract extension from filename', () => {
expect(getFileExtension('document.pdf')).toBe('pdf');
});
test('handle filenames without extension', () => {
expect(getFileExtension('README')).toBe('');
});
test('handle multiple dots in filename', () => {
expect(getFileExtension('archive.tar.gz')).toBe('gz');
});
test('handle empty filename', () => {
expect(getFileExtension('')).toBe('');
});
});
/**
* 单元测试: formatFileExtension
*/
describe('formatFileExtension', () => {
test('format extension without dot', () => {
expect(formatFileExtension('txt')).toBe('TXT');
});
test('format extension with dot', () => {
expect(formatFileExtension('.jpg')).toBe('JPG');
});
});

21
app/utils/file.ts Normal file
View File

@ -0,0 +1,21 @@
export function formatFileSize(sizeInBytes: number): string {
if (sizeInBytes < 1024) {
return `${sizeInBytes.toFixed(2)} B`;
} else if (sizeInBytes < 1024 * 1024) {
const sizeInKB = sizeInBytes / 1024;
return `${sizeInKB.toFixed(2)} KB`;
} else {
const sizeInMB = sizeInBytes / 1024 / 1024;
return `${sizeInMB.toFixed(2)} MB`;
}
}
export function getFileExtension(filename: string): string {
const lastDotIndex = filename.lastIndexOf('.');
if (lastDotIndex === -1) return ''; // 找不到拓展名
return filename.slice(lastDotIndex + 1);
}
export function formatFileExtension(ext: string): string {
return ext.startsWith('.') ? ext.slice(1).toUpperCase() : ext.toUpperCase();
}

108
app/utils/fuzzyFilter.ts Normal file
View File

@ -0,0 +1,108 @@
import Fuse from 'fuse.js';
interface FuzzyFilterOptions<T> {
/** 匹配关键字 */
keyword: string;
/** 搜索字段 */
keys: Array<FuzzyKeyOf<T>>;
/** 模糊程度 (0~1越低越严格) */
threshold?: number;
/** 最小匹配字符数 */
minMatchCharLength?: number;
/** 当前语言 */
locale?: string;
}
/** 限定 keys 只能选择字符串字段 */
type FuzzyKeyOf<T> = {
[K in keyof T]: T[K] extends string ? K : never;
}[keyof T];
export function fuzzyMatch<T extends object>(
source: T[],
options: FuzzyFilterOptions<T>
): T[] {
const { keyword, keys, threshold = 0.35, minMatchCharLength = 1 } = options;
// --- 文本标准化函数 ---
const normalizeText = (text: string): string => {
const normalizedText = text.normalize('NFKC').toLowerCase().trim();
return normalizedText;
};
/**
* 类型安全的对象取值函数
*/
function getPropertyByPath<T>(
obj: T,
path: string | string[]
): string | undefined {
const keys = Array.isArray(path) ? path : path.split('.');
let value: unknown = obj;
for (const key of keys) {
if (value && typeof value === 'object' && key in value) {
value = (value as Record<string, unknown>)[key];
} else {
return undefined;
}
}
return typeof value === 'string' ? value : undefined;
}
// --- fallback 模糊匹配算法 ---
const fallbackFuzzyMatch = (text: string, pattern: string): boolean => {
const normalizedText = normalizeText(text);
const normalizedPattern = normalizeText(pattern);
let i = 0;
for (const char of normalizedPattern) {
i = normalizedText.indexOf(char, i);
if (i === -1) return false;
i++;
}
return true;
};
const k = keyword.trim();
if (!k) {
return source;
}
if (import.meta.client) {
// 客户端使用Fuze.js进行模糊匹配
const fuse = new Fuse<T>(source, {
keys: keys as string[],
threshold,
minMatchCharLength,
ignoreLocation: true,
findAllMatches: true,
isCaseSensitive: false,
getFn: (obj, path) => {
const value = getPropertyByPath(obj, path);
if (typeof value === 'string') {
const normalized = value
.normalize('NFKC')
.replace(/\s+/g, '')
.toLowerCase()
.trim();
return normalized;
}
return value;
},
});
const result = fuse.search(k);
return result.map((result) => result.item);
}
return source.filter((item) =>
keys.some((key) => {
const value = item[key];
return typeof value === 'string' ? fallbackFuzzyMatch(value, k) : false;
})
);
}

View File

@ -0,0 +1,30 @@
import type { HtmlRenderMap } from '@/composables/useHtmlRenderer';
import { h } from 'vue';
import MarkdownTable from '@/components/shared/MarkdownTable.vue';
export const defaultHtmlRenderMap: HtmlRenderMap = {
h1: (_, children) => h('h1', {}, children),
h2: (_, children) => h('h2', {}, children),
p: (_, children) => h('p', {}, children),
// table: (_, children) => h('div', {}, [h('table', {}, children)]),
table: (node) => {
const { headers, rows } = parseHtmlTable(node);
return h(
'div',
{},
h(MarkdownTable, {
headers,
rows,
})
);
},
img: (node) =>
h('img', {
src: node.attribs?.src,
}),
};

View File

@ -5,17 +5,16 @@ const md = new MarkdownIt({
linkify: true, linkify: true,
typographer: true, typographer: true,
breaks: true, breaks: true,
}) });
export function renderMarkdown(content: string): string { export function renderMarkdown(content: string): string {
const dirtyHtml = md.render(content); const dirtyHtml = md.render(content);
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
import('dompurify').then((DOMPurify => { import('dompurify').then((DOMPurify) => {
return DOMPurify.default.sanitize(dirtyHtml) return DOMPurify.default.sanitize(dirtyHtml);
})) });
} }
return dirtyHtml return dirtyHtml;
} }

90
app/utils/parseTable.ts Normal file
View File

@ -0,0 +1,90 @@
import type { Element, Node } from 'domhandler';
export interface ParsedTable {
headers: string[];
rows: Record<string, string>[];
}
const isElement = (n: Node): n is Element => n.type === 'tag';
export function parseHtmlTable(table: Element): ParsedTable {
if (table.name !== 'table') {
throw new Error('parseHtmlTable: node is not <table>');
}
// 获取 table 下的所有 tag 子节点
const getChildren = (node: Node): Element[] =>
isElement(node) ? node.children.filter(isElement) : [];
// ---- 找 thead / tbody ----
const children = getChildren(table);
const thead = children.find((n) => n.name === 'thead');
const tbody = children.find((n) => n.name === 'tbody');
if (!tbody) {
return { headers: [], rows: [] };
}
const bodyRows = getChildren(tbody).filter((n) => n.name === 'tr');
if (bodyRows.length === 0) {
return { headers: [], rows: [] };
}
// ---- 1. 表头 ----
let headerCells: Element[] = [];
if (thead) {
// 如果 Directus 有 thead一般不会
const headerRow = getChildren(thead).find((n) => n.name === 'tr');
headerCells = headerRow
? getChildren(headerRow).filter((n) => n.name === 'th' || n.name === 'td')
: [];
} else {
// Directus 情况:没有 thead → 用 tbody 第一行作为 header
headerCells = getChildren(bodyRows[0]).filter(
(n) => n.name === 'th' || n.name === 'td'
);
}
logger.info(headerCells);
const headers = headerCells.map((cell, i) => {
const text = cell.children
.filter((c) => c.type === 'text')
.map((t) => t.data.trim())
.filter(Boolean)
.join('');
return text || `${i + 1}`;
});
// ---- 2. 数据行 ----
// 如果没有 thead则跳过第一行它是 header
const dataRows = thead ? bodyRows : bodyRows.slice(1);
const rows = dataRows.map((row) => {
const cells = getChildren(row).filter(
(n) => n.name === 'td' || n.name === 'th'
);
const record: Record<string, string> = {};
headers.forEach((header, i) => {
const cell = cells[i];
if (!cell) {
record[header] = '';
} else {
const text = cell.children
.filter((c) => c.type === 'text')
.map((t) => t.data.trim())
.filter(Boolean)
.join('');
record[header] = text;
}
});
return record;
});
logger.info(headers, rows);
return { headers, rows };
}

2772
bun.lock

File diff suppressed because it is too large Load Diff

3
commitlint.config.mjs Normal file
View File

@ -0,0 +1,3 @@
export default {
extends: ['@commitlint/config-conventional'],
};

Some files were not shown because too many files have changed in this diff Show More