修复:数据字典维护表单中的字典值字段,避免维护时字典值和数据库预设值不一样,导致异常

master
Guo XIn 1 year ago
parent c29293b280
commit f6b3041dfa
  1. 2
      shandan-system/src/main/java/com/keyware/shandan/system/service/impl/SysDictServiceImpl.java
  2. 8
      shandan-system/src/main/resources/view/sys/dict/dictEdit.html

@ -33,7 +33,7 @@ public class SysDictServiceImpl extends BaseServiceImpl<SysDictMapper, SysDict,
return Result.of(null, false, "字典名称已存在"); return Result.of(null, false, "字典名称已存在");
} }
} }
entity.setDictCode(entity.getDictName()); entity.setDictCode(entity.getDictValue());
// entity.setDictValue(entity.getDictName()); // entity.setDictValue(entity.getDictName());
boolean ok = super.saveOrUpdate(entity); boolean ok = super.saveOrUpdate(entity);
if(ok){ if(ok){

@ -29,6 +29,14 @@
class="layui-input" lay-verify="required"> class="layui-input" lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">字典值</label>
<div class="layui-input-block">
<input type="text" name="dictValue" autocomplete="off" placeholder="字典值"
th:value="${dict.dictValue}"
class="layui-input" lay-verify="required">
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">排序</label> <label class="layui-form-label">排序</label>
<div class="layui-input-block"> <div class="layui-input-block">