Compare commits
23 Commits
04a8912307
...
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 |
229
CLAUDE.md
229
CLAUDE.md
@@ -1,229 +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.
|
||||
|
||||
## Repository Collaboration Rules
|
||||
|
||||
These rules capture long-term repository preferences confirmed by the user and should be applied in future sessions unless the user explicitly overrides them.
|
||||
|
||||
### Pagination Rules
|
||||
|
||||
- Prefer the project global `pagination` component by default.
|
||||
- Pagination should be fixed and visible as part of the page or dialog layout, not conditionally hidden only because the dataset is small.
|
||||
- In single-page scenarios, the UI should still show total count together with the pagination area.
|
||||
- Avoid designs where pagination only appears after data exceeds one page.
|
||||
|
||||
### Dialog Layout Rules
|
||||
|
||||
- For dialogs that contain searchable tabular data, prefer this structure:
|
||||
1. search area
|
||||
2. table/content area
|
||||
3. pagination area placed under the table inside the dialog body
|
||||
4. footer action buttons
|
||||
- The pagination area should remain visually stable and should not be omitted just because the current result set is small.
|
||||
|
||||
### Theme and Style Rules
|
||||
|
||||
- When functionality and existing theme style conflict, prioritize making the feature clearly visible and usable first.
|
||||
- After ensuring usability, align the implementation with the repository's existing theme and style system as much as possible.
|
||||
- Be cautious about global theme styles that may affect local pagination, dialog, or table layouts.
|
||||
|
||||
### Problem-solving Workflow
|
||||
|
||||
- For repeated UI issues, analyze in this order:
|
||||
1. interface/request data and returned structure
|
||||
2. component logic and render conditions
|
||||
3. theme and style coverage/conflicts
|
||||
4. then decide whether a rewrite is necessary
|
||||
- Do not jump straight to a rewrite before checking interface behavior and style interference.
|
||||
|
||||
### Execution Workflow Rules
|
||||
|
||||
- When modifying a feature, locate it in this order: usage location, component definition, API definition, then at least one similar implementation in the project.
|
||||
- For common UI features such as pagination, dialogs, and tables, align with an existing similar implementation before making changes.
|
||||
- Prefer componentization. If a page or Vue SFC is already large, or a block has a clear independent responsibility, split it into components instead of continuing to extend the same file.
|
||||
- For very long files such as complex page-level `index.vue` files, treat further component splitting as the default direction rather than the exception.
|
||||
- Before editing large files or complex Vue SFCs, first read the target context; if a replacement fails once, do not repeat the same replacement blindly, and instead expand the context or switch to smaller targeted edits.
|
||||
- After UI or interaction changes, verify not only lint status for edited files but also render conditions, interface fields, and possible style impact.
|
||||
- If the same issue is not resolved after one attempt, pause and ask the user before continuing with more speculative changes.
|
||||
- Do not proactively rewrite a component unless the user explicitly asks for a rewrite.
|
||||
- At the start of a new conversation, read `CLAUDE.md` before making changes.
|
||||
- When code changes appear not to take effect, check in this order: compile/HMR status, render conditions, API data, then style overrides.
|
||||
- Turn repeated low-level mistakes into explicit workflow checks and follow those checks in future edits.
|
||||
|
||||
### Environment and Tool Selection Rules
|
||||
|
||||
- Before running environment-dependent commands, first follow the known runtime context already provided by the IDE, such as OS and default shell.
|
||||
- On Windows projects with PowerShell as the active shell, prefer PowerShell-native commands and scripts by default.
|
||||
- Do not assume Python, bash, sed, awk, or other non-default tooling is installed locally unless the user or repository explicitly indicates that they are available.
|
||||
- For reading and editing repository files, prefer dedicated file tools first; use shell-based text replacement only when file tools are not suitable for the change.
|
||||
- When a replacement fails once, do not keep retrying the same method blindly. Re-read the exact target content and switch to a smaller or more reliable edit strategy that matches the current environment.
|
||||
- Avoid trial-and-error probing for basic tooling when the available environment is already known from context.
|
||||
|
||||
### Componentization and Structure Rules
|
||||
|
||||
- If a view block has an independent responsibility, prefer extracting it into a component instead of keeping it inside a large page file.
|
||||
- When a file is already long, or a new feature would further expand responsibilities, proactively split it into components.
|
||||
- Child components may keep their own local logic when that logic belongs clearly to the child’s responsibility; only shared state and necessary events should stay in the parent.
|
||||
- For complex pages, small-scale components can stay in `component/`, while larger feature areas may be grouped by responsibility in subdirectories.
|
||||
- For very long page files, prefer keeping the parent focused on composition, state orchestration, and data flow, while moving feature UI and local behavior into child components.
|
||||
- When extracting new child components from a large file, move their related local styles with them to avoid continued growth of the parent file.
|
||||
|
||||
### API and Data Handling Rules
|
||||
|
||||
- Follow the project’s common response structure by default, but add moderate component-side compatibility handling when equivalent APIs return slightly inconsistent fields.
|
||||
- For page-level error handling, use global handling by default, but use page-level or silent handling when the interaction requires local control.
|
||||
- Prefer a unified parameter-building entry for request params instead of assembling the same parameters across multiple functions.
|
||||
|
||||
### Form and Interaction Rules
|
||||
|
||||
- Follow the project’s existing form behavior style: required fields should be clearly validated on submit, while avoiding unnecessarily disruptive validation during input.
|
||||
- For shared create/edit forms, initialize, patch, and reset form state through a unified initialization path to avoid stale state.
|
||||
- Search interactions should behave consistently across button click, Enter key, and clear actions, and should reset to the first page by default.
|
||||
|
||||
### Dialog and Selector Rules
|
||||
|
||||
- Dialogs should clear temporary internal state on close by default; any state that needs to persist should be explicitly provided back by the parent.
|
||||
- Selector components should follow a consistent pattern: `v-model` for visibility, a default value prop, and a `confirm` event for returning the selected result.
|
||||
- For temporary selectors and lightweight dialogs, prefer `destroy-on-close`; for more complex stateful forms, decide deliberately rather than applying it blindly.
|
||||
|
||||
### Styling Rules
|
||||
|
||||
- Prefer local scoped style changes first; only modify global theme styles after confirming the issue is truly shared across multiple places.
|
||||
- When overriding Element Plus internals, prefer local `:deep()` overrides before considering global style changes.
|
||||
- Use semantic, area-based class names instead of short or overly generic names.
|
||||
|
||||
### Debugging and Validation Rules
|
||||
|
||||
- Minimal temporary debugging is allowed when necessary, but all temporary debugging code must be removed before final delivery.
|
||||
- Temporary `console` output is acceptable only when debugging is genuinely needed and must be removed before final delivery.
|
||||
- For UI and interaction changes, verify lint, key render conditions, interface fields, and style impact before considering the task complete.
|
||||
|
||||
### Change Scope and Consistency Rules
|
||||
|
||||
- Prefer the smallest necessary change set, but do not pretend a local-only fix is sufficient when the real root cause is elsewhere in the chain.
|
||||
- Only fix nearby issues when they are strongly related to the current task; otherwise ask the user before expanding the scope.
|
||||
- Within the current modification scope, move code toward repository rules when practical, but avoid broad unrelated refactors.
|
||||
|
||||
### Communication and Risk Rules
|
||||
|
||||
- Before changing code, confirm with the user when a change involves a rewrite, global side effects, unclear requirements, or a second attempt that still has not solved the issue.
|
||||
- After changes, explain what changed, why it was changed that way, and any remaining risks or points worth confirming.
|
||||
- When a requirement still depends on a meaningful assumption, ask the user first instead of silently choosing a direction.
|
||||
|
||||
### Repository Memory Rules
|
||||
|
||||
- When collaboration reveals a repeated problem pattern, proactively suggest turning it into an explicit repository rule in `CLAUDE.md`.
|
||||
- Project-specific experience or pitfall notes may be added when they become necessary, but do not expand them prematurely without clear recurring value.
|
||||
|
||||
### Rule Documentation Style
|
||||
|
||||
- Keep long-term repository rules concise and practical.
|
||||
- Prefer short rule lists with a small amount of explanation over overly long documentation.
|
||||
|
||||
## 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
|
||||
# 配置Alpine国内镜像源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
@@ -13,7 +13,7 @@ COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# ==================== 第二阶段:部署到Nginx ====================
|
||||
FROM nginx:alpine
|
||||
FROM docker.m.daocloud.io/nginx:alpine
|
||||
|
||||
# 复制构建产物
|
||||
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 {
|
||||
listen 80;
|
||||
server_name _;
|
||||
@@ -19,11 +33,27 @@ server {
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# 自定义 404 页面,保持 404 状态码
|
||||
error_page 404 /404.html;
|
||||
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
|
||||
# 根路径默认进入网页端
|
||||
location = / {
|
||||
return 302 /web/index.html;
|
||||
}
|
||||
|
||||
# 兼容无斜杠访问
|
||||
location = /web {
|
||||
return 302 /web/;
|
||||
}
|
||||
|
||||
location = /sys {
|
||||
return 302 /sys/;
|
||||
}
|
||||
|
||||
# 网页端(public/web/index.html -> dist/web/index.html)
|
||||
location /web/ {
|
||||
alias /usr/share/nginx/html/web/;
|
||||
@@ -33,7 +63,7 @@ server {
|
||||
# 后台管理端(dist/index.html,前缀 /sys/)
|
||||
location /sys/ {
|
||||
alias /usr/share/nginx/html/;
|
||||
try_files $uri $uri/ /sys/index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# 1. 先尝试作为静态文件查找
|
||||
@@ -60,3 +90,49 @@ server {
|
||||
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 {
|
||||
platformId: string | number;
|
||||
platformId: number;
|
||||
name: string;
|
||||
code: string;
|
||||
url: string;
|
||||
@@ -22,6 +22,7 @@ export interface CreateApiInterfaceParams {
|
||||
requestConfig?: Record<string, any>;
|
||||
responseConfig?: Record<string, any>;
|
||||
limitConfig?: Record<string, any>;
|
||||
tableDefinition?: Record<string, any>;
|
||||
}
|
||||
|
||||
// 更新接口参数
|
||||
@@ -50,6 +51,7 @@ export interface ApiInterfaceInfo {
|
||||
requestConfig?: Record<string, any>;
|
||||
responseConfig?: Record<string, any>;
|
||||
limitConfig?: Record<string, any>;
|
||||
tableDefinition?: Record<string, any>;
|
||||
createdBy?: string;
|
||||
createdAt?: number;
|
||||
updatedBy?: string;
|
||||
@@ -59,7 +61,7 @@ export interface ApiInterfaceInfo {
|
||||
// 获取接口列表
|
||||
export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/listApiInterfaces',
|
||||
url: '/data-engine/api/interface/controller/listApiInterfaces',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
@@ -68,7 +70,7 @@ export function listApiInterfaces(params: ApiInterfaceQueryParams) {
|
||||
// 获取接口详情
|
||||
export function getApiInterface(id: string) {
|
||||
return request({
|
||||
url: '/api/interface/controller/getApiInterface',
|
||||
url: '/data-engine/api/interface/controller/getApiInterface',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
@@ -77,7 +79,7 @@ export function getApiInterface(id: string) {
|
||||
// 创建接口
|
||||
export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/createApiInterface',
|
||||
url: '/data-engine/api/interface/controller/createApiInterface',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@@ -86,7 +88,7 @@ export function createApiInterface(data: CreateApiInterfaceParams) {
|
||||
// 修改接口
|
||||
export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/updateApiInterface',
|
||||
url: '/data-engine/api/interface/controller/updateApiInterface',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -95,7 +97,7 @@ export function updateApiInterface(data: UpdateApiInterfaceParams) {
|
||||
// 更新接口状态
|
||||
export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||
return request({
|
||||
url: '/api/interface/controller/updateApiInterfaceStatus',
|
||||
url: '/data-engine/api/interface/controller/updateApiInterfaceStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -104,7 +106,7 @@ export function updateApiInterfaceStatus(data: UpdateApiInterfaceStatusParams) {
|
||||
// 删除接口
|
||||
export function deleteApiInterface(id: string) {
|
||||
return request({
|
||||
url: '/api/interface/controller/deleteApiInterface',
|
||||
url: '/data-engine/api/interface/controller/deleteApiInterface',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
|
||||
@@ -26,8 +26,7 @@ export interface CreateDatasourcePlatformParams {
|
||||
requestTimeoutMs?: number;
|
||||
maxRetries?: number;
|
||||
retryDelayMs?: number;
|
||||
createdBy?: string;
|
||||
updatedBy?: string;
|
||||
authConfig?: Record<string, any>;
|
||||
}
|
||||
|
||||
// 更新平台参数
|
||||
@@ -40,7 +39,6 @@ export interface UpdateDatasourcePlatformParams extends Partial<CreateDatasource
|
||||
export interface UpdateDatasourcePlatformStatusParams {
|
||||
id: string;
|
||||
Status: string;
|
||||
updatedBy?: string;
|
||||
}
|
||||
|
||||
// 平台信息
|
||||
@@ -54,22 +52,25 @@ export interface DatasourcePlatformInfo {
|
||||
apiBaseUrl: string;
|
||||
authType: string;
|
||||
authTypeName: string;
|
||||
token?: string;
|
||||
apiKey?: string;
|
||||
clientId?: string;
|
||||
clientSecret?: string;
|
||||
authConfig?: Record<string, any>;
|
||||
rateLimitPerMinute?: number;
|
||||
rateLimitPerHour?: number;
|
||||
concurrencyLimit?: number;
|
||||
requestTimeoutMs?: number;
|
||||
maxRetries?: number;
|
||||
retryDelayMs?: number;
|
||||
createdBy?: string;
|
||||
createdAt?: number;
|
||||
updatedBy?: string;
|
||||
updatedAt?: number;
|
||||
}
|
||||
|
||||
// 获取平台列表
|
||||
export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/listDatasourcePlatforms',
|
||||
url: '/data-engine/datasource/platform/controller/listDatasourcePlatforms',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
@@ -78,7 +79,7 @@ export function listDatasourcePlatforms(params: DatasourcePlatformQueryParams) {
|
||||
// 创建平台
|
||||
export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/createDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/createDatasourcePlatform',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
@@ -87,7 +88,7 @@ export function createDatasourcePlatform(data: CreateDatasourcePlatformParams) {
|
||||
// 更新平台
|
||||
export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/updateDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatform',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
@@ -96,7 +97,7 @@ export function updateDatasourcePlatform(data: UpdateDatasourcePlatformParams) {
|
||||
// 删除平台
|
||||
export function deleteDatasourcePlatform(id: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/deleteDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/deleteDatasourcePlatform',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
@@ -105,7 +106,7 @@ export function deleteDatasourcePlatform(id: string) {
|
||||
// 获取平台详情
|
||||
export function getDatasourcePlatform(id: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/getDatasourcePlatform',
|
||||
url: '/data-engine/datasource/platform/controller/getDatasourcePlatform',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
@@ -114,7 +115,7 @@ export function getDatasourcePlatform(id: string) {
|
||||
// 根据编码获取平台信息
|
||||
export function getPlatformByCode(platformCode: string) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/getPlatformByCode',
|
||||
url: '/data-engine/datasource/platform/controller/getPlatformByCode',
|
||||
method: 'get',
|
||||
params: { platformCode },
|
||||
});
|
||||
@@ -123,7 +124,7 @@ export function getPlatformByCode(platformCode: string) {
|
||||
// 更新平台状态
|
||||
export function updateDatasourcePlatformStatus(data: UpdateDatasourcePlatformStatusParams) {
|
||||
return request({
|
||||
url: '/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||
url: '/data-engine/datasource/platform/controller/updateDatasourcePlatformStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface PromptItem {
|
||||
deletedAt?: string | null;
|
||||
nodeType: string;
|
||||
prompt: string;
|
||||
sourceType: number; // 0-自定义 1-公共
|
||||
sourceType: number; // 1-管理员 2-用户
|
||||
}
|
||||
|
||||
export interface PromptListResponse {
|
||||
@@ -32,6 +32,23 @@ export interface CreatePromptParams {
|
||||
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 {
|
||||
id: number | string;
|
||||
}
|
||||
@@ -92,7 +109,7 @@ export function getMyPromptList(params: PromptListParams) {
|
||||
* 创建提示词
|
||||
*/
|
||||
export function createPrompt(data: CreatePromptParams) {
|
||||
return request({
|
||||
return request<CreatePromptResponse>({
|
||||
url: '/ai-agent/node/prompt/create',
|
||||
method: 'post',
|
||||
data,
|
||||
@@ -120,3 +137,13 @@ export function deletePrompt(id: number | string) {
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前用户是否为超级管理员
|
||||
*/
|
||||
export function checkIsSuperAdmin() {
|
||||
return request<CheckIsSuperAdminResponse>({
|
||||
url: '/admin-go/api/v1/system/user/checkIsSuperAdmin',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,65 +1,92 @@
|
||||
<template>
|
||||
<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
|
||||
v-model="message"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
:autosize="{ minRows: 2, maxRows: 5 }"
|
||||
placeholder="多说说你的偏好和要求,我会越用越懂你"
|
||||
:autosize="{ minRows: 1, maxRows: 6 }"
|
||||
placeholder="有什么想聊的?按 Enter 发送,Shift+Enter 换行"
|
||||
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="toolbar-left">
|
||||
<el-button circle class="tool-btn" @click="handleAttachment">
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-button>
|
||||
<el-dropdown trigger="click" @command="handleSkillSelect">
|
||||
<el-button class="pill-btn">
|
||||
{{ currentSkillDisplay }}
|
||||
</el-button>
|
||||
<!-- 上传附件 -->
|
||||
<el-tooltip content="上传文件" placement="top">
|
||||
<button class="tool-icon-btn" @click="handleAttachment">
|
||||
<el-icon><Paperclip /></el-icon>
|
||||
</button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 选择技能 -->
|
||||
<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>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="default">默认对话</el-dropdown-item>
|
||||
<el-dropdown-item command="code-review">代码审查</el-dropdown-item>
|
||||
<el-dropdown-item command="default">
|
||||
<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="writing">内容写作</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<el-button circle class="send-btn" :disabled="!message.trim()" @click="handleSend">
|
||||
<span class="hint-text">Shift+Enter 换行</span>
|
||||
<button class="send-btn" :disabled="!message.trim()" @click="handleSend">
|
||||
<el-icon><Top /></el-icon>
|
||||
</el-button>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 常用工作流胶囊 -->
|
||||
<div class="workflow-pills" v-if="commonWorkflows.length > 0">
|
||||
<div
|
||||
<!-- 快捷工作流胶囊(输入框下方) -->
|
||||
<div v-if="commonWorkflows.length > 0" class="workflow-shortcuts">
|
||||
<button
|
||||
v-for="wf in commonWorkflows"
|
||||
:key="wf.id"
|
||||
class="workflow-pill"
|
||||
class="shortcut-pill"
|
||||
:class="{ active: selectedWorkflowId === wf.id }"
|
||||
@click="selectWorkflow(wf)"
|
||||
@click="toggleWorkflow(wf.id)"
|
||||
>
|
||||
<el-icon class="pill-icon">
|
||||
<component :is="wf.icon" />
|
||||
</el-icon>
|
||||
<span class="pill-text">{{ wf.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-icon><Promotion /></el-icon>
|
||||
{{ wf.name }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Top, Plus, MagicStick, Document, CircleCheck } from '@element-plus/icons-vue';
|
||||
import { ref } from 'vue';
|
||||
import { Top, MagicStick, Promotion, Close, CircleClose, Paperclip } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
interface Emits {
|
||||
@@ -69,14 +96,12 @@ interface Emits {
|
||||
interface Workflow {
|
||||
id: number;
|
||||
name: string;
|
||||
icon: any;
|
||||
prefix: string;
|
||||
editPath: string;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
const router = useRouter();
|
||||
const message = ref('');
|
||||
const isFocused = ref(false);
|
||||
const selectedSkill = ref('default');
|
||||
const selectedWorkflowId = ref<number | null>(null);
|
||||
|
||||
@@ -87,59 +112,28 @@ const skillLabels: Record<string, string> = {
|
||||
writing: '内容写作',
|
||||
};
|
||||
|
||||
const currentSkillDisplay = computed(() => {
|
||||
return selectedSkill.value === 'default' ? '选择技能' : skillLabels[selectedSkill.value];
|
||||
});
|
||||
|
||||
const skills: Record<string, string> = {
|
||||
const skillPrefixes: Record<string, string> = {
|
||||
default: '',
|
||||
'code-review': '[技能:代码审查] 请帮我审查下面这段代码,找出潜在问题并给出改进建议:\n',
|
||||
refactor: '[技能:代码重构] 请帮我重构下面这段代码,提升可读性和可维护性:\n',
|
||||
writing: '[技能:内容写作] 请根据下面的需求帮我创作内容:\n',
|
||||
};
|
||||
|
||||
// 常用工作流列表
|
||||
const commonWorkflows: Workflow[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: '审查+测试',
|
||||
icon: Document,
|
||||
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',
|
||||
},
|
||||
{ id: 1, name: '审查', prefix: '[工作流:审查] 完成后请自动生成单元测试:\n' },
|
||||
{ id: 2, name: '文档再编码', prefix: '[工作流:文档再编码] 请先编写接口文档,再实现代码:\n' },
|
||||
{ id: 3, name: '代码重构', prefix: '[工作流:代码重构] 请帮我重构这段代码:\n' },
|
||||
{ id: 4, name: '需求分析', prefix: '[工作流:需求分析] 请帮我分析这个需求并拆解任务:\n' },
|
||||
];
|
||||
|
||||
const handleSend = (event?: KeyboardEvent) => {
|
||||
if (event) event.preventDefault();
|
||||
const handleSend = () => {
|
||||
const msg = message.value.trim();
|
||||
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 finalMessage = (skillPrefix + workflowPrefix + msg).trim();
|
||||
emit('send', finalMessage);
|
||||
message.value = '';
|
||||
// 发送后清空选择
|
||||
selectedWorkflowId.value = null;
|
||||
};
|
||||
|
||||
@@ -147,186 +141,241 @@ const handleAttachment = () => {
|
||||
ElMessage.info('附件上传功能开发中...');
|
||||
};
|
||||
|
||||
const handleSkillSelect = (key: string | number | object) => {
|
||||
selectedSkill.value = String(key);
|
||||
if (selectedSkill.value !== 'default') {
|
||||
ElMessage.success(`已选择技能:${skillLabels[selectedSkill.value]}`);
|
||||
}
|
||||
const handleSkillSelect = (key: string | number | object | null) => {
|
||||
selectedSkill.value = String(key ?? 'default');
|
||||
};
|
||||
|
||||
const selectWorkflow = (wf: Workflow) => {
|
||||
if (selectedWorkflowId.value === wf.id) {
|
||||
selectedWorkflowId.value = null;
|
||||
ElMessage.info('已取消工作流');
|
||||
} else {
|
||||
selectedWorkflowId.value = wf.id;
|
||||
ElMessage.success(`已选择工作流:${wf.name}`);
|
||||
}
|
||||
const handleWorkflowSelect = (id: number | null) => {
|
||||
selectedWorkflowId.value = id;
|
||||
};
|
||||
|
||||
const toggleWorkflow = (id: number) => {
|
||||
selectedWorkflowId.value = selectedWorkflowId.value === id ? null : id;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.input-shell {
|
||||
position: relative;
|
||||
z-index: 12;
|
||||
margin-top: -20px;
|
||||
padding: 0 0 50px;
|
||||
padding: 0 24px 24px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.input-card {
|
||||
width: min(1060px, 82%);
|
||||
max-width: 860px;
|
||||
margin: 0 auto;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 100%),
|
||||
radial-gradient(120% 180% at 0% 0%, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 38%),
|
||||
radial-gradient(80% 120% at 100% 100%, rgba(168, 85, 247, 0.08) 0%, rgba(168, 85, 247, 0) 38%);
|
||||
border: 1px solid rgba(59, 130, 246, 0.28);
|
||||
border-radius: 20px;
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
overflow: hidden;
|
||||
|
||||
&.is-focused {
|
||||
border-color: #93c5fd;
|
||||
box-shadow:
|
||||
0 24px 48px rgba(15, 23, 42, 0.12),
|
||||
0 0 0 1px rgba(59, 130, 246, 0.08) inset,
|
||||
0 8px 16px rgba(37, 99, 235, 0.1);
|
||||
padding: 16px 18px 18px;
|
||||
backdrop-filter: blur(16px);
|
||||
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 {
|
||||
:deep(.el-textarea__inner) {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
resize: none;
|
||||
padding: 8px 6px 14px;
|
||||
padding: 14px 16px 8px;
|
||||
font-size: 15px;
|
||||
line-height: 1.65;
|
||||
line-height: 1.6;
|
||||
color: #0f172a;
|
||||
background: transparent;
|
||||
min-height: 50px;
|
||||
font-weight: 500;
|
||||
min-height: 28px !important;
|
||||
|
||||
&::placeholder {
|
||||
color: #90a1b7;
|
||||
color: #94a3b8;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 底部工具栏 */
|
||||
.input-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding-top: 2px;
|
||||
padding: 6px 10px 10px 12px;
|
||||
}
|
||||
|
||||
.toolbar-left,
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.tool-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid #d9e4f5;
|
||||
color: #5b6b84;
|
||||
background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
|
||||
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
|
||||
transition: all 0.2s ease;
|
||||
.tool-icon-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
border: none;
|
||||
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 {
|
||||
color: #2b4d8f;
|
||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
|
||||
border-color: #bfdbfe;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
|
||||
background: #f1f5f9;
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #eff6ff;
|
||||
color: #2563eb;
|
||||
}
|
||||
}
|
||||
|
||||
.pill-btn {
|
||||
height: 32px;
|
||||
padding: 0 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid #dbe7f7;
|
||||
color: #30435f;
|
||||
background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
|
||||
.tool-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
|
||||
border-color: #bfdbfe;
|
||||
color: #1d4ed8;
|
||||
}
|
||||
.hint-text {
|
||||
font-size: 11px;
|
||||
color: #cbd5e1;
|
||||
margin-right: 6px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.send-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
|
||||
border-radius: 8px;
|
||||
background: #2563eb;
|
||||
color: #fff;
|
||||
box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background 0.15s,
|
||||
transform 0.1s,
|
||||
opacity 0.15s;
|
||||
outline: none;
|
||||
|
||||
.el-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
filter: brightness(1.08);
|
||||
background: #1d4ed8;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
box-shadow: none;
|
||||
background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
|
||||
background: #e2e8f0;
|
||||
color: #94a3b8;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 工作流胶囊样式 */
|
||||
.workflow-pills {
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid rgba(59, 130, 246, 0.15);
|
||||
/* 快捷工作流胶囊 */
|
||||
.workflow-shortcuts {
|
||||
max-width: 860px;
|
||||
margin: 10px auto 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.workflow-pill {
|
||||
.shortcut-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 10px;
|
||||
gap: 5px;
|
||||
height: 28px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
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 {
|
||||
border-color: #3b82f6;
|
||||
background: rgba(59, 130, 246, 0.08);
|
||||
transform: translateY(-1px);
|
||||
border-color: #93c5fd;
|
||||
color: #2563eb;
|
||||
background: rgba(239, 246, 255, 0.9);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #3b82f6;
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.pill-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.pill-text {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
background: #2563eb;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="history-title">历史对话</div>
|
||||
<div class="history-list">
|
||||
<div
|
||||
v-for="item in historyList"
|
||||
v-for="item in visibleHistory"
|
||||
:key="item.id"
|
||||
class="history-item"
|
||||
:class="{ active: activeHistoryId === item.id }"
|
||||
@@ -31,12 +31,56 @@
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from '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 {
|
||||
id: number;
|
||||
title: string;
|
||||
@@ -47,6 +91,8 @@ interface Props {
|
||||
activeMenu: string;
|
||||
activeHistoryId: number;
|
||||
historyList: HistoryItem[];
|
||||
treeNodes: TreeNode[];
|
||||
treeLoading: boolean;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
@@ -54,22 +100,22 @@ interface Emits {
|
||||
(e: 'new-chat'): void;
|
||||
(e: 'select-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 handleNewChat = () => {
|
||||
emit('new-chat');
|
||||
};
|
||||
const treeProps = { children: 'children', label: 'label' };
|
||||
|
||||
const handleSelectHistory = (id: number) => {
|
||||
emit('select-history', id);
|
||||
};
|
||||
const visibleHistory = computed(() => props.historyList);
|
||||
|
||||
const handleDeleteHistory = (id: number) => {
|
||||
emit('delete-history', id);
|
||||
};
|
||||
const handleNewChat = () => emit('new-chat');
|
||||
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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -113,12 +159,11 @@ const handleDeleteHistory = (id: number) => {
|
||||
}
|
||||
|
||||
.history-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 8px;
|
||||
min-height: 0;
|
||||
background: linear-gradient(180deg, rgba(249, 251, 255, 0.5) 0%, rgba(249, 251, 255, 0.9) 100%);
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid rgba(59, 130, 246, 0.08);
|
||||
}
|
||||
|
||||
.history-title {
|
||||
@@ -131,8 +176,8 @@ const handleDeleteHistory = (id: number) => {
|
||||
}
|
||||
|
||||
.history-list {
|
||||
flex: 1;
|
||||
padding: 0 8px 10px;
|
||||
padding: 0 8px 4px;
|
||||
max-height: 255px;
|
||||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
@@ -204,4 +249,146 @@ const handleDeleteHistory = (id: number) => {
|
||||
font-size: 11px;
|
||||
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>
|
||||
|
||||
@@ -4,50 +4,21 @@
|
||||
:active-menu="activeMenu"
|
||||
:active-history-id="activeHistoryId"
|
||||
:history-list="historyList"
|
||||
:tree-nodes="treeNodes"
|
||||
:tree-loading="treeLoading"
|
||||
@menu-change="handleMenuChange"
|
||||
@new-chat="handleCreateHistory"
|
||||
@select-history="handleSelectHistory"
|
||||
@delete-history="handleDeleteHistory"
|
||||
@preview-node="previewNode"
|
||||
@download-node="downloadNode"
|
||||
/>
|
||||
<div class="main-wrapper">
|
||||
<MainContent :active-menu="activeMenu" />
|
||||
<InputBar @send="handleSend" />
|
||||
</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>
|
||||
<div class="preview-container">
|
||||
<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 天前' },
|
||||
]);
|
||||
|
||||
const treeProps = { children: 'children', label: 'label' };
|
||||
const apiBaseUrl = (import.meta.env.VITE_API_URL || '').replace(/\/$/, '');
|
||||
|
||||
const joinUrl = (b: string, p: string) => `${b.replace(/\/$/, '')}${p.startsWith('/') ? p : `/${p}`}`;
|
||||
@@ -155,15 +125,15 @@ const mockTreeData: ExecutionTreeItem[] = [
|
||||
flowName: '代码审查任务',
|
||||
sessionId: 'session-1',
|
||||
items: [
|
||||
{ label: '审查结果.md', content: 'https://placekitten.com/800/600', type: 'text/markdown' },
|
||||
{ label: '流程图.png', content: 'https://placekitten.com/800/600', type: 'image/png' },
|
||||
{ label: '审查结果.md', content: 'https://placekitten.com/800/600', type: 'text/markdown', timestamp: '' },
|
||||
{ label: '流程图.png', content: 'https://placekitten.com/800/600', type: 'image/png', timestamp: '' },
|
||||
],
|
||||
},
|
||||
{
|
||||
Id: 2,
|
||||
flowName: '需求分析',
|
||||
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,
|
||||
flowName: '生成演示视频',
|
||||
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);
|
||||
};
|
||||
|
||||
const handleTreeNodeClick = () => {
|
||||
// 点击节点不需要额外操作
|
||||
};
|
||||
|
||||
const handleMenuChange = (menu: string) => {
|
||||
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 {
|
||||
max-height: 85vh;
|
||||
overflow: auto;
|
||||
|
||||
@@ -87,7 +87,7 @@ export default defineComponent({
|
||||
isShowPassword: false,
|
||||
ruleForm: {
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
password: 'Tongli686^*^',
|
||||
verifyCode: '',
|
||||
verifyKey: '',
|
||||
},
|
||||
|
||||
@@ -1,221 +1,540 @@
|
||||
<template>
|
||||
<template>
|
||||
<div class="cid-apis-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-form :model="tableData.param" ref="queryRef" :inline="true" label-width="68px">
|
||||
<el-form-item label="关键字" prop="keyword">
|
||||
<el-input
|
||||
v-model="tableData.param.keyword"
|
||||
placeholder="请输入接口名称"
|
||||
<el-card shadow="hover"
|
||||
><el-tabs v-model="tab" @tab-change="onTab"
|
||||
><el-tab-pane label="平台管理" name="platform"
|
||||
><el-form ref="pqf" :model="pq" :inline="true" label-width="68px" class="mb15"
|
||||
><el-form-item label="关键字" prop="keyword"
|
||||
><el-input
|
||||
v-model="pq.keyword"
|
||||
placeholder="请输入平台名称/编码"
|
||||
clearable
|
||||
size="default"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="getList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="default" type="primary" @click="getList">
|
||||
<el-icon><ele-Search /></el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default" @click="resetQuery(queryRef)">
|
||||
<el-icon><ele-Refresh /></el-icon>
|
||||
重置
|
||||
</el-button>
|
||||
<el-button size="default" type="success" @click="onOpenAdd">
|
||||
<el-icon><ele-FolderAdd /></el-icon>
|
||||
新增接口
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" @click="onRowDel(null)">
|
||||
<el-icon><ele-Delete /></el-icon>
|
||||
删除
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="name" label="接口名称" show-overflow-tooltip />
|
||||
<el-table-column prop="path" label="接口路径" show-overflow-tooltip />
|
||||
<el-table-column prop="method" label="请求方式" width="100" align="center" />
|
||||
<el-table-column prop="datasourceName" label="所属平台" show-overflow-tooltip />
|
||||
<el-table-column prop="status" label="状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" size="small">
|
||||
{{ scope.row.status === 1 ? '启用' : '禁用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createdAt" label="创建时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onOpenEdit(scope.row)">修改</el-button>
|
||||
<el-button size="small" text type="danger" @click="onRowDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="tableData.total > 0"
|
||||
:total="tableData.total"
|
||||
v-model:page="tableData.param.pageNum"
|
||||
v-model:limit="tableData.param.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" :close-on-click-modal="false">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="90px">
|
||||
<el-form-item label="接口名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入接口名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接口路径" prop="path">
|
||||
<el-input v-model="form.path" placeholder="请输入接口路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请求方式" prop="method">
|
||||
<el-select v-model="form.method" style="width: 100%">
|
||||
<el-option label="GET" value="GET" />
|
||||
<el-option label="POST" value="POST" />
|
||||
<el-option label="PUT" value="PUT" />
|
||||
<el-option label="DELETE" value="DELETE" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台" prop="datasourceId">
|
||||
<el-input v-model="form.datasourceId" placeholder="请输入所属平台ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" :rows="3" placeholder="请输入描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" style="width: 100%">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="禁用" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :loading="dialog.saving">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@keyup.enter.native="searchPlatform" /></el-form-item
|
||||
><el-form-item label="状态" prop="status"
|
||||
><el-select v-model="pq.status" placeholder="平台状态" clearable style="width: 160px"
|
||||
><el-option label="启用" value="ACTIVE" /><el-option label="禁用" value="INACTIVE" /></el-select></el-form-item
|
||||
><el-form-item
|
||||
><el-button type="primary" @click="searchPlatform"
|
||||
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||
><el-button @click="resetPlatformQuery"
|
||||
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||
><el-button type="success" @click="openPlatform()"
|
||||
><el-icon><ele-FolderAdd /></el-icon>新增平台</el-button
|
||||
></el-form-item
|
||||
></el-form
|
||||
><el-table :data="platformRows" row-key="id" v-loading="platformLoading"
|
||||
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||
prop="platformCode"
|
||||
label="平台编码"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="platformName" label="平台名称" min-width="160" show-overflow-tooltip /><el-table-column
|
||||
prop="apiBaseUrl"
|
||||
label="API地址"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="authType" label="认证" width="100" align="center" /><el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
width="90"
|
||||
align="center"
|
||||
><template #default="s"
|
||||
><el-tag size="small" :type="s.row.status === 'ACTIVE' ? 'success' : 'danger'">{{
|
||||
s.row.status === 'ACTIVE' ? '启用' : '禁用'
|
||||
}}</el-tag></template
|
||||
></el-table-column
|
||||
><el-table-column prop="rateLimitPerMinute" label="限流/分钟" width="110" align="center" /><el-table-column
|
||||
prop="requestTimeoutMs"
|
||||
label="超时(ms)"
|
||||
width="110"
|
||||
align="center"
|
||||
/><el-table-column label="创建时间" width="170"
|
||||
><template #default="s">{{ ft(s.row.createdAt) }}</template></el-table-column
|
||||
><el-table-column label="操作" width="150" fixed="right"
|
||||
><template #default="s"
|
||||
><el-button size="small" text type="primary" @click="openPlatform(s.row)">修改</el-button
|
||||
><el-button size="small" text type="danger" @click="delPlatform(s.row)">删除</el-button></template
|
||||
></el-table-column
|
||||
></el-table
|
||||
><pagination :total="platformTotal" v-model:page="pq.pageNum" v-model:limit="pq.pageSize" @pagination="getPlatforms" /></el-tab-pane
|
||||
><el-tab-pane label="接口管理" name="api"
|
||||
><el-form ref="aqf" :model="aq" :inline="true" label-width="68px" class="mb15"
|
||||
><el-form-item label="关键字" prop="keyword"
|
||||
><el-input
|
||||
v-model="aq.keyword"
|
||||
placeholder="请输入接口名称/编码"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
@keyup.enter.native="searchApi" /></el-form-item
|
||||
><el-form-item label="平台" prop="platformId"
|
||||
><el-select v-model="aq.platformId" placeholder="请选择平台" clearable filterable style="width: 180px"
|
||||
><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="status"
|
||||
><el-select v-model="aq.status" placeholder="状态" clearable style="width: 130px"
|
||||
><el-option label="启用" value="active" /><el-option label="禁用" value="inactive" /></el-select></el-form-item
|
||||
><el-form-item label="方法" prop="method"
|
||||
><el-select v-model="aq.method" placeholder="请求方式" clearable style="width: 130px"
|
||||
><el-option v-for="m in methods" :key="m" :label="m" :value="m" /></el-select></el-form-item
|
||||
><el-form-item
|
||||
><el-button type="primary" @click="searchApi"
|
||||
><el-icon><ele-Search /></el-icon>查询</el-button
|
||||
><el-button @click="resetApiQuery"
|
||||
><el-icon><ele-Refresh /></el-icon>重置</el-button
|
||||
><el-button type="success" @click="openApi()"
|
||||
><el-icon><ele-FolderAdd /></el-icon>新增接口</el-button
|
||||
></el-form-item
|
||||
></el-form
|
||||
><el-table :data="apiRows" v-loading="apiLoading"
|
||||
><el-table-column type="index" label="序号" width="60" /><el-table-column
|
||||
prop="code"
|
||||
label="接口编码"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="name" label="接口名称" min-width="150" show-overflow-tooltip /><el-table-column
|
||||
prop="url"
|
||||
label="URL"
|
||||
min-width="220"
|
||||
show-overflow-tooltip
|
||||
/><el-table-column prop="method" label="请求方式" width="100" align="center"
|
||||
><template #default="s"
|
||||
><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>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default { name: 'cidApis' };
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
||||
|
||||
const queryRef = ref<FormInstance>();
|
||||
const formRef = ref<FormInstance>();
|
||||
const ids = ref<string[]>([]);
|
||||
|
||||
const tableData = reactive({
|
||||
data: [] as any[],
|
||||
total: 0,
|
||||
param: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyword: '',
|
||||
},
|
||||
});
|
||||
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
saving: false,
|
||||
});
|
||||
|
||||
const form = reactive({
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { getApiErrorMessage } from '/@/utils/request';
|
||||
import {
|
||||
createDatasourcePlatform,
|
||||
deleteDatasourcePlatform,
|
||||
getDatasourcePlatform,
|
||||
listDatasourcePlatforms,
|
||||
updateDatasourcePlatform,
|
||||
} from '/@/api/cid/datasource';
|
||||
import {
|
||||
createApiInterface,
|
||||
deleteApiInterface,
|
||||
getApiInterface,
|
||||
listApiInterfaces,
|
||||
updateApiInterface,
|
||||
type ApiInterfaceInfo,
|
||||
} from '/@/api/cid/apis';
|
||||
defineOptions({ name: 'cidApis' });
|
||||
const tab = ref('platform'),
|
||||
methods = ['GET', 'POST', 'PUT', 'DELETE'],
|
||||
platforms = ref<any[]>([]),
|
||||
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: '',
|
||||
name: '',
|
||||
path: '',
|
||||
method: 'GET',
|
||||
datasourceId: '',
|
||||
platformCode: '',
|
||||
platformName: '',
|
||||
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 rules = {
|
||||
name: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
|
||||
path: [{ required: true, message: '请输入接口路径', trigger: 'blur' }],
|
||||
method: [{ required: true, message: '请选择请求方式', trigger: 'change' }],
|
||||
};
|
||||
|
||||
const getList = () => {
|
||||
// TODO: 调用列表接口
|
||||
};
|
||||
|
||||
const resetQuery = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
formEl.resetFields();
|
||||
getList();
|
||||
};
|
||||
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
};
|
||||
|
||||
const onOpenAdd = () => {
|
||||
dialog.title = '新增接口';
|
||||
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;
|
||||
const daf = () => ({
|
||||
id: '',
|
||||
platformId: '',
|
||||
code: '',
|
||||
name: '',
|
||||
url: '',
|
||||
method: 'GET',
|
||||
status: 'active',
|
||||
authType: '',
|
||||
requestConfigText: '{}',
|
||||
responseConfigText: '{}',
|
||||
limitConfigText: '{}',
|
||||
tableDefinitionText: '{}',
|
||||
});
|
||||
const platformForm = reactive(dpf()),
|
||||
apiForm = reactive(daf());
|
||||
const jv = (v: string, cb: (e?: Error) => void, l: string) => {
|
||||
if (!v) return cb();
|
||||
try {
|
||||
JSON.parse(v);
|
||||
cb();
|
||||
} catch {
|
||||
cb(new Error(`${l} 格式错误`));
|
||||
}
|
||||
ElMessageBox.confirm(`确定要删除选中的接口吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
// TODO: 调用删除接口
|
||||
ElMessage.success('删除成功');
|
||||
getList();
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
const platformRules: FormRules = {
|
||||
platformCode: [{ required: true, message: '请输入平台编码', trigger: 'blur' }],
|
||||
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>
|
||||
|
||||
@@ -1,126 +1,45 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
title="选择提示词"
|
||||
width="900px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="prompt-selector-dialog">
|
||||
<div class="prompt-header">
|
||||
<div class="search-bar">
|
||||
<el-input v-model="searchParams.keyword" placeholder="搜索提示词内容" clearable @clear="handleSearch" @keyup.enter="handleSearch">
|
||||
<template #prefix>
|
||||
<el-icon><Search /></el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="prompt-content" v-loading="loading">
|
||||
<el-empty v-if="!loading && promptList.length === 0" description="暂无提示词数据" :image-size="100" />
|
||||
<el-table v-else :data="promptList" height="360" border stripe style="width: 100%" @row-click="handleSelectPrompt">
|
||||
<el-table-column label="节点类型" width="120" prop="nodeType" />
|
||||
<el-table-column label="提示词内容" prop="prompt" show-overflow-tooltip />
|
||||
<el-table-column label="来源" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.sourceType === 1 ? 'success' : 'info'" size="small">
|
||||
{{ row.sourceType === 1 ? '公共' : '自定义' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="选择" width="60" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-icon v-if="selectedPrompt?.id === row.id" class="check-icon" color="#67c23a">
|
||||
<CircleCheck />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-if="shouldRenderPagination" class="pagination-panel">
|
||||
<div class="pagination-summary">共 {{ displayTotal }} 条</div>
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.pageNum"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:total="displayTotal"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="sizes, prev, pager, next, jumper"
|
||||
background
|
||||
:hide-on-single-page="false"
|
||||
@current-change="handlePageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
<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" :disabled="!selectedPrompt" @click="handleConfirm">确定</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { Search, CircleCheck } from '@element-plus/icons-vue';
|
||||
import { getPromptList, type PromptItem } from '/@/api/settings/promptManager';
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
defaultPrompt?: PromptItem | null;
|
||||
nodeType?: string;
|
||||
defaultPrompt?: string;
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
(e: 'confirm', prompt: PromptItem): void;
|
||||
(e: 'confirm', promptContent: string): void;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
defaultPrompt: null,
|
||||
nodeType: '',
|
||||
defaultPrompt: '',
|
||||
});
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const visible = ref(false);
|
||||
const loading = ref(false);
|
||||
const promptList = ref<PromptItem[]>([]);
|
||||
const selectedPrompt = ref<PromptItem | null>(null);
|
||||
const searchParams = reactive({ keyword: '' });
|
||||
const pagination = reactive({ pageNum: 1, pageSize: 10, total: 0 });
|
||||
|
||||
const displayTotal = computed(() => {
|
||||
if (pagination.total > 0) return pagination.total;
|
||||
if (promptList.value.length > 0) return promptList.value.length;
|
||||
return 0;
|
||||
});
|
||||
|
||||
const shouldRenderPagination = computed(() => displayTotal.value > 0);
|
||||
const promptContent = ref('');
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
visible.value = val;
|
||||
if (val) {
|
||||
selectedPrompt.value = props.defaultPrompt || null;
|
||||
pagination.pageNum = 1;
|
||||
fetchPromptList();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.nodeType,
|
||||
() => {
|
||||
if (visible.value) {
|
||||
pagination.pageNum = 1;
|
||||
fetchPromptList();
|
||||
promptContent.value = props.defaultPrompt || '';
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -131,112 +50,19 @@ watch(visible, (val) => {
|
||||
}
|
||||
});
|
||||
|
||||
const resolvePromptList = (payload: any): PromptItem[] => {
|
||||
if (Array.isArray(payload?.data?.list)) return payload.data.list;
|
||||
if (Array.isArray(payload?.list)) return payload.list;
|
||||
if (Array.isArray(payload?.rows)) return payload.rows;
|
||||
return [];
|
||||
};
|
||||
|
||||
const resolvePromptTotal = (payload: any, list: PromptItem[]) => {
|
||||
const totalCandidates = [payload?.data?.total, payload?.total, payload?.data?.count, payload?.count];
|
||||
const validTotal = totalCandidates.find((item) => typeof item === 'number' && !Number.isNaN(item));
|
||||
if (typeof validTotal === 'number') return validTotal;
|
||||
return list.length;
|
||||
};
|
||||
|
||||
const fetchPromptList = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const params = {
|
||||
pageNum: pagination.pageNum,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchParams.keyword || undefined,
|
||||
nodeType: props.nodeType || undefined,
|
||||
};
|
||||
const res = await getPromptList(params);
|
||||
const list = resolvePromptList(res);
|
||||
promptList.value = list;
|
||||
pagination.total = resolvePromptTotal(res, list);
|
||||
} catch (error) {
|
||||
promptList.value = [];
|
||||
pagination.total = 0;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleSearch = () => {
|
||||
pagination.pageNum = 1;
|
||||
fetchPromptList();
|
||||
};
|
||||
|
||||
const handlePageChange = () => {
|
||||
fetchPromptList();
|
||||
};
|
||||
|
||||
const handleSizeChange = (size: number) => {
|
||||
pagination.pageSize = size;
|
||||
pagination.pageNum = 1;
|
||||
fetchPromptList();
|
||||
};
|
||||
|
||||
const handleSelectPrompt = (prompt: PromptItem) => {
|
||||
selectedPrompt.value = prompt;
|
||||
};
|
||||
|
||||
const handleConfirm = () => {
|
||||
if (!selectedPrompt.value) return;
|
||||
emit('confirm', selectedPrompt.value);
|
||||
emit('confirm', promptContent.value.trim());
|
||||
handleClose();
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
selectedPrompt.value = null;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.prompt-selector-dialog {
|
||||
.prompt-input-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.prompt-header {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.search-bar :deep(.el-input) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.prompt-content {
|
||||
min-height: 360px;
|
||||
}
|
||||
|
||||
.pagination-panel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid var(--el-border-color-lighter);
|
||||
}
|
||||
|
||||
.pagination-summary {
|
||||
font-size: 14px;
|
||||
color: var(--el-text-color-regular);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pagination-panel :deep(.el-pagination) {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
选择提示词
|
||||
编辑提示词
|
||||
</el-button>
|
||||
<div v-if="selectedPrompt" class="selected-prompt-tag">
|
||||
<div v-if="promptContent" class="selected-prompt-tag">
|
||||
<el-tag type="success" size="large" closable @close="handleRemovePrompt">
|
||||
{{ selectedPrompt.prompt ? selectedPrompt.prompt.substring(0, 50) + '...' : '提示词' }}
|
||||
{{ promptContent.length > 50 ? `${promptContent.substring(0, 50)}...` : promptContent }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,6 +91,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<template v-if="isParameterConversionNode">
|
||||
<el-divider content-position="left">参数结构</el-divider>
|
||||
<div class="output-config-list">
|
||||
<div v-for="(item, index) in outputConfigFields" :key="index" class="output-config-card">
|
||||
<div class="output-config-inline-row">
|
||||
<el-input v-model="item.field" placeholder="参数名" class="output-config-inline-input" />
|
||||
<el-input v-model="item.value" placeholder="参数说明" class="output-config-inline-input" />
|
||||
<el-button type="danger" :icon="Delete" circle size="small" @click="removeOutputConfigField(index)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" link :icon="Plus" class="add-pair-btn" @click="addOutputConfigField">添加参数结构</el-button>
|
||||
</template>
|
||||
<!-- 基础表单 + 模型表单 -->
|
||||
<el-form-item v-for="fieldItem in visibleFormFields" :key="fieldItem.field" :label="fieldItem.label">
|
||||
<!-- 下拉选择框 -->
|
||||
@@ -593,7 +606,7 @@
|
||||
/>
|
||||
|
||||
<!-- 提示词选择器 -->
|
||||
<PromptSelector v-model="showPromptSelector" :default-prompt="selectedPrompt" :node-type="formState.nodeCode" @confirm="handlePromptConfirm" />
|
||||
<PromptSelector v-model="showPromptSelector" :default-prompt="promptContent" @confirm="handlePromptConfirm" />
|
||||
|
||||
<!-- 技能选择器 -->
|
||||
<SkillSelector v-model="showSkillSelector" :default-skill="selectedSkill" @confirm="handleSkillConfirm" />
|
||||
@@ -812,7 +825,6 @@ import SkillSelector from '/@/components/skill/NodeSkillSelector.vue';
|
||||
import ModelSelector from '/@/components/model/ModelSelector.vue';
|
||||
import SaveWorkflowDialog from './component/SaveWorkflowDialog.vue';
|
||||
import PromptSelector from './component/PromptSelector.vue';
|
||||
import type { PromptItem } from '/@/api/settings/promptManager';
|
||||
import type { SkillItem } from '/@/api/settings/skill';
|
||||
import {
|
||||
downloadToFile,
|
||||
@@ -874,12 +886,13 @@ const customFields = ref<
|
||||
maxFileCount?: number;
|
||||
}>
|
||||
>([]);
|
||||
const outputConfigFields = ref<Array<{ field: string; value: string }>>([]);
|
||||
const selectedParentParam = ref('');
|
||||
const selectedModel = ref('');
|
||||
const showSkillSelector = ref(false);
|
||||
const selectedSkill = ref<SkillItem | null>(null);
|
||||
const showPromptSelector = ref(false);
|
||||
const selectedPrompt = ref<PromptItem | null>(null);
|
||||
const promptContent = ref('');
|
||||
const isSaveFileEnabled = ref(false);
|
||||
const saving = ref(false);
|
||||
const leftPanelTab = ref('selected'); // 默认显示"当前选中"Tab
|
||||
@@ -1092,6 +1105,7 @@ const visibleFormFields = computed<NodeLibraryFormItem[]>(() => {
|
||||
return returnType === 'callback' || returnType === '等候回调' || returnType === '等待回调';
|
||||
});
|
||||
});
|
||||
const isParameterConversionNode = computed(() => String(formState.nodeCode || '').toLowerCase() === 'data_conversion_model');
|
||||
// 获取可用的上级节点参数
|
||||
const availableParentParams = computed(() => {
|
||||
if (!selectedElement.value) return [];
|
||||
@@ -1327,8 +1341,9 @@ const workflowDsl = computed(() => ({
|
||||
modelResponse: n.properties.modelConfig?.modelResponse || n.properties?.modelResponse || null,
|
||||
}
|
||||
: null,
|
||||
outputConfig: Array.isArray(n.properties?.outputConfig) ? n.properties.outputConfig : null,
|
||||
isSaveFile: n.properties?.isSaveFileEnabled ?? null,
|
||||
promptContent: n.properties?.promptData?.prompt || null,
|
||||
promptContent: n.properties?.promptContent || '',
|
||||
outputResult: null,
|
||||
})),
|
||||
edges: flowDsl.value.edges.map((e) => ({
|
||||
@@ -1479,10 +1494,21 @@ const handleTemplatePageChange = (page: number) => {
|
||||
// 处理技能选择确认(只更新临时状态,不保存到节点)
|
||||
const handleSkillConfirm = (skill: SkillItem) => {
|
||||
selectedSkill.value = skill;
|
||||
if (selectedElement.value?.kind === 'node') {
|
||||
selectedElement.value.properties = {
|
||||
...(selectedElement.value.properties || {}),
|
||||
skillName: skill.name,
|
||||
};
|
||||
}
|
||||
};
|
||||
// 移除已选择的技能(只更新临时状态)
|
||||
const handleRemoveSkill = () => {
|
||||
selectedSkill.value = null;
|
||||
if (selectedElement.value?.kind === 'node') {
|
||||
const nextProperties = { ...(selectedElement.value.properties || {}) };
|
||||
delete nextProperties.skillName;
|
||||
selectedElement.value.properties = nextProperties;
|
||||
}
|
||||
};
|
||||
// 处理模型选择确认(只更新临时状态,不保存到节点)
|
||||
const handleModelConfirm = (model: any) => {
|
||||
@@ -1499,13 +1525,13 @@ const handleRemoveModel = () => {
|
||||
selectedModel.value = '';
|
||||
selectedModelData.value = null;
|
||||
};
|
||||
// 处理提示词选择确认
|
||||
const handlePromptConfirm = (prompt: PromptItem) => {
|
||||
selectedPrompt.value = prompt;
|
||||
// 处理提示词输入确认
|
||||
const handlePromptConfirm = (value: string) => {
|
||||
promptContent.value = value;
|
||||
};
|
||||
// 移除已选择的提示词
|
||||
// 移除已填写的提示词
|
||||
const handleRemovePrompt = () => {
|
||||
selectedPrompt.value = null;
|
||||
promptContent.value = '';
|
||||
};
|
||||
// 获取对话模型列表
|
||||
const fetchChatModelList = async () => {
|
||||
@@ -1695,7 +1721,20 @@ const useWorkflow = async (workflow: WorkflowItem) => {
|
||||
// 初始化其他配置字段(从 config 中读取)
|
||||
if (node.config) {
|
||||
Object.keys(node.config).forEach((key) => {
|
||||
if (!['nodeCode', 'width', 'height', 'x', 'y', 'formConfig', 'inputSource', 'fieldMetadata', 'selectedModel', 'modelOutputFields'].includes(key)) {
|
||||
if (
|
||||
![
|
||||
'nodeCode',
|
||||
'width',
|
||||
'height',
|
||||
'x',
|
||||
'y',
|
||||
'formConfig',
|
||||
'inputSource',
|
||||
'fieldMetadata',
|
||||
'selectedModel',
|
||||
'modelOutputFields',
|
||||
].includes(key)
|
||||
) {
|
||||
const fieldKey = `${node.id}_${key}`;
|
||||
creationFormValues[fieldKey] = node.config[key];
|
||||
}
|
||||
@@ -1864,7 +1903,10 @@ const hydrateCreationFileFields = (nodes: any[] = []) => {
|
||||
const urls = Array.isArray(rawValue) ? rawValue : rawValue ? [rawValue] : [];
|
||||
if (urls.length === 0) return;
|
||||
creationFieldFiles[key] = urls.map((url: string, index: number) => ({
|
||||
name: String(url || '').split('/').pop() || `file-${index + 1}`,
|
||||
name:
|
||||
String(url || '')
|
||||
.split('/')
|
||||
.pop() || `file-${index + 1}`,
|
||||
url,
|
||||
}));
|
||||
});
|
||||
@@ -2075,13 +2117,10 @@ const sendMessage = async () => {
|
||||
// 2. 构建节点输入参数
|
||||
const nodeInputParams =
|
||||
currentWorkflowForCreation.value.nodeInputParams?.map((node: any) => {
|
||||
const nodeParam: any = {
|
||||
id: node.id,
|
||||
nodeCode: node.nodeCode,
|
||||
name: node.name,
|
||||
};
|
||||
// 先展开原始节点的所有字段(保留 promptContent、isSaveFile、outputConfig、modelOutputFields 等)
|
||||
const nodeParam: any = { ...node };
|
||||
|
||||
// 添加表单配置和值
|
||||
// 用用户填写的值覆盖 formConfig
|
||||
if (node.formConfig && Array.isArray(node.formConfig)) {
|
||||
nodeParam.formConfig = node.formConfig.map((field: any) => {
|
||||
// HTTP body: 将创作模式填写值回写到 body 的 showInForm 子字段
|
||||
@@ -2123,10 +2162,9 @@ const sendMessage = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
// 添加其他配置
|
||||
// 用用户填写的值覆盖 config
|
||||
if (node.config) {
|
||||
nodeParam.config = { ...node.config };
|
||||
// 更新 config 中的值
|
||||
Object.keys(node.config).forEach((key) => {
|
||||
const fieldKey = `${node.id}_${key}`;
|
||||
if (creationFormValues[fieldKey] !== undefined) {
|
||||
@@ -2135,11 +2173,6 @@ const sendMessage = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
// 添加其他字段
|
||||
if (node.inputSource) nodeParam.inputSource = node.inputSource;
|
||||
if (node.modelConfig) nodeParam.modelConfig = node.modelConfig;
|
||||
if (node.skillName) nodeParam.skillName = node.skillName;
|
||||
|
||||
return nodeParam;
|
||||
}) || [];
|
||||
|
||||
@@ -2295,7 +2328,20 @@ const handleTreeNodeClick = async (data: TreeNode) => {
|
||||
// 初始化其他配置字段(从 config 中读取)
|
||||
if (node.config) {
|
||||
Object.keys(node.config).forEach((key) => {
|
||||
if (!['nodeCode', 'width', 'height', 'x', 'y', 'formConfig', 'inputSource', 'fieldMetadata', 'selectedModel', 'modelOutputFields'].includes(key)) {
|
||||
if (
|
||||
![
|
||||
'nodeCode',
|
||||
'width',
|
||||
'height',
|
||||
'x',
|
||||
'y',
|
||||
'formConfig',
|
||||
'inputSource',
|
||||
'fieldMetadata',
|
||||
'selectedModel',
|
||||
'modelOutputFields',
|
||||
].includes(key)
|
||||
) {
|
||||
const fieldKey = `${node.id}_${key}`;
|
||||
creationFormValues[fieldKey] = node.config[key];
|
||||
}
|
||||
@@ -2377,7 +2423,20 @@ const handleTreeNodeClick = async (data: TreeNode) => {
|
||||
// 初始化其他配置字段(从 config 中读取)
|
||||
if (node.config) {
|
||||
Object.keys(node.config).forEach((key) => {
|
||||
if (!['nodeCode', 'width', 'height', 'x', 'y', 'formConfig', 'inputSource', 'fieldMetadata', 'selectedModel', 'modelOutputFields'].includes(key)) {
|
||||
if (
|
||||
![
|
||||
'nodeCode',
|
||||
'width',
|
||||
'height',
|
||||
'x',
|
||||
'y',
|
||||
'formConfig',
|
||||
'inputSource',
|
||||
'fieldMetadata',
|
||||
'selectedModel',
|
||||
'modelOutputFields',
|
||||
].includes(key)
|
||||
) {
|
||||
const fieldKey = `${node.id}_${key}`;
|
||||
creationFormValues[fieldKey] = node.config[key];
|
||||
}
|
||||
@@ -2503,6 +2562,12 @@ const addCustomField = () => {
|
||||
maxFileCount: undefined,
|
||||
});
|
||||
};
|
||||
const addOutputConfigField = () => {
|
||||
outputConfigFields.value.push({ field: '', value: '' });
|
||||
};
|
||||
const removeOutputConfigField = (index: number) => {
|
||||
outputConfigFields.value.splice(index, 1);
|
||||
};
|
||||
// 删除自定义字段
|
||||
const removeCustomField = (index: number) => {
|
||||
customFields.value.splice(index, 1);
|
||||
@@ -2940,6 +3005,18 @@ const updateKeyValueFieldFromPairs = (field: string) => {
|
||||
// 保存为JSON字符串
|
||||
dynamicFormValues[field] = Object.keys(obj).length > 0 ? JSON.stringify(obj) : '';
|
||||
};
|
||||
const buildOutputConfigPayload = () =>
|
||||
outputConfigFields.value
|
||||
.map((item) => {
|
||||
const fieldName = String(item.field || '').trim();
|
||||
if (!fieldName) return null;
|
||||
return {
|
||||
field: fieldName,
|
||||
label: fieldName,
|
||||
value: String(item.value || '').trim(),
|
||||
};
|
||||
})
|
||||
.filter(Boolean) as Array<{ field: string; label: string; value: string }>;
|
||||
// 存储字段的文件列表
|
||||
const fieldFileLists = reactive<Record<string, any[]>>({});
|
||||
// 存储字段的上传key(用于重置上传组件)
|
||||
@@ -3221,6 +3298,7 @@ watch(
|
||||
Object.keys(fieldUploadKeys).forEach((k) => delete fieldUploadKeys[k]);
|
||||
currentHttpBodyField.value = '';
|
||||
showHttpBodyDialog.value = false;
|
||||
outputConfigFields.value = [];
|
||||
|
||||
// 重置 dynamicFormValues(不删除固定字段键,动态 expand 键按节点切换清理)
|
||||
for (const key in dynamicFormValues) {
|
||||
@@ -3294,6 +3372,12 @@ watch(
|
||||
}
|
||||
});
|
||||
}
|
||||
if (Array.isArray(e?.properties?.outputConfig)) {
|
||||
outputConfigFields.value = e.properties.outputConfig.map((item: any) => ({
|
||||
field: String(item?.field || item?.label || '').trim(),
|
||||
value: String(item?.value || ''),
|
||||
}));
|
||||
}
|
||||
|
||||
// 初始化模型选择和模型相关数据(从 modelConfig)
|
||||
const modelConfig = e?.properties?.modelConfig;
|
||||
@@ -3360,12 +3444,8 @@ watch(
|
||||
selectedSkill.value = null;
|
||||
}
|
||||
|
||||
// 恢复提示词信息
|
||||
if (e?.properties?.promptData) {
|
||||
selectedPrompt.value = e.properties.promptData;
|
||||
} else {
|
||||
selectedPrompt.value = null;
|
||||
}
|
||||
// 恢复提示词内容
|
||||
promptContent.value = String(e?.properties?.promptContent || '');
|
||||
|
||||
// 恢复对话模式状态
|
||||
isSaveFileEnabled.value = e?.properties?.isSaveFileEnabled === true;
|
||||
@@ -3450,7 +3530,7 @@ const applySelected = () => {
|
||||
'inputSource',
|
||||
'formConfig',
|
||||
'skillName',
|
||||
'promptData',
|
||||
'promptContent',
|
||||
'isSaveFileEnabled',
|
||||
'width',
|
||||
'height',
|
||||
@@ -3503,14 +3583,14 @@ const applySelected = () => {
|
||||
if (selectedSkill.value) {
|
||||
p.skillName = selectedSkill.value.name;
|
||||
} else {
|
||||
delete p.skillName;
|
||||
p.skillName = null;
|
||||
}
|
||||
|
||||
// 保存提示词选择状态
|
||||
if (selectedPrompt.value) {
|
||||
p.promptData = selectedPrompt.value;
|
||||
// 保存提示词内容
|
||||
if (promptContent.value.trim()) {
|
||||
p.promptContent = promptContent.value.trim();
|
||||
} else {
|
||||
delete p.promptData;
|
||||
delete p.promptContent;
|
||||
}
|
||||
|
||||
// 保存对话模式状态
|
||||
@@ -3534,6 +3614,7 @@ const applySelected = () => {
|
||||
|
||||
// 保存 formConfig(包含基础字段 + 自定义字段,不包含模型字段)
|
||||
const formConfig: Array<any> = [];
|
||||
const outputConfig = buildOutputConfigPayload();
|
||||
|
||||
// 1. 添加基础表单字段(非模型字段)
|
||||
// 重用上面的 modelFieldNames
|
||||
@@ -3590,6 +3671,12 @@ const applySelected = () => {
|
||||
} else {
|
||||
delete p.formConfig;
|
||||
}
|
||||
|
||||
if (outputConfig.length > 0) {
|
||||
p.outputConfig = outputConfig;
|
||||
} else {
|
||||
delete p.outputConfig;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -3929,10 +4016,11 @@ const loadWorkflowFromDsl = (dsl: any) => {
|
||||
skillName: n.skillName || null,
|
||||
formConfig: n.formConfig || null,
|
||||
modelConfig: n.modelConfig || null,
|
||||
outputConfig: n.outputConfig || null,
|
||||
inputSource: n.inputSource || null,
|
||||
// 加载提示词和保存文件配置
|
||||
isSaveFileEnabled: n.isSaveFile ?? false,
|
||||
promptData: n.promptContent ? { id: 0, prompt: n.promptContent, nodeType: n.nodeCode } : null,
|
||||
promptContent: n.promptContent || '',
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -3984,8 +4072,8 @@ watch(selectedElement, (newElement) => {
|
||||
selectedSkill.value = null;
|
||||
}
|
||||
|
||||
// 从节点属性中恢复提示词选择状态
|
||||
selectedPrompt.value = newElement.properties.promptData || null;
|
||||
// 从节点属性中恢复提示词内容
|
||||
promptContent.value = String(newElement.properties.promptContent || '');
|
||||
|
||||
// 从节点属性中恢复对话模式状态
|
||||
isSaveFileEnabled.value = newElement.properties.isSaveFileEnabled === true;
|
||||
@@ -3994,7 +4082,7 @@ watch(selectedElement, (newElement) => {
|
||||
selectedModel.value = '';
|
||||
selectedModelData.value = null;
|
||||
selectedSkill.value = null;
|
||||
selectedPrompt.value = null;
|
||||
promptContent.value = '';
|
||||
isSaveFileEnabled.value = false;
|
||||
}
|
||||
});
|
||||
@@ -5413,6 +5501,30 @@ onBeforeUnmount(() => {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.output-config-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.output-config-card {
|
||||
padding: 12px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 12px;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.output-config-inline-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.output-config-inline-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.selected-panel {
|
||||
padding: 14px;
|
||||
height: 100%;
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="sourceType" label="来源" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.sourceType === 0">自定义</el-tag>
|
||||
<el-tag v-else-if="row.sourceType === 1" type="success">公共</el-tag>
|
||||
<el-tag v-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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -128,7 +128,7 @@ const nodeOptions = computed(() => {
|
||||
const createForm = reactive({
|
||||
nodeType: '',
|
||||
prompt: '',
|
||||
sourceType: 0 as number,
|
||||
sourceType: 2 as number,
|
||||
});
|
||||
|
||||
// 加载节点库
|
||||
@@ -269,7 +269,7 @@ const cancelCreate = () => {
|
||||
editId.value = null;
|
||||
createForm.nodeType = '';
|
||||
createForm.prompt = '';
|
||||
createForm.sourceType = 0;
|
||||
createForm.sourceType = 2;
|
||||
};
|
||||
|
||||
// 分页
|
||||
|
||||
@@ -43,11 +43,6 @@
|
||||
<span class="ml10 text-muted">天(0表示永不过期)</span>
|
||||
</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-input-number v-model="ruleForm.maxRetryCount" :min="0" :max="10" placeholder="请输入登录失败锁定次数" />
|
||||
<span class="ml10 text-muted">次(0表示不锁定)</span>
|
||||
@@ -85,7 +80,6 @@ interface RuleFormState {
|
||||
requireDigit: boolean;
|
||||
requireSpecialChar: boolean;
|
||||
expireDays: number;
|
||||
historyLimit: number;
|
||||
maxRetryCount: number;
|
||||
lockTimeMinutes: number;
|
||||
remark: string;
|
||||
@@ -112,7 +106,6 @@ export default defineComponent({
|
||||
requireDigit: true,
|
||||
requireSpecialChar: false,
|
||||
expireDays: 90,
|
||||
historyLimit: 5,
|
||||
maxRetryCount: 5,
|
||||
lockTimeMinutes: 30,
|
||||
remark: '',
|
||||
@@ -127,9 +120,6 @@ export default defineComponent({
|
||||
expireDays: [
|
||||
{ required: true, message: '请输入密码过期天数', trigger: 'blur' }
|
||||
],
|
||||
historyLimit: [
|
||||
{ required: true, message: '请输入禁止重复使用次数', trigger: 'blur' }
|
||||
],
|
||||
maxRetryCount: [
|
||||
{ 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