diff --git a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json index cf0bec37c..53b32889a 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/en-US/abp.json @@ -98,7 +98,8 @@ "email": "Email Messages", "sms": "Sms Messages" }, - "dataDictionaries": "Data Dictionaries" + "dataDictionaries": "Data Dictionaries", + "layouts": "Layouts" }, "saas": { "title": "Saas", diff --git a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json index d5334ae22..1d0b58882 100644 --- a/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/vben5/apps/app-antd/src/locales/langs/zh-CN/abp.json @@ -98,7 +98,8 @@ "email": "邮件消息", "sms": "短信消息" }, - "dataDictionaries": "数据字典" + "dataDictionaries": "数据字典", + "layouts": "布局管理" }, "saas": { "title": "Saas", diff --git a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts index 020a35e98..afaf79836 100644 --- a/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts +++ b/apps/vben5/apps/app-antd/src/router/routes/modules/abp.ts @@ -409,6 +409,15 @@ const routes: RouteRecordRaw[] = [ component: () => import('#/views/platform/data-dictionaries/index.vue'), }, + { + meta: { + title: $t('abp.platform.layouts'), + icon: 'material-symbols-light:responsive-layout', + }, + name: 'PlatformLayouts', + path: '/platform/layouts', + component: () => import('#/views/platform/layouts/index.vue'), + }, { meta: { title: $t('abp.platform.messages.title'), diff --git a/apps/vben5/apps/app-antd/src/views/platform/layouts/index.vue b/apps/vben5/apps/app-antd/src/views/platform/layouts/index.vue new file mode 100644 index 000000000..65c86e092 --- /dev/null +++ b/apps/vben5/apps/app-antd/src/views/platform/layouts/index.vue @@ -0,0 +1,15 @@ + + + diff --git a/apps/vben5/packages/@abp/platform/src/api/index.ts b/apps/vben5/packages/@abp/platform/src/api/index.ts index 481660d28..68f19461a 100644 --- a/apps/vben5/packages/@abp/platform/src/api/index.ts +++ b/apps/vben5/packages/@abp/platform/src/api/index.ts @@ -1,3 +1,4 @@ export { useDataDictionariesApi } from './useDataDictionariesApi'; export { useEmailMessagesApi } from './useEmailMessagesApi'; +export { useLayoutsApi } from './useLayoutsApi'; export { useSmsMessagesApi } from './useSmsMessagesApi'; diff --git a/apps/vben5/packages/@abp/platform/src/api/useLayoutsApi.ts b/apps/vben5/packages/@abp/platform/src/api/useLayoutsApi.ts new file mode 100644 index 000000000..fa61697e7 --- /dev/null +++ b/apps/vben5/packages/@abp/platform/src/api/useLayoutsApi.ts @@ -0,0 +1,58 @@ +import type { PagedResultDto } from '@abp/core'; + +import type { + LayoutCreateDto, + LayoutDto, + LayoutGetPagedListInput, + LayoutUpdateDto, +} from '../types/layouts'; + +import { useRequest } from '@abp/request'; + +export function useLayoutsApi() { + const { cancel, request } = useRequest(); + + function createApi(input: LayoutCreateDto): Promise { + return request(`/api/platform/layouts`, { + data: input, + method: 'POST', + }); + } + + function getPagedListApi( + input?: LayoutGetPagedListInput, + ): Promise> { + return request>('/api/platform/layouts', { + method: 'GET', + params: input, + }); + } + + function getApi(id: string): Promise { + return request(`/api/platform/layouts/${id}`, { + method: 'GET', + }); + } + + function deleteApi(id: string): Promise { + return request(`/api/platform/layouts/${id}`, { + method: 'DELETE', + }); + } + + function updateApi(id: string, input: LayoutUpdateDto): Promise { + return request(`/api/platform/layouts/${id}`, { + data: input, + method: 'PUT', + }); + } + + return { + cancel, + createApi, + deleteApi, + getApi, + getPagedListApi, + updateApi, + }; +} diff --git a/apps/vben5/packages/@abp/platform/src/components/data-dictionaries/DataDictionaryItemDrawer.vue b/apps/vben5/packages/@abp/platform/src/components/data-dictionaries/DataDictionaryItemDrawer.vue index c6c1f05d7..c41b908cf 100644 --- a/apps/vben5/packages/@abp/platform/src/components/data-dictionaries/DataDictionaryItemDrawer.vue +++ b/apps/vben5/packages/@abp/platform/src/components/data-dictionaries/DataDictionaryItemDrawer.vue @@ -41,7 +41,7 @@ const valueTypeMaps: { [key: number]: string } = { }; const [Drawer, drawerApi] = useVbenDrawer({ - class: 'w-1/2', + class: 'w-2/3', async onOpenChange(isOpen) { if (isOpen) { const { name } = drawerApi.getData(); diff --git a/apps/vben5/packages/@abp/platform/src/components/index.ts b/apps/vben5/packages/@abp/platform/src/components/index.ts index 7c7cc632e..4ee20942f 100644 --- a/apps/vben5/packages/@abp/platform/src/components/index.ts +++ b/apps/vben5/packages/@abp/platform/src/components/index.ts @@ -1,3 +1,4 @@ export { default as DataDictionaryTable } from './data-dictionaries/DataDictionaryTable.vue'; +export { default as LayoutTable } from './layouts/LayoutTable.vue'; export { default as EmailMessageTable } from './messages/email/EmailMessageTable.vue'; export { default as SmsMessageTable } from './messages/sms/SmsMessageTable.vue'; diff --git a/apps/vben5/packages/@abp/platform/src/components/layouts/LayoutModal.vue b/apps/vben5/packages/@abp/platform/src/components/layouts/LayoutModal.vue new file mode 100644 index 000000000..5172f1e99 --- /dev/null +++ b/apps/vben5/packages/@abp/platform/src/components/layouts/LayoutModal.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/apps/vben5/packages/@abp/platform/src/components/layouts/LayoutTable.vue b/apps/vben5/packages/@abp/platform/src/components/layouts/LayoutTable.vue new file mode 100644 index 000000000..fab643ae7 --- /dev/null +++ b/apps/vben5/packages/@abp/platform/src/components/layouts/LayoutTable.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/apps/vben5/packages/@abp/platform/src/types/layouts.ts b/apps/vben5/packages/@abp/platform/src/types/layouts.ts new file mode 100644 index 000000000..f030ceb91 --- /dev/null +++ b/apps/vben5/packages/@abp/platform/src/types/layouts.ts @@ -0,0 +1,35 @@ +import type { PagedAndSortedResultRequestDto } from '@abp/core'; + +import type { RouteDto } from './routes'; + +interface LayoutDto extends RouteDto { + dataId: string; + framework: string; +} + +interface LayoutCreateOrUpdateDto { + description?: string; + displayName: string; + name: string; + path: string; + redirect?: string; +} + +interface LayoutCreateDto extends LayoutCreateOrUpdateDto { + dataId: string; + framework: string; +} + +type LayoutUpdateDto = LayoutCreateOrUpdateDto; + +interface LayoutGetPagedListInput extends PagedAndSortedResultRequestDto { + filter?: string; + framework?: string; +} + +export type { + LayoutCreateDto, + LayoutDto, + LayoutGetPagedListInput, + LayoutUpdateDto, +}; diff --git a/apps/vben5/packages/@abp/platform/src/types/routes.ts b/apps/vben5/packages/@abp/platform/src/types/routes.ts new file mode 100644 index 000000000..daa246d9d --- /dev/null +++ b/apps/vben5/packages/@abp/platform/src/types/routes.ts @@ -0,0 +1,12 @@ +import type { EntityDto } from '@abp/core'; + +interface RouteDto extends EntityDto { + description?: string; + displayName: string; + meta: Record; + name: string; + path: string; + redirect?: string; +} + +export type { RouteDto };