😎1、修复代码生成字典处理 2、优化菜单添加和更新逻辑 3、升级依赖和更新前端请求文件
This commit is contained in:
parent
c1240eb550
commit
9495569172
@ -6,7 +6,8 @@
|
|||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning",
|
"Microsoft.AspNetCore": "Warning",
|
||||||
"Microsoft.EntityFrameworkCore": "Information",
|
"Microsoft.EntityFrameworkCore": "Information",
|
||||||
"AspNetCoreRateLimit": "None"
|
"AspNetCoreRateLimit": "None",
|
||||||
|
"System.Net.Http.HttpClient": "Error"
|
||||||
},
|
},
|
||||||
"File": {
|
"File": {
|
||||||
"Enabled": false, // 启用文件日志
|
"Enabled": false, // 启用文件日志
|
||||||
|
|||||||
@ -40,14 +40,14 @@
|
|||||||
<PackageReference Include="QRCoder" Version="1.6.0" />
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
<PackageReference Include="RabbitMQ.Client" Version="7.0.0" />
|
<PackageReference Include="RabbitMQ.Client" Version="7.0.0" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
|
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.3" />
|
||||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.9" />
|
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.116.0" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.6.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.Api" Version="3.6.0" />
|
||||||
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.9.0" />
|
<PackageReference Include="SKIT.FlurlHttpClient.Wechat.TenpayV3" Version="3.9.0" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
||||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.9" />
|
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.9" />
|
||||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1133" />
|
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1135" />
|
||||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@ -218,8 +218,16 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
var entityType = provider.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == tableName);
|
var entityType = provider.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == tableName);
|
||||||
if (entityType == null) return null;
|
if (entityType == null) return null;
|
||||||
var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenant)];
|
var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenant)];
|
||||||
|
var properties = GetEntityInfos().Result.First(u => u.DbTableName == tableName).Type.GetProperties()
|
||||||
|
.Where(e => e.GetCustomAttribute<SugarColumn>()?.IsIgnore == false).Select(u => new
|
||||||
|
{
|
||||||
|
PropertyName = u.Name,
|
||||||
|
ColumnComment = u.GetCustomAttribute<SugarColumn>()?.ColumnDescription,
|
||||||
|
ColumnName = u.GetCustomAttribute<SugarColumn>()?.ColumnName ?? u.Name
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
// 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null)
|
// 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null)
|
||||||
return provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput
|
var columnList = provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput
|
||||||
{
|
{
|
||||||
ColumnName = config.DbSettings.EnableUnderLine ? CodeGenUtil.CamelColumnName(u.DbColumnName, entityBasePropertyNames) : u.DbColumnName,
|
ColumnName = config.DbSettings.EnableUnderLine ? CodeGenUtil.CamelColumnName(u.DbColumnName, entityBasePropertyNames) : u.DbColumnName,
|
||||||
ColumnKey = u.IsPrimarykey.ToString(),
|
ColumnKey = u.IsPrimarykey.ToString(),
|
||||||
@ -227,6 +235,13 @@ public class SysCodeGenService : IDynamicApiController, ITransient
|
|||||||
NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType),
|
NetType = CodeGenUtil.ConvertDataType(u, provider.CurrentConnectionConfig.DbType),
|
||||||
ColumnComment = u.ColumnDescription
|
ColumnComment = u.ColumnDescription
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
foreach (var column in columnList)
|
||||||
|
{
|
||||||
|
var property = properties.First(u => u.ColumnName == column.ColumnName);
|
||||||
|
column.ColumnComment ??= property?.ColumnComment;
|
||||||
|
column.PropertyName = property?.PropertyName;
|
||||||
|
}
|
||||||
|
return columnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -116,7 +116,7 @@ public class SysMenuService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
var isExist = input.Type != MenuTypeEnum.Btn
|
var isExist = input.Type != MenuTypeEnum.Btn
|
||||||
? await _sysMenuRep.IsAnyAsync(u => u.Title == input.Title && u.Pid == input.Pid)
|
? await _sysMenuRep.IsAnyAsync(u => u.Title == input.Title && u.Pid == input.Pid)
|
||||||
: await _sysMenuRep.IsAnyAsync(u => u.Permission == input.Permission && u.Pid == input.Pid);
|
: await _sysMenuRep.IsAnyAsync(u => u.Permission == input.Permission);
|
||||||
if (isExist)
|
if (isExist)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D4000);
|
throw Oops.Oh(ErrorCodeEnum.D4000);
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ public class SysMenuService : IDynamicApiController, ITransient
|
|||||||
|
|
||||||
var isExist = input.Type != MenuTypeEnum.Btn
|
var isExist = input.Type != MenuTypeEnum.Btn
|
||||||
? await _sysMenuRep.IsAnyAsync(u => u.Title == input.Title && u.Type == input.Type && u.Pid == input.Pid && u.Id != input.Id)
|
? await _sysMenuRep.IsAnyAsync(u => u.Title == input.Title && u.Type == input.Type && u.Pid == input.Pid && u.Id != input.Id)
|
||||||
: await _sysMenuRep.IsAnyAsync(u => u.Permission == input.Permission && u.Type == input.Type && u.Pid == input.Pid && u.Id != input.Id);
|
: await _sysMenuRep.IsAnyAsync(u => u.Permission == input.Permission && u.Id != input.Id);
|
||||||
if (isExist)
|
if (isExist)
|
||||||
throw Oops.Oh(ErrorCodeEnum.D4000);
|
throw Oops.Oh(ErrorCodeEnum.D4000);
|
||||||
|
|
||||||
|
|||||||
@ -327,6 +327,26 @@ public class SysOrgService : IDynamicApiController, ITransient
|
|||||||
return await GetUserOrgIdList(roleList, userId, userOrgId);
|
return await GetUserOrgIdList(roleList, userId, userOrgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判定用户是否有某角色权限
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="role">角色代码</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[NonAction]
|
||||||
|
public async Task<bool> GetUserHasRole(long userId, SysRole role)
|
||||||
|
{
|
||||||
|
if (_userManager.SuperAdmin) return true;
|
||||||
|
|
||||||
|
var userOrgId = _userManager.OrgId;
|
||||||
|
var roleList = await _sysUserRoleService.GetUserRoleList(userId);
|
||||||
|
if (roleList != null && roleList.Exists(r => r.Code == role.Code)) return true;
|
||||||
|
|
||||||
|
roleList = new List<SysRole> { role };
|
||||||
|
var orgIds = await GetUserOrgIdList(roleList, userId, userOrgId);
|
||||||
|
return orgIds.Contains(userOrgId);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据角色Id集合获取机构Id集合
|
/// 根据角色Id集合获取机构Id集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -54,11 +54,14 @@ public class SysRoleService : IDynamicApiController, ITransient
|
|||||||
[DisplayName("获取角色分页列表")]
|
[DisplayName("获取角色分页列表")]
|
||||||
public async Task<SqlSugarPagedList<PageRoleOutput>> Page(PageRoleInput input)
|
public async Task<SqlSugarPagedList<PageRoleOutput>> Page(PageRoleInput input)
|
||||||
{
|
{
|
||||||
|
// 当前用户已拥有的角色集合
|
||||||
|
var roleIdList = _userManager.SuperAdmin ? new List<long>() : await _sysUserRoleService.GetUserRoleIdList(_userManager.UserId);
|
||||||
|
|
||||||
return await _sysRoleRep.AsQueryable()
|
return await _sysRoleRep.AsQueryable()
|
||||||
.LeftJoin<SysTenant>((u, a) => u.TenantId == a.Id)
|
.LeftJoin<SysTenant>((u, a) => u.TenantId == a.Id)
|
||||||
.LeftJoin<SysOrg>((u, a, b) => a.OrgId == b.Id)
|
.LeftJoin<SysOrg>((u, a, b) => a.OrgId == b.Id)
|
||||||
.WhereIF(!_userManager.SuperAdmin, u => u.TenantId == _userManager.TenantId) // 若非超管,则只能操作本租户的角色
|
.WhereIF(!_userManager.SuperAdmin, u => u.TenantId == _userManager.TenantId) // 若非超管,则只能操作本租户的角色
|
||||||
.WhereIF(!_userManager.SuperAdmin && !_userManager.SysAdmin, u => u.CreateUserId == _userManager.UserId) // 若非超管且非系统管理员,则只能操作自己创建的角色
|
.WhereIF(!_userManager.SuperAdmin && !_userManager.SysAdmin, u => u.CreateUserId == _userManager.UserId || roleIdList.Contains(u.Id)) // 若非超管且非系统管理员,则只能操作自己创建的角色
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
|
||||||
.Select((u, a, b) => new PageRoleOutput
|
.Select((u, a, b) => new PageRoleOutput
|
||||||
|
|||||||
@ -186,18 +186,12 @@
|
|||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from "element-plus";
|
import { ElMessageBox, ElMessage } from "element-plus";
|
||||||
import { auth } from '/@@/utils/authFunction';
|
import { auth } from '/@@/utils/authFunction';
|
||||||
import { useUserInfo } from '/@/stores/userInfo';
|
import { useUserInfo } from '/@@/stores/userInfo';
|
||||||
|
|
||||||
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@@/hooks/useVxeTableOptionsHook';
|
import { useVxeTable } from '/@@/hooks/useVxeTableOptionsHook';
|
||||||
import { Local } from '/@@/utils/storage';
|
import { Local } from '/@@/utils/storage';
|
||||||
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
|
||||||
@:import { codeToName, getConstType } from "/@@/utils/constHelper";
|
|
||||||
}
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "DictSelector") || @Model.TableField.Any(x=>x.EffectType == "EnumSelector")){
|
|
||||||
@:import { getDictLabelByCode as dc, getDictLabelByVal as dv, getDictDataList as dl } from '/@@/utils/dict-utils';
|
|
||||||
}
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "DatePicker")){
|
@if(@Model.TableField.Any(x=>x.EffectType == "DatePicker")){
|
||||||
@:import { formatDate } from '/@@/utils/formatTime';
|
@:import { formatDate } from '/@@/utils/formatTime';
|
||||||
}
|
}
|
||||||
@ -242,6 +236,15 @@ const xGrid = ref<VxeGridInstance>();
|
|||||||
const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
const editDialogRef = ref<InstanceType<typeof EditDialog>>();
|
||||||
const userStore = useUserInfo();
|
const userStore = useUserInfo();
|
||||||
|
|
||||||
|
@if(@Model.TableField.Any(x=>x.EffectType == "ConstSelector")){
|
||||||
|
@:const codeToName = userStore.codeToName;
|
||||||
|
}
|
||||||
|
@if(@Model.TableField.Any(x=>x.EffectType == "DictSelector") || @Model.TableField.Any(x=>x.EffectType == "EnumSelector")){
|
||||||
|
@:const dc = userStore.getDictItemByCode;
|
||||||
|
@:const dv = userStore.getDictLabelByVal;
|
||||||
|
@:const dl = userStore.getDictDataByCode;
|
||||||
|
}
|
||||||
|
|
||||||
// 变量
|
// 变量
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
showAdvanceQueryUI: false,
|
showAdvanceQueryUI: false,
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.2.0" />
|
<PackageReference Include="DocumentFormat.OpenXml" Version="3.2.0" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.12.0" />
|
||||||
<PackageReference Include="Rezero.Api" Version="1.7.12" />
|
<PackageReference Include="Rezero.Api" Version="1.7.12" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "admin.net.pro",
|
"name": "admin.net.pro",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.4.33",
|
"version": "2.4.33",
|
||||||
"lastBuildTime": "2024.12.03",
|
"lastBuildTime": "2024.12.04",
|
||||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||||
"author": "zuohuaijun",
|
"author": "zuohuaijun",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"async-validator": "^4.2.5",
|
"async-validator": "^4.2.5",
|
||||||
"axios": "^1.7.8",
|
"axios": "^1.7.9",
|
||||||
"countup.js": "^2.8.0",
|
"countup.js": "^2.8.0",
|
||||||
"cropperjs": "^1.6.2",
|
"cropperjs": "^1.6.2",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
@ -51,7 +51,7 @@
|
|||||||
"mqtt": "^5.10.3",
|
"mqtt": "^5.10.3",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"ol": "^10.3.0",
|
"ol": "^10.3.0",
|
||||||
"pinia": "^2.2.8",
|
"pinia": "^2.3.0",
|
||||||
"print-js": "^1.6.0",
|
"print-js": "^1.6.0",
|
||||||
"push.js": "^1.0.12",
|
"push.js": "^1.0.12",
|
||||||
"qrcodejs2-fixes": "^0.0.2",
|
"qrcodejs2-fixes": "^0.0.2",
|
||||||
@ -74,7 +74,7 @@
|
|||||||
"vue-router": "^4.5.0",
|
"vue-router": "^4.5.0",
|
||||||
"vue-signature-pad": "^3.0.2",
|
"vue-signature-pad": "^3.0.2",
|
||||||
"vue3-tree-org": "^4.2.2",
|
"vue3-tree-org": "^4.2.2",
|
||||||
"vxe-pc-ui": "^4.3.12",
|
"vxe-pc-ui": "^4.3.14",
|
||||||
"vxe-table": "^4.8.10",
|
"vxe-table": "^4.8.10",
|
||||||
"vxe-table-plugin-element": "^4.0.4",
|
"vxe-table-plugin-element": "^4.0.4",
|
||||||
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||||
@ -88,8 +88,8 @@
|
|||||||
"@types/node": "^20.17.9",
|
"@types/node": "^20.17.9",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
||||||
"@typescript-eslint/parser": "^8.16.0",
|
"@typescript-eslint/parser": "^8.17.0",
|
||||||
"@vitejs/plugin-vue": "^5.2.1",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||||
"@vue/compiler-sfc": "^3.5.13",
|
"@vue/compiler-sfc": "^3.5.13",
|
||||||
@ -98,9 +98,9 @@
|
|||||||
"eslint-plugin-vue": "^9.32.0",
|
"eslint-plugin-vue": "^9.32.0",
|
||||||
"globals": "^15.13.0",
|
"globals": "^15.13.0",
|
||||||
"less": "^4.2.1",
|
"less": "^4.2.1",
|
||||||
"prettier": "^3.4.1",
|
"prettier": "^3.4.2",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"sass": "^1.81.0",
|
"sass": "^1.82.0",
|
||||||
"terser": "^5.36.0",
|
"terser": "^5.36.0",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.2",
|
||||||
"vite": "^6.0.2",
|
"vite": "^6.0.2",
|
||||||
|
|||||||
@ -135,7 +135,7 @@ export interface AddOrgInput {
|
|||||||
longitude?: number;
|
longitude?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof AddOrgInput
|
* @memberof AddOrgInput
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export interface AddRegionInput {
|
|||||||
longitude?: number;
|
longitude?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof AddRegionInput
|
* @memberof AddRegionInput
|
||||||
|
|||||||
@ -82,6 +82,30 @@ export interface CodeGenInput {
|
|||||||
*/
|
*/
|
||||||
descStr?: string | null;
|
descStr?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库表名
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CodeGenInput
|
||||||
|
*/
|
||||||
|
tableName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务名(业务代码包名称)
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CodeGenInput
|
||||||
|
*/
|
||||||
|
busName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 命名空间
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CodeGenInput
|
||||||
|
*/
|
||||||
|
nameSpace?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者姓名
|
* 作者姓名
|
||||||
*
|
*
|
||||||
@ -90,6 +114,30 @@ export interface CodeGenInput {
|
|||||||
*/
|
*/
|
||||||
authorName?: string | null;
|
authorName?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成方式
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CodeGenInput
|
||||||
|
*/
|
||||||
|
generateType?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否生成菜单
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CodeGenInput
|
||||||
|
*/
|
||||||
|
generateMenu?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用 Api Service
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CodeGenInput
|
||||||
|
*/
|
||||||
|
isApiService?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类名
|
* 类名
|
||||||
*
|
*
|
||||||
@ -138,38 +186,6 @@ export interface CodeGenInput {
|
|||||||
*/
|
*/
|
||||||
connectionString?: string | null;
|
connectionString?: string | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成方式
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof CodeGenInput
|
|
||||||
*/
|
|
||||||
generateType?: string | null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据库表名
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof CodeGenInput
|
|
||||||
*/
|
|
||||||
tableName?: string | null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 命名空间
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof CodeGenInput
|
|
||||||
*/
|
|
||||||
nameSpace?: string | null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务名(业务代码包名称)
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof CodeGenInput
|
|
||||||
*/
|
|
||||||
busName?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能名(数据库表名称)
|
* 功能名(数据库表名称)
|
||||||
*
|
*
|
||||||
@ -186,14 +202,6 @@ export interface CodeGenInput {
|
|||||||
*/
|
*/
|
||||||
menuApplication?: string | null;
|
menuApplication?: string | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否生成菜单
|
|
||||||
*
|
|
||||||
* @type {boolean}
|
|
||||||
* @memberof CodeGenInput
|
|
||||||
*/
|
|
||||||
generateMenu?: boolean;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单父级
|
* 菜单父级
|
||||||
*
|
*
|
||||||
@ -233,12 +241,4 @@ export interface CodeGenInput {
|
|||||||
* @memberof CodeGenInput
|
* @memberof CodeGenInput
|
||||||
*/
|
*/
|
||||||
printName?: string | null;
|
printName?: string | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否使用 Api Service
|
|
||||||
*
|
|
||||||
* @type {boolean}
|
|
||||||
* @memberof CodeGenInput
|
|
||||||
*/
|
|
||||||
isApiService?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ export interface LogVisOutput {
|
|||||||
longitude?: number | null;
|
longitude?: number | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof LogVisOutput
|
* @memberof LogVisOutput
|
||||||
|
|||||||
@ -150,7 +150,7 @@ export interface SysLogEx {
|
|||||||
longitude?: number | null;
|
longitude?: number | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysLogEx
|
* @memberof SysLogEx
|
||||||
|
|||||||
@ -150,7 +150,7 @@ export interface SysLogOp {
|
|||||||
longitude?: number | null;
|
longitude?: number | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysLogOp
|
* @memberof SysLogOp
|
||||||
|
|||||||
@ -150,7 +150,7 @@ export interface SysLogVis {
|
|||||||
longitude?: number | null;
|
longitude?: number | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysLogVis
|
* @memberof SysLogVis
|
||||||
|
|||||||
@ -151,7 +151,7 @@ export interface SysOrg {
|
|||||||
longitude?: number;
|
longitude?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysOrg
|
* @memberof SysOrg
|
||||||
|
|||||||
@ -118,7 +118,7 @@ export interface SysRegion {
|
|||||||
longitude?: number;
|
longitude?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof SysRegion
|
* @memberof SysRegion
|
||||||
|
|||||||
@ -135,7 +135,7 @@ export interface UpdateOrgInput {
|
|||||||
longitude?: number;
|
longitude?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof UpdateOrgInput
|
* @memberof UpdateOrgInput
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export interface UpdateRegionInput {
|
|||||||
longitude?: number;
|
longitude?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维度
|
* 纬度
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof UpdateRegionInput
|
* @memberof UpdateRegionInput
|
||||||
|
|||||||
@ -15,10 +15,10 @@ const { t } = i18n.global;
|
|||||||
*/
|
*/
|
||||||
export const useUserInfo = defineStore('userInfo', {
|
export const useUserInfo = defineStore('userInfo', {
|
||||||
state: (): UserInfosState => ({
|
state: (): UserInfosState => ({
|
||||||
userInfos: {} as any,
|
userInfos: {} as any, // 用户信息
|
||||||
constList: [] as any,
|
constList: [] as any, // 常量列表
|
||||||
dictList: {} as any,
|
dictList: {} as any, // 字典列表
|
||||||
userTableList: [] as any, // 用户表格字段数据
|
userTableList: [] as any, // 用户表格字段列表
|
||||||
}),
|
}),
|
||||||
getters: {},
|
getters: {},
|
||||||
actions: {
|
actions: {
|
||||||
@ -135,6 +135,39 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
getDictDataByCode(dictTypeCode: string) {
|
getDictDataByCode(dictTypeCode: string) {
|
||||||
return this.dictList[dictTypeCode] || [];
|
return this.dictList[dictTypeCode] || [];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 根据字典类型和代码取字典项
|
||||||
|
getDictItemByCode(typePCode: string, code: string) {
|
||||||
|
if (code != undefined && code !== '') {
|
||||||
|
const _code = code.toString();
|
||||||
|
const ds = this.getDictDataByCode(typePCode);
|
||||||
|
for (const element of ds) {
|
||||||
|
if (element.code === _code) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
|
||||||
|
// 根据字典类型和值取描述
|
||||||
|
getDictLabelByVal(typePCode: string, val: string) {
|
||||||
|
if (val != undefined && val !== '') {
|
||||||
|
const _val = val.toString();
|
||||||
|
const ds = this.getDictDataByCode(typePCode);
|
||||||
|
for (const element of ds) {
|
||||||
|
if (element.value === _val) {
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
|
||||||
|
// 常量编码和名称转换
|
||||||
|
codeToName(code: any, type: any) {
|
||||||
|
return this.constList.find((x: any) => x.code === type).data.result.find((x: any) => x.code === code)?.name;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user