init: 2026Technology-Competition initial commit
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
# 指摘管理系统(IMS)技术构成简要说明
|
||||
|
||||
> **版本**:V4.1 | **日期**:2026-07-20
|
||||
>
|
||||
> AI驱动的指摘(缺陷/问题)全生命周期管理系统,以 Agent(智能体)为核心,实现"人机协同"的自动化管理。
|
||||
|
||||
---
|
||||
|
||||
## 一、整体架构
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐
|
||||
│ 前端层 │────▶│ 后端业务层 │────▶│ Agent决策编排层 │
|
||||
│ React SPA │ │ Spring Boot │ │ ReAct循环 + 工具调用 │
|
||||
└─────────────┘ └─────────────┘ └─────────────────────────┘
|
||||
│
|
||||
┌───────────────────────────┼───────────────────┐
|
||||
▼ ▼ ▼
|
||||
┌──────────┐ ┌────────────┐ ┌────────────┐
|
||||
│本地数据层 │ │ 本地向量库 │ │ 外接AI算力 │
|
||||
│PostgreSQL│ │ pgvector │ │ DeepSeek │
|
||||
│+ Redis │ │ (1536维) │ │ API │
|
||||
└──────────┘ └────────────┘ └────────────┘
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 二、核心技术栈
|
||||
|
||||
| 层级 | 技术选型 | 作用 |
|
||||
|:---|:---|:---|
|
||||
| **前端** | React 19 + TypeScript + Vite + Ant Design 6 | 单页应用,工作台/指摘管理/Agent驾驶舱 |
|
||||
| **后端** | Java 17/21 + Spring Boot 3.5 + Spring Security | RESTful API、RBAC权限、数据访问(JPA) |
|
||||
| **Agent引擎** | Spring AI / 自定义ReAct框架 + DeepSeek API | 自然语言理解、任务规划、工具调用、思考链 |
|
||||
| **向量检索** | PostgreSQL 16 + **pgvector** 插件 | 本地存储文档向量(1536维),余弦相似度检索 |
|
||||
| **缓存/消息** | Redis 7.4 | 热点缓存、会话管理、异步通知 |
|
||||
| **对象存储** | MinIO(本地部署) | 知识库文档、附件文件存储 |
|
||||
| **AI算力** | DeepSeek API(deepseek-v4-pro + text-embedding-3-small) | **仅提供推理与向量化算力,不留存数据** |
|
||||
|
||||
---
|
||||
|
||||
## 三、核心创新点
|
||||
|
||||
### 1. Agent驱动的业务闭环
|
||||
- 内置 **ReAct循环**(推理→行动→观察)
|
||||
- 用户自然语言指令(如"催办逾期指摘分配给张三")→ Agent自动规划 → 调用工具执行
|
||||
- 高风险操作(删除/跨部门分配)自动触发人工审批
|
||||
|
||||
### 2. 本地知识库 + 外接算力
|
||||
- 所有文档原文和向量索引 **存储于本地**(PostgreSQL pgvector)
|
||||
- 仅将待向量化的文本片段通过API发送至DeepSeek
|
||||
- **数据不出内网**,兼顾智能化与数据安全
|
||||
|
||||
### 3. 人机协同审批机制
|
||||
- Agent执行敏感操作前自动触发 `request_human_approval`
|
||||
- 详情页"Agent驾驶舱"实时展示思考链:`[思考]` → `[行动]` → `[观察]`
|
||||
- 用户可实时批准/拒绝/修改建议
|
||||
|
||||
### 4. 长期记忆能力
|
||||
- 成功的Agent处理经验自动沉淀为向量记忆(`agent_memories`表)
|
||||
- 后续遇到相似问题时优先检索历史方案,持续优化决策质量
|
||||
|
||||
---
|
||||
|
||||
## 四、关键数据流示例
|
||||
|
||||
**用户输入**:"这个4K屏幕适配问题怎么处理?"
|
||||
|
||||
```
|
||||
Agent接收目标
|
||||
│
|
||||
▼
|
||||
检索本地知识库(search_knowledge)
|
||||
│
|
||||
▼
|
||||
匹配历史案例 #KB-042(Flex容器4K适配方案)
|
||||
│
|
||||
▼
|
||||
生成行动方案 → 调用 send_reminder 给担当者
|
||||
│
|
||||
▼
|
||||
触发人工审批闸门(request_human_approval)
|
||||
│
|
||||
▼
|
||||
用户批准 → 发送通知并附解决方案 → 记录成功经验到记忆库
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 五、部署特点
|
||||
|
||||
| 特性 | 说明 |
|
||||
|:---|:---|
|
||||
| **全栈容器化** | Docker Compose 一键启动所有服务 |
|
||||
| **数据本地化** | 知识库文档、向量索引、业务数据全部本地存储 |
|
||||
| **算力外包化** | 仅DeepSeek API为外部依赖,传输内容可控、不留存 |
|
||||
| **可观测性** | Prometheus + Grafana 监控Agent任务指标;ELK审计思考链日志 |
|
||||
| **安全策略** | JWT认证 + RBAC权限 + 单用户Agent调用限流(10次/分钟) |
|
||||
|
||||
---
|
||||
|
||||
## 六、一句话概括
|
||||
|
||||
> 用 **Spring Boot + React** 构建、以 **DeepSeek AI** 为大脑、以 **本地pgvector** 为记忆、以 **Agent** 为执行中枢的智能化缺陷管理系统——让AI自动处理80%的常规指摘流转,人工只介入关键决策。
|
||||
@@ -0,0 +1,78 @@
|
||||
# Master 骨架搭建 · 执行计划
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
D:\IMS\ ← Git 仓库根目录
|
||||
├── backend/ ← 后端 Maven 多模块
|
||||
│ ├── pom.xml ← 父 POM
|
||||
│ ├── ims-common/ ← 公共模块(DTO、工具类)
|
||||
│ ├── ims-api/ ← API 模块(Controller 定义)
|
||||
│ ├── ims-service/ ← 业务模块(Entity、Repository、Security)
|
||||
│ └── ims-web/ ← Web 启动模块
|
||||
├── frontend/ ← 前端 Vite + React + Ant Design
|
||||
├── docs/ ← 设计文档
|
||||
├── docker-compose.yml ← PostgreSQL 16 + pgvector + Redis 7 + MinIO
|
||||
└── _MASTER_PLAN.md
|
||||
```
|
||||
|
||||
## 阶段 1:数据库 + Docker Compose
|
||||
|
||||
| # | 任务 | 产出 |
|
||||
|---|------|------|
|
||||
| 1.1 | docker-compose.yml:PostgreSQL 16(pgvector)+ Redis 7 + MinIO + 初始化脚本 | 1 个 yml + 1 个 init SQL |
|
||||
| 1.2 | Flyway V1.0:基础表(departments, users, roles, permissions, user_roles, role_permissions) | 1 个 SQL |
|
||||
| 1.3 | Flyway V1.1:核心业务表(issues, issue_logs, attachments, notifications, task_executions) | 1 个 SQL |
|
||||
| 1.4 | Flyway V1.2:AI 分析表(ai_analysis, ai_feedback) | 1 个 SQL |
|
||||
| 1.5 | Flyway V1.3:Agent 表(agent_plans, agent_memories, tool_executions) | 1 个 SQL |
|
||||
| 1.6 | Flyway V1.4:知识库表(knowledge_documents, knowledge_chunks, knowledge_search_logs) | 1 个 SQL |
|
||||
| 1.7 | Flyway V1.5:Prompt 模板表(prompt_templates, prompt_template_versions, prompt_render_logs) | 1 个 SQL |
|
||||
| 1.8 | Flyway V1.6:种子数据(admin 账号 + 6 个预设角色 + 权限数据) | 1 个 SQL |
|
||||
|
||||
## 阶段 2:后端 POM + 配置
|
||||
|
||||
| # | 任务 | 产出 |
|
||||
|---|------|------|
|
||||
| 2.1 | 父 POM + 4 子模块 pom.xml,统一管理依赖 | 5 个 pom.xml |
|
||||
| 2.2 | application.yml + application-dev.yml + application-prod.yml | 3 个 yml |
|
||||
|
||||
## 阶段 3:后端 Java 基础设施
|
||||
|
||||
| # | 任务 | 产出 |
|
||||
|---|------|------|
|
||||
| 3.1 | ims-common:ApiResponse、PageResult、ResultCode、BusinessException | 4 个 Java 类 |
|
||||
| 3.2 | JwtUtil(生成/校验 access_token + refresh_token) | 1 个 Java 类 |
|
||||
| 3.3 | 启动类、Jackson 配置、全局异常处理、CORS 配置 | 4 个 Java 类 |
|
||||
| 3.4 | 全部 21 张表的 JPA Entity | 21 个 Java 类 |
|
||||
| 3.5 | 全部 Repository 接口 | 21 个 Java 类 |
|
||||
| 3.6 | 请求/响应 DTO(按模块分包:auth/issue/agent/knowledge/prompt/system) | ~30 个 Java 类 |
|
||||
|
||||
## 阶段 4:后端 Security + Controller
|
||||
|
||||
| # | 任务 | 产出 |
|
||||
|---|------|------|
|
||||
| 4.1 | SecurityConfig + JwtAuthFilter + UserDetailsServiceImpl | 3 个 Java 类 |
|
||||
| 4.2 | 数据权限 AOP:@DataScope 注解 + 切面(空实现骨架) | 2 个 Java 类 |
|
||||
| 4.3 | AuthController(真实实现,POST /auth/login 返回 JWT) | 1 个 Controller |
|
||||
| 4.4 | 其余 10 个 Controller 空实现(return ApiResponse.success(null)) | 10 个 Controller |
|
||||
|
||||
## 阶段 5:前端项目
|
||||
|
||||
| # | 任务 | 产出 |
|
||||
|---|------|------|
|
||||
| 5.1 | npm create vite → React + TypeScript,安装依赖 | 脚手架 |
|
||||
| 5.2 | Ant Design 主题 + axios 封装 + Redux store | 4 个文件 |
|
||||
| 5.3 | 登录页(表单 + API 调用 + token 存储 + 跳转) | 1 个页面 |
|
||||
| 5.4 | 全局 Layout(侧边栏 + 顶栏 + Outlet) | 1 个 Layout 组件 |
|
||||
| 5.5 | 路由表(懒加载 + 路由守卫 + 侧边栏联动) | routes.tsx |
|
||||
| 5.6 | 13 个空页面壳(显示"待实现"占位) | 13 个页面组件 |
|
||||
|
||||
## 验证标准
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
cd backend/ims-web && mvn spring-boot:run
|
||||
cd frontend && npm run dev
|
||||
```
|
||||
|
||||
浏览器 http://localhost:5173 → 登录页 → 种子账号登录 → 侧边栏可点 → 各页面"待实现"
|
||||
@@ -0,0 +1,726 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>Agent 管理 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/echarts.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
.mono {
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
}
|
||||
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
|
||||
.tab-active {
|
||||
border-bottom: 3px solid #1a73e8;
|
||||
color: #1a73e8;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.approval-pulse {
|
||||
animation: approvalPulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes approvalPulse {
|
||||
0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
|
||||
50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (Shared) -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="roles.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<h2 class="text-lg font-semibold text-gray-800">Agent 监控与管理</h2>
|
||||
<div class="flex items-center gap-3">
|
||||
<span class="text-xs font-bold text-gray-400">全局自动执行</span>
|
||||
<div class="w-12 h-6 bg-green-500 rounded-full relative cursor-pointer shadow-inner">
|
||||
<div class="absolute right-1 top-1 w-4 h-4 bg-white rounded-full shadow-sm"></div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Tabs -->
|
||||
<div class="bg-white border-b border-gray-200 px-8 flex-none">
|
||||
<div class="flex gap-8">
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700 tab-active" data-tab="overview" onclick="switchTab('overview')">
|
||||
<iconify-icon icon="lucide:activity" class="inline mr-1"></iconify-icon> 运行概览
|
||||
</button>
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="approval" onclick="switchTab('approval')">
|
||||
<iconify-icon icon="lucide:shield-alert" class="inline mr-1"></iconify-icon> 待审批队列
|
||||
<span class="ml-1 px-1.5 py-0.5 bg-red-500 text-white text-[10px] rounded-full font-bold">3</span>
|
||||
</button>
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="config" onclick="switchTab('config')">
|
||||
<iconify-icon icon="lucide:settings" class="inline mr-1"></iconify-icon> 全局配置
|
||||
</button>
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="tools" onclick="switchTab('tools')">
|
||||
<iconify-icon icon="lucide:wrench" class="inline mr-1"></iconify-icon> 工具管理
|
||||
</button>
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="memory" onclick="switchTab('memory')">
|
||||
<iconify-icon icon="lucide:brain" class="inline mr-1"></iconify-icon> 记忆库
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 overflow-y-auto p-8 space-y-8">
|
||||
<!-- Tab: 运行概览 -->
|
||||
<div id="tab-overview" class="space-y-8">
|
||||
<!-- Overall Stats -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-4">当前运行状态</p>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-12 h-12 bg-green-50 rounded-xl flex items-center justify-center text-green-600">
|
||||
<iconify-icon class="text-2xl" icon="lucide:activity"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-xl font-bold text-gray-900 leading-tight">健康</h3>
|
||||
<p class="text-xs text-green-600 font-medium italic">响应延迟 240ms</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-4">今日调用次数</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900">4,821</h3>
|
||||
<p class="text-xs text-gray-400 mt-2"><span class="text-blue-600 font-bold">+15%</span> 较昨日平均</p>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-4">工具执行成功率</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900">99.2%</h3>
|
||||
<div class="w-full h-1.5 bg-gray-100 rounded-full mt-4 overflow-hidden">
|
||||
<div class="h-full bg-green-500 w-[99.2%]"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-4">人工介入请求</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900">12</h3>
|
||||
<p class="text-xs text-gray-400 mt-2">待处理 <span class="text-red-500 font-bold">3</span> 条</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
<!-- Exec Records -->
|
||||
<div class="lg:col-span-2 bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden flex flex-col">
|
||||
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-gray-50/30">
|
||||
<h4 class="font-bold text-gray-800">Agent 执行日志记录</h4>
|
||||
<div class="flex gap-2">
|
||||
<button class="p-2 hover:bg-white rounded-lg border border-transparent hover:border-gray-200 text-gray-400 transition-all"><iconify-icon icon="lucide:filter"></iconify-icon></button>
|
||||
<button class="p-2 hover:bg-white rounded-lg border border-transparent hover:border-gray-200 text-gray-400 transition-all"><iconify-icon icon="lucide:refresh-cw"></iconify-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50/50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">时间</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">工具名称</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">执行结果</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">耗时</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-right">详情</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50 text-xs">
|
||||
<tr>
|
||||
<td class="px-6 py-4 text-gray-400 mono">10:32:15</td>
|
||||
<td class="px-6 py-4 font-bold text-blue-600 mono">search_knowledge</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">SUCCESS</span></td>
|
||||
<td class="px-6 py-4 text-gray-500">850ms</td>
|
||||
<td class="px-6 py-4 text-right"><iconify-icon class="text-gray-400 cursor-pointer hover:text-blue-600" icon="lucide:eye"></iconify-icon></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 text-gray-400 mono">10:30:02</td>
|
||||
<td class="px-6 py-4 font-bold text-orange-600 mono">send_reminder</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-orange-50 text-orange-700 rounded-full font-bold">WAIT_HUMAN</span></td>
|
||||
<td class="px-6 py-4 text-gray-500">-</td>
|
||||
<td class="px-6 py-4 text-right"><iconify-icon class="text-gray-400 cursor-pointer hover:text-blue-600" icon="lucide:eye"></iconify-icon></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 text-gray-400 mono">10:28:45</td>
|
||||
<td class="px-6 py-4 font-bold text-blue-600 mono">update_metadata</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">SUCCESS</span></td>
|
||||
<td class="px-6 py-4 text-gray-500">120ms</td>
|
||||
<td class="px-6 py-4 text-right"><iconify-icon class="text-gray-400 cursor-pointer hover:text-blue-600" icon="lucide:eye"></iconify-icon></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 text-gray-400 mono">10:25:12</td>
|
||||
<td class="px-6 py-4 font-bold text-red-600 mono">delete_issue</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-red-50 text-red-700 rounded-full font-bold">REJECTED</span></td>
|
||||
<td class="px-6 py-4 text-gray-500">-</td>
|
||||
<td class="px-6 py-4 text-right"><iconify-icon class="text-gray-400 cursor-pointer hover:text-blue-600" icon="lucide:eye"></iconify-icon></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Exec Trend -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<h4 class="font-bold text-gray-800 mb-6">工具调用频率趋势</h4>
|
||||
<div id="execChart" style="height: 350px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: 待审批队列 -->
|
||||
<div id="tab-approval" class="hidden space-y-6">
|
||||
<div class="bg-red-50 border border-red-100 rounded-2xl p-6 flex items-center gap-4">
|
||||
<div class="w-12 h-12 bg-red-100 rounded-xl flex items-center justify-center text-red-600 approval-pulse">
|
||||
<iconify-icon class="text-2xl" icon="lucide:shield-alert"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-bold text-red-800">待审批操作提醒</h4>
|
||||
<p class="text-xs text-red-600 mt-1">当前有 <span class="font-bold">3</span> 个 Agent 发起的操作等待人工审批,超时 48 小时将自动触发通知升级。</p>
|
||||
</div>
|
||||
<button class="ml-auto px-4 py-2 bg-red-600 text-white rounded-lg text-xs font-bold hover:bg-red-700 transition-all">一键处理</button>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 bg-gray-50/30 flex justify-between items-center">
|
||||
<h4 class="font-bold text-gray-800">审批队列</h4>
|
||||
<div class="flex gap-2">
|
||||
<select class="bg-white border border-gray-200 rounded-lg px-3 py-1.5 text-xs focus:outline-none">
|
||||
<option>全部类型</option>
|
||||
<option>删除指摘</option>
|
||||
<option>跨部门分配</option>
|
||||
<option>状态强制流转</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divide-y divide-gray-50">
|
||||
<!-- Approval Item 1 -->
|
||||
<div class="p-6 hover:bg-gray-50 transition-colors">
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-10 h-10 bg-red-100 rounded-xl flex items-center justify-center text-red-600 flex-none">
|
||||
<iconify-icon class="text-xl" icon="lucide:trash-2"></iconify-icon>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="text-sm font-bold text-gray-900">删除指摘请求</span>
|
||||
<span class="px-2 py-0.5 bg-red-100 text-red-700 rounded-full text-[10px] font-bold">高风险</span>
|
||||
<span class="text-[10px] text-gray-400">10:30:02</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 mb-3">Agent 准备调用 <code class="bg-gray-100 px-1 rounded font-mono text-red-600">delete_issue</code> 删除指摘 <span class="font-mono text-blue-600">ISSUE-2026-085</span></p>
|
||||
<div class="bg-gray-50 rounded-lg p-3 text-xs text-gray-500 mb-3">
|
||||
<span class="font-bold text-gray-700">原因:</span>用户指令 "清理已关闭超过3个月的测试数据",Agent 识别到 ISSUE-2026-085 为测试阶段产生的废弃指摘,建议删除。
|
||||
</div>
|
||||
<div class="flex items-center gap-2 text-[10px] text-gray-400">
|
||||
<iconify-icon icon="lucide:user" width="12"></iconify-icon>
|
||||
发起人:张明亮 · 发起方式:Agent自动执行
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 flex-none">
|
||||
<button class="px-4 py-2 bg-red-600 text-white rounded-lg text-xs font-bold hover:bg-red-700 transition-all shadow-sm">批准</button>
|
||||
<button class="px-4 py-2 bg-white border border-gray-200 text-gray-600 rounded-lg text-xs font-bold hover:bg-gray-50 transition-all">拒绝</button>
|
||||
<button class="px-4 py-2 bg-white border border-gray-200 text-gray-400 rounded-lg text-xs font-bold hover:bg-gray-50 transition-all">查看详情</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Approval Item 2 -->
|
||||
<div class="p-6 hover:bg-gray-50 transition-colors">
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-10 h-10 bg-orange-100 rounded-xl flex items-center justify-center text-orange-600 flex-none">
|
||||
<iconify-icon class="text-xl" icon="lucide:shuffle"></iconify-icon>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="text-sm font-bold text-gray-900">跨部门分配请求</span>
|
||||
<span class="px-2 py-0.5 bg-orange-100 text-orange-700 rounded-full text-[10px] font-bold">中风险</span>
|
||||
<span class="text-[10px] text-gray-400">09:15:33</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 mb-3">Agent 准备调用 <code class="bg-gray-100 px-1 rounded font-mono text-orange-600">assign_issue</code> 将指摘 <span class="font-mono text-blue-600">ISSUE-2026-092</span> 分配给品质部</p>
|
||||
<div class="bg-gray-50 rounded-lg p-3 text-xs text-gray-500 mb-3">
|
||||
<span class="font-bold text-gray-700">原因:</span>当前担当者所属部门(研发中心)无相关处理权限,Agent 建议跨部门分配至品质部。
|
||||
</div>
|
||||
<div class="flex items-center gap-2 text-[10px] text-gray-400">
|
||||
<iconify-icon icon="lucide:user" width="12"></iconify-icon>
|
||||
发起人:李志强 · 发起方式:Agent自动执行
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 flex-none">
|
||||
<button class="px-4 py-2 bg-orange-600 text-white rounded-lg text-xs font-bold hover:bg-orange-700 transition-all shadow-sm">批准</button>
|
||||
<button class="px-4 py-2 bg-white border border-gray-200 text-gray-600 rounded-lg text-xs font-bold hover:bg-gray-50 transition-all">拒绝</button>
|
||||
<button class="px-4 py-2 bg-white border border-gray-200 text-gray-400 rounded-lg text-xs font-bold hover:bg-gray-50 transition-all">查看详情</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Approval Item 3 -->
|
||||
<div class="p-6 hover:bg-gray-50 transition-colors">
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-10 h-10 bg-yellow-100 rounded-xl flex items-center justify-center text-yellow-600 flex-none">
|
||||
<iconify-icon class="text-xl" icon="lucide:git-compare"></iconify-icon>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="text-sm font-bold text-gray-900">状态强制流转请求</span>
|
||||
<span class="px-2 py-0.5 bg-yellow-100 text-yellow-700 rounded-full text-[10px] font-bold">中风险</span>
|
||||
<span class="text-[10px] text-gray-400">08:42:18</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-600 mb-3">Agent 准备调用 <code class="bg-gray-100 px-1 rounded font-mono text-yellow-600">update_status</code> 将指摘 <span class="font-mono text-blue-600">ISSUE-2026-088</span> 从"待确认"强制改为"已关闭"</p>
|
||||
<div class="bg-gray-50 rounded-lg p-3 text-xs text-gray-500 mb-3">
|
||||
<span class="font-bold text-gray-700">原因:</span>验证人员超过7天未响应,且整改内容已通过自动化测试验证。
|
||||
</div>
|
||||
<div class="flex items-center gap-2 text-[10px] text-gray-400">
|
||||
<iconify-icon icon="lucide:user" width="12"></iconify-icon>
|
||||
发起人:系统定时任务 · 发起方式:自动触发
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-2 flex-none">
|
||||
<button class="px-4 py-2 bg-yellow-600 text-white rounded-lg text-xs font-bold hover:bg-yellow-700 transition-all shadow-sm">批准</button>
|
||||
<button class="px-4 py-2 bg-white border border-gray-200 text-gray-600 rounded-lg text-xs font-bold hover:bg-gray-50 transition-all">拒绝</button>
|
||||
<button class="px-4 py-2 bg-white border border-gray-200 text-gray-400 rounded-lg text-xs font-bold hover:bg-gray-50 transition-all">查看详情</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: 全局配置 -->
|
||||
<div id="tab-config" class="hidden space-y-6">
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<!-- AI模型配置 -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:cpu"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">AI 模型配置</h4>
|
||||
</div>
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-2">推理模型</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none">
|
||||
<option selected>deepseek-v4-pro(推荐)</option>
|
||||
<option>deepseek-v4-flash(快速响应)</option>
|
||||
</select>
|
||||
<p class="text-[10px] text-gray-400 mt-1.5">Pro 模型推理能力更强,适合复杂任务;Flash 模型响应更快。</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-2">Embedding 模型</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none">
|
||||
<option selected>text-embedding-3-small</option>
|
||||
<option>text-embedding-3-large</option>
|
||||
</select>
|
||||
<p class="text-[10px] text-gray-400 mt-1.5">用于知识库文档向量化,Large 模型精度更高但耗时更长。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Agent行为配置 -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:settings-2"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">Agent 行为配置</h4>
|
||||
</div>
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<label class="text-[10px] font-bold text-gray-400 uppercase">最大推理步数</label>
|
||||
<span class="text-sm font-bold text-blue-600">10</span>
|
||||
</div>
|
||||
<input type="range" min="5" max="20" value="10" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-blue-600" />
|
||||
<p class="text-[10px] text-gray-400 mt-1.5">超过最大步数后 Agent 任务将自动终止并记录错误。</p>
|
||||
</div>
|
||||
<div class="flex items-center justify-between p-4 bg-red-50 rounded-xl border border-red-100">
|
||||
<div>
|
||||
<p class="text-sm font-bold text-red-800">允许自动执行高风险操作</p>
|
||||
<p class="text-[10px] text-red-600/70 mt-1">开启后,Agent 可在不经过人工审批的情况下执行 delete_issue、跨部门分配等敏感操作。</p>
|
||||
</div>
|
||||
<div class="w-12 h-6 bg-gray-300 rounded-full relative cursor-pointer transition-colors">
|
||||
<div class="absolute left-1 top-1 w-4 h-4 bg-white rounded-full shadow-sm"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between p-4 bg-gray-50 rounded-xl border border-gray-100">
|
||||
<div>
|
||||
<p class="text-sm font-bold text-gray-700">单用户 Agent 调用限流</p>
|
||||
<p class="text-[10px] text-gray-500 mt-1">每分钟最多 10 个 Agent 目标请求</p>
|
||||
</div>
|
||||
<div class="w-12 h-6 bg-green-500 rounded-full relative cursor-pointer">
|
||||
<div class="absolute right-1 top-1 w-4 h-4 bg-white rounded-full shadow-sm"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 知识库切片配置 -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:scissors"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">知识库切片配置</h4>
|
||||
</div>
|
||||
<div class="grid grid-cols-3 gap-6">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-2">切片大小 (Token)</label>
|
||||
<div class="flex items-center gap-3">
|
||||
<input type="number" value="500" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-2">重叠比例 (%)</label>
|
||||
<div class="flex items-center gap-3">
|
||||
<input type="number" value="10" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-2">最大上传大小 (MB)</label>
|
||||
<div class="flex items-center gap-3">
|
||||
<input type="number" value="50" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button class="px-8 py-3 bg-blue-600 text-white rounded-xl font-bold hover:bg-blue-700 transition-all shadow-lg shadow-blue-200">保存配置</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: 工具管理 -->
|
||||
<div id="tab-tools" class="hidden space-y-6">
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 bg-gray-50/30 flex justify-between items-center">
|
||||
<div>
|
||||
<h4 class="font-bold text-gray-800">已注册工具列表</h4>
|
||||
<p class="text-xs text-gray-400 mt-1">管理 Agent 可调用的原子工具,敏感工具建议设为"需审批"</p>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50/50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">工具名称</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">描述</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">状态</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">风险等级</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50 text-xs">
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">assign_issue</td>
|
||||
<td class="px-6 py-4 text-gray-600">将指摘分配给指定负责人</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">启用</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-yellow-100 text-yellow-700 rounded-full font-bold">中风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">send_reminder</td>
|
||||
<td class="px-6 py-4 text-gray-600">发送催办通知</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">启用</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full font-bold">低风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">close_issue</td>
|
||||
<td class="px-6 py-4 text-gray-600">关闭指摘</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-orange-50 text-orange-700 rounded-full font-bold">需审批</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-red-100 text-red-700 rounded-full font-bold">高风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">delete_issue</td>
|
||||
<td class="px-6 py-4 text-gray-600">删除指摘(不可逆)</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-orange-50 text-orange-700 rounded-full font-bold">需审批</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-red-100 text-red-700 rounded-full font-bold">高风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">search_knowledge</td>
|
||||
<td class="px-6 py-4 text-gray-600">在本地知识库中检索相关文档片段</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">启用</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full font-bold">低风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">create_comment</td>
|
||||
<td class="px-6 py-4 text-gray-600">创建评论/备注</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">启用</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full font-bold">低风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">request_human_approval</td>
|
||||
<td class="px-6 py-4 text-gray-600">请求人工审批</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">启用</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-blue-100 text-blue-700 rounded-full font-bold">系统</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-mono font-bold text-blue-600">export_excel</td>
|
||||
<td class="px-6 py-4 text-gray-600">导出 Excel 报表</td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">启用</span></td>
|
||||
<td class="px-6 py-4 text-center"><span class="px-2 py-0.5 bg-yellow-100 text-yellow-700 rounded-full font-bold">中风险</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-gray-400 hover:text-blue-600 mr-3"><iconify-icon icon="lucide:settings" width="16"></iconify-icon></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: 记忆库 -->
|
||||
<div id="tab-memory" class="hidden space-y-6">
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase">记忆条目总数</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-2">1,247</h3>
|
||||
<p class="text-xs text-gray-400 mt-1"><span class="text-blue-600 font-bold">+23</span> 本周新增</p>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase">平均有效性评分</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-2">4.2<span class="text-lg text-gray-400">/5.0</span></h3>
|
||||
<div class="w-full h-1.5 bg-gray-100 rounded-full mt-3 overflow-hidden">
|
||||
<div class="h-full bg-blue-500 w-[84%]"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase">被引用次数</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-2">3,856</h3>
|
||||
<p class="text-xs text-gray-400 mt-1">本周被 Agent 检索 <span class="text-blue-600 font-bold">412</span> 次</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 bg-gray-50/30 flex justify-between items-center">
|
||||
<h4 class="font-bold text-gray-800">记忆条目列表</h4>
|
||||
<div class="flex gap-2">
|
||||
<button class="px-3 py-1.5 bg-blue-600 text-white rounded-lg text-xs font-bold hover:bg-blue-700 transition-all flex items-center gap-1">
|
||||
<iconify-icon icon="lucide:plus" width="14"></iconify-icon> 新增记忆
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50/50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">问题摘要</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">解决方案步骤</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">有效性评分</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">引用次数</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50 text-xs">
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4">
|
||||
<p class="font-bold text-gray-900 text-sm">4K屏幕下侧边栏高度适配问题</p>
|
||||
<p class="text-gray-400 mt-1">前端布局 · CSS · 响应式设计</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-gray-600 max-w-xs">
|
||||
<ol class="list-decimal list-inside space-y-0.5">
|
||||
<li>使用 min-h-screen 替代 100vh</li>
|
||||
<li>开启 flex-grow 属性</li>
|
||||
<li>添加媒体查询适配 4K</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<div class="flex items-center justify-center gap-1">
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-[10px] text-gray-400">5.0</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-blue-600">42</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-2">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:thumbs-up" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:thumbs-down" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:pencil" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:trash-2" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4">
|
||||
<p class="font-bold text-gray-900 text-sm">数据库连接池泄漏排查</p>
|
||||
<p class="text-gray-400 mt-1">后端 · 数据库 · 性能优化</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-gray-600 max-w-xs">
|
||||
<ol class="list-decimal list-inside space-y-0.5">
|
||||
<li>检查连接是否正确关闭</li>
|
||||
<li>调整连接池最大连接数</li>
|
||||
<li>启用连接泄漏检测日志</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<div class="flex items-center justify-center gap-1">
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-gray-300" icon="lucide:star" width="14"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-[10px] text-gray-400">4.0</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-blue-600">28</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-2">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:thumbs-up" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:thumbs-down" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:pencil" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:trash-2" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4">
|
||||
<p class="font-bold text-gray-900 text-sm">API 接口参数校验缺失</p>
|
||||
<p class="text-gray-400 mt-1">后端 · API · 安全</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-gray-600 max-w-xs">
|
||||
<ol class="list-decimal list-inside space-y-0.5">
|
||||
<li>添加 @Valid 注解</li>
|
||||
<li>配置全局异常处理器</li>
|
||||
<li>补充参数校验规则</li>
|
||||
</ol>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<div class="flex items-center justify-center gap-1">
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-yellow-400" icon="lucide:star" width="14"></iconify-icon>
|
||||
<iconify-icon class="text-gray-300" icon="lucide:star" width="14"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-[10px] text-gray-400">4.5</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-blue-600">15</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-2">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:thumbs-up" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:thumbs-down" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:pencil" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:trash-2" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
function switchTab(tab) {
|
||||
document.querySelectorAll('[data-tab]').forEach(btn => btn.classList.remove('tab-active'));
|
||||
document.querySelector(`[data-tab="${tab}"]`).classList.add('tab-active');
|
||||
['overview', 'approval', 'config', 'tools', 'memory'].forEach(t => {
|
||||
document.getElementById(`tab-${t}`).classList.toggle('hidden', t !== tab);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const execChart = echarts.init(document.getElementById('execChart'));
|
||||
execChart.setOption({
|
||||
tooltip: { trigger: 'axis' },
|
||||
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['08:00', '09:00', '10:00', '11:00', '12:00'],
|
||||
axisLine: { lineStyle: { color: '#eee' } }
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: { lineStyle: { type: 'dashed', color: '#f5f5f5' } }
|
||||
},
|
||||
series: [{
|
||||
name: '调用次数',
|
||||
type: 'bar',
|
||||
barWidth: '20%',
|
||||
data: [120, 450, 890, 520, 300],
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#1a73e8' },
|
||||
{ offset: 1, color: '#60a5fa' }
|
||||
]),
|
||||
borderRadius: [4, 4, 0, 0]
|
||||
}
|
||||
}]
|
||||
});
|
||||
window.addEventListener('resize', () => execChart.resize());
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,453 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>AI分析记录 - 指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js">
|
||||
</script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js">
|
||||
</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
.glass-card {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.modal-overlay {
|
||||
background-color: rgba(15, 23, 42, 0.6);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
.modal-body::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
.modal-body::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.modal-body::-webkit-scrollbar-thumb {
|
||||
background: #cbd5e1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.modal-body::-webkit-scrollbar-thumb:hover {
|
||||
background: #94a3b8;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (完全相同于 dashboard.html) -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="roles.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
<div class="p-4 border-t border-gray-100">
|
||||
<div class="bg-blue-50 rounded-xl p-4">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<div class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center">
|
||||
<iconify-icon class="text-white text-sm" icon="lucide:sparkles"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-xs font-bold text-blue-800 tracking-tight">AI Agent 状态</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-[10px] text-blue-600 font-medium italic">正在监控指摘状态...</span>
|
||||
<span class="flex h-2 w-2 rounded-full bg-green-500 animate-pulse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<!-- Header (与 dashboard 一致) -->
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<div class="flex items-center gap-4">
|
||||
<h2 class="text-lg font-semibold text-gray-800">AI 分析记录</h2>
|
||||
<span class="text-xs text-gray-400">2026年7月17日 星期五</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="relative">
|
||||
<iconify-icon class="text-xl text-gray-500 hover:text-blue-600 cursor-pointer" icon="lucide:bell"></iconify-icon>
|
||||
<span class="absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-[10px] flex items-center justify-center rounded-full border-2 border-white font-bold">3</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 pl-6 border-l border-gray-100">
|
||||
<div class="text-right">
|
||||
<p class="text-xs font-bold text-gray-900 leading-none">李志强</p>
|
||||
<p class="text-[10px] text-gray-400 mt-1">系统管理员</p>
|
||||
</div>
|
||||
<img alt="User Avatar" class="w-9 h-9 rounded-full border border-gray-200" src="https://modao.cc/agent-py/media/generated_images/2026-06-26/3897ae65e7734794adc3fbb56826b171.jpg" />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Scrollable Content -->
|
||||
<div class="flex-1 overflow-y-auto p-8 space-y-8 bg-gray-50">
|
||||
<!-- Filter Bar -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="grid grid-cols-4 gap-4 mb-4">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">指摘 ID</label>
|
||||
<input class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="输入 ID" type="text" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">归属部门</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>全部</option>
|
||||
<option>生产部</option>
|
||||
<option>品质部</option>
|
||||
<option>技术部</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">日期范围</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" type="date" />
|
||||
<span class="text-gray-400 text-xs">~</span>
|
||||
<input class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" type="date" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">分析状态</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>全部</option>
|
||||
<option>已完成</option>
|
||||
<option>进行中</option>
|
||||
<option>失败</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-between items-center border-t border-gray-100 pt-4">
|
||||
<div class="flex gap-2">
|
||||
<button class="px-6 py-2 bg-gray-900 text-white rounded-lg text-sm font-semibold hover:bg-black transition-all">查询</button>
|
||||
<button class="px-4 py-2 text-sm font-semibold text-gray-500 hover:text-gray-700 transition-colors">重置</button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button onclick="openModal()" class="bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-blue-700 transition-all flex items-center gap-2 shadow-md shadow-blue-200">
|
||||
<iconify-icon icon="lucide:refresh-cw" width="16"></iconify-icon>
|
||||
<span>生成 AI 分析</span>
|
||||
</button>
|
||||
<button class="bg-gray-100 text-gray-700 px-4 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200 transition-all flex items-center gap-2">
|
||||
<iconify-icon icon="lucide:file-spreadsheet" width="16"></iconify-icon>
|
||||
<span>导出记录</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- AI List Table -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">ID</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">提取关键词</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">问题分类</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">根因分析</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">AI 整改建议</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">反馈</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-sm font-mono font-bold text-blue-600">ISSUE-001</td>
|
||||
<td class="px-6 py-4 text-sm">传感器, 灰尘, 误报</td>
|
||||
<td class="px-6 py-4 text-sm">设备故障-电气类</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500">传感器透镜污垢导致光路阻挡...</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500">建议增加防尘罩并定期清洁...</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full text-[10px] font-bold">有帮助</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:eye" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:refresh-cw" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-sm font-mono font-bold text-blue-600">ISSUE-002</td>
|
||||
<td class="px-6 py-4 text-sm">打印, 模糊, 耗材</td>
|
||||
<td class="px-6 py-4 text-sm">品质异常-标识类</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500">碳带张力不均或打印头老化...</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500">检查碳带路径,清洁打印头...</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full text-[10px] font-bold">有帮助</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:eye" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:refresh-cw" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-sm font-mono font-bold text-blue-600">ISSUE-003</td>
|
||||
<td class="px-6 py-4 text-sm">螺丝, 松动, 安全</td>
|
||||
<td class="px-6 py-4 text-sm">安全隐患-设施类</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500">长期震动导致紧固件失效...</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500">使用防松螺母或增加弹垫...</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-gray-100 text-gray-500 rounded-full text-[10px] font-bold">未评估</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:eye" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:refresh-cw" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Modal: 生成 AI 分析 -->
|
||||
<div class="fixed inset-0 z-50 hidden flex items-center justify-center p-4" id="issueModal">
|
||||
<div class="absolute inset-0 modal-overlay" onclick="closeModal()"></div>
|
||||
<div class="relative bg-white rounded-2xl shadow-2xl w-[1200px] max-w-[95vw] max-h-[90vh] flex flex-col overflow-hidden">
|
||||
<div class="flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/80 flex-none">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center text-blue-600">
|
||||
<iconify-icon icon="lucide:list-todo" width="18"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="text-base font-bold text-gray-800">选择指摘生成 AI 分析</h3>
|
||||
<span class="text-xs text-gray-400 bg-gray-200 px-2 py-0.5 rounded-full">可多选</span>
|
||||
</div>
|
||||
<button onclick="closeModal()" class="text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-lg hover:bg-gray-200">
|
||||
<iconify-icon icon="lucide:x" width="22"></iconify-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="px-6 py-4 border-b border-gray-100 flex-none bg-white">
|
||||
<div class="grid grid-cols-5 gap-3">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1">指摘状态</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>待处理</option>
|
||||
<option>进行中</option>
|
||||
<option>已验证</option>
|
||||
<option>已关闭</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1">工程阶段</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>Phase 1</option>
|
||||
<option>Phase 2</option>
|
||||
<option>Phase 3</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1">归属部门</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>生产部</option>
|
||||
<option>品质部</option>
|
||||
<option>技术部</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1">搜索</label>
|
||||
<input class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="ID / 标题" type="text" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1">创建时间</label>
|
||||
<div class="flex items-center gap-1">
|
||||
<input class="w-full bg-gray-50 border border-gray-200 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500" type="date" />
|
||||
<span class="text-gray-400 text-xs">~</span>
|
||||
<input class="w-full bg-gray-50 border border-gray-200 rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500" type="date" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2 mt-4 pt-3 border-t border-gray-100">
|
||||
<button class="bg-white text-gray-600 border border-gray-200 px-4 py-1.5 rounded-lg text-sm font-medium hover:bg-gray-50 transition-colors">重置</button>
|
||||
<button class="bg-blue-600 text-white px-4 py-1.5 rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 overflow-auto modal-body">
|
||||
<table class="w-full text-left border-collapse">
|
||||
<thead class="bg-gray-50 text-gray-500 text-xs uppercase sticky top-0">
|
||||
<tr>
|
||||
<th class="px-4 py-3 border-b border-gray-100 w-10">
|
||||
<input type="checkbox" id="selectAll" onchange="toggleAllCheckboxes()" />
|
||||
</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">ID</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">标题</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">状态</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">优先级</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">工程阶段</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">对应者</th>
|
||||
<th class="px-4 py-3 border-b border-gray-100 font-semibold">截止日期</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50 text-sm">
|
||||
<tr class="hover:bg-gray-50 transition-colors cursor-pointer" onclick="toggleRowCheckbox(this)">
|
||||
<td class="px-4 py-3 text-center" onclick="event.stopPropagation()">
|
||||
<input type="checkbox" class="row-checkbox" onchange="updateSelectAll()" />
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs font-mono font-medium text-blue-600">ISSUE-2026-001</td>
|
||||
<td class="px-4 py-3">三号生产线设备异常报警,需排查传感器</td>
|
||||
<td class="px-4 py-3"><span class="px-2 py-0.5 bg-blue-100 text-blue-700 rounded-full text-[10px] font-bold">进行中</span></td>
|
||||
<td class="px-4 py-3"><span class="px-2 py-0.5 bg-red-100 text-red-700 rounded-full text-[10px] font-bold">高</span></td>
|
||||
<td class="px-4 py-3 text-xs">Phase 1</td>
|
||||
<td class="px-4 py-3 text-xs">王五</td>
|
||||
<td class="px-4 py-3 text-xs">2026-06-25</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors cursor-pointer" onclick="toggleRowCheckbox(this)">
|
||||
<td class="px-4 py-3 text-center" onclick="event.stopPropagation()">
|
||||
<input type="checkbox" class="row-checkbox" onchange="updateSelectAll()" />
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs font-mono font-medium text-blue-600">ISSUE-2026-002</td>
|
||||
<td class="px-4 py-3">A区成品包装标签打印模糊问题</td>
|
||||
<td class="px-4 py-3"><span class="px-2 py-0.5 bg-yellow-100 text-yellow-700 rounded-full text-[10px] font-bold">待处理</span></td>
|
||||
<td class="px-4 py-3"><span class="px-2 py-0.5 bg-orange-100 text-orange-700 rounded-full text-[10px] font-bold">中</span></td>
|
||||
<td class="px-4 py-3 text-xs">Phase 2</td>
|
||||
<td class="px-4 py-3 text-xs">赵六</td>
|
||||
<td class="px-4 py-3 text-xs">2026-06-28</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="flex items-center justify-between px-6 py-4 border-t border-gray-100 bg-gray-50/80 flex-none">
|
||||
<div class="text-sm text-gray-500">
|
||||
已选择 <span class="font-bold text-blue-600" id="selectedCount">0</span> 条指摘
|
||||
</div>
|
||||
<div class="flex gap-3">
|
||||
<button onclick="closeModal()" class="px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50 transition-colors">取消</button>
|
||||
<button onclick="generateAI()" class="px-6 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors shadow-md shadow-blue-100 flex items-center gap-2">
|
||||
<iconify-icon icon="lucide:sparkles" width="16"></iconify-icon>
|
||||
<span>生成 AI 分析</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleSubmenu(id) {
|
||||
const menu = document.getElementById(id);
|
||||
const arrow = document.getElementById(id + 'Arrow');
|
||||
if (menu.classList.contains('hidden')) {
|
||||
menu.classList.remove('hidden');
|
||||
arrow.setAttribute('icon', 'lucide:chevron-down');
|
||||
} else {
|
||||
menu.classList.add('hidden');
|
||||
arrow.setAttribute('icon', 'lucide:chevron-right');
|
||||
}
|
||||
}
|
||||
|
||||
function openModal() {
|
||||
document.getElementById('issueModal').classList.remove('hidden');
|
||||
document.body.style.overflow = 'hidden';
|
||||
updateSelectedCount();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('issueModal').classList.add('hidden');
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
function toggleAllCheckboxes() {
|
||||
const selectAll = document.getElementById('selectAll');
|
||||
const checkboxes = document.querySelectorAll('.row-checkbox');
|
||||
checkboxes.forEach(cb => cb.checked = selectAll.checked);
|
||||
updateSelectedCount();
|
||||
}
|
||||
|
||||
function toggleRowCheckbox(row) {
|
||||
const cb = row.querySelector('.row-checkbox');
|
||||
if (cb) {
|
||||
cb.checked = !cb.checked;
|
||||
updateSelectAll();
|
||||
updateSelectedCount();
|
||||
}
|
||||
}
|
||||
|
||||
function updateSelectAll() {
|
||||
const checkboxes = document.querySelectorAll('.row-checkbox');
|
||||
const selectAll = document.getElementById('selectAll');
|
||||
const checked = document.querySelectorAll('.row-checkbox:checked');
|
||||
selectAll.checked = checkboxes.length > 0 && checked.length === checkboxes.length;
|
||||
updateSelectedCount();
|
||||
}
|
||||
|
||||
function updateSelectedCount() {
|
||||
const checked = document.querySelectorAll('.row-checkbox:checked');
|
||||
document.getElementById('selectedCount').textContent = checked.length;
|
||||
}
|
||||
|
||||
function generateAI() {
|
||||
const checked = document.querySelectorAll('.row-checkbox:checked');
|
||||
if (checked.length === 0) {
|
||||
alert('请至少选择一条指摘进行 AI 分析。');
|
||||
return;
|
||||
}
|
||||
const ids = [];
|
||||
checked.forEach(cb => {
|
||||
const row = cb.closest('tr');
|
||||
const idCell = row.querySelector('td:nth-child(2)');
|
||||
if (idCell) {
|
||||
ids.push(idCell.textContent.trim());
|
||||
}
|
||||
});
|
||||
if (confirm(`确认对以下 ${ids.length} 条指摘生成 AI 分析?\n\n${ids.join('\n')}`)) {
|
||||
alert(`✅ AI 分析生成已启动!\n\n正在对 ${ids.length} 条指摘进行分析,请稍后查看结果。`);
|
||||
closeModal();
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,316 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>批量录入 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
|
||||
.upload-dashed {
|
||||
background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%23D1D5DBFF' stroke-width='3' stroke-dasharray='8%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
.upload-dashed:hover {
|
||||
background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%231A73E8FF' stroke-width='3' stroke-dasharray='8%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
|
||||
border-color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (Shared) -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="roles.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<h2 class="text-lg font-semibold text-gray-800">指摘批量录入</h2>
|
||||
<div class="flex gap-3">
|
||||
<button
|
||||
class="flex items-center gap-2 px-4 py-2 text-sm font-semibold text-blue-600 border border-blue-200 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors">
|
||||
<iconify-icon icon="lucide:download"></iconify-icon> 下载导入模板
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="flex-1 overflow-y-auto p-8 space-y-8">
|
||||
<!-- Step 1: Upload -->
|
||||
<div
|
||||
class="bg-white p-10 rounded-2xl border border-gray-100 shadow-sm flex flex-col items-center justify-center text-center upload-dashed group transition-all">
|
||||
<div
|
||||
class="w-20 h-20 bg-blue-50 text-blue-600 rounded-full flex items-center justify-center mb-6 group-hover:scale-110 transition-transform">
|
||||
<iconify-icon class="text-4xl" icon="lucide:upload-cloud"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-gray-900 mb-2">点击或拖拽文件到此处上传</h3>
|
||||
<p class="text-sm text-gray-400 mb-6">支持 .xlsx, .xls 文件,单个文件不超过 10MB</p>
|
||||
<input class="hidden" id="fileInput" type="file" />
|
||||
<button
|
||||
class="bg-blue-600 text-white px-8 py-3 rounded-xl font-bold hover:bg-blue-700 transition-all shadow-lg shadow-blue-200"
|
||||
onclick="document.getElementById('fileInput').click()">选择文件</button>
|
||||
</div>
|
||||
<!-- Step 2: Agent Validation (Hidden by default, shown after upload simulation) -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
<!-- Validation Result -->
|
||||
<div class="lg:col-span-1 space-y-4">
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<div class="flex items-center gap-2">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">Agent 校验结果</h4>
|
||||
</div>
|
||||
<span class="px-2 py-0.5 bg-orange-100 text-orange-600 rounded text-[10px] font-bold">发现 3
|
||||
个建议</span>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<div class="p-4 bg-orange-50 rounded-xl border border-orange-100 relative group">
|
||||
<span class="absolute right-3 top-3 text-[10px] font-bold text-orange-400 uppercase">第 8
|
||||
行</span>
|
||||
<p class="text-[11px] font-bold text-orange-700 mb-1">字段: 工程阶段</p>
|
||||
<p class="text-xs text-orange-800/70 mb-3">输入内容 "详细测试" 在系统中不存在,根据上下文推断应为 "详细设计"。</p>
|
||||
<button
|
||||
class="w-full py-1.5 bg-white border border-orange-200 text-orange-700 text-[11px] font-bold rounded-lg hover:bg-orange-600 hover:text-white transition-all shadow-sm">应用修正</button>
|
||||
</div>
|
||||
<div class="p-4 bg-orange-50 rounded-xl border border-orange-100 relative">
|
||||
<span class="absolute right-3 top-3 text-[10px] font-bold text-orange-400 uppercase">第
|
||||
12 行</span>
|
||||
<p class="text-[11px] font-bold text-orange-700 mb-1">字段: 优先级</p>
|
||||
<p class="text-xs text-orange-800/70 mb-3">内容为空。检测到指摘描述包含 "崩溃"、"无法启动" 等词汇,建议设为 "紧急"。</p>
|
||||
<button
|
||||
class="w-full py-1.5 bg-white border border-orange-200 text-orange-700 text-[11px] font-bold rounded-lg hover:bg-orange-600 hover:text-white transition-all shadow-sm">应用修正</button>
|
||||
</div>
|
||||
<div class="p-4 bg-green-50 rounded-xl border border-green-100 flex items-center gap-3">
|
||||
<iconify-icon class="text-green-600 text-xl" icon="lucide:check-circle"></iconify-icon>
|
||||
<div>
|
||||
<p class="text-[11px] font-bold text-green-700 leading-none mb-1">其余 15 条数据校验通过</p>
|
||||
<p class="text-[10px] text-green-600/70">Agent 已完成自动关联与去重校验。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="w-full mt-6 py-3 bg-gray-900 text-white rounded-xl font-bold text-sm hover:bg-black transition-all shadow-lg shadow-gray-200">一键应用全部修正</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Preview Table -->
|
||||
<div
|
||||
class="lg:col-span-2 bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden flex flex-col">
|
||||
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-gray-50/50">
|
||||
<h4 class="font-bold text-gray-800">预检数据预览 (18 条)</h4>
|
||||
<div class="flex gap-2">
|
||||
<span class="flex items-center gap-1 text-[10px] text-gray-400"><span
|
||||
class="w-2 h-2 bg-orange-400 rounded-full"></span> 待修正</span>
|
||||
<span class="flex items-center gap-1 text-[10px] text-gray-400"><span
|
||||
class="w-2 h-2 bg-green-400 rounded-full"></span> 已就绪</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left text-xs">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-3 font-bold text-gray-400 uppercase tracking-wider">行号</th>
|
||||
<th class="px-6 py-3 font-bold text-gray-400 uppercase tracking-wider">标题</th>
|
||||
<th class="px-6 py-3 font-bold text-gray-400 uppercase tracking-wider">工程阶段</th>
|
||||
<th class="px-6 py-3 font-bold text-gray-400 uppercase tracking-wider">优先级</th>
|
||||
<th class="px-6 py-3 font-bold text-gray-400 uppercase tracking-wider">担当者</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr class="bg-orange-50/30">
|
||||
<td class="px-6 py-4 font-bold text-gray-400">08</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-700">页面加载异常</td>
|
||||
<td class="px-6 py-4"><span
|
||||
class="text-red-500 font-bold underline decoration-wavy">详细测试</span></td>
|
||||
<td class="px-6 py-4 text-gray-500">中</td>
|
||||
<td class="px-6 py-4 text-gray-500">王志</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-bold text-gray-400">09</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-700">Logo 尺寸显示不正确</td>
|
||||
<td class="px-6 py-4 text-gray-500">详细设计</td>
|
||||
<td class="px-6 py-4 text-gray-500">低</td>
|
||||
<td class="px-6 py-4 text-gray-500">李思</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-bold text-gray-400">10</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-700">数据库连接泄漏问题</td>
|
||||
<td class="px-6 py-4 text-gray-500">单体测试</td>
|
||||
<td class="px-6 py-4 text-gray-500">高</td>
|
||||
<td class="px-6 py-4 text-gray-500">陈刚</td>
|
||||
</tr>
|
||||
<tr class="bg-orange-50/30">
|
||||
<td class="px-6 py-4 font-bold text-gray-400">12</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-700">生产环境宕机风险点</td>
|
||||
<td class="px-6 py-4 text-gray-500">基本设计</td>
|
||||
<td class="px-6 py-4"><span
|
||||
class="text-red-500 font-bold bg-red-100 px-1 rounded">未填</span></td>
|
||||
<td class="px-6 py-4 text-gray-500">未分配</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="p-6 bg-gray-50 border-t border-gray-100 flex justify-end">
|
||||
<button
|
||||
class="bg-blue-600 text-white px-10 py-3 rounded-xl font-bold hover:bg-blue-700 transition-all shadow-lg shadow-blue-100 flex items-center gap-2">
|
||||
确认并正式导入 (18 条) <iconify-icon icon="lucide:arrow-right"></iconify-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 历史导入记录 -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-gray-50/30">
|
||||
<div class="flex items-center gap-3">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:history"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">历史导入记录</h4>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button class="p-2 hover:bg-white rounded-lg border border-transparent hover:border-gray-200 text-gray-400 transition-all"><iconify-icon icon="lucide:filter"></iconify-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50/50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">导入时间</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">操作人</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">总条数</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">成功</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-center">失败</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase">状态</th>
|
||||
<th class="px-6 py-4 text-[10px] font-bold text-gray-400 uppercase text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50 text-xs">
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-gray-600">2026-07-17 09:30:15</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900">李志强</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-gray-900">45</td>
|
||||
<td class="px-6 py-4 text-center text-green-600 font-bold">43</td>
|
||||
<td class="px-6 py-4 text-center text-red-500 font-bold">2</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">已完成</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-blue-600 hover:text-blue-800 text-xs font-bold flex items-center gap-1 justify-end">
|
||||
<iconify-icon icon="lucide:download" width="14"></iconify-icon> 下载错误日志
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-gray-600">2026-07-15 14:22:08</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900">张明亮</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-gray-900">128</td>
|
||||
<td class="px-6 py-4 text-center text-green-600 font-bold">128</td>
|
||||
<td class="px-6 py-4 text-center text-gray-400 font-bold">0</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">已完成</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<span class="text-gray-400 text-xs">无错误日志</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-gray-600">2026-07-12 10:05:33</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900">陈志伟</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-gray-900">67</td>
|
||||
<td class="px-6 py-4 text-center text-green-600 font-bold">60</td>
|
||||
<td class="px-6 py-4 text-center text-red-500 font-bold">7</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-yellow-50 text-yellow-700 rounded-full font-bold">部分成功</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-blue-600 hover:text-blue-800 text-xs font-bold flex items-center gap-1 justify-end">
|
||||
<iconify-icon icon="lucide:download" width="14"></iconify-icon> 下载错误日志
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4 text-gray-600">2026-07-10 16:45:21</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900">李志强</td>
|
||||
<td class="px-6 py-4 text-center font-bold text-gray-900">32</td>
|
||||
<td class="px-6 py-4 text-center text-green-600 font-bold">32</td>
|
||||
<td class="px-6 py-4 text-center text-gray-400 font-bold">0</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-50 text-green-700 rounded-full font-bold">已完成</span></td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<span class="text-gray-400 text-xs">无错误日志</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="px-6 py-4 bg-gray-50 border-t border-gray-100 flex items-center justify-between">
|
||||
<p class="text-xs text-gray-500 font-medium">显示 1 到 4 条,共 12 条记录</p>
|
||||
<div class="flex gap-1">
|
||||
<button class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-gray-400 hover:bg-white transition-colors"><iconify-icon icon="lucide:chevron-left"></iconify-icon></button>
|
||||
<button class="w-8 h-8 rounded border border-blue-600 bg-blue-600 text-white flex items-center justify-center text-xs font-bold transition-colors">1</button>
|
||||
<button class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-xs font-bold text-gray-600 hover:bg-white transition-colors">2</button>
|
||||
<button class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-xs font-bold text-gray-600 hover:bg-white transition-colors">3</button>
|
||||
<button class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-gray-400 hover:bg-white transition-colors"><iconify-icon icon="lucide:chevron-right"></iconify-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,436 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>工作台 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/echarts.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
|
||||
.glass-card {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.agent-input-glow:focus {
|
||||
box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15), 0 0 20px rgba(26, 115, 232, 0.1);
|
||||
}
|
||||
|
||||
.agent-pulse {
|
||||
animation: agentPulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes agentPulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="roles.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
<div class="p-4 border-t border-gray-100">
|
||||
<div class="bg-blue-50 rounded-xl p-4">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<div class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center">
|
||||
<iconify-icon class="text-white text-sm" icon="lucide:sparkles"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-xs font-bold text-blue-800 tracking-tight">AI Agent 状态</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-[10px] text-blue-600 font-medium italic">正在监控指摘状态...</span>
|
||||
<span class="flex h-2 w-2 rounded-full bg-green-500 animate-pulse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<!-- Header -->
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<div class="flex items-center gap-4">
|
||||
<h2 class="text-lg font-semibold text-gray-800">工作台概览</h2>
|
||||
<span class="text-xs text-gray-400">2026年7月17日 星期五</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="relative">
|
||||
<iconify-icon class="text-xl text-gray-500 hover:text-blue-600 cursor-pointer"
|
||||
icon="lucide:bell"></iconify-icon>
|
||||
<span
|
||||
class="absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-[10px] flex items-center justify-center rounded-full border-2 border-white font-bold">3</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 pl-6 border-l border-gray-100">
|
||||
<div class="text-right">
|
||||
<p class="text-xs font-bold text-gray-900 leading-none">李志强</p>
|
||||
<p class="text-[10px] text-gray-400 mt-1">系统管理员</p>
|
||||
</div>
|
||||
<img alt="User Avatar" class="w-9 h-9 rounded-full border border-gray-200"
|
||||
src="https://modao.cc/agent-py/media/generated_images/2026-06-26/3897ae65e7734794adc3fbb56826b171.jpg" />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- Scrollable Area -->
|
||||
<div class="flex-1 overflow-y-auto p-8 space-y-8">
|
||||
<!-- Agent快捷指令输入框 -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<div class="w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-blue-600 text-lg" icon="lucide:bot"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-bold text-gray-800 text-sm">Agent 快捷指令</h4>
|
||||
<p class="text-[10px] text-gray-400">输入自然语言指令,Agent 将自动解析并执行</p>
|
||||
</div>
|
||||
<span class="ml-auto flex items-center gap-1.5 px-2 py-1 bg-green-50 text-green-600 rounded-full text-[10px] font-bold">
|
||||
<span class="w-1.5 h-1.5 bg-green-500 rounded-full agent-pulse"></span>
|
||||
在线
|
||||
</span>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<input type="text"
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-xl pl-4 pr-32 py-3.5 text-sm focus:outline-none focus:border-blue-500 agent-input-glow transition-all"
|
||||
placeholder="例如:新建指摘 '传感器故障' 分配给张三,优先级设为紧急..." />
|
||||
<button class="absolute right-2 top-1/2 -translate-y-1/2 bg-blue-600 text-white px-4 py-2 rounded-lg text-xs font-bold hover:bg-blue-700 transition-all flex items-center gap-1.5 shadow-md shadow-blue-200">
|
||||
<iconify-icon icon="lucide:send-horizontal" width="14"></iconify-icon>
|
||||
执行
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 mt-3">
|
||||
<span class="text-[10px] text-gray-400 font-medium">快捷指令:</span>
|
||||
<button class="px-2.5 py-1 bg-gray-100 hover:bg-blue-50 hover:text-blue-600 text-gray-500 rounded-md text-[10px] font-medium transition-colors">催办逾期指摘</button>
|
||||
<button class="px-2.5 py-1 bg-gray-100 hover:bg-blue-50 hover:text-blue-600 text-gray-500 rounded-md text-[10px] font-medium transition-colors">生成本周报告</button>
|
||||
<button class="px-2.5 py-1 bg-gray-100 hover:bg-blue-50 hover:text-blue-600 text-gray-500 rounded-md text-[10px] font-medium transition-colors">分配待处理指摘</button>
|
||||
<button class="px-2.5 py-1 bg-gray-100 hover:bg-blue-50 hover:text-blue-600 text-gray-500 rounded-md text-[10px] font-medium transition-colors">检索知识库</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stats Cards -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
<div
|
||||
class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
|
||||
<div class="flex justify-between items-start mb-4">
|
||||
<div class="p-2 bg-orange-50 rounded-lg text-orange-600">
|
||||
<iconify-icon class="text-2xl" icon="lucide:alert-circle"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-[10px] font-bold text-orange-500 bg-orange-100 px-2 py-0.5 rounded">+12% vs
|
||||
昨天</span>
|
||||
</div>
|
||||
<p class="text-sm font-medium text-gray-500">待处理指摘</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-1">42</h3>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
|
||||
<div class="flex justify-between items-start mb-4">
|
||||
<div class="p-2 bg-blue-50 rounded-lg text-blue-600">
|
||||
<iconify-icon class="text-2xl animate-spin-slow" icon="lucide:loader"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-[10px] font-bold text-blue-500 bg-blue-100 px-2 py-0.5 rounded">正常推进中</span>
|
||||
</div>
|
||||
<p class="text-sm font-medium text-gray-500">进行中指摘</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-1">128</h3>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
|
||||
<div class="flex justify-between items-start mb-4">
|
||||
<div class="p-2 bg-green-50 rounded-lg text-green-600">
|
||||
<iconify-icon class="text-2xl" icon="lucide:check-circle-2"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-[10px] font-bold text-green-500 bg-green-100 px-2 py-0.5 rounded">完成率
|
||||
88%</span>
|
||||
</div>
|
||||
<p class="text-sm font-medium text-gray-500">本月已完成</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-1">856</h3>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white p-6 rounded-2xl shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
|
||||
<div class="flex justify-between items-start mb-4">
|
||||
<div class="p-2 bg-purple-50 rounded-lg text-purple-600">
|
||||
<iconify-icon class="text-2xl" icon="lucide:zap"></iconify-icon>
|
||||
</div>
|
||||
<span
|
||||
class="text-[10px] font-bold text-purple-500 bg-purple-100 px-2 py-0.5 rounded">AI活跃</span>
|
||||
</div>
|
||||
<p class="text-sm font-medium text-gray-500">今日新增指摘</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-1">15</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
<!-- Main Chart -->
|
||||
<div class="lg:col-span-2 bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h4 class="font-bold text-gray-800">指摘处理趋势</h4>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
class="text-xs px-3 py-1 bg-gray-50 text-gray-600 rounded hover:bg-gray-100">周报</button>
|
||||
<button class="text-xs px-3 py-1 bg-blue-600 text-white rounded">月报</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainChart" style="height: 350px;"></div>
|
||||
</div>
|
||||
<!-- Right Side: AI Agent Activity & Quick Entry -->
|
||||
<div class="space-y-8">
|
||||
<!-- Quick Actions -->
|
||||
<div
|
||||
class="bg-blue-600 p-6 rounded-2xl shadow-lg shadow-blue-100 text-white relative overflow-hidden group">
|
||||
<iconify-icon
|
||||
class="absolute -right-4 -top-4 text-8xl text-white/10 group-hover:rotate-45 transition-transform duration-700"
|
||||
icon="lucide:sparkle"></iconify-icon>
|
||||
<h4 class="font-bold text-lg mb-2">快速开始</h4>
|
||||
<p class="text-xs text-blue-100 mb-6 leading-relaxed">Agent 已经准备好为您加速指摘录入流程,支持智能去重与自动分类。</p>
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<a class="flex items-center justify-center gap-2 bg-white/20 hover:bg-white/30 px-4 py-2.5 rounded-lg text-sm font-semibold transition-colors backdrop-blur-sm"
|
||||
href="issues.html">
|
||||
<iconify-icon icon="lucide:plus-square"></iconify-icon> 新建指摘
|
||||
</a>
|
||||
<a class="flex items-center justify-center gap-2 bg-white/20 hover:bg-white/30 px-4 py-2.5 rounded-lg text-sm font-semibold transition-colors backdrop-blur-sm"
|
||||
href="batch-input.html">
|
||||
<iconify-icon icon="lucide:file-spreadsheet"></iconify-icon> 批量导入
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- AI Insights -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">Agent 洞察</h4>
|
||||
</div>
|
||||
<ul class="space-y-4">
|
||||
<li class="flex gap-3">
|
||||
<div class="w-1 h-8 bg-orange-400 rounded-full mt-1"></div>
|
||||
<div>
|
||||
<p class="text-xs font-bold text-gray-900 leading-none mb-1">高风险警报</p>
|
||||
<p class="text-[11px] text-gray-500 leading-relaxed">检测到 PGM_002 模块出现 3
|
||||
个关联指摘,建议启动根因分析。</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="flex gap-3">
|
||||
<div class="w-1 h-8 bg-blue-400 rounded-full mt-1"></div>
|
||||
<div>
|
||||
<p class="text-xs font-bold text-gray-900 leading-none mb-1">自动对应建议</p>
|
||||
<p class="text-[11px] text-gray-500 leading-relaxed">Agent 已为 5 个指摘匹配了历史知识库中的修复方案。
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="flex gap-3">
|
||||
<div class="w-1 h-8 bg-green-400 rounded-full mt-1"></div>
|
||||
<div>
|
||||
<p class="text-xs font-bold text-gray-900 leading-none mb-1">任务提醒</p>
|
||||
<p class="text-[11px] text-gray-500 leading-relaxed">已向 2 位担当者发送了关于"逾期指摘"的自动催办。</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Bottom Row: Recent Activities & Distribution -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 pb-8">
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<h4 class="font-bold text-gray-800 mb-6">最新动态</h4>
|
||||
<div class="space-y-6">
|
||||
<div class="flex gap-4">
|
||||
<div
|
||||
class="w-10 h-10 rounded-full bg-gray-50 flex items-center justify-center flex-none border border-gray-100">
|
||||
<iconify-icon class="text-gray-400" icon="lucide:user"></iconify-icon>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex justify-between">
|
||||
<p class="text-sm font-bold text-gray-900">张明亮 <span
|
||||
class="text-gray-400 font-normal">录入了新指摘</span></p>
|
||||
<span class="text-[10px] text-gray-400">10分钟前</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 truncate mt-1">#ISSUE-2026-089 UI适配在大屏幕下出现错位</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<div
|
||||
class="w-10 h-10 rounded-full bg-blue-50 flex items-center justify-center flex-none border border-blue-100">
|
||||
<iconify-icon class="text-blue-600" icon="lucide:bot"></iconify-icon>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex justify-between">
|
||||
<p class="text-sm font-bold text-blue-600">IMS Agent <span
|
||||
class="text-gray-400 font-normal underline decoration-blue-200 decoration-wavy">自动对应了</span>
|
||||
</p>
|
||||
<span class="text-[10px] text-gray-400">25分钟前</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 truncate mt-1">#ISSUE-2026-085 通过知识库匹配已完成对应方案生成</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<div
|
||||
class="w-10 h-10 rounded-full bg-gray-50 flex items-center justify-center flex-none border border-gray-100">
|
||||
<iconify-icon class="text-gray-400" icon="lucide:user"></iconify-icon>
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex justify-between">
|
||||
<p class="text-sm font-bold text-gray-900">王小美 <span
|
||||
class="text-gray-400 font-normal">更改了状态为</span> <span
|
||||
class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full text-[10px]">已关闭</span>
|
||||
</p>
|
||||
<span class="text-[10px] text-gray-400">1小时前</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 truncate mt-1">#ISSUE-2026-072 数据库连接超时优化完成</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="w-full mt-6 py-2 text-xs font-semibold text-gray-500 hover:text-blue-600 hover:bg-gray-50 rounded-lg transition-colors border border-dashed border-gray-200">查看所有动态</button>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<h4 class="font-bold text-gray-800 mb-6">指摘状态分布</h4>
|
||||
<div id="statusChart" style="height: 300px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Main Trend Chart
|
||||
const mainChart = echarts.init(document.getElementById('mainChart'));
|
||||
mainChart.setOption({
|
||||
tooltip: { trigger: 'axis' },
|
||||
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['07-11', '07-12', '07-13', '07-14', '07-15', '07-16', '07-17'],
|
||||
axisLine: { lineStyle: { color: '#eee' } },
|
||||
axisLabel: { color: '#999' }
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitLine: { lineStyle: { type: 'dashed', color: '#f5f5f5' } },
|
||||
axisLabel: { color: '#999' }
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '新增指摘',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: [12, 18, 15, 22, 14, 19, 15],
|
||||
lineStyle: { color: '#1a73e8', width: 3 },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(26, 115, 232, 0.2)' },
|
||||
{ offset: 1, color: 'rgba(26, 115, 232, 0)' }
|
||||
])
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '已解决',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
data: [8, 12, 16, 18, 10, 22, 20],
|
||||
lineStyle: { color: '#34a853', width: 3 },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(52, 168, 83, 0.2)' },
|
||||
{ offset: 1, color: 'rgba(52, 168, 83, 0)' }
|
||||
])
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Status Distribution Chart
|
||||
const statusChart = echarts.init(document.getElementById('statusChart'));
|
||||
statusChart.setOption({
|
||||
tooltip: { trigger: 'item' },
|
||||
legend: { bottom: '5%', left: 'center', icon: 'circle' },
|
||||
series: [
|
||||
{
|
||||
name: '状态占比',
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
itemStyle: { borderRadius: 10, borderColor: '#fff', borderWidth: 2 },
|
||||
label: { show: false },
|
||||
data: [
|
||||
{ value: 42, name: '待处理', itemStyle: { color: '#fbbc05' } },
|
||||
{ value: 128, name: '对应中', itemStyle: { color: '#1a73e8' } },
|
||||
{ value: 65, name: '待确认', itemStyle: { color: '#8e44ad' } },
|
||||
{ value: 856, name: '已关闭', itemStyle: { color: '#34a853' } }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
mainChart.resize();
|
||||
statusChart.resize();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,456 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>指摘详情与 Agent 交互 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
.mono {
|
||||
font-family: 'JetBrains Mono', monospace;
|
||||
}
|
||||
|
||||
.thought-card {
|
||||
border-left: 4px solid #1a73e8;
|
||||
background: #f0f7ff;
|
||||
}
|
||||
|
||||
.action-card {
|
||||
border-left: 4px solid #f59e0b;
|
||||
background: #fffbeb;
|
||||
}
|
||||
|
||||
.observation-card {
|
||||
border-left: 4px solid #10b981;
|
||||
background: #f0fdf4;
|
||||
}
|
||||
|
||||
.approval-card {
|
||||
border: 2px solid #ef4444;
|
||||
background: #fef2f2;
|
||||
animation: pulse-border 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-border {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
border-color: #ef4444;
|
||||
}
|
||||
|
||||
50% {
|
||||
border-color: #fee2e2;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-container::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.chat-container::-webkit-scrollbar-thumb {
|
||||
background: #e2e8f0;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (Same as Dashboard) -->
|
||||
<aside class="w-20 lg:w-64 bg-white border-r border-gray-200 flex flex-col flex-none transition-all">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div class="hidden lg:block">
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="hidden lg:block font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="hidden lg:block font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="hidden lg:block font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="hidden lg:block pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">
|
||||
系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="hidden lg:block font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="hidden lg:block font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex overflow-hidden">
|
||||
<!-- Left: Issue Details (60%) -->
|
||||
<div class="w-3/5 flex flex-col border-r border-gray-200 bg-white overflow-hidden">
|
||||
<!-- Top bar -->
|
||||
<div class="h-16 px-8 border-b border-gray-100 flex items-center justify-between flex-none bg-white z-10">
|
||||
<div class="flex items-center gap-4">
|
||||
<a class="p-2 hover:bg-gray-50 rounded-lg text-gray-400 hover:text-gray-900 transition-colors"
|
||||
href="issues.html">
|
||||
<iconify-icon icon="lucide:arrow-left"></iconify-icon>
|
||||
</a>
|
||||
<div>
|
||||
<span class="text-[10px] font-bold text-blue-600 uppercase">ISSUE-2026-089</span>
|
||||
<h2 class="text-sm font-bold text-gray-900 leading-tight">UI 适配在大屏幕(4K)下出现布局错位</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
class="px-3 py-1.5 border border-gray-200 rounded-lg text-xs font-bold text-gray-600 hover:bg-gray-50 transition-colors">编辑</button>
|
||||
<button
|
||||
class="px-3 py-1.5 bg-gray-900 text-white rounded-lg text-xs font-bold hover:bg-black transition-colors">更改状态</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Detail Scroll Area -->
|
||||
<div class="flex-1 overflow-y-auto p-8 space-y-8">
|
||||
<!-- Status Row -->
|
||||
<div class="flex items-center gap-6 pb-6 border-b border-gray-50">
|
||||
<div>
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-1">当前状态</p>
|
||||
<span
|
||||
class="px-3 py-1 bg-blue-50 text-blue-700 rounded-full text-xs font-bold border border-blue-100">对应中</span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-1">优先级</p>
|
||||
<span
|
||||
class="px-3 py-1 bg-red-50 text-red-600 rounded-full text-xs font-bold border border-red-100 text-center">紧急</span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-1">对应者</p>
|
||||
<div class="flex items-center gap-2">
|
||||
<img alt="Avatar" class="w-5 h-5 rounded-full"
|
||||
src="https://modao.cc/agent-py/media/generated_images/2026-06-30/377a3b1a44d74771b013c6d95f8e7be0.jpg" />
|
||||
<span class="text-xs font-bold text-gray-700">陈志伟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase mb-1">创建日期</p>
|
||||
<span class="text-xs font-bold text-gray-700">2026-07-17</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Info Grid -->
|
||||
<div class="grid grid-cols-2 gap-x-12 gap-y-6 text-sm">
|
||||
<div class="space-y-1">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase">工程阶段</label>
|
||||
<p class="font-medium text-gray-900">结合测试 (IT)</p>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase">子工程</label>
|
||||
<p class="font-medium text-gray-900">用户管理子系统</p>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase">影响度</label>
|
||||
<p class="font-medium text-gray-900">较高 - 影响高分屏用户体验</p>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase">关联 PGM</label>
|
||||
<p class="font-medium text-blue-600 hover:underline cursor-pointer">PGM_AUTH_VIEW_001</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Content Area -->
|
||||
<div class="space-y-3">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase tracking-wider">指摘内容</label>
|
||||
<div class="bg-gray-50 rounded-xl p-5 border border-gray-100 leading-relaxed text-gray-800 text-sm">
|
||||
在分辨率达到 3840x2160 (4K) 及以上时,侧边栏导航的高度未能撑满全屏,底部的用户信息区域会出现悬浮空隙。同时,主看板的统计卡片在超宽比例下没有自动换行,导致右侧溢出。
|
||||
</div>
|
||||
</div>
|
||||
<!-- Attachments -->
|
||||
<div class="space-y-3">
|
||||
<div class="flex justify-between items-center">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase tracking-wider">附件 (2)</label>
|
||||
<button class="text-xs font-bold text-blue-600 hover:text-blue-800">+ 添加附件</button>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div
|
||||
class="flex items-center justify-between p-3 border border-gray-100 rounded-xl hover:border-blue-200 transition-colors group">
|
||||
<div class="flex items-center gap-3">
|
||||
<div
|
||||
class="w-10 h-10 bg-gray-50 rounded-lg flex items-center justify-center text-red-500">
|
||||
<iconify-icon class="text-2xl" icon="lucide:file-image"></iconify-icon>
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs font-bold text-gray-900 truncate">bug_screenshot_01.png</p>
|
||||
<p class="text-[10px] text-gray-400">2.4 MB</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
<iconify-icon class="text-gray-400 hover:text-blue-600 cursor-pointer p-1"
|
||||
icon="lucide:download"></iconify-icon>
|
||||
<iconify-icon class="text-gray-400 hover:text-red-600 cursor-pointer p-1"
|
||||
icon="lucide:trash-2"></iconify-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center justify-between p-3 border border-gray-100 rounded-xl hover:border-blue-200 transition-colors group">
|
||||
<div class="flex items-center gap-3">
|
||||
<div
|
||||
class="w-10 h-10 bg-gray-50 rounded-lg flex items-center justify-center text-blue-500">
|
||||
<iconify-icon class="text-2xl" icon="lucide:file-text"></iconify-icon>
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs font-bold text-gray-900 truncate">error_logs.txt</p>
|
||||
<p class="text-[10px] text-gray-400">12 KB</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
<iconify-icon class="text-gray-400 hover:text-blue-600 cursor-pointer p-1"
|
||||
icon="lucide:download"></iconify-icon>
|
||||
<iconify-icon class="text-gray-400 hover:text-red-600 cursor-pointer p-1"
|
||||
icon="lucide:trash-2"></iconify-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Timeline -->
|
||||
<div class="space-y-4">
|
||||
<div class="flex justify-between items-center">
|
||||
<label class="text-xs font-bold text-gray-400 uppercase tracking-wider">状态流转历史</label>
|
||||
<iconify-icon class="text-gray-400 cursor-pointer" icon="lucide:chevron-up"></iconify-icon>
|
||||
</div>
|
||||
<div class="space-y-4 pl-3 border-l-2 border-gray-100">
|
||||
<div class="relative pl-6 pb-2">
|
||||
<div
|
||||
class="absolute -left-[31px] top-0 w-4 h-4 rounded-full bg-blue-600 border-4 border-white shadow-sm">
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<p class="text-xs font-bold text-gray-900">状态更新:对应中</p>
|
||||
<span class="text-[10px] text-gray-400">今天 10:20</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">陈志伟 开始处理此指摘,正在分析 CSS Grid 适配问题。</p>
|
||||
</div>
|
||||
<div class="relative pl-6">
|
||||
<div
|
||||
class="absolute -left-[31px] top-0 w-4 h-4 rounded-full bg-gray-300 border-4 border-white shadow-sm">
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<p class="text-xs font-bold text-gray-900">指摘创建</p>
|
||||
<span class="text-[10px] text-gray-400">今天 09:45</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mt-1">张明亮 通过系统录入了此条指摘。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Right: AI Agent Cockpit (40%) -->
|
||||
<div class="w-2/5 flex flex-col bg-[#fcfdfe]">
|
||||
<!-- Agent Header -->
|
||||
<div class="h-16 px-6 border-b border-gray-200 flex items-center justify-between flex-none bg-white">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:bot"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-sm font-bold text-gray-900">IMS Agent 驾驶舱</h3>
|
||||
<p class="text-[10px] text-green-600 font-bold flex items-center gap-1">
|
||||
<span class="w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"></span> 在线 · 实时分析中
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex items-center gap-2 px-2 py-1 bg-gray-50 rounded-lg">
|
||||
<span class="text-[10px] font-bold text-gray-400 uppercase">时间线</span>
|
||||
<div class="w-8 h-4 bg-blue-600 rounded-full relative cursor-pointer">
|
||||
<div class="absolute right-0.5 top-0.5 w-3 h-3 bg-white rounded-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="p-2 hover:bg-gray-100 rounded-lg text-gray-400 transition-colors">
|
||||
<iconify-icon icon="lucide:settings-2"></iconify-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Chat Area -->
|
||||
<div class="flex-1 overflow-y-auto p-6 space-y-6 chat-container" id="agentChat">
|
||||
<!-- Agent Intro -->
|
||||
<div class="flex gap-4">
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center flex-none">
|
||||
<iconify-icon class="text-white text-sm" icon="lucide:bot"></iconify-icon>
|
||||
</div>
|
||||
<div class="bg-white border border-gray-100 rounded-2xl rounded-tl-none p-4 shadow-sm max-w-[90%]">
|
||||
<p class="text-sm leading-relaxed text-gray-800">
|
||||
你好!我是您的指摘处理助手。我已经分析了这条指摘的内容。它涉及到前端适配问题。
|
||||
<br /><br />
|
||||
我可以帮您<b>催办担当者</b>、<b>查找知识库中的相似案例</b>,或者<b>根据附件日志自动推断错误原因</b>。您想怎么做?
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- User Message -->
|
||||
<div class="flex gap-4 justify-end">
|
||||
<div class="bg-blue-600 text-white rounded-2xl rounded-tr-none p-4 shadow-md max-w-[90%]">
|
||||
<p class="text-sm">查找知识库中的相似案例,并询问陈志伟是否需要技术支持。</p>
|
||||
</div>
|
||||
<div
|
||||
class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center flex-none border border-white overflow-hidden shadow-sm">
|
||||
<img alt="User" class="w-full h-full object-cover"
|
||||
src="https://modao.cc/agent-py/media/generated_images/2026-06-26/1e6c3700aaed4eeab622a5493b909edf.jpg" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- AI Thinking Chain -->
|
||||
<div class="space-y-4">
|
||||
<!-- Thought -->
|
||||
<div class="thought-card rounded-xl p-4 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<iconify-icon class="text-blue-600" icon="lucide:brain"></iconify-icon>
|
||||
<span class="text-xs font-bold text-blue-700 uppercase tracking-wider">[思考]</span>
|
||||
</div>
|
||||
<p class="text-xs text-blue-900/70 leading-relaxed italic">
|
||||
用户要求查找知识库相似案例。我需要调用 `search_knowledge` 工具,关键词为 "4K 适配", "侧边栏高度", "超宽屏 布局错位"。
|
||||
同时需要调用 `send_reminder` 工具给担当者陈志伟。
|
||||
</p>
|
||||
</div>
|
||||
<!-- Action -->
|
||||
<div class="action-card rounded-xl p-4 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<iconify-icon class="text-orange-600" icon="lucide:terminal"></iconify-icon>
|
||||
<span class="text-xs font-bold text-orange-700 uppercase tracking-wider">[行动]</span>
|
||||
</div>
|
||||
<div
|
||||
class="mono text-[11px] text-orange-900 bg-orange-100/50 p-3 rounded-lg border border-orange-200">
|
||||
call: <span class="font-bold">search_knowledge</span>({ <br />
|
||||
query: <span class="text-blue-700">"4K screen layout sidebar bug"</span>, <br />
|
||||
project: <span class="text-blue-700">"FRONTEND_CORE"</span> <br />
|
||||
})
|
||||
</div>
|
||||
</div>
|
||||
<!-- Observation -->
|
||||
<div class="observation-card rounded-xl p-4 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<iconify-icon class="text-green-600" icon="lucide:eye"></iconify-icon>
|
||||
<span class="text-xs font-bold text-green-700 uppercase tracking-wider">[观察]</span>
|
||||
</div>
|
||||
<p class="text-xs text-green-900/70 leading-relaxed">
|
||||
找到 1 条相似记录:<b>#KB-2025-042</b> "Flex容器在超高分辨率下的 100vh 兼容性修正"。方案:建议使用 `min-h-screen`
|
||||
代替固定高度,并开启 `flex-grow`。
|
||||
</p>
|
||||
</div>
|
||||
<!-- Approval Request -->
|
||||
<div class="approval-card rounded-xl p-5 shadow-lg">
|
||||
<div class="flex items-center gap-2 mb-3">
|
||||
<iconify-icon class="text-red-600 text-xl" icon="lucide:shield-alert"></iconify-icon>
|
||||
<span class="text-sm font-bold text-red-700">需要您的审批</span>
|
||||
</div>
|
||||
<p class="text-xs text-gray-700 leading-relaxed mb-4">
|
||||
Agent 准备调用 <code
|
||||
class="bg-gray-100 px-1 rounded text-red-600 font-bold">send_reminder</code> 给
|
||||
<b>陈志伟</b>。
|
||||
<br /><br />
|
||||
<b>内容:</b> "陈工您好,系统检测到您的 ISSUE-089 与已知案例 #KB-042 相似,推荐方案已发送至您的工作台。如有技术困难,请联系架构组支持。"
|
||||
</p>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
class="flex-1 bg-red-600 text-white text-xs font-bold py-2 rounded-lg hover:bg-red-700 transition-colors shadow-md shadow-red-100"
|
||||
onclick="alert('已批准发送催办')">批准发送</button>
|
||||
<button
|
||||
class="flex-1 bg-white border border-gray-200 text-gray-600 text-xs font-bold py-2 rounded-lg hover:bg-gray-50 transition-colors">修改建议</button>
|
||||
<button
|
||||
class="px-3 bg-white border border-gray-200 text-gray-400 rounded-lg hover:bg-gray-50 transition-colors">
|
||||
<iconify-icon icon="lucide:x"></iconify-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Final Response -->
|
||||
<div class="flex gap-4">
|
||||
<div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center flex-none">
|
||||
<iconify-icon class="text-white text-sm" icon="lucide:bot"></iconify-icon>
|
||||
</div>
|
||||
<div class="bg-white border border-gray-100 rounded-2xl rounded-tl-none p-4 shadow-sm max-w-[90%]">
|
||||
<p class="text-sm leading-relaxed text-gray-800">
|
||||
知识库检索完成!已为您锁定历史解决方案。我已准备好向陈工发送提醒并提供该方案。请在上方点击“批准”以继续。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Input Area -->
|
||||
<div class="p-6 bg-white border-t border-gray-200 flex-none space-y-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex gap-4">
|
||||
<button
|
||||
class="flex items-center gap-1.5 text-xs font-bold text-gray-400 hover:text-blue-600 transition-colors">
|
||||
<iconify-icon class="text-lg" icon="lucide:mic"></iconify-icon>
|
||||
语音输入
|
||||
</button>
|
||||
<button
|
||||
class="flex items-center gap-1.5 text-xs font-bold text-gray-400 hover:text-blue-600 transition-colors">
|
||||
<iconify-icon class="text-lg" icon="lucide:file-text"></iconify-icon>
|
||||
选择模板
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="flex items-center gap-1.5 text-xs font-bold text-red-500 hover:text-red-700 transition-colors border border-red-100 px-3 py-1 rounded-full bg-red-50">
|
||||
<iconify-icon class="text-lg" icon="lucide:user-cog"></iconify-icon>
|
||||
转人工模式
|
||||
</button>
|
||||
</div>
|
||||
<div class="relative group">
|
||||
<textarea
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-2xl p-4 pr-16 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all resize-none shadow-inner"
|
||||
placeholder="给 Agent 下达指令,如:“将状态改为待确认,并通知验证人员。”" rows="3"></textarea>
|
||||
<button
|
||||
class="absolute right-3 bottom-3 w-10 h-10 bg-blue-600 text-white rounded-xl flex items-center justify-center hover:bg-blue-700 transition-all shadow-lg shadow-blue-200 active:scale-95 group-focus-within:rotate-12">
|
||||
<iconify-icon class="text-xl" icon="lucide:send-horizontal"></iconify-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-[10px] font-bold text-gray-400 uppercase">Agent 工具可用:</span>
|
||||
<div class="flex gap-1">
|
||||
<span class="px-2 py-0.5 bg-gray-100 rounded text-[9px] font-bold text-gray-500">知识库查询</span>
|
||||
<span class="px-2 py-0.5 bg-gray-100 rounded text-[9px] font-bold text-gray-500">催办通知</span>
|
||||
<span class="px-2 py-0.5 bg-gray-100 rounded text-[9px] font-bold text-gray-500">状态流转</span>
|
||||
<span class="px-2 py-0.5 bg-gray-100 rounded text-[9px] font-bold text-gray-500">+4</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
// Simple chat auto-scroll
|
||||
const chat = document.getElementById('agentChat');
|
||||
chat.scrollTop = chat.scrollHeight;
|
||||
|
||||
// Toggle Timeline Simulation
|
||||
function toggleTimeline() {
|
||||
const history = document.getElementById('issueHistory');
|
||||
// Mock logic
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,341 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>新建指摘 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="dashboard.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group" href="issues.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="batch-input.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="knowledge-base.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="users.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="roles.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="agent-management.html" target="_self">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<!-- Header -->
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<div class="flex items-center gap-4">
|
||||
<a href="issues.html" target="_self" class="p-2 hover:bg-gray-50 rounded-lg text-gray-400 hover:text-gray-900 transition-colors">
|
||||
<iconify-icon icon="lucide:arrow-left"></iconify-icon>
|
||||
</a>
|
||||
<h2 class="text-lg font-semibold text-gray-800">新建指摘</h2>
|
||||
<span class="text-xs text-gray-400">ISSUE-2026-090 (草稿)</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<button class="px-4 py-2 text-sm font-semibold text-gray-500 hover:text-gray-700 transition-colors border border-gray-200 rounded-lg hover:bg-gray-50">清空重置</button>
|
||||
<button class="px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-semibold transition-colors flex items-center gap-2 shadow-md shadow-blue-200">
|
||||
<iconify-icon icon="lucide:save"></iconify-icon> 保存指摘
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Content Area -->
|
||||
<div class="flex-1 overflow-y-auto p-8">
|
||||
<div class="max-w-6xl mx-auto grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
<!-- Left: Main Form -->
|
||||
<div class="lg:col-span-2 space-y-6">
|
||||
<!-- Basic Info Section -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-6">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<div class="w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-blue-600" icon="lucide:file-text"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="font-bold text-gray-800">基本信息</h3>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-5">
|
||||
<div class="col-span-2">
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">指摘标题 <span class="text-red-500">*</span></label>
|
||||
<input type="text" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="请输入指摘标题" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">工程阶段 <span class="text-red-500">*</span></label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>基本设计</option>
|
||||
<option>详细设计</option>
|
||||
<option>单体测试</option>
|
||||
<option>结合测试 (IT)</option>
|
||||
<option>综合测试 (ST)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">子工程 <span class="text-red-500">*</span></label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>用户管理子系统</option>
|
||||
<option>权限控制子系统</option>
|
||||
<option>数据报表子系统</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">区分 <span class="text-red-500">*</span></label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>功能缺陷</option>
|
||||
<option>UI/UX问题</option>
|
||||
<option>性能问题</option>
|
||||
<option>安全漏洞</option>
|
||||
<option>文档错误</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">指摘日 <span class="text-red-500">*</span></label>
|
||||
<input type="date" value="2026-07-20" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">关联 PGM</label>
|
||||
<input type="text" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="如 PGM_AUTH_VIEW_001" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">影响度 <span class="text-red-500">*</span></label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>严重 - 系统不可用</option>
|
||||
<option>较高 - 核心功能受影响</option>
|
||||
<option>一般 - 非核心功能</option>
|
||||
<option>轻微 - 体验优化</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">影响工程</label>
|
||||
<input type="text" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="如:前端适配、数据库查询" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">部署</label>
|
||||
<input type="text" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="部署位置/环境" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">Review 者 <span class="text-red-500">*</span></label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>李志强</option>
|
||||
<option>陈志伟</option>
|
||||
<option>张美心</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">Review 工数 (h)</label>
|
||||
<input type="number" step="0.5" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="0.0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content Section -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-6">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<div class="w-8 h-8 bg-orange-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-orange-600" icon="lucide:message-square"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="font-bold text-gray-800">指摘内容</h3>
|
||||
</div>
|
||||
<div class="space-y-5">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">指摘内容 <span class="text-red-500">*</span></label>
|
||||
<textarea rows="5" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all resize-none" placeholder="请详细描述问题现象、复现步骤、期望结果..."></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">NG 原因</label>
|
||||
<input type="text" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="如:设计遗漏、编码错误、需求变更" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Response Section -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-6">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<div class="w-8 h-8 bg-green-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-green-600" icon="lucide:check-circle"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="font-bold text-gray-800">对应信息</h3>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-5">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">对应者 <span class="text-red-500">*</span></label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>陈志伟</option>
|
||||
<option>张美心</option>
|
||||
<option>李华</option>
|
||||
<option>王五</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">对应工数 (h)</label>
|
||||
<input type="number" step="0.5" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" placeholder="0.0" />
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">对应内容</label>
|
||||
<textarea rows="3" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all resize-none" placeholder="填写整改方案或对应措施..."></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">对应完了日</label>
|
||||
<input type="date" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" />
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">确认者</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>请选择</option>
|
||||
<option>李志强</option>
|
||||
<option>陈志伟</option>
|
||||
<option>张美心</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">确认日</label>
|
||||
<input type="date" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Attachments -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-6">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-purple-600" icon="lucide:paperclip"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="font-bold text-gray-800">附件</h3>
|
||||
</div>
|
||||
<button class="text-xs font-bold text-blue-600 hover:text-blue-800 flex items-center gap-1">
|
||||
<iconify-icon icon="lucide:plus" width="14"></iconify-icon> 添加附件
|
||||
</button>
|
||||
</div>
|
||||
<div class="border-2 border-dashed border-gray-200 rounded-xl p-8 text-center hover:border-blue-300 transition-colors">
|
||||
<div class="w-12 h-12 bg-gray-50 rounded-full flex items-center justify-center mx-auto mb-3">
|
||||
<iconify-icon class="text-2xl text-gray-400" icon="lucide:upload-cloud"></iconify-icon>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500">点击或拖拽文件到此处上传</p>
|
||||
<p class="text-[10px] text-gray-400 mt-1">支持图片、文档、日志文件,单个不超过 20MB</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right: Quick Settings + Agent Assist -->
|
||||
<div class="space-y-6">
|
||||
<!-- Quick Settings Card -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-6">
|
||||
<h4 class="font-bold text-gray-800 mb-5 text-sm">快速设置</h4>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">状态</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>草稿</option>
|
||||
<option>待对应</option>
|
||||
<option>对应中</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">优先级 <span class="text-red-500">*</span></label>
|
||||
<div class="grid grid-cols-4 gap-2">
|
||||
<button class="py-2 rounded-lg text-xs font-bold border border-red-200 bg-red-50 text-red-700">紧急</button>
|
||||
<button class="py-2 rounded-lg text-xs font-bold border border-gray-200 text-gray-500 hover:bg-gray-50">高</button>
|
||||
<button class="py-2 rounded-lg text-xs font-bold border border-gray-200 text-gray-500 hover:bg-gray-50">中</button>
|
||||
<button class="py-2 rounded-lg text-xs font-bold border border-gray-200 text-gray-500 hover:bg-gray-50">低</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">归属部门</label>
|
||||
<select class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all">
|
||||
<option>研发中心</option>
|
||||
<option>品质保证部</option>
|
||||
<option>运维部</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">创建人</label>
|
||||
<div class="flex items-center gap-2 bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5">
|
||||
<div class="w-6 h-6 bg-blue-600 rounded-full flex items-center justify-center text-white text-[10px] font-bold">李</div>
|
||||
<span class="text-sm text-gray-700">李志强</span>
|
||||
<span class="text-[10px] text-gray-400 ml-auto">只读</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[10px] font-bold text-gray-400 uppercase mb-1.5">整改截止日期 <span class="text-red-500">*</span></label>
|
||||
<input type="date" class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Agent Assist Card -->
|
||||
<div class="bg-blue-600 rounded-2xl shadow-lg shadow-blue-200 p-6 text-white relative overflow-hidden">
|
||||
<iconify-icon class="absolute -right-4 -top-4 text-8xl text-white/10" icon="lucide:sparkles"></iconify-icon>
|
||||
<div class="flex items-center gap-2 mb-4 relative z-10">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<h4 class="font-bold">Agent 辅助</h4>
|
||||
</div>
|
||||
<p class="text-xs text-blue-100 mb-4 leading-relaxed relative z-10">输入标题后,Agent 可自动分析并推荐工程阶段、优先级、影响度等字段。</p>
|
||||
<button class="w-full py-2.5 bg-white/20 hover:bg-white/30 rounded-lg text-sm font-semibold transition-colors backdrop-blur-sm relative z-10 flex items-center justify-center gap-2">
|
||||
<iconify-icon icon="lucide:sparkles" width="16"></iconify-icon>
|
||||
让 Agent 智能填充
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Draft Save Info -->
|
||||
<div class="bg-gray-50 rounded-2xl border border-gray-100 p-4">
|
||||
<div class="flex items-center gap-2 text-gray-500">
|
||||
<iconify-icon class="text-gray-400" icon="lucide:clock" width="16"></iconify-icon>
|
||||
<span class="text-xs">自动保存于 13:58</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,411 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>指摘列表 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
|
||||
.issue-row:hover {
|
||||
background-color: #f8fafc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.agent-suggestion {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.agent-suggestion::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -8px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 3px;
|
||||
height: 60%;
|
||||
background: linear-gradient(to bottom, #1a73e8, #60a5fa);
|
||||
border-radius: 2px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (Same as Dashboard) -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="roles.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl group-hover:text-blue-600" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<!-- Header -->
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<div class="flex items-center gap-4">
|
||||
<h2 class="text-lg font-semibold text-gray-800">指摘列表</h2>
|
||||
<div class="flex items-center px-3 py-1.5 bg-blue-50 text-blue-700 rounded-full text-xs font-bold">
|
||||
<iconify-icon class="mr-1" icon="lucide:sparkles"></iconify-icon>
|
||||
AI 实时监控中
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="relative">
|
||||
<iconify-icon class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"
|
||||
icon="lucide:search"></iconify-icon>
|
||||
<input
|
||||
class="pl-9 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm w-80 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all"
|
||||
placeholder="搜索指摘 ID、标题或关键词..." type="text" />
|
||||
</div>
|
||||
<button class="flex items-center gap-2 bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-semibold transition-colors">
|
||||
<iconify-icon icon="lucide:file-spreadsheet"></iconify-icon> 导出 Excel
|
||||
</button>
|
||||
<a href="issue-new.html" target="_self" class="flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm font-semibold transition-colors">
|
||||
<iconify-icon icon="lucide:plus"></iconify-icon> 新建指摘
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<!-- Main Body -->
|
||||
<div class="flex-1 overflow-y-auto p-8 flex flex-col gap-8">
|
||||
<!-- Status Tabs / Overview -->
|
||||
<div class="grid grid-cols-4 gap-6 flex-none">
|
||||
<div
|
||||
class="bg-white border-b-4 border-orange-400 p-4 rounded-xl shadow-sm hover:shadow-md transition-shadow cursor-pointer">
|
||||
<div class="flex justify-between items-center mb-1">
|
||||
<span class="text-xs font-bold text-gray-500 uppercase tracking-wider">待对应</span>
|
||||
<iconify-icon class="text-orange-400" icon="lucide:alert-circle"></iconify-icon>
|
||||
</div>
|
||||
<div class="text-2xl font-bold text-gray-900">42</div>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white border-b-4 border-blue-400 p-4 rounded-xl shadow-sm hover:shadow-md transition-shadow cursor-pointer">
|
||||
<div class="flex justify-between items-center mb-1">
|
||||
<span class="text-xs font-bold text-gray-500 uppercase tracking-wider">对应中</span>
|
||||
<iconify-icon class="text-blue-400" icon="lucide:clock"></iconify-icon>
|
||||
</div>
|
||||
<div class="text-2xl font-bold text-gray-900">128</div>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white border-b-4 border-purple-400 p-4 rounded-xl shadow-sm hover:shadow-md transition-shadow cursor-pointer">
|
||||
<div class="flex justify-between items-center mb-1">
|
||||
<span class="text-xs font-bold text-gray-500 uppercase tracking-wider">待确认</span>
|
||||
<iconify-icon class="text-purple-400" icon="lucide:eye"></iconify-icon>
|
||||
</div>
|
||||
<div class="text-2xl font-bold text-gray-900">65</div>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white border-b-4 border-green-400 p-4 rounded-xl shadow-sm hover:shadow-md transition-shadow cursor-pointer">
|
||||
<div class="flex justify-between items-center mb-1">
|
||||
<span class="text-xs font-bold text-gray-500 uppercase tracking-wider">已关闭</span>
|
||||
<iconify-icon class="text-green-400" icon="lucide:check-circle"></iconify-icon>
|
||||
</div>
|
||||
<div class="text-2xl font-bold text-gray-900">856</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Filter Panel -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<iconify-icon class="text-gray-400" icon="lucide:sliders-horizontal"></iconify-icon>
|
||||
<span class="text-sm font-bold text-gray-700">筛选条件</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[11px] font-bold text-gray-400 uppercase">工程阶段</label>
|
||||
<select
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>基本设计</option>
|
||||
<option>详细设计</option>
|
||||
<option>单体测试</option>
|
||||
<option>结合测试</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[11px] font-bold text-gray-400 uppercase">子工程</label>
|
||||
<select
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>子系统 A</option>
|
||||
<option>子系统 B</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[11px] font-bold text-gray-400 uppercase">优先级</label>
|
||||
<select
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>紧急</option>
|
||||
<option>高</option>
|
||||
<option>中</option>
|
||||
<option>低</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[11px] font-bold text-gray-400 uppercase">影响度</label>
|
||||
<select
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
<option>全部</option>
|
||||
<option>严重</option>
|
||||
<option>较大</option>
|
||||
<option>一般</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4 gap-2">
|
||||
<button
|
||||
class="px-4 py-2 text-sm font-semibold text-gray-500 hover:text-gray-700 transition-colors">重置</button>
|
||||
<button
|
||||
class="px-6 py-2 bg-gray-900 text-white rounded-lg text-sm font-semibold hover:bg-black transition-all">应用筛选</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Agent批量操作栏 -->
|
||||
<div class="bg-blue-50 border border-blue-100 rounded-xl p-4 flex items-center justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center">
|
||||
<iconify-icon class="text-blue-600" icon="lucide:bot"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-bold text-blue-800">Agent 批量处理</p>
|
||||
<p class="text-[10px] text-blue-600/70">选中多条指摘后,可使用 Agent 统一分配或催办</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button class="px-4 py-2 bg-white border border-blue-200 text-blue-700 rounded-lg text-xs font-bold hover:bg-blue-50 transition-all flex items-center gap-1.5">
|
||||
<iconify-icon icon="lucide:shuffle" width="14"></iconify-icon> Agent 统一分配
|
||||
</button>
|
||||
<button class="px-4 py-2 bg-white border border-blue-200 text-blue-700 rounded-lg text-xs font-bold hover:bg-blue-50 transition-all flex items-center gap-1.5">
|
||||
<iconify-icon icon="lucide:bell" width="14"></iconify-icon> Agent 批量催办
|
||||
</button>
|
||||
<button class="px-4 py-2 bg-blue-600 text-white rounded-lg text-xs font-bold hover:bg-blue-700 transition-all flex items-center gap-1.5 shadow-sm shadow-blue-200">
|
||||
<iconify-icon icon="lucide:sparkles" width="14"></iconify-icon> Agent 智能分析
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Table Container -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden flex flex-col">
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-4 py-4 w-10">
|
||||
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">ID / 标题</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">状态</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">优先级</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">影响度</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">对应者</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">Agent 建议</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">日期</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<!-- Row 1 -->
|
||||
<tr class="issue-row group">
|
||||
<td class="px-4 py-4">
|
||||
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
</td>
|
||||
<td class="px-6 py-4" onclick="window.location.href='issue-detail.html'">
|
||||
<p class="text-[10px] font-bold text-blue-600 mb-1">ISSUE-2026-089</p>
|
||||
<p class="text-sm font-semibold text-gray-900 group-hover:text-blue-600 transition-colors">UI 适配在大屏幕(4K)下出现布局错位</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-blue-50 text-blue-700 rounded-full text-[11px] font-bold border border-blue-100">对应中</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-red-50 text-red-600 rounded-full text-[11px] font-bold border border-red-100">紧急</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<iconify-icon class="text-red-500 text-lg" icon="lucide:arrow-up-circle"></iconify-icon>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-700">陈志伟</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="agent-suggestion pl-2">
|
||||
<p class="text-[11px] text-blue-700 font-medium">知识库匹配到相似案例 #KB-042</p>
|
||||
<p class="text-[10px] text-gray-400 mt-0.5">建议替换 min-h-screen</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500 font-medium">2026-07-17</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<iconify-icon class="text-gray-400 hover:text-blue-600" icon="lucide:more-vertical"></iconify-icon>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Row 2 -->
|
||||
<tr class="issue-row group">
|
||||
<td class="px-4 py-4">
|
||||
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
</td>
|
||||
<td class="px-6 py-4" onclick="window.location.href='issue-detail.html'">
|
||||
<p class="text-[10px] font-bold text-blue-600 mb-1">ISSUE-2026-085</p>
|
||||
<p class="text-sm font-semibold text-gray-900 group-hover:text-blue-600 transition-colors">数据库慢查询:用户订单统计页面响应超 5s</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-orange-50 text-orange-700 rounded-full text-[11px] font-bold border border-orange-100">待对应</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-orange-50 text-orange-600 rounded-full text-[11px] font-bold border border-orange-100">高</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<iconify-icon class="text-orange-500 text-lg" icon="lucide:arrow-up-circle"></iconify-icon>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-400">未分配</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="agent-suggestion pl-2">
|
||||
<p class="text-[11px] text-orange-700 font-medium">建议添加复合索引</p>
|
||||
<p class="text-[10px] text-gray-400 mt-0.5">检测到缺失 WHERE 索引</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500 font-medium">2026-07-16</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<iconify-icon class="text-gray-400 hover:text-blue-600" icon="lucide:more-vertical"></iconify-icon>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Row 3 -->
|
||||
<tr class="issue-row group">
|
||||
<td class="px-4 py-4">
|
||||
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
</td>
|
||||
<td class="px-6 py-4" onclick="window.location.href='issue-detail.html'">
|
||||
<p class="text-[10px] font-bold text-blue-600 mb-1">ISSUE-2026-082</p>
|
||||
<p class="text-sm font-semibold text-gray-900 group-hover:text-blue-600 transition-colors">登录页面表单校验逻辑漏掉了特殊字符处理</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-purple-50 text-purple-700 rounded-full text-[11px] font-bold border border-purple-100">待确认</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-gray-50 text-gray-600 rounded-full text-[11px] font-bold border border-gray-100">中</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<iconify-icon class="text-gray-400 text-lg" icon="lucide:arrow-right-circle"></iconify-icon>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-700">张美心</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="agent-suggestion pl-2">
|
||||
<p class="text-[11px] text-green-700 font-medium">整改方案已验证通过</p>
|
||||
<p class="text-[10px] text-gray-400 mt-0.5">可进入确认流程</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500 font-medium">2026-07-15</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<iconify-icon class="text-gray-400 hover:text-blue-600" icon="lucide:more-vertical"></iconify-icon>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Row 4 -->
|
||||
<tr class="issue-row group">
|
||||
<td class="px-4 py-4">
|
||||
<input type="checkbox" class="rounded border-gray-300 text-blue-600 focus:ring-blue-500" />
|
||||
</td>
|
||||
<td class="px-6 py-4" onclick="window.location.href='issue-detail.html'">
|
||||
<p class="text-[10px] font-bold text-blue-600 mb-1">ISSUE-2026-078</p>
|
||||
<p class="text-sm font-semibold text-gray-900 group-hover:text-blue-600 transition-colors">API 文档中 PGM_005 接口参数描述错误</p>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-green-50 text-green-700 rounded-full text-[11px] font-bold border border-green-100">已关闭</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="px-3 py-1 bg-gray-50 text-gray-600 rounded-full text-[11px] font-bold border border-gray-100">低</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<iconify-icon class="text-green-500 text-lg" icon="lucide:arrow-down-circle"></iconify-icon>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-700">李华</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="pl-2">
|
||||
<p class="text-[11px] text-gray-400">—</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500 font-medium">2026-07-14</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<iconify-icon class="text-gray-400 hover:text-blue-600" icon="lucide:more-vertical"></iconify-icon>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- Pagination -->
|
||||
<div class="px-6 py-4 bg-gray-50 border-t border-gray-100 flex items-center justify-between">
|
||||
<p class="text-xs text-gray-500 font-medium">显示 1 到 4 条,共 1,091 条</p>
|
||||
<div class="flex gap-1">
|
||||
<button
|
||||
class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-gray-400 hover:bg-white transition-colors"><iconify-icon
|
||||
icon="lucide:chevron-left"></iconify-icon></button>
|
||||
<button
|
||||
class="w-8 h-8 rounded border border-blue-600 bg-blue-600 text-white flex items-center justify-center text-xs font-bold transition-colors">1</button>
|
||||
<button
|
||||
class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-xs font-bold text-gray-600 hover:bg-white transition-colors">2</button>
|
||||
<button
|
||||
class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-xs font-bold text-gray-600 hover:bg-white transition-colors">3</button>
|
||||
<button
|
||||
class="w-8 h-8 rounded border border-gray-200 flex items-center justify-center text-gray-400 hover:bg-white transition-colors"><iconify-icon
|
||||
icon="lucide:chevron-right"></iconify-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,320 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>知识库管理 - 指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js">
|
||||
</script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js">
|
||||
</script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
body {
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
}
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
.upload-dashed {
|
||||
background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%23D1D5DBFF' stroke-width='3' stroke-dasharray='8%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
|
||||
}
|
||||
.upload-dashed:hover {
|
||||
background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%231A73E8FF' stroke-width='3' stroke-dasharray='8%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
|
||||
border-color: transparent;
|
||||
}
|
||||
.tab-active {
|
||||
border-bottom: 3px solid #1a73e8;
|
||||
color: #1a73e8;
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (完全相同) -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group" href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="roles.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
<div class="p-4 border-t border-gray-100">
|
||||
<div class="bg-blue-50 rounded-xl p-4">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<div class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center">
|
||||
<iconify-icon class="text-white text-sm" icon="lucide:sparkles"></iconify-icon>
|
||||
</div>
|
||||
<span class="text-xs font-bold text-blue-800 tracking-tight">AI Agent 状态</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-[10px] text-blue-600 font-medium italic">正在监控指摘状态...</span>
|
||||
<span class="flex h-2 w-2 rounded-full bg-green-500 animate-pulse"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<!-- Header -->
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<div class="flex items-center gap-4">
|
||||
<h2 class="text-lg font-semibold text-gray-800">知识库管理</h2>
|
||||
<span class="text-xs text-gray-400">2026年7月17日 星期五</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-6">
|
||||
<div class="relative">
|
||||
<iconify-icon class="text-xl text-gray-500 hover:text-blue-600 cursor-pointer" icon="lucide:bell"></iconify-icon>
|
||||
<span class="absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-[10px] flex items-center justify-center rounded-full border-2 border-white font-bold">3</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 pl-6 border-l border-gray-100">
|
||||
<div class="text-right">
|
||||
<p class="text-xs font-bold text-gray-900 leading-none">李志强</p>
|
||||
<p class="text-[10px] text-gray-400 mt-1">系统管理员</p>
|
||||
</div>
|
||||
<img alt="User Avatar" class="w-9 h-9 rounded-full border border-gray-200" src="https://modao.cc/agent-py/media/generated_images/2026-06-26/3897ae65e7734794adc3fbb56826b171.jpg" />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Scrollable Content -->
|
||||
<div class="flex-1 overflow-y-auto p-8 space-y-8 bg-gray-50">
|
||||
<!-- Tabs -->
|
||||
<div class="border-b border-gray-200 bg-white rounded-t-2xl px-6 pt-4">
|
||||
<div class="flex gap-8">
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700 tab-active" data-tab="documents" onclick="switchTab('documents')">
|
||||
<iconify-icon icon="lucide:file-text" class="inline mr-1"></iconify-icon> 文档管理
|
||||
</button>
|
||||
<button class="pb-3 text-sm font-medium text-gray-500 hover:text-gray-700" data-tab="audit" onclick="switchTab('audit')">
|
||||
<iconify-icon icon="lucide:search" class="inline mr-1"></iconify-icon> 检索审计
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Content: 文档管理 -->
|
||||
<div id="tab-documents" class="space-y-6">
|
||||
<!-- Upload Area -->
|
||||
<div class="bg-white p-10 rounded-2xl border border-gray-100 shadow-sm flex flex-col items-center justify-center text-center upload-dashed group transition-all">
|
||||
<div class="w-20 h-20 bg-blue-50 text-blue-600 rounded-full flex items-center justify-center mb-6 group-hover:scale-110 transition-transform">
|
||||
<iconify-icon class="text-4xl" icon="lucide:upload-cloud"></iconify-icon>
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-gray-900 mb-2">点击或拖拽文件到此处上传</h3>
|
||||
<p class="text-sm text-gray-400 mb-6">支持 PDF, Word (.docx), TXT, Markdown 格式,单个文件不超过 50MB</p>
|
||||
<input class="hidden" id="fileInput" type="file" multiple accept=".pdf,.docx,.txt,.md" />
|
||||
<button class="bg-blue-600 text-white px-8 py-3 rounded-xl font-bold hover:bg-blue-700 transition-all shadow-lg shadow-blue-200" onclick="document.getElementById('fileInput').click()">选择文件</button>
|
||||
</div>
|
||||
|
||||
<!-- Document List -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-gray-50/50">
|
||||
<div class="flex items-center gap-3">
|
||||
<span class="text-sm font-bold text-gray-700">文档列表</span>
|
||||
<span class="text-xs text-gray-400">共 6 个文档</span>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button class="text-xs font-semibold text-gray-500 hover:text-blue-600 px-3 py-1 bg-white rounded-lg border border-gray-200 hover:border-blue-300 transition-all">重新向量化 (3)</button>
|
||||
<button class="text-xs font-semibold text-red-500 hover:text-red-700 px-3 py-1 bg-white rounded-lg border border-gray-200 hover:border-red-300 transition-all">删除 (3)</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-3 w-10"><input type="checkbox" id="selectAllDocs" onchange="toggleAllDocs()" /></th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">文件名</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">上传人</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">上传时间</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">状态</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">分块数</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4"><input type="checkbox" class="doc-checkbox" onchange="updateDocSelectAll()" /></td>
|
||||
<td class="px-6 py-4 font-medium text-gray-800">API设计规范_v2.1.pdf</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-600">李志强</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">2026-07-15 14:23</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full text-[10px] font-bold">已完成</span></td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">42</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:rotate-ccw" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:trash-2" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4"><input type="checkbox" class="doc-checkbox" onchange="updateDocSelectAll()" /></td>
|
||||
<td class="px-6 py-4 font-medium text-gray-800">故障排查手册.docx</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-600">陈志伟</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">2026-07-14 09:15</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-yellow-100 text-yellow-700 rounded-full text-[10px] font-bold">处理中</span></td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">-</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:rotate-ccw" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:trash-2" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-6 py-4"><input type="checkbox" class="doc-checkbox" onchange="updateDocSelectAll()" /></td>
|
||||
<td class="px-6 py-4 font-medium text-gray-800">测试用例模板.md</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-600">张美心</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500">2026-07-13 11:40</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-0.5 bg-red-100 text-red-700 rounded-full text-[10px] font-bold">失败</span></td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">0</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button class="text-gray-400 hover:text-blue-600"><iconify-icon icon="lucide:rotate-ccw" width="16"></iconify-icon></button>
|
||||
<button class="text-gray-400 hover:text-red-600"><iconify-icon icon="lucide:trash-2" width="16"></iconify-icon></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Content: 检索审计 -->
|
||||
<div id="tab-audit" class="hidden space-y-6">
|
||||
<!-- Stats -->
|
||||
<div class="grid grid-cols-3 gap-6">
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase">今日检索次数</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-2">147</h3>
|
||||
<p class="text-xs text-gray-400 mt-1"><span class="text-green-600 font-bold">↑ 12%</span> 较昨日</p>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase">平均响应时间</p>
|
||||
<h3 class="text-3xl font-bold text-gray-900 mt-2">186 ms</h3>
|
||||
<p class="text-xs text-gray-400 mt-1">低于 200ms 目标</p>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<p class="text-[10px] font-bold text-gray-400 uppercase">热门检索词</p>
|
||||
<h3 class="text-lg font-bold text-gray-900 mt-2">“数据库连接”</h3>
|
||||
<p class="text-xs text-gray-400 mt-1">共 34 次检索</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search Log Table -->
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 flex justify-between items-center bg-gray-50/50">
|
||||
<span class="text-sm font-bold text-gray-700">检索日志</span>
|
||||
<button class="text-xs font-semibold text-blue-600 hover:text-blue-800 flex items-center gap-1">
|
||||
<iconify-icon icon="lucide:download" width="14"></iconify-icon> 导出日志
|
||||
</button>
|
||||
</div>
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">时间</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">用户</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider">关键词</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">命中数</th>
|
||||
<th class="px-6 py-3 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">耗时 (ms)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 text-sm text-gray-500">2026-07-17 10:32:15</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-800">陈志伟</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-700">4K 适配 侧边栏</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">3</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">120</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 text-sm text-gray-500">2026-07-17 09:45:02</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-800">张美心</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-700">数据库慢查询 索引</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">5</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">205</td>
|
||||
</tr>
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-6 py-4 text-sm text-gray-500">2026-07-17 08:55:33</td>
|
||||
<td class="px-6 py-4 text-sm font-medium text-gray-800">李志强</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-700">API 文档 参数错误</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">1</td>
|
||||
<td class="px-6 py-4 text-center text-sm text-gray-500">95</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
// Tab switching
|
||||
function switchTab(tab) {
|
||||
document.querySelectorAll('[data-tab]').forEach(btn => btn.classList.remove('tab-active'));
|
||||
document.querySelector(`[data-tab="${tab}"]`).classList.add('tab-active');
|
||||
document.getElementById('tab-documents').classList.toggle('hidden', tab !== 'documents');
|
||||
document.getElementById('tab-audit').classList.toggle('hidden', tab !== 'audit');
|
||||
}
|
||||
|
||||
// Document checkboxes
|
||||
function toggleAllDocs() {
|
||||
const checked = document.getElementById('selectAllDocs').checked;
|
||||
document.querySelectorAll('.doc-checkbox').forEach(cb => cb.checked = checked);
|
||||
}
|
||||
|
||||
function updateDocSelectAll() {
|
||||
const all = document.querySelectorAll('.doc-checkbox');
|
||||
const checked = document.querySelectorAll('.doc-checkbox:checked');
|
||||
document.getElementById('selectAllDocs').checked = all.length > 0 && checked.length === all.length;
|
||||
}
|
||||
|
||||
// Simulate file upload
|
||||
document.getElementById('fileInput').addEventListener('change', function(e) {
|
||||
if (this.files.length > 0) {
|
||||
alert(`已选择 ${this.files.length} 个文件,开始上传并向量化。`);
|
||||
this.value = '';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+317
@@ -0,0 +1,317 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>角色权限管理 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
|
||||
.role-active {
|
||||
background-color: #f0f7ff;
|
||||
border-color: #1a73e8;
|
||||
color: #1a73e8;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="roles.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<h2 class="text-lg font-semibold text-gray-800">角色权限配置</h2>
|
||||
<button
|
||||
class="bg-gray-900 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-black transition-all">保存配置</button>
|
||||
</header>
|
||||
<div class="flex-1 overflow-hidden flex">
|
||||
<!-- Left Role List -->
|
||||
<div class="w-72 bg-white border-r border-gray-100 flex flex-col overflow-y-auto">
|
||||
<div class="p-6 border-b border-gray-50">
|
||||
<button
|
||||
class="w-full py-2 border border-dashed border-gray-300 rounded-lg text-xs font-bold text-gray-400 hover:border-blue-500 hover:text-blue-500 transition-all">+
|
||||
新增角色</button>
|
||||
</div>
|
||||
<div class="p-3 space-y-1">
|
||||
<div class="p-4 rounded-xl border border-transparent role-active cursor-pointer">
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-sm font-bold leading-none">超级管理员</span>
|
||||
<iconify-icon class="text-xs" icon="lucide:crown"></iconify-icon>
|
||||
</div>
|
||||
<p class="text-[10px] opacity-70">拥有系统所有操作权限</p>
|
||||
</div>
|
||||
<div class="p-4 rounded-xl border border-transparent hover:bg-gray-50 cursor-pointer text-gray-700">
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-sm font-bold leading-none">部门管理员</span>
|
||||
</div>
|
||||
<p class="text-[10px] text-gray-400">管理本部门指摘与用户</p>
|
||||
</div>
|
||||
<div class="p-4 rounded-xl border border-transparent hover:bg-gray-50 cursor-pointer text-gray-700">
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-sm font-bold leading-none">指摘录入员</span>
|
||||
</div>
|
||||
<p class="text-[10px] text-gray-400">负责指摘的录入与初期分析</p>
|
||||
</div>
|
||||
<div class="p-4 rounded-xl border border-transparent hover:bg-gray-50 cursor-pointer text-gray-700">
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-sm font-bold leading-none">整改担当</span>
|
||||
</div>
|
||||
<p class="text-[10px] text-gray-400">负责指摘的修复与反馈</p>
|
||||
</div>
|
||||
<div class="p-4 rounded-xl border border-transparent hover:bg-gray-50 cursor-pointer text-gray-700">
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-sm font-bold leading-none">验证人员</span>
|
||||
</div>
|
||||
<p class="text-[10px] text-gray-400">负责确认修复结果并关闭指摘</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Right Permission Matrix -->
|
||||
<div class="flex-1 bg-gray-50 overflow-y-auto p-8 space-y-8">
|
||||
<!-- Data Permission -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:database"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">数据权限范围</h4>
|
||||
</div>
|
||||
<div class="max-w-xs">
|
||||
<select
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2.5 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
<option>全系统数据</option>
|
||||
<option>所属部门数据</option>
|
||||
<option>仅本人相关数据</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Function Permission -->
|
||||
<div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm">
|
||||
<div class="flex items-center justify-between mb-6">
|
||||
<div class="flex items-center gap-2">
|
||||
<iconify-icon class="text-blue-600 text-xl" icon="lucide:layout"></iconify-icon>
|
||||
<h4 class="font-bold text-gray-800">页面与功能权限</h4>
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<label
|
||||
class="flex items-center gap-2 text-xs font-bold text-gray-400 cursor-pointer hover:text-blue-600 transition-colors">
|
||||
<input checked="" class="w-4 h-4 rounded text-blue-600" type="checkbox" /> 全选
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
<div class="space-y-4">
|
||||
<h5
|
||||
class="text-xs font-bold text-gray-400 uppercase tracking-widest pb-2 border-b border-gray-50">
|
||||
基础功能</h5>
|
||||
<div class="space-y-3">
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">工作台 (Dashboard)</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">指摘列表查询</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">指摘详情查看</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">批量录入导入</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<h5
|
||||
class="text-xs font-bold text-gray-400 uppercase tracking-widest pb-2 border-b border-gray-50">
|
||||
AI 智能分析</h5>
|
||||
<div class="space-y-3">
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">AI分析记录查看</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">知识库维护与审计</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">Agent 操作详情记录</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<h5
|
||||
class="text-xs font-bold text-gray-400 uppercase tracking-widest pb-2 border-b border-gray-50">
|
||||
系统设置</h5>
|
||||
<div class="space-y-3">
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">用户与角色管理</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">全局 Agent 开关控制</span>
|
||||
</label>
|
||||
<label class="flex items-center gap-3 text-sm text-gray-700 cursor-pointer group">
|
||||
<input checked=""
|
||||
class="w-4 h-4 rounded-md border-gray-300 text-blue-600 focus:ring-blue-500 transition-all"
|
||||
type="checkbox" />
|
||||
<span class="group-hover:text-blue-600">系统审计日志</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Agent Tool Permission -->
|
||||
<div class="bg-blue-600 p-6 rounded-2xl shadow-lg shadow-blue-100 text-white overflow-hidden relative">
|
||||
<iconify-icon class="absolute -right-6 -bottom-6 text-9xl text-white/10 rotate-12"
|
||||
icon="lucide:bot"></iconify-icon>
|
||||
<div class="flex items-center gap-2 mb-6">
|
||||
<iconify-icon class="text-xl" icon="lucide:wrench"></iconify-icon>
|
||||
<h4 class="font-bold text-lg">Agent 工具调用权限 (核心)</h4>
|
||||
</div>
|
||||
<p class="text-xs text-blue-100 mb-6 max-w-2xl leading-relaxed">配置此角色在与 AI Agent 交互时,允许 Agent
|
||||
自动执行的原子工具。敏感操作建议开启“人机协同审批”。</p>
|
||||
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">assign_issue</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">send_reminder</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">close_issue</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">search_knowledge</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input class="w-4 h-4 rounded border-transparent text-blue-900" type="checkbox" />
|
||||
<span class="text-xs font-bold">delete_issue</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">request_human_approval</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">create_comment</span>
|
||||
</label>
|
||||
<label
|
||||
class="flex items-center gap-3 p-3 bg-white/10 rounded-xl border border-white/20 hover:bg-white/20 cursor-pointer transition-all">
|
||||
<input checked="" class="w-4 h-4 rounded border-transparent text-blue-900"
|
||||
type="checkbox" />
|
||||
<span class="text-xs font-bold">update_metadata</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+302
@@ -0,0 +1,302 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>用户管理 - AI指摘管理系统</title>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/tailwindcss.js"></script>
|
||||
<script src="https://modao.cc/agent-py/static/source/js/iconify-icon.min.js"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
.sidebar-active {
|
||||
background-color: rgba(26, 115, 232, 0.1);
|
||||
color: #1a73e8;
|
||||
border-right: 4px solid #1a73e8;
|
||||
}
|
||||
|
||||
.dept-active {
|
||||
color: #1a73e8;
|
||||
font-weight: 700;
|
||||
background: #f8fafc;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-50 text-gray-800 flex overflow-hidden h-screen">
|
||||
<!-- Sidebar (Shared) -->
|
||||
<aside class="w-64 bg-white border-r border-gray-200 flex flex-col flex-none">
|
||||
<div class="p-6 flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-200">
|
||||
<iconify-icon class="text-white text-2xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</div>
|
||||
<div>
|
||||
<h1 class="font-bold text-lg leading-none text-gray-900">IMS</h1>
|
||||
<p class="text-[10px] text-gray-400 mt-1 uppercase tracking-widest font-semibold">AI Assistant</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="flex-1 mt-4 px-3 space-y-1 overflow-y-auto">
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="dashboard.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:layout-dashboard"></iconify-icon>
|
||||
<span class="font-medium text-sm">工作台</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="issues.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:list-todo"></iconify-icon>
|
||||
<span class="font-medium text-sm">指摘列表</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="batch-input.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:file-up"></iconify-icon>
|
||||
<span class="font-medium text-sm">批量录入</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">AI 智能分析</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group" href="ai-analysis.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:brain-circuit"></iconify-icon>
|
||||
<span class="font-medium text-sm">AI分析记录</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="knowledge-base.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:database"></iconify-icon>
|
||||
<span class="font-medium text-sm">知识库管理</span>
|
||||
</a>
|
||||
<div class="pt-4 pb-2 px-4 text-[10px] font-bold text-gray-400 uppercase tracking-widest">系统设置</div>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg sidebar-active transition-all group"
|
||||
href="users.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:users"></iconify-icon>
|
||||
<span class="font-medium text-sm">用户管理</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="roles.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:key-round"></iconify-icon>
|
||||
<span class="font-medium text-sm">角色权限</span>
|
||||
</a>
|
||||
<a class="flex items-center gap-3 px-4 py-3 rounded-lg text-gray-600 hover:bg-gray-50 transition-all group"
|
||||
href="agent-management.html">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="font-medium text-sm">Agent管理</span>
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
<!-- Main Content -->
|
||||
<main class="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-none">
|
||||
<h2 class="text-lg font-semibold text-gray-800">用户管理</h2>
|
||||
<div class="flex gap-4 items-center">
|
||||
<div class="relative">
|
||||
<iconify-icon class="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"
|
||||
icon="lucide:search"></iconify-icon>
|
||||
<input
|
||||
class="pl-9 pr-4 py-2 bg-gray-50 border border-gray-200 rounded-lg text-sm w-60 outline-none focus:ring-2 focus:ring-blue-500 transition-all"
|
||||
placeholder="搜索姓名/账号..." type="text" />
|
||||
</div>
|
||||
<button
|
||||
class="bg-blue-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-blue-700 transition-all flex items-center gap-2"
|
||||
onclick="document.getElementById('userModal').classList.remove('hidden')">
|
||||
<iconify-icon icon="lucide:user-plus"></iconify-icon> 新增用户
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="flex-1 flex overflow-hidden">
|
||||
<!-- Left: Org Tree -->
|
||||
<div class="w-64 bg-white border-r border-gray-100 overflow-y-auto p-4">
|
||||
<div class="flex items-center gap-2 mb-6 px-2">
|
||||
<iconify-icon class="text-blue-600" icon="lucide:network"></iconify-icon>
|
||||
<span class="text-sm font-bold text-gray-800">组织架构</span>
|
||||
</div>
|
||||
<div class="space-y-1">
|
||||
<div class="flex items-center gap-2 p-2 rounded-lg dept-active cursor-pointer">
|
||||
<iconify-icon class="text-xs" icon="lucide:chevron-down"></iconify-icon>
|
||||
<iconify-icon class="text-sm" icon="lucide:building-2"></iconify-icon>
|
||||
<span class="text-sm">IMS 总部</span>
|
||||
</div>
|
||||
<div class="pl-6 space-y-1 mt-1 border-l border-gray-100 ml-3">
|
||||
<div
|
||||
class="flex items-center gap-2 p-2 rounded-lg text-gray-600 hover:bg-gray-50 cursor-pointer">
|
||||
<iconify-icon class="text-xs" icon="lucide:chevron-right"></iconify-icon>
|
||||
<iconify-icon class="text-sm" icon="lucide:folder"></iconify-icon>
|
||||
<span class="text-sm">研发中心</span>
|
||||
</div>
|
||||
<div class="pl-6 space-y-1 border-l border-gray-100 ml-3">
|
||||
<div
|
||||
class="flex items-center gap-2 p-2 rounded-lg text-blue-600 bg-blue-50 font-medium cursor-pointer">
|
||||
<iconify-icon class="text-sm" icon="lucide:users-2"></iconify-icon>
|
||||
<span class="text-sm">前端开发组</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center gap-2 p-2 rounded-lg text-gray-600 hover:bg-gray-50 cursor-pointer">
|
||||
<iconify-icon class="text-sm" icon="lucide:users-2"></iconify-icon>
|
||||
<span class="text-sm">后端开发组</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center gap-2 p-2 rounded-lg text-gray-600 hover:bg-gray-50 cursor-pointer">
|
||||
<iconify-icon class="text-sm" icon="lucide:folder"></iconify-icon>
|
||||
<span class="text-sm">质量保证部 (QA)</span>
|
||||
</div>
|
||||
<div
|
||||
class="flex items-center gap-2 p-2 rounded-lg text-gray-600 hover:bg-gray-50 cursor-pointer">
|
||||
<iconify-icon class="text-sm" icon="lucide:folder"></iconify-icon>
|
||||
<span class="text-sm">架构部</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Right: User Table -->
|
||||
<div class="flex-1 bg-gray-50 p-8 overflow-y-auto">
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden">
|
||||
<table class="w-full text-left">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">用户姓名
|
||||
</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">账号/邮箱
|
||||
</th>
|
||||
<th class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider">绑定角色
|
||||
</th>
|
||||
<th
|
||||
class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">
|
||||
状态</th>
|
||||
<th
|
||||
class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-center">
|
||||
Agent 授权</th>
|
||||
<th
|
||||
class="px-6 py-4 text-[11px] font-bold text-gray-400 uppercase tracking-wider text-right">
|
||||
操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<img alt="Avatar" class="w-8 h-8 rounded-full border border-gray-200"
|
||||
src="https://modao.cc/agent-py/media/generated_images/2026-06-30/177f9d3923ee4656a271725910bd7339.jpg" />
|
||||
<span class="text-sm font-bold text-gray-900">李志强</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500 font-medium">[email protected]</td>
|
||||
<td class="px-6 py-4">
|
||||
<span
|
||||
class="px-2 py-1 bg-purple-50 text-purple-700 rounded-md text-[10px] font-bold">超级管理员</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="inline-flex w-2 h-2 rounded-full bg-green-500 mr-2"></span>
|
||||
<span class="text-xs font-medium text-gray-700">正常</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center text-blue-600">
|
||||
<iconify-icon class="text-xl" icon="lucide:shield-check"></iconify-icon>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-blue-600 hover:underline text-xs font-bold mr-4">编辑</button>
|
||||
<button class="text-red-500 hover:underline text-xs font-bold">禁用</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<img alt="Avatar" class="w-8 h-8 rounded-full border border-gray-200"
|
||||
src="https://modao.cc/agent-py/media/generated_images/2026-06-30/b8ff5a3c6e6c4413b13ada0c277c17b8.jpg" />
|
||||
<span class="text-sm font-bold text-gray-900">陈志伟</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-xs text-gray-500 font-medium">[email protected]</td>
|
||||
<td class="px-6 py-4">
|
||||
<span
|
||||
class="px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-[10px] font-bold">整改担当</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center">
|
||||
<span class="inline-flex w-2 h-2 rounded-full bg-green-500 mr-2"></span>
|
||||
<span class="text-xs font-medium text-gray-700">正常</span>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-center text-gray-300">
|
||||
<iconify-icon class="text-xl" icon="lucide:shield-off"></iconify-icon>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button class="text-blue-600 hover:underline text-xs font-bold mr-4">编辑</button>
|
||||
<button class="text-red-500 hover:underline text-xs font-bold">禁用</button>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- More users... -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<!-- Modal Simulation -->
|
||||
<div class="fixed inset-0 bg-black/50 backdrop-blur-sm z-[100] flex items-center justify-center hidden"
|
||||
id="userModal">
|
||||
<div class="bg-white rounded-3xl w-[500px] shadow-2xl border border-white overflow-hidden">
|
||||
<div class="p-6 border-b border-gray-100 flex justify-between items-center">
|
||||
<h3 class="text-lg font-bold text-gray-900">新增用户信息</h3>
|
||||
<button class="p-2 hover:bg-gray-100 rounded-lg text-gray-400"
|
||||
onclick="document.getElementById('userModal').classList.add('hidden')">
|
||||
<iconify-icon class="text-xl" icon="lucide:x"></iconify-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-8 space-y-6">
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[10px] font-bold text-gray-400 uppercase">姓名</label>
|
||||
<input
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none"
|
||||
placeholder="请输入姓名" type="text" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[10px] font-bold text-gray-400 uppercase">账号 (工号)</label>
|
||||
<input
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none"
|
||||
placeholder="IMS-XXXX" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[10px] font-bold text-gray-400 uppercase">电子邮箱</label>
|
||||
<input
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none"
|
||||
placeholder="[email protected]" type="email" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-[10px] font-bold text-gray-400 uppercase">绑定角色</label>
|
||||
<select
|
||||
class="w-full bg-gray-50 border border-gray-200 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
<option>超级管理员</option>
|
||||
<option>指摘录入员</option>
|
||||
<option>整改担当</option>
|
||||
<option>验证人员</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Agent Specific Permission -->
|
||||
<div class="p-4 bg-blue-50 rounded-2xl border border-blue-100">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2 text-blue-800">
|
||||
<iconify-icon class="text-xl" icon="lucide:bot"></iconify-icon>
|
||||
<span class="text-sm font-bold">Agent 自动执行权限</span>
|
||||
</div>
|
||||
<div class="w-10 h-5 bg-blue-600 rounded-full relative cursor-pointer">
|
||||
<div class="absolute right-0.5 top-0.5 w-4 h-4 bg-white rounded-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-[10px] text-blue-600/70 mt-2 leading-relaxed">
|
||||
开启后,该用户允许 Agent 在不需要二次审批的情况下执行预设的高风险工具(如删除、状态强制流转等)。仅建议资深管理员开启。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-6 bg-gray-50 border-t border-gray-100 flex gap-3">
|
||||
<button
|
||||
class="flex-1 bg-white border border-gray-200 py-3 rounded-xl font-bold text-gray-600 hover:bg-white transition-all shadow-sm"
|
||||
onclick="document.getElementById('userModal').classList.add('hidden')">取消</button>
|
||||
<button
|
||||
class="flex-[2] bg-blue-600 text-white py-3 rounded-xl font-bold hover:bg-blue-700 transition-all shadow-lg shadow-blue-200">确认添加</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,1587 @@
|
||||
# 指摘管理系统_概要设计说明书_V6.0(Ollama混合架构升级版)
|
||||
|
||||
| 文档版本 | 修订日期 | 修订内容 | 修订人 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| V4.2 | 2026-07-21 | Prompt工程专项升级:全链路Prompt模板体系化、领域知识注入、伪专项训练策略落地、新增Prompt版本管理、动态模板加载、输出结构化约束 | 系统架构师 |
|
||||
| V5.0 | 2026-07-23 | Ollama混合架构升级:引入本地Ollama作为首选推理与嵌入引擎,DeepSeek作为外接高性能算力备选;适配Ollama ChatML格式;新增Spring AI Ollama配置类;调整Prompt模板渲染与工具调用方式;优化知识库向量化流程;新增模型切换与容错机制 | 系统架构师 |
|
||||
| **V6.0** | **2026-07-23** | **技术栈版本号范围化、Ollama 70B硬件评估+降级方案、Spring AI适配层抽象、双引擎调参策略、pgvector大数据集扩展说明** | **系统架构师** |
|
||||
|
||||
|
||||
## 1. 引言
|
||||
|
||||
### 1.1 编写目的
|
||||
本文档为"指摘管理系统"的概要设计说明书,定义系统的整体架构、功能模块、技术选型、数据模型、接口规范、安全策略及部署方案。系统以 **Agent(智能体)** 为核心,实现从用户意图感知到业务闭环执行的自动化与智能化。本版本(V6.0)在V4.2的Prompt工程体系基础上,**升级AI算力层为混合架构**:以本地Ollama为默认推理与嵌入引擎,确保数据隐私与低延迟,同时保留DeepSeek API作为高性能外接算力备选,实现灵活、可控、安全的AI服务。
|
||||
|
||||
### 1.2 项目背景
|
||||
为提升团队在项目开发、文档审查、流程管理等环节中发现和跟踪问题的效率,需构建一套集指摘创建、分配、整改、验证、智能分析于一体的全生命周期管理系统。系统引入 Agent 作为核心决策与执行单元,能够自主理解用户自然语言指令,调用业务工具完成指摘分配、催办、状态变更、知识检索等操作,并在高风险场景下请求人工审批,实现"人机协同"的闭环管理。
|
||||
|
||||
**AI部署策略(V6.0升级)**:
|
||||
- **资料库与向量库**:全部部署于本地服务器,文档原文和向量索引永不外传。
|
||||
- **推理与嵌入算力**:
|
||||
- **默认**:使用本地Ollama服务(`llama3.1:70b` / `nomic-embed-text`),数据不出内网,延迟低。
|
||||
> **硬件要求**:llama3.1:70b 需至少 48GB VRAM(4bit量化),如GPU显存不足可降级至 `qwen2.5:32b`(需24GB VRAM)或 `llama3.1:8b`(需16GB VRAM)。
|
||||
- **备选**:通过配置切换至DeepSeek API(`deepseek-v4-pro` + `text-embedding-3-small`),用于高性能复杂任务或负载分担。
|
||||
- **Prompt工程策略**:继续采用"伪专项训练"模式,通过系统化Prompt模板注入领域知识,并适配Ollama的ChatML消息格式,确保跨模型输出一致性与可控性。
|
||||
|
||||
### 1.3 设计原则
|
||||
- **Agent优先**:所有业务操作均可通过Agent自然语言指令触发,Agent具备感知、规划、行动、反思能力。
|
||||
- **目标驱动**:用户表达意图,Agent自主解析并生成执行计划。
|
||||
- **Human‑in‑the‑loop**:高风险操作必须经过人工审批,确保安全可控。
|
||||
- **长期记忆**:Agent具备向量化记忆能力,可检索历史成功案例,持续优化决策。
|
||||
- **知识本地化**:所有知识库文档及向量索引存储于本地,数据不出内网。
|
||||
- **可观测性**:Agent的思考链、工具调用、执行结果全程可视可审计。
|
||||
- **前后端分离**:前端React SPA,后端Spring Boot RESTful API。
|
||||
- **安全优先**:全链路安全防护,最小权限原则,全量操作审计。
|
||||
- **Prompt工程驱动**:通过结构化Prompt模板体系实现领域专业化,所有AI输出强制结构化,禁止自由发挥。
|
||||
- **AI算力灵活化**:支持本地Ollama与云端DeepSeek无缝切换,兼顾隐私、成本与性能。
|
||||
|
||||
|
||||
## 2. 总体架构设计
|
||||
|
||||
系统采用 B/S 架构,前端为 React SPA,后端为 Spring Boot 微服务,Agent决策引擎作为核心编排层,知识库与向量库全部本地化部署。AI算力层采用 **Ollama(本地)主 + DeepSeek API(外接)备** 的混合模式。
|
||||
|
||||
### 2.1 架构分层
|
||||
|
||||
| 层级 | 说明 | 主要技术组件 |
|
||||
| :--- | :--- | :--- |
|
||||
| **客户端层** | 用户浏览器 | Chrome / Edge / Firefox |
|
||||
| **接入层** | 反向代理、HTTPS终结、限流 | Nginx 1.27.x |
|
||||
| **前端应用层** | React SPA | React ^19.0.0, TypeScript ^5.8.0, Vite ^7.0.0, Ant Design ^6.0.0, Redux Toolkit ^2.0.0, React Router ^6.30.0 |
|
||||
| **Agent决策编排层** | Agent核心:规划器、执行器、观察器、记忆检索器、**Prompt模板引擎** | Spring AI (ChatModel/EmbeddingModel接口), 自定义ReAct框架, **Ollama/DeepSeek双引擎** |
|
||||
| **后端业务服务层** | 业务逻辑与工具实现 | Java 17/21, Spring Boot ^3.5.0, Spring Security ^6.5.0, Spring Data JPA ^3.5.0 |
|
||||
| **知识库处理层** | 文档解析、切片、向量化调用(通过EmbeddingModel)、本地存储、**Query改写引擎** | Apache Tika / PDFBox, HanLP 1.8.x |
|
||||
| **异步任务层** | 长耗时任务(Agent规划、文档向量化、导入导出、**Prompt批量渲染**) | Spring Async + ThreadPoolTaskExecutor |
|
||||
| **数据与向量层** | 关系数据、缓存、对象存储、**本地向量库**、**Prompt模板库** | PostgreSQL 16.14 + pgvector, Redis 7.4.9, MinIO(全部本地部署) |
|
||||
| **AI算力层(混合)** | **主:Ollama(本地推理+嵌入),备:DeepSeek API(外接高性能)** | Ollama(llama3.1:70b ≥48GB VRAM / qwen2.5:32b ≥24GB VRAM / llama3.1:8b ≥16GB VRAM, nomic-embed-text), Deepseek API(deepseek-v4-pro, text-embedding-3-small) |
|
||||
| **运维监控层** | 监控、日志、CI/CD | Prometheus 3.1.x, Grafana 11.3.x, ELK, Jenkins 2.440.x, Docker 27.x |
|
||||
|
||||
### 2.2 Agent核心工作流程(ReAct循环 + Prompt工程层 + 混合AI引擎)
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
User[用户/系统触发] -->|自然语言目标| PromptRouter[Prompt路由器 意图识别+模板匹配]
|
||||
PromptRouter -->|加载领域Prompt| DomainContext[领域上下文注入器 术语映射+规则约束]
|
||||
DomainContext -->|注入上下文| MemoryRetriever[长期记忆检索器 pgvector]
|
||||
MemoryRetriever -->|相似案例| Planner[ReAct 规划器 通过ChatModel接口调用AI引擎]
|
||||
Planner -->|生成步骤序列| Executor[工具执行器]
|
||||
Executor --> Tool1[assign_issue 带专用Prompt模板]
|
||||
Executor --> Tool2[send_reminder 带专用Prompt模板]
|
||||
Executor --> Tool3[search_knowledge Query改写+检索Prompt]
|
||||
Executor --> Tool4[update_status 带专用Prompt模板]
|
||||
Executor --> Tool5[create_comment 带专用Prompt模板]
|
||||
Executor --> Tool6[request_human_approval 强制触发Prompt]
|
||||
Tool1 & Tool2 & Tool3 & Tool4 & Tool5 -->|执行结果| OutputFormatter[输出结构化格式化器 JSON Schema约束]
|
||||
OutputFormatter -->|格式化结果| Observer[观察器]
|
||||
Observer -->|结果反馈| Planner
|
||||
Observer -->|成功经验| MemoryUpdater[记忆更新器 含Prompt优化反馈]
|
||||
Tool6 -->|挂起等待| HumanApprovalGate[人工审批闸门]
|
||||
HumanApprovalGate -->|批准/拒绝| Planner
|
||||
Planner -->|任务完成| ResultPresenter[结果展示 结构化输出渲染]
|
||||
|
||||
subgraph AI引擎选择
|
||||
A[配置决定] -->|ai.provider=ollama| Ollama[本地Ollama服务]
|
||||
A -->|ai.provider=deepseek| DeepSeek[外接DeepSeek API]
|
||||
end
|
||||
Planner -.->|调用ChatModel接口| AI引擎选择
|
||||
Executor -.->|向量化调用EmbeddingModel接口| AI引擎选择
|
||||
```
|
||||
|
||||
|
||||
## 3. Prompt工程体系设计(V6.0适配)
|
||||
|
||||
### 3.1 设计目标
|
||||
1. **领域专业化**:Agent行为表现等同于经过指摘管理领域专项训练的模型。
|
||||
2. **输出可控性**:所有AI输出强制符合预定义JSON Schema,禁止自由发挥。
|
||||
3. **行为一致性**:相同输入在不同时间、不同场景下输出稳定一致。
|
||||
4. **可维护性**:Prompt模板独立管理、版本控制、热更新,无需重启服务。
|
||||
5. **可审计性**:每次Prompt渲染全过程持久化,支持回溯与优化。
|
||||
6. **跨模型兼容**:Prompt模板与渲染逻辑需同时支持Ollama和DeepSeek,保证输出一致性。
|
||||
|
||||
### 3.2 Prompt模板分层架构
|
||||
|
||||
```
|
||||
Prompt Template Engine
|
||||
├── Layer 4: 动态上下文层 (Dynamic Context Layer)
|
||||
│ - 当前用户角色/权限/部门
|
||||
│ - 当前指摘上下文 (issue_id, status, phase等)
|
||||
│ - 实时数据注入 (用户列表、部门树、有效工程阶段)
|
||||
├── Layer 3: 领域知识层 (Domain Knowledge Layer)
|
||||
│ - 指摘管理术语词典 (术语映射表)
|
||||
│ - 业务规则约束 (审批规则、状态流转规则)
|
||||
│ - 最佳实践库 (历史成功案例模式)
|
||||
├── Layer 2: 任务专用层 (Task-Specific Layer)
|
||||
│ - 系统角色Prompt (System Role)
|
||||
│ - 工具专用Prompt (Tool Prompts)
|
||||
│ - 分析专用Prompt (Analysis Prompts)
|
||||
│ - 校验专用Prompt (Validation Prompts)
|
||||
│ - 记忆检索Prompt (Memory Retrieval Prompts)
|
||||
└── Layer 1: 基础约束层 (Base Constraint Layer)
|
||||
- 输出格式约束 (JSON Schema / Markdown模板)
|
||||
- 安全策略约束 (禁止内容、敏感词过滤)
|
||||
- 语言风格约束 (正式/简洁/结构化)
|
||||
```
|
||||
|
||||
### 3.3 Prompt模板类型定义
|
||||
|
||||
| 模板类型 | 标识前缀 | 用途 | 更新频率 | 存储位置 |
|
||||
| :--- | :--- | :--- | :--- | :--- |
|
||||
| **系统角色模板** | `SYS_ROLE_` | 定义Agent身份、知识边界、行为准则 | 低频(季度) | 数据库 + 本地文件 |
|
||||
| **工具调用模板** | `TOOL_` | 每个业务工具的专用Prompt,含参数生成规则 | 中频(月度) | 数据库 |
|
||||
| **ReAct规划模板** | `PLAN_` | 指导思考-行动-观察循环的结构化Prompt | 中频(月度) | 数据库 |
|
||||
| **Query改写模板** | `QUERY_` | 将用户自然语言改写为领域检索查询 | 中频(月度) | 数据库 |
|
||||
| **AI分析模板** | `ANALYSIS_` | 指摘深度分析的专用Prompt(根因/建议/分类) | 高频(周度) | 数据库 |
|
||||
| **批量校验模板** | `VALIDATE_` | Excel导入数据智能校验的专用Prompt | 中频(月度) | 数据库 |
|
||||
| **记忆重排序模板** | `MEMORY_` | 历史案例相关性评估与重排序Prompt | 低频(季度) | 数据库 |
|
||||
| **输出格式化模板** | `FORMAT_` | 各类输出的JSON Schema/Markdown模板定义 | 中频(月度) | 数据库 |
|
||||
| **快捷指令模板** | `QUICK_` | 工作台快捷指令的Prompt模板 | 高频(周度) | 数据库 + Redis缓存 |
|
||||
|
||||
### 3.4 核心Prompt模板详细定义
|
||||
|
||||
#### 3.4.1 系统角色Prompt模板(`SYS_ROLE_001`)
|
||||
|
||||
```markdown
|
||||
# 角色定义
|
||||
你是「指摘管理专家Agent」,专精于制造业与软件工程领域的质量问题跟踪与整改管理。
|
||||
你的知识边界严格限定于以下范围:
|
||||
- 指摘全生命周期管理(创建 → 分配 → 整改 → 验证 → 关闭)
|
||||
- 工程质量管理标准(ISO 9001、CMMI、企业内部QA规范)
|
||||
- 历史成功案例与失败教训(来自本地知识库检索)
|
||||
- 项目工程阶段管理(需求/设计/编码/测试/部署/运维)
|
||||
|
||||
# 身份标识
|
||||
- 系统名称:指摘管理系统(Issue Tracking System)
|
||||
- 你的名称:指摘助手(Issue Assistant)
|
||||
- 当前版本:V6.0
|
||||
|
||||
# 行为约束(强制遵守,违反将导致操作被拒绝)
|
||||
1. 【术语强制】所有输入输出必须使用标准指摘管理术语:
|
||||
- 使用"对应者"而非"负责人"、"处理人"
|
||||
- 使用"PGM"指代项目编号,格式为 PGM-XXXX
|
||||
- 使用"指摘"而非"问题"、"缺陷"、"bug"
|
||||
- 使用"对应内容"而非"解决方案"、"修复方案"
|
||||
- 使用"确认者"而非"审核人"、"验收人"
|
||||
- 使用"对应完了日"而非"完成日期"
|
||||
- 使用"review工数"和"对应工数"计量工作量
|
||||
- 状态术语:draft(草稿)/ open(待处理)/ in_progress(进行中)/ resolved(已解决)/ verified(已验证)/ closed(已关闭)/ rejected(已驳回)
|
||||
|
||||
2. 【审批强制】涉及以下高风险操作必须调用 request_human_approval 工具:
|
||||
- 关闭指摘(close_issue)
|
||||
- 删除指摘(delete_issue)
|
||||
- 跨部门分配指摘(assignee部门 ≠ 当前指摘部门)
|
||||
- 修改已验证状态的指摘
|
||||
- 批量操作超过10条指摘
|
||||
- 任何涉及数据删除或不可逆变更的操作
|
||||
|
||||
3. 【知识优先】生成整改建议时,必须遵循以下优先级:
|
||||
- 第一优先:引用本地知识库中的历史成功案例(需标注案例ID)
|
||||
- 第二优先:引用企业内部QA规范
|
||||
- 第三优先:基于通用工程管理最佳实践
|
||||
- 禁止:提供与指摘管理无关的建议(如财务、人事、市场等)
|
||||
|
||||
4. 【上下文依赖】当用户意图模糊时,必须优先询问以下信息以明确上下文:
|
||||
- 指摘ID(issue_id)
|
||||
- 工程阶段(phase)
|
||||
- 归属部门(department_id)
|
||||
- 当前状态(status)
|
||||
禁止在上下文不明的情况下执行操作。
|
||||
|
||||
5. 【输出结构化】所有输出必须严格符合预定义JSON Schema或Markdown模板,禁止自由发挥。
|
||||
- 分析类输出 → JSON格式
|
||||
- 对话类输出 → Markdown格式,含结构化标题
|
||||
- 工具调用 → 严格参数格式
|
||||
|
||||
6. 【安全边界】禁止执行以下行为:
|
||||
- 生成、传播或协助创建恶意代码
|
||||
- 泄露其他用户的敏感信息(密码、个人联系方式等)
|
||||
- 执行超出指摘管理范畴的系统操作
|
||||
- 伪造或篡改审计日志
|
||||
|
||||
# 当前环境信息
|
||||
- 当前用户:{{currentUserName}}({{currentUserRole}})
|
||||
- 所属部门:{{currentUserDepartment}}
|
||||
- Agent自动执行权限:{{agentAutoExecuteEnabled}}
|
||||
- 可用工具列表(格式:工具名 - 描述):
|
||||
{{#each availableTools}}
|
||||
- {{this.name}}:{{this.description}}
|
||||
{{/each}}
|
||||
- 当前时间:{{currentTime}}
|
||||
|
||||
# 工具调用规则(适用于当前AI引擎:{{modelProvider}})
|
||||
- 当你需要调用工具时,请在你的回复中输出一个 JSON 对象,格式为:
|
||||
{
|
||||
"tool": "工具名",
|
||||
"parameters": { ... }
|
||||
}
|
||||
- 不要用自然语言额外解释,直接输出该 JSON。
|
||||
- 如果目标已完成,输出 { "tool": "goal_completed", "parameters": {} }。
|
||||
```
|
||||
|
||||
#### 3.4.2 ReAct规划Prompt模板(`PLAN_001`)
|
||||
|
||||
```markdown
|
||||
# 任务
|
||||
基于用户目标和当前上下文,生成结构化的执行计划(ReAct循环)。
|
||||
|
||||
# 输入
|
||||
用户目标:{{userGoal}}
|
||||
当前指摘上下文:{{issueContext}}
|
||||
历史相似案例:{{similarCases}}
|
||||
可用工具列表:{{availableTools}}
|
||||
已执行步骤:{{executedSteps}}
|
||||
当前步数:{{currentStep}} / 最大步数:{{maxSteps}}
|
||||
|
||||
# 思考格式(必须严格遵循)
|
||||
你必须按以下结构输出思考过程,**且最终必须输出一个 JSON 对象**,其中 `action` 字段包含下一步的工具调用。
|
||||
|
||||
[思考]
|
||||
1. 用户意图解析:将自然语言目标转化为明确的业务操作
|
||||
2. 上下文评估:当前已掌握的信息是否足够执行
|
||||
3. 工具选择:从可用工具中选择最合适的工具(仅限1个)
|
||||
4. 参数生成:为选定工具生成所需参数
|
||||
5. 风险评估:判断是否需要人工审批
|
||||
6. 输出格式:确认输出符合JSON Schema
|
||||
|
||||
[行动]
|
||||
```json
|
||||
{
|
||||
"action": {
|
||||
"tool_name": "工具名称(必须从可用工具列表中选择)",
|
||||
"parameters": {
|
||||
"param1": "值1",
|
||||
"param2": "值2"
|
||||
},
|
||||
"reasoning": "选择此工具的理由(一句话)",
|
||||
"requires_approval": true/false,
|
||||
"approval_reason": "如需要审批,写明原因"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# 约束
|
||||
- 每步只能调用一个工具。
|
||||
- 如需审批,必须调用 request_human_approval 工具,不得直接执行目标操作。
|
||||
- 参数中的ID类字段必须为数字,禁止传递字符串ID。
|
||||
- 如用户目标已完成,输出 tool_name 为 "goal_completed"。
|
||||
- 如达到最大步数仍未完成,输出 tool_name 为 "max_steps_reached" 并说明原因。
|
||||
```
|
||||
|
||||
#### 3.4.3 工具调用Prompt模板(以 `TOOL_ASSIGN_ISSUE` 为例)
|
||||
|
||||
```markdown
|
||||
# 工具:assign_issue(将指摘分配给指定负责人)
|
||||
|
||||
## 适用场景
|
||||
- 新建指摘后的首次分配
|
||||
- 责任人变更(原负责人离职、调岗、负载过高)
|
||||
- Agent自动分配(基于负载均衡算法)
|
||||
|
||||
## 输入参数
|
||||
- issue_id: 指摘ID(数字)
|
||||
- assignee_id: 目标对应者ID(数字)
|
||||
|
||||
## 执行前检查清单(必须全部确认)
|
||||
1. 目标指摘是否存在且状态允许分配(status ∈ [draft, open, in_progress])
|
||||
2. 目标对应者是否存在于用户表中且状态为启用
|
||||
3. 目标对应者所属部门是否与指摘归属部门一致
|
||||
4. 如不一致(跨部门分配),必须调用 request_human_approval
|
||||
5. 目标对应者当前进行中指摘数是否 < 5(负载检查)
|
||||
|
||||
## 输出格式
|
||||
```json
|
||||
{
|
||||
"tool_call": {
|
||||
"name": "assign_issue",
|
||||
"parameters": {
|
||||
"issue_id": {{issueId}},
|
||||
"assignee_id": {{assigneeId}}
|
||||
}
|
||||
},
|
||||
"pre_check": {
|
||||
"issue_exists": true/false,
|
||||
"assignee_exists": true/false,
|
||||
"same_department": true/false,
|
||||
"workload_ok": true/false,
|
||||
"requires_approval": true/false,
|
||||
"approval_reason": "如需要,说明原因"
|
||||
},
|
||||
"execution_confidence": "high/medium/low",
|
||||
"reasoning": "分配决策的详细理由"
|
||||
}
|
||||
```
|
||||
|
||||
## 历史案例参考
|
||||
{{similarAssignmentCases}}
|
||||
```
|
||||
|
||||
其他工具模板(`TOOL_SEND_REMINDER`、`TOOL_SEARCH_KNOWLEDGE`、`TOOL_REQUEST_APPROVAL`)内容与V4.2完全相同,不再重复。
|
||||
|
||||
#### 3.4.4 Query改写Prompt模板(`QUERY_REWRITE_001`)
|
||||
|
||||
(与V4.2完全一致,内容不变)
|
||||
|
||||
#### 3.4.5 AI分析Prompt模板(`ANALYSIS_ROOT_CAUSE_001`)
|
||||
|
||||
(与V4.2完全一致,内容不变)
|
||||
|
||||
#### 3.4.6 批量校验Prompt模板(`VALIDATE_BATCH_001`)
|
||||
|
||||
(与V4.2完全一致,内容不变)
|
||||
|
||||
#### 3.4.7 记忆重排序Prompt模板(`MEMORY_RERANK_001`)
|
||||
|
||||
(与V4.2完全一致,内容不变)
|
||||
|
||||
#### 3.4.8 输出格式化模板(`FORMAT_JSON_001`)
|
||||
|
||||
(与V4.2完全一致,内容不变)
|
||||
|
||||
### 3.5 快捷指令Prompt模板(`QUICK_`系列)
|
||||
|
||||
| 模板ID | 标签 | 描述 | 审批要求 | 目标工具 |
|
||||
| :--- | :--- | :--- | :--- | :--- |
|
||||
| `QUICK_REMINDER_OVERDUE_001` | 催办逾期指摘 | 自动查找并催办所有逾期指摘 | 否 | search_issues, send_reminder |
|
||||
| `QUICK_WEEKLY_REPORT_001` | 生成本周报告 | 生成本周指摘处理统计报告 | 否 | search_issues, generate_report |
|
||||
| `QUICK_AUTO_ASSIGN_001` | 分配待处理指摘 | 自动将草稿状态指摘分配给合适人员 | 是 | search_issues, assign_issue, request_human_approval |
|
||||
| `QUICK_KNOWLEDGE_SEARCH_001` | 检索知识库 | 在本地知识库中检索相关信息 | 否 | search_knowledge |
|
||||
|
||||
### 3.6 Prompt版本管理与热更新机制
|
||||
|
||||
#### 3.6.1 版本控制策略
|
||||
|
||||
| 版本号格式 | 示例 | 含义 | 升级策略 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `MAJOR`变更 | `001` → `002` | 架构级变更,不兼容旧格式 | 需回归测试,逐步灰度发布 |
|
||||
| `MINOR`变更 | 模板内容优化 | 功能增强,兼容旧格式 | 可直接热更新,记录A/B测试数据 |
|
||||
| `PATCH`变更 | 错别字修正 | 无功能影响 | 即时热更新 |
|
||||
|
||||
#### 3.6.2 热更新流程
|
||||
1. 管理员提交新模板版本到数据库
|
||||
2. 数据库进行版本校验和语法检查
|
||||
3. 发布到Redis缓存(带生效时间)
|
||||
4. Prompt引擎每30秒轮询检查更新
|
||||
5. 如版本变更,清空本地缓存并加载新模板
|
||||
6. 后续请求使用最新模板
|
||||
|
||||
#### 3.6.3 数据库表设计
|
||||
(同V4.2,含 `prompt_templates`, `prompt_template_versions`, `prompt_render_logs`)
|
||||
|
||||
### 3.7 跨模型输出一致性策略
|
||||
|
||||
**背景**:Ollama(ChatML格式)与DeepSeek(OpenAI兼容格式)的Prompt渲染结果和模型行为可能存在差异,影响Agent决策稳定性。
|
||||
|
||||
**应对策略**:
|
||||
1. **格式适配**(由 `PromptFormatter` 实现):统一通过格式适配器将同一套模板内容转换为各模型所需的消息格式。
|
||||
2. **行为调参**:必要时对两个模型分别调整 `temperature`、`top_p` 等参数,确保输出质量接近。建议在测试环境中建立双模型评测流水线,定期对比输出一致性。
|
||||
3. **A/B测试机制**:利用模板管理后台的A/B测试功能,收集两个模型在实际任务中的效果数据,指导调优。
|
||||
|
||||
### 3.8 Prompt渲染格式适配器(V6.0新增)
|
||||
|
||||
```java
|
||||
@Component
|
||||
public class PromptFormatter {
|
||||
|
||||
@Value("${ai.provider:ollama}")
|
||||
private String provider;
|
||||
|
||||
public String format(String systemPrompt, String userPrompt) {
|
||||
if ("ollama".equalsIgnoreCase(provider)) {
|
||||
// ChatML 格式
|
||||
return "<|im_start|>system\n" + systemPrompt + "\n<|im_end|>\n" +
|
||||
"<|im_start|>user\n" + userPrompt + "\n<|im_end|>\n" +
|
||||
"<|im_start|>assistant\n";
|
||||
} else if ("deepseek".equalsIgnoreCase(provider)) {
|
||||
// DeepSeek 原始格式(系统角色+用户指令)
|
||||
return systemPrompt + "\n\n---\n\n" + userPrompt;
|
||||
}
|
||||
// 默认(通用)
|
||||
return systemPrompt + "\n\n" + userPrompt;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3.8 Prompt引擎核心实现(V6.0调整)
|
||||
|
||||
```java
|
||||
@Service
|
||||
public class PromptTemplateEngine {
|
||||
|
||||
@Autowired
|
||||
private PromptTemplateRepository templateRepo;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
private PromptFormatter formatter;
|
||||
|
||||
private final ConcurrentHashMap<String, PromptTemplate> localCache = new ConcurrentHashMap<>();
|
||||
@Value("${ai.provider:ollama}")
|
||||
private String provider;
|
||||
|
||||
public String render(String templateId, Map<String, Object> variables) {
|
||||
// 1. 加载模板
|
||||
PromptTemplate template = loadTemplate(templateId);
|
||||
// 2. 变量校验
|
||||
validateVariables(template, variables);
|
||||
// 3. 自动注入modelProvider
|
||||
variables.putIfAbsent("modelProvider", provider);
|
||||
// 4. 渲染模板(使用Mustache)
|
||||
String rendered = Mustache.compiler().compile(template.getContent()).execute(variables);
|
||||
// 5. 注入系统角色Prompt(如非系统角色模板)
|
||||
if (!templateId.startsWith("SYS_ROLE_")) {
|
||||
String systemPrompt = render("SYS_ROLE_001", variables);
|
||||
String formatConstraint = loadTemplate("FORMAT_JSON_001").getContent();
|
||||
String fullPrompt = systemPrompt + "\n\n---\n\n" + rendered + "\n\n---\n\n" + formatConstraint;
|
||||
// 6. 应用格式适配
|
||||
return formatter.format(fullPrompt, "");
|
||||
} else {
|
||||
return formatter.format(rendered, "");
|
||||
}
|
||||
}
|
||||
|
||||
@Scheduled(fixedRate = 30000)
|
||||
public void checkForUpdates() {
|
||||
List<PromptTemplate> activeTemplates = templateRepo.findAllActive();
|
||||
for (PromptTemplate template : activeTemplates) {
|
||||
String cacheKey = template.getTemplateId();
|
||||
PromptTemplate cached = localCache.get(cacheKey);
|
||||
if (cached == null || cached.getVersion() < template.getVersion()) {
|
||||
localCache.put(cacheKey, template);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 4. 功能模块设计
|
||||
|
||||
### 4.1 系统管理模块
|
||||
|
||||
#### 4.1.1 用户管理(`/system/users`)
|
||||
- **组织架构树**:以树形结构展示部门层级,点击节点可筛选该部门下的用户列表。
|
||||
- **用户列表**:展示账号、姓名、所属部门、绑定角色、状态(启用/禁用)、**Agent自动执行权限**,支持按姓名/账号搜索。
|
||||
- **新增/编辑用户**:弹窗形式,可设置账号、姓名、所属部门、绑定角色(多选)、启用状态开关,以及**Agent自动执行高风险操作**开关(仅超级管理员可见)。
|
||||
- **启用/禁用用户**:在表格行内操作,切换用户状态。
|
||||
- **导出用户列表**:将当前筛选结果导出为 Excel 文件。
|
||||
|
||||
**权限要求**:
|
||||
- 查看列表及搜索:所有已登录用户。
|
||||
- 新增、编辑、启用/禁用、导出:仅超级管理员及部门管理员(部门管理员仅可管理本部门及其下级部门用户)。
|
||||
- 部门树查看:所有已登录用户。
|
||||
|
||||
#### 4.1.2 角色权限管理(`/system/roles`)
|
||||
- **角色列表**:左侧展示所有预设角色(超级管理员、部门管理员、指摘录入员、整改担当、验证人员、只读用户),支持新建、编辑、删除角色。
|
||||
- **权限配置面板**:右侧展示选中角色的权限配置,包括:
|
||||
- **功能权限**:菜单权限(工作台、指摘列表、批量录入、AI智能分析管理、用户管理、角色权限、系统日志、Agent管理)和按钮权限,以复选框形式呈现。
|
||||
- **数据权限**:下拉选择数据范围(仅本人、本部门、全部门)。
|
||||
- **Agent工具权限**:以复选框列出所有可用工具(`assign_issue`, `send_reminder`, `close_issue`, `delete_issue`, `search_knowledge`, `create_comment`, `request_human_approval`, `export_excel`等),每个工具可独立授予或收回。
|
||||
- **Prompt模板权限**:可查看/可编辑的Prompt模板分类列表。
|
||||
- **保存权限配置**:将当前角色的权限设置持久化。
|
||||
|
||||
**权限要求**:所有操作仅限超级管理员。
|
||||
|
||||
#### 4.1.3 预设角色权限矩阵
|
||||
|
||||
| 角色 | 功能权限摘要 | 数据权限范围 | Agent可用工具 | Agent自动执行 | Prompt模板权限 |
|
||||
| :--- | :--- | :--- | :--- | :--- | :--- |
|
||||
| **超级管理员** | 全部功能 | 全部数据 | 全部工具 | 是(可配置) | 全部模板可编辑 |
|
||||
| **部门管理员** | 除"角色权限管理"外的所有菜单 | 本部门及下级部门 | 除`delete_issue`外的全部工具 | 否(需审批) | 可查看全部,可编辑工具类模板 |
|
||||
| **指摘录入员** | 工作台、指摘列表、批量录入 | 自己创建的指摘 | `send_reminder`, `search_knowledge`, `create_comment` | 否 | 仅查看 |
|
||||
| **整改担当** | 工作台、指摘列表、被分配指摘详情 | 分配给自己或协办的指摘 | `send_reminder`, `search_knowledge`, `request_human_approval` | 否 | 仅查看 |
|
||||
| **验证人员** | 工作台、指摘列表、被指定为验证人的指摘详情 | 被指定为验证人的指摘 | `send_reminder`, `search_knowledge` | 否 | 仅查看 |
|
||||
| **只读用户** | 工作台、指摘列表(仅查看) | 本部门 | `search_knowledge`(仅检索) | 否 | 仅查看 |
|
||||
|
||||
#### 4.1.4 系统日志(`/system/logs`)
|
||||
- **Tab切换**:操作日志 / 系统错误日志 / **Prompt渲染日志**。
|
||||
- **操作日志**:记录所有用户及Agent的操作行为,支持按操作人、时间、操作类型(含"Agent操作")、资源类型筛选,可导出筛选结果。
|
||||
- **系统错误日志**:记录系统运行异常,支持按级别、时间、模块、关键字搜索,可标记已读/已解决。
|
||||
- **Prompt渲染日志**:记录每次Prompt渲染的完整信息(模板ID、版本、变量、输入token、输出token、耗时),支持按模板、时间、操作人筛选,可导出审计报告。
|
||||
|
||||
**权限要求**:超级管理员、部门管理员。
|
||||
|
||||
### 4.2 指摘全生命周期管理模块
|
||||
|
||||
#### 4.2.1 工作台(`/dashboard`)
|
||||
- **统计卡片**:展示待处理、进行中、本月已完成、今日新增的数量及环比变化,每张卡片底部显示Agent生成的动态建议。
|
||||
- **Agent快捷指令输入框**:用户可在此输入自然语言指令(如"新建指摘 '传感器故障' 分配给张三"),Agent解析后执行相应操作;下方提供快捷指令标签(催办逾期指摘、生成本周报告、分配待处理指摘、检索知识库)。
|
||||
- **快捷操作**:"新建指摘"和"批量导入"按钮。
|
||||
- **Agent洞察面板**:展示Agent自动生成的三类洞察——高风险警报、自动对应建议、任务提醒。
|
||||
- **最新动态**:展示系统内最近的用户操作和Agent自动操作记录。
|
||||
- **指摘处理趋势图**:折线图展示新增指摘与已解决指摘的日趋势。
|
||||
- **指摘状态分布图**:环形图展示各状态指摘的数量占比。
|
||||
- **通知铃铛**:顶部栏显示未读消息数,点击展示消息列表(含Agent发起的审批请求通知)。
|
||||
|
||||
**权限要求**:所有已登录用户。
|
||||
|
||||
#### 4.2.2 指摘列表(`/issues`)
|
||||
- **筛选栏**:支持下拉选择状态、工程阶段、整改负责人、归属部门,以及日期范围筛选。
|
||||
- **操作按钮**:新建指摘、跳转批量录入、导出Excel、**Agent批量处理**(选中多条指摘后统一分配或催办)。
|
||||
- **表格**:展示指摘 ID、标题、状态、优先级、工程阶段、子工程、对应者、截止日期、**Agent建议**,每行提供"查看详情"链接。
|
||||
|
||||
**权限要求**:所有已登录用户(数据权限过滤);Agent批量处理仅部门管理员及超级管理员。
|
||||
|
||||
#### 4.2.3 指摘详情(`/issues/:id`)—— Agent驾驶舱集成
|
||||
- **布局**:页面分为左(基础信息+附件)右(Agent驾驶舱)两栏。
|
||||
- **左侧基础信息区域**:展示创建人、部门、review者、对应者、确认者、指摘日、关联PGM、影响度、影响工程、部署、区分、review工数、对应内容、NG原因等(只读)。
|
||||
- **左侧附件列表**:可上传新附件,支持预览、下载、删除。
|
||||
- **右侧 Agent 驾驶舱**:
|
||||
- **对话式交互**:用户输入自然语言指令(如"催办此指摘并询问是否需要技术支持")。
|
||||
- **思考链展示**:实时流式显示 Agent 的 `[思考]`、`[行动]`(含工具名和参数)、`[观察]`(执行结果)卡片。
|
||||
- **Prompt模板展示**:可展开查看当前Agent使用的Prompt模板ID、版本、关键变量(脱敏)。
|
||||
- **AI引擎信息展示**:显示当前使用的模型提供商(Ollama/DeepSeek)及模型名称。
|
||||
- **审批请求面板**:当Agent调用`request_human_approval`时,自动弹出审批按钮(批准/拒绝)。
|
||||
- **转人工按钮**:切换至纯人工模式。
|
||||
- **时间线切换**:可展开/折叠传统状态流转时间线(仅作审计参考)。
|
||||
|
||||
**权限要求**:所有已登录用户(须在数据权限范围内);上传附件需具备编辑权限。
|
||||
|
||||
#### 4.2.4 新建指摘(`/issues/new`)
|
||||
- **表单字段**:标题、工程阶段、子工程、区分、指摘内容、指摘日、关联PGM、影响度、影响工程、部署、review者、review工数、对应者、对应工数、对应内容、NG原因、对应完了日、确认者、确认日(标*为必填)。
|
||||
- **右侧快速设置**:状态、优先级、归属部门、创建人(只读)、整改截止日期。
|
||||
- **附件上传**:支持点击或拖拽上传,可上传多个文件。
|
||||
- **操作按钮**:清空重置、保存指摘。
|
||||
- **Agent辅助**:页面右侧提供"Agent辅助"按钮,可让Agent根据标题自动填充部分字段(基于`ANALYSIS_`系列Prompt模板)。
|
||||
|
||||
**权限要求**:指摘录入员、部门管理员、超级管理员。
|
||||
|
||||
#### 4.2.5 编辑指摘(`/issues/:id/edit`)
|
||||
- **页面复用**:与新建指摘页面(`/issues/new`)共用同一套表单组件,通过路由参数区分模式。
|
||||
- 预填充现有数据,部分字段(如创建人、创建日期)只读。
|
||||
- 支持附件新增、预览、下载、删除。
|
||||
- 操作按钮:恢复初始、保存修改、删除指摘、查看修改历史。
|
||||
- 提供"Agent建议修改"按钮(基于当前指摘上下文调用`ANALYSIS_`系列Prompt)。
|
||||
|
||||
**权限要求**:拥有编辑权限的用户。
|
||||
|
||||
#### 4.2.6 批量录入(`/batch-input`)
|
||||
- **上传区域**:支持点击或拖拽上传 Excel 文件(.xlsx, .xls),并提供标准导入模板下载。
|
||||
- **Agent智能校验**:上传后,Agent自动扫描错误(空字段、格式错误),并给出修正建议,提供"应用Agent修正"按钮(基于`VALIDATE_BATCH_001` Prompt模板)。
|
||||
- **预览与校验面板**:显示上传文件的数据预览,标出校验错误行。
|
||||
- **确认导入**:将校验通过的数据批量写入数据库。
|
||||
- **历史导入记录**:展示以往的导入记录(时间、操作人、总条数、成功/失败、可下载错误日志)。
|
||||
|
||||
**权限要求**:指摘录入员、部门管理员、超级管理员。
|
||||
|
||||
### 4.3 通知与消息模块
|
||||
|
||||
| 触发场景 | 通知方式 | 实现策略 |
|
||||
| :--- | :--- | :--- |
|
||||
| Agent发起的审批请求 | 站内消息 + 邮件 | 创建通知记录,异步发送邮件 |
|
||||
| 新指摘分配 | 站内消息 + 邮件 | Spring Async异步任务发送 |
|
||||
| 指摘被驳回 | 站内消息 + 邮件 | Spring Async异步任务发送 |
|
||||
| 整改即将超时 | 站内消息 + 邮件 | Spring @Scheduled定时任务扫描 |
|
||||
| 指摘关闭 | 站内消息 | 写入消息记录 |
|
||||
| Prompt模板更新 | 站内消息(仅管理员) | 模板热更新后通知相关管理员 |
|
||||
| **AI引擎切换** | **站内消息(管理员)** | **配置变更后通知** |
|
||||
|
||||
### 4.4 AI智能分析管理(`/ai-analysis`)
|
||||
|
||||
此模块作为独立页面存在,用于人工触发指摘的深度AI分析,与Agent并行存在。
|
||||
|
||||
- **筛选栏**:按指摘ID、归属部门、日期范围、分析状态筛选。
|
||||
- **操作按钮**:"生成AI分析"(弹窗多选指摘)、"导出AI分析记录"。
|
||||
- **列表展示**:指摘ID、提取关键词、问题分类、根因分析、AI整改建议、用户反馈、操作(查看详情/重新生成)。
|
||||
- **生成AI分析弹窗**:支持多选指摘,含筛选条件(指摘状态、工程阶段、归属部门、搜索、创建时间),确认后对选中指摘批量生成AI分析(基于`ANALYSIS_ROOT_CAUSE_001` Prompt模板)。
|
||||
- **Prompt模板查看**:分析结果详情页可查看生成该分析使用的Prompt模板ID、版本、关键输入变量。
|
||||
- **AI引擎信息**:显示生成分析时使用的模型提供商及模型名称。
|
||||
|
||||
**权限要求**:查看列表所有已登录用户;生成分析及导出仅部门管理员、超级管理员。
|
||||
|
||||
### 4.5 Agent管理(`/system/agent-admin`)
|
||||
|
||||
专门管理Agent全局配置、审批、工具、记忆和审计的后台模块。
|
||||
|
||||
- **运行状态统计**:总任务数、待审批数、执行成功率、记忆条目数、**Prompt模板总数/活跃数**、**当前AI引擎状态**。
|
||||
- **全局配置**:
|
||||
- **AI模型配置(V6.0新增)**:
|
||||
- **AI提供商选择**:下拉选择 `ollama` 或 `deepseek`,切换后立即生效。
|
||||
- **Ollama参数**:服务地址、推理模型、嵌入模型、温度、最大输出tokens。
|
||||
- **DeepSeek参数**:API Key(加密存储)、推理模型、嵌入模型。
|
||||
- **自动降级开关**:当主引擎不可用时,是否自动切换至备用引擎。
|
||||
- **Agent行为配置**:最大推理步数(默认10,范围5-20)、是否允许自动执行高风险操作(仅超级管理员可开启)、单用户Agent调用限流(默认每分钟10次)。
|
||||
- **知识库切片配置**:切片大小(Token,默认500)、重叠比例(%,默认10)、最大上传大小(MB,默认50)。
|
||||
- **Prompt工程配置**:系统角色Prompt版本选择、输出格式化强制开关、Query改写引擎开关、Prompt渲染日志保留天数(默认30天)。
|
||||
- **待审批队列**:Agent发起的需人工决策的操作列表,提供"批准"和"拒绝"按钮。
|
||||
- **工具列表**:展示所有已注册工具及其状态("启用"或"需审批"),支持启用/禁用。
|
||||
- **执行记录**:分页展示所有Agent任务(时间、指摘、工具、状态、操作人)。
|
||||
- **记忆库管理**:列表展示所有向量记忆条目(问题摘要、解决方案步骤、有效性评分),支持新增、编辑、删除、反馈有效性。
|
||||
- **Prompt模板管理**:
|
||||
- 模板列表:按分类展示所有Prompt模板,显示模板ID、名称、版本、状态、最近更新时间。
|
||||
- 模板编辑:在线编辑模板内容,支持变量自动补全、实时预览。
|
||||
- 版本历史:查看模板的所有历史版本,支持回滚到任意版本。
|
||||
- A/B测试:对同一模板的不同版本配置流量分配比例,收集效果数据。
|
||||
- 渲染测试:输入测试变量,查看渲染后的完整Prompt。
|
||||
- 批量发布:选择多个模板统一发布新版本。
|
||||
|
||||
**权限要求**:超级管理员、部门管理员(部门管理员仅可编辑工具类和分析类模板)。
|
||||
|
||||
### 4.6 本地知识库管理(`/knowledge-base`)
|
||||
|
||||
#### 4.6.1 知识库文档管理
|
||||
- **文档上传**:支持拖拽或点击上传 PDF、Word(.docx)、TXT、Markdown 格式文件,单文件限制 50MB。
|
||||
- **文档列表**:展示文件名、上传人、上传时间、处理状态(待处理/处理中/已完成/失败)、分块数量、操作按钮。
|
||||
- **解析与向量化流程**:
|
||||
1. 上传后,后端调用本地解析库(Apache Tika / PDFBox)提取纯文本。
|
||||
2. 按 **500 Token** 大小切分(含 10% 重叠)。
|
||||
3. 调用当前选中的 **EmbeddingModel**(Ollama 或 DeepSeek)将每个分块转为向量。
|
||||
4. 向量及原文存入本地 PostgreSQL(pgvector),源文件存入本地 MinIO。
|
||||
5. **全程无任何数据上传至云端存储(若使用Ollama则完全不外传,若使用DeepSeek仅API调用传输文本片段)。**
|
||||
- **重新向量化**:支持对已上传文档重新生成向量(用于嵌入模型升级时)。
|
||||
- **删除文档**:同时删除 MinIO 中的源文件和 pgvector 中的向量数据。
|
||||
- **批量操作**:支持多选文档进行批量删除或重新向量化。
|
||||
|
||||
#### 4.6.2 Agent 知识库检索工具
|
||||
- Agent 内置 `search_knowledge(query: string, top_k: int)` 工具。
|
||||
- 调用流程(V6.0增强):
|
||||
1. 用户原始问题通过 **Query改写引擎**(基于`QUERY_REWRITE_001` Prompt模板)转换为领域专业查询。
|
||||
2. 改写后的查询通过当前EmbeddingModel向量化。
|
||||
3. 在本地 pgvector 中执行余弦相似度检索。
|
||||
4. 检索结果通过 **记忆重排序引擎**(基于`MEMORY_RERANK_001` Prompt模板)进行相关性重排序。
|
||||
5. 返回 Top K 相关原文片段给 Agent。
|
||||
- 用途:辅助 Agent 进行根因分析、整改建议生成、历史案例参考。
|
||||
- **权限控制**:仅授予"超级管理员"、"部门管理员"、"指摘录入员"、"整改担当"角色的 Agent 可调用此工具。
|
||||
|
||||
#### 4.6.3 知识库检索审计
|
||||
- **检索日志**:记录每次 Agent 或人工检索的关键词、**改写后查询**、返回片段数、耗时、关联的指摘ID。
|
||||
- **统计看板**:展示"热门检索词 Top 50"、"低效文档"(从未被检索到的文档)、"文档命中率排行"、**"Query改写成功率"**。
|
||||
- **日志导出**:支持按时间范围导出检索审计日志(Excel)。
|
||||
|
||||
**权限要求**:
|
||||
- 上传、删除、重新向量化文档:仅超级管理员、部门管理员。
|
||||
- 查看文档列表及检索审计:超级管理员、部门管理员。
|
||||
- Agent 调用检索工具:受角色工具权限控制(默认除只读用户外均可)。
|
||||
|
||||
|
||||
## 5. 数据库架构与设计
|
||||
|
||||
### 5.1 ER图
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
departments ||--o{ users : "包含"
|
||||
users ||--o{ issues : "创建/负责/验证"
|
||||
issues ||--o{ attachments : "拥有"
|
||||
issues ||--o{ issue_logs : "产生"
|
||||
issues ||--o{ ai_analysis : "关联"
|
||||
ai_analysis ||--o{ ai_feedback : "收集反馈"
|
||||
users ||--o{ user_roles : "拥有"
|
||||
roles ||--o{ user_roles : "关联"
|
||||
roles ||--o{ role_permissions : "分配"
|
||||
permissions ||--o{ role_permissions : "被包含"
|
||||
issues ||--o{ agent_plans : "触发"
|
||||
agent_plans ||--o{ tool_executions : "包含"
|
||||
users ||--o{ agent_plans : "创建"
|
||||
agent_memories ||--o{ issues : "参考"
|
||||
knowledge_documents ||--o{ knowledge_chunks : "包含"
|
||||
users ||--o{ knowledge_documents : "上传"
|
||||
knowledge_search_logs ||--o{ users : "关联"
|
||||
knowledge_search_logs ||--o{ issues : "关联"
|
||||
prompt_templates ||--o{ prompt_template_versions : "版本历史"
|
||||
prompt_templates ||--o{ prompt_render_logs : "渲染记录"
|
||||
agent_plans ||--o{ prompt_render_logs : "关联"
|
||||
```
|
||||
|
||||
### 5.2 核心表结构
|
||||
|
||||
#### 5.2.1 基础表
|
||||
|
||||
**`departments`(部门表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | ID |
|
||||
| name | VARCHAR(100) | NOT NULL | 部门名称 |
|
||||
| parent_id | BIGINT | FOREIGN KEY | 上级部门ID |
|
||||
| sort_order | INT | DEFAULT 0 | 排序权重 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 更新时间 |
|
||||
|
||||
**`users`(用户表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | ID |
|
||||
| userid | VARCHAR(50) | NOT NULL, UNIQUE | 登录账号 |
|
||||
| username | VARCHAR(50) | NOT NULL, UNIQUE | 用户姓名 |
|
||||
| email | VARCHAR(100) | | 邮箱 |
|
||||
| password_hash | VARCHAR(255) | NOT NULL | bcrypt加密密码 |
|
||||
| department_id | BIGINT | FOREIGN KEY, NOT NULL | 所属部门 |
|
||||
| is_active | BOOLEAN | DEFAULT TRUE | 是否启用 |
|
||||
| agent_auto_execute | BOOLEAN | DEFAULT FALSE | 是否允许Agent自动执行高风险操作 |
|
||||
| last_login_at | TIMESTAMP | | 最后登录时间 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 更新时间 |
|
||||
|
||||
**`roles`(角色表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | ID |
|
||||
| name | VARCHAR(50) | NOT NULL, UNIQUE | 角色名称 |
|
||||
| description | VARCHAR(255) | | 角色描述 |
|
||||
| agent_auto_execute | BOOLEAN | DEFAULT FALSE | 是否允许该角色Agent自动执行高风险操作 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
|
||||
**`permissions`(权限表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | ID |
|
||||
| code | VARCHAR(100) | NOT NULL, UNIQUE | 权限编码 |
|
||||
| name | VARCHAR(100) | NOT NULL | 权限名称 |
|
||||
| resource | VARCHAR(50) | NOT NULL | 所属资源 |
|
||||
| description | VARCHAR(255) | | 权限描述 |
|
||||
|
||||
**`user_roles`(用户-角色关联表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| user_id | BIGINT | FOREIGN KEY, PRIMARY KEY (复合) | 用户ID |
|
||||
| role_id | BIGINT | FOREIGN KEY, PRIMARY KEY (复合) | 角色ID |
|
||||
|
||||
**`role_permissions`(角色-权限关联表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| role_id | BIGINT | FOREIGN KEY, PRIMARY KEY (复合) | 角色ID |
|
||||
| permission_id | BIGINT | FOREIGN KEY, PRIMARY KEY (复合) | 权限ID |
|
||||
|
||||
#### 5.2.2 核心业务表
|
||||
|
||||
**`issues`(指摘主表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 指摘ID |
|
||||
| issue_no | VARCHAR(20) | NOT NULL, UNIQUE | 业务编号 |
|
||||
| title | VARCHAR(200) | NOT NULL | 指摘标题 |
|
||||
| description | TEXT | | 问题详细描述 |
|
||||
| status | VARCHAR(30) | NOT NULL, DEFAULT 'draft' | 状态 |
|
||||
| priority | VARCHAR(10) | NOT NULL, DEFAULT 'medium' | 优先级 |
|
||||
| deadline | TIMESTAMP | | 整改截止时间 |
|
||||
| phase | VARCHAR(50) | | 工程阶段 |
|
||||
| sub_project | VARCHAR(100) | | 子工程 |
|
||||
| category | VARCHAR(50) | | 区分 |
|
||||
| impact_level | VARCHAR(10) | | 影响度 |
|
||||
| impact_scope | VARCHAR(200) | | 影响工程/范围 |
|
||||
| deployment | VARCHAR(100) | | 部署位置 |
|
||||
| pgm_no | VARCHAR(50) | | 关联PGM编号 |
|
||||
| review_workload | DECIMAL(5,1) | | review工数 |
|
||||
| response_workload | DECIMAL(5,1) | | 对应工数 |
|
||||
| response_content | TEXT | | 对应内容 |
|
||||
| ng_reason | VARCHAR(200) | | NG原因 |
|
||||
| response_completed_at | TIMESTAMP | | 对应完了日 |
|
||||
| confirm_at | TIMESTAMP | | 确认日 |
|
||||
| creator_id | BIGINT | FOREIGN KEY, NOT NULL | 创建人ID |
|
||||
| assignee_id | BIGINT | FOREIGN KEY | 整改负责人ID |
|
||||
| department_id | BIGINT | FOREIGN KEY, NOT NULL | 归属部门ID |
|
||||
| reviewer_id | BIGINT | FOREIGN KEY | review者ID |
|
||||
| validator_id | BIGINT | FOREIGN KEY | 验证人ID |
|
||||
| ai_analysis_id | BIGINT | FOREIGN KEY | 最新AI分析结果ID |
|
||||
| agent_last_plan_id | BIGINT | FOREIGN KEY | 关联最新Agent规划ID |
|
||||
| agent_status | VARCHAR(20) | DEFAULT 'human_driven' | Agent驱动状态 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 更新时间 |
|
||||
| closed_at | TIMESTAMP | | 关闭时间 |
|
||||
| is_deleted | BOOLEAN | DEFAULT FALSE | 软删除标记 |
|
||||
|
||||
**`issue_logs`(指摘操作日志表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 日志ID |
|
||||
| issue_id | BIGINT | FOREIGN KEY, NOT NULL | 指摘ID |
|
||||
| user_id | BIGINT | FOREIGN KEY, NOT NULL | 操作人ID |
|
||||
| action | VARCHAR(30) | NOT NULL | 操作类型 |
|
||||
| from_status | VARCHAR(30) | | 原状态 |
|
||||
| to_status | VARCHAR(30) | | 目标状态 |
|
||||
| remark | VARCHAR(500) | | 备注 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 操作时间 |
|
||||
|
||||
**`attachments`(附件表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 附件ID |
|
||||
| issue_id | BIGINT | FOREIGN KEY, NOT NULL | 关联指摘ID |
|
||||
| file_name | VARCHAR(200) | NOT NULL | 原始文件名 |
|
||||
| file_path | VARCHAR(500) | NOT NULL | 存储路径 |
|
||||
| file_size | BIGINT | NOT NULL | 文件大小 |
|
||||
| mime_type | VARCHAR(100) | | MIME类型 |
|
||||
| uploaded_by | BIGINT | FOREIGN KEY, NOT NULL | 上传人ID |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 上传时间 |
|
||||
|
||||
#### 5.2.3 AI与任务表
|
||||
|
||||
**`ai_analysis`(AI分析结果表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 分析ID |
|
||||
| issue_id | BIGINT | FOREIGN KEY, NOT NULL | 关联指摘ID |
|
||||
| category | VARCHAR(100) | | AI分类结果 |
|
||||
| keywords | VARCHAR(500) | | 提取关键词 |
|
||||
| root_cause | VARCHAR(1000) | | 根因分析 |
|
||||
| suggestion | TEXT | | 整改建议 |
|
||||
| status | VARCHAR(20) | DEFAULT 'pending' | 状态 |
|
||||
| helpful_count | INT | DEFAULT 0 | 有帮助计数 |
|
||||
| prompt_template_id | VARCHAR(100) | | 使用的Prompt模板ID |
|
||||
| prompt_version | INT | | 使用的Prompt版本 |
|
||||
| **model_provider** | **VARCHAR(20)** | | **【V6.0新增】使用的AI提供商** |
|
||||
| **model_name** | **VARCHAR(50)** | | **【V6.0新增】使用的模型名称** |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
|
||||
**`ai_feedback`(AI反馈表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 反馈ID |
|
||||
| ai_analysis_id | BIGINT | FOREIGN KEY, NOT NULL | AI分析ID |
|
||||
| user_id | BIGINT | FOREIGN KEY, NOT NULL | 反馈人ID |
|
||||
| is_helpful | BOOLEAN | NOT NULL | 是否有帮助 |
|
||||
| comment | VARCHAR(500) | | 反馈备注 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 反馈时间 |
|
||||
|
||||
**`task_executions`(异步任务执行表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 任务ID |
|
||||
| task_id | VARCHAR(64) | NOT NULL, UNIQUE | 业务任务唯一标识 |
|
||||
| task_type | VARCHAR(30) | NOT NULL | 任务类型 |
|
||||
| status | VARCHAR(20) | NOT NULL, DEFAULT 'pending' | 状态 |
|
||||
| result_url | VARCHAR(500) | | 结果文件URL |
|
||||
| error_message | TEXT | | 错误信息 |
|
||||
| created_by | BIGINT | FOREIGN KEY, NOT NULL | 触发人ID |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| started_at | TIMESTAMP | | 开始执行时间 |
|
||||
| completed_at | TIMESTAMP | | 完成时间 |
|
||||
| retry_count | INT | DEFAULT 0 | 已重试次数 |
|
||||
|
||||
#### 5.2.4 Agent相关表
|
||||
|
||||
**`agent_plans`(Agent规划表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 规划ID |
|
||||
| issue_id | BIGINT | FOREIGN KEY, NOT NULL | 关联指摘ID |
|
||||
| goal | TEXT | NOT NULL | 用户目标 |
|
||||
| plan_steps | JSONB | NOT NULL | 执行步骤数组 |
|
||||
| status | VARCHAR(20) | DEFAULT 'pending' | 状态 |
|
||||
| requires_approval | BOOLEAN | DEFAULT FALSE | 是否需人工审批 |
|
||||
| approval_status | VARCHAR(20) | | 审批状态 |
|
||||
| approval_comment | VARCHAR(500) | | 审批备注 |
|
||||
| created_by | BIGINT | FOREIGN KEY | 发起人ID |
|
||||
| **model_provider** | **VARCHAR(20)** | | **【V6.0新增】使用的AI提供商** |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| completed_at | TIMESTAMP | | 完成时间 |
|
||||
|
||||
**`agent_memories`(Agent长期记忆表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 记忆ID |
|
||||
| issue_summary | TEXT | NOT NULL | 问题摘要 |
|
||||
| solution_steps | JSONB | NOT NULL | 成功解决方案步骤 |
|
||||
| effectiveness_score | DECIMAL(3,2) | DEFAULT 0.00 | 有效性评分 |
|
||||
| embedding | VECTOR(1536) | | 向量化嵌入 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 更新时间 |
|
||||
|
||||
**`tool_executions`(工具执行明细表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 执行ID |
|
||||
| plan_id | BIGINT | FOREIGN KEY | 关联规划ID |
|
||||
| tool_name | VARCHAR(50) | NOT NULL | 工具名称 |
|
||||
| input_params | JSONB | NOT NULL | 输入参数 |
|
||||
| output_result | TEXT | | 执行结果 |
|
||||
| status | VARCHAR(20) | DEFAULT 'success' | 执行状态 |
|
||||
| execution_time_ms | BIGINT | | 执行耗时 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 执行时间 |
|
||||
|
||||
**`notifications`(通知表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 通知ID |
|
||||
| user_id | BIGINT | FOREIGN KEY, NOT NULL | 接收人ID |
|
||||
| title | VARCHAR(200) | NOT NULL | 通知标题 |
|
||||
| content | VARCHAR(1000) | NOT NULL | 通知内容 |
|
||||
| type | VARCHAR(30) | NOT NULL | 通知类型 |
|
||||
| link | VARCHAR(500) | | 跳转链接 |
|
||||
| is_read | BOOLEAN | DEFAULT FALSE | 是否已读 |
|
||||
| issue_id | BIGINT | FOREIGN KEY | 关联指摘ID |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
|
||||
#### 5.2.5 知识库相关表(本地部署)
|
||||
|
||||
**`knowledge_documents`(知识库文档主表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 文档ID |
|
||||
| name | VARCHAR(255) | NOT NULL | 原始文件名 |
|
||||
| file_path | VARCHAR(500) | NOT NULL | MinIO存储路径 |
|
||||
| file_size | BIGINT | NOT NULL | 文件大小(字节) |
|
||||
| file_type | VARCHAR(20) | NOT NULL | 文件类型(pdf/docx/txt/md) |
|
||||
| chunk_count | INT | DEFAULT 0 | 切片总数 |
|
||||
| status | VARCHAR(20) | DEFAULT 'pending' | 状态(pending/processing/completed/failed) |
|
||||
| error_message | TEXT | | 失败原因 |
|
||||
| uploaded_by | BIGINT | FOREIGN KEY, NOT NULL | 上传人ID |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 上传时间 |
|
||||
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 更新时间 |
|
||||
|
||||
**`knowledge_chunks`(知识库向量切片表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 切片ID |
|
||||
| doc_id | BIGINT | FOREIGN KEY, NOT NULL | 所属文档ID |
|
||||
| content | TEXT | NOT NULL | 切片原文 |
|
||||
| embedding | VECTOR(1536) | NOT NULL | 向量化嵌入(本地存储) |
|
||||
| metadata | JSONB | | 附加元数据 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
|
||||
**`knowledge_search_logs`(知识库检索审计表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 日志ID |
|
||||
| user_id | BIGINT | FOREIGN KEY | 检索人ID |
|
||||
| issue_id | BIGINT | FOREIGN KEY | 关联指摘ID |
|
||||
| query | TEXT | NOT NULL | 检索关键词 |
|
||||
| rewritten_query | TEXT | | 改写后的查询 |
|
||||
| top_k | INT | DEFAULT 5 | 返回条数 |
|
||||
| total_matches | INT | | 实际命中数 |
|
||||
| duration_ms | INT | | 检索耗时(毫秒) |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 检索时间 |
|
||||
|
||||
#### 5.2.6 Prompt模板相关表
|
||||
|
||||
**`prompt_templates`(Prompt模板主表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 模板ID |
|
||||
| template_id | VARCHAR(100) | NOT NULL, UNIQUE | 模板标识(如 SYS_ROLE_001) |
|
||||
| name | VARCHAR(200) | NOT NULL | 模板名称 |
|
||||
| category | VARCHAR(50) | NOT NULL | 分类(system/tool/analysis/validation/memory/format/quick) |
|
||||
| version | INT | NOT NULL, DEFAULT 1 | 版本号 |
|
||||
| content | TEXT | NOT NULL | 模板内容(支持{{变量}}占位符) |
|
||||
| variables | JSONB | | 模板变量定义(名称、类型、是否必填、默认值) |
|
||||
| output_schema | JSONB | | 输出JSON Schema定义 |
|
||||
| is_active | BOOLEAN | DEFAULT TRUE | 是否启用 |
|
||||
| is_default | BOOLEAN | DEFAULT FALSE | 是否为默认版本 |
|
||||
| created_by | BIGINT | FOREIGN KEY | 创建人 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 创建时间 |
|
||||
| updated_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 更新时间 |
|
||||
|
||||
**`prompt_template_versions`(Prompt模板版本历史表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 版本记录ID |
|
||||
| template_id | VARCHAR(100) | NOT NULL | 关联模板标识 |
|
||||
| version | INT | NOT NULL | 版本号 |
|
||||
| content | TEXT | NOT NULL | 该版本内容 |
|
||||
| change_log | VARCHAR(500) | | 变更说明 |
|
||||
| created_by | BIGINT | FOREIGN KEY | 修改人 |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 记录时间 |
|
||||
|
||||
**`prompt_render_logs`(Prompt渲染审计表)**
|
||||
|
||||
| 字段名 | 类型 | 约束 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| id | BIGSERIAL | PRIMARY KEY | 日志ID |
|
||||
| request_id | VARCHAR(64) | NOT NULL | 关联请求ID |
|
||||
| template_id | VARCHAR(100) | NOT NULL | 使用的模板标识 |
|
||||
| template_version | INT | NOT NULL | 使用的模板版本 |
|
||||
| rendered_prompt | TEXT | NOT NULL | 渲染后的完整Prompt(用于审计) |
|
||||
| variables_used | JSONB | | 实际使用的变量值(脱敏后) |
|
||||
| tokens_input | INT | | 输入token数 |
|
||||
| tokens_output | INT | | 输出token数 |
|
||||
| execution_time_ms | INT | | 执行耗时 |
|
||||
| llm_model | VARCHAR(50) | | 使用的模型 |
|
||||
| **model_provider** | **VARCHAR(20)** | | **【V6.0新增】使用的AI提供商** |
|
||||
| created_at | TIMESTAMP | DEFAULT CURRENT_TIMESTAMP | 记录时间 |
|
||||
|
||||
### 5.3 索引策略汇总
|
||||
|
||||
| 表名 | 索引字段 | 类型 | 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| issues | (department_id, status, created_at DESC) | 复合索引 | 工作台/列表页过滤排序 |
|
||||
| issues | (assignee_id, status) | 复合索引 | 按负责人查询待办 |
|
||||
| issues | (deadline) | B-tree | 定时任务扫描超时 |
|
||||
| issues | (issue_no) | UNIQUE | 业务编号快速查询 |
|
||||
| issue_logs | (issue_id, created_at DESC) | 复合索引 | 详情页时间线 |
|
||||
| attachments | (issue_id) | B-tree | 查询附件 |
|
||||
| ai_analysis | (issue_id, created_at DESC) | 复合索引 | 获取最新分析 |
|
||||
| notifications | (user_id, is_read, created_at DESC) | 复合索引 | 通知列表 |
|
||||
| task_executions | (task_id) | UNIQUE | 按任务ID查询 |
|
||||
| agent_plans | (issue_id, created_at DESC) | 复合索引 | 按指摘获取规划 |
|
||||
| tool_executions | (plan_id) | B-tree | 按规划ID查询 |
|
||||
| agent_memories | (embedding) | ivfflat | 向量相似度检索 |
|
||||
| knowledge_chunks | (embedding) | ivfflat | 知识库向量检索 |
|
||||
| knowledge_documents | (uploaded_by, created_at DESC) | 复合索引 | 按上传人查询 |
|
||||
| knowledge_search_logs | (user_id, created_at DESC) | 复合索引 | 检索审计查询 |
|
||||
| prompt_templates | (template_id, is_active) | 复合索引 | 模板查询 |
|
||||
| prompt_templates | (category, is_active) | 复合索引 | 按分类查询 |
|
||||
| prompt_render_logs | (request_id) | B-tree | 按请求查询 |
|
||||
| prompt_render_logs | (template_id, created_at DESC) | 复合索引 | 模板使用统计 |
|
||||
|
||||
### 5.4 数据迁移与版本管理
|
||||
|
||||
- **工具**:Flyway
|
||||
- **目录结构**:`src/main/resources/db/migration`
|
||||
- `V1.0__init_schema.sql` —— 基础表结构
|
||||
- `V1.1__agent_tables.sql` —— Agent相关表及pgvector扩展
|
||||
- `V1.2__knowledge_tables.sql` —— 知识库相关表
|
||||
- `V1.3__insert_default_data.sql` —— 默认角色与权限
|
||||
- `V1.4__prompt_template_tables.sql` —— Prompt模板相关表
|
||||
- `V1.5__insert_default_prompts.sql` —— 默认Prompt模板数据
|
||||
- **`V1.6__add_model_provider_columns.sql`** —— **【V6.0新增】为ai_analysis、agent_plans、prompt_render_logs增加model_provider字段**
|
||||
|
||||
### 5.5 软删除与数据生命周期
|
||||
|
||||
- **软删除**:`issues` 表使用 `is_deleted` 字段标记。
|
||||
- **归档策略**:超过3年的已关闭指摘迁移至 `issues_archive` 表。
|
||||
- **清理策略**:
|
||||
- `issue_logs`保留2年。
|
||||
- `notifications`保留1年。
|
||||
- `tool_executions`保留1年。
|
||||
- `knowledge_search_logs`保留6个月。
|
||||
- `prompt_render_logs`保留30天(可配置)。
|
||||
|
||||
|
||||
## 6. 异步任务与Agent执行架构(V6.0调整)
|
||||
|
||||
### 6.1 线程池配置
|
||||
|
||||
```java
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class AsyncConfig implements AsyncConfigurer {
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(10);
|
||||
executor.setMaxPoolSize(50);
|
||||
executor.setQueueCapacity(1000);
|
||||
executor.setKeepAliveSeconds(60);
|
||||
executor.setThreadNamePrefix("async-exec-");
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 6.2 Agent执行流程(V6.0:基于Spring AI ChatModel接口)
|
||||
|
||||
```java
|
||||
@Service
|
||||
public class AgentOrchestratorService {
|
||||
|
||||
@Autowired
|
||||
private ChatModel chatModel; // 由配置注入(Ollama或DeepSeek)
|
||||
@Autowired
|
||||
private EmbeddingModel embeddingModel; // 同上
|
||||
@Autowired
|
||||
private PromptTemplateEngine promptEngine;
|
||||
@Autowired
|
||||
private MemoryService memoryService;
|
||||
@Autowired
|
||||
private ToolRegistry toolRegistry;
|
||||
@Autowired
|
||||
private AgentPlanRepository planRepo;
|
||||
|
||||
@Async("asyncExecutor")
|
||||
public CompletableFuture<String> executeGoal(Long issueId, String goal, Long userId) {
|
||||
// 1. 创建规划记录
|
||||
AgentPlan plan = createPlan(issueId, goal, userId);
|
||||
// 记录当前使用的AI提供商
|
||||
plan.setModelProvider(provider); // provider从配置获取
|
||||
|
||||
// 2. 检索相似记忆
|
||||
List<AgentMemory> similarCases = memoryService.findSimilar(goal, 3);
|
||||
|
||||
// 3. 渲染系统角色+规划Prompt(包含格式适配)
|
||||
String systemPrompt = promptEngine.render("SYS_ROLE_001", buildSystemContext(userId));
|
||||
String planPrompt = promptEngine.render("PLAN_001", Map.of(
|
||||
"userGoal", goal,
|
||||
"issueContext", buildIssueContext(issueId),
|
||||
"similarCases", formatCases(similarCases),
|
||||
"availableTools", listAvailableTools(userId),
|
||||
"executedSteps", "[]",
|
||||
"currentStep", 1,
|
||||
"maxSteps", 10
|
||||
));
|
||||
// promptEngine.render() 已返回经过格式适配的完整Prompt
|
||||
String fullPrompt = systemPrompt + "\n\n---\n\n" + planPrompt;
|
||||
|
||||
// 4. ReAct循环
|
||||
int maxSteps = 10;
|
||||
String context = fullPrompt;
|
||||
|
||||
while (maxSteps-- > 0) {
|
||||
// 4.1 调用AI引擎(ChatModel)
|
||||
String response = chatModel.call(context);
|
||||
// 记录输入输出token(如有)
|
||||
// 4.2 解析工具调用(从文本JSON提取)
|
||||
ToolCallRequest toolCall = parseToolCall(response);
|
||||
|
||||
// 4.3 判断是否需要审批
|
||||
if ("request_human_approval".equals(toolCall.getToolName())) {
|
||||
plan.setStatus(PlanStatus.HUMAN_REVIEW);
|
||||
plan.setRequiresApproval(true);
|
||||
planRepo.save(plan);
|
||||
createApprovalTask(plan.getId(), toolCall.getArgs());
|
||||
break;
|
||||
}
|
||||
|
||||
// 4.4 加载工具专用Prompt并执行
|
||||
String toolPromptId = "TOOL_" + toolCall.getToolName().toUpperCase();
|
||||
// 渲染工具模板(预检查用)
|
||||
promptEngine.render(toolPromptId, Map.of(
|
||||
"goal", goal,
|
||||
"issueId", issueId,
|
||||
"parameters", toolCall.getArgs(),
|
||||
"similarCases", formatCases(similarCases)
|
||||
));
|
||||
// 执行工具
|
||||
ToolExecutionResult result = toolRegistry.execute(toolCall);
|
||||
saveToolExecution(plan.getId(), toolCall, result);
|
||||
|
||||
// 4.5 格式化输出(结构化)
|
||||
String formattedResult = formatOutput(result, toolCall.getToolName());
|
||||
|
||||
// 4.6 观察结果追加到上下文(用于下一轮)
|
||||
context += "\n\n观察结果:" + formattedResult;
|
||||
|
||||
// 4.7 判断是否完成
|
||||
if (result.isGoalCompleted()) {
|
||||
plan.setStatus(PlanStatus.DONE);
|
||||
plan.setCompletedAt(LocalDateTime.now());
|
||||
planRepo.save(plan);
|
||||
memoryService.saveMemory(issueId, plan);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CompletableFuture.completedFuture(plan.getId().toString());
|
||||
}
|
||||
|
||||
private ToolCallRequest parseToolCall(String response) {
|
||||
// 从响应中提取JSON,解析出tool和parameters
|
||||
// 使用Jackson或正则
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 6.3 Spring AI Ollama配置类(V6.0新增)
|
||||
|
||||
```java
|
||||
@Configuration
|
||||
public class AiProviderConfig {
|
||||
|
||||
@Value("${ai.provider:ollama}")
|
||||
private String provider;
|
||||
|
||||
@Value("${ollama.base-url:http://localhost:11434}")
|
||||
private String ollamaBaseUrl;
|
||||
|
||||
@Value("${ollama.chat.model:llama3.1:70b}")
|
||||
private String ollamaChatModel;
|
||||
|
||||
@Value("${ollama.embedding.model:nomic-embed-text}")
|
||||
private String ollamaEmbeddingModel;
|
||||
|
||||
@Value("${deepseek.api.key:}")
|
||||
private String deepseekApiKey;
|
||||
|
||||
@Value("${deepseek.model:deepseek-v4-pro}")
|
||||
private String deepseekModel;
|
||||
|
||||
@Value("${deepseek.embedding-model:text-embedding-3-small}")
|
||||
private String deepseekEmbeddingModel;
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnProperty(name = "ai.provider", havingValue = "ollama", matchIfMissing = true)
|
||||
public ChatModel ollamaChatModel() {
|
||||
OllamaApi api = new OllamaApi(ollamaBaseUrl);
|
||||
return new OllamaChatModel(api, OllamaOptions.create()
|
||||
.withModel(ollamaChatModel)
|
||||
.withTemperature(0.3)
|
||||
.withNumPredict(4096));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnProperty(name = "ai.provider", havingValue = "ollama", matchIfMissing = true)
|
||||
public EmbeddingModel ollamaEmbeddingModel() {
|
||||
OllamaApi api = new OllamaApi(ollamaBaseUrl);
|
||||
return new OllamaEmbeddingModel(api, OllamaOptions.create()
|
||||
.withModel(ollamaEmbeddingModel)
|
||||
.withNumPredict(512));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "ai.provider", havingValue = "deepseek")
|
||||
public ChatModel deepseekChatModel() {
|
||||
OpenAiApi api = new OpenAiApi("https://api.deepseek.com/v1", deepseekApiKey);
|
||||
return new OpenAiChatModel(api, OpenAiOptions.builder()
|
||||
.model(deepseekModel)
|
||||
.temperature(0.3)
|
||||
.build());
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "ai.provider", havingValue = "deepseek")
|
||||
public EmbeddingModel deepseekEmbeddingModel() {
|
||||
OpenAiApi api = new OpenAiApi("https://api.deepseek.com/v1", deepseekApiKey);
|
||||
return new OpenAiEmbeddingModel(api, OpenAiEmbeddingOptions.builder()
|
||||
.model(deepseekEmbeddingModel)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> **注意事项**:
|
||||
> - Spring AI 目前仍处于快速发展阶段,API 可能随版本升级发生变化。建议在实际代码中增加 `AiModelAdapter` 适配层接口,将 Spring AI 的 ChatModel/EmbeddingModel 调用封装在适配器之后,当 Spring AI 版本升级时只需修改适配器实现,不影响上层 AgentOrchestrator。
|
||||
> - `AiProviderConfig` 仅为示例代码,实际项目中需根据所选 Spring AI 版本调整具体 API 调用方式。
|
||||
|
||||
### 6.4 前端流式展示(V6.0增强)
|
||||
|
||||
前端通过 **Server-Sent Events (SSE)** 接收Agent思考链,新增AI引擎信息展示:
|
||||
|
||||
```typescript
|
||||
const eventSource = new EventSource(`/api/v1/agent/plan/${planId}/stream`);
|
||||
eventSource.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
// data.type: 'thought' | 'action' | 'observation' | 'result' | 'prompt_info' | 'model_info'【V6.0新增】
|
||||
|
||||
switch(data.type) {
|
||||
case 'thought':
|
||||
appendThought(data.content);
|
||||
break;
|
||||
case 'action':
|
||||
appendAction(data.tool, data.params);
|
||||
break;
|
||||
case 'observation':
|
||||
appendObservation(data.result);
|
||||
break;
|
||||
case 'result':
|
||||
appendResult(data.content);
|
||||
break;
|
||||
case 'prompt_info':
|
||||
showPromptInfo({
|
||||
templateId: data.templateId,
|
||||
version: data.version,
|
||||
variables: data.variables
|
||||
});
|
||||
break;
|
||||
case 'model_info': // V6.0新增
|
||||
showModelInfo({
|
||||
provider: data.provider, // 'ollama' 或 'deepseek'
|
||||
model: data.model,
|
||||
endpoint: data.endpoint
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
### 6.5 监控指标(V6.0新增)
|
||||
|
||||
| 指标名称 | 类型 | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| `async.executor.queue.size` | Gauge | 队列大小 |
|
||||
| `async.executor.active.count` | Gauge | 活跃线程数 |
|
||||
| `agent.task.duration` | Histogram | Agent任务执行耗时 |
|
||||
| `agent.tool.success.rate` | Gauge | 工具调用成功率 |
|
||||
| `knowledge.search.duration` | Histogram | 知识库检索耗时 |
|
||||
| `prompt.render.duration` | Histogram | Prompt模板渲染耗时 |
|
||||
| `prompt.render.count` | Counter | Prompt渲染次数(按模板ID分维度) |
|
||||
| `prompt.token.usage` | Histogram | 单次Prompt消耗的token数 |
|
||||
| `prompt.version.mismatch` | Counter | 缓存版本与数据库版本不一致次数 |
|
||||
| `llm.output.parse.error` | Counter | LLM输出JSON解析失败次数 |
|
||||
| **【V6.0新增】`ai.provider.current`** | **Gauge** | **当前使用的AI提供商(0=ollama, 1=deepseek)** |
|
||||
| **【V6.0新增】`ai.ollama.request.duration`** | **Histogram** | **Ollama请求耗时** |
|
||||
| **【V6.0新增】`ai.deepseek.request.duration`** | **Histogram** | **DeepSeek API请求耗时** |
|
||||
| **【V6.0新增】`ai.provider.switch.count`** | **Counter** | **提供商切换次数(自动降级)** |
|
||||
|
||||
|
||||
## 7. 接口设计
|
||||
|
||||
### 7.1 API 规范
|
||||
|
||||
- **协议与域名**:`https://api.domain.com`
|
||||
- **版本控制**:`/api/v1/`
|
||||
- **认证方式**:JWT(access_token 30min,refresh_token 7d)
|
||||
- **请求头**:`Authorization: Bearer <access_token>`
|
||||
- **统一返回结构**:
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"message": "success",
|
||||
"data": {},
|
||||
"timestamp": "2026-07-23T10:00:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
### 7.2 接口列表
|
||||
|
||||
| 模块 | 方法 | URL | 描述 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| **认证** | POST | `/api/v1/auth/login` | 用户登录 |
|
||||
| | POST | `/api/v1/auth/refresh` | 刷新令牌 |
|
||||
| | GET | `/api/v1/auth/me` | 获取当前用户信息 |
|
||||
| **用户部门** | GET | `/api/v1/users` | 用户列表 |
|
||||
| | GET | `/api/v1/departments` | 部门树 |
|
||||
| **指摘** | POST | `/api/v1/issues` | 创建指摘 |
|
||||
| | GET | `/api/v1/issues` | 指摘列表 |
|
||||
| | GET | `/api/v1/issues/{id}` | 指摘详情 |
|
||||
| | PUT | `/api/v1/issues/{id}` | 更新指摘 |
|
||||
| | POST | `/api/v1/issues/{id}/attachments` | 上传附件 |
|
||||
| **AI分析** | POST | `/api/v1/ai/batch-generate` | 批量生成AI分析 |
|
||||
| | GET | `/api/v1/ai/records` | 分析记录列表 |
|
||||
| | POST | `/api/v1/ai/records/{id}/feedback` | 提交反馈 |
|
||||
| **知识库** | GET | `/api/v1/knowledge/documents` | 文档列表 |
|
||||
| | POST | `/api/v1/knowledge/documents` | 上传文档 |
|
||||
| | DELETE | `/api/v1/knowledge/documents/{id}` | 删除文档 |
|
||||
| | POST | `/api/v1/knowledge/documents/{id}/reindex` | 重新向量化 |
|
||||
| | GET | `/api/v1/knowledge/search` | 测试检索 |
|
||||
| | GET | `/api/v1/knowledge/logs` | 检索审计日志 |
|
||||
| **导入导出** | GET | `/api/v1/issues/export` | 导出Excel |
|
||||
| | POST | `/api/v1/import/excel` | 上传校验Excel |
|
||||
| | POST | `/api/v1/import/confirm` | 确认导入 |
|
||||
| **Agent执行** | POST | `/api/v1/agent/execute` | 提交Agent目标 |
|
||||
| | GET | `/api/v1/agent/plan/{planId}/stream` | SSE流式思考链 |
|
||||
| | GET | `/api/v1/agent/plan/{planId}/status` | 查询状态 |
|
||||
| **Agent审批** | POST | `/api/v1/agent/approval/{planId}/approve` | 审批通过 |
|
||||
| | POST | `/api/v1/agent/approval/{planId}/reject` | 审批拒绝 |
|
||||
| **Agent记忆** | GET | `/api/v1/agent/memories` | 记忆列表 |
|
||||
| | POST | `/api/v1/agent/memories` | 新增记忆 |
|
||||
| | DELETE | `/api/v1/agent/memories/{id}` | 删除记忆 |
|
||||
| **Agent配置** | GET | `/api/v1/agent/config` | 获取配置 |
|
||||
| | PUT | `/api/v1/agent/config` | 更新配置 |
|
||||
| **通知** | GET | `/api/v1/notifications` | 通知列表 |
|
||||
| | PATCH | `/api/v1/notifications/{id}/read` | 标记已读 |
|
||||
| **Prompt模板** | GET | `/api/v1/prompts` | 模板列表 |
|
||||
| | GET | `/api/v1/prompts/{templateId}` | 模板详情 |
|
||||
| | POST | `/api/v1/prompts` | 创建模板 |
|
||||
| | PUT | `/api/v1/prompts/{templateId}` | 更新模板(创建新版本) |
|
||||
| | POST | `/api/v1/prompts/{templateId}/rollback` | 回滚到指定版本 |
|
||||
| | POST | `/api/v1/prompts/{templateId}/test` | 渲染测试 |
|
||||
| | GET | `/api/v1/prompts/{templateId}/versions` | 版本历史 |
|
||||
| **Prompt渲染日志** | GET | `/api/v1/prompts/logs` | 渲染日志列表 |
|
||||
| | GET | `/api/v1/prompts/logs/{logId}` | 渲染日志详情(含完整Prompt) |
|
||||
| | GET | `/api/v1/prompts/stats` | 模板使用统计 |
|
||||
| **【V6.0新增】AI配置** | GET | `/api/v1/ai/config` | 获取当前AI配置 |
|
||||
| | PUT | `/api/v1/ai/config` | 更新AI配置(模型、参数等) |
|
||||
| | POST | `/api/v1/ai/test` | 测试当前AI连接 |
|
||||
|
||||
|
||||
## 8. 安全设计
|
||||
|
||||
### 8.1 传输与接入安全
|
||||
- 全站强制 HTTPS。
|
||||
- Nginx 限流(`limit_req_zone`),防暴力破解和 CC 攻击。
|
||||
|
||||
### 8.2 认证与授权
|
||||
- JWT 短令牌(30min)+ 长刷新令牌(7d)。
|
||||
- Spring Security 过滤器验证 JWT,`@PreAuthorize` 进行功能权限校验。
|
||||
- AOP 注入数据权限过滤条件(部门隔离)。
|
||||
- Agent 工具调用权限基于角色动态过滤。
|
||||
- Prompt模板编辑权限基于角色分级控制。
|
||||
- **AI配置修改权限仅限超级管理员**。
|
||||
|
||||
### 8.3 攻击防护
|
||||
- **XSS**:React 自动转义 + OWASP Java HTML Sanitizer。
|
||||
- **CSRF**:JWT 机制天然防 CSRF。
|
||||
- **SQL注入**:Spring Data JPA 参数化查询。
|
||||
- **Prompt注入防护**:
|
||||
- 用户输入变量必须经过转义和长度限制。
|
||||
- 禁止用户输入中包含`{{}}`模板语法(防止模板注入)。
|
||||
- 敏感变量(密码、token等)禁止注入Prompt。
|
||||
- 所有用户输入变量在渲染日志中记录(脱敏后)。
|
||||
- **Ollama安全**:Ollama默认无认证,需通过Nginx反向代理增加Basic Auth或API Key验证,限制内网访问。
|
||||
|
||||
### 8.4 数据安全
|
||||
- 密码使用 `BCryptPasswordEncoder`(强度10)加盐哈希存储。
|
||||
- 知识库文档原文与向量:全部存储于本地 PostgreSQL + MinIO,永不外传。
|
||||
- DeepSeek API 调用:仅传输待向量化的文本片段或推理 Prompt,云端不留存任何数据。
|
||||
- **Ollama调用**:数据完全不出本地服务器,安全性最高。
|
||||
- Prompt渲染日志安全:
|
||||
- 完整Prompt仅保留30天(可配置)。
|
||||
- 日志中的敏感变量自动脱敏(正则匹配身份证号、手机号、密码等模式)。
|
||||
- 仅超级管理员可查看完整渲染日志。
|
||||
|
||||
### 8.5 Agent安全策略
|
||||
- **工具调用白名单**:基于角色动态过滤。
|
||||
- **高风险操作审批**:`close_issue`、`delete_issue`、跨部门 `assign_issue` 必须触发 `request_human_approval`。
|
||||
- **执行限流**:单用户每分钟最多 10 个 Agent 目标。
|
||||
- **思考链审计**:所有 Agent 推理过程持久化存储,保留 2 年。
|
||||
- **环境隔离**:生产环境默认禁止高风险自动执行。
|
||||
- **Prompt模板安全**:
|
||||
- 模板内容必须经过语法校验(防止模板语法错误导致渲染失败)。
|
||||
- 模板发布前必须经过审批(测试环境验证通过)。
|
||||
- 禁止模板中包含硬编码的API密钥、数据库连接串等敏感信息。
|
||||
- 模板变量必须进行类型校验(防止类型错误导致LLM输出异常)。
|
||||
|
||||
|
||||
## 9. 非功能需求
|
||||
|
||||
### 9.1 性能优化
|
||||
- 前端:路由懒加载,Ant Design 按需引入。
|
||||
- 后端:Redis 缓存热点数据,数据库联合索引,耗时操作异步化。
|
||||
- 数据库:定期 `VACUUM` 和 `ANALYZE`,慢查询日志分析。
|
||||
- 知识库检索:pgvector IVFFlat 索引,单次检索 < 200ms。
|
||||
> **注意事项**:pgvector 的 IVFFlat 索引在数据量超过 100 万条时召回率可能下降。初期数据量小可正常使用;后期若数据量增长较大,建议评估升级至 pgvectorscale 或迁移至专用向量数据库(如 Milvus、Qdrant)。
|
||||
- Prompt模板渲染:本地缓存 + Redis分布式缓存,渲染耗时 < 10ms。
|
||||
- Query改写:异步预渲染常用查询模板,减少LLM调用延迟。
|
||||
- **Ollama推理性能**:
|
||||
- 首次调用可能冷启动(~5-30s),建议保持模型常驻内存(`ollama serve`)。
|
||||
- 后续推理延迟取决于模型大小,70B模型约1-5s/token,需结合硬件(GPU)调优。
|
||||
- 可配置并发请求数,监控资源使用。
|
||||
|
||||
### 9.2 可用性与容错
|
||||
- Deepseek API 调用失败自动重试(最多3次,指数退避)。
|
||||
- **Ollama调用失败**:自动重试2次,若仍失败,记录错误并尝试切换到DeepSeek(若启用自动降级)。
|
||||
- 超过最大步数的 Agent 任务自动终止并记录错误。
|
||||
- 人工审批超时(48小时无响应)自动触发通知升级。
|
||||
- Prompt模板加载失败容错:
|
||||
- 如数据库模板加载失败,使用本地文件系统备份模板。
|
||||
- 如指定版本模板不存在,自动回退到最新稳定版本。
|
||||
- 如模板渲染失败,记录错误并使用通用Fallback模板。
|
||||
- LLM输出解析失败容错:
|
||||
- JSON解析失败时,尝试使用正则提取关键字段。
|
||||
- 如仍失败,标记为"low confidence"并请求人工确认。
|
||||
- 记录解析失败案例,用于优化Prompt模板。
|
||||
- **模型切换容错**:支持热切换,无需重启服务。
|
||||
|
||||
### 9.3 可观测性
|
||||
- Prometheus + Grafana:JVM、应用性能、数据库连接池、Agent 任务指标、Ollama服务状态。
|
||||
- ELK:集中日志管理(含 Agent 思考链日志)。
|
||||
- Sentry:异常捕获与告警。
|
||||
- Prompt工程专项监控:
|
||||
- 各Prompt模板的使用频率、成功率、平均耗时。
|
||||
- LLM输出结构化成功率(按模板分维度)。
|
||||
- Query改写成功率与改写质量评分。
|
||||
- A/B测试效果对比(不同模板版本的输出质量)。
|
||||
- **Ollama专项监控**:
|
||||
- 服务可用性(通过`/api/tags`端点探活)。
|
||||
- 响应时间分布。
|
||||
- 并发请求数。
|
||||
- 模型加载/卸载事件。
|
||||
|
||||
|
||||
## 10. 运维、部署与CI/CD
|
||||
|
||||
### 10.1 环境与部署
|
||||
- **开发环境**:Docker Compose 一键启动(PostgreSQL+Redis+MinIO+Ollama+Spring Boot+React)。
|
||||
- **测试/生产环境**:Docker Compose + Nginx 负载均衡,Ollama可单独部署在多台GPU服务器。
|
||||
- **对象存储**:MinIO(全部本地部署)。
|
||||
|
||||
### 10.2 环境变量(V6.0)
|
||||
|
||||
```properties
|
||||
# AI 提供商选择(ollama 或 deepseek)
|
||||
AI_PROVIDER=ollama
|
||||
|
||||
# Ollama 配置
|
||||
OLLAMA_BASE_URL=http://192.168.1.100:11434
|
||||
OLLAMA_CHAT_MODEL=llama3.1:70b
|
||||
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
|
||||
OLLAMA_CHAT_OPTIONS_TEMPERATURE=0.3
|
||||
OLLAMA_CHAT_OPTIONS_NUM_PREDICT=4096
|
||||
|
||||
# DeepSeek 配置(当 AI_PROVIDER=deepseek 时生效)
|
||||
DEEPSEEK_API_KEY=sk-xxx
|
||||
DEEPSEEK_MODEL=deepseek-v4-pro
|
||||
DEEPSEEK_EMBEDDING_MODEL=text-embedding-3-small
|
||||
|
||||
# 自动降级开关
|
||||
AI_AUTO_FALLBACK_ENABLED=true
|
||||
|
||||
# Agent 配置
|
||||
AGENT_MAX_STEPS=10
|
||||
AGENT_AUTO_EXECUTE_HIGH_RISK=false
|
||||
|
||||
# 知识库切片参数
|
||||
KNOWLEDGE_CHUNK_SIZE=500
|
||||
KNOWLEDGE_CHUNK_OVERLAP=50
|
||||
KNOWLEDGE_MAX_UPLOAD_SIZE=52428800
|
||||
|
||||
# Prompt工程配置
|
||||
PROMPT_TEMPLATE_CACHE_TTL=3600
|
||||
PROMPT_RENDER_LOG_RETENTION_DAYS=30
|
||||
PROMPT_DEFAULT_SYSTEM_TEMPLATE=SYS_ROLE_001
|
||||
PROMPT_OUTPUT_FORMAT_ENFORCED=true
|
||||
PROMPT_QUERY_REWRITE_ENABLED=true
|
||||
PROMPT_AB_TEST_ENABLED=true
|
||||
```
|
||||
|
||||
### 10.3 CI/CD(Jenkins)
|
||||
1. 代码提交触发构建。
|
||||
2. 执行 Lint、单元测试。
|
||||
3. Prompt模板语法校验(自动化测试)。
|
||||
4. 构建 Docker 镜像,推送至 Harbor。
|
||||
5. Ansible 更新测试环境。
|
||||
6. **部署前检查Ollama服务是否可达**。
|
||||
7. Prompt模板自动化测试(渲染测试、变量校验)。
|
||||
8. 生产环境蓝绿部署。
|
||||
|
||||
### 10.4 监控告警
|
||||
- Prometheus + Grafana 监控应用与Ollama服务健康状态。
|
||||
- 当Ollama响应时间超过阈值或错误率 >5% 触发告警。
|
||||
- Prompt模板异常告警:模板渲染失败率 > 1% 触发告警;LLM输出解析失败率 > 5% 触发告警。
|
||||
- **模型切换事件告警**:当自动降级触发时,发送告警通知管理员。
|
||||
|
||||
|
||||
## 11. 项目计划与团队分工(V6.0调整)
|
||||
|
||||
项目周期:**2026年7月6日 至 2026年8月7日**(5周),团队7人。
|
||||
|
||||
### 11.1 团队分组
|
||||
|
||||
| 组别 | 成员数 | 负责模块 |
|
||||
|------|--------|----------|
|
||||
| **第一组(核心业务组)** | 3人 | 登录、工作台(含Agent快捷指令)、指摘列表(含Agent批量处理)、指摘详情(Agent驾驶舱)、附件、状态流转 |
|
||||
| **第二组(业务支撑组)** | 2人 | 批量录入(含Agent智能校验)、用户管理(含Agent自动执行权限)、角色权限(含Agent工具权限)、**Prompt模板管理后台**、**AI配置管理界面(V6.0新增)** |
|
||||
| **第三组(知识库与后台组)** | 2人 | AI智能分析管理(分析记录)、知识库管理(文档上传/解析/向量化/检索审计)、**Prompt引擎核心实现**、**Spring AI集成与Ollama适配(V6.0新增)**、**向量化服务重构(V6.0新增)**、系统日志(含Agent操作日志分类) |
|
||||
|
||||
### 11.2 里程碑
|
||||
|
||||
| 阶段 | 时间 | 主要任务 |
|
||||
|------|------|----------|
|
||||
| **阶段1:设计** | 7/6-7/10 | 统一技术栈、接口文档、数据库设计(含pgvector)、Prompt模板体系设计、**Ollama部署方案设计、Spring AI配置设计**、项目骨架 |
|
||||
| **阶段2:开发** | 7/13-7/24 | 各组并行开发;第一组实现AgentOrchestrator及核心工具;第二组实现Prompt模板管理后台、**AI配置管理界面**;**第三组重点实现Ollama集成、嵌入模型切换、格式适配器** |
|
||||
| **阶段3:联调** | 7/27-7/31 | 前后端联调、Agent端到端测试(含Ollama和DeepSeek双模式)、Prompt模板A/B测试、知识库检索准确性测试 |
|
||||
| **阶段4:交付** | 8/3-8/7 | 全流程回归、性能优化、Prompt模板效果评估与调优、**Ollama性能调优**、用户手册、部署演示环境 |
|
||||
|
||||
|
||||
## 12. 最终交付物清单(V6.0)
|
||||
|
||||
1. ✅ 全部源代码(前端 React + 后端 Spring Boot)
|
||||
2. ✅ 数据库建表脚本(含 pgvector、Agent表、知识库表、Prompt模板表)
|
||||
3. ✅ 数据库 ER 图
|
||||
4. ✅ 接口文档(OpenAPI 3.0)
|
||||
5. ✅ 部署说明文档(Docker Compose、环境变量配置、**Ollama部署手册**)
|
||||
6. ✅ 用户操作手册(含 Agent 指令示例)
|
||||
7. ✅ 测试报告(单元测试、集成测试、端到端测试)
|
||||
8. ✅ Agent 工具集文档
|
||||
9. ✅ Prompt模板体系文档(含所有模板定义、变量说明、使用场景)
|
||||
10. ✅ Prompt工程最佳实践手册(含模板设计规范、A/B测试方法、效果评估指标)
|
||||
11. ✅ Agent 人工审批操作手册
|
||||
12. ✅ 知识库管理操作手册(含文档上传、向量化、检索测试说明)
|
||||
13. ✅ UI交互原型文件(静态HTML演示,含10个核心页面 + Prompt模板管理后台 + **AI配置页面**)
|
||||
14. ✅ **Ollama+DeepSeek混合架构配置与运维指南(新增)**
|
||||
15. ✅ **模型切换与容灾演练报告(新增)**
|
||||
|
||||
---
|
||||
|
||||
**文档结束**
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
## 2026-07-23
|
||||
|
||||
| # | 内容 | 理由 |
|
||||
|---|------|------|
|
||||
| 1 | **技术栈版本不锁定具体小版本号**。设计文档中的 Vite 8.1.2、Ant Design 6.5.0 等细化版本在 2026.7 可能不存在或不是最新,建项目时用大版本范围(如 Vite ^7.0.0)取当时最新稳定版即可 | 避免因等待特定版本号导致开发阻塞 |
|
||||
| 2 | **Ollama 70B 模型需评估硬件条件**。llama3.1:70b 需要至少 48GB VRAM,如公司只有单卡 24GB 显卡需准备降级方案,同时考虑 qwen2.5:32b 或 llama3.1:8b 作为备选 | 70B 模型对 GPU 要求过高,实际硬件可能无法支撑实时推理 |
|
||||
| 3 | **Spring AI 成熟度风险**。Spring AI 是较新项目(2024 年出 1.0),API 可能变化,需在代码中预留适配层抽象 | 避免 Spring AI 版本升级导致阻塞开发 |
|
||||
| 4 | **Ollama / DeepSeek 双引擎输出一致性**。ChatML 格式与 DeepSeek 原生格式的 Prompt 渲染结果可能质量不一致,需两层适配:格式适配 + 必要时对两个模型分别调参 | 保证跨模型输出行为稳定可控 |
|
||||
| 5 | **pgvector 1536 维 IVFFlat 索引在大数据集下召回率下降**。初期数据量小无问题,后期数据量大(>100万条)可考虑升级 pgvectorscale 或换专门向量库 | 确保向量检索长期性能 |
|
||||
| 6 | **项目结构改为 backend/ + frontend/ 分离**。前后端构建方式不同(Maven vs npm),部署环境不同(JRE vs Nginx),平级放在同一 Git 仓库但各自独立 | 避免构建工具链相互干扰,部署时可独立扩缩容 |
|
||||
| 7 | **AuthController 真实实现放在 ims-web 模块,其余 Controller 在 ims-api 为存根**。ims-api 只依赖 ims-common,不依赖 ims-service,无法访问 UserRepository、PasswordEncoder | 避免模块间循环依赖,同时保持架构分层清晰 |
|
||||
| 8 | **JwtUtil 移除 @Component/@Value 注解,改为普通构造函数 + @Configuration 工厂方法**。ims-common 不应依赖 Spring Context,保持轻量 | 使 ims-common 成为纯 POJO 模块,不依赖 Spring 框架 |
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
# 知识库模块实施计划
|
||||
|
||||
## 技术选型
|
||||
|
||||
| 项目 | 选择 |
|
||||
|------|------|
|
||||
| 文档解析 | Apache Tika(一个依赖支持 PDF/Word/TXT/MD) |
|
||||
| 向量化引擎 | Ollama(默认 `nomic-embed-text`)或 DeepSeek(`text-embedding-3-small`),**前端可切换** |
|
||||
| 向量存储 | PostgreSQL + pgvector(已有) |
|
||||
| 文件存储 | MinIO(已有) |
|
||||
| 切片策略 | 500 Token,10% 重叠 |
|
||||
|
||||
## 实施步骤
|
||||
|
||||
### Step 0:AI 配置管理(前置)
|
||||
|
||||
| 端 | 内容 |
|
||||
|----|------|
|
||||
| 后端新增 | `AiConfigService` — 读取/写入 AI 配置(provider、模型名、API Key),存入 Redis |
|
||||
| 后端实现 | `AiConfigController` 的 get/put/test 三个方法 |
|
||||
| 后端改动 | `EmbeddingService` 每次调用前查配置,根据 provider 路由到 Ollama 或 DeepSeek |
|
||||
| 前端新增 | 知识库页内加"Embedding 配置"区域:Provider 下拉框(Ollama / DeepSeek)+ 模型名输入框 |
|
||||
|
||||
### Step 1:添加依赖
|
||||
|
||||
修改 `ims-service/pom.xml`,新增依赖:
|
||||
|
||||
| 依赖 | 用途 |
|
||||
|------|------|
|
||||
| `org.apache.tika:tika-core` | 文档解析 |
|
||||
| `org.springframework.ai:spring-ai-ollama-spring-boot-starter` | Ollama Embedding 调用 |
|
||||
|
||||
### Step 2:创建 Service 接口 + 实现(8 个新文件)
|
||||
|
||||
| 文件 | 包路径 | 说明 |
|
||||
|------|--------|------|
|
||||
| `EmbeddingService.java` | `com.ims.service.knowledge` | 接口:`embed(text)` + `search(query, topK)` |
|
||||
| `AiConfigService.java` | `com.ims.service.knowledge` | AI 配置读写,存入 Redis |
|
||||
| `OllamaEmbeddingService.java` | `com.ims.service.knowledge` | 调用 Ollama 实现 Embedding |
|
||||
| `DeepSeekEmbeddingService.java` | `com.ims.service.knowledge` | 调用 DeepSeek API 实现 Embedding |
|
||||
| `DocumentParserService.java` | `com.ims.service.knowledge` | Tika 解析 + 500 Token 切片 |
|
||||
| `KnowledgeService.java` | `com.ims.service.knowledge` | 上传→MinIO→DB、列表、删除、重新索引 |
|
||||
| `SearchService.java` | `com.ims.service.knowledge` | pgvector 余弦相似度检索 |
|
||||
| `SearchLogService.java` | `com.ims.service.knowledge` | 检索审计日志记录 |
|
||||
|
||||
### Step 3:实现 Controller
|
||||
|
||||
| Controller | 方法 | 功能 |
|
||||
|-----------|------|------|
|
||||
| `AiConfigController` | `GET /api/v1/ai/config` | 读取 AI 配置 |
|
||||
| | `PUT /api/v1/ai/config` | 更新 AI 配置 |
|
||||
| | `POST /api/v1/ai/config/test` | 测试连接 |
|
||||
| `KnowledgeController` | `GET /documents` | 文档列表(分页) |
|
||||
| | `POST /documents` | 上传文档 → 解析 → 切片 → 向量化 → 入库 |
|
||||
| | `DELETE /documents/{id}` | 删除文档 + MinIO 文件 + 向量 |
|
||||
| | `POST /documents/{id}/reindex` | 重新向量化 |
|
||||
| | `GET /search` | 检索接口 |
|
||||
| | `GET /logs` | 检索日志列表 |
|
||||
|
||||
### Step 4:前端知识库页面
|
||||
|
||||
修改 `frontend/src/pages/knowledge-base/index.tsx`:
|
||||
|
||||
| 组件 | 参考设计 |
|
||||
|------|---------|
|
||||
| Tab 切换 | 文档管理 / 检索审计 |
|
||||
| Embedding 配置区 | Provider 下拉框(Ollama / DeepSeek)+ 模型名输入框 |
|
||||
| 上传拖拽区 | Ant Design `Upload.Dragger` |
|
||||
| 文档表格 | Ant Design `Table`(文件名/上传人/时间/状态/分块数/操作) |
|
||||
| 搜索框 | Ant Design `Input.Search` |
|
||||
| 检索日志表格 | Ant Design `Table` |
|
||||
| 统计卡片 | Ant Design `Card` + `Statistic` |
|
||||
|
||||
### Step 5:配置
|
||||
|
||||
| 项目 | 操作 |
|
||||
|------|------|
|
||||
| Ollama 模型 | `ollama pull nomic-embed-text` |
|
||||
| MinIO bucket | 管理后台创建 `ims-attachments` |
|
||||
|
||||
## 文件清单
|
||||
|
||||
```
|
||||
修改:
|
||||
backend/ims-service/pom.xml +2 依赖
|
||||
backend/ims-api/src/main/java/.../AiConfigController.java 填充 3 个方法
|
||||
backend/ims-api/src/main/java/.../KnowledgeController.java 填充 6 个方法
|
||||
frontend/src/pages/knowledge-base/index.tsx 重写
|
||||
|
||||
新增(后端):
|
||||
backend/ims-service/src/main/java/com/ims/service/knowledge/
|
||||
├── EmbeddingService.java
|
||||
├── AiConfigService.java
|
||||
├── OllamaEmbeddingService.java
|
||||
├── DeepSeekEmbeddingService.java
|
||||
├── DocumentParserService.java
|
||||
├── KnowledgeService.java
|
||||
├── SearchService.java
|
||||
└── SearchLogService.java
|
||||
|
||||
新增(前端):
|
||||
frontend/src/pages/knowledge-base/services.ts API 封装
|
||||
```
|
||||
|
||||
## 实施顺序
|
||||
|
||||
```
|
||||
前置条件(你手动执行)
|
||||
① ollama pull nomic-embed-text(如果用 DeepSeek 则跳过)
|
||||
② MinIO 创建 ims-attachments bucket
|
||||
③ 如需 DeepSeek 则准备 API Key
|
||||
↓
|
||||
代码实施(我写)
|
||||
Step 0: AiConfigService + AiConfigController + 前端配置区
|
||||
Step 1: pom.xml 加依赖 → mvn install 验证
|
||||
Step 2: 8 个 Service 文件
|
||||
Step 3: 填充 Controller
|
||||
Step 4: 前端页面 + services.ts
|
||||
↓
|
||||
验证
|
||||
① 启动后端 + 前端
|
||||
② 配置页选择 Ollama + nomic-embed-text → 保存
|
||||
③ 上传一个 PDF → 检查是否解析/切片/向量化成功
|
||||
④ 检索 → 检查返回结果
|
||||
⑤ 查看审计日志
|
||||
⑥ 切到 DeepSeek 重新索引 → 验证 DeepSeek 向量化
|
||||
```
|
||||
@@ -0,0 +1,104 @@
|
||||
# 知识库模块使用说明
|
||||
|
||||
## 已实现功能
|
||||
|
||||
| 功能 | 说明 |
|
||||
|------|------|
|
||||
| 文档上传 | 支持 PDF / Word(.docx/.doc) / TXT / Markdown / Excel(.xlsx/.xls) 拖拽上传 |
|
||||
| 文本解析 | Apache Tika 自动提取 PDF/Word,Apache POI 提取 Excel |
|
||||
| 文本切片 | 按 200 Token 切片,40 Token 重叠 |
|
||||
| 向量化 | 调用 Ollama 或 DeepSeek Embedding API 转为向量 |
|
||||
| 向量存储 | PostgreSQL pgvector |
|
||||
| 语义检索 | 余弦相似度检索,按相关性排序返回 Top 5 |
|
||||
| 文档管理 | 列表查看、删除、重新索引 |
|
||||
| 检索审计 | 记录每次检索的关键词、耗时、命中数 |
|
||||
| Embedding 配置 | 前端可切换 Ollama / DeepSeek,可修改模型名和 API Key |
|
||||
|
||||
## 功能界面位置
|
||||
|
||||
左侧菜单 → **知识库管理**(路径 `/knowledge-base`)
|
||||
|
||||
页面分两个 Tab:
|
||||
|
||||
- **文档管理** — 上传、搜索、文档列表
|
||||
- **检索审计** — 检索日志和统计
|
||||
|
||||
## 操作步骤
|
||||
|
||||
### 上传文档
|
||||
|
||||
1. 打开知识库管理页面
|
||||
2. 在虚线区域**拖拽文件**或**点击选择文件**
|
||||
3. 系统自动处理:解析 → 切片 → 向量化 → 入库
|
||||
4. 文档列表中状态变为 `completed` 即完成
|
||||
|
||||
支持格式:`.pdf` `.docx` `.doc` `.txt` `.md` `.xlsx` `.xls`,单文件不超过 50MB
|
||||
|
||||
### 检索知识库
|
||||
|
||||
1. 在文档管理页的搜索框中输入关键词或自然语言问题
|
||||
2. 按回车搜索
|
||||
3. 下方显示匹配结果、来源文件名和相似度百分比(越高越匹配)
|
||||
4. 注意:即使搜索词与文档用词不完全一致,语义相近也能搜到
|
||||
|
||||
> 相似度低于 50% 的结果通常不相关,因为搜索始终返回 Top 5,没有相关结果时也会"矮子里拔将军"。
|
||||
|
||||
### 切换 Embedding 模型
|
||||
|
||||
1. 点击页面右上角 **"Embedding 配置"** 按钮
|
||||
2. 在弹出的窗口中:
|
||||
- 选择 AI 提供商(Ollama / DeepSeek)
|
||||
- Ollama:填入 Ollama 地址和模型名(默认 `nomic-embed-text`)
|
||||
- DeepSeek:填入模型名(默认 `text-embedding-3-small`)和 API Key
|
||||
3. 点击保存
|
||||
|
||||
> 配置保存在 Redis 中,有效期 24 小时。未配置时使用 `application.yml` 的默认值。
|
||||
|
||||
### 删除文档
|
||||
|
||||
1. 在文档列表中点击对应行的 **"删除"** 按钮
|
||||
2. 确认后删除文档及其向量数据
|
||||
|
||||
### 重新索引
|
||||
|
||||
1. 在文档列表中点击对应行的 **"重新索引"** 按钮
|
||||
2. 系统重新执行解析 → 切片 → 向量化流程
|
||||
|
||||
## 前提条件
|
||||
|
||||
| 组件 | 状态要求 |
|
||||
|------|---------|
|
||||
| PostgreSQL + pgvector | 已运行(`docker compose up -d`) |
|
||||
| MinIO | 已运行,`ims-attachments` bucket 已创建 |
|
||||
| Ollama 或 DeepSeek | 至少一个可用(Ollama 需已拉取 `nomic-embed-text`) |
|
||||
| 后端 | 已启动(端口 8080) |
|
||||
| 前端 | 已启动(端口 5173) |
|
||||
|
||||
## 验证流程
|
||||
|
||||
1. 打开 `http://localhost:5173`,用 `admin / Admin@2026` 登录
|
||||
2. 左侧菜单 → 知识库管理
|
||||
3. 点击右上角 **"Embedding 配置"**,确认提供商已正确配置
|
||||
4. 上传一个 `.txt` 文件
|
||||
5. 等待状态变为 `completed`
|
||||
6. 在搜索框输入关键词,验证是否能匹配到文档内容
|
||||
|
||||
## 常见问题
|
||||
|
||||
| 问题 | 原因 | 解决 |
|
||||
|------|------|------|
|
||||
| 上传失败:bucket 不存在 | MinIO 未创建 bucket | 打开 `http://localhost:9001` 登录 minioadmin 创建 `ims-attachments` |
|
||||
| 上传失败:Ollama 连接拒绝 | Ollama 地址配置不对 | 见下方"Ollama 地址怎么配" |
|
||||
| 上传失败:状态显示 `failed` | 解析或向量化出错 | 鼠标悬停查看错误信息,根据提示处理 |
|
||||
| 上传失败:HTTP 500 | 后端异常 | 检查后端终端日志,常见原因:依赖版本冲突(执行 `mvn install -DskipTests -U` 后重启) |
|
||||
| 检索返回空 | 文档状态不是 `completed` | 等待文档处理完成 |
|
||||
| 检索结果乱码或相似度低 | 之前失败时存入了二进制乱码 | 删除该文档,重新上传 |
|
||||
| Token 过期跳登录 | 超过 30 分钟未操作 | 重新登录即可(已配置自动刷新) |
|
||||
|
||||
### Ollama 地址怎么配?
|
||||
|
||||
Ollama 已集成在 Docker Compose 中,地址固定为 `http://localhost:11434`。
|
||||
|
||||
如果在前端 Embedding 配置中手动填写,填此地址即可。默认 `application.yml` 中已配置为 `localhost:11434`,一般无需修改。
|
||||
|
||||
> 如果地址不对,上传任何文件都会在 Embedding 步骤报错,日志中显示 `Ollama embedding failed`。
|
||||
Reference in New Issue
Block a user