Просмотр исходного кода

😎1、修复分栏时二级菜单空时错误 2、代码调整及升级依赖

zuohuaijun 1 год назад
Родитель
Сommit
0dd5516f71

+ 3 - 3
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -34,7 +34,7 @@
     <PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.3.0" />
     <PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.6.0" />
-    <PackageReference Include="SqlSugarCore" Version="5.1.4.161" />
+    <PackageReference Include="SqlSugarCore" Version="5.1.4.162" />
     <PackageReference Include="SSH.NET" Version="2024.1.0" />
     <PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.3" />
     <PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1045" />
@@ -45,11 +45,11 @@
   <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
     <PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" />
     <PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
-    <PackageReference Include="Lazy.Captcha.Core" Version="2.0.6" />
+    <PackageReference Include="Lazy.Captcha.Core" Version="2.0.8" />
     <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.31" />
     <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.31" />
     <PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.31" />
-    <PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.2.0" />
+    <PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.1.9" />
   </ItemGroup>
 
   <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">

+ 2 - 1
Admin.NET/Admin.NET.Core/Util/CommonUtil.cs

@@ -209,11 +209,12 @@ public static class CommonUtil
         return res.Data;
     }
 
-
     /// <summary>
     /// 导入Excel数据并错误标记
     /// </summary>
+    /// <typeparam name="T"></typeparam>
     /// <param name="file"></param>
+    /// <param name="importResultCallback"></param>
     /// <returns></returns>
     public static async Task<ICollection<T>> ImportExcelData<T>([Required] IFormFile file, Func<ImportResult<T>, ImportResult<T>> importResultCallback = null) where T : class, new()
     {

+ 6 - 6
Web/package.json

@@ -70,11 +70,11 @@
 	"devDependencies": {
 		"@plugin-web-update-notification/vite": "^1.7.1",
 		"@types/lodash-es": "^4.17.12",
-		"@types/node": "^20.14.9",
+		"@types/node": "^20.14.10",
 		"@types/nprogress": "^0.2.3",
 		"@types/sortablejs": "^1.15.8",
-		"@typescript-eslint/eslint-plugin": "^7.15.0",
-		"@typescript-eslint/parser": "^7.15.0",
+		"@typescript-eslint/eslint-plugin": "^7.16.0",
+		"@typescript-eslint/parser": "^7.16.0",
 		"@vitejs/plugin-vue": "^5.0.5",
 		"@vitejs/plugin-vue-jsx": "^4.0.0",
 		"@vue/compiler-sfc": "^3.4.31",
@@ -84,10 +84,10 @@
 		"less": "^4.2.0",
 		"prettier": "^3.3.2",
 		"rollup-plugin-visualizer": "^5.12.0",
-		"sass": "^1.77.6",
-		"terser": "^5.31.1",
+		"sass": "^1.77.7",
+		"terser": "^5.31.2",
 		"typescript": "^5.5.3",
-		"vite": "^5.3.2",
+		"vite": "^5.3.3",
 		"vite-plugin-cdn-import": "^1.0.1",
 		"vite-plugin-compression2": "^1.1.2",
 		"vite-plugin-vue-setup-extend": "^0.4.0",

+ 4 - 3
Web/src/layout/component/columnsAside.vue

@@ -79,8 +79,9 @@ const onColumnsAsideMenuClick = async (v: RouteItem) => {
 		if (route.path.startsWith(redirect)) mittBus.emit('setSendColumnsChildren', setSendChildren(redirect));
 		else router.push(redirect);
 	} else {
-		if (!v.children) {
+		if (!v.children || v.children?.length === 0) {
 			router.push(path);
+			onColumnsAsideDown(v.k);
 		} else {
 			// 显示子级菜单
 			const resData: MittMenu = setSendChildren(path);
@@ -92,7 +93,7 @@ const onColumnsAsideMenuClick = async (v: RouteItem) => {
 
 	// 一个路由设置自动收起菜单
 	// https://gitee.com/lyt-top/vue-next-admin/issues/I6HW7H
-	if (!v.children) themeConfig.value.isCollapse = true;
+	if (!v.children || v.children?.length === 0) themeConfig.value.isCollapse = true;
 	else if (v.children.length > 1) themeConfig.value.isCollapse = false;
 };
 // 鼠标移入时,显示当前的子级菜单
@@ -283,7 +284,7 @@ watch(
 			width: var(--el-columnsMenuRoundWidth);
 			transform: translateX(-50%);
 			z-index: 0;
-			transition: 0.3s ease-in-out;
+			transition: 0.5s ease-in-out;
 			border-radius: 5px;
 		}
 		.columns-card {

+ 10 - 8
Web/src/stores/userInfo.ts

@@ -132,14 +132,16 @@ export const useUserInfo = defineStore('userInfo', {
 
 		// 根据字典类型和代码取字典项
 		getDictItemByCode(typePCode: string, val: string) {
-			val = val.toString();
-			if (val) {
-				const _val = val.toString();
-				const ds = this.getDictDatasByCode(typePCode);
-				for (let index = 0; index < ds.length; index++) {
-					const element = ds[index];
-					if (element.code == _val) {
-						return element;
+			if (val != undefined) {
+				val = val.toString();
+				if (val) {
+					const _val = val.toString();
+					const ds = this.getDictDatasByCode(typePCode);
+					for (let index = 0; index < ds.length; index++) {
+						const element = ds[index];
+						if (element.code == _val) {
+							return element;
+						}
 					}
 				}
 			}

+ 3 - 3
Web/src/views/login/component/account.vue

@@ -283,8 +283,8 @@ defineExpose({ saveTokenAndInitRoutes });
 <style lang="scss" scoped>
 .dialog-header {
 	:deep(.el-dialog) {
-        width: unset !important;
-        
+		width: unset !important;
+
 		.el-dialog__header {
 			display: none;
 		}
@@ -295,7 +295,7 @@ defineExpose({ saveTokenAndInitRoutes });
 
 		.v-modal {
 			position: absolute !important;
-		}		
+		}
 	}
 }