字典使用
配置好相关的数据字典信息即可正常使用(系统管理-字典管理)
<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
</option>
</select>
如果在想Table表格数据使用字典,使用formatter格式化
// 获取数据字典数据
var datas = [[${@dict.getType('sys_normal_disable')}]];
// 格式化数据字典
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}