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} field
|
||||||
* @param {string} label
|
* @param {string} label
|
||||||
* @param {number} width
|
* @param {number} width
|
||||||
|
* @param {boolean} wrap
|
||||||
*/
|
*/
|
||||||
export function stringField(field, label, width = undefined) {
|
export function stringField(field, label, width = undefined, wrap = false) {
|
||||||
let data = {
|
let data = {
|
||||||
name: field,
|
name: field,
|
||||||
label: label,
|
label: label,
|
||||||
className: 'nowrap',
|
|
||||||
}
|
}
|
||||||
if (width) {
|
if (width) {
|
||||||
data['width'] = width
|
data['width'] = width
|
||||||
}
|
}
|
||||||
|
if (wrap) {
|
||||||
|
data['className'] = 'nowrap'
|
||||||
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,15 @@ import {
|
|||||||
mappingField,
|
mappingField,
|
||||||
operationField,
|
operationField,
|
||||||
providerOnly,
|
providerOnly,
|
||||||
|
stringField,
|
||||||
|
stringWrapField,
|
||||||
timeField,
|
timeField,
|
||||||
userOnly
|
userOnly,
|
||||||
} from "../../components/constants.js";
|
} from "../../components/constants.js";
|
||||||
import {
|
import {
|
||||||
permissionAddDialog,
|
permissionAddDialog,
|
||||||
permissionDetailDialog,
|
permissionDetailDialog,
|
||||||
permissionEditeDialog
|
permissionEditeDialog,
|
||||||
} from "../../components/permission/dialog-permission.js";
|
} from "../../components/permission/dialog-permission.js";
|
||||||
|
|
||||||
export function tabPermissions() {
|
export function tabPermissions() {
|
||||||
@@ -42,15 +44,8 @@ export function tabPermissions() {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
{
|
stringField('name', '名称', 200),
|
||||||
label: '名称',
|
stringWrapField('description', '描述'),
|
||||||
name: 'name',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '描述',
|
|
||||||
name: 'description',
|
|
||||||
},
|
|
||||||
mappingField('state', '状态', confirmationStateMapping),
|
mappingField('state', '状态', confirmationStateMapping),
|
||||||
timeField('createdTime', '创建时间'),
|
timeField('createdTime', '创建时间'),
|
||||||
operationField('操作', undefined, [
|
operationField('操作', undefined, [
|
||||||
|
|||||||
Reference in New Issue
Block a user