diff --git a/PearAdmin.AbpTemplate.sln b/PearAdmin.AbpTemplate.sln index 3045936617af8ba1a7cf5935020f80f9b223a560..2240408fd26ed921a0819138a79ff8362ce7cef7 100644 --- a/PearAdmin.AbpTemplate.sln +++ b/PearAdmin.AbpTemplate.sln @@ -29,6 +29,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PearAdmin.AbpTemplate.Share EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PearAdmin.AbpTemplate.Gateway", "src\PearAdmin.AbpTemplate.Gateway\PearAdmin.AbpTemplate.Gateway.csproj", "{F17AF2E0-E290-43A6-8695-B653FA6446EE}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "module", "module", "{F109D900-1B4F-4BE8-83E9-CAFBD39BA318}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PearAdmin.AbpTemplate.Storage", "module\PearAdmin.AbpTemplate.Storage\PearAdmin.AbpTemplate.Storage.csproj", "{8D82ACD2-379E-46BC-8E31-4496DFC6A455}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PearAdmin.AbpTemplate.Storage.Aliyun", "module\PearAdmin.AbpTemplate.Storage.Aliyun\PearAdmin.AbpTemplate.Storage.Aliyun.csproj", "{CA9E91F9-3A80-4BFA-9767-B6A9B83B0E87}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PearAdmin.AbpTemplate.Storage.Local", "module\PearAdmin.AbpTemplate.Storage.Local\PearAdmin.AbpTemplate.Storage.Local.csproj", "{748101D0-D707-4A82-B8D8-EA986E17F357}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PearAdmin.AbpTemplate.Storage.Minio", "module\PearAdmin.AbpTemplate.Storage.Minio\PearAdmin.AbpTemplate.Storage.Minio.csproj", "{B820EEF5-3BFF-4CDF-9854-DF188895BC2A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -75,6 +85,22 @@ Global {F17AF2E0-E290-43A6-8695-B653FA6446EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {F17AF2E0-E290-43A6-8695-B653FA6446EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {F17AF2E0-E290-43A6-8695-B653FA6446EE}.Release|Any CPU.Build.0 = Release|Any CPU + {8D82ACD2-379E-46BC-8E31-4496DFC6A455}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D82ACD2-379E-46BC-8E31-4496DFC6A455}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D82ACD2-379E-46BC-8E31-4496DFC6A455}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D82ACD2-379E-46BC-8E31-4496DFC6A455}.Release|Any CPU.Build.0 = Release|Any CPU + {CA9E91F9-3A80-4BFA-9767-B6A9B83B0E87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA9E91F9-3A80-4BFA-9767-B6A9B83B0E87}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA9E91F9-3A80-4BFA-9767-B6A9B83B0E87}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA9E91F9-3A80-4BFA-9767-B6A9B83B0E87}.Release|Any CPU.Build.0 = Release|Any CPU + {748101D0-D707-4A82-B8D8-EA986E17F357}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {748101D0-D707-4A82-B8D8-EA986E17F357}.Debug|Any CPU.Build.0 = Debug|Any CPU + {748101D0-D707-4A82-B8D8-EA986E17F357}.Release|Any CPU.ActiveCfg = Release|Any CPU + {748101D0-D707-4A82-B8D8-EA986E17F357}.Release|Any CPU.Build.0 = Release|Any CPU + {B820EEF5-3BFF-4CDF-9854-DF188895BC2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B820EEF5-3BFF-4CDF-9854-DF188895BC2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B820EEF5-3BFF-4CDF-9854-DF188895BC2A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B820EEF5-3BFF-4CDF-9854-DF188895BC2A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -90,6 +116,10 @@ Global {4A7E8F99-4265-4B66-AB07-B8FAED794DE2} = {F10AA149-2626-486E-85BB-9CD5365F3016} {B02066C3-0275-4DA9-B761-EF78FA7DB2F9} = {0440FD52-239B-40E9-9EBC-34B36F698676} {F17AF2E0-E290-43A6-8695-B653FA6446EE} = {AFAA0841-BD93-466F-B8F4-FB4EEC86F1FC} + {8D82ACD2-379E-46BC-8E31-4496DFC6A455} = {F109D900-1B4F-4BE8-83E9-CAFBD39BA318} + {CA9E91F9-3A80-4BFA-9767-B6A9B83B0E87} = {F109D900-1B4F-4BE8-83E9-CAFBD39BA318} + {748101D0-D707-4A82-B8D8-EA986E17F357} = {F109D900-1B4F-4BE8-83E9-CAFBD39BA318} + {B820EEF5-3BFF-4CDF-9854-DF188895BC2A} = {F109D900-1B4F-4BE8-83E9-CAFBD39BA318} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C6B33810-FA59-48A3-9DC4-F1F0312C57F6} diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunStorageModule.cs b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AbpTemplateAliyunStorageModule.cs similarity index 45% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunStorageModule.cs rename to module/PearAdmin.AbpTemplate.Storage.Aliyun/AbpTemplateAliyunStorageModule.cs index d477ae276ccd55a159a9d75e1a2c4765a4c3969c..2723d00acb0201ac90927d7949563c83101601cc 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunStorageModule.cs +++ b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AbpTemplateAliyunStorageModule.cs @@ -3,11 +3,12 @@ using Abp.Reflection.Extensions; namespace PearAdmin.AbpTemplate.Storage.Aliyun { - public class AliyunStorageModule : AbpModule + [DependsOn(typeof(AbpTemplateStorageModule))] + public class AbpTemplateAliyunStorageModule : AbpModule { public override void Initialize() { - IocManager.RegisterAssemblyByConvention(typeof(AliyunStorageModule).GetAssembly()); + IocManager.RegisterAssemblyByConvention(typeof(AbpTemplateAliyunStorageModule).GetAssembly()); } } } diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunClientFactory.cs b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunClientFactory.cs similarity index 100% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunClientFactory.cs rename to module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunClientFactory.cs diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunConfig.cs b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunConfig.cs similarity index 57% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunConfig.cs rename to module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunConfig.cs index dd92b5cc9d635212703cb3d86c7715878a840968..b96b456a42fe71521ad663f8aec18700c6ca5f78 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunConfig.cs +++ b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunConfig.cs @@ -16,21 +16,5 @@ /// OSS的访问地址 /// public string Endpoint { get; set; } - - /// - /// 存储桶名称 - /// - public string BucketName { get; set; } - - /// - /// 访问路径 - /// - public string BaseUrl - { - get - { - return $"https://{BucketName}.{Endpoint}"; - } - } } } diff --git a/module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunStorageManager.cs b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunStorageManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..d93c5874344779036d3c7fceadaf647c8f0f7e11 --- /dev/null +++ b/module/PearAdmin.AbpTemplate.Storage.Aliyun/AliyunStorageManager.cs @@ -0,0 +1,58 @@ +using System; +using System.IO; +using System.Threading.Tasks; +using Aliyun.OSS; +using Aliyun.OSS.Util; +using Microsoft.Extensions.Configuration; + +namespace PearAdmin.AbpTemplate.Storage.Aliyun +{ + public class AliyunStorageManager : IStorageManager + { + private readonly AliyunConfig _aliyunConfig; + private readonly OssClient _ossClient; + private readonly IConfiguration _configuration; + + public string ProviderName => "AliyunStorage"; + + public AliyunStorageManager(IConfiguration configuration) + { + _configuration = configuration; + _aliyunConfig = new AliyunConfig() + { + Endpoint = _configuration.GetSection($"{ProviderName}:Endpoint").Value, + AccessKeyId = _configuration.GetSection($"{ProviderName}:AccessKeyId").Value, + AccessKeySecret = _configuration.GetSection($"{ProviderName}:AccessKeySecret").Value, + }; + _ossClient = AliyunClientFactory.Create(_aliyunConfig); + } + + public Task UploadObject(string objectName, string filePath, string contentType, string bucketName = "default", string location = "us-east-1") + { + throw new NotImplementedException(); + } + + public async Task UploadObject(string objectName, Stream data, string contentType, string bucketName = "default", string location = "us-east-1") + { + await Task.Run(() => + { + var key = $"{bucketName}/{objectName}"; + var md5 = OssUtils.ComputeContentMd5(data, data.Length); + var objectMeta = new ObjectMetadata(); + objectMeta.AddHeader("Content-MD5", md5); + objectMeta.UserMetadata.Add("Content-MD5", md5); + _ossClient.PutObject(bucketName, key, data, objectMeta); + }); + } + + public Task UploadObjectUrlAsync(string objectName, int expiresInt = 604800, string bucketName = "default") + { + throw new NotImplementedException(); + } + + public async Task GetObjectUrlAsync(string objectName, int expiresInt = 604800, string bucketName = "default") + { + return await Task.Run(() => $"{_aliyunConfig.Endpoint}/{bucketName}/{objectName}"); + } + } +} diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/PearAdmin.AbpTemplate.Storage.Aliyun.csproj b/module/PearAdmin.AbpTemplate.Storage.Aliyun/PearAdmin.AbpTemplate.Storage.Aliyun.csproj similarity index 72% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/PearAdmin.AbpTemplate.Storage.Aliyun.csproj rename to module/PearAdmin.AbpTemplate.Storage.Aliyun/PearAdmin.AbpTemplate.Storage.Aliyun.csproj index 19ce6d213052b18ae87bb116be20dcb619e65280..d974b2b472b079b611fb584c3a5eb67d703894a0 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage.Aliyun/PearAdmin.AbpTemplate.Storage.Aliyun.csproj +++ b/module/PearAdmin.AbpTemplate.Storage.Aliyun/PearAdmin.AbpTemplate.Storage.Aliyun.csproj @@ -5,8 +5,9 @@ - + + diff --git a/module/PearAdmin.AbpTemplate.Storage.Local/Class1.cs b/module/PearAdmin.AbpTemplate.Storage.Local/Class1.cs new file mode 100644 index 0000000000000000000000000000000000000000..ee0b30c5d956582e28625eb6a83124332bc11fc7 --- /dev/null +++ b/module/PearAdmin.AbpTemplate.Storage.Local/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace PearAdmin.AbpTemplate.Storage.Local +{ + public class Class1 + { + } +} diff --git a/module/PearAdmin.AbpTemplate.Storage.Local/PearAdmin.AbpTemplate.Storage.Local.csproj b/module/PearAdmin.AbpTemplate.Storage.Local/PearAdmin.AbpTemplate.Storage.Local.csproj new file mode 100644 index 0000000000000000000000000000000000000000..7c4ae4ca62de0ce5035e56acec67f8c58dfb0aee --- /dev/null +++ b/module/PearAdmin.AbpTemplate.Storage.Local/PearAdmin.AbpTemplate.Storage.Local.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp3.1 + + + diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Minio/AbpTemplateStorageMinioModule.cs b/module/PearAdmin.AbpTemplate.Storage.Minio/AbpTemplateMinioStorageModule.cs similarity index 72% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Minio/AbpTemplateStorageMinioModule.cs rename to module/PearAdmin.AbpTemplate.Storage.Minio/AbpTemplateMinioStorageModule.cs index 120529f2ddeebacdb132023eecb802ae99effabd..6f0a609ecdf2b8956d359d318a158313ffe2b08c 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage.Minio/AbpTemplateStorageMinioModule.cs +++ b/module/PearAdmin.AbpTemplate.Storage.Minio/AbpTemplateMinioStorageModule.cs @@ -4,11 +4,11 @@ using Abp.Reflection.Extensions; namespace PearAdmin.AbpTemplate.Storage.Minio { [DependsOn(typeof(AbpTemplateStorageModule))] - public class AbpTemplateStorageMinioModule : AbpModule + public class AbpTemplateMinioStorageModule : AbpModule { public override void Initialize() { - var thisAssembly = typeof(AbpTemplateStorageMinioModule).GetAssembly(); + var thisAssembly = typeof(AbpTemplateMinioStorageModule).GetAssembly(); IocManager.RegisterAssemblyByConvention(thisAssembly); } diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Minio/MinioClientFactory.cs b/module/PearAdmin.AbpTemplate.Storage.Minio/MinioClientFactory.cs similarity index 100% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Minio/MinioClientFactory.cs rename to module/PearAdmin.AbpTemplate.Storage.Minio/MinioClientFactory.cs diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Minio/MinioConfig.cs b/module/PearAdmin.AbpTemplate.Storage.Minio/MinioConfig.cs similarity index 100% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Minio/MinioConfig.cs rename to module/PearAdmin.AbpTemplate.Storage.Minio/MinioConfig.cs diff --git a/module/PearAdmin.AbpTemplate.Storage.Minio/MinioStorageManager.cs b/module/PearAdmin.AbpTemplate.Storage.Minio/MinioStorageManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..e882b5d1b42d8d507977c61446ebb6ade971d949 --- /dev/null +++ b/module/PearAdmin.AbpTemplate.Storage.Minio/MinioStorageManager.cs @@ -0,0 +1,72 @@ +using System.IO; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Minio; + +namespace PearAdmin.AbpTemplate.Storage.Minio +{ + /// + /// Minio存储服务 + /// + public class MinioStorageManager : IStorageManager + { + private readonly MinioConfig _minioConfig; + private readonly MinioClient _minioClient; + private readonly IConfiguration _configuration; + + public string ProviderName => "MinioStorage"; + + public MinioStorageManager(IConfiguration configuration) + { + _configuration = configuration; + + _minioConfig = new MinioConfig() + { + Endpoint = _configuration.GetSection($"{ProviderName}:Endpoint").Value, + AccessKey = _configuration.GetSection($"{ProviderName}:AccessKey").Value, + SecretKey = _configuration.GetSection($"{ProviderName}:SecretKey").Value, + }; + _minioClient = MinioClientFactory.Create(_minioConfig); + } + + public async Task UploadObject(string objectName, string filePath, string contentType, string bucketName = "default", string location = "us-east-1") + { + // 检查是否存在bucket + bool found = await _minioClient.BucketExistsAsync(bucketName); + if (!found) + { + // 创建bucket + await _minioClient.MakeBucketAsync(bucketName, location); + } + + // 上传文件到bucket + await _minioClient.PutObjectAsync(bucketName, objectName, filePath, contentType); + } + + public async Task UploadObject(string objectName, Stream data, string contentType, string bucketName = "default", string location = "us-east-1") + { + // 检查是否存在bucket + bool found = await _minioClient.BucketExistsAsync(bucketName); + if (!found) + { + // 创建bucket + await _minioClient.MakeBucketAsync(bucketName, location); + } + + // 上传文件到bucket + await _minioClient.PutObjectAsync(bucketName, objectName, data, data.Length, contentType); + } + + public async Task UploadObjectUrlAsync(string objectName, int expiresInt = 604800, string bucketName = "default") + { + var fileUrl = await _minioClient.PresignedPutObjectAsync(bucketName, objectName, expiresInt); + return fileUrl; + } + + public async Task GetObjectUrlAsync(string objectName, int expiresInt = 604800, string bucketName = "default") + { + var fileUrl = await _minioClient.PresignedGetObjectAsync(bucketName, objectName, expiresInt); + return fileUrl; + } + } +} diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage.Minio/PearAdmin.AbpTemplate.Storage.Minio.csproj b/module/PearAdmin.AbpTemplate.Storage.Minio/PearAdmin.AbpTemplate.Storage.Minio.csproj similarity index 71% rename from tool/modules/PearAdmin.AbpTemplate.Storage.Minio/PearAdmin.AbpTemplate.Storage.Minio.csproj rename to module/PearAdmin.AbpTemplate.Storage.Minio/PearAdmin.AbpTemplate.Storage.Minio.csproj index e84c32e9eca0699ac9ef4966f41c1fe7dbfb11b3..5428c9f540c101c5bd3dcb35eadb0d7162760d00 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage.Minio/PearAdmin.AbpTemplate.Storage.Minio.csproj +++ b/module/PearAdmin.AbpTemplate.Storage.Minio/PearAdmin.AbpTemplate.Storage.Minio.csproj @@ -9,7 +9,8 @@ - + + diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/AbpTemplateStorageModule.cs b/module/PearAdmin.AbpTemplate.Storage/AbpTemplateStorageModule.cs similarity index 100% rename from tool/modules/PearAdmin.AbpTemplate.Storage/AbpTemplateStorageModule.cs rename to module/PearAdmin.AbpTemplate.Storage/AbpTemplateStorageModule.cs diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/BlobFileInfo.cs b/module/PearAdmin.AbpTemplate.Storage/BlobObjectInfo.cs similarity index 64% rename from tool/modules/PearAdmin.AbpTemplate.Storage/BlobFileInfo.cs rename to module/PearAdmin.AbpTemplate.Storage/BlobObjectInfo.cs index a5a26ffd23df0cd7866c4d9cff296698c407d55a..5ac393960f565333d0068e52291109841a2250e6 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage/BlobFileInfo.cs +++ b/module/PearAdmin.AbpTemplate.Storage/BlobObjectInfo.cs @@ -1,48 +1,46 @@ using System; -using System.Collections.Generic; -using System.Text; namespace PearAdmin.AbpTemplate.Storage { /// - /// 文件对象描述 + /// 文件对象描述 /// - public class BlobFileInfo + public class BlobObjectInfo { /// - /// 内容类型 + /// 内容类型 /// public string ContentType { get; set; } /// - /// 内容MD5 + /// 内容MD5 /// public string ContentMD5 { get; set; } public string ETag { get; set; } /// - /// 大小 + /// 大小 /// public long Length { get; set; } /// - /// 最后修改时间 + /// 最后修改时间 /// public DateTime? LastModified { get; set; } /// - /// 名称 + /// 容器 /// - public string Name { get; set; } + public string BucketName { get; set; } /// - /// 容器 + /// 名称 /// - public string Container { get; set; } + public string ObjectName { get; set; } /// - /// 路径 + /// 路径 /// public string Url { get; set; } } diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/BlobUrlAccess.cs b/module/PearAdmin.AbpTemplate.Storage/BlobUrlAccess.cs similarity index 86% rename from tool/modules/PearAdmin.AbpTemplate.Storage/BlobUrlAccess.cs rename to module/PearAdmin.AbpTemplate.Storage/BlobUrlAccess.cs index c1416b7cd7cf10ce8556b93d199f77efcef758e8..6b5b3941f27b92e1d64afb5f952917c93505c516 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage/BlobUrlAccess.cs +++ b/module/PearAdmin.AbpTemplate.Storage/BlobUrlAccess.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace PearAdmin.AbpTemplate.Storage { diff --git a/module/PearAdmin.AbpTemplate.Storage/IStorageManager.cs b/module/PearAdmin.AbpTemplate.Storage/IStorageManager.cs new file mode 100644 index 0000000000000000000000000000000000000000..12a254f3193bfe2afb16a5cb8e9803c3fe8e9b04 --- /dev/null +++ b/module/PearAdmin.AbpTemplate.Storage/IStorageManager.cs @@ -0,0 +1,25 @@ +using System.IO; +using System.Threading.Tasks; +using Abp.Dependency; + +namespace PearAdmin.AbpTemplate.Storage +{ + /// + /// 存储服务 + /// + public interface IStorageManager : ITransientDependency + { + /// + /// 提供程序名称 + /// + string ProviderName { get; } + + Task UploadObject(string objectName, string filePath, string contentType, string bucketName = "default", string location = "us-east-1"); + + Task UploadObject(string objectName, Stream data, string contentType, string bucketName = "default", string location = "us-east-1"); + + Task UploadObjectUrlAsync(string objectName, int expiresInt = 604800, string bucketName = "default"); + + Task GetObjectUrlAsync(string objectName, int expiresInt = 604800, string bucketName = "default"); + } +} diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/PearAdmin.AbpTemplate.Storage.csproj b/module/PearAdmin.AbpTemplate.Storage/PearAdmin.AbpTemplate.Storage.csproj similarity index 75% rename from tool/modules/PearAdmin.AbpTemplate.Storage/PearAdmin.AbpTemplate.Storage.csproj rename to module/PearAdmin.AbpTemplate.Storage/PearAdmin.AbpTemplate.Storage.csproj index c6531632fe27070de9bd3be058ba4e2bd8e105fe..30aaefc09492a49b09115cc382c102426d1cfbe8 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage/PearAdmin.AbpTemplate.Storage.csproj +++ b/module/PearAdmin.AbpTemplate.Storage/PearAdmin.AbpTemplate.Storage.csproj @@ -5,7 +5,7 @@ - + diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/StorageError.cs b/module/PearAdmin.AbpTemplate.Storage/StorageError.cs similarity index 80% rename from tool/modules/PearAdmin.AbpTemplate.Storage/StorageError.cs rename to module/PearAdmin.AbpTemplate.Storage/StorageError.cs index fef9c7ccc410b825c3648d222dd52130cfe3ee03..8d52f6dda0f49c9aa66a1ece6328a6455307df40 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage/StorageError.cs +++ b/module/PearAdmin.AbpTemplate.Storage/StorageError.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace PearAdmin.AbpTemplate.Storage +namespace PearAdmin.AbpTemplate.Storage { /// /// 错误 diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/StorageErrorCode.cs b/module/PearAdmin.AbpTemplate.Storage/StorageErrorCode.cs similarity index 100% rename from tool/modules/PearAdmin.AbpTemplate.Storage/StorageErrorCode.cs rename to module/PearAdmin.AbpTemplate.Storage/StorageErrorCode.cs diff --git a/tool/modules/PearAdmin.AbpTemplate.Storage/StorageException.cs b/module/PearAdmin.AbpTemplate.Storage/StorageException.cs similarity index 91% rename from tool/modules/PearAdmin.AbpTemplate.Storage/StorageException.cs rename to module/PearAdmin.AbpTemplate.Storage/StorageException.cs index d6fdd3c8a60ac4cbb4c1ac2676392c42774c6076..53105cb034d69eb7ea6fdd30963a1137336900a1 100644 --- a/tool/modules/PearAdmin.AbpTemplate.Storage/StorageException.cs +++ b/module/PearAdmin.AbpTemplate.Storage/StorageException.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace PearAdmin.AbpTemplate.Storage { diff --git a/src/PearAdmin.AbpTemplate.Admin/AbpTemplateAdminModule.cs b/src/PearAdmin.AbpTemplate.Admin/AbpTemplateAdminModule.cs index d53cc9d398c4e128b32cb3fde4c896ce34fe9530..73756da0b6d832003183fd987cc830d58ed0f299 100644 --- a/src/PearAdmin.AbpTemplate.Admin/AbpTemplateAdminModule.cs +++ b/src/PearAdmin.AbpTemplate.Admin/AbpTemplateAdminModule.cs @@ -1,6 +1,5 @@ using System.IO; using Abp.AspNetCore; -using Abp.AspNetCore.Configuration; using Abp.AspNetCore.SignalR; using Abp.Modules; using Abp.Reflection.Extensions; diff --git a/src/PearAdmin.AbpTemplate.Admin/Areas/Resource/Views/DataDictionary/CreateOrUpdateDataDictionaryItem.cshtml b/src/PearAdmin.AbpTemplate.Admin/Areas/Resource/Views/DataDictionary/CreateOrUpdateDataDictionaryItem.cshtml index 5351ee9abc649b3132a8bd71dd8be33c1387350d..64b18a4697b5e3d609738d5d953e824670b3c3e6 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Areas/Resource/Views/DataDictionary/CreateOrUpdateDataDictionaryItem.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Areas/Resource/Views/DataDictionary/CreateOrUpdateDataDictionaryItem.cshtml @@ -26,9 +26,10 @@ @section scripts{ @@ -69,12 +77,40 @@ + + + @section scripts{ - - + @*pear admin*@ - - @*core scripts start*@ - - @*core scripts end*@ - - @*admin-lte scripts start*@ - @* - *@ - @*admin-lte scripts end*@ - - @*abp scripts start*@ - @* - - - - - *@ - - - @* - - - *@ - @*abp scripts end*@ - - @*other scripts start*@ - @* - *@ - @*other scripts end*@ - - @*custom scripts start*@ - @**@ - @*custom scripts end*@ - - - - @**@ - - -@*@if (CultureInfo.CurrentUICulture.Name != "en") -{ - var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_"); - var localizationFileNameWithExtension = "messages_"; - switch (normalizedCurrentUICultureName) - { - case "zh_Hans": - localizationFileNameWithExtension += "zh"; - break; - case "es_MX": - localizationFileNameWithExtension += "es"; - break; - default: - localizationFileNameWithExtension += normalizedCurrentUICultureName; - break; - } - localizationFileNameWithExtension += ".min.js"; - -}*@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Account/_Styles.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Account/_Styles.cshtml index d68393f598ae6593bcbc801861f97676f79dd020..475bbd2616d7ba0a1fc1e2d236d8e4f9c4650794 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Account/_Styles.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Account/_Styles.cshtml @@ -1,28 +1,6 @@  - @*pear admin*@ - - - @*admin-lte styles start*@ - @* - - *@ - @*admin-lte styles end*@ - - @*abp styles start*@ - @* - *@ - @*abp styles end*@ - - @*custom styles start*@ - @* - *@ - @*custom styles end*@ - - - - @**@ \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/AuditLogs/Index.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/AuditLogs/Index.cshtml index 9d75751d30e33f1372c4cd2106bae3029f0caa05..74a8beb90c8560ca7f35634362c997f90e0a254a 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/AuditLogs/Index.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/AuditLogs/Index.cshtml @@ -47,11 +47,12 @@ @section scripts{ @section scripts{ - - + - - + @*pear admin*@ - - @*core scripts start*@ - - @*core scripts end*@ - - @*admin-lte scripts start*@ - @* - - - - - - - *@ - @*admin-lte scripts end*@ - - @*abp scripts start*@ - @* - - - - - *@ - - - - @* - - - *@ - - - - - @*abp scripts end*@ - - @*other scripts start*@ - @* - - *@ - @*other scripts end*@ - - @*custom scripts start*@ - @* - *@ - @*custom scripts end*@ - - - - @**@ - - -@*@if (CultureInfo.CurrentUICulture.Name != "en") - { - var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_"); - var localizationFileNameWithExtension = "messages_"; - switch (normalizedCurrentUICultureName) - { - case "zh_Hans": - localizationFileNameWithExtension += "zh"; - break; - case "es_MX": - localizationFileNameWithExtension += "es"; - break; - default: - localizationFileNameWithExtension += normalizedCurrentUICultureName; - break; - } - localizationFileNameWithExtension += ".min.js"; - - }*@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Chat/_Styles.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Chat/_Styles.cshtml index 7b98bedd1d6f42fb7fb28fae760b67c2d68ab78b..0e60f32031d17ef39c293f12d2c2d9c1fc57fb82 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Chat/_Styles.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Chat/_Styles.cshtml @@ -1,32 +1,7 @@  - @*pear admin*@ - - - @*admin-lte styles start*@ - @* - - - - - *@ - @*admin-lte styles end*@ - - @*abp styles start*@ - @**@ - @**@ - @*abp styles end*@ - - @*custom styles start*@ - @* - *@ - @*custom styles end*@ - - - - @**@ \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Editions/CreateOrUpdateEdition.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Editions/CreateOrUpdateEdition.cshtml index b1565001906f19948fcafc86132611424cda7553..88ec0e6a5bb451cdeb4dab82773075aab814d9fb 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Editions/CreateOrUpdateEdition.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Editions/CreateOrUpdateEdition.cshtml @@ -44,11 +44,12 @@ @section scripts{ - + } diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Scripts.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Scripts.cshtml index 6fc113fa5b154697bbc9255d19ffa49f87afe9b0..7da678f57b4a489dc9b85c2c48c17ee0d8f7c344 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Scripts.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Scripts.cshtml @@ -1,90 +1,5 @@ -@using System.Globalization -@inject PearAdmin.AbpTemplate.Timing.AppTimes AppTimes - - - - + @*pear admin*@ - - @*core scripts start*@ - - @*core scripts end*@ - - @*admin-lte scripts start*@ - @* - - - - - - - *@ - @*admin-lte scripts end*@ - - @*abp scripts start*@ - @* - - - - - *@ - - - - @* - - - *@ - - - - - @*abp scripts end*@ - - @*other scripts start*@ - @* - - *@ - @*other scripts end*@ - - @*custom scripts start*@ - @* - *@ - @*custom scripts end*@ - - - - @**@ - - -@*@if (CultureInfo.CurrentUICulture.Name != "en") - { - var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_"); - var localizationFileNameWithExtension = "messages_"; - switch (normalizedCurrentUICultureName) - { - case "zh_Hans": - localizationFileNameWithExtension += "zh"; - break; - case "es_MX": - localizationFileNameWithExtension += "es"; - break; - default: - localizationFileNameWithExtension += normalizedCurrentUICultureName; - break; - } - localizationFileNameWithExtension += ".min.js"; - - }*@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Styles.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Styles.cshtml index 9d05b64d7b9a705ac88070a3aacc7240079de0d3..395e81cb479317c1e2d715da40243db47b4517c1 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Styles.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Home/_Styles.cshtml @@ -1,34 +1,12 @@  - @*pear admin*@ - - @*admin-lte styles start*@ - @* - - - - - *@ - @*admin-lte styles end*@ - - @*abp styles start*@ - @**@ - @**@ - @*abp styles end*@ - - @*custom styles start*@ - @* - *@ - @*custom styles end*@ - - - - @**@ + @*abp styles*@ + @**@ \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Maintenance/Index.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Maintenance/Index.cshtml index 6b779e3c5bae65a5b144cd12b2e763fbfa662c66..e12b9fbac3faf3be7617a5b32c201d30c57474c3 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Maintenance/Index.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Maintenance/Index.cshtml @@ -75,8 +75,10 @@ @section scripts{ - - + @*pear admin*@ - - @*core scripts start*@ - - @*core scripts end*@ - - @*admin-lte scripts start*@ - @* - - - - - - - *@ - @*admin-lte scripts end*@ - - @*abp scripts start*@ - @* - - - *@ - - @* - *@ - - - - @* - - - *@ - @*abp scripts end*@ - - @*other scripts start*@ - @* - - *@ - @*other scripts end*@ - - @*custom scripts start*@ - @* - *@ - @*custom scripts end*@ - - - - @**@ - - -@*@if (CultureInfo.CurrentUICulture.Name != "en") -{ - var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_"); - var localizationFileNameWithExtension = "messages_"; - switch (normalizedCurrentUICultureName) - { - case "zh_Hans": - localizationFileNameWithExtension += "zh"; - break; - case "es_MX": - localizationFileNameWithExtension += "es"; - break; - default: - localizationFileNameWithExtension += normalizedCurrentUICultureName; - break; - } - localizationFileNameWithExtension += ".min.js"; - -}*@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/Shared/Layout/_Styles.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/Shared/Layout/_Styles.cshtml index e2a03ba21f98564086130cf82b9fad21529d4bf1..4db62b8b666c85632fe5a0845d1a36e46e0f5c82 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/Shared/Layout/_Styles.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/Shared/Layout/_Styles.cshtml @@ -1,32 +1,10 @@  - @*pear admin*@ - - @*admin-lte styles start*@ - @* - - - - - *@ - @*admin-lte styles end*@ - - @*abp styles start*@ - - @**@ - @*abp styles end*@ - - @*custom styles start*@ - @* - *@ - @*custom styles end*@ - - - - @**@ + @*abp styles*@ + @**@ \ No newline at end of file diff --git a/src/PearAdmin.AbpTemplate.Admin/Views/TenantSettings/Index.cshtml b/src/PearAdmin.AbpTemplate.Admin/Views/TenantSettings/Index.cshtml index da8cf37f350ea9a2ba8e320b7d6395dc4683ac91..9a00f0e0396377d885a1c3817dbe023da073447c 100644 --- a/src/PearAdmin.AbpTemplate.Admin/Views/TenantSettings/Index.cshtml +++ b/src/PearAdmin.AbpTemplate.Admin/Views/TenantSettings/Index.cshtml @@ -48,9 +48,10 @@ @section scripts{ '; - return html; - } + function jscode() { + var html = ''; + return html; + } - function randStrName() { - return Math.random().toString(36).substr(8); - } - var jscodehtml = jscode(); - $('.js-show').text(jscodehtml) - form.on('submit(formDemo)', function(data) { - layer.msg(JSON.stringify(data.field)); - return false; - }); - exports('design', {}); + function randStrName() { + return Math.random().toString(36).substr(8); + } + var jscodehtml = jscode(); + $('.js-show').text(jscodehtml) + form.on('submit(formDemo)', function (data) { + layer.msg(JSON.stringify(data.field)); + return false; + }); + exports('design', {}); }); diff --git a/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/drawer.js b/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/drawer.js index 9c9c9c27dd6b2f2f2048055101b9f45005aa4fd8..bf29635e2743c40544e25b3f09b710777e134495 100644 --- a/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/drawer.js +++ b/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/drawer.js @@ -1,179 +1,187 @@ -layui.define(['jquery', 'element'], function(exports) { - "use strict"; +layui.define(['jquery', 'element'], function (exports) { + "use strict"; - var MOD_NAME = 'drawer', - $ = layui.jquery, - element = layui.element; - - var drawer = new function() { - - this.open = function(option) { - var _right = new mSlider({ - dom: option.dom, - direction: option.direction, - distance: option.distance, - time:option.time?option.time:0, - maskClose:option.maskClose, - callback:option.success - }); - _right.open(); - - return _right; - } - - } - exports(MOD_NAME,drawer); + /** + * Drawer component + * */ + var MOD_NAME = 'drawer', + $ = layui.jquery, + element = layui.element; + + var drawer = new function () { + + /** + * open drawer + * */ + this.open = function (option) { + var obj = new mSlider({ + dom: option.dom, + direction: option.direction, + distance: option.distance, + time: option.time ? option.time : 0, + maskClose: option.maskClose, + callback: option.success + }); + obj.open(); + return obj; + } + + } + exports(MOD_NAME, drawer); }); -(function(b, c) { - function a(d) { - this.opts = { - "direction": d.direction || "left", - "distance": d.distance || "60%", - "dom": this.Q(d.dom), - "time": d.time || "", - "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, - "callback": d.callback || "" - }; - this.rnd = this.rnd(); - this.dom = this.opts.dom[0]; - this.wrap = ""; - this.inner = ""; - this.mask = ""; - this.init() - } - a.prototype = { - Q: function(d) { - return document.querySelectorAll(d) - }, - isMobile: function() { - return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false - }, - addEvent: function(f, e, d) { - if (f.attachEvent) { - f.attachEvent("on" + e, d) - } else { - f.addEventListener(e, d, false) - } - }, - rnd: function() { - return Math.random().toString(36).substr(2, 6) - }, - init: function() { - var g = this; - if (!g.dom) { - console.log("未正确绑定弹窗容器"); - return - } - var d = document.createElement("div"); - var e = document.createElement("div"); - var f = document.createElement("div"); - d.setAttribute("class", "mSlider-main ms-" + g.rnd); - e.setAttribute("class", "mSlider-inner"); - f.setAttribute("class", "mSlider-mask"); - g.Q("body")[0].appendChild(d); - g.Q(".ms-" + g.rnd)[0].appendChild(e); - g.Q(".ms-" + g.rnd)[0].appendChild(f); - g.wrap = g.Q(".ms-" + g.rnd)[0]; - g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; - g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; - g.inner.appendChild(g.dom); - switch (g.opts.direction) { - case "top": - g.top = "0"; - g.left = "0"; - g.width = "100%"; - g.height = g.opts.distance; - g.translate = "0,-100%,0"; - break; - case "bottom": - g.bottom = "0"; - g.left = "0"; - g.width = "100%"; - g.height = g.opts.distance; - g.translate = "0,100%,0"; - break; - case "right": - g.top = "0"; - g.right = "0"; - g.width = g.opts.distance; - g.height = document.documentElement.clientHeight + "px"; - g.translate = "100%,0,0"; - break; - default: - g.top = "0"; - g.left = "0"; - g.width = g.opts.distance; - g.height = document.documentElement.clientHeight + "px"; - g.translate = "-100%,0,0" - } - g.wrap.style.display = "none"; - g.wrap.style.position = "fixed"; - g.wrap.style.top = "0"; - g.wrap.style.left = "0"; - g.wrap.style.width = "100%"; - g.wrap.style.height = "100%"; - g.wrap.style.zIndex = 99; - g.inner.style.position = "absolute"; - g.inner.style.top = g.top; - g.inner.style.bottom = g.bottom; - g.inner.style.left = g.left; - g.inner.style.right = g.right; - g.inner.style.width = g.width; - g.inner.style.height = g.height; - g.inner.style.backgroundColor = "#fff"; - g.inner.style.transform = "translate3d(" + g.translate + ")"; - g.inner.style.webkitTransition = "all .2s ease-out"; - g.inner.style.transition = "all .2s ease-out"; - g.inner.style.zIndex = 100; - g.mask.style.width = "100%"; - g.mask.style.height = "100%"; - g.mask.style.opacity = "0"; - g.mask.style.backgroundColor = "black"; - g.mask.style.zIndex = "98"; - g.mask.style.webkitTransition = "all .2s ease-out"; - g.mask.style.transition = "all .2s ease-out"; - g.mask.style.webkitBackfaceVisibility = "hidden"; - g.events() - }, - open: function() { - var d = this; - d.wrap.style.display = "block"; +/** + * 源码 + * */ +(function (b, c) { + function a(d) { + this.opts = { + "direction": d.direction || "left", + "distance": d.distance || "60%", + "dom": this.Q(d.dom), + "time": d.time || "", + "maskClose": (d.maskClose + "").toString() !== "false" ? true : false, + "callback": d.callback || "" + }; + this.rnd = this.rnd(); + this.dom = this.opts.dom[0]; + this.wrap = ""; + this.inner = ""; + this.mask = ""; + this.init() + } + a.prototype = { + Q: function (d) { + return document.querySelectorAll(d) + }, + isMobile: function () { + return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false + }, + addEvent: function (f, e, d) { + if (f.attachEvent) { + f.attachEvent("on" + e, d) + } else { + f.addEventListener(e, d, false) + } + }, + rnd: function () { + return Math.random().toString(36).substr(2, 6) + }, + init: function () { + var g = this; + if (!g.dom) { + console.log("未正确绑定弹窗容器"); + return + } + var d = document.createElement("div"); + var e = document.createElement("div"); + var f = document.createElement("div"); + d.setAttribute("class", "mSlider-main ms-" + g.rnd); + e.setAttribute("class", "mSlider-inner"); + f.setAttribute("class", "mSlider-mask"); + g.Q("body")[0].appendChild(d); + g.Q(".ms-" + g.rnd)[0].appendChild(e); + g.Q(".ms-" + g.rnd)[0].appendChild(f); + g.wrap = g.Q(".ms-" + g.rnd)[0]; + g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0]; + g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0]; + g.inner.appendChild(g.dom); + switch (g.opts.direction) { + case "top": + g.top = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,-100%,0"; + break; + case "bottom": + g.bottom = "0"; + g.left = "0"; + g.width = "100%"; + g.height = g.opts.distance; + g.translate = "0,100%,0"; + break; + case "right": + g.top = "0"; + g.right = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "100%,0,0"; + break; + default: + g.top = "0"; + g.left = "0"; + g.width = g.opts.distance; + g.height = document.documentElement.clientHeight + "px"; + g.translate = "-100%,0,0" + } + g.wrap.style.display = "none"; + g.wrap.style.position = "fixed"; + g.wrap.style.top = "0"; + g.wrap.style.left = "0"; + g.wrap.style.width = "100%"; + g.wrap.style.height = "100%"; + g.wrap.style.zIndex = 99; + g.inner.style.position = "absolute"; + g.inner.style.top = g.top; + g.inner.style.bottom = g.bottom; + g.inner.style.left = g.left; + g.inner.style.right = g.right; + g.inner.style.width = g.width; + g.inner.style.height = g.height; + g.inner.style.backgroundColor = "#fff"; + g.inner.style.transform = "translate3d(" + g.translate + ")"; + g.inner.style.webkitTransition = "all .2s ease-out"; + g.inner.style.transition = "all .2s ease-out"; + g.inner.style.zIndex = 100; + g.mask.style.width = "100%"; + g.mask.style.height = "100%"; + g.mask.style.opacity = "0"; + g.mask.style.backgroundColor = "black"; + g.mask.style.zIndex = "98"; + g.mask.style.webkitTransition = "all .2s ease-out"; + g.mask.style.transition = "all .2s ease-out"; + g.mask.style.webkitBackfaceVisibility = "hidden"; + g.events() + }, + open: function () { + var d = this; + d.wrap.style.display = "block"; - setTimeout(function() { - d.inner.style.transform = "translate3d(0,0,0)"; - d.inner.style.webkitTransform = "translate3d(0,0,0)"; - d.mask.style.opacity = 0.5 - }, 30); - if (d.opts.time) { - d.timer = setTimeout(function() { - d.close() - }, d.opts.time) - } - }, - close: function() { - var d = this; - d.timer && clearTimeout(d.timer); - d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; - d.inner.style.transform = "translate3d(" + d.translate + ")"; - d.mask.style.opacity = 0; - setTimeout(function() { - d.wrap.style.display = "none"; - d.timer = null; - d.opts.callback && d.opts.callback() - }, 300) - }, - events: function() { - var d = this; - d.addEvent(d.mask, "touchmove", function(f) { - f.preventDefault() - }); - d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function(f) { - if (d.opts.maskClose) { - d.close() - } - }) - } - }; - b.mSlider = a + setTimeout(function () { + d.inner.style.transform = "translate3d(0,0,0)"; + d.inner.style.webkitTransform = "translate3d(0,0,0)"; + d.mask.style.opacity = 0.5 + }, 30); + if (d.opts.time) { + d.timer = setTimeout(function () { + d.close() + }, d.opts.time) + } + }, + close: function () { + var d = this; + d.timer && clearTimeout(d.timer); + d.inner.style.webkitTransform = "translate3d(" + d.translate + ")"; + d.inner.style.transform = "translate3d(" + d.translate + ")"; + d.mask.style.opacity = 0; + setTimeout(function () { + d.wrap.style.display = "none"; + d.timer = null; + d.opts.callback && d.opts.callback() + }, 300) + }, + events: function () { + var d = this; + d.addEvent(d.mask, "touchmove", function (f) { + f.preventDefault() + }); + d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function (f) { + if (d.opts.maskClose) { + d.close() + } + }) + } + }; + b.mSlider = a })(window); diff --git a/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/dropdown.js b/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/dropdown.js index 546b68299841455931909a6b30bfb13d04dbda03..16e58be62ec40085c71d1847d72256da4908a3b3 100644 --- a/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/dropdown.js +++ b/src/PearAdmin.AbpTemplate.Admin/wwwroot/libs/pear/module/dropdown.js @@ -4,4 +4,4 @@ * by Microanswer * http://layuidropdown.microanswer.cn/ **/ -layui.define(["jquery","laytpl"],function(i){var s=layui.jquery||layui.$,r=layui.laytpl,e="a",d={},c="1",u="2",m="3";function f(i){if(!i)throw new Error("菜单条目内必须填写内容。");if("hr"===i)return"hr";if(0!==i.indexOf("{"))throw new Error("除了分割线hr,别的菜单条目都必须保证是合格的Javascript对象或json对象。");return new Function("return "+i)()}function a(i){if(i&&0