Compare commits
40 Commits
68d9767bd8
...
feature/wo
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ede6f4ba0 | |||
| 195d219f91 | |||
| 536ad8386c | |||
| 10519e7500 | |||
| 79d0a2a9fe | |||
| 20bf8138a8 | |||
| 1c0e966b7a | |||
| 57ca523b5a | |||
| f72508aa83 | |||
| 61577be41f | |||
| 1baef251ab | |||
| b25a1457af | |||
| 85845b0d38 | |||
| 075bf22add | |||
| 52340fcd94 | |||
| 10d6ce2b0d | |||
| 58d5713ec1 | |||
| cb6c881365 | |||
| ffaf04982a | |||
| 28d81d86bd | |||
| 0b958a0ebb | |||
| c13e01c902 | |||
| c8ad78ab44 | |||
| 04a8912307 | |||
| 495fde42ca | |||
| 5363613a7d | |||
| fc54bcd3d6 | |||
| 4a8bc3cb7a | |||
| 367cd98018 | |||
| ee8ba0a5d9 | |||
| 56e1517743 | |||
| eea5874dbf | |||
| 6ef063ac09 | |||
| c37710af3d | |||
| c52d31c16e | |||
| 48a4636a81 | |||
| 9c03013c44 | |||
| 05a0e35891 | |||
| 937d1e9373 | |||
| af3f0678b8 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,8 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
/dist
|
/dist
|
||||||
|
|
||||||
|
# Vue language service / accidental transpile artifacts
|
||||||
src/**/*.vue.js
|
src/**/*.vue.js
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
110
CLAUDE.md
110
CLAUDE.md
@@ -1,110 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Project Overview
|
|
||||||
|
|
||||||
This is the **GFast UI** project (`gfast-ui`), a Vue 3 admin management system based on the vue-next-admin template, customized for a digital advertising/trading platform.
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
- `npm install` - Install dependencies (use `npm install --registry=https://registry.npmmirror.com` for China mainland)
|
|
||||||
- `npm run dev` - Start development server
|
|
||||||
- `npm run build` - Build for production
|
|
||||||
- `npm run lint` - Run ESLint check
|
|
||||||
- `npm run lint-fix` - Fix ESLint issues automatically
|
|
||||||
- `npm run type-check` - Run TypeScript type checking
|
|
||||||
- `npm run quality` - Run both lint and type-check
|
|
||||||
|
|
||||||
## Architecture Overview
|
|
||||||
|
|
||||||
**Tech Stack:**
|
|
||||||
- Vue 3 with Composition API (script setup)
|
|
||||||
- TypeScript
|
|
||||||
- Vite
|
|
||||||
- Element Plus (UI framework)
|
|
||||||
- Pinia (state management)
|
|
||||||
- Vue Router (with hash mode)
|
|
||||||
- Axios (HTTP client)
|
|
||||||
- i18n (internationalization)
|
|
||||||
- mitt (event bus)
|
|
||||||
|
|
||||||
**Directory Structure:**
|
|
||||||
- `src/api/` - API client methods organized by business domain (ads, assets, cid, customerService, digitalHuman, knowledge, login, menu, settings, system, etc.)
|
|
||||||
- `src/components/` - Reusable Vue components
|
|
||||||
- `src/directives/` - Custom Vue directives
|
|
||||||
- `src/i18n/` - Internationalization configuration
|
|
||||||
- `src/layout/` - Main layout components
|
|
||||||
- `src/router/` - Route configuration
|
|
||||||
- `index.ts` - Router setup and guard
|
|
||||||
- `backEnd.ts` - Backend-controlled route initialization
|
|
||||||
- `frontEnd.ts` - Frontend-controlled route initialization
|
|
||||||
- `route.ts` - Static route definitions
|
|
||||||
- `src/stores/` - Pinia state stores
|
|
||||||
- `themeConfig.ts` - Theme and global configuration
|
|
||||||
- `userInfo.ts` - User information
|
|
||||||
- `routesList.ts` - Dynamic route management
|
|
||||||
- `keepAliveNames.ts` - keep-alive cache management
|
|
||||||
- `src/theme/` - Theme related styles
|
|
||||||
- `src/types/` - TypeScript type definitions
|
|
||||||
- `src/utils/` - Utility functions
|
|
||||||
- `request.ts` - Axios instance with interceptors, error handling, and token management
|
|
||||||
- `storage.ts` - Session storage wrapper
|
|
||||||
- `gfast.ts` - GFast-specific helpers (file URL construction, tree building, date formatting)
|
|
||||||
- `diffUtils.ts` - Field change detection for PUT requests
|
|
||||||
- `src/views/` - Page components organized by business module
|
|
||||||
|
|
||||||
**Key Patterns:**
|
|
||||||
|
|
||||||
1. **Routing**: Supports both frontend and backend controlled routing. When backend control is enabled (`isRequestRoutes: true` in themeConfig), routes are fetched from the backend and dynamically added.
|
|
||||||
|
|
||||||
2. **API Requests**:
|
|
||||||
- API methods are organized by domain in `src/api/` (each subdomain has its own directory structure)
|
|
||||||
- The Axios instance in `src/utils/request.ts` is pre-configured with:
|
|
||||||
- 50 second request timeout
|
|
||||||
- `qs` serialization of query parameters with dot notation for nested objects
|
|
||||||
- Automatically adds Bearer token (from cookies via Session utility) to all requests
|
|
||||||
- Automatically sends only changed fields for PUT requests (diff comparison with original data via `_originalData` field)
|
|
||||||
- Handles token expiration globally with redirect to login (prevents multiple overlapping popups)
|
|
||||||
- Provides error message extraction from multiple response formats (`message`, `msg`, `error`, `detail`)
|
|
||||||
- Error throttling: maximum one error message every 2 seconds
|
|
||||||
- Supports error mode configuration via `requestOptions.errorMode`:
|
|
||||||
- `global`: (default) Global error popup with backend message
|
|
||||||
- `page`: No automatic popup, reject the error for page-level handling
|
|
||||||
- `silent`: Completely silent, no error display
|
|
||||||
- Special handling for `code === 402`: Triggers module not enabled subscription flow (except for specific asset endpoints)
|
|
||||||
- Response format expects `code`, `message`/`msg`, and data. Known success codes: `0`, `200`.
|
|
||||||
- Use `getApiErrorMessage(error)` from `/@/utils/request` to extract user-friendly error messages in catch blocks when using `page` or `silent` mode.
|
|
||||||
|
|
||||||
3. **Global Properties & Components**:
|
|
||||||
- Helpers registered globally for template use:
|
|
||||||
- `getUpFileUrl`, `handleTree`, `useDict`, `selectDictLabel`, `parseTime`, `getItems`, `setItems`, `getOptionValue`, `isEmpty`
|
|
||||||
- Global components:
|
|
||||||
- `pagination` - Reusable pagination component
|
|
||||||
- Global plugins registered:
|
|
||||||
- `vue-simple-uploader` - Large file upload component
|
|
||||||
- Global event bus via mitt: `app.config.globalProperties.mittBus`
|
|
||||||
|
|
||||||
4. **Authentication**:
|
|
||||||
- Token is stored in cookies via `js-cookie` (through the `Session` utility). Other user session data is stored in `sessionStorage`.
|
|
||||||
- The `Session.clearAuth()` method only clears authentication-related keys (`token`, `userInfo`, `userMenu`, `permissions`), preserving other local preferences.
|
|
||||||
- 401 responses (HTTP or business code) containing token expiration signals trigger automatic logout with a single confirmation popup.
|
|
||||||
|
|
||||||
5. **Keep-alive**: Route components can be cached via keep-alive, managed by the `useKeepALiveNames` store.
|
|
||||||
|
|
||||||
## Environment Variables
|
|
||||||
|
|
||||||
- `.env.development` - Development environment settings
|
|
||||||
- `.env.production` - Production environment settings
|
|
||||||
- `VITE_API_URL` - Backend API base URL
|
|
||||||
- `VITE_PORT` - Dev server port
|
|
||||||
- `VITE_PUBLIC_PATH` - Public base path for production build
|
|
||||||
- `VITE_OPEN_CDN` - Enable CDN for external dependencies
|
|
||||||
|
|
||||||
## Development Notes
|
|
||||||
|
|
||||||
- The project uses `/@` alias for `src/`
|
|
||||||
- Components use the Composition API with `<script setup lang="ts">`
|
|
||||||
- Styling is done with SCSS
|
|
||||||
- ESLint enforces code quality
|
|
||||||
- Node version requirement: `>=16.0.0` (supported: v16.x ~ v20.x)
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# ==================== 第一阶段:构建前端 ====================
|
# ==================== 第一阶段:构建前端 ====================
|
||||||
FROM node:18-alpine AS builder
|
FROM docker.m.daocloud.io/node:18-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# 配置Alpine国内镜像源
|
# 配置Alpine国内镜像源
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
@@ -13,7 +13,7 @@ COPY . .
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# ==================== 第二阶段:部署到Nginx ====================
|
# ==================== 第二阶段:部署到Nginx ====================
|
||||||
FROM nginx:alpine
|
FROM docker.m.daocloud.io/nginx:alpine
|
||||||
|
|
||||||
# 复制构建产物
|
# 复制构建产物
|
||||||
COPY --from=builder /app/dist/ /usr/share/nginx/html/
|
COPY --from=builder /app/dist/ /usr/share/nginx/html/
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
FROM node:18-alpine
|
|
||||||
|
|
||||||
# 配置Alpine国内镜像源(加速apk)
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
RUN npm install --registry=https://registry.npmmirror.com
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
CMD ["npm", "run", "dev"]
|
|
||||||
82
ngnix.conf
82
ngnix.conf
@@ -1,6 +1,20 @@
|
|||||||
# Nginx 静态文件服务 + 智能代理
|
# Nginx 静态文件服务 + 智能代理 + 自定义 404 页面
|
||||||
|
|
||||||
# HTTP 重定向到 HTTPS
|
# Gitea 域名转发(HTTP)
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name gitea.redpowerfuture.com;
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
# MinIO 域名转发(HTTP)
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name minio.redpowerfuture.com;
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
# HTTP 重定向到 HTTPS(其他域名)
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
@@ -19,11 +33,27 @@ server {
|
|||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
|
|
||||||
|
# 自定义 404 页面,保持 404 状态码
|
||||||
|
error_page 404 /404.html;
|
||||||
|
|
||||||
|
location = /404.html {
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
# 根路径默认进入网页端
|
# 根路径默认进入网页端
|
||||||
location = / {
|
location = / {
|
||||||
return 302 /web/index.html;
|
return 302 /web/index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 兼容无斜杠访问
|
||||||
|
location = /web {
|
||||||
|
return 302 /web/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /sys {
|
||||||
|
return 302 /sys/;
|
||||||
|
}
|
||||||
|
|
||||||
# 网页端(public/web/index.html -> dist/web/index.html)
|
# 网页端(public/web/index.html -> dist/web/index.html)
|
||||||
location /web/ {
|
location /web/ {
|
||||||
alias /usr/share/nginx/html/web/;
|
alias /usr/share/nginx/html/web/;
|
||||||
@@ -33,7 +63,7 @@ server {
|
|||||||
# 后台管理端(dist/index.html,前缀 /sys/)
|
# 后台管理端(dist/index.html,前缀 /sys/)
|
||||||
location /sys/ {
|
location /sys/ {
|
||||||
alias /usr/share/nginx/html/;
|
alias /usr/share/nginx/html/;
|
||||||
try_files $uri $uri/ /sys/index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 1. 先尝试作为静态文件查找
|
# 1. 先尝试作为静态文件查找
|
||||||
@@ -60,3 +90,49 @@ server {
|
|||||||
proxy_read_timeout 30s;
|
proxy_read_timeout 30s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Gitea 域名转发(HTTPS)
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name gitea.redpowerfuture.com;
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/ssl/gitea.redpowerfuture.com.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/gitea.redpowerfuture.com.key;
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://gitea.redpowerfuture.com:3000;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_connect_timeout 30s;
|
||||||
|
proxy_send_timeout 30s;
|
||||||
|
proxy_read_timeout 30s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# MinIO 域名转发(HTTPS)
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name minio.redpowerfuture.com;
|
||||||
|
|
||||||
|
ssl_certificate /etc/nginx/ssl/minio.redpowerfuture.com.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/minio.redpowerfuture.com.key;
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://minio.redpowerfuture.com:9000;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_connect_timeout 30s;
|
||||||
|
proxy_send_timeout 30s;
|
||||||
|
proxy_read_timeout 30s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
212
public/404.html
Normal file
212
public/404.html
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>404 - 页面不存在</title>
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
color-scheme: light;
|
||||||
|
--bg-start: #f5f7fa;
|
||||||
|
--bg-end: #e8ecf3;
|
||||||
|
--card-bg: rgba(255, 255, 255, 0.92);
|
||||||
|
--text-primary: #1f2d3d;
|
||||||
|
--text-secondary: #6b7280;
|
||||||
|
--accent: #409eff;
|
||||||
|
--accent-hover: #66b1ff;
|
||||||
|
--border: rgba(64, 158, 255, 0.12);
|
||||||
|
--shadow: 0 20px 50px rgba(31, 45, 61, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
||||||
|
background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-page {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-card {
|
||||||
|
width: min(960px, 100%);
|
||||||
|
background: var(--card-bg);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 24px;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
display: flex;
|
||||||
|
gap: 48px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 56px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-code {
|
||||||
|
margin: 0;
|
||||||
|
font-size: clamp(64px, 12vw, 110px);
|
||||||
|
line-height: 1;
|
||||||
|
color: var(--accent);
|
||||||
|
letter-spacing: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-title {
|
||||||
|
margin: 20px 0 12px;
|
||||||
|
font-size: 30px;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-message {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-actions {
|
||||||
|
margin-top: 32px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button {
|
||||||
|
appearance: none;
|
||||||
|
border: none;
|
||||||
|
border-radius: 999px;
|
||||||
|
padding: 12px 22px;
|
||||||
|
font-size: 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button:hover {
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button.primary {
|
||||||
|
background: var(--accent);
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 12px 24px rgba(64, 158, 255, 0.24);
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button.primary:hover {
|
||||||
|
background: var(--accent-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button.secondary {
|
||||||
|
background: #fff;
|
||||||
|
color: var(--text-primary);
|
||||||
|
border: 1px solid rgba(31, 45, 61, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-illustration {
|
||||||
|
flex: 0 0 320px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustration-shell {
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 1 / 1;
|
||||||
|
border-radius: 32px;
|
||||||
|
background: linear-gradient(160deg, rgba(64, 158, 255, 0.12), rgba(64, 158, 255, 0.02));
|
||||||
|
border: 1px solid rgba(64, 158, 255, 0.14);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustration-shell::before,
|
||||||
|
.illustration-shell::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(64, 158, 255, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustration-shell::before {
|
||||||
|
width: 180px;
|
||||||
|
height: 180px;
|
||||||
|
top: -30px;
|
||||||
|
right: -30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustration-shell::after {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
left: -20px;
|
||||||
|
bottom: -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.illustration-center {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: clamp(72px, 10vw, 120px);
|
||||||
|
font-weight: 800;
|
||||||
|
color: rgba(64, 158, 255, 0.85);
|
||||||
|
letter-spacing: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.error-card {
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 36px 24px;
|
||||||
|
gap: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-illustration {
|
||||||
|
flex-basis: auto;
|
||||||
|
width: min(320px, 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-title {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="error-page">
|
||||||
|
<section class="error-card">
|
||||||
|
<div class="error-content">
|
||||||
|
<h1 class="error-code">404</h1>
|
||||||
|
<h2 class="error-title">抱歉,你访问的页面不存在</h2>
|
||||||
|
<p class="error-message">
|
||||||
|
当前地址可能已失效、输入有误,或者对应内容已被移动。你可以返回首页,或回到后台入口继续操作。
|
||||||
|
</p>
|
||||||
|
<div class="error-actions">
|
||||||
|
<a class="action-button primary" href="/">返回首页</a>
|
||||||
|
<a class="action-button secondary" href="/sys/">进入后台</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="error-illustration" aria-hidden="true">
|
||||||
|
<div class="illustration-shell">
|
||||||
|
<div class="illustration-center">404</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -12,7 +12,7 @@ export interface ApiInterfaceQueryParams {
|
|||||||
|
|
||||||
// 创建接口参数
|
// 创建接口参数
|
||||||
export interface CreateApiInterfaceParams {
|
export interface CreateApiInterfaceParams {
|
||||||
platformId: string | number;
|
platformId: number;
|
||||||
name: string;
|
name: string;
|
||||||
code: string;
|
code: string;
|
||||||
url: string;
|
url: string;
|
||||||
@@ -22,6 +22,7 @@ export interface CreateApiInterfaceParams {
|
|||||||
requestConfig?: Record<string, any>;
|
requestConfig?: Record<string, any>;
|
||||||
responseConfig?: Record<string, any>;
|
responseConfig?: Record<string, any>;
|
||||||
limitConfig?: Record<string, any>;
|
limitConfig?: Record<string, any>;
|
||||||
|
tableDefinition?: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新接口参数
|
// 更新接口参数
|
||||||
@@ -50,6 +51,7 @@ export interface ApiInterfaceInfo {
|
|||||||
requestConfig?: Record<string, any>;
|
requestConfig?: Record<string, any>;
|
||||||
responseConfig?: Record<string, any>;
|
responseConfig?: Record<string, any>;
|
||||||
limitConfig?: Record<string, any>;
|
limitConfig?: Record<string, any>;
|
||||||
|
tableDefinition?: Record<string, any>;
|
||||||
createdBy?: string;
|
createdBy?: string;
|
||||||
createdAt?: number;
|
createdAt?: number;
|
||||||
updatedBy?: string;
|
updatedBy?: string;
|
||||||
@@ -59,7 +61,7 @@ export interface ApiInterfaceInfo {
|
|||||||
// 获取接口列表
|
// 获取接口列表
|
||||||
export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/interface/controller/listApiInterfaces',
|
url: '/data-engine/api/interface/controller/listApiInterfaces',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -68,7 +70,7 @@ export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
|||||||
// 获取接口详情
|
// 获取接口详情
|
||||||
export function getApiInterface(id: string) {
|
export function getApiInterface(id: string) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/interface/controller/getApiInterface',
|
url: '/data-engine/api/interface/controller/getApiInterface',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id },
|
params: { id },
|
||||||
});
|
});
|
||||||
@@ -77,7 +79,7 @@ export function getApiInterface(id: string) {
|
|||||||
// 创建接口
|
// 创建接口
|
||||||
export function createApiInterface(data: CreateApiInterfaceParams) {
|
export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/interface/controller/createApiInterface',
|
url: '/data-engine/api/interface/controller/createApiInterface',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
@@ -86,7 +88,7 @@ export function createApiInterface(data: CreateApiInterfaceParams) {
|
|||||||
// 修改接口
|
// 修改接口
|
||||||
export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/interface/controller/updateApiInterface',
|
url: '/data-engine/api/interface/controller/updateApiInterface',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
@@ -95,7 +97,7 @@ export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
|||||||
// 更新接口状态
|
// 更新接口状态
|
||||||
export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/interface/controller/updateApiInterfaceStatus',
|
url: '/data-engine/api/interface/controller/updateApiInterfaceStatus',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
@@ -104,7 +106,7 @@ export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
|||||||
// 删除接口
|
// 删除接口
|
||||||
export function deleteApiInterface(id: string) {
|
export function deleteApiInterface(id: string) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/interface/controller/deleteApiInterface',
|
url: '/data-engine/api/interface/controller/deleteApiInterface',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
params: { id },
|
params: { id },
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ export interface CreateDatasourcePlatformParams {
|
|||||||
requestTimeoutMs?: number;
|
requestTimeoutMs?: number;
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
retryDelayMs?: number;
|
retryDelayMs?: number;
|
||||||
createdBy?: string;
|
authConfig?: Record<string, any>;
|
||||||
updatedBy?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新平台参数
|
// 更新平台参数
|
||||||
@@ -40,7 +39,6 @@ export interface UpdateDatasourcePlatformParams extends Partial<CreateDatasource
|
|||||||
export interface UpdateDatasourcePlatformStatusParams {
|
export interface UpdateDatasourcePlatformStatusParams {
|
||||||
id: string;
|
id: string;
|
||||||
Status: string;
|
Status: string;
|
||||||
updatedBy?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平台信息
|
// 平台信息
|
||||||
@@ -54,22 +52,25 @@ export interface DatasourcePlatformInfo {
|
|||||||
apiBaseUrl: string;
|
apiBaseUrl: string;
|
||||||
authType: string;
|
authType: string;
|
||||||
authTypeName: string;
|
authTypeName: string;
|
||||||
|
token?: string;
|
||||||
|
apiKey?: string;
|
||||||
|
clientId?: string;
|
||||||
|
clientSecret?: string;
|
||||||
|
authConfig?: Record<string, any>;
|
||||||
rateLimitPerMinute?: number;
|
rateLimitPerMinute?: number;
|
||||||
rateLimitPerHour?: number;
|
rateLimitPerHour?: number;
|
||||||
concurrencyLimit?: number;
|
concurrencyLimit?: number;
|
||||||
requestTimeoutMs?: number;
|
requestTimeoutMs?: number;
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
retryDelayMs?: number;
|
retryDelayMs?: number;
|
||||||
createdBy?: string;
|
|
||||||
createdAt?: number;
|
createdAt?: number;
|
||||||
updatedBy?: string;
|
|
||||||
updatedAt?: number;
|
updatedAt?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取平台列表
|
// 获取平台列表
|
||||||
export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/listDatasourcePlatforms',
|
url: '/data-engine/datasource/platform/controller/listDatasourcePlatforms',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
@@ -78,7 +79,7 @@ export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
|||||||
// 创建平台
|
// 创建平台
|
||||||
export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/createDatasourcePlatform',
|
url: '/data-engine/datasource/platform/controller/createDatasourcePlatform',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
@@ -87,7 +88,7 @@ export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
|||||||
// 更新平台
|
// 更新平台
|
||||||
export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/updateDatasourcePlatform',
|
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatform',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
@@ -96,7 +97,7 @@ export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
|||||||
// 删除平台
|
// 删除平台
|
||||||
export function deleteDatasourcePlatform(id: string) {
|
export function deleteDatasourcePlatform(id: string) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/deleteDatasourcePlatform',
|
url: '/data-engine/datasource/platform/controller/deleteDatasourcePlatform',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
params: { id },
|
params: { id },
|
||||||
});
|
});
|
||||||
@@ -105,7 +106,7 @@ export function deleteDatasourcePlatform(id: string) {
|
|||||||
// 获取平台详情
|
// 获取平台详情
|
||||||
export function getDatasourcePlatform(id: string) {
|
export function getDatasourcePlatform(id: string) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/getDatasourcePlatform',
|
url: '/data-engine/datasource/platform/controller/getDatasourcePlatform',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id },
|
params: { id },
|
||||||
});
|
});
|
||||||
@@ -114,7 +115,7 @@ export function getDatasourcePlatform(id: string) {
|
|||||||
// 根据编码获取平台信息
|
// 根据编码获取平台信息
|
||||||
export function getPlatformByCode(platformCode: string) {
|
export function getPlatformByCode(platformCode: string) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/getPlatformByCode',
|
url: '/data-engine/datasource/platform/controller/getPlatformByCode',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { platformCode },
|
params: { platformCode },
|
||||||
});
|
});
|
||||||
@@ -123,7 +124,7 @@ export function getPlatformByCode(platformCode: string) {
|
|||||||
// 更新平台状态
|
// 更新平台状态
|
||||||
export function updateDatasourcePlatformStatus(data: UpdateDatasourcePlatformStatusParams) {
|
export function updateDatasourcePlatformStatus(data: UpdateDatasourcePlatformStatusParams) {
|
||||||
return request({
|
return request({
|
||||||
url: '/datasource/platform/controller/updateDatasourcePlatformStatus',
|
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ export interface NodeLibraryItem {
|
|||||||
nodeName: string;
|
nodeName: string;
|
||||||
modelType: number;
|
modelType: number;
|
||||||
skillOption: boolean;
|
skillOption: boolean;
|
||||||
|
promptOption: boolean;
|
||||||
|
isSaveFile: boolean;
|
||||||
formConfig: NodeLibraryFormItem[];
|
formConfig: NodeLibraryFormItem[];
|
||||||
modelConfig: NodeLibraryModelConfig[];
|
modelConfig: NodeLibraryModelConfig[];
|
||||||
}
|
}
|
||||||
@@ -86,6 +88,7 @@ export interface ExecutionItem {
|
|||||||
timestamp: string;
|
timestamp: string;
|
||||||
content: string;
|
content: string;
|
||||||
label: string;
|
label: string;
|
||||||
|
type?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExecutionFlowItem {
|
export interface ExecutionFlowItem {
|
||||||
|
|||||||
@@ -119,18 +119,22 @@ export interface ModelModuleItem {
|
|||||||
/** 会话开关状态(列表接口返回,0 关 1 开;会话开关接口就绪后生效) */
|
/** 会话开关状态(列表接口返回,0 关 1 开;会话开关接口就绪后生效) */
|
||||||
chatSessionEnabled?: number;
|
chatSessionEnabled?: number;
|
||||||
enabled: number;
|
enabled: number;
|
||||||
|
/** 调用模式:0-同步 1-异步 2-流式 */
|
||||||
|
callMode?: number;
|
||||||
maxConcurrency: number;
|
maxConcurrency: number;
|
||||||
queueLimit: number;
|
queueLimit?: number;
|
||||||
timeoutMs?: number;
|
timeoutMs?: number;
|
||||||
timeoutSeconds?: number;
|
timeoutSeconds?: number;
|
||||||
expectedSeconds?: number;
|
expectedSeconds?: number;
|
||||||
retryTimes: number;
|
retryTimes: number;
|
||||||
retryQueueMaxSeconds: number;
|
retryQueueMaxSeconds?: number;
|
||||||
autoCleanSeconds: number;
|
autoCleanSeconds: number;
|
||||||
remark?: string;
|
headMsg?: string | Record<string, string>;
|
||||||
headMsg?: string;
|
|
||||||
form?: ModelFormEntry[] | Record<string, { value: string }>;
|
form?: ModelFormEntry[] | Record<string, { value: string }>;
|
||||||
requestMapping?: Record<string, unknown>;
|
requestMapping?: Record<string, unknown>;
|
||||||
|
requiredFields?: string[];
|
||||||
|
firstFrame?: string;
|
||||||
|
lastFrame?: string;
|
||||||
responseMapping?: Record<string, unknown>;
|
responseMapping?: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,27 +154,32 @@ export interface CreateModelParams {
|
|||||||
operatorName?: string;
|
operatorName?: string;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
httpMethod?: string;
|
httpMethod?: string;
|
||||||
headMsg?: string;
|
headMsg?: Record<string, string>;
|
||||||
isPrivate: number;
|
isPrivate: number;
|
||||||
enabled: number;
|
enabled: number;
|
||||||
isChatModel: number;
|
isChatModel: number;
|
||||||
|
/** 调用模式:0-同步 1-异步 2-流式,默认0 */
|
||||||
|
callMode: number;
|
||||||
apiKey?: string;
|
apiKey?: string;
|
||||||
form: ModelFormEntry[];
|
form: ModelFormEntry[];
|
||||||
requestMapping?: Record<string, unknown>;
|
requestMapping?: Record<string, unknown>;
|
||||||
|
requiredFields?: string[];
|
||||||
|
firstFrame?: string;
|
||||||
|
lastFrame?: string;
|
||||||
responseMapping?: Record<string, unknown>;
|
responseMapping?: Record<string, unknown>;
|
||||||
responseBody?: Record<string, unknown>;
|
responseBody?: string;
|
||||||
extendMapping?: Record<string, unknown>;
|
extendMapping?: Record<string, unknown>;
|
||||||
responseTokenField?: string;
|
responseTokenField?: string;
|
||||||
tokenConfig?: Record<string, unknown>;
|
tokenConfig?: Record<string, unknown>;
|
||||||
queryConfig?: Record<string, unknown>;
|
queryConfig?: Record<string, unknown>;
|
||||||
|
streamConfig?: Record<string, unknown>;
|
||||||
maxConcurrency?: number;
|
maxConcurrency?: number;
|
||||||
queueLimit?: number;
|
queueLimit?: number;
|
||||||
timeoutSeconds: number;
|
timeoutSeconds: number;
|
||||||
expectedSeconds: number;
|
expectedSeconds?: number;
|
||||||
retryTimes?: number;
|
retryTimes?: number;
|
||||||
retryQueueMaxSeconds: number;
|
retryQueueMaxSeconds?: number;
|
||||||
autoCleanSeconds: number;
|
autoCleanSeconds: number;
|
||||||
remark?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModelConfigTypeItem {
|
export interface ModelConfigTypeItem {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export interface PromptItem {
|
|||||||
deletedAt?: string | null;
|
deletedAt?: string | null;
|
||||||
nodeType: string;
|
nodeType: string;
|
||||||
prompt: string;
|
prompt: string;
|
||||||
sourceType: number; // 0-自定义 1-公共
|
sourceType: number; // 1-管理员 2-用户
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PromptListResponse {
|
export interface PromptListResponse {
|
||||||
@@ -23,6 +23,7 @@ export interface PromptListParams {
|
|||||||
pageNum?: number;
|
pageNum?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
keyword?: string;
|
keyword?: string;
|
||||||
|
nodeType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreatePromptParams {
|
export interface CreatePromptParams {
|
||||||
@@ -31,6 +32,23 @@ export interface CreatePromptParams {
|
|||||||
sourceType: number;
|
sourceType: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CheckIsSuperAdminResponse {
|
||||||
|
isSuperAdmin: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreatePromptResponse {
|
||||||
|
id?: number | string;
|
||||||
|
tenantId?: number;
|
||||||
|
creator?: string;
|
||||||
|
createdAt?: string;
|
||||||
|
updater?: string;
|
||||||
|
updatedAt?: string;
|
||||||
|
deletedAt?: string | null;
|
||||||
|
nodeType?: string;
|
||||||
|
prompt?: string;
|
||||||
|
sourceType?: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface UpdatePromptParams extends CreatePromptParams {
|
export interface UpdatePromptParams extends CreatePromptParams {
|
||||||
id: number | string;
|
id: number | string;
|
||||||
}
|
}
|
||||||
@@ -65,6 +83,17 @@ export function getNodeLibraryList() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提示词列表(根据节点类型)
|
||||||
|
*/
|
||||||
|
export function getPromptList(params: PromptListParams) {
|
||||||
|
return request<PromptListResponse>({
|
||||||
|
url: '/ai-agent/node/prompt/list',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前用户提示词列表
|
* 获取当前用户提示词列表
|
||||||
*/
|
*/
|
||||||
@@ -80,7 +109,7 @@ export function getMyPromptList(params: PromptListParams) {
|
|||||||
* 创建提示词
|
* 创建提示词
|
||||||
*/
|
*/
|
||||||
export function createPrompt(data: CreatePromptParams) {
|
export function createPrompt(data: CreatePromptParams) {
|
||||||
return request({
|
return request<CreatePromptResponse>({
|
||||||
url: '/ai-agent/node/prompt/create',
|
url: '/ai-agent/node/prompt/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data,
|
data,
|
||||||
@@ -108,3 +137,13 @@ export function deletePrompt(id: number | string) {
|
|||||||
data: { id },
|
data: { id },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前用户是否为超级管理员
|
||||||
|
*/
|
||||||
|
export function checkIsSuperAdmin() {
|
||||||
|
return request<CheckIsSuperAdminResponse>({
|
||||||
|
url: '/admin-go/api/v1/system/user/checkIsSuperAdmin',
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -118,15 +118,22 @@ interface ModelItem {
|
|||||||
apiKey?: string;
|
apiKey?: string;
|
||||||
isPrivate?: number;
|
isPrivate?: number;
|
||||||
isChatModel?: number;
|
isChatModel?: number;
|
||||||
headMsg?: string;
|
headMsg?: string | Record<string, string>;
|
||||||
operatorName?: string;
|
operatorName?: string;
|
||||||
responseBody?: Record<string, unknown>;
|
responseBody?: Record<string, unknown>;
|
||||||
|
responseTokenField?: string;
|
||||||
tokenConfig?: Record<string, unknown> | string;
|
tokenConfig?: Record<string, unknown> | string;
|
||||||
extendMapping?: Record<string, unknown> | string;
|
extendMapping?: Record<string, unknown> | string;
|
||||||
queryConfig?: Record<string, unknown>;
|
queryConfig?: Record<string, unknown>;
|
||||||
|
streamConfig?: Record<string, unknown>;
|
||||||
form?: ModelFormEntry[] | Record<string, unknown>;
|
form?: ModelFormEntry[] | Record<string, unknown>;
|
||||||
requestMapping?: Record<string, unknown>;
|
requestMapping?: Record<string, unknown>;
|
||||||
|
requiredFields?: string[];
|
||||||
|
firstFrame?: string;
|
||||||
|
lastFrame?: string;
|
||||||
responseMapping?: Record<string, unknown>;
|
responseMapping?: Record<string, unknown>;
|
||||||
|
callMode?: number;
|
||||||
|
isAsync?: number;
|
||||||
maxConcurrency?: number;
|
maxConcurrency?: number;
|
||||||
queueLimit?: number;
|
queueLimit?: number;
|
||||||
timeoutSeconds?: number;
|
timeoutSeconds?: number;
|
||||||
@@ -271,74 +278,71 @@ const fieldsToUnknownObject = (fields: Array<{ key: string; value: string }>) =>
|
|||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
const flattenNestedObject = (obj: Record<string, unknown>, prefix = ''): Array<{ key: string; value: string }> => {
|
const parseFormEntries = (raw: unknown): ModelFormEntry[] => {
|
||||||
const rows: Array<{ key: string; value: string }> = [];
|
if (Array.isArray(raw)) {
|
||||||
Object.entries(obj || {}).forEach(([k, v]) => {
|
return (raw as ModelFormEntry[])
|
||||||
const fk = prefix ? `${prefix}.${k}` : k;
|
.filter((item) => item && item.key !== undefined)
|
||||||
if (v && typeof v === 'object' && !Array.isArray(v)) {
|
.map((item) => ({
|
||||||
rows.push(...flattenNestedObject(v as Record<string, unknown>, fk));
|
key: String(item.key ?? '').trim(),
|
||||||
return;
|
value: String(item.value ?? ''),
|
||||||
}
|
}))
|
||||||
rows.push({ key: fk, value: String(v ?? '') });
|
.filter((item) => item.key !== '');
|
||||||
});
|
|
||||||
return rows;
|
|
||||||
};
|
|
||||||
|
|
||||||
const nestFieldsToObject = (fields: Array<{ key: string; value: string }>) => {
|
|
||||||
const root: Record<string, unknown> = {};
|
|
||||||
fields.forEach((f) => {
|
|
||||||
const path = String(f.key || '').trim();
|
|
||||||
if (!path) return;
|
|
||||||
const parts = path
|
|
||||||
.split('.')
|
|
||||||
.map((p) => p.trim())
|
|
||||||
.filter(Boolean);
|
|
||||||
if (!parts.length) return;
|
|
||||||
let cur: Record<string, unknown> = root;
|
|
||||||
parts.forEach((part, idx) => {
|
|
||||||
if (idx === parts.length - 1) {
|
|
||||||
cur[part] = String(f.value ?? '');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!cur[part] || typeof cur[part] !== 'object' || Array.isArray(cur[part])) {
|
|
||||||
cur[part] = {};
|
|
||||||
}
|
|
||||||
cur = cur[part] as Record<string, unknown>;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return root;
|
|
||||||
};
|
|
||||||
|
|
||||||
const buildQueryConfigFromRaw = (rawQc: Record<string, unknown> | null): Record<string, unknown> => {
|
|
||||||
if (!rawQc) return { responseType: 'sync', callbackUrl: '' };
|
|
||||||
const rt = String(rawQc.responseType || 'sync');
|
|
||||||
if (rt === 'callback') return { responseType: 'callback', callbackUrl: String(rawQc.callbackUrl || '') };
|
|
||||||
if (rt === 'pull') {
|
|
||||||
const hFields = Object.entries((rawQc.headers as Record<string, unknown>) || {}).map(([k, v]) => ({ key: k, value: String(v ?? '') }));
|
|
||||||
const bFields = flattenNestedObject((rawQc.body as Record<string, unknown>) || {});
|
|
||||||
return {
|
|
||||||
responseType: 'pull',
|
|
||||||
callbackUrl: '',
|
|
||||||
method: String(rawQc.method || 'GET'),
|
|
||||||
url: String(rawQc.url || ''),
|
|
||||||
headers: fieldsToUnknownObject(hFields),
|
|
||||||
body: nestFieldsToObject(bFields),
|
|
||||||
response: ((rawQc.response as unknown[]) || [])
|
|
||||||
.map((item) => {
|
|
||||||
if (typeof item === 'string') {
|
|
||||||
return { value: item, isTokenField: false, isMainBody: false };
|
|
||||||
}
|
|
||||||
const row = item as Record<string, unknown>;
|
|
||||||
return {
|
|
||||||
value: String(row.value ?? ''),
|
|
||||||
isTokenField: Boolean(row.isTokenField),
|
|
||||||
isMainBody: Boolean(row.isMainBody),
|
|
||||||
};
|
|
||||||
})
|
|
||||||
.filter((row) => row.value !== ''),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return { responseType: 'sync', callbackUrl: '' };
|
|
||||||
|
if (raw && typeof raw === 'object') {
|
||||||
|
return Object.entries(raw as Record<string, unknown>).map(([key, value]) => {
|
||||||
|
let nextValue = value;
|
||||||
|
if (nextValue && typeof nextValue === 'object' && !Array.isArray(nextValue) && 'value' in nextValue) {
|
||||||
|
nextValue = (nextValue as { value: unknown }).value;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
key: String(key).trim(),
|
||||||
|
value: String(nextValue ?? ''),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
const normalizeQueryConfig = (raw: unknown): Record<string, unknown> => {
|
||||||
|
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||||
|
return raw as Record<string, unknown>;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
|
const parseHeadMsgRecord = (raw: ModelItem['headMsg']) => {
|
||||||
|
const headMsgRecord: Record<string, string> = {};
|
||||||
|
if (typeof raw === 'string') {
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(raw);
|
||||||
|
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
||||||
|
Object.entries(parsed).forEach(([k, v]) => {
|
||||||
|
headMsgRecord[k] = String(v);
|
||||||
|
});
|
||||||
|
return headMsgRecord;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
const pairs = raw.split(',');
|
||||||
|
pairs.forEach((pair) => {
|
||||||
|
const idx = pair.indexOf(':');
|
||||||
|
if (idx === -1) return;
|
||||||
|
const key = pair.slice(0, idx).trim();
|
||||||
|
const value = pair.slice(idx + 1).trim();
|
||||||
|
if (key) {
|
||||||
|
headMsgRecord[key] = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return headMsgRecord;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||||
|
Object.entries(raw).forEach(([k, v]) => {
|
||||||
|
headMsgRecord[k] = String(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return headMsgRecord;
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchModelList = async () => {
|
const fetchModelList = async () => {
|
||||||
@@ -396,25 +400,25 @@ const handleCreatePrivateModel = async () => {
|
|||||||
creatingModel.value = true;
|
creatingModel.value = true;
|
||||||
|
|
||||||
const builtInModel = builtInModelToClone.value;
|
const builtInModel = builtInModelToClone.value;
|
||||||
const formList: ModelFormEntry[] = Array.isArray(builtInModel.form)
|
const formList = parseFormEntries(builtInModel.form);
|
||||||
? (builtInModel.form as ModelFormEntry[])
|
|
||||||
: Object.entries((builtInModel.form as Record<string, unknown>) || {}).map(([key, value]) => ({
|
|
||||||
key: String(key),
|
|
||||||
value: String(value ?? ''),
|
|
||||||
}));
|
|
||||||
const createParams: CreateModelParams = {
|
const createParams: CreateModelParams = {
|
||||||
modelName: apiKeyForm.modelName,
|
modelName: apiKeyForm.modelName,
|
||||||
modelType: builtInModel.modelType,
|
modelType: builtInModel.modelType,
|
||||||
operatorName: builtInModel.operatorName || '',
|
operatorName: builtInModel.operatorName || '',
|
||||||
baseUrl: builtInModel.baseUrl,
|
baseUrl: builtInModel.baseUrl,
|
||||||
httpMethod: builtInModel.httpMethod || 'POST',
|
httpMethod: builtInModel.httpMethod || 'POST',
|
||||||
headMsg: builtInModel.headMsg || '',
|
headMsg: parseHeadMsgRecord(builtInModel.headMsg),
|
||||||
isPrivate: builtInModel.isPrivate ?? 1,
|
isPrivate: builtInModel.isPrivate ?? 1,
|
||||||
enabled: builtInModel.enabled ?? 1,
|
enabled: builtInModel.enabled ?? 1,
|
||||||
isChatModel: builtInModel.isChatModel || 0,
|
isChatModel: builtInModel.isChatModel || 0,
|
||||||
|
callMode: builtInModel.callMode ?? builtInModel.isAsync ?? 0,
|
||||||
apiKey: apiKeyForm.apiKey,
|
apiKey: apiKeyForm.apiKey,
|
||||||
form: formList,
|
form: formList,
|
||||||
requestMapping: (builtInModel.requestMapping as Record<string, unknown>) || {},
|
requestMapping: (builtInModel.requestMapping as Record<string, unknown>) || {},
|
||||||
|
requiredFields: Array.isArray(builtInModel.requiredFields) ? builtInModel.requiredFields : [],
|
||||||
|
firstFrame: String(builtInModel.firstFrame || ''),
|
||||||
|
lastFrame: String(builtInModel.lastFrame || ''),
|
||||||
responseMapping: (builtInModel.responseMapping as Record<string, unknown>) || {},
|
responseMapping: (builtInModel.responseMapping as Record<string, unknown>) || {},
|
||||||
responseBody: builtInModel.responseBody || {},
|
responseBody: builtInModel.responseBody || {},
|
||||||
maxConcurrency: builtInModel.maxConcurrency || 10,
|
maxConcurrency: builtInModel.maxConcurrency || 10,
|
||||||
@@ -424,19 +428,20 @@ const handleCreatePrivateModel = async () => {
|
|||||||
retryTimes: builtInModel.retryTimes || 3,
|
retryTimes: builtInModel.retryTimes || 3,
|
||||||
retryQueueMaxSeconds: builtInModel.retryQueueMaxSeconds || 60,
|
retryQueueMaxSeconds: builtInModel.retryQueueMaxSeconds || 60,
|
||||||
autoCleanSeconds: builtInModel.autoCleanSeconds || 300,
|
autoCleanSeconds: builtInModel.autoCleanSeconds || 300,
|
||||||
remark: builtInModel.remark || '',
|
|
||||||
|
|
||||||
extendMapping: fieldsToUnknownObject(
|
extendMapping: fieldsToUnknownObject(
|
||||||
Object.entries(parseJsonObjectField(builtInModel.extendMapping)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
Object.entries(parseJsonObjectField(builtInModel.extendMapping)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
||||||
),
|
),
|
||||||
tokenConfig: fieldsToUnknownObject(
|
tokenConfig: fieldsToUnknownObject(
|
||||||
Object.entries(parseJsonObjectField(builtInModel.tokenConfig)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
Object.entries(parseJsonObjectField(builtInModel.tokenConfig)).map(([k, v]) => ({ key: k, value: String(v ?? '') }))
|
||||||
),
|
),
|
||||||
queryConfig: buildQueryConfigFromRaw(
|
queryConfig: normalizeQueryConfig(builtInModel.queryConfig),
|
||||||
builtInModel.queryConfig && typeof builtInModel.queryConfig === 'object' && !Array.isArray(builtInModel.queryConfig)
|
responseTokenField: String(builtInModel.responseTokenField || ''),
|
||||||
? (builtInModel.queryConfig as Record<string, unknown>)
|
streamConfig:
|
||||||
: null
|
Number(builtInModel.callMode ?? builtInModel.isAsync ?? 0) === 2
|
||||||
),
|
? builtInModel.streamConfig && typeof builtInModel.streamConfig === 'object' && !Array.isArray(builtInModel.streamConfig)
|
||||||
|
? (builtInModel.streamConfig as Record<string, unknown>)
|
||||||
|
: {}
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
const res: any = await addModelModule(createParams);
|
const res: any = await addModelModule(createParams);
|
||||||
|
|||||||
@@ -34,6 +34,23 @@ export const router = createRouter({
|
|||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes: staticRoutes,
|
routes: staticRoutes,
|
||||||
});
|
});
|
||||||
|
const hasValidResolvedRoute = (to: any) => {
|
||||||
|
const resolved = router.resolve(to.fullPath);
|
||||||
|
const matched = resolved.matched || [];
|
||||||
|
|
||||||
|
const isStaticFallbackRoute = matched.length === 1 && matched[0]?.path === '/:pathMatch(.*)*';
|
||||||
|
|
||||||
|
const isRedirectTo404Route = matched.length > 0 && matched.every((item) => item.redirect === '/404');
|
||||||
|
|
||||||
|
return matched.length > 0 && !isStaticFallbackRoute && !isRedirectTo404Route;
|
||||||
|
};
|
||||||
|
const goResolvedOr404AfterInit = (to: any, next: any) => {
|
||||||
|
if (hasValidResolvedRoute(to)) {
|
||||||
|
next({ ...to, replace: true });
|
||||||
|
} else {
|
||||||
|
next('/404');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由多级嵌套数组处理成一维数组
|
* 路由多级嵌套数组处理成一维数组
|
||||||
@@ -106,18 +123,18 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
const { routesList } = storeToRefs(storesRoutesList);
|
const { routesList } = storeToRefs(storesRoutesList);
|
||||||
if (routesList.value.length === 0) {
|
if (routesList.value.length === 0) {
|
||||||
if (isRequestRoutes) {
|
if (isRequestRoutes) {
|
||||||
// 后端控制路由:路由数据初始化,防止刷新时丢失
|
|
||||||
await initBackEndControlRoutes();
|
await initBackEndControlRoutes();
|
||||||
// 动态添加路由:防止非首页刷新时跳转回首页的问题
|
goResolvedOr404AfterInit(to, next);
|
||||||
// 确保 addRoute() 时动态添加的路由已经被完全加载上去
|
|
||||||
next({ ...to, replace: true });
|
|
||||||
} else {
|
} else {
|
||||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I5F1HP
|
|
||||||
await initFrontEndControlRoutes();
|
await initFrontEndControlRoutes();
|
||||||
next({ ...to, replace: true });
|
goResolvedOr404AfterInit(to, next);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
next();
|
if (hasValidResolvedRoute(to)) {
|
||||||
|
next();
|
||||||
|
} else {
|
||||||
|
next('/404');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { RouteRecordRaw } from 'vue-router';
|
import { RouteRecordRaw } from 'vue-router';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由meta对象参数说明
|
* 路由meta对象参数说明
|
||||||
@@ -69,9 +69,9 @@ export const dynamicRoutes: Array<RouteRecordRaw> = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 盘点管理路由配置(供后端菜单配置参考)
|
* 盘点管理路由配置(供后端菜单配置参考)
|
||||||
*
|
*
|
||||||
* 父级菜单: 库存作业 (/assets/operation)
|
* 父级菜单: 库存作业 (/assets/operation)
|
||||||
*
|
*
|
||||||
* 盘点菜单配置:
|
* 盘点菜单配置:
|
||||||
* - 路由路径: /assets/operation/count
|
* - 路由路径: /assets/operation/count
|
||||||
* - 组件路径: assets/operation/count/index
|
* - 组件路径: assets/operation/count/index
|
||||||
@@ -1077,8 +1077,8 @@ export const demoRoutes: Array<RouteRecordRaw> = [
|
|||||||
*/
|
*/
|
||||||
export const notFoundAndNoPower = [
|
export const notFoundAndNoPower = [
|
||||||
{
|
{
|
||||||
path: '/:path(.*)*',
|
path: '/404',
|
||||||
name: 'notFound',
|
name: 'notFoundPage',
|
||||||
component: () => import('/@/views/error/404.vue'),
|
component: () => import('/@/views/error/404.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'message.staticRoutes.notFound',
|
title: 'message.staticRoutes.notFound',
|
||||||
@@ -1094,6 +1094,15 @@ export const notFoundAndNoPower = [
|
|||||||
isHide: true,
|
isHide: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/:path(.*)*',
|
||||||
|
name: 'notFound',
|
||||||
|
redirect: '/404',
|
||||||
|
meta: {
|
||||||
|
title: 'message.staticRoutes.notFound',
|
||||||
|
isHide: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,65 +1,92 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="input-shell">
|
<div class="input-shell">
|
||||||
<div class="input-card">
|
<div class="input-card" :class="{ 'is-focused': isFocused }">
|
||||||
|
<!-- 已选中状态标签栏 -->
|
||||||
|
<div v-if="selectedWorkflowId !== null || selectedSkill !== 'default'" class="selected-tags">
|
||||||
|
<div v-if="selectedWorkflowId !== null" class="selected-tag workflow-tag">
|
||||||
|
<el-icon><Promotion /></el-icon>
|
||||||
|
<span>{{ commonWorkflows.find((w) => w.id === selectedWorkflowId)?.name }}</span>
|
||||||
|
<el-icon class="tag-close" @click="selectedWorkflowId = null"><Close /></el-icon>
|
||||||
|
</div>
|
||||||
|
<div v-if="selectedSkill !== 'default'" class="selected-tag skill-tag">
|
||||||
|
<el-icon><MagicStick /></el-icon>
|
||||||
|
<span>{{ skillLabels[selectedSkill] }}</span>
|
||||||
|
<el-icon class="tag-close" @click="selectedSkill = 'default'"><Close /></el-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 文本输入区 -->
|
||||||
<el-input
|
<el-input
|
||||||
v-model="message"
|
v-model="message"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="1"
|
:autosize="{ minRows: 1, maxRows: 6 }"
|
||||||
:autosize="{ minRows: 2, maxRows: 5 }"
|
placeholder="有什么想聊的?按 Enter 发送,Shift+Enter 换行"
|
||||||
placeholder="多说说你的偏好和要求,我会越用越懂你"
|
|
||||||
class="message-input"
|
class="message-input"
|
||||||
@keydown.enter.exact="handleSend"
|
@focus="isFocused = true"
|
||||||
|
@blur="isFocused = false"
|
||||||
|
@keydown.enter.exact.prevent="handleSend"
|
||||||
|
@keydown.enter.shift.exact="() => {}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- 底部工具栏 -->
|
||||||
<div class="input-toolbar">
|
<div class="input-toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button circle class="tool-btn" @click="handleAttachment">
|
<!-- 上传附件 -->
|
||||||
<el-icon><Plus /></el-icon>
|
<el-tooltip content="上传文件" placement="top">
|
||||||
</el-button>
|
<button class="tool-icon-btn" @click="handleAttachment">
|
||||||
<el-dropdown trigger="click" @command="handleSkillSelect">
|
<el-icon><Paperclip /></el-icon>
|
||||||
<el-button class="pill-btn">
|
</button>
|
||||||
{{ currentSkillDisplay }}
|
</el-tooltip>
|
||||||
</el-button>
|
|
||||||
|
<!-- 选择技能 -->
|
||||||
|
<el-dropdown trigger="click" placement="top-start" @command="handleSkillSelect">
|
||||||
|
<el-tooltip content="选择技能" placement="top">
|
||||||
|
<button class="tool-icon-btn" :class="{ active: selectedSkill !== 'default' }">
|
||||||
|
<el-icon><MagicStick /></el-icon>
|
||||||
|
<span class="tool-label">技能</span>
|
||||||
|
</button>
|
||||||
|
</el-tooltip>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item command="default">默认对话</el-dropdown-item>
|
<el-dropdown-item command="default">
|
||||||
<el-dropdown-item command="code-review">代码审查</el-dropdown-item>
|
<el-icon><CircleClose /></el-icon>不使用技能
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item divided command="code-review">代码审查</el-dropdown-item>
|
||||||
<el-dropdown-item command="refactor">代码重构</el-dropdown-item>
|
<el-dropdown-item command="refactor">代码重构</el-dropdown-item>
|
||||||
<el-dropdown-item command="writing">内容写作</el-dropdown-item>
|
<el-dropdown-item command="writing">内容写作</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
|
||||||
<el-button circle class="send-btn" :disabled="!message.trim()" @click="handleSend">
|
|
||||||
<el-icon><Top /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 常用工作流胶囊 -->
|
<div class="toolbar-right">
|
||||||
<div class="workflow-pills" v-if="commonWorkflows.length > 0">
|
<span class="hint-text">Shift+Enter 换行</span>
|
||||||
<div
|
<button class="send-btn" :disabled="!message.trim()" @click="handleSend">
|
||||||
v-for="wf in commonWorkflows"
|
<el-icon><Top /></el-icon>
|
||||||
:key="wf.id"
|
</button>
|
||||||
class="workflow-pill"
|
|
||||||
:class="{ active: selectedWorkflowId === wf.id }"
|
|
||||||
@click="selectWorkflow(wf)"
|
|
||||||
>
|
|
||||||
<el-icon class="pill-icon">
|
|
||||||
<component :is="wf.icon" />
|
|
||||||
</el-icon>
|
|
||||||
<span class="pill-text">{{ wf.name }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 快捷工作流胶囊(输入框下方) -->
|
||||||
|
<div v-if="commonWorkflows.length > 0" class="workflow-shortcuts">
|
||||||
|
<button
|
||||||
|
v-for="wf in commonWorkflows"
|
||||||
|
:key="wf.id"
|
||||||
|
class="shortcut-pill"
|
||||||
|
:class="{ active: selectedWorkflowId === wf.id }"
|
||||||
|
@click="toggleWorkflow(wf.id)"
|
||||||
|
>
|
||||||
|
<el-icon><Promotion /></el-icon>
|
||||||
|
{{ wf.name }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { Top, MagicStick, Promotion, Close, CircleClose, Paperclip } from '@element-plus/icons-vue';
|
||||||
import { Top, Plus, MagicStick, Document, CircleCheck } from '@element-plus/icons-vue';
|
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
@@ -69,14 +96,12 @@ interface Emits {
|
|||||||
interface Workflow {
|
interface Workflow {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
icon: any;
|
|
||||||
prefix: string;
|
prefix: string;
|
||||||
editPath: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits<Emits>();
|
const emit = defineEmits<Emits>();
|
||||||
const router = useRouter();
|
|
||||||
const message = ref('');
|
const message = ref('');
|
||||||
|
const isFocused = ref(false);
|
||||||
const selectedSkill = ref('default');
|
const selectedSkill = ref('default');
|
||||||
const selectedWorkflowId = ref<number | null>(null);
|
const selectedWorkflowId = ref<number | null>(null);
|
||||||
|
|
||||||
@@ -87,59 +112,28 @@ const skillLabels: Record<string, string> = {
|
|||||||
writing: '内容写作',
|
writing: '内容写作',
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentSkillDisplay = computed(() => {
|
const skillPrefixes: Record<string, string> = {
|
||||||
return selectedSkill.value === 'default' ? '选择技能' : skillLabels[selectedSkill.value];
|
|
||||||
});
|
|
||||||
|
|
||||||
const skills: Record<string, string> = {
|
|
||||||
default: '',
|
default: '',
|
||||||
'code-review': '[技能:代码审查] 请帮我审查下面这段代码,找出潜在问题并给出改进建议:\n',
|
'code-review': '[技能:代码审查] 请帮我审查下面这段代码,找出潜在问题并给出改进建议:\n',
|
||||||
refactor: '[技能:代码重构] 请帮我重构下面这段代码,提升可读性和可维护性:\n',
|
refactor: '[技能:代码重构] 请帮我重构下面这段代码,提升可读性和可维护性:\n',
|
||||||
writing: '[技能:内容写作] 请根据下面的需求帮我创作内容:\n',
|
writing: '[技能:内容写作] 请根据下面的需求帮我创作内容:\n',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 常用工作流列表
|
|
||||||
const commonWorkflows: Workflow[] = [
|
const commonWorkflows: Workflow[] = [
|
||||||
{
|
{ id: 1, name: '审查', prefix: '[工作流:审查] 完成后请自动生成单元测试:\n' },
|
||||||
id: 1,
|
{ id: 2, name: '文档再编码', prefix: '[工作流:文档再编码] 请先编写接口文档,再实现代码:\n' },
|
||||||
name: '审查+测试',
|
{ id: 3, name: '代码重构', prefix: '[工作流:代码重构] 请帮我重构这段代码:\n' },
|
||||||
icon: Document,
|
{ id: 4, name: '需求分析', prefix: '[工作流:需求分析] 请帮我分析这个需求并拆解任务:\n' },
|
||||||
prefix: '[工作流:审查+测试] 完成后请自动生成单元测试:\n',
|
|
||||||
editPath: '/settings/workflow',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '文档再编码',
|
|
||||||
icon: Document,
|
|
||||||
prefix: '[工作流:文档再编码] 请先编写接口文档,再实现代码:\n',
|
|
||||||
editPath: '/settings/workflow',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: '代码重构',
|
|
||||||
icon: Document,
|
|
||||||
prefix: '[工作流:代码重构] 请帮我重构这段代码:\n',
|
|
||||||
editPath: '/settings/workflow',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: '需求分析',
|
|
||||||
icon: Document,
|
|
||||||
prefix: '[工作流:需求分析] 请帮我分析这个需求并拆解任务:\n',
|
|
||||||
editPath: '/settings/workflow',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleSend = (event?: KeyboardEvent) => {
|
const handleSend = () => {
|
||||||
if (event) event.preventDefault();
|
|
||||||
const msg = message.value.trim();
|
const msg = message.value.trim();
|
||||||
if (!msg) return;
|
if (!msg) return;
|
||||||
const skillPrefix = skills[selectedSkill.value] || '';
|
const skillPrefix = skillPrefixes[selectedSkill.value] || '';
|
||||||
const workflowPrefix = selectedWorkflowId.value !== null ? commonWorkflows.find((w) => w.id === selectedWorkflowId.value)?.prefix || '' : '';
|
const workflowPrefix = selectedWorkflowId.value !== null ? commonWorkflows.find((w) => w.id === selectedWorkflowId.value)?.prefix || '' : '';
|
||||||
const finalMessage = (skillPrefix + workflowPrefix + msg).trim();
|
const finalMessage = (skillPrefix + workflowPrefix + msg).trim();
|
||||||
emit('send', finalMessage);
|
emit('send', finalMessage);
|
||||||
message.value = '';
|
message.value = '';
|
||||||
// 发送后清空选择
|
|
||||||
selectedWorkflowId.value = null;
|
selectedWorkflowId.value = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -147,186 +141,241 @@ const handleAttachment = () => {
|
|||||||
ElMessage.info('附件上传功能开发中...');
|
ElMessage.info('附件上传功能开发中...');
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSkillSelect = (key: string | number | object) => {
|
const handleSkillSelect = (key: string | number | object | null) => {
|
||||||
selectedSkill.value = String(key);
|
selectedSkill.value = String(key ?? 'default');
|
||||||
if (selectedSkill.value !== 'default') {
|
|
||||||
ElMessage.success(`已选择技能:${skillLabels[selectedSkill.value]}`);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectWorkflow = (wf: Workflow) => {
|
const handleWorkflowSelect = (id: number | null) => {
|
||||||
if (selectedWorkflowId.value === wf.id) {
|
selectedWorkflowId.value = id;
|
||||||
selectedWorkflowId.value = null;
|
};
|
||||||
ElMessage.info('已取消工作流');
|
|
||||||
} else {
|
const toggleWorkflow = (id: number) => {
|
||||||
selectedWorkflowId.value = wf.id;
|
selectedWorkflowId.value = selectedWorkflowId.value === id ? null : id;
|
||||||
ElMessage.success(`已选择工作流:${wf.name}`);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.input-shell {
|
.input-shell {
|
||||||
position: relative;
|
padding: 0 24px 24px;
|
||||||
z-index: 12;
|
|
||||||
margin-top: -20px;
|
|
||||||
padding: 0 0 50px;
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-card {
|
.input-card {
|
||||||
width: min(1060px, 82%);
|
max-width: 860px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
background:
|
background: #fff;
|
||||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%),
|
border: 1.5px solid #e2e8f0;
|
||||||
radial-gradient(120% 180% at 0% 0%, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 38%),
|
border-radius: 16px;
|
||||||
radial-gradient(80% 120% at 100% 100%, rgba(168, 85, 247, 0.08) 0%, rgba(168, 85, 247, 0) 38%);
|
box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
|
||||||
border: 1px solid rgba(59, 130, 246, 0.28);
|
transition:
|
||||||
border-radius: 20px;
|
border-color 0.2s,
|
||||||
box-shadow:
|
box-shadow 0.2s;
|
||||||
0 24px 48px rgba(15, 23, 42, 0.12),
|
overflow: hidden;
|
||||||
0 0 0 1px rgba(59, 130, 246, 0.08) inset,
|
|
||||||
0 8px 16px rgba(37, 99, 235, 0.1);
|
&.is-focused {
|
||||||
padding: 16px 18px 18px;
|
border-color: #93c5fd;
|
||||||
backdrop-filter: blur(16px);
|
box-shadow:
|
||||||
|
0 0 0 3px rgba(59, 130, 246, 0.12),
|
||||||
|
0 2px 12px rgba(15, 23, 42, 0.07);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 已选标签栏 */
|
||||||
|
.selected-tags {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 10px 14px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected-tag {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 8px 3px 8px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.4;
|
||||||
|
|
||||||
|
&.workflow-tag {
|
||||||
|
background: #eff6ff;
|
||||||
|
color: #2563eb;
|
||||||
|
border: 1px solid #bfdbfe;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.skill-tag {
|
||||||
|
background: #f5f3ff;
|
||||||
|
color: #7c3aed;
|
||||||
|
border: 1px solid #ddd6fe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-close {
|
||||||
|
margin-left: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.6;
|
||||||
|
transition: opacity 0.15s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 文本域 */
|
||||||
.message-input {
|
.message-input {
|
||||||
:deep(.el-textarea__inner) {
|
:deep(.el-textarea__inner) {
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
resize: none;
|
resize: none;
|
||||||
padding: 8px 6px 14px;
|
padding: 14px 16px 8px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 1.65;
|
line-height: 1.6;
|
||||||
color: #0f172a;
|
color: #0f172a;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
min-height: 50px;
|
min-height: 28px !important;
|
||||||
font-weight: 500;
|
|
||||||
|
|
||||||
&::placeholder {
|
&::placeholder {
|
||||||
color: #90a1b7;
|
color: #94a3b8;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 底部工具栏 */
|
||||||
.input-toolbar {
|
.input-toolbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
padding: 6px 10px 10px 12px;
|
||||||
padding-top: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-left,
|
.toolbar-left,
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool-btn {
|
.tool-icon-btn {
|
||||||
width: 32px;
|
display: inline-flex;
|
||||||
height: 32px;
|
align-items: center;
|
||||||
border: 1px solid #d9e4f5;
|
gap: 4px;
|
||||||
color: #5b6b84;
|
height: 30px;
|
||||||
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
|
padding: 0 10px;
|
||||||
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
|
border: none;
|
||||||
transition: all 0.2s ease;
|
border-radius: 8px;
|
||||||
|
background: transparent;
|
||||||
|
color: #64748b;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
transition:
|
||||||
|
background 0.15s,
|
||||||
|
color 0.15s;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
.el-icon {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #2b4d8f;
|
background: #f1f5f9;
|
||||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
|
color: #334155;
|
||||||
border-color: #bfdbfe;
|
}
|
||||||
transform: translateY(-1px);
|
|
||||||
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
|
&.active {
|
||||||
|
background: #eff6ff;
|
||||||
|
color: #2563eb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pill-btn {
|
.tool-label {
|
||||||
height: 32px;
|
|
||||||
padding: 0 14px;
|
|
||||||
border-radius: 999px;
|
|
||||||
border: 1px solid #dbe7f7;
|
|
||||||
color: #30435f;
|
|
||||||
background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
}
|
||||||
transition: all 0.2s ease;
|
|
||||||
|
|
||||||
&:hover {
|
.hint-text {
|
||||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
|
font-size: 11px;
|
||||||
border-color: #bfdbfe;
|
color: #cbd5e1;
|
||||||
color: #1d4ed8;
|
margin-right: 6px;
|
||||||
}
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.send-btn {
|
.send-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border: none;
|
border: none;
|
||||||
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
|
border-radius: 8px;
|
||||||
|
background: #2563eb;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition:
|
||||||
|
background 0.15s,
|
||||||
|
transform 0.1s,
|
||||||
|
opacity 0.15s;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
.el-icon {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover:not(:disabled) {
|
&:hover:not(:disabled) {
|
||||||
filter: brightness(1.08);
|
background: #1d4ed8;
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
opacity: 0.5;
|
background: #e2e8f0;
|
||||||
box-shadow: none;
|
color: #94a3b8;
|
||||||
background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
|
cursor: not-allowed;
|
||||||
|
transform: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 工作流胶囊样式 */
|
/* 快捷工作流胶囊 */
|
||||||
.workflow-pills {
|
.workflow-shortcuts {
|
||||||
margin-top: 12px;
|
max-width: 860px;
|
||||||
padding-top: 12px;
|
margin: 10px auto 0;
|
||||||
border-top: 1px solid rgba(59, 130, 246, 0.15);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-pill {
|
.shortcut-pill {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 5px;
|
||||||
padding: 4px 10px;
|
height: 28px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
background: rgba(255, 255, 255, 0.7);
|
||||||
background: rgba(255, 255, 255, 0.6);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
color: #475569;
|
color: #475569;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
transition: all 0.15s;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
.el-icon {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: #3b82f6;
|
border-color: #93c5fd;
|
||||||
background: rgba(59, 130, 246, 0.08);
|
color: #2563eb;
|
||||||
transform: translateY(-1px);
|
background: rgba(239, 246, 255, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
border-color: #3b82f6;
|
border-color: #3b82f6;
|
||||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
background: #2563eb;
|
||||||
color: #ffffff;
|
color: #fff;
|
||||||
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
|
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
|
||||||
}
|
|
||||||
|
|
||||||
.pill-icon {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pill-text {
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 500;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="history-title">历史对话</div>
|
<div class="history-title">历史对话</div>
|
||||||
<div class="history-list">
|
<div class="history-list">
|
||||||
<div
|
<div
|
||||||
v-for="item in historyList"
|
v-for="item in visibleHistory"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="history-item"
|
class="history-item"
|
||||||
:class="{ active: activeHistoryId === item.id }"
|
:class="{ active: activeHistoryId === item.id }"
|
||||||
@@ -31,12 +31,56 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="workspace-section">
|
||||||
|
<div class="workspace-title">工作流</div>
|
||||||
|
<div class="workspace-tree-wrap" v-loading="treeLoading">
|
||||||
|
<el-empty v-if="!treeLoading && treeNodes.length === 0" description="暂无作品数据" />
|
||||||
|
<el-tree
|
||||||
|
v-else
|
||||||
|
:data="treeNodes"
|
||||||
|
node-key="id"
|
||||||
|
:props="treeProps"
|
||||||
|
:highlight-current="true"
|
||||||
|
:expand-on-click-node="true"
|
||||||
|
>
|
||||||
|
<template #default="{ data }">
|
||||||
|
<div
|
||||||
|
class="tree-node"
|
||||||
|
:class="[
|
||||||
|
data.nodeType === 'date' ? 'level-date' :
|
||||||
|
data.nodeType === 'contentType' ? 'level-flow' : 'level-file',
|
||||||
|
data.fileType ? data.fileType.replace(/\//g, ' ').split(' ')[0] : ''
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<span class="ellipsis">{{ data.label }}</span>
|
||||||
|
<div v-if="data.nodeType === 'title' && data.fileUrl" class="tree-node-actions">
|
||||||
|
<el-button type="primary" link size="small" @click.stop="handlePreviewNode(data)"> 预览 </el-button>
|
||||||
|
<el-button type="primary" link size="small" @click.stop="handleDownloadNode(data)"> 下载 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
import { Plus, Delete } from '@element-plus/icons-vue';
|
import { Plus, Delete } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
|
interface TreeNode {
|
||||||
|
id: string;
|
||||||
|
label: string;
|
||||||
|
nodeType: string;
|
||||||
|
children?: TreeNode[];
|
||||||
|
fileUrl?: string;
|
||||||
|
workflowId?: number | string;
|
||||||
|
fileType?: string;
|
||||||
|
sessionId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface HistoryItem {
|
interface HistoryItem {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -47,6 +91,8 @@ interface Props {
|
|||||||
activeMenu: string;
|
activeMenu: string;
|
||||||
activeHistoryId: number;
|
activeHistoryId: number;
|
||||||
historyList: HistoryItem[];
|
historyList: HistoryItem[];
|
||||||
|
treeNodes: TreeNode[];
|
||||||
|
treeLoading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
@@ -54,22 +100,22 @@ interface Emits {
|
|||||||
(e: 'new-chat'): void;
|
(e: 'new-chat'): void;
|
||||||
(e: 'select-history', id: number): void;
|
(e: 'select-history', id: number): void;
|
||||||
(e: 'delete-history', id: number): void;
|
(e: 'delete-history', id: number): void;
|
||||||
|
(e: 'preview-node', data: TreeNode): void;
|
||||||
|
(e: 'download-node', data: TreeNode): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
const emit = defineEmits<Emits>();
|
const emit = defineEmits<Emits>();
|
||||||
|
|
||||||
const handleNewChat = () => {
|
const treeProps = { children: 'children', label: 'label' };
|
||||||
emit('new-chat');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSelectHistory = (id: number) => {
|
const visibleHistory = computed(() => props.historyList);
|
||||||
emit('select-history', id);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDeleteHistory = (id: number) => {
|
const handleNewChat = () => emit('new-chat');
|
||||||
emit('delete-history', id);
|
const handleSelectHistory = (id: number) => emit('select-history', id);
|
||||||
};
|
const handleDeleteHistory = (id: number) => emit('delete-history', id);
|
||||||
|
const handlePreviewNode = (data: TreeNode) => emit('preview-node', data);
|
||||||
|
const handleDownloadNode = (data: TreeNode) => emit('download-node', data);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -113,12 +159,11 @@ const handleDeleteHistory = (id: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.history-section {
|
.history-section {
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
min-height: 0;
|
padding-bottom: 8px;
|
||||||
background: linear-gradient(180deg, rgba(249, 251, 255, 0.5) 0%, rgba(249, 251, 255, 0.9) 100%);
|
border-bottom: 1px solid rgba(59, 130, 246, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-title {
|
.history-title {
|
||||||
@@ -131,8 +176,8 @@ const handleDeleteHistory = (id: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.history-list {
|
.history-list {
|
||||||
flex: 1;
|
padding: 0 8px 4px;
|
||||||
padding: 0 8px 10px;
|
max-height: 255px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
@@ -204,4 +249,146 @@ const handleDeleteHistory = (id: number) => {
|
|||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: #94a3b8;
|
color: #94a3b8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.workspace-section {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-title {
|
||||||
|
padding: 4px 12px 8px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #64748b;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-tree-wrap {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 8px 12px;
|
||||||
|
overflow-y: auto;
|
||||||
|
scrollbar-width: none;
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tree) {
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
.el-tree-node {
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__content {
|
||||||
|
height: 38px;
|
||||||
|
line-height: 38px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 2px 0;
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-width: 2px;
|
||||||
|
transform: translateX(2px);
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node.is-current > .el-tree-node__content {
|
||||||
|
border-width: 2px;
|
||||||
|
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__expand-icon {
|
||||||
|
color: rgba(59, 130, 246, 0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-date) .el-tree-node__content {
|
||||||
|
height: 42px;
|
||||||
|
background: linear-gradient(135deg, rgba(59, 130, 246, 0.20) 0%, rgba(59, 130, 246, 0.05) 100%);
|
||||||
|
border: 1px solid rgba(59, 130, 246, 0.28);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-flow) .el-tree-node__content {
|
||||||
|
margin-left: 8px;
|
||||||
|
background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.03) 100%);
|
||||||
|
border: 1px solid rgba(139, 92, 246, 0.18);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-file.image) .el-tree-node__content,
|
||||||
|
:deep(.level-file.jpg) .el-tree-node__content,
|
||||||
|
:deep(.level-file.png) .el-tree-node__content,
|
||||||
|
:deep(.level-file.gif) .el-tree-node__content {
|
||||||
|
margin-left: 16px;
|
||||||
|
background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.04) 100%);
|
||||||
|
border: 1px solid rgba(16, 185, 129, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-file.video) .el-tree-node__content,
|
||||||
|
:deep(.level-file.mp4) .el-tree-node__content,
|
||||||
|
:deep(.level-file.webm) .el-tree-node__content {
|
||||||
|
margin-left: 16px;
|
||||||
|
background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
|
||||||
|
border: 1px solid rgba(245, 158, 11, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-file.audio) .el-tree-node__content,
|
||||||
|
:deep(.level-file.mp3) .el-tree-node__content,
|
||||||
|
:deep(.level-file.wav) .el-tree-node__content {
|
||||||
|
margin-left: 16px;
|
||||||
|
background: linear-gradient(135deg, rgba(236, 72, 153, 0.18) 0%, rgba(236, 72, 153, 0.04) 100%);
|
||||||
|
border: 1px solid rgba(236, 72, 153, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-file.text) .el-tree-node__content,
|
||||||
|
:deep(.level-file.md) .el-tree-node__content,
|
||||||
|
:deep(.level-file.txt) .el-tree-node__content,
|
||||||
|
:deep(.level-file.markdown) .el-tree-node__content {
|
||||||
|
margin-left: 16px;
|
||||||
|
background: linear-gradient(135deg, rgba(79, 70, 229, 0.18) 0%, rgba(79, 70, 229, 0.04) 100%);
|
||||||
|
border: 1px solid rgba(79, 70, 229, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.level-file:not(.image):not(.video):not(.audio):not(.text)) .el-tree-node__content {
|
||||||
|
margin-left: 16px;
|
||||||
|
background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(100, 116, 139, 0.04) 100%);
|
||||||
|
border: 1px solid rgba(100, 116, 139, 0.15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
gap: 6px;
|
||||||
|
|
||||||
|
.ellipsis {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-node-actions {
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
font-size: 11px;
|
||||||
|
padding: 2px 4px;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,50 +4,21 @@
|
|||||||
:active-menu="activeMenu"
|
:active-menu="activeMenu"
|
||||||
:active-history-id="activeHistoryId"
|
:active-history-id="activeHistoryId"
|
||||||
:history-list="historyList"
|
:history-list="historyList"
|
||||||
|
:tree-nodes="treeNodes"
|
||||||
|
:tree-loading="treeLoading"
|
||||||
@menu-change="handleMenuChange"
|
@menu-change="handleMenuChange"
|
||||||
@new-chat="handleCreateHistory"
|
@new-chat="handleCreateHistory"
|
||||||
@select-history="handleSelectHistory"
|
@select-history="handleSelectHistory"
|
||||||
@delete-history="handleDeleteHistory"
|
@delete-history="handleDeleteHistory"
|
||||||
|
@preview-node="previewNode"
|
||||||
|
@download-node="downloadNode"
|
||||||
/>
|
/>
|
||||||
<div class="main-wrapper">
|
<div class="main-wrapper">
|
||||||
<MainContent :active-menu="activeMenu" />
|
<MainContent :active-menu="activeMenu" />
|
||||||
<InputBar @send="handleSend" />
|
<InputBar @send="handleSend" />
|
||||||
</div>
|
</div>
|
||||||
<!-- 右侧:工作空间(树形结构) -->
|
|
||||||
<div class="workspace-panel">
|
|
||||||
<div class="workspace-tree-wrap" v-loading="treeLoading">
|
|
||||||
<el-empty v-if="!treeLoading && treeNodes.length === 0" description="暂无作品数据" />
|
|
||||||
<el-tree
|
|
||||||
v-else
|
|
||||||
:data="treeNodes"
|
|
||||||
node-key="id"
|
|
||||||
:props="treeProps"
|
|
||||||
default-expand-all
|
|
||||||
:highlight-current="true"
|
|
||||||
:expand-on-click-node="true"
|
|
||||||
@node-click="handleTreeNodeClick"
|
|
||||||
>
|
|
||||||
<template #default="{ data }">
|
|
||||||
<div
|
|
||||||
class="tree-node"
|
|
||||||
:class="[
|
|
||||||
data.nodeType === 'date' ? 'level-date' :
|
|
||||||
data.nodeType === 'contentType' ? 'level-flow' : 'level-file',
|
|
||||||
data.fileType ? data.fileType.replace(/\\/g, ' ').split(' ')[0] : ''
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<span class="ellipsis">{{ data.label }}</span>
|
|
||||||
<div v-if="data.nodeType === 'title' && data.fileUrl" class="tree-node-actions">
|
|
||||||
<el-button type="primary" link size="small" @click.stop="previewNode(data)"> 预览 </el-button>
|
|
||||||
<el-button type="primary" link size="small" @click.stop="downloadNode(data)"> 下载 </el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-tree>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 预览弹窗 - 放在外层,避免被右侧容器限制宽度 -->
|
<!-- 预览弹窗 -->
|
||||||
<el-dialog v-model="previewDialogVisible" title="预览" width="95%" top="2vh" :close-on-click-modal="false" destroy-on-close>
|
<el-dialog v-model="previewDialogVisible" title="预览" width="95%" top="2vh" :close-on-click-modal="false" destroy-on-close>
|
||||||
<div class="preview-container">
|
<div class="preview-container">
|
||||||
<el-image v-if="previewUrl && previewMode === 'image'" :src="previewUrl" fit="contain" style="width: 100%; height: 100%" />
|
<el-image v-if="previewUrl && previewMode === 'image'" :src="previewUrl" fit="contain" style="width: 100%; height: 100%" />
|
||||||
@@ -107,7 +78,6 @@ const historyList = ref<HistoryItem[]>([
|
|||||||
{ id: 4, title: '快捷回复产品设计', time: '2 天前' },
|
{ id: 4, title: '快捷回复产品设计', time: '2 天前' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const treeProps = { children: 'children', label: 'label' };
|
|
||||||
const apiBaseUrl = (import.meta.env.VITE_API_URL || '').replace(/\/$/, '');
|
const apiBaseUrl = (import.meta.env.VITE_API_URL || '').replace(/\/$/, '');
|
||||||
|
|
||||||
const joinUrl = (b: string, p: string) => `${b.replace(/\/$/, '')}${p.startsWith('/') ? p : `/${p}`}`;
|
const joinUrl = (b: string, p: string) => `${b.replace(/\/$/, '')}${p.startsWith('/') ? p : `/${p}`}`;
|
||||||
@@ -155,15 +125,15 @@ const mockTreeData: ExecutionTreeItem[] = [
|
|||||||
flowName: '代码审查任务',
|
flowName: '代码审查任务',
|
||||||
sessionId: 'session-1',
|
sessionId: 'session-1',
|
||||||
items: [
|
items: [
|
||||||
{ label: '审查结果.md', content: 'https://placekitten.com/800/600', type: 'text/markdown' },
|
{ label: '审查结果.md', content: 'https://placekitten.com/800/600', type: 'text/markdown', timestamp: '' },
|
||||||
{ label: '流程图.png', content: 'https://placekitten.com/800/600', type: 'image/png' },
|
{ label: '流程图.png', content: 'https://placekitten.com/800/600', type: 'image/png', timestamp: '' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Id: 2,
|
Id: 2,
|
||||||
flowName: '需求分析',
|
flowName: '需求分析',
|
||||||
sessionId: 'session-2',
|
sessionId: 'session-2',
|
||||||
items: [{ label: '需求拆解.txt', content: '# 需求分析结果\n\n- 功能点一\n- 功能点二\n- 需要优化', type: 'text/plain' }],
|
items: [{ label: '需求拆解.txt', content: '# 需求分析结果\n\n- 功能点一\n- 功能点二\n- 需要优化', type: 'text/plain', timestamp: '' }],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -174,7 +144,7 @@ const mockTreeData: ExecutionTreeItem[] = [
|
|||||||
Id: 3,
|
Id: 3,
|
||||||
flowName: '生成演示视频',
|
flowName: '生成演示视频',
|
||||||
sessionId: 'session-3',
|
sessionId: 'session-3',
|
||||||
items: [{ label: '输出视频.mp4', content: 'https://www.w3schools.com/html/mov_bbb.mp4', type: 'video/mp4' }],
|
items: [{ label: '输出视频.mp4', content: 'https://www.w3schools.com/html/mov_bbb.mp4', type: 'video/mp4', timestamp: '' }],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -230,10 +200,6 @@ const downloadNode = (data: TreeNode) => {
|
|||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleTreeNodeClick = () => {
|
|
||||||
// 点击节点不需要额外操作
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMenuChange = (menu: string) => {
|
const handleMenuChange = (menu: string) => {
|
||||||
activeMenu.value = menu;
|
activeMenu.value = menu;
|
||||||
};
|
};
|
||||||
@@ -311,151 +277,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 右侧工作空间面板 - 渐变玻璃风格 */
|
|
||||||
.workspace-panel {
|
|
||||||
width: 260px;
|
|
||||||
background: linear-gradient(
|
|
||||||
180deg,
|
|
||||||
rgba(255, 255, 255, 0.85) 0%,
|
|
||||||
rgba(249, 251, 255, 0.7) 50%,
|
|
||||||
rgba(235, 241, 252, 0.6) 100%
|
|
||||||
);
|
|
||||||
border-left: 1px solid rgba(59, 130, 246, 0.15);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
|
||||||
box-shadow: -6px 0 35px rgba(59, 130, 246, 0.08);
|
|
||||||
backdrop-filter: blur(16px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.workspace-tree-wrap {
|
|
||||||
flex: 1;
|
|
||||||
padding: 8px 8px 12px;
|
|
||||||
overflow-y: auto;
|
|
||||||
scrollbar-width: none;
|
|
||||||
-ms-overflow-style: none;
|
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-tree) {
|
|
||||||
background: transparent;
|
|
||||||
|
|
||||||
.el-tree-node {
|
|
||||||
padding: 4px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 一级节点(日期)- 蓝色渐变
|
|
||||||
:deep(.level-date) .el-tree-node__content {
|
|
||||||
height: 42px;
|
|
||||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.20) 0%, rgba(59, 130, 246, 0.05) 100%);
|
|
||||||
border: 1px solid rgba(59, 130, 246, 0.28);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 二级节点(工作流)- 紫色渐变
|
|
||||||
:deep(.level-flow) .el-tree-node__content {
|
|
||||||
margin-left: 8px;
|
|
||||||
background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.03) 100%);
|
|
||||||
border: 1px solid rgba(139, 92, 246, 0.18);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 三级节点(文件)- 根据文件类型区分颜色
|
|
||||||
:deep(.level-file.image) .el-tree-node__content,
|
|
||||||
:deep(.level-file.jpg) .el-tree-node__content,
|
|
||||||
:deep(.level-file.png) .el-tree-node__content,
|
|
||||||
:deep(.level-file.gif) .el-tree-node__content {
|
|
||||||
margin-left: 16px;
|
|
||||||
background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.04) 100%);
|
|
||||||
border: 1px solid rgba(16, 185, 129, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.level-file.video) .el-tree-node__content,
|
|
||||||
:deep(.level-file.mp4) .el-tree-node__content,
|
|
||||||
:deep(.level-file.webm) .el-tree-node__content {
|
|
||||||
margin-left: 16px;
|
|
||||||
background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.04) 100%);
|
|
||||||
border: 1px solid rgba(245, 158, 11, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.level-file.audio) .el-tree-node__content,
|
|
||||||
:deep(.level-file.mp3) .el-tree-node__content,
|
|
||||||
:deep(.level-file.wav) .el-tree-node__content {
|
|
||||||
margin-left: 16px;
|
|
||||||
background: linear-gradient(135deg, rgba(236, 72, 153, 0.18) 0%, rgba(236, 72, 153, 0.04) 100%);
|
|
||||||
border: 1px solid rgba(236, 72, 153, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.level-file.text) .el-tree-node__content,
|
|
||||||
:deep(.level-file.md) .el-tree-node__content,
|
|
||||||
:deep(.level-file.txt) .el-tree-node__content,
|
|
||||||
:deep(.level-file.markdown) .el-tree-node__content {
|
|
||||||
margin-left: 16px;
|
|
||||||
background: linear-gradient(135deg, rgba(79, 70, 229, 0.18) 0%, rgba(79, 70, 229, 0.04) 100%);
|
|
||||||
border: 1px solid rgba(79, 70, 229, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 默认其他文件
|
|
||||||
:deep(.level-file:not(.image):not(.video):not(.audio):not(.text)) .el-tree-node__content {
|
|
||||||
margin-left: 16px;
|
|
||||||
background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(100, 116, 139, 0.04) 100%);
|
|
||||||
border: 1px solid rgba(100, 116, 139, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree-node__content {
|
|
||||||
height: 38px;
|
|
||||||
line-height: 38px;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: 2px 0;
|
|
||||||
backdrop-filter: blur(8px);
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-width: 2px;
|
|
||||||
transform: translateX(2px);
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree-node.is-current > .el-tree-node__content {
|
|
||||||
border-width: 2px;
|
|
||||||
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree-node__expand-icon {
|
|
||||||
color: rgba(59, 130, 246, 0.7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-node {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: 100%;
|
|
||||||
gap: 6px;
|
|
||||||
|
|
||||||
.ellipsis {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #1e293b;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-node-actions {
|
|
||||||
flex-shrink: 0;
|
|
||||||
.el-button {
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 2px 4px;
|
|
||||||
margin: 0;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.preview-container {
|
.preview-container {
|
||||||
max-height: 85vh;
|
max-height: 85vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default defineComponent({
|
|||||||
isShowPassword: false,
|
isShowPassword: false,
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: '123456',
|
password: 'Tongli686^*^',
|
||||||
verifyCode: '',
|
verifyCode: '',
|
||||||
verifyKey: '',
|
verifyKey: '',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,221 +1,540 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="cid-apis-container">
|
<div class="cid-apis-container">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover"
|
||||||
<div class="system-user-search mb15">
|
><el-tabs v-model="tab" @tab-change="onTab"
|
||||||
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
|
><el-tab-pane label="平台管理" name="platform"
|
||||||
<el-form-item label="关键字" prop="keyword">
|
><el-form ref="pqf" :model="pq" :inline="true" label-width="68px" class="mb15"
|
||||||
<el-input
|
><el-form-item label="关键字" prop="keyword"
|
||||||
v-model="tableData.param.keyword"
|
><el-input
|
||||||
placeholder="请输入接口名称"
|
v-model="pq.keyword"
|
||||||
clearable
|
placeholder="请输入平台名称/编码"
|
||||||
size="default"
|
clearable
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
@keyup.enter.native="getList"
|
@keyup.enter.native="searchPlatform" /></el-form-item
|
||||||
/>
|
><el-form-item label="状态" prop="status"
|
||||||
</el-form-item>
|
><el-select v-model="pq.status" placeholder="平台状态" clearable style="width: 160px"
|
||||||
<el-form-item>
|
><el-option label="启用" value="ACTIVE" /><el-option label="禁用" value="INACTIVE" /></el-select></el-form-item
|
||||||
<el-button size="default" type="primary" @click="getList">
|
><el-form-item
|
||||||
<el-icon><ele-Search /></el-icon>
|
><el-button type="primary" @click="searchPlatform"
|
||||||
查询
|
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||||
</el-button>
|
><el-button @click="resetPlatformQuery"
|
||||||
<el-button size="default" @click="resetQuery(queryRef)">
|
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||||
<el-icon><ele-Refresh /></el-icon>
|
><el-button type="success" @click="openPlatform()"
|
||||||
重置
|
><el-icon><ele-FolderAdd /></el-icon>新增平台</el-button
|
||||||
</el-button>
|
></el-form-item
|
||||||
<el-button size="default" type="success" @click="onOpenAdd">
|
></el-form
|
||||||
<el-icon><ele-FolderAdd /></el-icon>
|
><el-table :data="platformRows" row-key="id" v-loading="platformLoading"
|
||||||
新增接口
|
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||||
</el-button>
|
prop="platformCode"
|
||||||
<el-button size="default" type="danger" @click="onRowDel(null)">
|
label="平台编码"
|
||||||
<el-icon><ele-Delete /></el-icon>
|
min-width="140"
|
||||||
删除
|
show-overflow-tooltip
|
||||||
</el-button>
|
/><el-table-column prop="platformName" label="平台名称" min-width="160" show-overflow-tooltip /><el-table-column
|
||||||
</el-form-item>
|
prop="apiBaseUrl"
|
||||||
</el-form>
|
label="API地址"
|
||||||
</div>
|
min-width="220"
|
||||||
<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange">
|
show-overflow-tooltip
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
/><el-table-column prop="authType" label="认证" width="100" align="center" /><el-table-column
|
||||||
<el-table-column type="index" label="序号" width="60" />
|
prop="status"
|
||||||
<el-table-column prop="name" label="接口名称" show-overflow-tooltip />
|
label="状态"
|
||||||
<el-table-column prop="path" label="接口路径" show-overflow-tooltip />
|
width="90"
|
||||||
<el-table-column prop="method" label="请求方式" width="100" align="center" />
|
align="center"
|
||||||
<el-table-column prop="datasourceName" label="所属平台" show-overflow-tooltip />
|
><template #default="s"
|
||||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
><el-tag size="small" :type="s.row.status === 'ACTIVE' ? 'success' : 'danger'">{{
|
||||||
<template #default="scope">
|
s.row.status === 'ACTIVE' ? '启用' : '禁用'
|
||||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" size="small">
|
}}</el-tag></template
|
||||||
{{ scope.row.status === 1 ? '启用' : '禁用' }}
|
></el-table-column
|
||||||
</el-tag>
|
><el-table-column prop="rateLimitPerMinute" label="限流/分钟" width="110" align="center" /><el-table-column
|
||||||
</template>
|
prop="requestTimeoutMs"
|
||||||
</el-table-column>
|
label="超时(ms)"
|
||||||
<el-table-column prop="createdAt" label="创建时间" show-overflow-tooltip />
|
width="110"
|
||||||
<el-table-column label="操作" width="180">
|
align="center"
|
||||||
<template #default="scope">
|
/><el-table-column label="创建时间" width="170"
|
||||||
<el-button size="small" text type="primary" @click="onOpenEdit(scope.row)">修改</el-button>
|
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||||
<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
|
><el-table-column label="操作" width="150" fixed="right"
|
||||||
</template>
|
><template #default="s"
|
||||||
</el-table-column>
|
><el-button size="small" text type="primary" @click="openPlatform(s.row)">修改</el-button
|
||||||
</el-table>
|
><el-button size="small" text type="danger" @click="delPlatform(s.row)">删除</el-button></template
|
||||||
<pagination
|
></el-table-column
|
||||||
v-show="tableData.total > 0"
|
></el-table
|
||||||
:total="tableData.total"
|
><pagination :total="platformTotal" v-model:page="pq.pageNum" v-model:limit="pq.pageSize" @pagination="getPlatforms" /></el-tab-pane
|
||||||
v-model:page="tableData.param.pageNum"
|
><el-tab-pane label="接口管理" name="api"
|
||||||
v-model:limit="tableData.param.pageSize"
|
><el-form ref="aqf" :model="aq" :inline="true" label-width="68px" class="mb15"
|
||||||
@pagination="getList"
|
><el-form-item label="关键字" prop="keyword"
|
||||||
/>
|
><el-input
|
||||||
</el-card>
|
v-model="aq.keyword"
|
||||||
|
placeholder="请输入接口名称/编码"
|
||||||
<!-- 新增/编辑弹窗 -->
|
clearable
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" :close-on-click-modal="false">
|
style="width: 220px"
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="90px">
|
@keyup.enter.native="searchApi" /></el-form-item
|
||||||
<el-form-item label="接口名称" prop="name">
|
><el-form-item label="平台" prop="platformId"
|
||||||
<el-input v-model="form.name" placeholder="请输入接口名称" />
|
><el-select v-model="aq.platformId" placeholder="请选择平台" clearable filterable style="width: 180px"
|
||||||
</el-form-item>
|
><el-option v-for="i in platforms" :key="i.id" :label="i.platformName" :value="String(i.id)" /></el-select></el-form-item
|
||||||
<el-form-item label="接口路径" prop="path">
|
><el-form-item label="状态" prop="status"
|
||||||
<el-input v-model="form.path" placeholder="请输入接口路径" />
|
><el-select v-model="aq.status" placeholder="状态" clearable style="width: 130px"
|
||||||
</el-form-item>
|
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item
|
||||||
<el-form-item label="请求方式" prop="method">
|
><el-form-item label="方法" prop="method"
|
||||||
<el-select v-model="form.method" style="width: 100%">
|
><el-select v-model="aq.method" placeholder="请求方式" clearable style="width: 130px"
|
||||||
<el-option label="GET" value="GET" />
|
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item
|
||||||
<el-option label="POST" value="POST" />
|
><el-form-item
|
||||||
<el-option label="PUT" value="PUT" />
|
><el-button type="primary" @click="searchApi"
|
||||||
<el-option label="DELETE" value="DELETE" />
|
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||||
</el-select>
|
><el-button @click="resetApiQuery"
|
||||||
</el-form-item>
|
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||||
<el-form-item label="所属平台" prop="datasourceId">
|
><el-button type="success" @click="openApi()"
|
||||||
<el-input v-model="form.datasourceId" placeholder="请输入所属平台ID" />
|
><el-icon><ele-FolderAdd /></el-icon>新增接口</el-button
|
||||||
</el-form-item>
|
></el-form-item
|
||||||
<el-form-item label="描述" prop="description">
|
></el-form
|
||||||
<el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述" />
|
><el-table :data="apiRows" v-loading="apiLoading"
|
||||||
</el-form-item>
|
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||||
<el-form-item label="状态" prop="status">
|
prop="code"
|
||||||
<el-select v-model="form.status" style="width: 100%">
|
label="接口编码"
|
||||||
<el-option label="启用" :value="1" />
|
min-width="140"
|
||||||
<el-option label="禁用" :value="0" />
|
show-overflow-tooltip
|
||||||
</el-select>
|
/><el-table-column prop="name" label="接口名称" min-width="150" show-overflow-tooltip /><el-table-column
|
||||||
</el-form-item>
|
prop="url"
|
||||||
</el-form>
|
label="URL"
|
||||||
<template #footer>
|
min-width="220"
|
||||||
<el-button @click="dialog.visible = false">取消</el-button>
|
show-overflow-tooltip
|
||||||
<el-button type="primary" @click="onSubmit" :loading="dialog.saving">确定</el-button>
|
/><el-table-column prop="method" label="请求方式" width="100" align="center"
|
||||||
</template>
|
><template #default="s"
|
||||||
</el-dialog>
|
><el-tag size="small" :type="s.row.method === 'GET' ? 'success' : 'primary'">{{ s.row.method }}</el-tag></template
|
||||||
|
></el-table-column
|
||||||
|
><el-table-column prop="status" label="状态" width="90" align="center"
|
||||||
|
><template #default="s"
|
||||||
|
><el-tag size="small" :type="ns(s.row.status) === 'active' ? 'success' : 'danger'">{{
|
||||||
|
ns(s.row.status) === 'active' ? '启用' : '禁用'
|
||||||
|
}}</el-tag></template
|
||||||
|
></el-table-column
|
||||||
|
><el-table-column prop="platformName" label="所属平台" min-width="140" show-overflow-tooltip /> ><el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
width="170"
|
||||||
|
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||||
|
><el-table-column label="操作" width="160" fixed="right"
|
||||||
|
><template #default="s"
|
||||||
|
><el-button size="small" text type="primary" @click="openApi(String(s.row.id))">修改</el-button
|
||||||
|
><el-button size="small" text type="danger" @click="delApi(s.row)">删除</el-button></template
|
||||||
|
></el-table-column
|
||||||
|
></el-table
|
||||||
|
><pagination :total="apiTotal" v-model:page="aq.pageNum" v-model:limit="aq.pageSize" @pagination="getApis" /></el-tab-pane></el-tabs
|
||||||
|
></el-card>
|
||||||
|
<el-dialog v-model="platformDialog.visible" :title="platformDialog.title" width="720px" :close-on-click-modal="false" destroy-on-close
|
||||||
|
><el-form ref="platformFormRef" :model="platformForm" :rules="platformRules" label-width="120px" v-loading="platformDialog.loading"
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="平台编码" prop="platformCode"><el-input v-model="platformForm.platformCode" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="平台名称" prop="platformName"><el-input v-model="platformForm.platformName" /></el-form-item></el-col></el-row
|
||||||
|
><el-form-item label="平台描述"><el-input v-model="platformForm.description" type="textarea" :rows="3" /></el-form-item
|
||||||
|
><el-form-item label="API地址"><el-input v-model="platformForm.apiBaseUrl" /></el-form-item
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="认证类型" prop="authType"
|
||||||
|
><el-select v-model="platformForm.authType" style="width: 100%"
|
||||||
|
><el-option label="Token" value="TOKEN" /><el-option label="API Key" value="API_KEY" /><el-option
|
||||||
|
label="OAuth2"
|
||||||
|
value="OAUTH2" /><el-option label="Basic" value="BASIC" /></el-select></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="状态" prop="status"
|
||||||
|
><el-select v-model="platformForm.status" style="width: 100%"
|
||||||
|
><el-option label="启用" value="ACTIVE" /><el-option label="停用" value="INACTIVE" /></el-select></el-form-item></el-col></el-row
|
||||||
|
><el-form-item label="Token/密钥"><el-input v-model="platformForm.token" show-password /></el-form-item
|
||||||
|
><el-form-item label="API Key"><el-input v-model="platformForm.apiKey" show-password /></el-form-item
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="Client ID"><el-input v-model="platformForm.clientId" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="Client Secret"><el-input v-model="platformForm.clientSecret" show-password /></el-form-item></el-col></el-row
|
||||||
|
><el-form-item label="认证配置 JSON" prop="authConfigText"
|
||||||
|
><el-input v-model="platformForm.authConfigText" type="textarea" :rows="6" /></el-form-item
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="限流/分钟"
|
||||||
|
><el-input-number v-model="platformForm.rateLimitPerMinute" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="限流/小时"
|
||||||
|
><el-input-number v-model="platformForm.rateLimitPerHour" :min="0" style="width: 100%" /></el-form-item></el-col></el-row
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="并发限制"
|
||||||
|
><el-input-number v-model="platformForm.concurrencyLimit" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="超时(ms)"
|
||||||
|
><el-input-number v-model="platformForm.requestTimeoutMs" :min="0" style="width: 100%" /></el-form-item></el-col></el-row
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="最大重试"><el-input-number v-model="platformForm.maxRetries" :min="0" style="width: 100%" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="重试延迟(ms)"
|
||||||
|
><el-input-number v-model="platformForm.retryDelayMs" :min="0" style="width: 100%" /></el-form-item></el-col></el-row></el-form
|
||||||
|
><template #footer
|
||||||
|
><el-button @click="platformDialog.visible = false">取消</el-button
|
||||||
|
><el-button type="primary" :loading="platformDialog.saving" @click="savePlatform">确定</el-button></template
|
||||||
|
></el-dialog
|
||||||
|
><el-dialog v-model="apiDialog.visible" :title="apiDialog.title" width="780px" :close-on-click-modal="false" destroy-on-close
|
||||||
|
><el-form ref="apiFormRef" :model="apiForm" :rules="apiRules" label-width="110px" v-loading="apiDialog.loading"
|
||||||
|
><el-form-item label="所属平台" prop="platformId"
|
||||||
|
><el-select v-model="apiForm.platformId" style="width: 100%" filterable
|
||||||
|
><el-option v-for="i in platforms" :key="i.id" :label="i.platformName" :value="String(i.id)" /></el-select></el-form-item
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="接口编码" prop="code"><el-input v-model="apiForm.code" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="接口名称" prop="name"><el-input v-model="apiForm.name" /></el-form-item></el-col></el-row
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="URL" prop="url"><el-input v-model="apiForm.url" /></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="请求方式" prop="method"
|
||||||
|
><el-select v-model="apiForm.method" style="width: 100%"
|
||||||
|
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item></el-col></el-row
|
||||||
|
><el-row :gutter="16"
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="状态" prop="status"
|
||||||
|
><el-select v-model="apiForm.status" style="width: 100%"
|
||||||
|
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item></el-col
|
||||||
|
><el-col :span="12"
|
||||||
|
><el-form-item label="认证类型"
|
||||||
|
><el-select v-model="apiForm.authType" style="width: 100%" clearable
|
||||||
|
><el-option label="Token" value="TOKEN" /><el-option label="API Key" value="API_KEY" /><el-option
|
||||||
|
label="OAuth2"
|
||||||
|
value="OAUTH2" /><el-option label="APP_SIGNATURE" value="APP_SIGNATURE" /></el-select></el-form-item></el-col></el-row
|
||||||
|
><el-form-item label="请求配置 JSON" prop="requestConfigText"
|
||||||
|
><el-input v-model="apiForm.requestConfigText" type="textarea" :rows="6" /></el-form-item
|
||||||
|
><el-form-item label="响应配置 JSON" prop="responseConfigText"
|
||||||
|
><el-input v-model="apiForm.responseConfigText" type="textarea" :rows="5" /></el-form-item
|
||||||
|
><el-form-item label="限流配置 JSON" prop="limitConfigText"
|
||||||
|
><el-input v-model="apiForm.limitConfigText" type="textarea" :rows="4" /></el-form-item
|
||||||
|
><el-form-item label="表结构定义 JSON" prop="tableDefinitionText"
|
||||||
|
><el-input v-model="apiForm.tableDefinitionText" type="textarea" :rows="6" /></el-form-item></el-form
|
||||||
|
><template #footer
|
||||||
|
><el-button @click="apiDialog.visible = false">取消</el-button
|
||||||
|
><el-button type="primary" :loading="apiDialog.saving" @click="saveApi">确定</el-button></template
|
||||||
|
></el-dialog
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
export default { name: 'cidApis' };
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
import type { FormInstance, FormRules } from 'element-plus';
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
const queryRef = ref<FormInstance>();
|
import { getApiErrorMessage } from '/@/utils/request';
|
||||||
const formRef = ref<FormInstance>();
|
import {
|
||||||
const ids = ref<string[]>([]);
|
createDatasourcePlatform,
|
||||||
|
deleteDatasourcePlatform,
|
||||||
const tableData = reactive({
|
getDatasourcePlatform,
|
||||||
data: [] as any[],
|
listDatasourcePlatforms,
|
||||||
total: 0,
|
updateDatasourcePlatform,
|
||||||
param: {
|
} from '/@/api/cid/datasource';
|
||||||
pageNum: 1,
|
import {
|
||||||
pageSize: 10,
|
createApiInterface,
|
||||||
keyword: '',
|
deleteApiInterface,
|
||||||
},
|
getApiInterface,
|
||||||
});
|
listApiInterfaces,
|
||||||
|
updateApiInterface,
|
||||||
const dialog = reactive({
|
type ApiInterfaceInfo,
|
||||||
visible: false,
|
} from '/@/api/cid/apis';
|
||||||
title: '',
|
defineOptions({ name: 'cidApis' });
|
||||||
saving: false,
|
const tab = ref('platform'),
|
||||||
});
|
methods = ['GET', 'POST', 'PUT', 'DELETE'],
|
||||||
|
platforms = ref<any[]>([]),
|
||||||
const form = reactive({
|
platformRows = ref<any[]>([]),
|
||||||
|
apiRows = ref<ApiInterfaceInfo[]>([]),
|
||||||
|
platformTotal = ref(0),
|
||||||
|
apiTotal = ref(0),
|
||||||
|
platformLoading = ref(false),
|
||||||
|
apiLoading = ref(false);
|
||||||
|
const pqf = ref<FormInstance>(),
|
||||||
|
aqf = ref<FormInstance>(),
|
||||||
|
platformFormRef = ref<FormInstance>(),
|
||||||
|
apiFormRef = ref<FormInstance>();
|
||||||
|
const pq = reactive({ pageNum: 1, pageSize: 10, keyword: '', status: '' }),
|
||||||
|
aq = reactive({ pageNum: 1, pageSize: 10, keyword: '', platformId: '', status: '', method: '' });
|
||||||
|
const platformDialog = reactive({ visible: false, title: '', loading: false, saving: false }),
|
||||||
|
apiDialog = reactive({ visible: false, title: '', loading: false, saving: false });
|
||||||
|
const dpf = () => ({
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
platformCode: '',
|
||||||
path: '',
|
platformName: '',
|
||||||
method: 'GET',
|
|
||||||
datasourceId: '',
|
|
||||||
description: '',
|
description: '',
|
||||||
status: 1,
|
apiBaseUrl: '',
|
||||||
|
authType: 'TOKEN',
|
||||||
|
status: 'ACTIVE',
|
||||||
|
token: '',
|
||||||
|
apiKey: '',
|
||||||
|
clientId: '',
|
||||||
|
clientSecret: '',
|
||||||
|
authConfigText: '{}',
|
||||||
|
rateLimitPerMinute: 60,
|
||||||
|
rateLimitPerHour: 1000,
|
||||||
|
concurrencyLimit: 10,
|
||||||
|
requestTimeoutMs: 30000,
|
||||||
|
maxRetries: 3,
|
||||||
|
retryDelayMs: 1000,
|
||||||
});
|
});
|
||||||
|
const daf = () => ({
|
||||||
const rules = {
|
id: '',
|
||||||
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
platformId: '',
|
||||||
path: [{ required: true, message: '请输入接口路径', trigger: 'blur' }],
|
code: '',
|
||||||
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
name: '',
|
||||||
};
|
url: '',
|
||||||
|
method: 'GET',
|
||||||
const getList = () => {
|
status: 'active',
|
||||||
// TODO: 调用列表接口
|
authType: '',
|
||||||
};
|
requestConfigText: '{}',
|
||||||
|
responseConfigText: '{}',
|
||||||
const resetQuery = (formEl: FormInstance | undefined) => {
|
limitConfigText: '{}',
|
||||||
if (!formEl) return;
|
tableDefinitionText: '{}',
|
||||||
formEl.resetFields();
|
});
|
||||||
getList();
|
const platformForm = reactive(dpf()),
|
||||||
};
|
apiForm = reactive(daf());
|
||||||
|
const jv = (v: string, cb: (e?: Error) => void, l: string) => {
|
||||||
const handleSelectionChange = (selection: any[]) => {
|
if (!v) return cb();
|
||||||
ids.value = selection.map((item) => item.id);
|
try {
|
||||||
};
|
JSON.parse(v);
|
||||||
|
cb();
|
||||||
const onOpenAdd = () => {
|
} catch {
|
||||||
dialog.title = '新增接口';
|
cb(new Error(`${l} 格式错误`));
|
||||||
dialog.visible = true;
|
|
||||||
form.id = '';
|
|
||||||
form.name = '';
|
|
||||||
form.path = '';
|
|
||||||
form.method = 'GET';
|
|
||||||
form.datasourceId = '';
|
|
||||||
form.description = '';
|
|
||||||
form.status = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
const onOpenEdit = (row: any) => {
|
|
||||||
dialog.title = '修改接口';
|
|
||||||
dialog.visible = true;
|
|
||||||
form.id = row.id;
|
|
||||||
form.name = row.name;
|
|
||||||
form.path = row.path;
|
|
||||||
form.method = row.method;
|
|
||||||
form.datasourceId = row.datasourceId;
|
|
||||||
form.description = row.description;
|
|
||||||
form.status = row.status;
|
|
||||||
};
|
|
||||||
|
|
||||||
const onSubmit = () => {
|
|
||||||
if (!formRef.value) return;
|
|
||||||
formRef.value.validate((valid) => {
|
|
||||||
if (!valid) return;
|
|
||||||
dialog.saving = true;
|
|
||||||
// TODO: 调用新增/编辑接口
|
|
||||||
dialog.saving = false;
|
|
||||||
dialog.visible = false;
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const onRowDel = (row: any) => {
|
|
||||||
const delIds = row ? [row.id] : ids.value;
|
|
||||||
if (delIds.length === 0) {
|
|
||||||
ElMessage.error('请选择要删除的数据');
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(`确定要删除选中的接口吗?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
// TODO: 调用删除接口
|
|
||||||
ElMessage.success('删除成功');
|
|
||||||
getList();
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
};
|
||||||
|
const platformRules: FormRules = {
|
||||||
onMounted(() => {
|
platformCode: [{ required: true, message: '请输入平台编码', trigger: 'blur' }],
|
||||||
getList();
|
platformName: [{ required: true, message: '请输入平台名称', trigger: 'blur' }],
|
||||||
|
authType: [{ required: true, message: '请选择认证类型', trigger: 'change' }],
|
||||||
|
authConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '认证配置 JSON'), trigger: 'blur' }],
|
||||||
|
};
|
||||||
|
const apiRules: FormRules = {
|
||||||
|
platformId: [{ required: true, message: '请选择所属平台', trigger: 'change' }],
|
||||||
|
code: [{ required: true, message: '请输入接口编码', trigger: 'blur' }],
|
||||||
|
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
||||||
|
url: [{ required: true, message: '请输入接口 URL', trigger: 'blur' }],
|
||||||
|
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
||||||
|
requestConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '请求配置 JSON'), trigger: 'blur' }],
|
||||||
|
responseConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '响应配置 JSON'), trigger: 'blur' }],
|
||||||
|
limitConfigText: [{ validator: (_r, v, cb) => jv(v, cb, '接口独立限流配置 JSON'), trigger: 'blur' }],
|
||||||
|
tableDefinitionText: [{ validator: (_r, v, cb) => jv(v, cb, '表结构定义 JSON'), trigger: 'blur' }],
|
||||||
|
};
|
||||||
|
const ft = (t?: number) => (!t ? '' : new Date(String(t).length === 10 ? t * 1000 : t).toLocaleString('zh-CN', { hour12: false })),
|
||||||
|
ns = (s?: string) => (String(s || '').toLowerCase() === 'active' ? 'active' : 'inactive');
|
||||||
|
const loadPlatforms = async () => {
|
||||||
|
const r = await listDatasourcePlatforms({ pageNum: 1, pageSize: 100 });
|
||||||
|
platforms.value = r.data?.list || [];
|
||||||
|
};
|
||||||
|
const getPlatforms = async () => {
|
||||||
|
platformLoading.value = true;
|
||||||
|
try {
|
||||||
|
const r = await listDatasourcePlatforms({
|
||||||
|
pageNum: pq.pageNum,
|
||||||
|
pageSize: pq.pageSize,
|
||||||
|
...(pq.keyword ? { keyword: pq.keyword } : {}),
|
||||||
|
...(pq.status ? { status: pq.status } : {}),
|
||||||
|
});
|
||||||
|
platformRows.value = r.data?.list || [];
|
||||||
|
platformTotal.value = r.data?.total || 0;
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || '获取平台列表失败');
|
||||||
|
} finally {
|
||||||
|
platformLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const getApis = async () => {
|
||||||
|
apiLoading.value = true;
|
||||||
|
try {
|
||||||
|
const r = await listApiInterfaces({
|
||||||
|
pageNum: aq.pageNum,
|
||||||
|
pageSize: aq.pageSize,
|
||||||
|
...(aq.keyword ? { keyword: aq.keyword } : {}),
|
||||||
|
...(aq.platformId ? { platformId: aq.platformId } : {}),
|
||||||
|
...(aq.status ? { status: aq.status } : {}),
|
||||||
|
...(aq.method ? { method: aq.method } : {}),
|
||||||
|
});
|
||||||
|
apiRows.value = r.data?.list || [];
|
||||||
|
apiTotal.value = r.data?.total || 0;
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || '获取接口列表失败');
|
||||||
|
} finally {
|
||||||
|
apiLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onTab = () => (tab.value === 'platform' ? getPlatforms() : getApis());
|
||||||
|
const searchPlatform = () => {
|
||||||
|
pq.pageNum = 1;
|
||||||
|
getPlatforms();
|
||||||
|
};
|
||||||
|
const searchApi = () => {
|
||||||
|
aq.pageNum = 1;
|
||||||
|
getApis();
|
||||||
|
};
|
||||||
|
const resetPlatformQuery = () => {
|
||||||
|
pqf.value?.resetFields();
|
||||||
|
searchPlatform();
|
||||||
|
};
|
||||||
|
const resetApiQuery: any = () => {
|
||||||
|
aqf.value?.resetFields();
|
||||||
|
searchApi();
|
||||||
|
};
|
||||||
|
const openPlatform = async (row?: any) => {
|
||||||
|
Object.assign(platformForm, dpf());
|
||||||
|
platformFormRef.value?.clearValidate();
|
||||||
|
platformDialog.title = row ? '编辑平台' : '新建平台';
|
||||||
|
platformDialog.visible = true;
|
||||||
|
if (!row) return;
|
||||||
|
platformDialog.loading = true;
|
||||||
|
try {
|
||||||
|
const r = await getDatasourcePlatform(row.id);
|
||||||
|
const d = r.data || {};
|
||||||
|
Object.assign(platformForm, {
|
||||||
|
id: String(d.id || row.id),
|
||||||
|
platformCode: d.platformCode || '',
|
||||||
|
platformName: d.platformName || '',
|
||||||
|
description: d.description || '',
|
||||||
|
apiBaseUrl: d.apiBaseUrl || '',
|
||||||
|
authType: d.authType || 'TOKEN',
|
||||||
|
status: d.status || 'ACTIVE',
|
||||||
|
token: d.token || '',
|
||||||
|
apiKey: d.apiKey || '',
|
||||||
|
clientId: d.clientId || '',
|
||||||
|
clientSecret: d.clientSecret || '',
|
||||||
|
authConfigText: JSON.stringify(d.authConfig ?? {}, null, 2),
|
||||||
|
rateLimitPerMinute: d.rateLimitPerMinute ?? 60,
|
||||||
|
rateLimitPerHour: d.rateLimitPerHour ?? 1000,
|
||||||
|
concurrencyLimit: d.concurrencyLimit ?? 10,
|
||||||
|
requestTimeoutMs: d.requestTimeoutMs ?? 30000,
|
||||||
|
maxRetries: d.maxRetries ?? 3,
|
||||||
|
retryDelayMs: d.retryDelayMs ?? 1000,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
platformDialog.visible = false;
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || '获取平台详情失败');
|
||||||
|
} finally {
|
||||||
|
platformDialog.loading = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const savePlatform = async () => {
|
||||||
|
if (!platformFormRef.value) return;
|
||||||
|
const ok = await platformFormRef.value.validate().catch(() => false);
|
||||||
|
if (!ok) return;
|
||||||
|
platformDialog.saving = true;
|
||||||
|
try {
|
||||||
|
const p = {
|
||||||
|
platformCode: platformForm.platformCode,
|
||||||
|
platformName: platformForm.platformName,
|
||||||
|
description: platformForm.description,
|
||||||
|
apiBaseUrl: platformForm.apiBaseUrl,
|
||||||
|
authType: platformForm.authType,
|
||||||
|
status: platformForm.status,
|
||||||
|
token: platformForm.token,
|
||||||
|
apiKey: platformForm.apiKey,
|
||||||
|
clientId: platformForm.clientId,
|
||||||
|
clientSecret: platformForm.clientSecret,
|
||||||
|
authConfig: JSON.parse(platformForm.authConfigText || '{}'),
|
||||||
|
rateLimitPerMinute: platformForm.rateLimitPerMinute || 60,
|
||||||
|
rateLimitPerHour: platformForm.rateLimitPerHour || 1000,
|
||||||
|
concurrencyLimit: platformForm.concurrencyLimit || 10,
|
||||||
|
requestTimeoutMs: platformForm.requestTimeoutMs || 30000,
|
||||||
|
maxRetries: platformForm.maxRetries || 3,
|
||||||
|
retryDelayMs: platformForm.retryDelayMs || 1000,
|
||||||
|
};
|
||||||
|
platformForm.id ? await updateDatasourcePlatform({ id: platformForm.id, ...p }) : await createDatasourcePlatform(p);
|
||||||
|
ElMessage.success(platformForm.id ? '更新成功' : '创建成功');
|
||||||
|
platformDialog.visible = false;
|
||||||
|
await Promise.all([getPlatforms(), loadPlatforms()]);
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || (platformForm.id ? '更新失败' : '创建失败'));
|
||||||
|
} finally {
|
||||||
|
platformDialog.saving = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const delPlatform = (row: any) => {
|
||||||
|
const ids = [row.id];
|
||||||
|
ElMessageBox.confirm(`确定删除平台「${row.platformName}」吗?`, '提示', { type: 'warning' })
|
||||||
|
.then(async () => {
|
||||||
|
try {
|
||||||
|
for (const id of ids) await deleteDatasourcePlatform(id);
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
await Promise.all([getPlatforms(), loadPlatforms()]);
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || '删除失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => undefined);
|
||||||
|
};
|
||||||
|
const openApi = async (id = '', platformId = '') => {
|
||||||
|
Object.assign(apiForm, daf(), platformId ? { platformId } : {});
|
||||||
|
apiFormRef.value?.clearValidate();
|
||||||
|
if (!platforms.value.length) await loadPlatforms();
|
||||||
|
apiDialog.title = id ? '编辑接口' : '新建接口';
|
||||||
|
apiDialog.visible = true;
|
||||||
|
if (!id) return;
|
||||||
|
apiDialog.loading = true;
|
||||||
|
try {
|
||||||
|
const r = await getApiInterface(id);
|
||||||
|
const d = r.data || {};
|
||||||
|
Object.assign(apiForm, {
|
||||||
|
id: String(d.id || id),
|
||||||
|
platformId: String(d.platformId || platformId || ''),
|
||||||
|
code: d.code || '',
|
||||||
|
name: d.name || '',
|
||||||
|
url: d.url || '',
|
||||||
|
method: d.method || 'GET',
|
||||||
|
status: ns(d.status),
|
||||||
|
authType: d.authType || '',
|
||||||
|
requestConfigText: JSON.stringify(d.requestConfig ?? {}, null, 2),
|
||||||
|
responseConfigText: JSON.stringify(d.responseConfig ?? {}, null, 2),
|
||||||
|
limitConfigText: JSON.stringify(d.limitConfig ?? {}, null, 2),
|
||||||
|
tableDefinitionText: JSON.stringify(d.tableDefinition ?? {}, null, 2),
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
apiDialog.visible = false;
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || '获取接口详情失败');
|
||||||
|
} finally {
|
||||||
|
apiDialog.loading = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const saveApi = async () => {
|
||||||
|
if (!apiFormRef.value) return;
|
||||||
|
const ok = await apiFormRef.value.validate().catch(() => false);
|
||||||
|
if (!ok) return;
|
||||||
|
apiDialog.saving = true;
|
||||||
|
try {
|
||||||
|
const p = {
|
||||||
|
platformId: Number(apiForm.platformId),
|
||||||
|
code: apiForm.code,
|
||||||
|
name: apiForm.name,
|
||||||
|
url: apiForm.url,
|
||||||
|
method: apiForm.method,
|
||||||
|
status: apiForm.status,
|
||||||
|
authType: apiForm.authType || undefined,
|
||||||
|
requestConfig: JSON.parse(apiForm.requestConfigText || '{}'),
|
||||||
|
responseConfig: JSON.parse(apiForm.responseConfigText || '{}'),
|
||||||
|
limitConfig: JSON.parse(apiForm.limitConfigText || '{}'),
|
||||||
|
tableDefinition: JSON.parse(apiForm.tableDefinitionText || '{}'),
|
||||||
|
};
|
||||||
|
apiForm.id ? await updateApiInterface({ id: apiForm.id, ...p }) : await createApiInterface(p);
|
||||||
|
ElMessage.success(apiForm.id ? '更新成功' : '创建成功');
|
||||||
|
apiDialog.visible = false;
|
||||||
|
await getApis();
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || (apiForm.id ? '更新失败' : '创建失败'));
|
||||||
|
} finally {
|
||||||
|
apiDialog.saving = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const delApi = (row: any) => {
|
||||||
|
ElMessageBox.confirm(`确定删除接口「${row.name}」吗?`, '提示', { type: 'warning' })
|
||||||
|
.then(async () => {
|
||||||
|
try {
|
||||||
|
await deleteApiInterface(String(row.id));
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
await getApis();
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error(getApiErrorMessage(e) || '删除失败');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => undefined);
|
||||||
|
};
|
||||||
|
onMounted(async () => {
|
||||||
|
await loadPlatforms();
|
||||||
|
await Promise.all([getPlatforms(), getApis()]);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
68
src/views/settings/creation/component/PromptSelector.vue
Normal file
68
src/views/settings/creation/component/PromptSelector.vue
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="visible" title="编辑提示词" width="720px" :close-on-click-modal="false" destroy-on-close @close="handleClose">
|
||||||
|
<div class="prompt-input-dialog">
|
||||||
|
<el-input v-model="promptContent" type="textarea" :rows="12" maxlength="5000" show-word-limit placeholder="请输入提示词内容" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="handleClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watch } from 'vue';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
modelValue: boolean;
|
||||||
|
defaultPrompt?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Emits {
|
||||||
|
(e: 'update:modelValue', value: boolean): void;
|
||||||
|
(e: 'confirm', promptContent: string): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
modelValue: false,
|
||||||
|
defaultPrompt: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits<Emits>();
|
||||||
|
|
||||||
|
const visible = ref(false);
|
||||||
|
const promptContent = ref('');
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val) => {
|
||||||
|
visible.value = val;
|
||||||
|
if (val) {
|
||||||
|
promptContent.value = props.defaultPrompt || '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(visible, (val) => {
|
||||||
|
if (!val) {
|
||||||
|
emit('update:modelValue', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleConfirm = () => {
|
||||||
|
emit('confirm', promptContent.value.trim());
|
||||||
|
handleClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
visible.value = false;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.prompt-input-dialog {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -240,18 +240,54 @@ const handleCreatePrivateModelAndSetChat = async () => {
|
|||||||
|
|
||||||
// 基于内置模型创建新模型(继承原模型的所有配置,只替换 apiKey)
|
// 基于内置模型创建新模型(继承原模型的所有配置,只替换 apiKey)
|
||||||
const builtInModel = builtInModelToClone.value;
|
const builtInModel = builtInModelToClone.value;
|
||||||
|
|
||||||
|
// Parse headMsg to Record<string, string> - it might be stored as string or already as object
|
||||||
|
let headMsgRecord: Record<string, string> = {};
|
||||||
|
if (builtInModel.headMsg && typeof builtInModel.headMsg === 'string') {
|
||||||
|
// Try to parse as JSON first (new format stored as string)
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(builtInModel.headMsg);
|
||||||
|
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
||||||
|
Object.entries(parsed).forEach(([k, v]) => {
|
||||||
|
headMsgRecord[k] = String(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// If JSON parse fails, parse as old format "key1:value1,key2:value2"
|
||||||
|
const pairs = builtInModel.headMsg.split(',');
|
||||||
|
pairs.forEach((pair: string) => {
|
||||||
|
const idx = pair.indexOf(':');
|
||||||
|
if (idx === -1) return;
|
||||||
|
const key = pair.slice(0, idx).trim();
|
||||||
|
const value = pair.slice(idx + 1).trim();
|
||||||
|
if (key) {
|
||||||
|
headMsgRecord[key] = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (builtInModel.headMsg && typeof builtInModel.headMsg === 'object' && !Array.isArray(builtInModel.headMsg)) {
|
||||||
|
// Already an object
|
||||||
|
Object.entries(builtInModel.headMsg).forEach(([k, v]) => {
|
||||||
|
headMsgRecord[k] = String(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const createParams = {
|
const createParams = {
|
||||||
modelName: apiKeyForm.modelName,
|
modelName: apiKeyForm.modelName,
|
||||||
modelType: builtInModel.modelType,
|
modelType: builtInModel.modelType,
|
||||||
baseUrl: builtInModel.baseUrl,
|
baseUrl: builtInModel.baseUrl,
|
||||||
httpMethod: builtInModel.httpMethod || 'POST',
|
httpMethod: builtInModel.httpMethod || 'POST',
|
||||||
headMsg: builtInModel.headMsg || '',
|
headMsg: headMsgRecord,
|
||||||
isPrivate: builtInModel.isPrivate ?? 1,
|
isPrivate: builtInModel.isPrivate ?? 1,
|
||||||
enabled: builtInModel.enabled ?? 1,
|
enabled: builtInModel.enabled ?? 1,
|
||||||
isChatModel: 1, // 设置为会话模型
|
isChatModel: 1, // 设置为会话模型
|
||||||
|
callMode: builtInModel.callMode ?? builtInModel.isAsync ?? 0,
|
||||||
apiKey: apiKeyForm.apiKey,
|
apiKey: apiKeyForm.apiKey,
|
||||||
form: builtInModel.form || {},
|
form: builtInModel.form || {},
|
||||||
requestMapping: builtInModel.requestMapping || {},
|
requestMapping: builtInModel.requestMapping || {},
|
||||||
|
requiredFields: Array.isArray(builtInModel.requiredFields) ? builtInModel.requiredFields : [],
|
||||||
|
firstFrame: String(builtInModel.firstFrame || ''),
|
||||||
|
lastFrame: String(builtInModel.lastFrame || ''),
|
||||||
responseMapping: builtInModel.responseMapping || {},
|
responseMapping: builtInModel.responseMapping || {},
|
||||||
responseBody: builtInModel.responseBody || {},
|
responseBody: builtInModel.responseBody || {},
|
||||||
tokenMapping: builtInModel.tokenMapping || '',
|
tokenMapping: builtInModel.tokenMapping || '',
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="system-model-type-container layout-padding">
|
|
||||||
<el-card shadow="hover" class="layout-padding-auto">
|
|
||||||
<div class="system-model-type-search mb15">
|
|
||||||
<el-input v-model="state.tableData.param.keyword" size="default" placeholder="请输入模型类型名称" style="max-width: 180px" clearable> </el-input>
|
|
||||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
|
||||||
<el-icon>
|
|
||||||
<ele-Search />
|
|
||||||
</el-icon>
|
|
||||||
查询
|
|
||||||
</el-button>
|
|
||||||
<el-button size="default" type="success" class="ml10" @click="onOpenAddType('add')">
|
|
||||||
<el-icon>
|
|
||||||
<ele-FolderAdd />
|
|
||||||
</el-icon>
|
|
||||||
新增模型类型
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
|
||||||
<el-table-column type="index" label="序号" width="60" />
|
|
||||||
<el-table-column prop="typeName" label="类型名称" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="typeCode" label="类型编码" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="description" label="描述" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="status" label="状态" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ scope.row.status === 1 ? '启用' : '禁用' }}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column label="操作" width="200">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button size="small" text type="primary" @click="onOpenEditType('edit', scope.row)">修改</el-button>
|
|
||||||
<el-button size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
@size-change="onHandleSizeChange"
|
|
||||||
@current-change="onHandleCurrentChange"
|
|
||||||
class="mt15"
|
|
||||||
:pager-count="5"
|
|
||||||
:page-sizes="[10, 20, 30]"
|
|
||||||
v-model:current-page="state.tableData.param.pageNum"
|
|
||||||
background
|
|
||||||
v-model:page-size="state.tableData.param.pageSize"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="state.tableData.total"
|
|
||||||
>
|
|
||||||
</el-pagination>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts" name="digitalHumanModelType">
|
|
||||||
import { reactive, onMounted } from 'vue';
|
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
tableData: {
|
|
||||||
data: [],
|
|
||||||
total: 0,
|
|
||||||
loading: false,
|
|
||||||
param: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
keyword: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// 初始化表格数据
|
|
||||||
const getTableData = () => {
|
|
||||||
state.tableData.loading = true;
|
|
||||||
// TODO: 调用API获取数据
|
|
||||||
setTimeout(() => {
|
|
||||||
state.tableData.data = [];
|
|
||||||
state.tableData.total = 0;
|
|
||||||
state.tableData.loading = false;
|
|
||||||
}, 500);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 打开新增模型类型弹窗
|
|
||||||
const onOpenAddType = (type: string) => {
|
|
||||||
ElMessage.info('功能开发中...');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 打开修改模型类型弹窗
|
|
||||||
const onOpenEditType = (type: string, row: any) => {
|
|
||||||
ElMessage.info('功能开发中...');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除模型类型
|
|
||||||
const onRowDel = (row: any) => {
|
|
||||||
ElMessage.info('功能开发中...');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 分页改变
|
|
||||||
const onHandleSizeChange = (val: number) => {
|
|
||||||
state.tableData.param.pageSize = val;
|
|
||||||
getTableData();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 分页改变
|
|
||||||
const onHandleCurrentChange = (val: number) => {
|
|
||||||
state.tableData.param.pageNum = val;
|
|
||||||
getTableData();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 页面加载时
|
|
||||||
onMounted(() => {
|
|
||||||
getTableData();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.system-model-type-container {
|
|
||||||
:deep(.el-card__body) {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
overflow: auto;
|
|
||||||
.el-table {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="sourceType" label="来源" width="100">
|
<el-table-column prop="sourceType" label="来源" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.sourceType === 0">自定义</el-tag>
|
<el-tag v-if="row.sourceType === 1" type="success">管理员</el-tag>
|
||||||
<el-tag v-else-if="row.sourceType === 1" type="success">公共</el-tag>
|
<el-tag v-else-if="row.sourceType === 2">用户</el-tag>
|
||||||
<el-tag v-else type="info">{{ row.sourceType }}</el-tag>
|
<el-tag v-else type="info">{{ row.sourceType }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -128,7 +128,7 @@ const nodeOptions = computed(() => {
|
|||||||
const createForm = reactive({
|
const createForm = reactive({
|
||||||
nodeType: '',
|
nodeType: '',
|
||||||
prompt: '',
|
prompt: '',
|
||||||
sourceType: 0 as number,
|
sourceType: 2 as number,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 加载节点库
|
// 加载节点库
|
||||||
@@ -269,7 +269,7 @@ const cancelCreate = () => {
|
|||||||
editId.value = null;
|
editId.value = null;
|
||||||
createForm.nodeType = '';
|
createForm.nodeType = '';
|
||||||
createForm.prompt = '';
|
createForm.prompt = '';
|
||||||
createForm.sourceType = 0;
|
createForm.sourceType = 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 分页
|
// 分页
|
||||||
|
|||||||
@@ -43,11 +43,6 @@
|
|||||||
<span class="ml10 text-muted">天(0表示永不过期)</span>
|
<span class="ml10 text-muted">天(0表示永不过期)</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="禁止重复使用次数" prop="historyLimit">
|
|
||||||
<el-input-number v-model="ruleForm.historyLimit" :min="0" :max="24" placeholder="请输入禁止重复使用次数" />
|
|
||||||
<span class="ml10 text-muted">次(0表示不限制)</span>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="登录失败锁定次数" prop="maxRetryCount">
|
<el-form-item label="登录失败锁定次数" prop="maxRetryCount">
|
||||||
<el-input-number v-model="ruleForm.maxRetryCount" :min="0" :max="10" placeholder="请输入登录失败锁定次数" />
|
<el-input-number v-model="ruleForm.maxRetryCount" :min="0" :max="10" placeholder="请输入登录失败锁定次数" />
|
||||||
<span class="ml10 text-muted">次(0表示不锁定)</span>
|
<span class="ml10 text-muted">次(0表示不锁定)</span>
|
||||||
@@ -85,7 +80,6 @@ interface RuleFormState {
|
|||||||
requireDigit: boolean;
|
requireDigit: boolean;
|
||||||
requireSpecialChar: boolean;
|
requireSpecialChar: boolean;
|
||||||
expireDays: number;
|
expireDays: number;
|
||||||
historyLimit: number;
|
|
||||||
maxRetryCount: number;
|
maxRetryCount: number;
|
||||||
lockTimeMinutes: number;
|
lockTimeMinutes: number;
|
||||||
remark: string;
|
remark: string;
|
||||||
@@ -112,7 +106,6 @@ export default defineComponent({
|
|||||||
requireDigit: true,
|
requireDigit: true,
|
||||||
requireSpecialChar: false,
|
requireSpecialChar: false,
|
||||||
expireDays: 90,
|
expireDays: 90,
|
||||||
historyLimit: 5,
|
|
||||||
maxRetryCount: 5,
|
maxRetryCount: 5,
|
||||||
lockTimeMinutes: 30,
|
lockTimeMinutes: 30,
|
||||||
remark: '',
|
remark: '',
|
||||||
@@ -127,9 +120,6 @@ export default defineComponent({
|
|||||||
expireDays: [
|
expireDays: [
|
||||||
{ required: true, message: '请输入密码过期天数', trigger: 'blur' }
|
{ required: true, message: '请输入密码过期天数', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
historyLimit: [
|
|
||||||
{ required: true, message: '请输入禁止重复使用次数', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
maxRetryCount: [
|
maxRetryCount: [
|
||||||
{ required: true, message: '请输入登录失败锁定次数', trigger: 'blur' }
|
{ required: true, message: '请输入登录失败锁定次数', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
|||||||
27
ssl/gitea.redpowerfuture.com.key
Normal file
27
ssl/gitea.redpowerfuture.com.key
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEowIBAAKCAQEAqlbH8ExzyW3D87glDgjSz6IoKWmV1iZh33DIYmDFzbaGqdBZ
|
||||||
|
gWyW4TWbBn9huVDrglShjeIEjAdfK3BcHKv4/xh+XjGjzp/GyvKkggLGB2Itc3Wq
|
||||||
|
wxlyAhlm7tgU0bmQGPu/+CnIvmss7lKWx9b5L9eYU+ToU3r/GOP4juGqcUYHLyhW
|
||||||
|
ZDjy2fjO5Ju4/W0U1OcaLho1Sapn9EFXFIjJ5RbiiOF8QVo8Ez3EbV/EsQowaIvp
|
||||||
|
OoqLT1GGBRd6sz/L1TMliw6UPcGd+TTaADTh4PxSklYsXqro0vstft0kiuAElah3
|
||||||
|
Hw3XZMNiRfAqJVvhc8/pXdA6kH4FuZKfxAF8CwIDAQABAoIBAEwB8DKKMsppZ9wr
|
||||||
|
SaGTD1pmHayo+Bq4Qsj83vWDABCUh09j8GR/i23PyS6jjXwvHv+nevVAKs4/Bdjw
|
||||||
|
yLFkjXVqvQyT8ueixQZPMlfvG+U0ilpwYXOwOX61Tgh6tAOHXUTApT77ih9p3IE1
|
||||||
|
qiFfDA8skUSyKncBta2qIAHFsZPcNGB+44hv5AT1aaXtZbuFdwAoptIpNDaWVmbo
|
||||||
|
cjm6AEHOoiTfXx437ORAx+F3e2umzBVkLQZNLPlYsz0pFN8elZAde1e13kAPUaHa
|
||||||
|
q5g49Yad4UA3iIO6xo3kZz90BGMlcbe0ckY8wOg9biF4zTxVg0unbvk4DZve8iTZ
|
||||||
|
hDrrAF0CgYEA3oakLouCgo/JWERfXVTYVyTvuh8wkYmsndV4s7hENIjhEiKrgfW1
|
||||||
|
4RfnVNEjgEbsukgyMj8GpeXp9d8mC5Jz9uhKbbpCbLIuTdZpeNvob4RA1a+rgP6L
|
||||||
|
Fan3W9yrMqmrz7gLW2PsPmU3vnn8SI/8QlgwmNLutbMPncWJzNukMM0CgYEAw/Zy
|
||||||
|
dqFjNIgHemnYpK1R0xcLVs6MTOOwqEv0xUor1fZujLittRbb4JAqDlUwQNU6Zn6K
|
||||||
|
xxuSJ3TrRHqpjLcT812yPeMXd1f7jzCnZXDkWYoUT/ILjIB9cEJuycTwDwMJGkPd
|
||||||
|
RGV+gyBPHYBM6+hhxh1YSYm0CebDPMRMC7anADcCgYBg/KYKc1vKtAi5o/M8poI0
|
||||||
|
WTDzGiz9AdhuYmBdVG7FxvLyCJJf7kv7c4OsAAtNGZyMBHN8WuP24qJ6O2xFlutc
|
||||||
|
LhpigM/6uB5eZplJx+8iy63GdO53JnpQUugw7ZjgV/s+aaTpjD+nYk5NgrVmmvsD
|
||||||
|
n5Rux2CraQPha/uHgiOp8QKBgQCwqh6ZOnfgZP4w6vmnxKUu4+iSEtXDf8XEg+2g
|
||||||
|
a3THiUoyzU+1IW2Krw1rLHu7B0CGJHDifcWukqaDbv4p4Oc4kPDfADsomYYtmhRf
|
||||||
|
zH3hBy22wSSOP0xXB10vw78UGY18Q1BYmBONDXSlyQQP7ckvvUbZzS4lewfqYaGZ
|
||||||
|
Mcqu0wKBgDh2tcdxuHUizlRAPwfoZ3JhbITJqGytkpZT96WpQ0fpzcSovNJf0shC
|
||||||
|
5gXCzWWRKQPxV7cUXmB6hBm1Q6WoZ/VKN36+R+7L8Pt7yTmZhBxQKVjVn3k849JC
|
||||||
|
tcWDXiZd5qINC7dsH/vjLahnr76cFtYfNM5stomJkKNRjC7hZfnw
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
62
ssl/gitea.redpowerfuture.com.pem
Normal file
62
ssl/gitea.redpowerfuture.com.pem
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIGJTCCBQ2gAwIBAgIQCXpUlFT9Cue3+TsPpxvnWjANBgkqhkiG9w0BAQsFADBu
|
||||||
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||||
|
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
|
||||||
|
RFYgVExTIENBIC0gRzIwHhcNMjYwNjEwMDAwMDAwWhcNMjYwOTA3MjM1OTU5WjAj
|
||||||
|
MSEwHwYDVQQDExhnaXRlYS5yZWRwb3dlcmZ1dHVyZS5jb20wggEiMA0GCSqGSIb3
|
||||||
|
DQEBAQUAA4IBDwAwggEKAoIBAQCqVsfwTHPJbcPzuCUOCNLPoigpaZXWJmHfcMhi
|
||||||
|
YMXNtoap0FmBbJbhNZsGf2G5UOuCVKGN4gSMB18rcFwcq/j/GH5eMaPOn8bK8qSC
|
||||||
|
AsYHYi1zdarDGXICGWbu2BTRuZAY+7/4Kci+ayzuUpbH1vkv15hT5OhTev8Y4/iO
|
||||||
|
4apxRgcvKFZkOPLZ+M7km7j9bRTU5xouGjVJqmf0QVcUiMnlFuKI4XxBWjwTPcRt
|
||||||
|
X8SxCjBoi+k6iotPUYYFF3qzP8vVMyWLDpQ9wZ35NNoANOHg/FKSVixequjS+y1+
|
||||||
|
3SSK4ASVqHcfDddkw2JF8ColW+Fzz+ld0DqQfgW5kp/EAXwLAgMBAAGjggMIMIID
|
||||||
|
BDAfBgNVHSMEGDAWgBR435GQX+7erPbFdevVTFVT7yRKtjAdBgNVHQ4EFgQUOiq0
|
||||||
|
OCRofHA6BrxoM9do+AWnNgowQQYDVR0RBDowOIIYZ2l0ZWEucmVkcG93ZXJmdXR1
|
||||||
|
cmUuY29tghx3d3cuZ2l0ZWEucmVkcG93ZXJmdXR1cmUuY29tMD4GA1UdIAQ3MDUw
|
||||||
|
MwYGZ4EMAQIBMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93d3cuZGlnaWNlcnQuY29t
|
||||||
|
L0NQUzAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF
|
||||||
|
BwMCMIGABggrBgEFBQcBAQR0MHIwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRp
|
||||||
|
Z2ljZXJ0LmNvbTBKBggrBgEFBQcwAoY+aHR0cDovL2NhY2VydHMuZGlnaWNlcnQu
|
||||||
|
Y29tL0VuY3J5cHRpb25FdmVyeXdoZXJlRFZUTFNDQS1HMi5jcnQwDAYDVR0TAQH/
|
||||||
|
BAIwADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHUAwjF+V0UZo0XufzjespBB
|
||||||
|
68fCIVoiv3/Vta12mtkOUs0AAAGesEYy8QAABAMARjBEAiBD7255l5PRI6mZXWxU
|
||||||
|
iC7txvWxkLlBgVFzAkRrMW7RXQIgZyupslAslfGDqDMk9H948AFZGe0JwB6YiuXK
|
||||||
|
lx1sox0AdgDYCVU7lE96/8gWGW+UT4WrsPj8XodVJg8V0S5yu0VLFAAAAZ6wRjNI
|
||||||
|
AAAEAwBHMEUCIBqfIfl4sL0ME60NI0KG6JIHImcJjR5qkLGDjCp3sEhrAiEA4cvy
|
||||||
|
yFaz3BSjjQa+UspsqgfKxeTjCLJq5pLbDcgBgGQAdgCUTkOH+uzB74HzGSQmqBhl
|
||||||
|
AcfTXzgCAT9yZ31VNy4Z2AAAAZ6wRjL3AAAEAwBHMEUCIQDIIa8mLpO6BmhgCecw
|
||||||
|
pI+QNznn4lhIxmtJQyHmZo7qRAIgFPq9xlLLqqe5/+WgcNwoawggpi8skhg8t/yT
|
||||||
|
JJ5TmV0wDQYJKoZIhvcNAQELBQADggEBAOeiZrRwpNh/bNIuKe+1vWBrLHu2Zj70
|
||||||
|
cKAVUhT08ZAl8scEYusbuqtSAq+oz9sm595YyPgmrB0wSZEMTd/+pUy5GrrJAXal
|
||||||
|
kOx1a3TBxCvpK9F4T7KmBaBWA5HuljHfw9833jXi7v9jLYShDjyNRzSWeKl41kdt
|
||||||
|
Hq4CbDLXp9XVzVPBlOongGZV/6cDrvy4hoJcBq8UANU/QWw0PaJQWxPwHcULekBw
|
||||||
|
AefTX7JwKbHcZ3gGV4EzJU/eoycBOu9VsYgJu9U+p1nNjYHwS8RQjij+cgs8r5Wx
|
||||||
|
r4+wYkdN2767iK2+NRRdQD/ZqBMTgSZ6AXCM7gS8oP/ylLwnzyq7ikc=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEqjCCA5KgAwIBAgIQDeD/te5iy2EQn2CMnO1e0zANBgkqhkiG9w0BAQsFADBh
|
||||||
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||||
|
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
|
||||||
|
MjAeFw0xNzExMjcxMjQ2NDBaFw0yNzExMjcxMjQ2NDBaMG4xCzAJBgNVBAYTAlVT
|
||||||
|
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
|
||||||
|
b20xLTArBgNVBAMTJEVuY3J5cHRpb24gRXZlcnl3aGVyZSBEViBUTFMgQ0EgLSBH
|
||||||
|
MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO8Uf46i/nr7pkgTDqnE
|
||||||
|
eSIfCFqvPnUq3aF1tMJ5hh9MnO6Lmt5UdHfBGwC9Si+XjK12cjZgxObsL6Rg1njv
|
||||||
|
NhAMJ4JunN0JGGRJGSevbJsA3sc68nbPQzuKp5Jc8vpryp2mts38pSCXorPR+sch
|
||||||
|
QisKA7OSQ1MjcFN0d7tbrceWFNbzgL2csJVQeogOBGSe/KZEIZw6gXLKeFe7mupn
|
||||||
|
NYJROi2iC11+HuF79iAttMc32Cv6UOxixY/3ZV+LzpLnklFq98XORgwkIJL1HuvP
|
||||||
|
ha8yvb+W6JislZJL+HLFtidoxmI7Qm3ZyIV66W533DsGFimFJkz3y0GeHWuSVMbI
|
||||||
|
lfsCAwEAAaOCAU8wggFLMB0GA1UdDgQWBBR435GQX+7erPbFdevVTFVT7yRKtjAf
|
||||||
|
BgNVHSMEGDAWgBROIlQgGJXm427mD/r6uRLtBhePOTAOBgNVHQ8BAf8EBAMCAYYw
|
||||||
|
HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8C
|
||||||
|
AQAwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
|
||||||
|
Y2VydC5jb20wQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQu
|
||||||
|
Y29tL0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG
|
||||||
|
/WwBAjAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
|
||||||
|
MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAoBs1eCLKakLtVRPFRjBIJ9LJ
|
||||||
|
L0s8ZWum8U8/1TMVkQMBn+CPb5xnCD0GSA6L/V0ZFrMNqBirrr5B241OesECvxIi
|
||||||
|
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
|
||||||
|
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
|
||||||
|
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
|
||||||
|
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
27
ssl/minio.redpowerfuture.com.key
Normal file
27
ssl/minio.redpowerfuture.com.key
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpAIBAAKCAQEAvoMUrxhR2vYC/tyGZlplkANptmFfqcglnd+ETk1ppE/tMyrI
|
||||||
|
PxBLvjN1BIcbBFkHthuv/Ut/dSgtS0hbI52Z1bMACbJ5SdPLTBZzNpXgHWXUHf/S
|
||||||
|
OsQB8s7gsCekcVly3Tf1emsXxcyeXQ7u8/ZrNEAKGZwT3xkAvtte01NqJeaIMddY
|
||||||
|
1o/nrlVhgV6CvDtCAFLRVvw2p5zc/Vejc/MLEXV4l9g3VIODfcIbLsczUmsT98zO
|
||||||
|
LOwwgVssCQcdnA12T1X3U4sX4U0Pin0MexT5L8/Kx3pHbajpQK+ID0TDpmP4QKf5
|
||||||
|
QkAHJxM7py4u1EHNBo3nkrxWNPfZTTnhbvowjwIDAQABAoIBAAcLQ14FU615ZXtK
|
||||||
|
kxZAvGWamAjcHn82vRv9EjVvoPrS0Q3lxI6ptGs9bX5eh84ILq6kj8QZS7FSFs6k
|
||||||
|
R75lit+/D77MCwutmY7gJkq74ulOBQ2bkl3a4R7lraLFwcubx5FMtYuyXv17cdWL
|
||||||
|
V6Qh6y0nkFgJuyWyFSLOwKRRVBOU8KTldFLR+iF7oULALpUZeci9RF+EEGKarFmp
|
||||||
|
07OjPbLjdBl+FT05c2KRy4lVl+BRQB6YfU+Al84VQPdoE8byE3mrzomo6CiMTCQ9
|
||||||
|
aNN2QfpVZ6x16gOEcgpJZHYvD+gC5H7q//TWBJ/jdR6ToKYcRK7HOJQjZgUFLSUs
|
||||||
|
wCf1ybkCgYEA7V7XkB10SdfT2axO2jdsRM3kW1U86k//dF26G4OKlRmWpibcJXnk
|
||||||
|
i0M3be0b1VrqefYEWot3MVhJheQCCa+tNR4hSovN7FqCNVUzXZ8YWrTaycXi46po
|
||||||
|
urfRLUeupTXJinBfmIPCdbqr0bPOJ0q5NfpG+LeG0LlsAfxjALgjGrcCgYEAzXbG
|
||||||
|
0TLaDNwB3aXTUPpsL7DrrQTaVi9ScH5sa2IJjes2Pv/MyTB05JyHG9rqAtIShjJi
|
||||||
|
/N3qMnN0q40GSnzPj99+Sep3p+41LvxfvRma9HMZRnczyPZIT31TMQF++QP3d8gz
|
||||||
|
giDVNND0GXY11bwcqIuS+ouNwU4P6tvLKznQIOkCgYEAxBZ0JuZeGV5E8O2p2hSs
|
||||||
|
yQ35FgYNI1dgpUWEJ5R71/3ieHFjrUXLqcumL5YPRyoqxwOXxyCtH0NawVOA53WL
|
||||||
|
tXSldcqWGykNpXczzqRN3yjGEKb7bq1ohM6y6x/rQylyy31XS0uVSeIibEKIC+dr
|
||||||
|
pw6QsIgTw7tZYS6YrpBu13MCgYBb5t7zP+2shtQG0l98/yZZBqfEEkGe/ze+va29
|
||||||
|
MnLXmff/oed1rkj64NDGMtstO82xXORN+u0AeAgdm8zOkJk+31bbtRakdLYxOA2S
|
||||||
|
xds7sCgEDtmI8DBT7djCOMsUkyOj3la7w/fZ0gT9RpS575RaB2RM0RMs/b+862cr
|
||||||
|
BIcF0QKBgQCrO6f1zj9vr4h3nWohSjgpAkZHpeUxDf6s39U960JU5Dvz/bhCHr51
|
||||||
|
uuVO183cFmx9W8IW6BI4dwEKk5MrXD2hdM8uGAIi+ip/SwBqej072HuY1xD2Elp9
|
||||||
|
mWXLESLAedhWvp9QhNQbHib1RzaPV8TUgCDN/QLGQE+jdVqfk/Smfw==
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
62
ssl/minio.redpowerfuture.com.pem
Normal file
62
ssl/minio.redpowerfuture.com.pem
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIGJTCCBQ2gAwIBAgIQAWng8l3t5rBYcCmLpCDdJTANBgkqhkiG9w0BAQsFADBu
|
||||||
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||||
|
d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg
|
||||||
|
RFYgVExTIENBIC0gRzIwHhcNMjYwNjEyMDAwMDAwWhcNMjYwOTA5MjM1OTU5WjAj
|
||||||
|
MSEwHwYDVQQDExhtaW5pby5yZWRwb3dlcmZ1dHVyZS5jb20wggEiMA0GCSqGSIb3
|
||||||
|
DQEBAQUAA4IBDwAwggEKAoIBAQC+gxSvGFHa9gL+3IZmWmWQA2m2YV+pyCWd34RO
|
||||||
|
TWmkT+0zKsg/EEu+M3UEhxsEWQe2G6/9S391KC1LSFsjnZnVswAJsnlJ08tMFnM2
|
||||||
|
leAdZdQd/9I6xAHyzuCwJ6RxWXLdN/V6axfFzJ5dDu7z9ms0QAoZnBPfGQC+217T
|
||||||
|
U2ol5ogx11jWj+euVWGBXoK8O0IAUtFW/DannNz9V6Nz8wsRdXiX2DdUg4N9whsu
|
||||||
|
xzNSaxP3zM4s7DCBWywJBx2cDXZPVfdTixfhTQ+KfQx7FPkvz8rHekdtqOlAr4gP
|
||||||
|
RMOmY/hAp/lCQAcnEzunLi7UQc0GjeeSvFY099lNOeFu+jCPAgMBAAGjggMIMIID
|
||||||
|
BDAfBgNVHSMEGDAWgBR435GQX+7erPbFdevVTFVT7yRKtjAdBgNVHQ4EFgQUm+W1
|
||||||
|
VEi2C0CdxtuncyBFtX9cS5UwQQYDVR0RBDowOIIYbWluaW8ucmVkcG93ZXJmdXR1
|
||||||
|
cmUuY29tghx3d3cubWluaW8ucmVkcG93ZXJmdXR1cmUuY29tMD4GA1UdIAQ3MDUw
|
||||||
|
MwYGZ4EMAQIBMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93d3cuZGlnaWNlcnQuY29t
|
||||||
|
L0NQUzAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF
|
||||||
|
BwMCMIGABggrBgEFBQcBAQR0MHIwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRp
|
||||||
|
Z2ljZXJ0LmNvbTBKBggrBgEFBQcwAoY+aHR0cDovL2NhY2VydHMuZGlnaWNlcnQu
|
||||||
|
Y29tL0VuY3J5cHRpb25FdmVyeXdoZXJlRFZUTFNDQS1HMi5jcnQwDAYDVR0TAQH/
|
||||||
|
BAIwADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHUAwjF+V0UZo0XufzjespBB
|
||||||
|
68fCIVoiv3/Vta12mtkOUs0AAAGeucefAgAABAMARjBEAiBdD793ndAhFw/xk4gS
|
||||||
|
Pycc/U4IGSbSFNg1wXMMBkma9gIgSK8LNW9lqHn4wEYFRQrBfmYMUkJhUR51JmOb
|
||||||
|
rUESBu8AdgDXbX0Q0af1d8LH6V/XAL/5gskzWmXh0LMBcxfAyMVpdwAAAZ65x57r
|
||||||
|
AAAEAwBHMEUCIALrNS+sHrfHVl72YGHkqSb4quYzH6xZ0JNCTLakfjK4AiEA0jbR
|
||||||
|
ORUL7BLzYbw5geZfMb8NJmD+7CbgXdHNPWmowdYAdgCUTkOH+uzB74HzGSQmqBhl
|
||||||
|
AcfTXzgCAT9yZ31VNy4Z2AAAAZ65x58NAAAEAwBHMEUCIQCn753LSIK5ODnAw8za
|
||||||
|
2BUf7PZQhtwhe1I0fEfrFjwcAAIgPZtnV83cNV8UK9zGQhWso4QX/oK+ziXQMuP5
|
||||||
|
+lApPpcwDQYJKoZIhvcNAQELBQADggEBAKceFp1JWPgaR5TGrMXQNY0qgRPhY0ZC
|
||||||
|
MSVLqtbgWPeODl3p+BTpLJ/taGR1v1mlL/2cM+EU/RQVDobYUu91Td0Tibp1T8vv
|
||||||
|
KKgnGTj8fVTzimTR5YsFHKc0XFqHpbneArZFb9tbMnRLheDjAqJ3Xs5H5t/XNDSi
|
||||||
|
vasqxdvAYZPP+7JZPRrFqq/fPZR79NRz7kl45YiQX199d/8oPRVFRrq1TGtp41Nk
|
||||||
|
7rP31tq0YZDpBHXXmpYXmOZalWBHoASnZJDq0+H5bSBzNVHR25eOZe0dt5lWMzrf
|
||||||
|
bzFMatWnPKI/aLhc3GGZAxyy7PCRA5pJGB+qnaJAakODvB02VvJey/Y=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEqjCCA5KgAwIBAgIQDeD/te5iy2EQn2CMnO1e0zANBgkqhkiG9w0BAQsFADBh
|
||||||
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||||
|
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
|
||||||
|
MjAeFw0xNzExMjcxMjQ2NDBaFw0yNzExMjcxMjQ2NDBaMG4xCzAJBgNVBAYTAlVT
|
||||||
|
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
|
||||||
|
b20xLTArBgNVBAMTJEVuY3J5cHRpb24gRXZlcnl3aGVyZSBEViBUTFMgQ0EgLSBH
|
||||||
|
MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO8Uf46i/nr7pkgTDqnE
|
||||||
|
eSIfCFqvPnUq3aF1tMJ5hh9MnO6Lmt5UdHfBGwC9Si+XjK12cjZgxObsL6Rg1njv
|
||||||
|
NhAMJ4JunN0JGGRJGSevbJsA3sc68nbPQzuKp5Jc8vpryp2mts38pSCXorPR+sch
|
||||||
|
QisKA7OSQ1MjcFN0d7tbrceWFNbzgL2csJVQeogOBGSe/KZEIZw6gXLKeFe7mupn
|
||||||
|
NYJROi2iC11+HuF79iAttMc32Cv6UOxixY/3ZV+LzpLnklFq98XORgwkIJL1HuvP
|
||||||
|
ha8yvb+W6JislZJL+HLFtidoxmI7Qm3ZyIV66W533DsGFimFJkz3y0GeHWuSVMbI
|
||||||
|
lfsCAwEAAaOCAU8wggFLMB0GA1UdDgQWBBR435GQX+7erPbFdevVTFVT7yRKtjAf
|
||||||
|
BgNVHSMEGDAWgBROIlQgGJXm427mD/r6uRLtBhePOTAOBgNVHQ8BAf8EBAMCAYYw
|
||||||
|
HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8C
|
||||||
|
AQAwNAYIKwYBBQUHAQEEKDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdp
|
||||||
|
Y2VydC5jb20wQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQu
|
||||||
|
Y29tL0RpZ2lDZXJ0R2xvYmFsUm9vdEcyLmNybDBMBgNVHSAERTBDMDcGCWCGSAGG
|
||||||
|
/WwBAjAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
|
||||||
|
MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAoBs1eCLKakLtVRPFRjBIJ9LJ
|
||||||
|
L0s8ZWum8U8/1TMVkQMBn+CPb5xnCD0GSA6L/V0ZFrMNqBirrr5B241OesECvxIi
|
||||||
|
98bZ90h9+q/X5eMyOD35f8YTaEMpdnQCnawIwiHx06/0BfiTj+b/XQih+mqt3ZXe
|
||||||
|
xNCJqKexdiB2IWGSKcgahPacWkk/BAQFisKIFYEqHzV974S3FAz/8LIfD58xnsEN
|
||||||
|
GfzyIDkH3JrwYZ8caPTf6ZX9M1GrISN8HnWTtdNCH2xEajRa/h9ZBXjUyFKQrGk2
|
||||||
|
n2hcLrfZSbynEC/pSw/ET7H5nWwckjmAJ1l9fcnbqkU/pf6uMQmnfl0JQjJNSg==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
Reference in New Issue
Block a user