瀏覽代碼

身份管理-权限名称-不要这么长

sunxbiao 1 年之前
父節點
當前提交
f02f7d09e8
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/views/setting/systemRole/index.vue

+ 9 - 1
src/views/setting/systemRole/index.vue

@@ -111,7 +111,15 @@ export default {
111 111
     getList() {
112 112
       this.listLoading = true
113 113
       menuRoleApi(this.tableFrom).then(res => {
114
-        this.tableData.data = res.data.list
114
+        this.tableData.data = res.data.list.map(item => {
115
+          // 判断 rule_name 是否超过 20 个字符
116
+          if (item.rule_name && item.rule_name.length > 20) {
117
+            // 超过 20 个字符,则截取前 20 个字符并加上省略号
118
+            item.rule_name = item.rule_name.slice(0, 20) + '...';
119
+          }
120
+          return item;
121
+        });
122
+
115 123
         this.tableData.total = res.data.count
116 124
         this.listLoading = false
117 125
       }).catch(res => {