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 @@ + + + + +