1
0

feat(web): 优化折行的使用

This commit is contained in:
2024-12-01 11:47:23 +08:00
parent 6742565f97
commit be2971765e
2 changed files with 15 additions and 13 deletions

View File

@@ -179,20 +179,27 @@ export function timeField(field, label, width = 150) {
}
}
export function stringWrapField(field, label, width = undefined) {
return stringField(field, label, width, true)
}
/**
* @param {string} field
* @param {string} label
* @param {number} width
* @param {boolean} wrap
*/
export function stringField(field, label, width = undefined) {
export function stringField(field, label, width = undefined, wrap = false) {
let data = {
name: field,
label: label,
className: 'nowrap',
}
if (width) {
data['width'] = width
}
if (wrap) {
data['className'] = 'nowrap'
}
return data
}

View File

@@ -5,13 +5,15 @@ import {
mappingField,
operationField,
providerOnly,
stringField,
stringWrapField,
timeField,
userOnly
userOnly,
} from "../../components/constants.js";
import {
permissionAddDialog,
permissionDetailDialog,
permissionEditeDialog
permissionEditeDialog,
} from "../../components/permission/dialog-permission.js";
export function tabPermissions() {
@@ -42,15 +44,8 @@ export function tabPermissions() {
},
],
columns: [
{
label: '名称',
name: 'name',
width: 200,
},
{
label: '描述',
name: 'description',
},
stringField('name', '名称', 200),
stringWrapField('description', '描述'),
mappingField('state', '状态', confirmationStateMapping),
timeField('createdTime', '创建时间'),
operationField('操作', undefined, [