mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-08 07:31:09 +08:00
fix(monitor): 缩短过长操作系统名称显示
在在线用户和登录日志的表格列以及登录详情弹窗中,当操作系统字段包含“ or ”(如“Windows 10 or Windows Server 2016”)时,仅显示第一部分以优化表格显示宽度。完整的原始信息在详情中仍可查看。
This commit is contained in:
@@ -70,10 +70,20 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'os',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
/**
|
||||
* Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
|
||||
*/
|
||||
let value = row.os;
|
||||
if (value) {
|
||||
const split = value.split(' or ');
|
||||
if (split.length === 2) {
|
||||
value = split[0];
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div class="flex items-center justify-center gap-[6px]">
|
||||
{renderOsIcon(row.os, 'shrink-0')}
|
||||
{row.os}
|
||||
{value}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -31,6 +31,16 @@ const items = computed<DescriptionsProps['items']>(() => {
|
||||
return [];
|
||||
}
|
||||
const data = loginInfo.value;
|
||||
/**
|
||||
* Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
|
||||
*/
|
||||
let os = data.os;
|
||||
if (os) {
|
||||
const split = os.split(' or ');
|
||||
if (split.length === 2) {
|
||||
os = split[0]!;
|
||||
}
|
||||
}
|
||||
return [
|
||||
{
|
||||
label: '登录状态',
|
||||
@@ -66,7 +76,7 @@ const items = computed<DescriptionsProps['items']>(() => {
|
||||
content: (
|
||||
<div class="flex items-center justify-center gap-[6px]">
|
||||
{renderOsIcon(data.os, 'shrink-0')}
|
||||
{data.os}
|
||||
{os}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -58,10 +58,20 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'os',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
/**
|
||||
* Windows 10 or Windows Server 2016 太长了 分割一下 详情依旧能看到详细的
|
||||
*/
|
||||
let value = row.os;
|
||||
if (value) {
|
||||
const split = value.split(' or ');
|
||||
if (split.length === 2) {
|
||||
value = split[0];
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div class="flex items-center justify-center gap-[6px]">
|
||||
{renderOsIcon(row.os, 'shrink-0')}
|
||||
{row.os}
|
||||
{value}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user