forked from github/dataease
refactor(仪表板): 拆分仪表板移动和更新接口,优化后端权限校验 #5450
This commit is contained in:
parent
91046c883c
commit
9f8bae2a9b
@ -89,15 +89,24 @@ public class PanelGroupController {
|
||||
|
||||
@ApiOperation("更新")
|
||||
@PostMapping("/update")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id"),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@I18n
|
||||
public PanelGroupDTO update(@RequestBody PanelGroupRequest request) {
|
||||
return panelGroupService.update(request);
|
||||
}
|
||||
|
||||
@ApiOperation("移动")
|
||||
@PostMapping("/move")
|
||||
@DePermissions(value = {
|
||||
@DePermission(type = DePermissionType.PANEL, value = "id", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE),
|
||||
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
}, logical = Logical.AND)
|
||||
@I18n
|
||||
public PanelGroupDTO move(@RequestBody PanelGroupRequest request) {
|
||||
return panelGroupService.update(request);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@PostMapping("/deleteCircle/{id}")
|
||||
|
@ -85,6 +85,15 @@ export function panelUpdate(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function panelMove(data) {
|
||||
return request({
|
||||
url: 'panel/group/move',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function findOne(id) {
|
||||
return request({
|
||||
url: 'panel/group/findOne/' + id,
|
||||
|
@ -449,7 +449,7 @@ import {
|
||||
defaultTree,
|
||||
delGroup,
|
||||
groupTree,
|
||||
initPanelData,
|
||||
initPanelData, panelMove,
|
||||
panelToTop,
|
||||
panelUpdate,
|
||||
viewPanelLog
|
||||
@ -1116,7 +1116,7 @@ export default {
|
||||
saveMoveGroup() {
|
||||
this.moveInfo.pid = this.tGroup.id
|
||||
this.moveInfo['optType'] = 'move'
|
||||
panelUpdate(this.moveInfo).then((response) => {
|
||||
panelMove(this.moveInfo).then((response) => {
|
||||
updateCacheTree('move', 'panel-main-tree', response.data, this.tData)
|
||||
this.closeMoveGroup()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user