Ver código fonte

数据字典是否默认字段获取调整

RuoYi 5 anos atrás
pai
commit
6c47f48e06

+ 4 - 0
ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css

@@ -790,6 +790,10 @@ label {
 	border-top: 0px solid #ddd;
 }
 
+.fixed-table-container {
+	border: 0px solid #ddd;
+}
+
 .table-striped .table>thead>tr>th, .table-striped .table>tbody>tr>th {
 	border-bottom: 1px solid #ccc!important;
 	border-top: 0px!important;

+ 1 - 1
ruoyi-admin/src/main/resources/templates/demo/operate/add.html

@@ -44,7 +44,7 @@
 				<label class="col-sm-3 control-label">用户状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/config/add.html

@@ -28,7 +28,7 @@
 			<label class="col-sm-3 control-label">系统内置:</label>
 			<div class="col-sm-8">
 			    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
-					<input type="radio" th:id="${dict.dictCode}" name="configType" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+					<input type="radio" th:id="${dict.dictCode}" name="configType" th:value="${dict.dictValue}" th:checked="${dict.default}">
 					<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 				</div>
 			</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/dept/add.html

@@ -50,7 +50,7 @@
 				<label class="col-sm-3 control-label">部门状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/dept/dept.html

@@ -40,7 +40,7 @@
                 </a>
 	        </div>
        		 <div class="col-sm-12 select-table table-striped">
-	            <table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
+	            <table id="bootstrap-tree-table"></table>
 	        </div>
 	    </div>
 	</div>

+ 2 - 2
ruoyi-admin/src/main/resources/templates/system/dict/data/add.html

@@ -55,7 +55,7 @@
 				<label class="col-sm-3 control-label">系统默认:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
-						<input type="radio" th:id="${dict.dictCode}" name="isDefault" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="isDefault" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>
@@ -64,7 +64,7 @@
 				<label class="col-sm-3 control-label">状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/dict/type/add.html

@@ -22,7 +22,7 @@
 				<label class="col-sm-3 control-label">状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/menu/add.html

@@ -73,7 +73,7 @@
 				<label class="col-sm-3 control-label">菜单状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
-						<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/menu/menu.html

@@ -40,7 +40,7 @@
                 </a>
 	        </div>
        		 <div class="col-sm-12 select-table table-striped">
-	            <table id="bootstrap-tree-table" data-mobile-responsive="true"></table>
+	            <table id="bootstrap-tree-table"></table>
 	        </div>
 	    </div>
 	</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/notice/add.html

@@ -32,7 +32,7 @@
 				<label class="col-sm-2 control-label">公告状态:</label>
 				<div class="col-sm-10">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/post/add.html

@@ -28,7 +28,7 @@
 				<label class="col-sm-3 control-label">岗位状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 6 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java

@@ -27,6 +27,12 @@ public class UserConstants
     /** 部门正常状态 */
     public static final String DEPT_NORMAL = "0";
 
+    /** 字典正常状态 */
+    public static final String DICT_NORMAL = "0";
+
+    /** 是否为系统默认(是) */
+    public static final String YES = "Y";
+
     /**
      * 用户名长度限制
      */

+ 1 - 1
ruoyi-quartz/src/main/resources/templates/monitor/job/add.html

@@ -56,7 +56,7 @@
 				<label class="col-sm-3 control-label">状态:</label>
 				<div class="col-sm-8">
 				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
+						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>

+ 8 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDictData.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.domain;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
@@ -119,6 +120,11 @@ public class SysDictData extends BaseEntity
         this.listClass = listClass;
     }
 
+    public boolean getDefault()
+    {
+        return UserConstants.YES.equals(this.isDefault) ? true : false;
+    }
+
     public String getIsDefault()
     {
         return isDefault;
@@ -138,8 +144,8 @@ public class SysDictData extends BaseEntity
     {
         this.status = status;
     }
-    
-	@Override
+
+    @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("dictCode", getDictCode())