feat(web): 优化折行的使用
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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, [
|
||||
|
||||
Reference in New Issue
Block a user