51
51
type =" primary"
52
52
icon =" plus"
53
53
@click =" handleAdd()"
54
- >新建 </a-button >
54
+ >新建
55
+ </a-button >
55
56
</div >
56
57
</div >
57
58
72
73
>
73
74
<template #menu-title-slot =" text , record " >
74
75
<icon-font v-if =" record.icon" :type =" record.icon" style =" margin-right : 6px " />
75
- {{ enableI18n ? record.i18nTitle : record.title }}
76
+ <a-tooltip placement =" top" >
77
+ <template slot="title">
78
+ <span >{{ enableI18n ? record.i18nTitle : record.title }}</span >
79
+ </template >
80
+ {{ enableI18n ? record.i18nTitle : record.title }}
81
+ </a-tooltip >
76
82
<a-icon
77
83
v-if =" enableI18n && record.type !== 2"
78
84
type =" edit"
@@ -115,7 +121,7 @@ export default {
115
121
name: ' SysMenuPage' ,
116
122
components: { SysMenuModalForm, I18nMessageModal },
117
123
mixins: [TablePageMixin],
118
- data () {
124
+ data () {
119
125
return {
120
126
delObj: delObj,
121
127
@@ -129,6 +135,7 @@ export default {
129
135
title: ' 菜单名称' ,
130
136
dataIndex: ' title' ,
131
137
width: 200 ,
138
+ ellipsis: true ,
132
139
scopedSlots: { customRender: ' menu-title-slot' }
133
140
},
134
141
{
@@ -182,17 +189,17 @@ export default {
182
189
menuList: []
183
190
}
184
191
},
185
- created () {
192
+ created () {
186
193
this .loadData ()
187
194
// 开启国际化时,注册监听事件
188
195
this .enableI18n && this .$bus .$on (' switch-language' , this .reloadTable )
189
196
},
190
- destroyed () {
197
+ destroyed () {
191
198
// 销毁监听事件
192
199
this .enableI18n && this .$bus .$off (' switch-language' , this .reloadTable )
193
200
},
194
201
methods: {
195
- loadData () {
202
+ loadData () {
196
203
this .loading = true
197
204
list (this .queryParam )
198
205
.then (res => {
@@ -204,13 +211,13 @@ export default {
204
211
this .loading = false
205
212
})
206
213
},
207
- reloadTable () {
214
+ reloadTable () {
208
215
this .loadData ()
209
216
},
210
217
/**
211
218
* 新建菜单权限
212
219
*/
213
- handleAdd (record ) {
220
+ handleAdd (record ) {
214
221
const attributes = { title: ' 新建菜单权限' }
215
222
// 按钮类型不允许有子级,所以默认变成创建平级
216
223
if (record) {
@@ -229,20 +236,20 @@ export default {
229
236
* 编辑菜单权限
230
237
* @param record 当前菜单权限属性
231
238
*/
232
- handleEdit (record ) {
239
+ handleEdit (record ) {
233
240
const attributes = { title: ' 编辑菜单权限' }
234
241
this .$refs .formModal .update (record, attributes)
235
242
},
236
243
/**
237
244
* 打开 i18nMessage 弹窗
238
245
*/
239
- openI18nMessage (code ) {
246
+ openI18nMessage (code ) {
240
247
this .$refs .i18nMessageModal .show (code)
241
248
},
242
249
/**
243
250
* 当 i18nData 有修改时,刷新表格数据
244
251
*/
245
- handleI18nMessageUpdate () {
252
+ handleI18nMessageUpdate () {
246
253
this .reloadTable ()
247
254
}
248
255
}
0 commit comments