From 27ab0d802c91519b542cfa0e24bc8d8b5ccd9c5f Mon Sep 17 00:00:00 2001 From: zhangtao <9480807882@qq.com> Date: Mon, 3 Aug 2026 00:15:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=E6=B8=85=E7=90=86?= =?UTF-8?q?=E5=BA=9F=E5=BC=83=E8=B5=84=E6=BA=90=E4=B8=8E=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 删除大量旧版静态图标、图片资源,替换为新的svg图标 2. 移除废弃的API模块、页面组件与配置文件 3. 新增全局消息store与通用列表分页hook 4. 优化代码逻辑:简化错误处理、调整样式类顺序、更新路由鉴权 5. 替换旧的按钮样式属性,统一代码规范 --- frontend/app/src/api/mock/mockAdapter.ts | 8 +- frontend/app/src/api/module_ai/chat.ts | 3 +- .../app/src/api/module_generator/gencode.ts | 71 -- frontend/app/src/api/module_monitor/cache.ts | 59 -- .../app/src/api/module_monitor/resource.ts | 57 - frontend/app/src/api/module_system/auth.ts | 3 +- .../app/src/api/module_task/cronjob/job.ts | 114 -- .../app/src/api/module_task/cronjob/node.ts | 70 -- .../app/src/api/module_task/workflow/flow.ts | 100 -- .../app/src/api/module_task/workflow/nodes.ts | 60 -- frontend/app/src/auto-imports.d.ts | 4 + frontend/app/src/components.d.ts | 15 +- frontend/app/src/components/GlobalMessage.vue | 1 + frontend/app/src/components/PaginationBar.vue | 8 +- frontend/app/src/components/SkeletonPage.vue | 2 +- frontend/app/src/components/SliderCaptcha.vue | 355 ------- .../app/src/composables/useGlobalMessage.ts | 32 + frontend/app/src/composables/useListPage.ts | 63 ++ frontend/app/src/http/adapters/alova.ts | 82 +- frontend/app/src/manifest-bak.json | 83 -- frontend/app/src/pages-bak.json | 329 ------ frontend/app/src/pages.json | 294 ++++-- frontend/app/src/pages/index/index.vue | 430 +++++--- frontend/app/src/pages/login/index.vue | 84 +- frontend/app/src/pages/mine/index.vue | 54 +- frontend/app/src/pages/work/index.vue | 37 +- frontend/app/src/router/index.ts | 17 + frontend/app/src/static/icons/browser.png | Bin 3592 -> 0 bytes .../src/static/icons/{oauth => }/gitee.svg | 0 .../src/static/icons/{oauth => }/github.svg | 0 .../app/src/static/{images => icons}/home.svg | 0 frontend/app/src/static/icons/log.png | Bin 5404 -> 0 bytes frontend/app/src/static/icons/notice.png | Bin 5237 -> 0 bytes frontend/app/src/static/icons/notice.svg | 1 + .../app/src/static/icons/{oauth => }/qq.svg | 0 frontend/app/src/static/icons/role.png | Bin 5637 -> 0 bytes frontend/app/src/static/icons/role.svg | 1 + frontend/app/src/static/icons/setting.png | Bin 5628 -> 0 bytes frontend/app/src/static/icons/setting.svg | 1 + frontend/app/src/static/icons/user.png | Bin 5597 -> 0 bytes .../app/src/static/{images => icons}/user.svg | 0 frontend/app/src/static/icons/visitor.png | Bin 2318 -> 0 bytes .../src/static/icons/{oauth => }/wechat.svg | 0 frontend/app/src/static/icons/weixin.png | Bin 4252 -> 0 bytes .../app/src/static/{images => icons}/work.svg | 0 frontend/app/src/static/images/banner01.jpg | Bin 37168 -> 0 bytes frontend/app/src/static/images/banner02.jpg | Bin 38085 -> 0 bytes .../app/src/static/images/default-avatar.png | Bin 6359 -> 0 bytes frontend/app/src/static/images/login-bg.svg | 54 - frontend/app/src/static/logo.svg | 5 - frontend/app/src/store/userStore.ts | 7 +- frontend/app/src/styles/index.scss | 499 --------- frontend/app/src/styles/themes/fastapp.scss | 130 --- .../app/src/subPages/biz/dashboard/index.vue | 103 +- frontend/app/src/subPages/biz/dicts/index.vue | 22 +- .../app/src/subPages/biz/notices/index.vue | 34 +- .../app/src/subPages/biz/params/index.vue | 30 +- .../src/subPages/biz/ticket-detail/index.vue | 11 +- .../app/src/subPages/biz/tickets/index.vue | 34 +- .../src/subPages/biz/user-detail/index.vue | 12 +- .../app/src/subPages/biz/versions/index.vue | 38 +- .../app/src/subPages/dev/ai-models/index.vue | 34 +- frontend/app/src/subPages/dev/chat/index.vue | 79 +- .../app/src/subPages/dev/gencode/index.vue | 250 ----- .../app/src/subPages/dev/workflow/index.vue | 524 ---------- .../app/src/subPages/monitor/cache/index.vue | 94 -- .../src/subPages/monitor/cronjob/index.vue | 986 ------------------ .../src/subPages/monitor/devices/index.vue | 373 ------- .../subPages/monitor/file_manager/index.vue | 229 ---- .../src/subPages/monitor/loginlogs/index.vue | 20 +- .../app/src/subPages/monitor/online/index.vue | 16 +- .../app/src/subPages/monitor/oplogs/index.vue | 30 +- .../app/src/subPages/monitor/server/index.vue | 94 -- .../app/src/subPages/system/depts/index.vue | 8 +- .../app/src/subPages/system/menus/index.vue | 8 +- .../src/subPages/system/positions/index.vue | 13 +- .../app/src/subPages/system/roles/index.vue | 14 +- .../app/src/subPages/system/users/index.vue | 10 +- .../subPages/wot-demo/echarts-async/index.vue | 24 +- .../src/subPages/wot-demo/skills/index.vue | 2 +- frontend/app/src/uni-pages.d.ts | 51 +- frontend/app/tsconfig.json | 13 +- 82 files changed, 1073 insertions(+), 5216 deletions(-) delete mode 100644 frontend/app/src/api/module_generator/gencode.ts delete mode 100644 frontend/app/src/api/module_monitor/cache.ts delete mode 100644 frontend/app/src/api/module_monitor/resource.ts delete mode 100644 frontend/app/src/api/module_task/cronjob/job.ts delete mode 100644 frontend/app/src/api/module_task/cronjob/node.ts delete mode 100644 frontend/app/src/api/module_task/workflow/flow.ts delete mode 100644 frontend/app/src/api/module_task/workflow/nodes.ts delete mode 100644 frontend/app/src/components/SliderCaptcha.vue create mode 100644 frontend/app/src/composables/useGlobalMessage.ts create mode 100644 frontend/app/src/composables/useListPage.ts delete mode 100644 frontend/app/src/manifest-bak.json delete mode 100644 frontend/app/src/pages-bak.json delete mode 100644 frontend/app/src/static/icons/browser.png rename frontend/app/src/static/icons/{oauth => }/gitee.svg (100%) rename frontend/app/src/static/icons/{oauth => }/github.svg (100%) rename frontend/app/src/static/{images => icons}/home.svg (100%) delete mode 100644 frontend/app/src/static/icons/log.png delete mode 100644 frontend/app/src/static/icons/notice.png create mode 100644 frontend/app/src/static/icons/notice.svg rename frontend/app/src/static/icons/{oauth => }/qq.svg (100%) delete mode 100644 frontend/app/src/static/icons/role.png create mode 100644 frontend/app/src/static/icons/role.svg delete mode 100644 frontend/app/src/static/icons/setting.png create mode 100644 frontend/app/src/static/icons/setting.svg delete mode 100644 frontend/app/src/static/icons/user.png rename frontend/app/src/static/{images => icons}/user.svg (100%) delete mode 100644 frontend/app/src/static/icons/visitor.png rename frontend/app/src/static/icons/{oauth => }/wechat.svg (100%) delete mode 100644 frontend/app/src/static/icons/weixin.png rename frontend/app/src/static/{images => icons}/work.svg (100%) delete mode 100644 frontend/app/src/static/images/banner01.jpg delete mode 100644 frontend/app/src/static/images/banner02.jpg delete mode 100644 frontend/app/src/static/images/default-avatar.png delete mode 100644 frontend/app/src/static/images/login-bg.svg delete mode 100644 frontend/app/src/static/logo.svg delete mode 100644 frontend/app/src/styles/index.scss delete mode 100644 frontend/app/src/styles/themes/fastapp.scss delete mode 100644 frontend/app/src/subPages/dev/gencode/index.vue delete mode 100644 frontend/app/src/subPages/dev/workflow/index.vue delete mode 100644 frontend/app/src/subPages/monitor/cache/index.vue delete mode 100644 frontend/app/src/subPages/monitor/cronjob/index.vue delete mode 100644 frontend/app/src/subPages/monitor/devices/index.vue delete mode 100644 frontend/app/src/subPages/monitor/file_manager/index.vue delete mode 100644 frontend/app/src/subPages/monitor/server/index.vue diff --git a/frontend/app/src/api/mock/mockAdapter.ts b/frontend/app/src/api/mock/mockAdapter.ts index 750f0001..b0466690 100644 --- a/frontend/app/src/api/mock/mockAdapter.ts +++ b/frontend/app/src/api/mock/mockAdapter.ts @@ -16,10 +16,10 @@ import petMocks from './modules/pet' import storeMocks from './modules/store' import userMocks from './modules/user' -const canUseGroupLogger = - typeof console !== 'undefined' - && typeof console.groupCollapsed === 'function' - && typeof console.groupEnd === 'function' +const canUseGroupLogger + = typeof console !== 'undefined' + && typeof console.groupCollapsed === 'function' + && typeof console.groupEnd === 'function' // 合并所有mock定义 const allMocks = [ diff --git a/frontend/app/src/api/module_ai/chat.ts b/frontend/app/src/api/module_ai/chat.ts index ee5005f4..db67a857 100644 --- a/frontend/app/src/api/module_ai/chat.ts +++ b/frontend/app/src/api/module_ai/chat.ts @@ -28,7 +28,8 @@ export const ChatAPI = { }, /** 发送消息 (非流式) */ sendMessage(sessionId: number, content: string): Promise { - return http.Post(`${AI_BASE}/ai-chat`, { session_id: sessionId, content }) + // silent:聊天页将错误内联展示为 AI 消息,避免与全局 toast 重复提示 + return http.Post(`${AI_BASE}/ai-chat`, { session_id: sessionId, content }, { meta: { silent: true } }) }, /** 获取 AI 模型配置列表 */ getModels(): Promise { diff --git a/frontend/app/src/api/module_generator/gencode.ts b/frontend/app/src/api/module_generator/gencode.ts deleted file mode 100644 index b6496f54..00000000 --- a/frontend/app/src/api/module_generator/gencode.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 代码生成 API 模块(对应后端 module_generator 插件) - */ -import { http } from '@/http' - -const GEN_BASE = '/generator/gencode' - -export const GencodeAPI = { - /** 查询业务表列表 */ - getPage(params?: Record): Promise> { - return http.Get(`${GEN_BASE}/list`, params) - }, - /** 查询数据库表列表 */ - getDbTables(params?: Record): Promise> { - return http.Get(`${GEN_BASE}/db/list`, params) - }, - /** 导入表结构 */ - importTable(tableName: string): Promise { - return http.Post(`${GEN_BASE}/import`, { table_name: tableName }) - }, - /** 获取业务表详情 */ - getDetail(id: number): Promise { - return http.Get(`${GEN_BASE}/detail/${id}`) - }, - /** 编辑业务表 */ - update(id: number, data: Partial): Promise { - return http.Put(`${GEN_BASE}/update/${id}`, data) - }, - /** 删除业务表 */ - remove(ids: number[]): Promise { - return http.Delete(`${GEN_BASE}/delete`, { ids: JSON.stringify(ids) }) - }, - /** 批量生成代码 (返回 zip) */ - batchGenerate(ids: number[]): Promise { - return http.Patch(`${GEN_BASE}/batch/output`, { ids }) - }, - /** 预览代码 */ - preview(id: number): Promise> { - return http.Get(`${GEN_BASE}/preview/${id}`) - }, - /** 同步数据库 */ - syncDb(tableName: string): Promise { - return http.Post(`${GEN_BASE}/sync_db/${tableName}`) - }, -} - -/* ==================== 类型定义 ==================== */ - -export interface GenTableItem { - id: number - table_name: string - table_comment?: string - class_name?: string - package_name?: string - module_name?: string - business_name?: string - function_name?: string - sub_table_name?: string - sub_table_fk_name?: string - parent_menu_id?: number - description?: string - created_time?: string - updated_time?: string -} - -export interface DbTableItem { - table_name?: string - name?: string - table_comment?: string - comment?: string -} diff --git a/frontend/app/src/api/module_monitor/cache.ts b/frontend/app/src/api/module_monitor/cache.ts deleted file mode 100644 index 2ec87c8f..00000000 --- a/frontend/app/src/api/module_monitor/cache.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { http } from '@/http' - -const MONITOR_BASE = '/monitor' - -/** - * 缓存监控 API - * 与 web 端 module_monitor/cache.ts 对齐 - */ -export const CacheAPI = { - getInfo(): Promise { - return http.Get(`${MONITOR_BASE}/cache/info`) - }, - getNames(): Promise { - return http.Get(`${MONITOR_BASE}/cache/get/names`) - }, - getKeys(cacheName: string): Promise { - return http.Get(`${MONITOR_BASE}/cache/get/keys/${cacheName}`) - }, - getValue(cacheName: string, cacheKey: string): Promise { - return http.Get(`${MONITOR_BASE}/cache/get/value/${cacheName}/${cacheKey}`) - }, - deleteName(cacheName: string): Promise { - return http.Delete(`${MONITOR_BASE}/cache/delete/name/${cacheName}`) - }, - deleteKey(cacheKey: string): Promise { - return http.Delete(`${MONITOR_BASE}/cache/delete/key/${cacheKey}`) - }, - clear(): Promise { - return http.Delete(`${MONITOR_BASE}/cache/clear`) - }, -} - -export interface CacheInfo { - db_size?: number - command_stats?: Record[] - info?: Record - // computed from info dict - keys_count?: number - hit_rate?: string - used_memory?: string -} - -export interface CommandStats { - name: string - value: string -} - -export interface RedisInfo { - redis_version: string - redis_mode: string - tcp_port: number - connected_clients: number - uptime_in_days: number - used_memory_human: string - maxmemory_human: string - aof_enabled: string - instantaneous_input_kbps: number - instantaneous_output_kbps: number -} diff --git a/frontend/app/src/api/module_monitor/resource.ts b/frontend/app/src/api/module_monitor/resource.ts deleted file mode 100644 index 1f9dfb92..00000000 --- a/frontend/app/src/api/module_monitor/resource.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { http } from '@/http' - -const MONITOR_BASE = '/monitor' - -/** - * 资源管理 API - * 与 web 端 module_monitor/resource.ts 对齐(补全完整字段) - */ -export const ResourceAPI = { - getPage(params?: Record): Promise> { - return http.Get(`${MONITOR_BASE}/resource/list`, params) - }, - getDetail(id: number): Promise { - return http.Get(`${MONITOR_BASE}/resource/detail/${id}`) - }, - remove(ids: number[]): Promise { - return http.Delete(`${MONITOR_BASE}/resource/delete`, { ids: JSON.stringify(ids) }) - }, - upload(path: string, filePath: string, fileName: string): Promise { - return http.Post(`${MONITOR_BASE}/resource/upload`, { path, file_path: filePath, file_name: fileName }) - }, - download(id: number): Promise<{ url: string }> { - return http.Get(`${MONITOR_BASE}/resource/download`, { params: { id } }) - }, - mkdir(path: string, name: string): Promise { - return http.Post(`${MONITOR_BASE}/resource/mkdir`, { path, name }) - }, - rename(id: number, newName: string): Promise { - return http.Post(`${MONITOR_BASE}/resource/rename`, { id, new_name: newName }) - }, - move(id: number, targetPath: string): Promise { - return http.Post(`${MONITOR_BASE}/resource/move`, { id, target_path: targetPath }) - }, - copy(id: number, targetPath: string): Promise { - return http.Post(`${MONITOR_BASE}/resource/copy`, { id, target_path: targetPath }) - }, -} - -export interface ResourceItem { - id: number - name: string - file_url: string - relative_path: string - is_file: boolean - is_dir: boolean - size?: number | null - created_time?: string - modified_time?: string - is_hidden?: boolean -} - -export interface ResourceUploadSchema { - file_path?: string - file_name?: string - origin_name?: string - file_url?: string -} diff --git a/frontend/app/src/api/module_system/auth.ts b/frontend/app/src/api/module_system/auth.ts index 5362fc89..ad05beb6 100644 --- a/frontend/app/src/api/module_system/auth.ts +++ b/frontend/app/src/api/module_system/auth.ts @@ -31,7 +31,8 @@ const AuthAPI = { * @returns 新的访问令牌 */ refreshToken(body: RefreshToekenBody): Promise { - return http.Post(`${AUTH_BASE_URL}/token/refresh`, body, { meta: { ignoreAuth: true } }) + // silent:刷新失败由 onAuthRequired 的刷新处理器统一跳转登录,无需全局 toast + return http.Post(`${AUTH_BASE_URL}/token/refresh`, body, { meta: { ignoreAuth: true, silent: true } }) }, /** diff --git a/frontend/app/src/api/module_task/cronjob/job.ts b/frontend/app/src/api/module_task/cronjob/job.ts deleted file mode 100644 index 0bec6ef0..00000000 --- a/frontend/app/src/api/module_task/cronjob/job.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * 定时任务 API 模块(对应后端 `plugin.module_task.cronjob.job`) - * 包含: 调度器管理 / 任务管理 / 任务执行日志 - */ -import { http } from '@/http' - -const JOB_BASE = '/task/cronjob/job' - -/* ==================== 调度器管理 ==================== */ -export const SchedulerAPI = { - /** 获取调度器状态 */ - getStatus(): Promise { - return http.Get(`${JOB_BASE}/scheduler/status`) - }, - /** 获取调度器任务列表 */ - getJobs(): Promise { - return http.Get(`${JOB_BASE}/scheduler/jobs`) - }, - /** 启动调度器 */ - start(): Promise { - return http.Post(`${JOB_BASE}/scheduler/start`) - }, - /** 暂停调度器 */ - pause(): Promise { - return http.Post(`${JOB_BASE}/scheduler/pause`) - }, - /** 恢复调度器 */ - resume(): Promise { - return http.Post(`${JOB_BASE}/scheduler/resume`) - }, - /** 关闭调度器 */ - shutdown(): Promise { - return http.Post(`${JOB_BASE}/scheduler/shutdown`) - }, - /** 清空所有任务 */ - clear(): Promise { - return http.Delete(`${JOB_BASE}/scheduler/jobs/clear`) - }, - /** 获取调度器控制台信息 */ - getConsole(): Promise { - return http.Get(`${JOB_BASE}/scheduler/console`) - }, -} - -/* ==================== 任务管理 ==================== */ -export const JobAPI = { - /** 暂停任务 */ - pause(jobId: string): Promise { - return http.Post(`${JOB_BASE}/task/pause/${jobId}`) - }, - /** 恢复任务 */ - resume(jobId: string): Promise { - return http.Post(`${JOB_BASE}/task/resume/${jobId}`) - }, - /** 立即执行任务 */ - run(jobId: string): Promise { - return http.Post(`${JOB_BASE}/task/run/${jobId}`) - }, - /** 修改任务 */ - modify(jobId: string, data: Record): Promise { - return http.Put(`${JOB_BASE}/task/modify/${jobId}`, data) - }, - /** 移除任务 */ - remove(jobId: string): Promise { - return http.Delete(`${JOB_BASE}/task/remove/${jobId}`) - }, -} - -/* ==================== 任务执行日志 ==================== */ -export const JobLogAPI = { - /** 查询执行日志列表 */ - getPage(params?: Record): Promise> { - return http.Get(`${JOB_BASE}/log/list`, params) - }, - /** 获取执行日志详情 */ - getDetail(id: number): Promise { - return http.Get(`${JOB_BASE}/log/detail/${id}`) - }, - /** 删除执行日志 */ - remove(ids: number[]): Promise { - return http.Delete(`${JOB_BASE}/log/delete`, { ids: JSON.stringify(ids) }) - }, -} - -/* ==================== 类型定义 ==================== */ - -export interface SchedulerStatus { - status?: string - is_running?: boolean - running: boolean - job_count: number -} - -export interface SchedulerJob { - id: string - name: string - status?: string - next_run_time?: string - trigger?: string - func?: string - args?: any[] -} - -export interface JobLogItem { - id: number - job_name?: string - job_id?: string - status?: string - result?: string - error_msg?: string - start_time?: string - end_time?: string - created_time?: string -} diff --git a/frontend/app/src/api/module_task/cronjob/node.ts b/frontend/app/src/api/module_task/cronjob/node.ts deleted file mode 100644 index f1979674..00000000 --- a/frontend/app/src/api/module_task/cronjob/node.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 任务节点 API 模块(对应后端 `plugin.module_task.cronjob.node`) - */ -import { http } from '@/http' - -const NODE_BASE = '/task/cronjob/node' - -/* ==================== 任务节点 ==================== */ -export const NodeAPI = { - /** 获取节点列表(选项) */ - getOptions(): Promise { - return http.Get(`${NODE_BASE}/options`) - }, - /** 获取节点详情 */ - getDetail(id: number): Promise { - return http.Get(`${NODE_BASE}/detail/${id}`) - }, - /** 节点分页列表 */ - getPage(params?: Record): Promise> { - return http.Get(`${NODE_BASE}/list`, params) - }, - /** 创建节点 */ - create(data: NodeForm): Promise { - return http.Post(`${NODE_BASE}/create`, data) - }, - /** 修改节点 */ - update(id: number, data: NodeForm): Promise { - return http.Put(`${NODE_BASE}/update/${id}`, data) - }, - /** 删除节点 */ - remove(ids: number[]): Promise { - return http.Delete(`${NODE_BASE}/delete`, { ids: JSON.stringify(ids) }) - }, - /** 清空节点 */ - clear(_id?: number): Promise { - return http.Delete(`${NODE_BASE}/clear`) - }, - /** 调试节点 */ - execute(id: number): Promise { - return http.Post(`${NODE_BASE}/execute/${id}`) - }, - /** 批量设置节点状态 */ - batchStatus(data: { ids: number[], status: number }): Promise { - return http.Patch(`${NODE_BASE}/status/batch`, data) - }, -} - -/* ==================== 类型定义 ==================== */ - -export interface NodeOption { - value: number - label: string - path: string -} - -export interface NodeForm { - name: string - host: string - port: number - type: string - description?: string -} - -export interface NodeItem extends NodeForm { - id: number - status?: string - task_count?: number - created_time?: string - updated_time?: string -} diff --git a/frontend/app/src/api/module_task/workflow/flow.ts b/frontend/app/src/api/module_task/workflow/flow.ts deleted file mode 100644 index 5898f000..00000000 --- a/frontend/app/src/api/module_task/workflow/flow.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * 工作流流程 API 模块(对应后端 `plugin.module_task.workflow.flow`) - * 与 web 端 module_task/workflow/flow.ts 对齐(完整字段定义) - */ -import { http } from '@/http' - -const FLOW_BASE = '/task/workflow/flow' - -/* ==================== 流程编排 ==================== */ -export const WorkflowAPI = { - /** 工作流详情 */ - getDetail(id: number): Promise { - return http.Get(`${FLOW_BASE}/detail/${id}`) - }, - /** 工作流列表 */ - getPage(params?: Record): Promise> { - return http.Get(`${FLOW_BASE}/list`, params) - }, - /** 创建工作流 */ - create(data: WorkflowForm): Promise { - return http.Post(`${FLOW_BASE}/create`, data) - }, - /** 更新工作流 */ - update(id: number, data: WorkflowForm): Promise { - return http.Put(`${FLOW_BASE}/update/${id}`, data) - }, - /** 删除工作流 */ - remove(ids: number[]): Promise { - return http.Delete(`${FLOW_BASE}/delete`, { ids: JSON.stringify(ids) }) - }, - /** 发布工作流 */ - publish(id: number): Promise { - return http.Post(`${FLOW_BASE}/publish/${id}`) - }, - /** 执行工作流 */ - execute(data: WorkflowExecuteForm): Promise { - return http.Post(`${FLOW_BASE}/execute`, data) - }, -} - -/* ==================== 类型定义 ==================== */ - -export interface WorkflowPageQuery extends PageQuery { - name?: string - code?: string - status?: number -} - -export interface WorkflowForm { - name: string - description?: string - nodes?: WorkflowNode[] - edges?: WorkflowEdge[] -} - -export interface WorkflowItem extends WorkflowForm { - id: number - status?: string - version?: number - created_time?: string - updated_time?: string -} - -export interface WorkflowPublishForm { - remark?: string -} - -export interface WorkflowExecuteForm { - workflow_id: number - variables?: Record - business_key?: string - job_id?: number -} - -export interface WorkflowExecuteResult { - workflow_id: number - workflow_name: string - status: number - start_time?: string - end_time?: string - variables?: Record - node_results?: Record - error?: string -} - -export interface WorkflowNode { - id?: string - type: string - label?: string - position?: { x: number, y: number } - data?: Record -} - -export interface WorkflowEdge { - id?: string - source: string - target: string - label?: string - condition?: string -} diff --git a/frontend/app/src/api/module_task/workflow/nodes.ts b/frontend/app/src/api/module_task/workflow/nodes.ts deleted file mode 100644 index b45bbc90..00000000 --- a/frontend/app/src/api/module_task/workflow/nodes.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * 工作流节点类型 API 模块(对应后端 `plugin.module_task.workflow.nodes`) - */ -import { http } from '@/http' - -const NODES_BASE = '/task/workflow/nodes' - -/* ==================== 工作流节点类型 ==================== */ -export const WorkflowNodeTypeAPI = { - /** 节点选项 */ - getOptions(): Promise { - return http.Get(`${NODES_BASE}/options`) - }, - /** 节点详情 */ - getDetail(id: number): Promise { - return http.Get(`${NODES_BASE}/detail/${id}`) - }, - /** 节点列表 */ - getPage(params?: Record): Promise> { - return http.Get(`${NODES_BASE}/list`, params) - }, - /** 创建节点 */ - create(data: WorkflowNodeTypeForm): Promise { - return http.Post(`${NODES_BASE}/create`, data) - }, - /** 更新节点 */ - update(id: number, data: WorkflowNodeTypeForm): Promise { - return http.Put(`${NODES_BASE}/update/${id}`, data) - }, - /** 删除节点 */ - remove(ids: number[]): Promise { - return http.Delete(`${NODES_BASE}/delete`, { ids: JSON.stringify(ids) }) - }, - /** 节点选择列表 */ - getSelect(): Promise { - return http.Get(`${NODES_BASE}/select`) - }, -} - -/* ==================== 类型定义 ==================== */ - -export interface WorkflowNodeTypeOption { - value: number - label: string - type: string -} - -export interface WorkflowNodeTypeForm { - name: string - type: string - handler_path?: string - params_schema?: Record - description?: string -} - -export interface WorkflowNodeTypeItem extends WorkflowNodeTypeForm { - id: number - created_time?: string - updated_time?: string -} diff --git a/frontend/app/src/auto-imports.d.ts b/frontend/app/src/auto-imports.d.ts index 79f592b2..c9cbf5e2 100644 --- a/frontend/app/src/auto-imports.d.ts +++ b/frontend/app/src/auto-imports.d.ts @@ -227,6 +227,7 @@ declare global { const useGeolocation: typeof import('@vueuse/core')['useGeolocation'] const useGlobalDialog: typeof import('./composables/useGlobalDialog')['useGlobalDialog'] const useGlobalLoading: typeof import('./composables/useGlobalLoading')['useGlobalLoading'] + const useGlobalMessage: typeof import('./composables/useGlobalMessage')['useGlobalMessage'] const useGlobalToast: typeof import('./composables/useGlobalToast')['useGlobalToast'] const useIdle: typeof import('@vueuse/core')['useIdle'] const useImage: typeof import('@vueuse/core')['useImage'] @@ -236,6 +237,7 @@ declare global { const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn'] const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier'] const useLastChanged: typeof import('@vueuse/core')['useLastChanged'] + const useListPage: typeof import('./composables/useListPage')['useListPage'] const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage'] const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys'] const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory'] @@ -584,6 +586,7 @@ declare module 'vue' { readonly useGeolocation: UnwrapRef readonly useGlobalDialog: UnwrapRef readonly useGlobalLoading: UnwrapRef + readonly useGlobalMessage: UnwrapRef readonly useGlobalToast: UnwrapRef readonly useIdle: UnwrapRef readonly useImage: UnwrapRef @@ -593,6 +596,7 @@ declare module 'vue' { readonly useIntervalFn: UnwrapRef readonly useKeyModifier: UnwrapRef readonly useLastChanged: UnwrapRef + readonly useListPage: UnwrapRef readonly useLocalStorage: UnwrapRef readonly useMagicKeys: UnwrapRef readonly useManualRefHistory: UnwrapRef diff --git a/frontend/app/src/components.d.ts b/frontend/app/src/components.d.ts index aa2e23ca..aff9dc8c 100644 --- a/frontend/app/src/components.d.ts +++ b/frontend/app/src/components.d.ts @@ -20,22 +20,35 @@ declare module 'vue' { PrivacyPopup: typeof import('./components/PrivacyPopup.vue')['default'] 'PrivacyPopup copy': typeof import('./components/PrivacyPopup copy.vue')['default'] SkeletonPage: typeof import('./components/SkeletonPage.vue')['default'] - SliderCaptcha: typeof import('./components/SliderCaptcha.vue')['default'] StatusBadge: typeof import('./components/StatusBadge.vue')['default'] UniEcharts: typeof import('uni-echarts')['default'] WdActionSheet: typeof import('@wot-ui/ui/components/wd-action-sheet/wd-action-sheet.vue')['default'] + WdAvatar: typeof import('@wot-ui/ui/components/wd-avatar/wd-avatar.vue')['default'] WdButton: typeof import('@wot-ui/ui/components/wd-button/wd-button.vue')['default'] WdCell: typeof import('@wot-ui/ui/components/wd-cell/wd-cell.vue')['default'] WdCellGroup: typeof import('@wot-ui/ui/components/wd-cell-group/wd-cell-group.vue')['default'] WdConfigProvider: typeof import('@wot-ui/ui/components/wd-config-provider/wd-config-provider.vue')['default'] WdDialog: typeof import('@wot-ui/ui/components/wd-dialog/wd-dialog.vue')['default'] + WdForm: typeof import('@wot-ui/ui/components/wd-form/wd-form.vue')['default'] + WdFormItem: typeof import('@wot-ui/ui/components/wd-form-item/wd-form-item.vue')['default'] WdGap: typeof import('@wot-ui/ui/components/wd-gap/wd-gap.vue')['default'] + WdGrid: typeof import('@wot-ui/ui/components/wd-grid/wd-grid.vue')['default'] + WdGridItem: typeof import('@wot-ui/ui/components/wd-grid-item/wd-grid-item.vue')['default'] WdIcon: typeof import('@wot-ui/ui/components/wd-icon/wd-icon.vue')['default'] + WdInput: typeof import('@wot-ui/ui/components/wd-input/wd-input.vue')['default'] + WdLoading: typeof import('@wot-ui/ui/components/wd-loading/wd-loading.vue')['default'] + WdNavbar: typeof import('@wot-ui/ui/components/wd-navbar/wd-navbar.vue')['default'] WdNotify: typeof import('@wot-ui/ui/components/wd-notify/wd-notify.vue')['default'] + WdPicker: typeof import('@wot-ui/ui/components/wd-picker/wd-picker.vue')['default'] WdPopup: typeof import('@wot-ui/ui/components/wd-popup/wd-popup.vue')['default'] + WdRadio: typeof import('@wot-ui/ui/components/wd-radio/wd-radio.vue')['default'] + WdRadioGroup: typeof import('@wot-ui/ui/components/wd-radio-group/wd-radio-group.vue')['default'] + WdSlideVerify: typeof import('@wot-ui/ui/components/wd-slide-verify/wd-slide-verify.vue')['default'] + WdSwiper: typeof import('@wot-ui/ui/components/wd-swiper/wd-swiper.vue')['default'] WdSwitch: typeof import('@wot-ui/ui/components/wd-switch/wd-switch.vue')['default'] WdTabbar: typeof import('@wot-ui/ui/components/wd-tabbar/wd-tabbar.vue')['default'] WdTabbarItem: typeof import('@wot-ui/ui/components/wd-tabbar-item/wd-tabbar-item.vue')['default'] + WdTextarea: typeof import('@wot-ui/ui/components/wd-textarea/wd-textarea.vue')['default'] WdToast: typeof import('@wot-ui/ui/components/wd-toast/wd-toast.vue')['default'] } } diff --git a/frontend/app/src/components/GlobalMessage.vue b/frontend/app/src/components/GlobalMessage.vue index 39b2a7d9..9f1a8feb 100644 --- a/frontend/app/src/components/GlobalMessage.vue +++ b/frontend/app/src/components/GlobalMessage.vue @@ -1,5 +1,6 @@