字典使用

配置好相关的数据字典信息即可正常使用(系统管理-字典管理)

  1. <select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
  2. <option value="">所有</option>
  3. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
  4. </option>
  5. </select>

如果在想Table表格数据使用字典,使用formatter格式化

// 获取数据字典数据
var datas = [[${@dict.getType('sys_normal_disable')}]];

// 格式化数据字典
formatter: function(value, row, index) {
    return $.table.selectDictLabel(datas, value);
}