From 920c89998a9c52a638e3ffefb1a26d991ea0762a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E7=94=B0=E7=94=B0?= <10422644+guo-tiantian99@user.noreply.gitee.com> Date: Fri, 5 Sep 2025 12:27:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=94=E7=94=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AE=8C=E6=95=B4=E5=AE=9E=E7=8E=B0=E4=B8=8E?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=A0=87=E7=AD=BE=E9=A1=B5=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/application/myapp.ts | 138 ++++- frontend/src/router/index.ts | 7 + frontend/src/types/auto-imports.d.ts | 1 + frontend/src/types/components.d.ts | 3 + .../myapp/components/InternalApp.vue | 143 +++++ .../src/views/application/myapp/indev.vue | 13 - .../src/views/application/myapp/index.vue | 574 ++++++++++++++++++ 7 files changed, 865 insertions(+), 14 deletions(-) create mode 100644 frontend/src/views/application/myapp/components/InternalApp.vue delete mode 100644 frontend/src/views/application/myapp/indev.vue create mode 100644 frontend/src/views/application/myapp/index.vue diff --git a/frontend/src/api/application/myapp.ts b/frontend/src/api/application/myapp.ts index 9baee9cc..c191a44e 100644 --- a/frontend/src/api/application/myapp.ts +++ b/frontend/src/api/application/myapp.ts @@ -1 +1,137 @@ -// 待开发 +import request from "@/utils/request"; + +export const ApplicationAPI = { + /** + * 获取应用详情 + * @param id 应用ID + */ + getApplicationDetail(id: number) { + return request>({ + url: `/application/application/detail/${id}`, + method: "get", + }); + }, + + /** + * 查询应用列表 + * @param query 查询参数 + */ + getApplicationList(query: ApplicationPageQuery) { + return request>>({ + url: `/application/application/list`, + method: "get", + params: query, + }); + }, + + /** + * 创建应用 + * @param body 应用信息 + */ + createApplication(body: ApplicationForm) { + return request({ + url: `/application/application/create`, + method: "post", + data: body, + }); + }, + + /** + * 修改应用 + * @param id 应用ID + * @param body 应用信息 + */ + updateApplication(id: number, body: ApplicationForm) { + return request({ + url: `/application/application/update/${id}`, + method: "put", + data: body, + }); + }, + + /** + * 删除应用 + * @param body 应用ID数组 + */ + deleteApplication(body: number[]) { + return request({ + url: `/application/application/delete`, + method: "delete", + data: body, + }); + }, + + /** + * 批量修改应用状态 + * @param body 批量操作参数 + */ + batchAvailableApplication(body: BatchType) { + return request({ + url: `/application/application/available/setting`, + method: "patch", + data: body, + }); + }, +}; + +export default ApplicationAPI; + +/** + * 应用分页查询参数 + */ +export interface ApplicationPageQuery extends PageQuery { + /** 应用名称 */ + name?: string; + /** 是否启用 */ + status?: boolean; + /** 创建人 */ + creator?: number; + /** 开始时间 */ + start_time?: string; + /** 结束时间 */ + end_time?: string; + /** 排序字段,格式:[{'field':'asc/desc'}] */ + order_by?: string; +} + +/** + * 应用信息 + */ +export interface ApplicationInfo { + /** 应用ID */ + id?: number; + /** 应用名称 */ + name?: string; + /** 访问地址 */ + access_url?: string; + /** 图标地址 */ + icon_url?: string; + /** 是否启用 */ + status?: boolean; + /** 应用描述 */ + description?: string; + /** 创建时间 */ + created_at?: string; + /** 更新时间 */ + updated_at?: string; + /** 创建人 */ + creator?: creatorType; +} + +/** + * 应用表单 + */ +export interface ApplicationForm { + /** 应用ID */ + id?: number; + /** 应用名称 */ + name: string; + /** 访问地址 */ + access_url: string; + /** 图标地址 */ + icon_url: string; + /** 是否启用 */ + status: boolean; + /** 应用描述 */ + description?: string; +} diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index d350b2c9..063467ac 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -58,6 +58,13 @@ export const constantRoutes: RouteRecordRaw[] = [ meta: { title: "个人中心", icon: "user", hidden: true }, component: () => import("@/views/current/profile.vue"), }, + // 应用内部打开页面 + { + path: "internal-app/:appId", + name: "InternalApp", + meta: { title: "内部应用", icon: "Monitor", hidden: true, keepAlive: false }, + component: () => import("@/views/application/myapp/components/InternalApp.vue"), + }, // // 临时构建后面要删除掉 // { // path: "form-builder", diff --git a/frontend/src/types/auto-imports.d.ts b/frontend/src/types/auto-imports.d.ts index 96afad15..d800967e 100644 --- a/frontend/src/types/auto-imports.d.ts +++ b/frontend/src/types/auto-imports.d.ts @@ -587,6 +587,7 @@ declare module 'vue' { readonly useThrottleFn: UnwrapRef readonly useThrottledRefHistory: UnwrapRef readonly useTimeAgo: UnwrapRef + readonly useTimeAgoIntl: UnwrapRef readonly useTimeout: UnwrapRef readonly useTimeoutFn: UnwrapRef readonly useTimeoutPoll: UnwrapRef diff --git a/frontend/src/types/components.d.ts b/frontend/src/types/components.d.ts index 9acd4246..e639ef47 100644 --- a/frontend/src/types/components.d.ts +++ b/frontend/src/types/components.d.ts @@ -29,6 +29,7 @@ declare module 'vue' { ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElCard: typeof import('element-plus/es')['ElCard'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCol: typeof import('element-plus/es')['ElCol'] @@ -53,6 +54,7 @@ declare module 'vue' { ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElLink: typeof import('element-plus/es')['ElLink'] + ElLoadingSpinner: typeof import('element-plus/es')['ElLoadingSpinner'] ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] @@ -97,6 +99,7 @@ declare module 'vue' { IconSelect: typeof import('./../components/IconSelect/index.vue')['default'] ImportModal: typeof import('./../components/Upload/ImportModal.vue')['default'] InputTag: typeof import('./../components/InputTag/index.vue')['default'] + InternalApp: typeof import('./../views/application/myapp/components/InternalApp.vue')['default'] IntervalTab: typeof import('./../components/IntervalTab/index.vue')['default'] JobLogDrawer: typeof import('./../views/monitor/job/components/JobLogDrawer.vue')['default'] LangSelect: typeof import('./../components/LangSelect/index.vue')['default'] diff --git a/frontend/src/views/application/myapp/components/InternalApp.vue b/frontend/src/views/application/myapp/components/InternalApp.vue new file mode 100644 index 00000000..a079be30 --- /dev/null +++ b/frontend/src/views/application/myapp/components/InternalApp.vue @@ -0,0 +1,143 @@ + + + + + + diff --git a/frontend/src/views/application/myapp/indev.vue b/frontend/src/views/application/myapp/indev.vue deleted file mode 100644 index cf623ec9..00000000 --- a/frontend/src/views/application/myapp/indev.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/frontend/src/views/application/myapp/index.vue b/frontend/src/views/application/myapp/index.vue new file mode 100644 index 00000000..fdefbc82 --- /dev/null +++ b/frontend/src/views/application/myapp/index.vue @@ -0,0 +1,574 @@ + + + + + +