theamleaf
html
字典值
<select class="form-control" name="fplx" id="fplx" th:with="type=${@dict.getType('sys_fplx')}">
<option value="" th:text="全部"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
</option>
</select>
var deptIdDatas = [[${@dict.getType('sys_workshop_name')}]];
var datas = [[${@dict.getType('sys_oper_type')}]];
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
java service
/**
* 根据字典类型查询字典数据信息
*
* @param dictType 字典类型
* @return 参数键值
*/
public List<SysDictData> getType(String dictType)
{
return dictTypeService.selectDictDataByType(dictType);
}