diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index 295882ec..e840e1cf 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -22,15 +22,15 @@ - + - - - - + + + + @@ -50,13 +50,13 @@ - + - + @@ -76,9 +76,9 @@ - - - + + + diff --git a/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs b/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs index 297bf699..0a76b4a3 100644 --- a/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs @@ -123,22 +123,31 @@ public class SysEnumService : IDynamicApiController, ITransient var newEnumType = enumTypeList.Where(u => !updatedEnumCodes.Contains(u.TypeName)).ToList(); var (newDictTypes, newDictDatas) = GetNewSysDicts(newEnumType); - // 需要更新的字典类型 + // 执行数据库操作 if (updatedDictTypes.Count > 0) - await _db.Fastest().PageSize(300).BulkMergeAsync(updatedDictTypes); - // 需要更新的字典数据 - if (updatedDictDatas.Count > 0) - await _db.Fastest().PageSize(300).BulkMergeAsync(updatedDictDatas); + await _db.Updateable(updatedDictTypes).ExecuteCommandAsync(); + + if (updatedDictDatas.Count > 0) + await _db.Updateable(updatedDictDatas).ExecuteCommandAsync(); - // 需要新增的字典数据 if (newSysDictDatas.Count > 0) - await _db.Fastest().PageSize(300).BulkMergeAsync(newSysDictDatas); - // 需要新增的字典类型 + { + // 达梦:用db.Insertable(newDictTypes).ExecuteCommandAsync(stoppingToken);插入400条以上会内容溢出错误,所以改用逐条插入 + // 达梦:不支持storageable2.BulkUpdateAsync 功能 + foreach (var dd in newSysDictDatas) + await _db.Insertable(dd).ExecuteCommandAsync(); + } + if (newDictTypes.Count > 0) - await _db.Fastest().PageSize(300).BulkMergeAsync(newDictTypes); - // 需要新增的字典数据 + await _db.Insertable(newDictTypes).ExecuteCommandAsync(); + if (newDictDatas.Count > 0) - await _db.Fastest().PageSize(300).BulkMergeAsync(newDictDatas); + { + // 达梦:用db.Insertable(newDictTypes).ExecuteCommandAsync(stoppingToken);插入400条以上会内容溢出错误,所以改用逐条插入 + // 达梦:不支持storageable2.BulkUpdateAsync 功能 + foreach (var dd in newDictDatas) + await _db.Insertable(dd).ExecuteCommandAsync(); + } } /// diff --git a/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs b/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs index 0142c165..7ac36a62 100644 --- a/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs @@ -187,17 +187,19 @@ public class SysRegionService : IDynamicApiController, ITransient var html = await _httpRemoteService.GetAsStringAsync("http://xzqh.mca.gov.cn/map"); var municipalityList = new List { "北京", "天津", "上海", "重庆" }; - var provList = JSON.Deserialize>>(Regex.Match(html, @"(?<=var json = )(\[\{.*?\}\])(?=;)").Value); - foreach (var dict1 in provList) + var proJson = Regex.Match(html, @"(?<=var json = )(\[\{.*?\}\])(?=;)").Value; + dynamic provList = Clay.Parse(proJson); + + var list = new List(); + foreach (var proItem in provList) { - var list = new List(); - var provName = dict1.GetValueOrDefault("shengji"); + var provName = proItem.shengji; var province = new SysRegion { Id = YitIdHelper.NextId(), Name = Regex.Replace(provName, "[((].*?[))]", ""), - Code = dict1.GetValueOrDefault("quHuaDaiMa"), - CityCode = dict1.GetValueOrDefault("quhao"), + Code = proItem.quHuaDaiMa, + CityCode = proItem.quhao, Level = 1, Pid = 0, }; @@ -206,17 +208,17 @@ public class SysRegionService : IDynamicApiController, ITransient if (input.Level <= 1) continue; - var prefList = await GetSelectList(provName); - foreach (var dict2 in prefList) + var cityList = await GetSelectList(provName); + foreach (var cityItem in cityList) { - var prefName = dict2.GetValueOrDefault("diji"); + var cityName = cityItem.diji; var city = new SysRegion { Id = YitIdHelper.NextId(), - Code = dict2.GetValueOrDefault("quHuaDaiMa"), - CityCode = dict2.GetValueOrDefault("quhao"), + Code = cityItem.quHuaDaiMa, + CityCode = cityItem.quhao, Pid = province.Id, - Name = prefName, + Name = cityName, Level = 2 }; if (municipalityList.Any(m => city.Name.StartsWith(m))) city.Name += "(地)"; @@ -224,23 +226,31 @@ public class SysRegionService : IDynamicApiController, ITransient if (input.Level <= 2) continue; - var countyList = await GetSelectList(provName, prefName); - foreach (var dict3 in countyList) + var countyList = await GetSelectList(provName, cityName); + foreach (var countyItem in countyList) { - var countyName = dict3.GetValueOrDefault("xianji"); + var countyName = countyItem.xianji; var county = new SysRegion { Id = YitIdHelper.NextId(), - Code = dict3.GetValueOrDefault("quHuaDaiMa"), - CityCode = dict3.GetValueOrDefault("quhao"), + Code = countyItem.quHuaDaiMa, + CityCode = countyItem.quhao, Name = countyName, Pid = city.Id, Level = 3 }; + if (city.Code.IsNullOrEmpty()) + { + // 省直辖县级行政单位 节点无Code编码处理 + city.Code = county.Code.Substring(0, 3).PadRight(6, '0'); + } list.Add(county); } } + } + if (list.Count > 0) + { await _sysRegionRep.AsDeleteable().ExecuteCommandAsync(); await _sysRegionRep.Context.Fastest().BulkCopyAsync(list); } @@ -251,14 +261,14 @@ public class SysRegionService : IDynamicApiController, ITransient } // 获取选择数据 - async Task>> GetSelectList(string prov, string prefecture = null) + async Task GetSelectList(string prov, string prefecture = null) { var json = await _httpRemoteService.PostAsStringAsync("http://xzqh.mca.gov.cn/selectJson", builder => builder.SetJsonContent(new { shengji = prov, diji = prefecture, })); - return JSON.Deserialize>>(json); + return Clay.Parse(json); } } diff --git a/Admin.NET/Admin.NET.Core/Utils/VerifyFileExtensionName.cs b/Admin.NET/Admin.NET.Core/Utils/VerifyFileExtensionName.cs index 12c73bbc..2c8e8bee 100644 --- a/Admin.NET/Admin.NET.Core/Utils/VerifyFileExtensionName.cs +++ b/Admin.NET/Admin.NET.Core/Utils/VerifyFileExtensionName.cs @@ -109,7 +109,7 @@ public static class VerifyFileExtensionName foreach (var len in dic) { byte[] b = new byte[len]; - _ = stream.Read(b, 0, b.Length); + stream.ReadExactly(b); // string fileType = System.Text.Encoding.UTF8.GetString(b); string fileKey = GetFileHeader(b); if (DicsExt.ContainsKey(fileKey)) diff --git a/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj b/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj index 30ef2ad4..de625f1e 100644 --- a/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj +++ b/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj @@ -12,7 +12,7 @@ - + diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_List.vue.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_List.vue.vm index b342c30b..8d7c8805 100644 --- a/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_List.vue.vm +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/template/web_views_List.vue.vm @@ -272,6 +272,9 @@ const state = reactive({ @if(Model.QueryWhetherList.Count > 0) { @foreach (var column in Model.QueryWhetherList) { @:@(@column.LowerPropertyName): undefined, + @if(@column.EffectType == "DatePicker"){ + @:@(@column.LowerPropertyName)Range: undefined, + } } } }, diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj index 2c3486b7..1c792dc6 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj @@ -26,7 +26,7 @@ - + diff --git a/Web/package.json b/Web/package.json index 1eefec74..85da970c 100644 --- a/Web/package.json +++ b/Web/package.json @@ -2,7 +2,7 @@ "name": "admin.net.pro", "type": "module", "version": "2.4.33", - "lastBuildTime": "2025.04.05", + "lastBuildTime": "2025.04.10", "description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架", "author": "zuohuaijun", "license": "MIT", @@ -25,7 +25,7 @@ "@vue-office/docx": "^1.6.2", "@vue-office/excel": "^1.7.14", "@vue-office/pdf": "^2.0.9", - "@vueuse/core": "^13.0.0", + "@vueuse/core": "^13.1.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.12", "animate.css": "^4.1.1", @@ -53,7 +53,7 @@ "mqtt": "^5.10.4", "nprogress": "^0.2.0", "ol": "^10.5.0", - "pinia": "^3.0.1", + "pinia": "^3.0.2", "print-js": "^1.6.0", "push.js": "^1.0.12", "qrcodejs2-fixes": "^0.0.2", @@ -77,7 +77,7 @@ "vue-signature-pad": "^3.0.2", "vue3-flag-icons": "^0.0.3", "vue3-tree-org": "^4.2.2", - "vxe-pc-ui": "^4.5.12", + "vxe-pc-ui": "^4.5.16", "vxe-table": "^4.12.5", "vxe-table-plugin-element": "^4.0.4", "vxe-table-plugin-export-xlsx": "^4.0.7", @@ -91,8 +91,8 @@ "@types/node": "^20.17.30", "@types/nprogress": "^0.2.3", "@types/sortablejs": "^1.15.8", - "@typescript-eslint/eslint-plugin": "^8.29.0", - "@typescript-eslint/parser": "^8.29.0", + "@typescript-eslint/eslint-plugin": "^8.29.1", + "@typescript-eslint/parser": "^8.29.1", "@vitejs/plugin-vue": "^5.2.3", "@vitejs/plugin-vue-jsx": "^4.1.2", "@vue/compiler-sfc": "^3.5.13", @@ -101,7 +101,7 @@ "eslint-plugin-vue": "^10.0.0", "globals": "^16.0.0", "less": "^4.3.0", - "openapi-ts-request": "^1.3.0", + "openapi-ts-request": "^1.3.1", "prettier": "^3.5.3", "rollup-plugin-visualizer": "^5.14.0", "sass": "^1.86.3", diff --git a/Web/src/views/system/menu/index.vue b/Web/src/views/system/menu/index.vue index 2ae688b7..f5bfa13a 100644 --- a/Web/src/views/system/menu/index.vue +++ b/Web/src/views/system/menu/index.vue @@ -70,7 +70,7 @@ - + @@ -131,7 +131,11 @@ const options = useVxeTable( // 工具栏配置 toolbarConfig: { export: false }, // 树形配置 - treeConfig: { expandAll: false }, + treeConfig: { expandAll: false, reserve: true }, + // 行配置信息 + rowConfig: { + keyField: 'id', + }, } ); diff --git a/Web/src/views/system/role/component/grantApi.vue b/Web/src/views/system/role/component/grantApi.vue index ef159d77..44b19aac 100644 --- a/Web/src/views/system/role/component/grantApi.vue +++ b/Web/src/views/system/role/component/grantApi.vue @@ -134,7 +134,7 @@ const cancel = () => { // 授权角色接口资源 const submit = async () => { - state.ownApiList = treeRef.value?.getCheckedKeys() as Array; + state.ownApiList = treeRef.value?.getCheckedKeys(true) as Array; await getAPI(SysRoleApi).apiSysRoleGrantApiPost({ id: state.roleId, apiList: state.ownApiList }); cancel(); }; diff --git a/Web/src/views/system/role/component/grantMenu.vue b/Web/src/views/system/role/component/grantMenu.vue index 4126315f..3c385ebf 100644 --- a/Web/src/views/system/role/component/grantMenu.vue +++ b/Web/src/views/system/role/component/grantMenu.vue @@ -97,7 +97,7 @@ const cancel = () => { // 提交 const submit = async () => { - state.menuIdList = treeRef.value?.getCheckedKeys() as Array; //.concat(treeRef.value?.getHalfCheckedKeys()); + state.menuIdList = treeRef.value?.getCheckedKeys(true) as Array; //.concat(treeRef.value?.getHalfCheckedKeys()); await getAPI(SysRoleApi).apiSysRoleGrantMenuPost({ id: state.roleId, menuIdList: state.menuIdList }); cancel(); }; diff --git a/Web/src/views/system/role/component/grantTable.vue b/Web/src/views/system/role/component/grantTable.vue index 4b188b32..cf5c46f5 100644 --- a/Web/src/views/system/role/component/grantTable.vue +++ b/Web/src/views/system/role/component/grantTable.vue @@ -87,7 +87,7 @@ const cancel = () => { // 提交 const submit = async () => { - state.tableColumnList = treeRef.value?.getCheckedKeys() as Array; //.concat(treeRef.value?.getHalfCheckedKeys()); + state.tableColumnList = treeRef.value?.getCheckedKeys(true) as Array; //.concat(treeRef.value?.getHalfCheckedKeys()); await getAPI(SysRoleApi).apiSysRoleGrantRoleTablePost({ id: state.roleId, tableColumnList: state.tableColumnList }); cancel(); }; diff --git a/Web/src/views/system/tenant/component/grantMenu.vue b/Web/src/views/system/tenant/component/grantMenu.vue index 62d6c199..2d10b825 100644 --- a/Web/src/views/system/tenant/component/grantMenu.vue +++ b/Web/src/views/system/tenant/component/grantMenu.vue @@ -91,7 +91,7 @@ const cancel = () => { // 提交 const submit = async () => { - state.ruleForm.menuIdList = treeRef.value?.getCheckedKeys() as Array; + state.ruleForm.menuIdList = treeRef.value?.getCheckedKeys(true) as Array; await getAPI(SysTenantApi).apiSysTenantGrantMenuPost(state.ruleForm); state.isShowDialog = false; };