From f4aeaf94c4d2557f8b3dacf7d826d42ddd73c324 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Thu, 13 Aug 2026 04:06:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E5=BA=94=E7=94=A8=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=A1=B5=EF=BC=88=E5=BA=94=E7=94=A8=E5=B8=82=E5=9C=BA?= =?UTF-8?q?/=E6=88=91=E7=9A=84=E5=BA=94=E7=94=A8/=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=EF=BC=89+=20=E8=B7=AF=E7=94=B1=E4=B8=8E?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/app.ts | 61 ++++++ src/router/index.ts | 6 + src/views/app/AppCenter.vue | 394 ++++++++++++++++++++++++++++++++++++ 3 files changed, 461 insertions(+) create mode 100644 src/api/app.ts create mode 100644 src/views/app/AppCenter.vue diff --git a/src/api/app.ts b/src/api/app.ts new file mode 100644 index 0000000..7441ec9 --- /dev/null +++ b/src/api/app.ts @@ -0,0 +1,61 @@ +import { get, post } from './request' + +/** 应用/功能市场项 */ +export interface AppItem { + AppUUID: string + AppCode: string + AppName: string + AppIcon: string + AppDesc: string + AppType: string + AuthRequired: number + MenuRootUUID?: string + AppSort?: number + /** 市场页附加状态 */ + TenantInstalled?: number + TenantAuth?: number + UserEnabled?: number + ApplyStatus?: number +} + +/** 个人授权申请项(租户管理员审批台) */ +export interface PendingItem { + UserAppUUID: string + UserUUID: string + AppUUID: string + AppName: string + AppCode: string + AppIcon: string + ApplyTime: string | null +} + +/** 应用/功能 API 客户端 */ +export const appApi = { + /** 应用市场列表(附租户安装/个人启用/申请状态) */ + market: (): Promise<{ list: AppItem[]; total: number }> => get<{ list: AppItem[]; total: number }>('/API/App/Market'), + + /** 我的应用(当前用户可用) */ + myApps: (): Promise<{ list: AppItem[]; total: number }> => get<{ list: AppItem[]; total: number }>('/API/App/MyApps'), + + /** 租户管理员:安装企业功能 */ + install: (AppUUID: string): Promise => post('/API/App/Install', { AppUUID }), + + /** 租户管理员:停用企业功能 */ + uninstall: (AppUUID: string): Promise => post('/API/App/Uninstall', { AppUUID }), + + /** 个人:启用应用 */ + enable: (AppUUID: string): Promise => post('/API/App/Enable', { AppUUID }), + + /** 个人:停用应用 */ + disable: (AppUUID: string): Promise => post('/API/App/Disable', { AppUUID }), + + /** 个人:申请企业授权 */ + apply: (AppUUID: string): Promise => post('/API/App/Apply', { AppUUID }), + + /** 租户管理员:审批个人授权申请 */ + approve: (UserAppUUID: string, Approved: boolean): Promise => + post('/API/App/Approve', { UserAppUUID, Approved }), + + /** 租户管理员:待审批申请列表 */ + pending: (): Promise<{ list: PendingItem[]; total: number }> => get<{ list: PendingItem[]; total: number }>('/API/App/Pending'), +} diff --git a/src/router/index.ts b/src/router/index.ts index 9ee8527..717619d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -229,6 +229,12 @@ export const staticRoutes: RouteRecordRaw[] = [ component: () => import('@/views/company/EpCreate.vue'), meta: { title: '企业创建向导(调试)', requiresAuth: true }, }, + { + path: 'app/center', + name: 'AppCenter', + component: () => import('@/views/app/AppCenter.vue'), + meta: { title: '应用中心', icon: 'Grid', requiresAuth: true, menuGuarded: true }, + }, // === 阶段 6:独立工具 === { path: 'doc/editor', diff --git a/src/views/app/AppCenter.vue b/src/views/app/AppCenter.vue new file mode 100644 index 0000000..2f5edaa --- /dev/null +++ b/src/views/app/AppCenter.vue @@ -0,0 +1,394 @@ + + + + +