diff --git a/.agents/skills/frontend-design/LICENSE.txt b/.agents/skills/frontend-design/LICENSE.txt
new file mode 100644
index 0000000..f433b1a
--- /dev/null
+++ b/.agents/skills/frontend-design/LICENSE.txt
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/.agents/skills/frontend-design/SKILL.md b/.agents/skills/frontend-design/SKILL.md
new file mode 100644
index 0000000..5be498e
--- /dev/null
+++ b/.agents/skills/frontend-design/SKILL.md
@@ -0,0 +1,42 @@
+---
+name: frontend-design
+description: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
+license: Complete terms in LICENSE.txt
+---
+
+This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
+
+The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.
+
+## Design Thinking
+
+Before coding, understand the context and commit to a BOLD aesthetic direction:
+- **Purpose**: What problem does this interface solve? Who uses it?
+- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
+- **Constraints**: Technical requirements (framework, performance, accessibility).
+- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
+
+**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.
+
+Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:
+- Production-grade and functional
+- Visually striking and memorable
+- Cohesive with a clear aesthetic point-of-view
+- Meticulously refined in every detail
+
+## Frontend Aesthetics Guidelines
+
+Focus on:
+- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.
+- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
+- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.
+- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
+- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.
+
+NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.
+
+Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.
+
+**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
+
+Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
diff --git a/.agents/skills/uied-tools-fullstack-sync/SKILL.md b/.agents/skills/uied-tools-fullstack-sync/SKILL.md
new file mode 100644
index 0000000..c5ba59f
--- /dev/null
+++ b/.agents/skills/uied-tools-fullstack-sync/SKILL.md
@@ -0,0 +1,58 @@
+---
+name: uied-tools-fullstack-sync
+description: 用于 tools-web 项目的前后端联动开发与回归。适用于“纯前端工具 + likeadmin-go 后台 + Python AI服务”的接口设计、菜单权限、配额计费与联调验收。
+license: Internal project skill
+---
+
+本技能用于统一前后端协作方式,降低联调成本,避免“页面改了但接口未对齐”。
+
+## 适用场景
+
+- 新增后台管理能力:会员、配额、支付、配置中心
+- 新增 AI 服务能力:如抠图、OCR、文生图
+- 前端工具页接入后台鉴权与次数限制
+
+## 标准联调流程
+
+1. 定义接口契约
+先确定 URL、请求参数、响应结构、错误码,不先写页面细节。
+
+2. 后台先给可调接口
+后台先返回稳定 JSON,哪怕先写 mock 数据也可以。
+
+3. 前端按契约接入
+前端只依赖契约字段,不直接猜后台结构。
+
+4. 菜单与权限同步
+后台新增菜单、按钮权限点,前端再挂页面入口。
+
+5. 闭环回归
+完成“保存配置 -> 接口返回 -> 前端生效 -> 异常提示”全链路验证。
+
+## 推荐目录约定
+
+- 前端工具站:`src/components/Tools/**`
+- 后台基座:`backend/likeadmin-go`
+- AI 服务:`backend/matting-service`(可扩展为 `backend/ai-services/*`)
+- 部署文档:`docs/ai-matting-baota-deploy.md`
+
+## 接口约定建议
+
+- 管理后台 API 前缀:`/api/admin/*`
+- AI 推理 API 前缀:`/api/matting/*`
+- 统一返回结构:`{ code, msg, data, traceId }`
+- 统一错误码:鉴权、配额不足、任务失败、超时、参数错误
+
+## 回归清单(每次发版至少执行)
+
+1. 登录态接口是否正常(未登录/已登录)
+2. 配额扣减是否准确(成功扣次、失败不扣次)
+3. 关键工具路由是否可达
+4. 工具主按钮是否可点击并返回结果
+5. 失败场景是否有明确错误提示
+
+## 项目当前建议
+
+- 大版本阶段先保持“前端站点稳定”,后台能力增量接入。
+- AI 模型推理放 Python 服务,likeadmin-go 专注业务与运营管理。
+
diff --git a/.gitignore b/.gitignore
index f7cd987..3f9bdd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,9 @@ pnpm-debug.log*
public/sitemap.txt
UIED-Tools/
+*.zip
+backups/
+backend/likeadmin-go/
+.runtime/
+backend/data/
+backend/matting-service/.venv/
diff --git a/README.md b/README.md
index 2595a54..87f25ed 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,29 @@
-# UIED Tools - 免费在线工具集合
+# UIED Tools - 免费在线工具集合与AI学习平台
-> 最近更新:修改了文档说明,优化了项目结构介绍
+> 最近更新:新增AI学习平台、资讯热榜及多个设计开发工具
-这是一个功能丰富的免费在线工具集合网站,集成了多种实用工具,包括 AI 工具、设计工具、开发工具等。该项目旨在为设计师、开发者和普通用户提供一站式工具解决方案,提高工作效率。
+这是一个功能丰富的免费在线工具集合网站,专注于为设计师、开发者和 AI 爱好者提供一站式解决方案。项目不仅集成了 AI 工具、设计工具、开发工具,还提供了丰富的 AI 学习资源和资讯。
+
+**在线资源矩阵:**
+- **在线工具站**:[UIED免费在线工具集](https://uiedtool.com/)
+- **AI学习平台**:[UIED官网](https://www.uied.cn/)
+- **AI资讯热榜**:[AI资讯热榜](https://hot.uied.cn)
+- **AI工具导航**:[AI工具导航](https://hao.uied.cn/ai)
+- **AI知识库**:[AIGC知识共享社区](https://ai.feishu.cn/wiki/ZjddwTFpWivK6ukwBoDc5DoHnVt?from=from_copylink)
-在线站点:UIED免费在线工具集

## 更新日志
-更新日志2025.5.11
+查看完整更新日志
### 项目亮点
-- **丰富多样的工具**:提供超过80种常用工具,覆盖设计、开发、文本处理、图片处理等多个领域,持续更新中。
-- **简洁易用的界面**:采用直观的UI设计,让用户快速找到并使用所需工具
-- **完全免费**:所有工具完全免费使用,无需注册和付费
-- **持续更新**:定期添加新工具,不断优化已有功能
+- **AI 赋能**:集成 AI 对话、AI 绘画、AI 资讯等前沿工具,助你拥抱 AIGC 时代。
+- **设计师友好**:提供色彩提取、渐变生成、对比度检测、玻璃拟态等专属设计工具。
+- **丰富多样**:提供超过 227+ 种常用工具,覆盖设计、开发、文本处理、图片处理等多个领域。
+- **简洁易用**:采用直观的 UI 设计,让用户快速找到并使用所需工具。
+- **完全免费**:所有工具完全免费使用,无需注册和付费。
+- **持续更新**:定期添加新工具,不断优化已有功能。
- **开源共享**:项目代码完全开源,欢迎社区贡献和改进
- **中文优化**:专为中文用户设计,提供本地化的使用体验
diff --git a/backend/README.md b/backend/README.md
new file mode 100644
index 0000000..17dcf5b
--- /dev/null
+++ b/backend/README.md
@@ -0,0 +1,80 @@
+# 后台接入说明(likeadmin-go)
+
+本目录用于承载 `likeadmin-go` 后台基座与后续会员/配额/支付能力。
+
+## 当前状态
+
+- 已完成前端源码备份:`/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/backups/frontend-src-20260321-185054.tar.gz`
+- 已拉取后台基座:`/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/backend/likeadmin-go`
+- 已初始化抠图微服务骨架:`/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/backend/matting-service`
+
+## 推荐架构(与你当前纯前端项目兼容)
+
+- 前端站点:当前 `tools-web`(继续独立发布)
+- 后台系统:`likeadmin-go`(菜单/权限/会员/订单/配置)
+- AI 推理服务:独立 Python 服务(抠图模型推理)
+- 对外网关:Nginx(按路径转发)
+
+## 首次启动(本地)
+
+1. 启动基础依赖(MySQL + Redis)
+
+```bash
+cd /Users/tangxiaoda/Desktop/网站备份/tools-web-master\ 2/tools-web/backend
+docker compose up -d
+```
+
+2. 初始化 likeadmin-go
+
+```bash
+cd /Users/tangxiaoda/Desktop/网站备份/tools-web-master\ 2/tools-web
+bash scripts/backend/bootstrap-likeadmin-go.sh
+```
+
+3. 导入 SQL(根据 likeadmin-go/sql 目录选择)
+
+4. 启动服务端
+
+```bash
+cd /Users/tangxiaoda/Desktop/网站备份/tools-web-master\ 2/tools-web/backend/likeadmin-go/server
+go run main.go
+```
+
+## 一键全栈启动(推荐)
+
+在项目根目录执行:
+
+```bash
+npm run dev:fullstack:start
+```
+
+该命令会自动完成:
+
+- 启动 MySQL/Redis
+- 初始化 `uiedtool` 数据库(首次)
+- 启动 likeadmin-go 服务端
+- 启动 likeadmin-go 后台前端
+- 启动抠图 Python 服务
+- 启动 tools-web 前端
+
+说明:
+
+- 各服务端口会自动避让冲突(从默认起始端口向后顺延)。
+- 数据库名称固定为 `uiedtool`。
+
+更多命令见:
+
+- `npm run dev:fullstack:status`
+- `npm run dev:fullstack:stop`
+- `npm run dev:fullstack:stop:all`
+
+## 大版本注意事项
+
+- 前端与后台先分仓思路推进,避免一次性混改。
+- 先打通登录/菜单/配置中心,再挂会员与配额,不要直接改业务工具逻辑。
+- 抠图能力建议走独立推理服务,后台只做鉴权、计费、配额和审计日志。
+
+## 新手部署指引
+
+- 宝塔部署文档:`/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/docs/ai-matting-baota-deploy.md`
+- 一键启动脚本:`/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/scripts/backend/run-matting-service.sh`
diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml
new file mode 100644
index 0000000..244f509
--- /dev/null
+++ b/backend/docker-compose.yml
@@ -0,0 +1,27 @@
+services:
+ mysql:
+ image: mysql:8.0
+ restart: unless-stopped
+ environment:
+ MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root123456}
+ MYSQL_DATABASE: ${MYSQL_DATABASE:-uiedtool}
+ MYSQL_USER: ${MYSQL_USER:-uiedtool}
+ MYSQL_PASSWORD: ${MYSQL_PASSWORD:-uiedtool123}
+ TZ: ${TZ:-Asia/Shanghai}
+ command:
+ - --default-authentication-plugin=mysql_native_password
+ - --character-set-server=utf8mb4
+ - --collation-server=utf8mb4_general_ci
+ ports:
+ - "${MYSQL_PORT:-33069}:3306"
+ volumes:
+ - ./data/mysql:/var/lib/mysql
+
+ redis:
+ image: redis:7-alpine
+ restart: unless-stopped
+ command: ["redis-server", "--appendonly", "yes"]
+ ports:
+ - "${REDIS_PORT:-16379}:6379"
+ volumes:
+ - ./data/redis:/data
diff --git a/backend/matting-service/README.md b/backend/matting-service/README.md
new file mode 100644
index 0000000..d4e4be0
--- /dev/null
+++ b/backend/matting-service/README.md
@@ -0,0 +1,43 @@
+# Matting Service(ModelScope 通用抠图)
+
+## 说明
+
+该服务用于承接你指定的模型:
+
+- `iic/cv_unet_universal-matting`
+- 模型页:
+
+服务职责:
+
+- 接收前端上传图片
+- 本地执行抠图
+- 返回透明 PNG 结果
+
+## 本地运行
+
+```bash
+cd /Users/tangxiaoda/Desktop/网站备份/tools-web-master\ 2/tools-web/backend/matting-service
+python3 -m venv .venv
+source .venv/bin/activate
+pip install -r requirements.txt
+uvicorn app:app --host 0.0.0.0 --port 8091 --reload
+```
+
+## 接口
+
+- `GET /health`:健康检查
+- `POST /matting`:上传文件字段名 `file`
+
+示例:
+
+```bash
+curl -X POST "http://127.0.0.1:8091/matting" \
+ -F "file=@/absolute/path/to/test.png" \
+ --output result.png
+```
+
+## 注意事项
+
+- 第一次调用会下载模型权重,耗时较长。
+- 当前限制单图最大 12MB,可按需求调整。
+- 线上建议接入对象存储、任务队列与鉴权层。
diff --git a/backend/matting-service/app.py b/backend/matting-service/app.py
new file mode 100644
index 0000000..f343e1c
--- /dev/null
+++ b/backend/matting-service/app.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+@copyright Tomda (https://www.tomda.top)
+@copyright UIED技术团队 (https://fsuied.com)
+@author UIED技术团队
+@createDate 2026-03-21
+"""
+
+from __future__ import annotations
+
+import os
+import tempfile
+from typing import Optional
+
+import cv2
+from fastapi import FastAPI, File, HTTPException, UploadFile
+from fastapi.responses import FileResponse, JSONResponse
+from modelscope.outputs import OutputKeys
+from modelscope.pipelines import pipeline
+from modelscope.utils.constant import Tasks
+
+app = FastAPI(title="UIED Matting Service", version="0.1.0")
+
+_matting_pipeline: Optional[object] = None
+MODEL_ID = "iic/cv_unet_universal-matting"
+MAX_UPLOAD_MB = 12
+
+
+def get_matting_pipeline():
+ """初始化并缓存抠图模型管线,避免每次请求重复加载模型。"""
+ global _matting_pipeline
+ if _matting_pipeline is None:
+ _matting_pipeline = pipeline(Tasks.universal_matting, model=MODEL_ID)
+ return _matting_pipeline
+
+
+def save_upload_to_temp(file: UploadFile) -> str:
+ """将上传文件落盘到临时目录,供 ModelScope 管线读取。"""
+ suffix = os.path.splitext(file.filename or "")[-1] or ".png"
+ with tempfile.NamedTemporaryFile(delete=False, suffix=suffix) as tmp:
+ content = file.file.read()
+ tmp.write(content)
+ return tmp.name
+
+
+def write_result_png(result_img, output_path: str) -> None:
+ """将模型输出写为 PNG,输出透明背景图。"""
+ ok = cv2.imwrite(output_path, result_img)
+ if not ok:
+ raise RuntimeError("写入抠图结果失败")
+
+
+@app.get("/health")
+def health():
+ """健康检查接口,用于部署探活。"""
+ return JSONResponse({"ok": True, "service": "matting-service", "model": MODEL_ID})
+
+
+@app.post("/matting")
+def matting(file: UploadFile = File(...)):
+ """执行通用抠图:上传图片后返回透明 PNG 文件。"""
+ if not file.content_type or not file.content_type.startswith("image/"):
+ raise HTTPException(status_code=400, detail="仅支持图片文件上传")
+
+ file.file.seek(0, os.SEEK_END)
+ size_bytes = file.file.tell()
+ file.file.seek(0)
+ if size_bytes > MAX_UPLOAD_MB * 1024 * 1024:
+ raise HTTPException(status_code=400, detail=f"图片过大,限制 {MAX_UPLOAD_MB}MB")
+
+ input_path = None
+ output_path = None
+ try:
+ input_path = save_upload_to_temp(file)
+ output_path = tempfile.NamedTemporaryFile(delete=False, suffix=".png").name
+
+ matting_pipe = get_matting_pipeline()
+ result = matting_pipe(input_path)
+ output_img = result.get(OutputKeys.OUTPUT_IMG)
+ if output_img is None:
+ raise RuntimeError("模型未返回有效结果")
+
+ write_result_png(output_img, output_path)
+ return FileResponse(
+ path=output_path,
+ media_type="image/png",
+ filename=f"{os.path.splitext(file.filename or 'matting')[0]}-matting.png",
+ )
+ except HTTPException:
+ raise
+ except Exception as exc:
+ raise HTTPException(status_code=500, detail=f"抠图失败: {str(exc)}") from exc
+ finally:
+ if input_path and os.path.exists(input_path):
+ os.remove(input_path)
+
diff --git a/backend/matting-service/requirements.txt b/backend/matting-service/requirements.txt
new file mode 100644
index 0000000..534d65f
--- /dev/null
+++ b/backend/matting-service/requirements.txt
@@ -0,0 +1,6 @@
+fastapi==0.111.0
+uvicorn[standard]==0.30.1
+python-multipart==0.0.9
+modelscope==1.19.1
+opencv-python-headless==4.10.0.84
+numpy==1.26.4
diff --git a/development-log.md b/development-log.md
new file mode 100644
index 0000000..061e4ab
--- /dev/null
+++ b/development-log.md
@@ -0,0 +1,58 @@
+
+
+# 开发记录
+
+## 2026-01-28
+### 开发辅助能力增强
+- 安装 frontend-design skill 到 .agents/skills 目录,增强前端设计与开发辅助能力
+- 路径:.agents/skills/frontend-design
+
+## 2026-01-27
+### PDF 功能统一与优化
+- 统一 PDF.js worker 引用为 public 根路径,减少各工具重复打包与加载
+- 补齐并统一 PDF 文件校验逻辑(类型与大小),提高一致性与用户提示准确性
+- 按规范更新工具页版权信息块
+- 为关键函数补充中文函数级注释,提升代码可维护性
+- 通过 vue-tsc 与构建校验验证改动有效性
+
+- 更新文件与关键行号:
+ - src/utils/pdf.ts(L1-L6, L21-L31)
+ - src/components/Tools/PdfEncrypt/index.vue(L1-L8, L137-L151, L256-L274, L285-L326)
+ - src/components/Tools/PdfMerge/index.vue(L1-L8, L228-L233)
+ - src/components/Tools/PdfRotate/index.vue(L1-L8, L206-L211)
+ - src/components/Tools/PdfSplit/index.vue(L1-L8, L178-L191)
+ - src/components/Tools/PdfWatermark/index.vue(L1-L8, L178-L191)
+ - src/components/Tools/PdfPageNumber/index.vue(L1-L8, L185-L198, L310-L330, L391-L459)
+ - src/components/Tools/PdfExtractText/index.vue(L1-L8, L184-L196, L306-L326, L337-L421)
+ - src/components/Tools/PdfSign/index.vue(L1-L8, L139-L152, L250-L269, L410-L477)
+ - src/components/Tools/PdfToImages/index.vue(L1-L8, L254-L266, L413-L417, L298-L320)
+- 为视频转 GIF 增加超过 5 次需公众号密码验证的限制,复用 DeepSeek 验证逻辑与提示文案
+- 抽离“关注公众号获取密码”弹窗为可复用组件,支持自定义文案与按钮文案
+- 修复工具详情获取方法缺失,新增根据路由或ID匹配工具信息逻辑
+- 更新文件:src/store/modules/tools.ts
+- 修复外包报价与小红书等 AI 工具的类型与逻辑报错
+- 更新文件:src/components/Tools/AI/AIOutsourceQuote.vue、src/components/Tools/AI/AIRanking.vue、src/components/Tools/AI/AIResume.vue、src/components/Tools/AI/OCRRecognition.vue、src/components/Tools/AI/XiaoHongShu.vue、src/components/Tools/AI/XunfeiSpark.vue
+- 修复 Header 与字体页面的类型报错
+- 更新文件:src/components/Layout/Header/Header.vue、src/components/Tools/Design/Font.vue
+- 视频转 GIF 标题增加“免费”,修复转换流程与 workerScript 引用
+- 更新文件:src/components/Tools/Video/VideoToGif/VideoToGif.vue(L12-L209, L320-L322)
+- 补充项目开发规范条目
+- 更新文件:.trae/rules/guifan.md(L2-L6)
+- 根据项目现状完善规范,补充工具页版权块、路由/工具配置同步、worker 路径与类型定义要求
+- 更新文件:.trae/rules/guifan.md(L1-L13)
+- 拆分工具配置逻辑为常量数据,并统一工具类型定义引用
+- 合并重复路由入口,统一 PDF 与 AI 快讯标题规则,移除重复的 AI 分析报告入口
+- 更新文件:src/components/Tools/tools.ts(L1-L3827)
+- 更新文件:src/types/tools.ts(L1-L50)
+- 更新文件:src/store/modules/tools.ts(L1-L223)
+- 更新文件:src/components/Home/Home.vue(L18-L36)
+- 更新文件:src/components/Tools/RandomTools/RandomTools.vue(L110-L159)
+- 更新文件:src/components/Layout/Left/Left.vue(L17-L535)
+- 更新文件:src/router/router.ts(L152-L999, L1262-L1271, L2658-L2666)
diff --git a/docs/ai-matting-baota-deploy.md b/docs/ai-matting-baota-deploy.md
new file mode 100644
index 0000000..da6b740
--- /dev/null
+++ b/docs/ai-matting-baota-deploy.md
@@ -0,0 +1,130 @@
+
+
+# AI 抠图(ModelScope)宝塔部署指南(新手版)
+
+适用场景:
+
+- 现有前端项目继续纯前端发布
+- 新增后端(likeadmin-go)管理会员/配额/支付
+- AI 抠图由独立 Python 服务处理
+
+使用模型:
+
+- `iic/cv_unet_universal-matting`
+- 模型地址:
+
+## 一、先理解整体架构
+
+- 前端站点(Nginx 静态)
+ `https://你的域名`
+- likeadmin-go 后台(Go 服务)
+ `http://127.0.0.1:8080`(示例)
+- 抠图服务(Python + FastAPI)
+ `http://127.0.0.1:8091`
+- 业务数据库(MySQL)
+ 建议库名统一:`uiedtool`
+- Nginx 反向代理
+ - `/api/admin/*` -> likeadmin-go
+ - `/api/matting/*` -> matting-service
+
+## 二、为什么不建议“把模型手工上传到宝塔”
+
+新手最稳方案是:
+
+- 在服务器上运行 Python 抠图服务
+- 第一次调用时由 `modelscope` 自动下载模型到本机缓存目录
+
+优点:
+
+- 不用你先处理模型格式和目录细节
+- 后续升级模型更简单
+
+## 三、服务器准备(宝塔)
+
+1. 宝塔安装 Python 3.10+(建议 3.10/3.11)
+2. 安装 `supervisor`(宝塔进程守护)
+3. 安装 Nginx
+4. 服务器需要能访问 ModelScope(首次下载模型)
+
+## 四、上传代码到服务器
+
+上传目录建议:
+
+```bash
+/www/wwwroot/uied-tools/backend/matting-service
+```
+
+把本地这些文件上传上去:
+
+- `backend/matting-service/app.py`
+- `backend/matting-service/requirements.txt`
+- `scripts/backend/run-matting-service.sh`
+
+## 五、初始化并启动抠图服务
+
+服务器执行:
+
+```bash
+cd /www/wwwroot/uied-tools/backend/matting-service
+bash /www/wwwroot/uied-tools/scripts/backend/run-matting-service.sh
+```
+
+默认端口:`8091`
+健康检查:`http://127.0.0.1:8091/health`
+
+## 六、用 Supervisor 托管(建议)
+
+Supervisor 启动命令示例:
+
+```bash
+cd /www/wwwroot/uied-tools/backend/matting-service && \
+source .venv/bin/activate && \
+uvicorn app:app --host 127.0.0.1 --port 8091 --workers 1
+```
+
+说明:
+
+- `workers=1` 是为了降低内存占用,新手先这样最稳
+- 后续压力上来再扩容
+
+## 七、Nginx 反向代理
+
+在站点配置里增加:
+
+```nginx
+location /api/matting/ {
+ proxy_pass http://127.0.0.1:8091/;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_read_timeout 300;
+}
+```
+
+## 八、前端如何调用
+
+前端统一调用:
+
+- `POST /api/matting/matting`(上传图片字段名 `file`)
+
+不要在前端直接放模型,也不要让浏览器下载 220MB 权重。
+
+## 九、常见问题(新手高频)
+
+1. 首次请求很慢
+原因:模型首次下载 + 初始化。正常现象。
+
+2. 内存不足
+降低并发、限制上传大小(比如 12MB),必要时升级服务器。
+
+3. 超时
+Nginx 的 `proxy_read_timeout` 要调大,建议 300 秒。
+
+4. 后续会员限制怎么做
+放在 likeadmin-go:登录、次数、套餐、订单。
+抠图服务只做推理,和业务逻辑解耦。
diff --git a/docs/development-log.md b/docs/development-log.md
new file mode 100644
index 0000000..e69de29
diff --git a/docs/fullstack-one-click-dev.md b/docs/fullstack-one-click-dev.md
new file mode 100644
index 0000000..f10b6ea
--- /dev/null
+++ b/docs/fullstack-one-click-dev.md
@@ -0,0 +1,90 @@
+
+
+# 一键启动前后端(含数据库)
+
+适用于本项目本地联调:
+
+- 工具前端(Vite)
+- likeadmin-go 后台 API(Go)
+- likeadmin-go 后台前端(Vite)
+- AI 抠图服务(Python/FastAPI)
+- MySQL + Redis(Docker)
+
+## 一键启动
+
+首次需要先确保目录存在:
+
+```bash
+/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/backend/likeadmin-go
+```
+
+如不存在,请先拉取:
+
+```bash
+cd /Users/tangxiaoda/Desktop/网站备份/tools-web-master\ 2/tools-web
+mkdir -p backend
+git clone --depth 1 https://gitee.com/likeadmin/likeadmin_go.git backend/likeadmin-go
+```
+
+然后执行:
+
+```bash
+cd /Users/tangxiaoda/Desktop/网站备份/tools-web-master\ 2/tools-web
+npm run dev:fullstack:start
+```
+
+## 查看状态
+
+```bash
+npm run dev:fullstack:status
+```
+
+## 停止服务
+
+仅停止前后端进程(保留数据库容器):
+
+```bash
+npm run dev:fullstack:stop
+```
+
+停止全部(包括 MySQL/Redis):
+
+```bash
+npm run dev:fullstack:stop:all
+```
+
+## 端口与数据库
+
+脚本使用以下“起始端口”,如冲突会自动顺延到可用端口:
+
+- 工具前端起始:`5179`
+- 后台前端起始:`5180`
+- 后台 API 起始:`8001`
+- 抠图服务起始:`8091`
+- MySQL 起始:`33069`
+- Redis 起始:`16379`
+
+数据库名固定为:`uiedtool`
+
+查看当前实际端口:
+
+```bash
+npm run dev:fullstack:status
+```
+
+如需固定某个端口,可在启动前设置环境变量,例如:
+
+```bash
+TOOLS_PORT=5279 GO_API_PORT=9001 npm run dev:fullstack:start
+```
+
+## 首次启动说明
+
+1. 脚本会自动起数据库并检测初始化 `uiedtool` 库中的 `la_admin` 表结构。
+2. 脚本会自动生成并覆盖 likeadmin 本地联调环境变量。
+3. 抠图服务首次调用会下载模型,首次会比较慢。
diff --git a/generate_components.py b/generate_components.py
new file mode 100644
index 0000000..c8fdd77
--- /dev/null
+++ b/generate_components.py
@@ -0,0 +1,449 @@
+import os
+
+# 组件配置列表
+components = [
+ {
+ "name": "CustomAnalysis",
+ "title": "自定义分析报告",
+ "desc": "针对特定需求生成的深度分析报告,支持自定义分析维度和结构",
+ "icon": "ChartBarIcon",
+ "color": "indigo",
+ "inputs": [
+ {"label": "分析主题", "model": "topic", "placeholder": "例如:2024年用户增长分析", "type": "input"},
+ {"label": "分析维度", "model": "dimensions", "placeholder": "例如:用户画像、留存率、转化路径...", "type": "textarea", "rows": 3},
+ {"label": "详细要求", "model": "requirements", "placeholder": "请输入具体的分析要求或侧重点...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请帮我撰写一份关于${topic}的分析报告。\n分析维度:${dimensions}\n具体要求:${requirements}\n\n要求:\n1. 结构严谨,逻辑清晰。\n2. 数据分析深入,观点独到。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "ResearchReport",
+ "title": "研究报告",
+ "desc": "智能生成学术或商业研究报告,包含研究背景、方法、发现和结论",
+ "icon": "AcademicCapIcon",
+ "color": "blue",
+ "inputs": [
+ {"label": "研究课题", "model": "topic", "placeholder": "例如:人工智能在医疗领域的应用现状", "type": "input"},
+ {"label": "研究背景", "model": "background", "placeholder": "简述研究的起因或背景...", "type": "textarea", "rows": 3},
+ {"label": "研究目标", "model": "goal", "placeholder": "希望通过研究解决什么问题...", "type": "textarea", "rows": 2}
+ ],
+ "prompt_template": "请帮我撰写一份关于${topic}的研究报告。\n研究背景:${background}\n研究目标:${goal}\n\n要求:\n1. 包含摘要、背景、方法、主要发现和结论。\n2. 语言学术专业,论证严密。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "ActivityPlan",
+ "title": "活动方案",
+ "desc": "智能策划各类线上线下活动方案,包含创意亮点、流程安排和执行细节",
+ "icon": "CalendarDaysIcon",
+ "color": "rose",
+ "inputs": [
+ {"label": "活动名称", "model": "topic", "placeholder": "例如:双十一品牌促销活动", "type": "input"},
+ {"label": "活动目的", "model": "purpose", "placeholder": "例如:提升品牌知名度、增加销售额...", "type": "textarea", "rows": 2},
+ {"label": "目标人群", "model": "target", "placeholder": "例如:18-25岁大学生", "type": "input"},
+ {"label": "预算范围", "model": "budget", "placeholder": "例如:5-10万元", "type": "input"}
+ ],
+ "prompt_template": "请帮我策划一份${topic}的活动方案。\n活动目的:${purpose}\n目标人群:${target}\n预算范围:${budget}\n\n要求:\n1. 方案创意新颖,可行性强。\n2. 包含活动主题、时间地点、流程安排、推广计划和预算预估。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "BusinessPlan",
+ "title": "商业计划书",
+ "desc": "智能生成专业的商业计划书(BP),助力项目融资和商业路演",
+ "icon": "BriefcaseIcon",
+ "color": "amber",
+ "inputs": [
+ {"label": "项目名称", "model": "project", "placeholder": "例如:智能家居生态平台", "type": "input"},
+ {"label": "商业模式", "model": "model", "placeholder": "简述产品服务及盈利模式...", "type": "textarea", "rows": 3},
+ {"label": "核心优势", "model": "advantage", "placeholder": "例如:技术壁垒、团队资源...", "type": "textarea", "rows": 2},
+ {"label": "融资需求", "model": "financing", "placeholder": "例如:天使轮 500万 出让10%", "type": "input"}
+ ],
+ "prompt_template": "请帮我撰写一份${project}的商业计划书。\n商业模式:${model}\n核心优势:${advantage}\n融资需求:${financing}\n\n要求:\n1. 结构完整,包含执行摘要、市场分析、产品介绍、商业模式、竞争分析和财务预测。\n2. 语言精炼有力,突出投资价值。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "SurveyReport",
+ "title": "调研报告",
+ "desc": "智能生成市场调研或社会调查报告,深入分析数据背后的趋势",
+ "icon": "ClipboardDocumentListIcon",
+ "color": "cyan",
+ "inputs": [
+ {"label": "调研主题", "model": "topic", "placeholder": "例如:Z世代消费习惯调研", "type": "input"},
+ {"label": "调研对象", "model": "target", "placeholder": "例如:在一线城市工作的95后", "type": "input"},
+ {"label": "调研方法", "model": "method", "placeholder": "例如:问卷调查、深度访谈", "type": "input"},
+ {"label": "主要发现", "model": "findings", "placeholder": "简述调研得到的核心数据或现象...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请帮我撰写一份关于${topic}的调研报告。\n调研对象:${target}\n调研方法:${method}\n主要发现:${findings}\n\n要求:\n1. 分析深入,数据详实。\n2. 包含调研背景、方法、结果分析和建议。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "IndustryReport",
+ "title": "行业报告",
+ "desc": "智能分析行业发展现状、趋势和竞争格局,提供战略参考",
+ "icon": "BuildingOffice2Icon",
+ "color": "slate",
+ "inputs": [
+ {"label": "行业名称", "model": "industry", "placeholder": "例如:新能源汽车行业", "type": "input"},
+ {"label": "分析时段", "model": "period", "placeholder": "例如:2024-2025年", "type": "input"},
+ {"label": "关注重点", "model": "focus", "placeholder": "例如:技术趋势、政策影响、市场规模...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请帮我撰写一份${industry}的行业分析报告。\n分析时段:${period}\n关注重点:${focus}\n\n要求:\n1. 宏观分析与微观分析相结合。\n2. 包含市场规模、竞争格局、发展趋势和风险提示。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "FeasibilityReport",
+ "title": "可行性研究报告",
+ "desc": "全面评估项目的技术、经济和社会可行性,为决策提供依据",
+ "icon": "CheckBadgeIcon",
+ "color": "emerald",
+ "inputs": [
+ {"label": "项目名称", "model": "project", "placeholder": "例如:新建年产5万吨锂电池工厂", "type": "input"},
+ {"label": "建设内容", "model": "content", "placeholder": "简述项目建设的主要内容和规模...", "type": "textarea", "rows": 3},
+ {"label": "投资估算", "model": "investment", "placeholder": "例如:总投资2亿元", "type": "input"}
+ ],
+ "prompt_template": "请帮我撰写一份${project}的可行性研究报告。\n建设内容:${content}\n投资估算:${investment}\n\n要求:\n1. 从技术、经济、社会、环境等方面进行全面评估。\n2. 包含项目背景、必要性、可行性分析、风险评估和结论。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "ProjectApplication",
+ "title": "立项申请报告",
+ "desc": "智能生成规范的项目立项申请书,清晰阐述项目价值和实施计划",
+ "icon": "DocumentPlusIcon",
+ "color": "violet",
+ "inputs": [
+ {"label": "项目名称", "model": "project", "placeholder": "例如:企业数字化转型一期项目", "type": "input"},
+ {"label": "项目背景", "model": "background", "placeholder": "为什么要发起这个项目...", "type": "textarea", "rows": 3},
+ {"label": "预期收益", "model": "benefits", "placeholder": "项目完成后带来的经济或社会效益...", "type": "textarea", "rows": 2}
+ ],
+ "prompt_template": "请帮我撰写一份${project}的立项申请报告。\n项目背景:${background}\n预期收益:${benefits}\n\n要求:\n1. 论述充分,目标明确。\n2. 包含项目概况、必要性、实施方案、进度计划和预算需求。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "PESTAnalysis",
+ "title": "PEST分析",
+ "desc": "利用PEST模型从政治、经济、社会、技术四个维度分析宏观环境",
+ "icon": "GlobeAsiaAustraliaIcon",
+ "color": "sky",
+ "inputs": [
+ {"label": "分析对象", "model": "target", "placeholder": "例如:跨境电商行业、某公司出海战略", "type": "input"},
+ {"label": "背景信息", "model": "background", "placeholder": "补充相关的背景信息(可选)...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请运用PEST模型对${target}进行宏观环境分析。\n背景信息:${background}\n\n要求:\n1. 分别从政治(Political)、经济(Economic)、社会(Social)、技术(Technological)四个维度进行深入分析。\n2. 结合具体情况,给出战略建议。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "SWOTAnalysis",
+ "title": "SWOT分析",
+ "desc": "利用SWOT模型分析优势、劣势、机会和威胁,制定战略对策",
+ "icon": "ArrowsPointingOutIcon",
+ "color": "orange",
+ "inputs": [
+ {"label": "分析对象", "model": "target", "placeholder": "例如:某品牌新产品、个人职业发展", "type": "input"},
+ {"label": "具体情况", "model": "details", "placeholder": "简述分析对象的现状和面临的问题...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请运用SWOT模型对${target}进行战略分析。\n具体情况:${details}\n\n要求:\n1. 详细分析优势(Strengths)、劣势(Weaknesses)、机会(Opportunities)和威胁(Threats)。\n2. 基于分析结果,提出SO、WO、ST、WT战略组合建议。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "TransportPlan",
+ "title": "运输方案",
+ "desc": "智能规划物流运输路线和方式,优化成本和效率",
+ "icon": "TruckIcon",
+ "color": "lime",
+ "inputs": [
+ {"label": "货物类型", "model": "goods", "placeholder": "例如:精密仪器、生鲜食品", "type": "input"},
+ {"label": "起止地点", "model": "route", "placeholder": "例如:从上海到法兰克福", "type": "input"},
+ {"label": "运输要求", "model": "requirements", "placeholder": "例如:全程冷链、时效3天以内...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请帮我制定一份${goods}的运输方案。\n起止地点:${route}\n运输要求:${requirements}\n\n要求:\n1. 综合考虑成本、时效和安全性。\n2. 包含运输方式选择、路线规划、包装方案、风险控制和应急预案。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "SituationReport",
+ "title": "情况报告",
+ "desc": "客观陈述事件经过或当前状态,分析原因并提出处理意见",
+ "icon": "InformationCircleIcon",
+ "color": "zinc",
+ "inputs": [
+ {"label": "事件/情况", "model": "event", "placeholder": "例如:服务器宕机事故、突发公共卫生事件", "type": "input"},
+ {"label": "当前状态", "model": "status", "placeholder": "目前的情况如何...", "type": "textarea", "rows": 3},
+ {"label": "拟采取措施", "model": "measures", "placeholder": "计划如何处理...", "type": "textarea", "rows": 2}
+ ],
+ "prompt_template": "请帮我撰写一份关于${event}的情况报告。\n当前状态:${status}\n拟采取措施:${measures}\n\n要求:\n1. 实事求是,语言客观。\n2. 包含基本情况、原因分析、已采取措施、下一步计划和建议。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "SevenSAnalysis",
+ "title": "7S模型分析",
+ "desc": "利用麦肯锡7S模型全方位分析企业组织有效性",
+ "icon": "CubeTransparentIcon",
+ "color": "fuchsia",
+ "inputs": [
+ {"label": "分析对象", "model": "target", "placeholder": "例如:某公司的组织架构改革", "type": "input"},
+ {"label": "背景信息", "model": "background", "placeholder": "简述企业现状和存在的问题...", "type": "textarea", "rows": 3}
+ ],
+ "prompt_template": "请运用麦肯锡7S模型对${target}进行组织分析。\n背景信息:${background}\n\n要求:\n1. 从战略(Strategy)、结构(Structure)、制度(Systems)、人员(Staff)、风格(Style)、技能(Skills)、共同价值观(Shared Values)七个维度进行剖析。\n2. 分析各要素之间的相互作用和匹配程度,提出改进建议。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "Marketing4P",
+ "title": "4P营销分析",
+ "desc": "利用4P理论制定产品营销组合策略",
+ "icon": "ShoppingBagIcon",
+ "color": "pink",
+ "inputs": [
+ {"label": "产品/服务", "model": "product", "placeholder": "例如:新款智能手表", "type": "input"},
+ {"label": "目标市场", "model": "market", "placeholder": "例如:城市白领、运动爱好者", "type": "input"},
+ {"label": "营销目标", "model": "goal", "placeholder": "例如:首发月销量突破1万台", "type": "input"}
+ ],
+ "prompt_template": "请运用4P营销理论为${product}制定营销策略。\n目标市场:${market}\n营销目标:${goal}\n\n要求:\n1. 详细规划产品(Product)、价格(Price)、渠道(Place)和促销(Promotion)策略。\n2. 策略要具体可执行,符合市场定位。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "IndustryConsultant",
+ "title": "产业顾问",
+ "desc": "模拟资深产业顾问,解答行业疑惑,提供专业见解",
+ "icon": "UserGroupIcon",
+ "color": "teal",
+ "inputs": [
+ {"label": "咨询问题", "model": "question", "placeholder": "例如:未来5年光伏产业的发展前景如何?", "type": "textarea", "rows": 3},
+ {"label": "行业背景", "model": "context", "placeholder": "补充相关的行业或地区背景...", "type": "input"}
+ ],
+ "prompt_template": "你是一位资深的产业顾问,请回答以下问题:\n${question}\n行业背景:${context}\n\n要求:\n1. 观点专业,数据支撑。\n2. 结合产业链上下游进行分析。\n3. 给出具有前瞻性的判断和建议。\n4. 标题使用 Markdown 三级标题格式(### 标题)。"
+ },
+ {
+ "name": "StartupIdea",
+ "title": "创新创业金点子",
+ "desc": "结合个人优势和市场趋势,激发创新创业灵感",
+ "icon": "LightBulbIcon",
+ "color": "yellow",
+ "inputs": [
+ {"label": "感兴趣领域", "model": "field", "placeholder": "例如:银发经济、宠物市场", "type": "input"},
+ {"label": "个人优势/资源", "model": "advantage", "placeholder": "例如:懂技术、有供应链资源...", "type": "textarea", "rows": 2}
+ ],
+ "prompt_template": "请基于${field}领域,结合我的优势:${advantage},提供5个创新创业的金点子。\n\n要求:\n1. 每个点子包含项目名称、痛点分析、解决方案、商业模式和可行性评估。\n2. 点子要新颖且具有落地可能性。\n3. 标题使用 Markdown 三级标题格式(### 标题)。"
+ }
+]
+
+template = """
+
+
+
+
+
+
+
+
+
+
+
+ {title}
+
+
{desc}
+
+
+
+
+
+
+
+ <{icon} class="w-5 h-5" />
+
+ 配置信息
+
+
+
+{inputs_html}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 生成结果
+
+
+
+
+
+
+
+
+
+
+
+
+
在左侧输入信息,AI将为您生成{title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+"""
+
+base_path = "/Users/tangxiaoda/Desktop/网站备份/tools-web-master 2/tools-web/src/components/Tools/AI/Analysis"
+
+for comp in components:
+ inputs_html = ""
+ form_fields = ""
+ prompt_replacements = ""
+
+ for i, inp in enumerate(comp["inputs"]):
+ # HTML
+ inputs_html += f"""
+ PDF 压缩 /
+ PDF 合并 /
+ PDF 分割 /
+ PDF 删除 /
+ PDF 旋转 /
+ PDF 加密 /
+ PDF 水印 /
+ PDF 签名 /
+ PDF 提取文本 /
+ PDF 转图片 /
+ PDF 加页码
+ 统一改为运行时按需加载 pdfjs-dist 与 pdf-lib。
+