文件位置
odoo\addons\web\static\src\legacy\js\views\list\list_renderer.js
关键代码
// Allowed decoration on the list's rows: bold, italic and bootstrap semantics classes
var DECORATIONS = [
'decoration-bf',
'decoration-it',
'decoration-danger',
'decoration-info',
'decoration-muted',
'decoration-primary',
'decoration-success',
'decoration-warning'
];
代码解释
-
decoration-bf
和decoration-it
:decoration-bf
: 这个类名可能与 bold (粗体) 相关,表示该行将会用粗体显示。decoration-it
: 这个类名可能与 italic (斜体) 相关,表示该行将会用斜体显示。
-
Bootstrap 语义类:
其余类名与 Bootstrap 框架中的样式类有关,用来提供特定的颜色和装饰效果:decoration-danger
: 通常用于表示危险或错误信息,会显示为红色背景或文本。decoration-info
: 用于显示信息型内容,通常为蓝色。decoration-muted
: 表示轻度或不太显眼的文本,颜色较为暗淡。decoration-primary
: 用于主要操作或信息,通常为蓝色。decoration-success
: 表示成功的操作,通常为绿色。decoration-warning
: 表示警告信息,通常为黄色。
这些装饰样式可以根据不同的需求动态应用于列表中的每一行,以调整行的视觉风格或强调特定的信息。