Bladeren bron

qxm-修改TUC事业群多选权限分配

qxm 2 jaren geleden
bovenliggende
commit
266409152a

+ 14 - 4
suishenbang-admin/src/main/java/com/dgtly/web/controller/system/SysUserController.java

@@ -5,12 +5,11 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import com.dgtly.common.core.domain.Ztree;
 import com.dgtly.common.exception.BusinessException;
 import com.dgtly.common.exception.BusinessException;
 import com.dgtly.common.utils.ShiroSaltUtil;
 import com.dgtly.common.utils.ShiroSaltUtil;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
-import com.dgtly.system.domain.SysCompany;
-import com.dgtly.system.domain.SysDept;
-import com.dgtly.system.domain.SysUserExt;
+import com.dgtly.system.domain.*;
 import com.dgtly.system.service.*;
 import com.dgtly.system.service.*;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,7 +32,6 @@ import com.dgtly.common.enums.BusinessType;
 import com.dgtly.common.utils.poi.ExcelUtil;
 import com.dgtly.common.utils.poi.ExcelUtil;
 import com.dgtly.framework.shiro.service.SysPasswordService;
 import com.dgtly.framework.shiro.service.SysPasswordService;
 import com.dgtly.framework.util.ShiroUtils;
 import com.dgtly.framework.util.ShiroUtils;
-import com.dgtly.system.domain.SysUser;
 
 
 /**
 /**
  * 用户信息
  * 用户信息
@@ -53,6 +51,9 @@ public class SysUserController extends BaseController
     @Autowired
     @Autowired
     private ISysRoleService roleService;
     private ISysRoleService roleService;
 
 
+    @Autowired
+    private ISysUserOrderAuthorService sysUserOrderAuthorService;
+
     @Autowired
     @Autowired
     private ISysPostService postService;
     private ISysPostService postService;
     @Autowired
     @Autowired
@@ -79,6 +80,15 @@ public class SysUserController extends BaseController
     public String authUser(@PathVariable("userId") Long userId, ModelMap mmap)
     public String authUser(@PathVariable("userId") Long userId, ModelMap mmap)
     {
     {
         mmap.put("user", userService.selectUserById(userId));
         mmap.put("user", userService.selectUserById(userId));
+        SysUserOrderAuthor sysUserOrderAuthor = new SysUserOrderAuthor();
+        sysUserOrderAuthor.setParentId(0L);
+        mmap.put("authorInfo", sysUserOrderAuthorService.selectSysUserOrderAuthorList(sysUserOrderAuthor).get(0));
+        List<Ztree> ztrees = sysUserOrderAuthorService.userAuthorTreeData(userId);
+        boolean checked = false;
+        if (ztrees.get(0).getCode().equals("TUC")&& ztrees.get(0).isChecked()){
+            checked=true;
+        }
+        mmap.put("tucCheck", checked);
         return prefix + "/author";
         return prefix + "/author";
     }
     }
 
 

+ 4 - 3
suishenbang-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@@ -1241,10 +1241,11 @@
 			getCheckedNodesRole: function(column) {
 			getCheckedNodesRole: function(column) {
 				var _column = $.common.isEmpty(column) ? "id" : column;
 				var _column = $.common.isEmpty(column) ? "id" : column;
 				var nodes = $._tree.getCheckedNodes(true);
 				var nodes = $._tree.getCheckedNodes(true);
-				console.log($._tree.getNodes()[0].getCheckStatus())
-				console.log(nodes)
+				// console.log($._tree.getNodes()[0].getCheckStatus())
+				// console.log(nodes)
 				return $.map(nodes, function (row) {
 				return $.map(nodes, function (row) {
-					if ($._tree.getNodes()[0].getCheckStatus().half==true && row.code=='TUC'){
+					// if ($._tree.getNodes()[0].getCheckStatus().half==true && row.code=='TUC'){
+					if (row.code=='TUC'){
 						return
 						return
 					}else{
 					}else{
 						return row[_column];
 						return row[_column];

+ 2 - 2
suishenbang-admin/src/main/resources/templates/system/author/author.html

@@ -110,11 +110,11 @@
                         return $.table.selectDictLabel(authorTypeDatas, value);
                         return $.table.selectDictLabel(authorTypeDatas, value);
                     }
                     }
                 },
                 },
-                {
+                /*{
                     field : 'remark', 
                     field : 'remark', 
                     title : '备注',
                     title : '备注',
                     align: 'left'
                     align: 'left'
-                },
+                },*/
                 {
                 {
                     title: '操作',
                     title: '操作',
                     align: 'center',
                     align: 'center',

+ 15 - 3
suishenbang-admin/src/main/resources/templates/system/user/author.html

@@ -12,6 +12,7 @@
 			<div class="form-group">
 			<div class="form-group">
 				<label class="col-sm-3 control-label">菜单权限</label>
 				<label class="col-sm-3 control-label">菜单权限</label>
 				<div class="col-sm-8">
 				<div class="col-sm-8">
+					<input type="checkbox" id="highTuc" th:value="${authorInfo.authorId}"><label for="highTuc">TUC事业群</label>
 					<div id="menuTrees" class="ztree"></div>
 					<div id="menuTrees" class="ztree"></div>
 				</div>
 				</div>
 			</div>
 			</div>
@@ -19,7 +20,11 @@
 	</div>
 	</div>
 	<th:block th:include="include :: footer" />
 	<th:block th:include="include :: footer" />
 	<th:block th:include="include :: ztree-js" />
 	<th:block th:include="include :: ztree-js" />
-	<script type="text/javascript">
+	<script th:inline="javascript">
+
+		var tucCheck = [[${tucCheck}]];
+		$("#highTuc").prop('checked',tucCheck);
+
 	     $(function() {
 	     $(function() {
 			var url = ctx + "system/author/tree/" + $("#userId").val();
 			var url = ctx + "system/author/tree/" + $("#userId").val();
 			var options = {
 			var options = {
@@ -93,8 +98,15 @@
 			var userId = $("input[name='userId']").val();
 			var userId = $("input[name='userId']").val();
 			// console.log($.tree)
 			// console.log($.tree)
 			// console.log($.tree.getNodes()[0].getCheckStatus())
 			// console.log($.tree.getNodes()[0].getCheckStatus())
-
-			var authorIds = $.tree.getCheckedNodesRole();
+			var authorIds='';
+			if($("#highTuc").is(":checked")){
+				authorIds=$('#highTuc:checked').val()+","
+			}
+			authorIds += $.tree.getCheckedNodesRole();
+			if($.tree.getCheckedNodesRole()==''){
+				$.modal.alertWarning("至少勾选一个事业部")
+				return
+			}
 			$.ajax({
 			$.ajax({
 				cache : true,
 				cache : true,
 				type : "POST",
 				type : "POST",