From 75111b6690cbf3654aed4a7204137677c19bf412 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Sun, 5 Feb 2023 17:18:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=98=A0=E5=B0=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj | 2 +- .../TypeScriptServiceProxyGenerator.cs | 7 ++- .../Cli/UI/Vben/VbenModelScriptGenerator.cs | 54 ++++++++++++++++--- .../Properties/launchSettings.json | 4 +- 4 files changed, 55 insertions(+), 12 deletions(-) diff --git a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj index e948a6227..52a582fa5 100644 --- a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj +++ b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj @@ -5,7 +5,7 @@ Exe net7.0 - 7.0.0 + 7.0.1 colin Use LINGYUN.MicroService.Templates command line true diff --git a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptServiceProxyGenerator.cs b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptServiceProxyGenerator.cs index ca8e7db70..778b46fa4 100644 --- a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptServiceProxyGenerator.cs +++ b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/LINGYUN/Abp/Cli/ServiceProxying/TypeScript/TypeScriptServiceProxyGenerator.cs @@ -31,7 +31,12 @@ public class TypeScriptServiceProxyGenerator : ServiceProxyGeneratorBase TypeScriptModelGenerator.AbpBaseTypes.Any(typeSimple.StartsWith); + protected virtual string GetComponentType(string typeSimple) + { + if (typeSimple.Contains("DateTime")) + { + return "DatePicker"; + } + + if (typeSimple.Contains("Boolean")) + { + return "Checkbox"; + } + + if (typeSimple.Contains("Enum")) + { + return "Select"; + } + + if (typeSimple.Contains("Int") || + typeSimple.Contains("Byte") || + typeSimple.Contains("Single") || + typeSimple.Contains("Double") || + typeSimple.Contains("Decimal")) + { + return "InputNumber"; + } + + if (typeSimple.Contains("Object")) + { + return "CodeEditorX"; + } + + return "Input"; + } + protected virtual string GetAbpBaseType(string typeSimple) => TypeScriptModelGenerator.AbpBaseTypes.FirstOrDefault(typeSimple.StartsWith); @@ -476,4 +512,6 @@ public class ComponentModel public bool Sorter { get; set; } = true; public bool Resizable { get; set; } = true; public bool Required { get; set; } = false; + + public bool HasDate { get; set; } = false; } diff --git a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/Properties/launchSettings.json b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/Properties/launchSettings.json index bd56229eb..7fa08e303 100644 --- a/aspnet-core/modules/cli/LINGYUN.Abp.Cli/Properties/launchSettings.json +++ b/aspnet-core/modules/cli/LINGYUN.Abp.Cli/Properties/launchSettings.json @@ -2,8 +2,8 @@ "profiles": { "LINGYUN.Abp.Cli": { "commandName": "Project", - "commandLineArgs": "generate-view -t vben-view -m task-management -o D:\\Projects\\Development\\view-script -url http://127.0.0.1:30000/" - // "commandLineArgs": "generate-proxy -t ts -asp vben-dynamic -u http://127.0.0.1:30000 -m task-management -o D:\\Projects\\Development\\type-script" + "commandLineArgs": "generate-view -t vben-view -m auditing -o D:\\Projects\\Development\\view-script -url http://127.0.0.1:30000/" + //"commandLineArgs": "generate-proxy -t ts -asp vben-dynamic -u http://127.0.0.1:30000 -m platform -o D:\\Projects\\Development\\type-script" } } } \ No newline at end of file From c87819baa30f627a3f294f599e1aac8e711d5a75 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Sun, 5 Feb 2023 17:25:23 +0800 Subject: [PATCH 2/2] feat(platform): add package management ui --- apps/vue/src/api/platform/package/index.ts | 121 ++++++++++++++++++ .../src/api/platform/package/model/index.ts | 84 ++++++++++++ .../package/components/PackageModal.vue | 65 ++++++++++ .../package/components/PackageTable.vue | 98 ++++++++++++++ .../views/platform/package/datas/ModalData.ts | 119 +++++++++++++++++ .../views/platform/package/datas/TableData.ts | 118 +++++++++++++++++ apps/vue/src/views/platform/package/index.vue | 13 ++ .../Platform/Localization/Resources/en.json | 7 +- .../Localization/Resources/zh-Hans.json | 7 +- 9 files changed, 630 insertions(+), 2 deletions(-) create mode 100644 apps/vue/src/api/platform/package/index.ts create mode 100644 apps/vue/src/api/platform/package/model/index.ts create mode 100644 apps/vue/src/views/platform/package/components/PackageModal.vue create mode 100644 apps/vue/src/views/platform/package/components/PackageTable.vue create mode 100644 apps/vue/src/views/platform/package/datas/ModalData.ts create mode 100644 apps/vue/src/views/platform/package/datas/TableData.ts create mode 100644 apps/vue/src/views/platform/package/index.vue diff --git a/apps/vue/src/api/platform/package/index.ts b/apps/vue/src/api/platform/package/index.ts new file mode 100644 index 000000000..73b01191d --- /dev/null +++ b/apps/vue/src/api/platform/package/index.ts @@ -0,0 +1,121 @@ +import { defAbpHttp } from '/@/utils/http/abp'; +import { + PackageCreateDto, + PackageDto, + PackageBlobUploadDto, + PackageBlobDto, + PackageBlobRemoveDto, + PackageBlobDownloadInput, + PackageGetLatestInput, + PackageGetPagedListInput, + PackageUpdateDto +} from './model'; + +const remoteServiceName = 'Platform'; +const controllerName = 'Package'; + +export const CreateAsyncByInput = (input: PackageCreateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'CreateAsync', + uniqueName: 'CreateAsyncByInput', + params: { + }, + data: input, + }); +}; +export const DeleteAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DeleteAsync', + uniqueName: 'DeleteAsyncById', + params: { + id: id, + }, + }); +}; +export const UploadBlobAsyncByIdAndInput = (id: string, input: PackageBlobUploadDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'UploadBlobAsync', + uniqueName: 'UploadBlobAsyncByIdAndInput', + params: id, + data: input, + }); +}; +export const RemoveBlobAsyncByIdAndInput = (id: string, input: PackageBlobRemoveDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'RemoveBlobAsync', + uniqueName: 'RemoveBlobAsyncByIdAndInput', + params: { + id: id, + input: input, + }, + }); +}; +export const DownloadBlobAsyncByIdAndInput = (id: string, input: PackageBlobDownloadInput) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'DownloadBlobAsync', + uniqueName: 'DownloadBlobAsyncByIdAndInput', + params: { + id: id, + input: input, + }, + },{ + withToken: false, + }); +}; +export const GetAsyncById = (id: string) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetAsync', + uniqueName: 'GetAsyncById', + params: { + id: id, + }, + },{ + withToken: false, + }); +}; +export const GetLatestAsyncByInput = (input: PackageGetLatestInput) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'GetLatestAsync', + uniqueName: 'GetLatestAsyncByInput', + params: { + input: input, + }, + },{ + withToken: false, + }); +}; +export const GetListAsyncByInput = (input: PackageGetPagedListInput) => { + return defAbpHttp.pagedRequest({ + service: remoteServiceName, + controller: controllerName, + action: 'GetListAsync', + uniqueName: 'GetListAsyncByInput', + params: { + input: input, + }, + }); +}; +export const UpdateAsyncByIdAndInput = (id: string, input: PackageUpdateDto) => { + return defAbpHttp.request({ + service: remoteServiceName, + controller: controllerName, + action: 'UpdateAsync', + uniqueName: 'UpdateAsyncByIdAndInput', + params: id, + data: input, + }); +}; diff --git a/apps/vue/src/api/platform/package/model/index.ts b/apps/vue/src/api/platform/package/model/index.ts new file mode 100644 index 000000000..aefc684fc --- /dev/null +++ b/apps/vue/src/api/platform/package/model/index.ts @@ -0,0 +1,84 @@ +export interface PackageCreateDto extends PackageCreateOrUpdateDto { + name: string; + version: string; +} + +export interface PackageBlobUploadDto { + name: string; + size?: number; + summary?: string; + contentType?: string; + createdAt?: string; + updatedAt?: string; + license?: string; + authors?: string; + file: Blob; +} + +export interface PackageBlobRemoveDto { + name: string; +} + +export interface PackageBlobDownloadInput { + name: string; +} + +export interface PackageGetLatestInput { + name: string; +} + +export interface PackageGetPagedListInput extends PagedAndSortedResultRequestDto { + filter?: string; + name?: string; + note?: string; + version?: string; + description?: string; + forceUpdate?: boolean; + authors?: string; +} + +export interface PackageUpdateDto extends PackageCreateOrUpdateDto { + concurrencyStamp?: string; +} + +export interface PackageCreateOrUpdateDto { + note: string; + description?: string; + forceUpdate?: boolean; + authors?: string; + level?: PackageLevel; +} + +export enum PackageLevel { + Resource = 0, + Full = 1, + None = -1, +} + +export interface PackageBlobDto extends CreationAuditedEntityDto { + name?: string; + url?: string; + size?: number; + summary?: string; + createdAt?: string; + updatedAt?: string; + license?: string; + authors?: string; + sHA256?: string; + contentType?: string; + downloadCount?: number; + extraProperties?: Dictionary; +} + +export interface PackageDto extends ExtensibleAuditedEntityDto { + concurrencyStamp?: string; + name?: string; + note?: string; + version?: string; + description?: string; + forceUpdate?: boolean; + authors?: string; + level?: PackageLevel; + blobs?: PackageBlobDto[]; +} + diff --git a/apps/vue/src/views/platform/package/components/PackageModal.vue b/apps/vue/src/views/platform/package/components/PackageModal.vue new file mode 100644 index 000000000..923dd52fb --- /dev/null +++ b/apps/vue/src/views/platform/package/components/PackageModal.vue @@ -0,0 +1,65 @@ + + + diff --git a/apps/vue/src/views/platform/package/components/PackageTable.vue b/apps/vue/src/views/platform/package/components/PackageTable.vue new file mode 100644 index 000000000..95bbddce0 --- /dev/null +++ b/apps/vue/src/views/platform/package/components/PackageTable.vue @@ -0,0 +1,98 @@ + + + diff --git a/apps/vue/src/views/platform/package/datas/ModalData.ts b/apps/vue/src/views/platform/package/datas/ModalData.ts new file mode 100644 index 000000000..cbc8e4761 --- /dev/null +++ b/apps/vue/src/views/platform/package/datas/ModalData.ts @@ -0,0 +1,119 @@ +import { useLocalization } from '/@/hooks/abp/useLocalization'; +import { FormProps, FormSchema } from '/@/components/Form'; + +const { L } = useLocalization(['Platform', 'AbpUi']); + +export function getSearchFormProps(): Partial { + return { + labelWidth: 100, + schemas: [ + { + field: 'filter', + component: 'Input', + label: L('Search'), + colProps: {span: 24}, + }, + { + field: 'name', + component: 'Input', + label: L('DisplayName:Name'), + colProps: {span: 8}, + }, + { + field: 'note', + component: 'Input', + label: L('DisplayName:Note'), + colProps: {span: 8}, + }, + { + field: 'version', + component: 'Input', + label: L('DisplayName:Version'), + colProps: {span: 8}, + }, + { + field: 'description', + component: 'Input', + label: L('DisplayName:Description'), + colProps: {span: 8}, + }, + { + field: 'forceUpdate', + component: 'Input', + label: L('DisplayName:ForceUpdate'), + colProps: {span: 8}, + }, + { + field: 'authors', + component: 'Input', + label: L('DisplayName:Authors'), + colProps: {span: 8}, + } + ], + }; +} + +export function getModalFormSchemas(): FormSchema[] { + return [ + { + field: 'note', + component: 'Input', + label: L('DisplayName:Note'), + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'description', + component: 'Input', + label: L('DisplayName:Description'), + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'forceUpdate', + component: 'Input', + label: L('DisplayName:ForceUpdate'), + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'authors', + component: 'Input', + label: L('DisplayName:Authors'), + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'name', + component: 'Input', + label: L('DisplayName:Name'), + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'version', + component: 'Input', + label: L('DisplayName:Version'), + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'id', + component: 'Input', + label: 'id', + show: false, + dynamicDisabled: true, + colProps: {span: 24}, + componentProps: {}, + }, + { + field: 'concurrencyStamp', + component: 'Input', + label: 'concurrencyStamp', + show: false, + dynamicDisabled: true, + colProps: {span: 24}, + componentProps: {}, + }, + ]; +} diff --git a/apps/vue/src/views/platform/package/datas/TableData.ts b/apps/vue/src/views/platform/package/datas/TableData.ts new file mode 100644 index 000000000..eac0ee973 --- /dev/null +++ b/apps/vue/src/views/platform/package/datas/TableData.ts @@ -0,0 +1,118 @@ +import { useLocalization } from '/@/hooks/abp/useLocalization'; +import { BasicColumn } from '/@/components/Table'; +import { formatToDateTime } from '/@/utils/dateUtil'; + +const { L } = useLocalization(['Platform', 'AbpUi']); + +export function getDataColumns(): BasicColumn[] { + return [ + { + title: L('DisplayName:Id'), + dataIndex: 'id', + align: 'left', + width: 1, + sorter: true, + resizable: true, + ifShow: false, + }, + { + title: L('DisplayName:CreationTime'), + dataIndex: 'creationTime', + align: 'left', + width: 1, + sorter: true, + resizable: true, + ifShow: false, + format: (text) => { + return text ? formatToDateTime(text) : text; + } + }, + { + title: L('DisplayName:CreatorId'), + dataIndex: 'creatorId', + align: 'left', + width: 1, + sorter: true, + resizable: true, + ifShow: false, + }, + { + title: L('DisplayName:LastModificationTime'), + dataIndex: 'lastModificationTime', + align: 'left', + width: 1, + sorter: true, + resizable: true, + ifShow: false, + format: (text) => { + return text ? formatToDateTime(text) : text; + } + }, + { + title: L('DisplayName:LastModifierId'), + dataIndex: 'lastModifierId', + align: 'left', + width: 1, + sorter: true, + resizable: true, + ifShow: false, + }, + { + title: L('DisplayName:ConcurrencyStamp'), + dataIndex: 'concurrencyStamp', + align: 'left', + width: 1, + sorter: true, + resizable: true, + ifShow: false, + }, + { + title: L('DisplayName:Name'), + dataIndex: 'name', + align: 'left', + width: 120, + sorter: true, + resizable: true, + }, + { + title: L('DisplayName:Note'), + dataIndex: 'note', + align: 'left', + width: 120, + sorter: true, + resizable: true, + }, + { + title: L('DisplayName:Version'), + dataIndex: 'version', + align: 'left', + width: 120, + sorter: true, + resizable: true, + }, + { + title: L('DisplayName:Description'), + dataIndex: 'description', + align: 'left', + width: 120, + sorter: true, + resizable: true, + }, + { + title: L('DisplayName:ForceUpdate'), + dataIndex: 'forceUpdate', + align: 'left', + width: 120, + sorter: true, + resizable: true, + }, + { + title: L('DisplayName:Authors'), + dataIndex: 'authors', + align: 'left', + width: 120, + sorter: true, + resizable: true, + }, + ]; +} diff --git a/apps/vue/src/views/platform/package/index.vue b/apps/vue/src/views/platform/package/index.vue new file mode 100644 index 000000000..aad98e0d5 --- /dev/null +++ b/apps/vue/src/views/platform/package/index.vue @@ -0,0 +1,13 @@ + + + diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json index 8416935cb..7a149bf0f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json @@ -37,6 +37,10 @@ "DisplayName:Basic": "Basic", "DisplayName:DataDictionary": "Data Dictionary", "DisplayName:RoleName": "Role Name", + "DisplayName:Note": "Note", + "DisplayName:Version": "Version", + "DisplayName:ForceUpdate": "Force Update", + "DisplayName:Authors": "Authors", "Layout:AddNew": "Add New", "Layout:Edit": "Edit", "Layout:EditByName": "Edit Layout - {0}", @@ -60,6 +64,7 @@ "DuplicateDataItem": "A data dictionary entry named {0} already exists!", "DataItemNotFound": "There is no data dictionary entry named {0}!", "UnableRemoveHasChildNode": "Current data dictionary exists child node, cannot delete!", - "DuplicateLayout": "A layout named {0} already exists!" + "DuplicateLayout": "A layout named {0} already exists!", + "Packages": "Packages" } } \ No newline at end of file diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json index bdba3e823..6dddd8baf 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json @@ -37,6 +37,10 @@ "DisplayName:Basic": "基础信息", "DisplayName:DataDictionary": "数据字典", "DisplayName:RoleName": "角色名称", + "DisplayName:Note": "发版说明", + "DisplayName:Version": "版本", + "DisplayName:ForceUpdate": "强制更新", + "DisplayName:Authors": "作者", "Layout:AddNew": "添加新布局", "Layout:Edit": "编辑布局", "Layout:EditByName": "编辑布局 - {0}", @@ -60,6 +64,7 @@ "DuplicateDataItem": "已经存在名为 {0} 的数据字典项!", "DataItemNotFound": "不存在名为 {0} 的数据字典项!", "UnableRemoveHasChildNode": "当前数据字典存在子节点,无法删除!", - "DuplicateLayout": "已经存在名为 {0} 的布局!" + "DuplicateLayout": "已经存在名为 {0} 的布局!", + "Packages": "包列表" } } \ No newline at end of file