Skip to content

Commit d2a6149

Browse files
lvchenjiaSeanHai
authored andcommitted
fix: fix issue #5, limit the display length of the text box content
1 parent d40a8de commit d2a6149

File tree

7 files changed

+50
-24
lines changed

7 files changed

+50
-24
lines changed

src/layout/components/admin/UserList.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ const columns = ref([
3939
{
4040
title: '用户名',
4141
key: 'userName',
42-
42+
ellipsis: {
43+
tooltip: true
44+
},
4345
},
4446
{
4547
title: '邮箱',
4648
key: 'email',
47-
49+
ellipsis: {
50+
tooltip: true
51+
},
4852
},
4953
{
5054
title: '用户角色',

src/views/alertPage/alert-config.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ const columns = ref([
5555
title: '名称',
5656
width: 'auto',
5757
key: 'name',
58+
ellipsis: {
59+
tooltip: true
60+
},
5861
},
5962
{
6063
title: '级别',
@@ -84,17 +87,25 @@ const columns = ref([
8487
title: '规则',
8588
width: 'auto',
8689
key: 'rule',
90+
ellipsis: {
91+
tooltip: true
92+
},
8793
},
8894
{
8995
title: '描述',
9096
width: 'auto',
9197
key: 'desc',
98+
ellipsis: {
99+
tooltip: true
100+
},
92101
},
93102
{
94103
title: '接收人',
95104
width: 'auto',
96105
key: 'alertUsers',
97-
106+
ellipsis: {
107+
tooltip: true
108+
},
98109
render: row => {
99110
return <span>{row.alertUsers.join('')}</span>
100111
},

src/views/alertPage/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ const columns = ref([
120120
title: '告警内容',
121121
width: 'auto',
122122
key: 'summary',
123+
ellipsis: {
124+
tooltip: true
125+
},
123126
},
124127
])
125128

src/views/alertPage/system-log.vue

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ const columns = ref([
8989
title: '访问者',
9090
width: 'auto',
9191
key: 'user',
92+
ellipsis: {
93+
tooltip: true
94+
},
9295
},
9396
{
9497
title: '模块',
@@ -99,7 +102,9 @@ const columns = ref([
99102
title: '操作',
100103
width: 'auto',
101104
key: 'method',
102-
105+
ellipsis: {
106+
tooltip: true
107+
},
103108
// render: (row) => {
104109
// return (
105110
// <span>{row.enable? '开启' : '关闭'}</span>
@@ -110,26 +115,16 @@ const columns = ref([
110115
title: '结果',
111116
width: 'auto',
112117
key: 'errorMsg',
118+
ellipsis: {
119+
tooltip: true
120+
},
113121
},
114122
{
115123
title: '内容',
116124
width: 'auto',
117125
key: 'content',
118-
render(row) {
119-
return (
120-
<NTooltip trigger='hover'>
121-
{{
122-
trigger: () => (
123-
<span>
124-
{row.content.length < 15
125-
? row.content
126-
: row.content.substring(0, 15) + '...'}
127-
</span>
128-
),
129-
default: () => <span>{row.content}</span>,
130-
}}
131-
</NTooltip>
132-
)
126+
ellipsis: {
127+
tooltip: true
133128
},
134129
},
135130
])

src/views/clusterManagement/DiskManagement.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ const columns = ref([
9292
title: '主机名',
9393
width: 'auto',
9494
key: 'hostName',
95-
95+
ellipsis: {
96+
tooltip: true
97+
},
9698
},
9799
{
98100
title: '盘符',
@@ -104,13 +106,17 @@ const columns = ref([
104106
title: '类型',
105107
width: 'auto',
106108
key: 'diskType',
107-
109+
ellipsis: {
110+
tooltip: true
111+
},
108112
},
109113
{
110114
title: '型号',
111115
width: 'auto',
112116
key: 'model',
113-
117+
ellipsis: {
118+
tooltip: true
119+
},
114120
},
115121
// {
116122
// title: '写缓存',
@@ -121,7 +127,9 @@ const columns = ref([
121127
title: '挂载点',
122128
key: 'mountPoint',
123129
width: 'auto',
124-
130+
ellipsis: {
131+
tooltip: true
132+
},
125133
render(row) {
126134
if (row.mountPoint) {
127135
return <span>{row.mountPoint}</span>

src/views/clusterManagement/ServerManagement.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ const columns = ref([
3737
title: '主机名',
3838
key: 'hostName',
3939
width: 'auto',
40-
40+
ellipsis: {
41+
tooltip: true
42+
},
4143
render(row) {
4244
return h(
4345
NButton,

src/views/storagePool/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const columns: DataTableColumns<StoragePoolInfo> = [
2323
title: '逻辑池名称',
2424
width: 'auto',
2525
key: 'name',
26+
ellipsis: {
27+
tooltip: true
28+
},
2629
render(row) {
2730
return h(
2831
NButton,

0 commit comments

Comments
 (0)