Explorar el Código

😎1、增加MiniExcel和MiniWord组件 2、清理代码

zuohuaijun hace 1 año
padre
commit
9ac9c8fb60

+ 2 - 0
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -28,6 +28,8 @@
     <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.5.2" />
     <PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
     <PackageReference Include="MailKit" Version="4.8.0" />
+    <PackageReference Include="MiniExcel" Version="1.34.2" />
+    <PackageReference Include="MiniWord" Version="0.8.0" />
     <PackageReference Include="NewLife.Redis" Version="6.0.2024.1006" />
     <PackageReference Include="Novell.Directory.Ldap.NETStandard" Version="3.6.0" />
     <PackageReference Include="QRCoder" Version="1.6.0" />

+ 2 - 3
Admin.NET/Admin.NET.Core/Extension/RepositoryExtension.cs

@@ -405,6 +405,7 @@ public static class RepositoryExtension
         }
         return updateable;
     }
+
     /// <summary>
     /// 批量列表in查询
     /// </summary>
@@ -417,7 +418,6 @@ public static class RepositoryExtension
     /// <returns></returns>
     public static async Task<List<T1>> BulkListQuery<T1, T2>(this ISugarQueryable<T1> queryable,
             Expression<Func<T1, SingleColumnEntity<T2>, bool>> exp,
-
             IEnumerable<T2> queryList,
             CancellationToken stoppingToken) where T1 : class, new()
     {
@@ -426,7 +426,7 @@ public static class RepositoryExtension
         try
         {
             var type = queryable.Context.DynamicBuilder().CreateClass(tableName, new SugarTable())
-                .CreateProperty("ColumnName", typeof(string), new SugarColumn() { IsPrimaryKey = true })//主键不要自增 
+                .CreateProperty("ColumnName", typeof(string), new SugarColumn() { IsPrimaryKey = true }) // 主键不要自增
                 .BuilderType();
             // 创建表
             queryable.Context.CodeFirst.InitTables(type);
@@ -450,6 +450,5 @@ public static class RepositoryExtension
             queryable.Context.DbMaintenance.DropTable(tableName);
             throw Oops.Oh(error);
         }
-
     }
 }

+ 4 - 4
Admin.NET/Admin.NET.Core/Utils/MiniExcelUtil.cs

@@ -6,7 +6,7 @@
 
 using MiniExcelLibs;
 
-namespace Admin.NET.Core;   
+namespace Admin.NET.Core;
 
 public static class MiniExcelUtil
 {
@@ -20,11 +20,11 @@ public static class MiniExcelUtil
     public static async Task<IActionResult> ExportExcelTemplate<T>(string fileName = null) where T : class, new()
     {
         var values = Array.Empty<T>();
-        //在内存中当开辟空间
+        // 在内存中当开辟空间
         var memoryStream = new MemoryStream();
-        //将数据写到内存当中
+        // 将数据写到内存当中
         await memoryStream.SaveAsAsync(values, sheetName: _sheetName);
-        //从0的位置开始写入
+        // 从0的位置开始写入
         memoryStream.Seek(0, SeekOrigin.Begin);
         return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
         {

+ 4 - 4
Web/package.json

@@ -2,7 +2,7 @@
 	"name": "admin.net",
 	"type": "module",
 	"version": "2.4.33",
-	"lastBuildTime": "2024.10.27",
+	"lastBuildTime": "2024.10.29",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
 	"author": "zuohuaijun",
 	"license": "MIT",
@@ -38,7 +38,7 @@
 		"js-table2excel": "^1.1.2",
 		"jsplumb": "^2.15.6",
 		"lodash-es": "^4.17.21",
-		"md-editor-v3": "^4.21.1",
+		"md-editor-v3": "^4.21.2",
 		"mitt": "^3.0.1",
 		"monaco-editor": "^0.52.0",
 		"mqtt": "^4.3.8",
@@ -48,7 +48,7 @@
 		"push.js": "^1.0.12",
 		"qrcodejs2-fixes": "^0.0.2",
 		"qs": "^6.13.0",
-		"relation-graph": "^2.2.7",
+		"relation-graph": "^2.2.8",
 		"screenfull": "^6.0.2",
 		"sm-crypto-v2": "^1.9.3",
 		"sortablejs": "^1.15.3",
@@ -81,7 +81,7 @@
 		"@vue/compiler-sfc": "^3.5.12",
 		"code-inspector-plugin": "^0.17.2",
 		"eslint": "^9.13.0",
-		"eslint-plugin-vue": "^9.29.1",
+		"eslint-plugin-vue": "^9.30.0",
 		"globals": "^15.11.0",
 		"less": "^4.2.0",
 		"prettier": "^3.3.3",

+ 5 - 5
Web/src/views/system/print/component/hiprint/index.vue

@@ -127,12 +127,12 @@ import { hiprint } from 'vue-plugin-hiprint';
 import providers from './providers';
 import PrintPreview from './preview.vue';
 import printDataDefault from './print-data';
-import { IPaperType } from './type';
+// import { IPaperType } from './type';
 
-interface IPaperType{
-    type:string;
-    width:number;
-    height:number;
+interface IPaperType {
+	type: string;
+	width: number;
+	height: number;
 }
 
 var props = defineProps({