fix: 默认仪表板管理权限未生效问题

This commit is contained in:
wangjiahao 2022-03-02 10:46:58 +08:00
parent feec812267
commit 16ea97339e
3 changed files with 12 additions and 7 deletions

View File

@ -68,7 +68,7 @@ public class PanelGroupController {
@ApiOperation("详细信息")
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
@GetMapping("/findOne/{id}")
public PanelGroupWithBLOBs findOne(@PathVariable String id) throws Exception {
public PanelGroupDTO findOne(@PathVariable String id) throws Exception {
return panelGroupService.findOne(id);
}

View File

@ -200,12 +200,16 @@ public class PanelGroupService {
}
public PanelGroupWithBLOBs findOne(String panelId) {
PanelGroupWithBLOBs panelGroupWithBLOBs = extPanelGroupMapper.findOneWithPrivileges(panelId, String.valueOf(AuthUtils.getUser().getUserId()));
if (panelGroupWithBLOBs != null && StringUtils.isNotEmpty(panelGroupWithBLOBs.getSource())) {
return extPanelGroupMapper.findOneWithPrivileges(panelGroupWithBLOBs.getSource(), String.valueOf(AuthUtils.getUser().getUserId()));
public PanelGroupDTO findOne(String panelId) {
PanelGroupDTO panelGroup = extPanelGroupMapper.findOneWithPrivileges(panelId, String.valueOf(AuthUtils.getUser().getUserId()));
// 默认仪表板取源仪表板样式
if (panelGroup != null && StringUtils.isNotEmpty(panelGroup.getSource())) {
PanelGroupDTO sourcePanel = extPanelGroupMapper.findOneWithPrivileges(panelGroup.getSource(), String.valueOf(AuthUtils.getUser().getUserId()));
panelGroup.setPanelData(sourcePanel.getPanelData());
panelGroup.setPanelStyle(sourcePanel.getPanelStyle());
panelGroup.setSourcePanelName(sourcePanel.getName());
}
return panelGroupWithBLOBs;
return panelGroup;
}

View File

@ -142,7 +142,8 @@ export function initPanelData(panelId, callback) {
store.dispatch('panel/setPanelInfo', {
id: response.data.id,
name: response.data.name,
privileges: response.data.privileges
privileges: response.data.privileges,
sourcePanelName: response.data.sourcePanelName
})
// 刷新联动信息
getPanelAllLinkageInfo(panelId).then(rsp => {