😎1、修复在线用户redis模式报错 2、增加字典组件select模式过滤 3、升级依赖
This commit is contained in:
parent
72e699bbc0
commit
b2be0d3160
@ -28,9 +28,9 @@
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" Aliases="BouncyCastleV2" />
|
||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="9.1.4" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.109" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.109" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.7.109" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.110" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.110" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.7.110" />
|
||||
<PackageReference Include="Hardware.Info" Version="101.0.1.1" />
|
||||
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||
|
||||
@ -66,7 +66,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
|
||||
await _onlineUserHubContext.Groups.AddToGroupAsync(Context.ConnectionId, groupName);
|
||||
|
||||
// 更新在线用户列表
|
||||
var userList = SysCacheService.HashGetAll<OnlineUser>(CacheConst.KeyUserOnline).Where(u => u.Value.TenantId == tenantId).Select(u => u.Value).ToList();
|
||||
var userList = SysCacheService.HashGetAll<OnlineUser>(CacheConst.KeyUserOnline).Values.Where(u => u.TenantId == tenantId).ToList();
|
||||
await _onlineUserHubContext.Clients.Groups(groupName).OnlineUserList(new OnlineUserList
|
||||
{
|
||||
RealName = user.RealName,
|
||||
@ -90,7 +90,7 @@ public class OnlineUserHub : Hub<IOnlineUserHub>
|
||||
SysCacheService.HashDel<OnlineUser>(CacheConst.KeyUserOnline, Context.ConnectionId);
|
||||
|
||||
// 更新在线用户列表
|
||||
var userList = SysCacheService.HashGetAll<OnlineUser>(CacheConst.KeyUserOnline).Where(u => u.Value.TenantId == user.TenantId).Select(u => u.Value).ToList();
|
||||
var userList = SysCacheService.HashGetAll<OnlineUser>(CacheConst.KeyUserOnline).Values.Where(u => u.TenantId == user.TenantId).ToList();
|
||||
await _onlineUserHubContext.Clients.Groups($"{GROUP_ONLINE}{user.TenantId}").OnlineUserList(new OnlineUserList
|
||||
{
|
||||
RealName = user.RealName,
|
||||
|
||||
@ -47,11 +47,11 @@ public static class SqlSugarSetup
|
||||
// 初始化SqlSugar
|
||||
SqlSugarScope sqlSugar = new(dbOptions.ConnectionConfigs.Adapt<List<ConnectionConfig>>(), db =>
|
||||
{
|
||||
dbOptions.ConnectionConfigs.ForEach(config =>
|
||||
dbOptions.ConnectionConfigs.ForEach(dbConfig =>
|
||||
{
|
||||
var dbProvider = db.GetConnectionScope(config.ConfigId);
|
||||
var dbProvider = db.GetConnectionScope(dbConfig.ConfigId);
|
||||
SetDbAop(dbProvider, dbOptions.EnableConsoleSql);
|
||||
SetDbDiffLog(dbProvider, config);
|
||||
SetDbDiffLog(dbProvider, dbConfig);
|
||||
});
|
||||
});
|
||||
ITenant = sqlSugar;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2025.08.18",
|
||||
"lastBuildTime": "2025.08.19",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -25,7 +25,7 @@
|
||||
"@vue-office/docx": "^1.6.3",
|
||||
"@vue-office/excel": "^1.7.14",
|
||||
"@vue-office/pdf": "^2.0.10",
|
||||
"@vueuse/core": "^13.6.0",
|
||||
"@vueuse/core": "^13.7.0",
|
||||
"@vxe-ui/plugin-export-xlsx": "^4.3.0",
|
||||
"@vxe-ui/plugin-render-element": "^4.1.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
@ -80,8 +80,8 @@
|
||||
"vue-router": "^4.5.1",
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vxe-pc-ui": "^4.8.20",
|
||||
"vxe-table": "^4.15.9",
|
||||
"vxe-pc-ui": "^4.8.22",
|
||||
"vxe-table": "^4.15.10",
|
||||
"xe-utils": "^3.7.8",
|
||||
"xlsx-js-style": "^1.2.0"
|
||||
},
|
||||
@ -92,25 +92,25 @@
|
||||
"@types/node": "^22.17.2",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
||||
"@typescript-eslint/parser": "^8.39.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.40.0",
|
||||
"@typescript-eslint/parser": "^8.40.0",
|
||||
"@vitejs/plugin-vue": "^6.0.1",
|
||||
"@vitejs/plugin-vue-jsx": "^5.0.1",
|
||||
"@vue/compiler-sfc": "^3.5.18",
|
||||
"cli-progress": "^3.12.0",
|
||||
"code-inspector-plugin": "^1.2.1",
|
||||
"code-inspector-plugin": "^1.2.2",
|
||||
"colors": "^1.4.0",
|
||||
"dotenv": "^17.2.1",
|
||||
"eslint": "^9.33.0",
|
||||
"eslint-plugin-vue": "^10.4.0",
|
||||
"globals": "^16.3.0",
|
||||
"less": "^4.4.0",
|
||||
"less": "^4.4.1",
|
||||
"prettier": "^3.6.2",
|
||||
"rollup-plugin-visualizer": "^6.0.3",
|
||||
"sass": "^1.90.0",
|
||||
"terser": "^5.43.1",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "^7.1.2",
|
||||
"vite": "^7.1.3",
|
||||
"vite-auto-i18n-plugin": "^1.1.7",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-compression2": "^2.2.0",
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @constant
|
||||
*/
|
||||
const RENDER_TYPES = ['tag', 'select', 'radio', 'checkbox', 'radio-button'] as const;
|
||||
type RenderType = typeof RENDER_TYPES[number];
|
||||
type RenderType = (typeof RENDER_TYPES)[number];
|
||||
|
||||
/**
|
||||
* 支持的标签类型常量
|
||||
@ -24,7 +24,7 @@ type RenderType = typeof RENDER_TYPES[number];
|
||||
* @constant
|
||||
*/
|
||||
const TAG_TYPES = ['success', 'warning', 'info', 'primary', 'danger'] as const;
|
||||
type TagType = typeof TAG_TYPES[number];
|
||||
type TagType = (typeof TAG_TYPES)[number];
|
||||
|
||||
/**
|
||||
* 字典项数据结构
|
||||
@ -218,13 +218,11 @@ const props = defineProps({
|
||||
* @returns {DictItem[]} - 过滤并格式化后的字典数据
|
||||
*/
|
||||
const formattedDictData = computed(() => {
|
||||
return state.dictData
|
||||
.filter(props.onItemFilter)
|
||||
.map(item => ({
|
||||
...item,
|
||||
label: item[props.propLabel],
|
||||
value: item[props.propValue],
|
||||
}));
|
||||
return state.dictData.filter(props.onItemFilter).map((item) => ({
|
||||
...item,
|
||||
label: item[props.propLabel],
|
||||
value: item[props.propValue],
|
||||
}));
|
||||
});
|
||||
|
||||
/**
|
||||
@ -238,12 +236,10 @@ const currentDictItems = computed(() => {
|
||||
if (Array.isArray(state.value)) {
|
||||
// 确保回显时也去重
|
||||
const uniqueValues = [...new Set(state.value)];
|
||||
return formattedDictData.value.filter(item =>
|
||||
uniqueValues.includes(item.value)
|
||||
);
|
||||
return formattedDictData.value.filter((item) => uniqueValues.includes(item.value));
|
||||
}
|
||||
|
||||
return formattedDictData.value.find(item => item.value == state.value) || null;
|
||||
return formattedDictData.value.find((item) => item.value == state.value) || null;
|
||||
});
|
||||
|
||||
/**
|
||||
@ -260,9 +256,7 @@ const getDataList = (): DictItem[] => {
|
||||
}
|
||||
|
||||
const source = props.isConst ? userStore.constList : userStore.dictList;
|
||||
const data = props.isConst
|
||||
? source?.find((x: any) => x.code === props.code)?.data?.result ?? []
|
||||
: source[props.code] ?? [];
|
||||
const data = props.isConst ? (source?.find((x: any) => x.code === props.code)?.data?.result ?? []) : (source[props.code] ?? []);
|
||||
|
||||
return data.map((item: any) => ({
|
||||
...item,
|
||||
@ -282,7 +276,7 @@ const getDataList = (): DictItem[] => {
|
||||
*/
|
||||
const processNumericValues = (value: any) => {
|
||||
if (typeof value === 'number' || (Array.isArray(value) && typeof value[0] === 'number')) {
|
||||
state.dictData.forEach(item => {
|
||||
state.dictData.forEach((item) => {
|
||||
if (!isEmpty(item.value)) {
|
||||
item.value = Number(item.value);
|
||||
}
|
||||
@ -324,11 +318,14 @@ const parseMultipleValue = (value: any): any => {
|
||||
// 处理逗号分隔格式
|
||||
if (props.multipleModel === MultipleModel.Comma && trimmedValue.includes(',')) {
|
||||
// 去重处理
|
||||
return [...new Set(
|
||||
trimmedValue.split(',')
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean)
|
||||
)];
|
||||
return [
|
||||
...new Set(
|
||||
trimmedValue
|
||||
.split(',')
|
||||
.map((item) => item.trim())
|
||||
.filter(Boolean)
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
// 处理单个值情况
|
||||
@ -353,7 +350,7 @@ const updateValue = (newValue: any) => {
|
||||
// 先对值进行去重处理
|
||||
let processedValue = newValue;
|
||||
if (Array.isArray(newValue)) {
|
||||
processedValue = [...new Set(newValue.filter(v => v !== null && v !== undefined && v !== ''))];
|
||||
processedValue = [...new Set(newValue.filter((v) => v !== null && v !== undefined && v !== ''))];
|
||||
}
|
||||
|
||||
let emitValue = processedValue;
|
||||
@ -377,7 +374,7 @@ const updateValue = (newValue: any) => {
|
||||
* @returns {TagType} - 合法的标签类型
|
||||
*/
|
||||
const ensureTagType = (item: DictItem): TagType => {
|
||||
return TAG_TYPES.includes(item.tagType as TagType) ? item.tagType as TagType : 'primary';
|
||||
return TAG_TYPES.includes(item.tagType as TagType) ? (item.tagType as TagType) : 'primary';
|
||||
};
|
||||
|
||||
/**
|
||||
@ -416,9 +413,12 @@ const state = reactive({
|
||||
});
|
||||
|
||||
// 监听数据变化
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
state.value = parseMultipleValue(newValue);
|
||||
});
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(newValue) => {
|
||||
state.value = parseMultipleValue(newValue);
|
||||
}
|
||||
);
|
||||
|
||||
watch(() => [userStore.dictList, userStore.constList], initData, { immediate: true });
|
||||
</script>
|
||||
@ -440,7 +440,7 @@ watch(() => [userStore.dictList, userStore.constList], initData, { immediate: tr
|
||||
</template>
|
||||
|
||||
<!-- 渲染选择器 -->
|
||||
<el-select v-else-if="props.renderAs === 'select'" v-model="state.value" v-bind="$attrs" :multiple="props.multiple" @change="updateValue" clearable>
|
||||
<el-select v-else-if="props.renderAs === 'select'" v-model="state.value" v-bind="$attrs" :multiple="props.multiple" @change="updateValue" filterable clearable>
|
||||
<el-option v-for="(item, index) in formattedDictData" :key="index" :label="getDisplayText(item)" :value="item.value" />
|
||||
</el-select>
|
||||
|
||||
@ -465,4 +465,4 @@ watch(() => [userStore.dictList, userStore.constList], initData, { immediate: tr
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user