| | |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[id]"] = this.idData; |
| | | conditionMaps["conditionMap[authType]"] = "data_auth"; |
| | | conditionMaps["conditionMap[buttonCode]"] = this.idData; |
| | | // 数据授权中是否具备查看权限 |
| | | conditionMaps["conditionMap[menuCode]"] = "data_view"; |
| | | getTreeList(conditionMaps).then(res => { |
| | |
| | | currentRow: {} |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | // 监听父组件传的窗口显示隐藏的值 |
| | | visible() { |
| | |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1 |
| | | this.roleHandlerMethods(authData.roleId, 'create', index) |
| | | console.log('index', index) |
| | | // console.log('index', index) |
| | | }) |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | roleHandlerMethods(id, type, index) { |
| | |
| | | const filteredItems = this.classifyAuthButton.filter(item => { |
| | | return !res.data.data.find(x => x.id === item.id); |
| | | }); |
| | | console.log('禁用按钮',filteredItems) |
| | | console.log('不禁用按钮',res.data.data) |
| | | // console.log('禁用按钮',filteredItems) |
| | | // console.log('不禁用按钮',res.data.data) |
| | | //拿表格列头循环和没有对应的属性进行比较 |
| | | this.classifyAuthHeader.forEach((item) => { |
| | | const isMatched = filteredItems.some(x => x.id === item.prop); |
| | |
| | | this.classifyAuthData[classIndex].allDisabled = false; |
| | | } |
| | | }); |
| | | console.log('classifyAuthData',this.classifyAuthData) |
| | | // console.log('classifyAuthData',this.classifyAuthData) |
| | | //强制刷新表格 |
| | | this.itemKey = uuidv4(); |
| | | }) |
| | |
| | | this.$message.warning("当前租户不存在角色信息!"); |
| | | return; |
| | | } |
| | | console.log('this.roleList', this.roleList) |
| | | // console.log('this.roleList', this.roleList) |
| | | this.addIndex++; //自定义生成添加行下标 |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | |
| | | this.classifyAuthButton.forEach(data => { |
| | | Vue.set(item, data.id, false); |
| | | }) |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item); |
| | | this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex) |
| | | }, |
| | |
| | | return new Promise((resolve, reject) => { |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[authType]"] = "classify_auth"; |
| | | conditionMaps["conditionMap[buttonCode]"] = "classifyTree"; |
| | | // 分类授权中是否具备查看权限 |
| | | conditionMaps["conditionMap[menuCode]"] = "classify_view"; |
| | | getAtrrList(conditionMaps) |
| | |
| | | R<List<String>> getRegexByList(@RequestBody List<String> combinationIds); |
| | | |
| | | @GetMapping(GETVIEWCLASSIFY) |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("menuCode") String menuCode); |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("buttonCode") String buttonCode,@RequestParam("menuCode") String menuCode); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) { |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) { |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | |
| | | private CodeBasicSecMapper codeBasicSecMapper; |
| | | |
| | | /** |
| | | * 自定义并发ForkJoinPool |
| | | */ |
| | | private static final ForkJoinPool customForkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors()-1); |
| | | |
| | | /** |
| | | * 上级节点的属性名称 |
| | | */ |
| | | public static final String PARENT_FIELD_NAME = "parentCodeClassifyOid"; |
| | |
| | | // 非超管过滤未授权的分类 |
| | | if(!VciBaseUtil.checkAdminTenant()){ |
| | | // 那些分类具备查看权限 |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(",")),treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"),treeQueryObject.getConditionMap().getOrDefault("menuCode","classify_view")); |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds( |
| | | Arrays.asList(AuthUtil.getUser().getRoleId().split(",")), |
| | | treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"), |
| | | treeQueryObject.getConditionMap().getOrDefault("buttonCode","classify_view"), |
| | | treeQueryObject.getConditionMap().getOrDefault("menuCode","classifyTree") |
| | | ); |
| | | // 请求失败或者请求得到的具备查看权限的分类id集合为空 |
| | | if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){ |
| | | throw new ServiceException("主数据查看权限未配置,或配置有误!"); |
| | |
| | | return R.data(mdmCountConfigService.getMdmCountConfig(userId)); |
| | | } |
| | | |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,menuCode)); |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,buttonCode,menuCode)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId); |
| | | |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("menuCode") String menuCode); |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("buttonCode") String buttonCode,@Param("menuCode") String menuCode); |
| | | |
| | | } |
| | |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode); |
| | | List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String menuCode) { |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) { |
| | | if(roleIds.isEmpty()){ |
| | | return new ArrayList<>(); |
| | | } |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,menuCode); |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,buttonCode,menuCode); |
| | | } |
| | | |
| | | } |
| | |
| | | </foreach> |
| | | </if> |
| | | AND AUTH_TYPE = #{authType} |
| | | AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID |
| | | FROM PL_SYS_MENU |
| | | WHERE CODE = #{menuCode}), '%')) |
| | | AND BUTTON_IDS LIKE CONCAT('%', CONCAT(( |
| | | SELECT |
| | | pm.ID |
| | | FROM |
| | | PL_SYS_MENU ps, |
| | | PL_SYS_MENU pm |
| | | WHERE |
| | | ps.CODE = #{buttonCode} |
| | | AND ps.ID = pm.PARENT_ID |
| | | AND pm.CODE = #{menuCode} |
| | | ), '%')) |
| | | </select> |
| | | |
| | | |