Pārlūkot izejas kodu

数据字典应用

RuoYi 6 gadi atpakaļ
vecāks
revīzija
ce80396188
29 mainītis faili ar 229 papildinājumiem un 162 dzēšanām
  1. 26 19
      sql/ry_20180522.sql
  2. 30 0
      src/main/java/com/ruoyi/framework/web/service/DictService.java
  3. 27 2
      src/main/java/com/ruoyi/project/system/dict/domain/DictData.java
  4. 1 1
      src/main/java/com/ruoyi/project/system/dict/domain/DictType.java
  5. 8 0
      src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java
  6. 12 0
      src/main/java/com/ruoyi/project/system/dict/service/DictDataServiceImpl.java
  7. 9 1
      src/main/java/com/ruoyi/project/system/dict/service/IDictDataService.java
  8. 15 2
      src/main/resources/mybatis/system/DictDataMapper.xml
  9. 0 2
      src/main/resources/static/ruoyi/js/common.js
  10. 1 1
      src/main/resources/static/ruoyi/monitor/job/add.js
  11. 1 1
      src/main/resources/static/ruoyi/monitor/job/edit.js
  12. 2 2
      src/main/resources/static/ruoyi/system/dict/data/data.js
  13. 2 2
      src/main/resources/static/ruoyi/system/dict/type/type.js
  14. 4 8
      src/main/resources/templates/monitor/job/add.html
  15. 4 8
      src/main/resources/templates/monitor/job/edit.html
  16. 4 8
      src/main/resources/templates/system/config/add.html
  17. 4 8
      src/main/resources/templates/system/config/edit.html
  18. 4 8
      src/main/resources/templates/system/dept/add.html
  19. 4 8
      src/main/resources/templates/system/dept/edit.html
  20. 19 8
      src/main/resources/templates/system/dict/data/add.html
  21. 19 8
      src/main/resources/templates/system/dict/data/edit.html
  22. 4 8
      src/main/resources/templates/system/dict/type/add.html
  23. 4 8
      src/main/resources/templates/system/dict/type/edit.html
  24. 4 8
      src/main/resources/templates/system/menu/add.html
  25. 5 9
      src/main/resources/templates/system/menu/edit.html
  26. 4 8
      src/main/resources/templates/system/post/add.html
  27. 4 8
      src/main/resources/templates/system/post/edit.html
  28. 4 8
      src/main/resources/templates/system/user/add.html
  29. 4 8
      src/main/resources/templates/system/user/edit.html

+ 26 - 19
sql/ry_20180522.sql

@@ -390,7 +390,7 @@ create table sys_dict_type
 	dict_id          int(11) 		 not null auto_increment    comment '字典主键',
 	dict_name        varchar(100)    default ''                 comment '字典名称',
 	dict_type        varchar(100)    default ''                 comment '字典类型',
-    status 			 int(1) 		 default 0				    comment '状态(0正常 1用)',
+    status 			 int(1) 		 default 0				    comment '状态(0正常 1用)',
     create_by        varchar(64)     default ''                 comment '创建者',
     create_time      datetime                                   comment '创建时间',
     update_by        varchar(64) 	 default ''			        comment '更新者',
@@ -400,9 +400,13 @@ create table sys_dict_type
 	unique (dict_type)
 ) engine=innodb auto_increment=100 default charset=utf8 comment = '字典类型表';
 
-insert into sys_dict_type values(1, '银行列表', 'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '银行数据列表');
-insert into sys_dict_type values(2, '支付通道', 'sys_pay_code',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '支付通道列表');
-
+insert into sys_dict_type values(1, '用户性别', 'sys_user_sex',     0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户性别列表');
+insert into sys_dict_type values(2, '菜单状态', 'sys_menu_visible', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单状态列表');
+insert into sys_dict_type values(3, '部门状态', 'sys_dept_status',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '部门状态列表');
+insert into sys_dict_type values(4, '岗位状态', 'sys_post_status',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '岗位状态列表');
+insert into sys_dict_type values(5, '字典状态', 'sys_dict_status',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '字典状态列表');
+insert into sys_dict_type values(5, '任务状态', 'sys_job_status',   0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '任务状态列表');
+insert into sys_dict_type values(6, '系统是否', 'sys_yes_no',       0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统是否列表');
 
 -- ----------------------------
 -- 11、字典数据表
@@ -415,7 +419,9 @@ create table sys_dict_data
 	dict_label       varchar(100)    default ''                 comment '字典标签',
 	dict_value       varchar(100)    default ''                 comment '字典键值',
 	dict_type        varchar(100)    default ''                 comment '字典类型',
-    status 			 int(1) 		 default 0				    comment '状态(0正常 1禁用)',
+	css_class        varchar(500)    default ''                 comment '样式属性',
+	is_default       char(1)         default 'N'                comment '是否默认(Y是 N否)',
+    status 			 int(1) 		 default 0				    comment '状态(0正常 1停用)',
     create_by        varchar(64)     default ''                 comment '创建者',
     create_time      datetime                                   comment '创建时间',
     update_by        varchar(64) 	 default ''			        comment '更新者',
@@ -424,19 +430,20 @@ create table sys_dict_data
 	primary key (dict_code)
 ) engine=innodb auto_increment=100 default charset=utf8 comment = '字典数据表';
 
-insert into sys_dict_data values(1,  1, '工商银行', '01',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(2,  2, '建设银行', '02',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(3,  3, '农业银行', '03',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(4,  4, '光大银行', '04',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(5,  5, '兴业银行', '05',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); 
-insert into sys_dict_data values(6,  6, '中国银行', '06',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(7,  7, '平安银行', '07',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(8,  8, '招商银行', '08',  'sys_bank_code', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(9,  1, '微信支付', 'WX',  'sys_pay_code',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(10, 2, '支付宝',   'ZFB', 'sys_pay_code',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', ''); 
-insert into sys_dict_data values(11, 3, 'QQ支付',   'JD',  'sys_pay_code',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-insert into sys_dict_data values(12, 4, '京东支付', 'QQ',  'sys_pay_code',  0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
-
+insert into sys_dict_data values(1,  1, '男',   '0',  'sys_user_sex',      'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(2,  2, '女',   '1',  'sys_user_sex',      'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(3,  1, '显示', '0',  'sys_menu_visible',  'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(4,  2, '隐藏', '1',  'sys_menu_visible',  'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(5,  1, '正常', '0',  'sys_dept_status',   'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(6,  2, '停用', '1',  'sys_dept_status',   'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(7,  1, '正常', '0',  'sys_dict_status',   'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(8,  2, '停用', '1',  'sys_dict_status',   'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(9,  1, '正常', '0',  'sys_post_status',   'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(10, 2, '停用', '1',  'sys_post_status',   'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(11, 1, '正常', '0',  'sys_job_status',    'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(12, 2, '暂停', '1',  'sys_job_status',    'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(13, 1, '是',   'Y',  'sys_yes_no',        'radio radio-info radio-inline',   'Y', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
+insert into sys_dict_data values(14, 2, '否',   'N',  'sys_yes_no',        'radio radio-danger radio-inline', 'N', 0, 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
 
 -- ----------------------------
 -- 12、参数配置表
@@ -452,7 +459,7 @@ create table sys_config (
     create_time 	   datetime                                 comment '创建时间',
     update_by          varchar(64)   default ''                 comment '更新者',
     update_time        datetime                                 comment '更新时间',
-	remark 	         varchar(500) 	 default '' 				comment '备注',
+	remark 	           varchar(500)  default '' 				comment '备注',
 	primary key (config_id)
 ) engine=innodb auto_increment=100 default charset=utf8 comment = '参数配置表';
 

+ 30 - 0
src/main/java/com/ruoyi/framework/web/service/DictService.java

@@ -0,0 +1,30 @@
+package com.ruoyi.framework.web.service;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import com.ruoyi.project.system.dict.domain.DictData;
+import com.ruoyi.project.system.dict.service.IDictDataService;
+
+/**
+ * RuoYi首创 html调用 thymeleaf 实现字典读取
+ * 
+ * @author ruoyi
+ */
+@Component
+public class DictService
+{
+    @Autowired
+    private IDictDataService dictDataService;
+
+    /**
+     * 根据字典类型查询字典数据信息
+     * 
+     * @param dictType 字典类型
+     * @return 参数键值
+     */
+    public List<DictData> selectDictData(String dictType)
+    {
+        return dictDataService.selectDictDataByType(dictType);
+    }
+}

+ 27 - 2
src/main/java/com/ruoyi/project/system/dict/domain/DictData.java

@@ -20,7 +20,11 @@ public class DictData extends BaseEntity
     private String dictValue;
     /** 字典类型 */
     private String dictType;
-    /** 状态(0正常 1禁用) */
+    /** 字典样式 */
+    private String cssClass;
+    /** 是否默认(Y是 N否) */
+    private String isDefault;
+    /** 状态(0正常 1停用) */
     private int status;
 
     public Long getDictCode()
@@ -73,6 +77,26 @@ public class DictData extends BaseEntity
         this.dictType = dictType;
     }
 
+    public String getCssClass()
+    {
+        return cssClass;
+    }
+
+    public void setCssClass(String cssClass)
+    {
+        this.cssClass = cssClass;
+    }
+
+    public String getIsDefault()
+    {
+        return isDefault;
+    }
+
+    public void setIsDefault(String isDefault)
+    {
+        this.isDefault = isDefault;
+    }
+
     public int getStatus()
     {
         return status;
@@ -87,7 +111,8 @@ public class DictData extends BaseEntity
     public String toString()
     {
         return "DictData [dictCode=" + dictCode + ", dictSort=" + dictSort + ", dictLabel=" + dictLabel + ", dictValue="
-                + dictValue + ", dictType=" + dictType + ", status=" + status + "]";
+                + dictValue + ", dictType=" + dictType + ", cssClass=" + cssClass + ", isDefault=" + isDefault
+                + ", status=" + status + "]";
     }
 
 }

+ 1 - 1
src/main/java/com/ruoyi/project/system/dict/domain/DictType.java

@@ -16,7 +16,7 @@ public class DictType extends BaseEntity
     private String dictName;
     /** 字典类型 */
     private String dictType;
-    /** 状态(0正常 1用) */
+    /** 状态(0正常 1用) */
     private int status;
 
     public Long getDictId()

+ 8 - 0
src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java

@@ -18,6 +18,14 @@ public interface DictDataMapper
      * @return 字典数据集合信息
      */
     public List<DictData> selectDictDataList(DictData dictData);
+    
+    /**
+     * 根据字典类型查询字典数据
+     * 
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<DictData> selectDictDataByType(String dictType);
 
     /**
      * 根据字典数据ID查询信息

+ 12 - 0
src/main/java/com/ruoyi/project/system/dict/service/DictDataServiceImpl.java

@@ -31,6 +31,18 @@ public class DictDataServiceImpl implements IDictDataService
         return dictDataMapper.selectDictDataList(dictData);
     }
 
+    /**
+     * 根据字典类型查询字典数据
+     * 
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    @Override
+    public List<DictData> selectDictDataByType(String dictType)
+    {
+        return dictDataMapper.selectDictDataByType(dictType);
+    }
+
     /**
      * 根据字典数据ID查询信息
      * 

+ 9 - 1
src/main/java/com/ruoyi/project/system/dict/service/IDictDataService.java

@@ -18,7 +18,15 @@ public interface IDictDataService
      * @return 字典数据集合信息
      */
     public List<DictData> selectDictDataList(DictData dictData);
-
+    
+    /**
+     * 根据字典类型查询字典数据
+     * 
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<DictData> selectDictDataByType(String dictType);
+    
     /**
      * 根据字典数据ID查询信息
      * 

+ 15 - 2
src/main/resources/mybatis/system/DictDataMapper.xml

@@ -10,6 +10,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="dictLabel"  column="dict_label"  />
 		<result property="dictValue"  column="dict_value"  />
 		<result property="dictType"   column="dict_type"   />
+		<result property="cssClass"   column="css_class"   />
+		<result property="isDefault"  column="is_default"   />
 		<result property="status"     column="status"      />
 		<result property="createBy"   column="create_by"   />
 		<result property="createTime" column="create_time" />
@@ -18,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 
 	<select id="selectDictDataList" parameterType="DictData" resultMap="DictDataResult">
-		select dict_code, dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time, remark from sys_dict_data
+		select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, is_default, status, create_by, create_time, remark from sys_dict_data
 		<where>
 			<if test="searchValue != null and searchValue != ''">
 				AND dict_label like concat(concat('%', #{searchValue}), '%')
@@ -29,8 +31,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</where>
 	</select>
 	
+	<select id="selectDictDataByType" parameterType="DictData" resultMap="DictDataResult">
+		select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, is_default, status, create_by, create_time, remark from sys_dict_data
+		where dict_type = #{dictType} order by dict_sort asc
+	</select>
+	
 	<select id="selectDictDataById" parameterType="Long" resultMap="DictDataResult">
-		select dict_code, dict_sort, dict_label, dict_value, dict_type, status, create_by, create_time, remark
+		select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, is_default, status, create_by, create_time, remark
 		from sys_dict_data
 		where dict_code = #{dictCode}
 	</select>
@@ -53,6 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
  			<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
  			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+ 			<if test="cssClass != null and cssClass != ''">css_class = #{cssClass},</if>
+ 			<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
  			<if test="status != null">status = #{status},</if>
  			<if test="remark != null and remark != ''">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
@@ -68,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
  			<if test="dictValue != null and dictValue != ''">dict_value,</if>
  			<if test="dictType != null and dictType != ''">dict_type,</if>
+ 			<if test="cssClass != null and cssClass != ''">css_class,</if>
+ 			<if test="isDefault != null and isDefault != ''">is_default,</if>
  			<if test="status != null">status,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
@@ -77,6 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		    <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
  			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
  			<if test="dictType != null and dictType != ''">#{dictType},</if>
+ 			<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
+ 			<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
  			<if test="status != null">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>

+ 0 - 2
src/main/resources/static/ruoyi/js/common.js

@@ -178,8 +178,6 @@ $.ajaxSetup({
         	$.modalConfirm("登陆超时!请重新登陆!", function() {
         		window.location.href = ctx + "login";
         	})
-        } else if (textStatus == "error") {
-        	$.modalAlert("请求超时!请稍后再试!", 'warning');
         }
     }
 }); 

+ 1 - 1
src/main/resources/static/ruoyi/monitor/job/add.js

@@ -16,5 +16,5 @@ $("#form-job-add").validate({
 });
 
 function add() {
-	_ajax_save(ctx + "/monitor/job/save", $("#form-job-add").serialize());
+	_ajax_save(ctx + "monitor/job/save", $("#form-job-add").serialize());
 }

+ 1 - 1
src/main/resources/static/ruoyi/monitor/job/edit.js

@@ -16,5 +16,5 @@ $("#form-job-edit").validate({
 });
 
 function edit() {
-	_ajax_save(ctx + "/monitor/job/save", $("#form-job-edit").serialize());
+	_ajax_save(ctx + "monitor/job/save", $("#form-job-edit").serialize());
 }

+ 2 - 2
src/main/resources/static/ruoyi/system/dict/data/data.js

@@ -22,13 +22,13 @@ $(function() {
         },
         {
             field: 'status',
-            title: '操作状态',
+            title: '状态',
             align: 'center',
             formatter: function(value, row, index) {
                 if (value == 0) {
                     return '<span class="label label-success">正常</span>';
                 } else if (value == 1) {
-                    return '<span class="label label-danger">用</span>';
+                    return '<span class="label label-danger">用</span>';
                 }
             }
         },

+ 2 - 2
src/main/resources/static/ruoyi/system/dict/type/type.js

@@ -18,13 +18,13 @@ $(function() {
         },
         {
             field: 'status',
-            title: '操作状态',
+            title: '状态',
             align: 'center',
             formatter: function(value, row, index) {
                 if (value == 0) {
                     return '<span class="label label-success">正常</span>';
                 } else if (value == 1) {
-                    return '<span class="label label-danger">用</span>';
+                    return '<span class="label label-danger">用</span>';
                 }
             }
         },

+ 4 - 8
src/main/resources/templates/monitor/job/add.html

@@ -37,14 +37,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">状态:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="status" value="0" checked="">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_job_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/monitor/job/edit.html

@@ -38,14 +38,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">状态:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{job.status}" name="status" value="0">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{job.status}" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_job_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{job.status}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/config/add.html

@@ -25,14 +25,10 @@
         </div>
         <div class="form-group">
 			<label class="col-sm-3 control-label">系统内置:</label>
-			<div class="col-sm-8">
-                    <div class="radio radio-info radio-inline">
-					<input type="radio" id="radio1" name="configType" value="Y" checked="">
-					<label for="radio1">是</label>
-				</div>
-				<div class="radio radio-danger radio-inline">
-					<input type="radio" id="radio2" name="configType" value="N">
-					<label for="radio2">否</label>
+			<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_yes_no')}">
+				<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+					<input type="radio" th:id="${dict['dictCode']}" name="configType" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+					<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 				</div>
 			</div>
 		</div>

+ 4 - 8
src/main/resources/templates/system/config/edit.html

@@ -26,14 +26,10 @@
             </div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">系统内置:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{config.configType}" name="configType" value="Y">
-						<label for="radio1">是</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{config.configType}" name="configType" value="N">
-						<label for="radio2">否</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_yes_no')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="configType" th:value="${dict['dictValue']}" th:field="*{config.configType}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/dept/add.html

@@ -44,14 +44,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">部门状态:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="status" value="0" checked="">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="status" value="1">
-						<label for="radio2">停用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_post_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/dept/edit.html

@@ -45,14 +45,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">部门状态:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{dept.status}" name="status" value="0">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{dept.status}" name="status" value="1">
-						<label for="radio2">停用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_post_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{dept.status}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 19 - 8
src/main/resources/templates/system/dict/data/add.html

@@ -23,6 +23,21 @@
 					<input class="form-control" type="text" id="dictType" name="dictType" readonly="true" th:value="${dictType}">
 				</div>
 			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label">样式属性:</label>
+				<div class="col-sm-8">
+					<input class="form-control" type="text" id="cssClass" name="cssClass">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label">系统默认:</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_yes_no')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="isDefault" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
+					</div>
+				</div>
+			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">字典排序:</label>
 				<div class="col-sm-8">
@@ -31,14 +46,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">状态:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="status" value="0" checked="">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_post_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 19 - 8
src/main/resources/templates/system/dict/data/edit.html

@@ -24,6 +24,21 @@
 					<input class="form-control" type="text" readonly="true" th:value="${dict.dictType}">
 				</div>
 			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label">样式属性:</label>
+				<div class="col-sm-8">
+					<input class="form-control" type="text" id="cssClass" name="cssClass" th:value="${dict.cssClass}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-3 control-label">系统默认:</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_yes_no')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="isDefault" th:value="${dict['dictValue']}" th:field="*{dict.isDefault}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
+					</div>
+				</div>
+			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">字典排序:</label>
 				<div class="col-sm-8">
@@ -32,14 +47,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">状态:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{dict.status}" name="status" value="0">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{dict.status}" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_dict_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{dict.status}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/dict/type/add.html

@@ -19,14 +19,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">状态:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="status" value="0" checked="">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_dict_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/dict/type/edit.html

@@ -20,14 +20,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">状态:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{dict.status}" name="status" value="0">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{dict.status}" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_dict_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{dict.status}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/menu/add.html

@@ -58,14 +58,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">菜单状态:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="visible" value="0" checked="">
-						<label for="radio1">显示</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="visible" value="1">
-						<label for="radio2">隐藏</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_menu_visible')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="visible" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 5 - 9
src/main/resources/templates/system/menu/edit.html

@@ -58,15 +58,11 @@
 				</div>
 			</div>
 			<div class="form-group">
-				<label class="col-sm-3 control-label">菜单:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{menu.visible}" name="visible" value="0">
-						<label for="radio1">显示</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{menu.visible}" name="visible" value="1">
-						<label for="radio2">隐藏</label>
+				<label class="col-sm-3 control-label">菜单状态:</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_menu_visible')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="visible" th:value="${dict['dictValue']}" th:field="*{menu.visible}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/post/add.html

@@ -25,14 +25,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">岗位状态:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="status" value="0" checked="">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_post_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/post/edit.html

@@ -26,14 +26,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">岗位状态:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{post.status}" name="status" value="0">
-						<label for="radio1">正常</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{post.status}" name="status" value="1">
-						<label for="radio2">禁用</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_post_status')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{post.status}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/user/add.html

@@ -47,14 +47,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">性别:</label>
-				<div class="col-sm-8">
-                     <div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" name="sex" value="0" checked="">
-						<label for="radio1">男</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" name="sex" value="1">
-						<label for="radio2">女</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_user_sex')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="sex" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>

+ 4 - 8
src/main/resources/templates/system/user/edit.html

@@ -42,14 +42,10 @@
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">性别:</label>
-				<div class="col-sm-8">
-					<div class="radio radio-info radio-inline">
-						<input type="radio" id="radio1" th:field="*{user.sex}" name="sex" value="0">
-						<label for="radio1">男</label>
-					</div>
-					<div class="radio radio-danger radio-inline">
-						<input type="radio" id="radio2" th:field="*{user.sex}" name="sex" value="1">
-						<label for="radio2">女</label>
+				<div class="col-sm-8" th:with="datas=${@dictService.selectDictData('sys_user_sex')}">
+					<div th:each="dict : ${datas}" th:class="${dict['cssClass']}">
+						<input type="radio" th:id="${dict['dictCode']}" name="sex" th:value="${dict['dictValue']}" th:field="*{user.sex}">
+						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
 					</div>
 				</div>
 			</div>