From 9fb25a2d3318d1d113f8d5f5925f67674a084bee Mon Sep 17 00:00:00 2001 From: AoXuan Date: Tue, 12 Aug 2025 22:26:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(queue):=20=E5=AE=8C=E6=88=90=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E9=98=9F=E5=88=97=E9=A1=B5=E9=9D=A2=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=84=9A=E6=9C=AC=E4=B8=8B=E6=8B=89=E6=A1=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重新设计了队列页面布局,使用表格代替原来的卡片布局 - 添加了脚本下拉框功能,支持选择已有的脚本 - 简化了队列项的展示内容,只显示脚本名称 - 优化了队列项的编辑和删除操作 - 新增了获取脚本下拉框信息的 API 接口 --- frontend/src/api/index.ts | 9 + frontend/src/api/models/ComboBoxItem.ts | 15 + frontend/src/api/models/ComboBoxOut.ts | 24 ++ frontend/src/api/models/GlobalConfig.ts | 37 ++ .../src/api/models/GlobalConfig_Function.ts | 31 ++ .../src/api/models/GlobalConfig_Notify.ts | 59 +++ frontend/src/api/models/GlobalConfig_Start.ts | 15 + frontend/src/api/models/GlobalConfig_UI.ts | 15 + .../src/api/models/GlobalConfig_Update.ts | 27 ++ frontend/src/api/models/GlobalConfig_Voice.ts | 15 + frontend/src/api/models/ScriptCreateIn.ts | 6 + frontend/src/api/models/SettingGetOut.ts | 3 +- frontend/src/api/models/SettingUpdateIn.ts | 5 +- frontend/src/api/models/TaskCreateIn.ts | 6 +- frontend/src/api/services/Service.ts | 12 + .../src/components/queue/QueueItemManager.vue | 362 ++++++------------ .../src/components/queue/TimeSetManager.vue | 8 +- frontend/src/views/Queue.vue | 28 +- 18 files changed, 412 insertions(+), 265 deletions(-) create mode 100644 frontend/src/api/models/ComboBoxItem.ts create mode 100644 frontend/src/api/models/ComboBoxOut.ts create mode 100644 frontend/src/api/models/GlobalConfig.ts create mode 100644 frontend/src/api/models/GlobalConfig_Function.ts create mode 100644 frontend/src/api/models/GlobalConfig_Notify.ts create mode 100644 frontend/src/api/models/GlobalConfig_Start.ts create mode 100644 frontend/src/api/models/GlobalConfig_UI.ts create mode 100644 frontend/src/api/models/GlobalConfig_Update.ts create mode 100644 frontend/src/api/models/GlobalConfig_Voice.ts diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 1deabeb..efb7a39 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -7,7 +7,16 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise'; export { OpenAPI } from './core/OpenAPI'; export type { OpenAPIConfig } from './core/OpenAPI'; +export type { ComboBoxItem } from './models/ComboBoxItem'; +export type { ComboBoxOut } from './models/ComboBoxOut'; export type { DispatchIn } from './models/DispatchIn'; +export type { GlobalConfig } from './models/GlobalConfig'; +export type { GlobalConfig_Function } from './models/GlobalConfig_Function'; +export type { GlobalConfig_Notify } from './models/GlobalConfig_Notify'; +export type { GlobalConfig_Start } from './models/GlobalConfig_Start'; +export type { GlobalConfig_UI } from './models/GlobalConfig_UI'; +export type { GlobalConfig_Update } from './models/GlobalConfig_Update'; +export type { GlobalConfig_Voice } from './models/GlobalConfig_Voice'; export type { HTTPValidationError } from './models/HTTPValidationError'; export type { InfoOut } from './models/InfoOut'; export type { OutBase } from './models/OutBase'; diff --git a/frontend/src/api/models/ComboBoxItem.ts b/frontend/src/api/models/ComboBoxItem.ts new file mode 100644 index 0000000..c3cdaed --- /dev/null +++ b/frontend/src/api/models/ComboBoxItem.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ComboBoxItem = { + /** + * 展示值 + */ + label: string; + /** + * 实际值 + */ + value: string; +}; + diff --git a/frontend/src/api/models/ComboBoxOut.ts b/frontend/src/api/models/ComboBoxOut.ts new file mode 100644 index 0000000..753e716 --- /dev/null +++ b/frontend/src/api/models/ComboBoxOut.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ComboBoxItem } from './ComboBoxItem'; +export type ComboBoxOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 下拉框选项 + */ + data: Array; +}; + diff --git a/frontend/src/api/models/GlobalConfig.ts b/frontend/src/api/models/GlobalConfig.ts new file mode 100644 index 0000000..548f600 --- /dev/null +++ b/frontend/src/api/models/GlobalConfig.ts @@ -0,0 +1,37 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { GlobalConfig_Function } from './GlobalConfig_Function'; +import type { GlobalConfig_Notify } from './GlobalConfig_Notify'; +import type { GlobalConfig_Start } from './GlobalConfig_Start'; +import type { GlobalConfig_UI } from './GlobalConfig_UI'; +import type { GlobalConfig_Update } from './GlobalConfig_Update'; +import type { GlobalConfig_Voice } from './GlobalConfig_Voice'; +export type GlobalConfig = { + /** + * 功能相关配置 + */ + Function?: (GlobalConfig_Function | null); + /** + * 语音相关配置 + */ + Voice?: (GlobalConfig_Voice | null); + /** + * 启动相关配置 + */ + Start?: (GlobalConfig_Start | null); + /** + * 界面相关配置 + */ + UI?: (GlobalConfig_UI | null); + /** + * 通知相关配置 + */ + Notify?: (GlobalConfig_Notify | null); + /** + * 更新相关配置 + */ + Update?: (GlobalConfig_Update | null); +}; + diff --git a/frontend/src/api/models/GlobalConfig_Function.ts b/frontend/src/api/models/GlobalConfig_Function.ts new file mode 100644 index 0000000..7416e1c --- /dev/null +++ b/frontend/src/api/models/GlobalConfig_Function.ts @@ -0,0 +1,31 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GlobalConfig_Function = { + /** + * 历史记录保留时间, 0表示永久保存 + */ + HistoryRetentionTime?: (7 | 15 | 30 | 60 | 90 | 180 | 365 | 0 | null); + /** + * 允许休眠 + */ + IfAllowSleep?: (boolean | null); + /** + * 静默模式 + */ + IfSilence?: (boolean | null); + /** + * 模拟器老板键 + */ + BossKey?: (string | null); + /** + * 同意哔哩哔哩用户协议 + */ + IfAgreeBilibili?: (boolean | null); + /** + * 跳过Mumu模拟器启动广告 + */ + IfSkipMumuSplashAds?: (boolean | null); +}; + diff --git a/frontend/src/api/models/GlobalConfig_Notify.ts b/frontend/src/api/models/GlobalConfig_Notify.ts new file mode 100644 index 0000000..cc2b68b --- /dev/null +++ b/frontend/src/api/models/GlobalConfig_Notify.ts @@ -0,0 +1,59 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GlobalConfig_Notify = { + /** + * 任务结果推送时机 + */ + SendTaskResultTime?: ('不推送' | '任何时刻' | '仅失败时' | null); + /** + * 是否发送统计信息 + */ + IfSendStatistic?: (boolean | null); + /** + * 是否发送公招六星通知 + */ + IfSendSixStar?: (boolean | null); + /** + * 是否推送系统通知 + */ + IfPushPlyer?: (boolean | null); + /** + * 是否发送邮件通知 + */ + IfSendMail?: (boolean | null); + /** + * SMTP服务器地址 + */ + SMTPServerAddress?: (string | null); + /** + * SMTP授权码 + */ + AuthorizationCode?: (string | null); + /** + * 邮件发送地址 + */ + FromAddress?: (string | null); + /** + * 邮件接收地址 + */ + ToAddress?: (string | null); + /** + * 是否使用ServerChan推送 + */ + IfServerChan?: (boolean | null); + /** + * ServerChan推送密钥 + */ + ServerChanKey?: (string | null); + /** + * 是否使用企微Webhook推送 + */ + IfCompanyWebHookBot?: (boolean | null); + /** + * 企微Webhook Bot URL + */ + CompanyWebHookBotUrl?: (string | null); +}; + diff --git a/frontend/src/api/models/GlobalConfig_Start.ts b/frontend/src/api/models/GlobalConfig_Start.ts new file mode 100644 index 0000000..8c0a0ef --- /dev/null +++ b/frontend/src/api/models/GlobalConfig_Start.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GlobalConfig_Start = { + /** + * 是否在系统启动时自动运行 + */ + IfSelfStart?: (boolean | null); + /** + * 启动时是否直接最小化到托盘而不显示主窗口 + */ + IfMinimizeDirectly?: (boolean | null); +}; + diff --git a/frontend/src/api/models/GlobalConfig_UI.ts b/frontend/src/api/models/GlobalConfig_UI.ts new file mode 100644 index 0000000..05b32c4 --- /dev/null +++ b/frontend/src/api/models/GlobalConfig_UI.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GlobalConfig_UI = { + /** + * 是否常态显示托盘图标 + */ + IfShowTray?: (boolean | null); + /** + * 是否最小化到托盘 + */ + IfToTray?: (boolean | null); +}; + diff --git a/frontend/src/api/models/GlobalConfig_Update.ts b/frontend/src/api/models/GlobalConfig_Update.ts new file mode 100644 index 0000000..35f7148 --- /dev/null +++ b/frontend/src/api/models/GlobalConfig_Update.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GlobalConfig_Update = { + /** + * 是否自动更新 + */ + IfAutoUpdate?: (boolean | null); + /** + * 更新类型, stable为稳定版, beta为测试版 + */ + UpdateType?: ('stable' | 'beta' | null); + /** + * 更新源: GitHub源, Mirror酱源, 自建源 + */ + Source?: ('GitHub' | 'MirrorChyan' | 'AutoSite' | null); + /** + * 网络代理地址 + */ + ProxyAddress?: (string | null); + /** + * Mirror酱CDK + */ + MirrorChyanCDK?: (string | null); +}; + diff --git a/frontend/src/api/models/GlobalConfig_Voice.ts b/frontend/src/api/models/GlobalConfig_Voice.ts new file mode 100644 index 0000000..10bf3e3 --- /dev/null +++ b/frontend/src/api/models/GlobalConfig_Voice.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GlobalConfig_Voice = { + /** + * 语音功能是否启用 + */ + Enabled?: (boolean | null); + /** + * 语音类型, simple为简洁, noisy为聒噪 + */ + Type?: ('simple' | 'noisy' | null); +}; + diff --git a/frontend/src/api/models/ScriptCreateIn.ts b/frontend/src/api/models/ScriptCreateIn.ts index 1d0d824..8600110 100644 --- a/frontend/src/api/models/ScriptCreateIn.ts +++ b/frontend/src/api/models/ScriptCreateIn.ts @@ -3,9 +3,15 @@ /* tslint:disable */ /* eslint-disable */ export type ScriptCreateIn = { + /** + * 脚本类型: MAA脚本, 通用脚本 + */ type: ScriptCreateIn.type; }; export namespace ScriptCreateIn { + /** + * 脚本类型: MAA脚本, 通用脚本 + */ export enum type { MAA = 'MAA', GENERAL = 'General', diff --git a/frontend/src/api/models/SettingGetOut.ts b/frontend/src/api/models/SettingGetOut.ts index d478626..e909ef6 100644 --- a/frontend/src/api/models/SettingGetOut.ts +++ b/frontend/src/api/models/SettingGetOut.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { GlobalConfig } from './GlobalConfig'; export type SettingGetOut = { /** * 状态码 @@ -18,6 +19,6 @@ export type SettingGetOut = { /** * 全局设置数据 */ - data: Record>; + data: GlobalConfig; }; diff --git a/frontend/src/api/models/SettingUpdateIn.ts b/frontend/src/api/models/SettingUpdateIn.ts index 791a6e9..51e8991 100644 --- a/frontend/src/api/models/SettingUpdateIn.ts +++ b/frontend/src/api/models/SettingUpdateIn.ts @@ -2,10 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { GlobalConfig } from './GlobalConfig'; export type SettingUpdateIn = { /** - * 全局设置更新数据 + * 全局设置需要更新的数据 */ - data: Record>; + data: GlobalConfig; }; diff --git a/frontend/src/api/models/TaskCreateIn.ts b/frontend/src/api/models/TaskCreateIn.ts index d519f9b..d3cb3eb 100644 --- a/frontend/src/api/models/TaskCreateIn.ts +++ b/frontend/src/api/models/TaskCreateIn.ts @@ -17,9 +17,9 @@ export namespace TaskCreateIn { * 任务模式 */ export enum mode { - AutoMode = '自动代理', - ManualMode = '人工排查', - SettingScriptMode = '设置脚本', + AutoMode = '自动代理', + ManualMode = '人工排查', + SettingScriptMode = '设置脚本', } } diff --git a/frontend/src/api/services/Service.ts b/frontend/src/api/services/Service.ts index b04c4c8..f5899e1 100644 --- a/frontend/src/api/services/Service.ts +++ b/frontend/src/api/services/Service.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ComboBoxOut } from '../models/ComboBoxOut'; import type { DispatchIn } from '../models/DispatchIn'; import type { InfoOut } from '../models/InfoOut'; import type { OutBase } from '../models/OutBase'; @@ -58,6 +59,17 @@ export class Service { url: '/api/info/stage', }); } + /** + * 获取脚本下拉框信息 + * @returns ComboBoxOut Successful Response + * @throws ApiError + */ + public static getScriptComboxApiInfoComboxScriptPost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/info/combox/script', + }); + } /** * 获取通知信息 * @returns InfoOut Successful Response diff --git a/frontend/src/components/queue/QueueItemManager.vue b/frontend/src/components/queue/QueueItemManager.vue index c8bce32..9c1dc4a 100644 --- a/frontend/src/components/queue/QueueItemManager.vue +++ b/frontend/src/components/queue/QueueItemManager.vue @@ -8,120 +8,50 @@ 添加队列项 - - - 刷新 - -
-
-
-
{{ item.name || `项目 ${item.id}` }}
- - - + + +
- - - - - + + - - - - - - - - 激活 - 未激活 - 等待中 - 运行中 - 已完成 - 失败 - - - - + @@ -129,7 +59,7 @@