mirror of
https://github.com/dataease/dataease.git
synced 2026-05-21 12:45:37 +08:00
fix: 仪表盘列表中的仪表盘可转为默认仪表盘
This commit is contained in:
@@ -10,6 +10,10 @@ public interface ExtPanelGroupMapper {
|
||||
|
||||
List<PanelGroupDTO> panelGroupList(PanelGroupRequest request);
|
||||
|
||||
List<PanelGroupDTO> panelGroupListDefault(PanelGroupRequest request);
|
||||
|
||||
|
||||
|
||||
//会级联删除pid 下的所有数据
|
||||
int deleteCircle(@Param("pid") String pid);
|
||||
|
||||
|
||||
@@ -12,6 +12,21 @@
|
||||
select panel_group.*,panel_group.name as label from panel_group where id =#{id}
|
||||
</select>
|
||||
|
||||
<select id="panelGroupListDefault" resultMap="BaseResultMapDTO">
|
||||
SELECT
|
||||
id,
|
||||
`name`,
|
||||
pid,
|
||||
`level`,
|
||||
node_type,
|
||||
create_by,
|
||||
create_time,
|
||||
panel_type,
|
||||
`name` AS label
|
||||
from panel_group
|
||||
where panel_group.panel_type=#{panelType}
|
||||
</select>
|
||||
|
||||
<select id="panelGroupList" resultMap="BaseResultMapDTO">
|
||||
SELECT
|
||||
id,
|
||||
|
||||
@@ -16,5 +16,13 @@ public class PanelConstants {
|
||||
|
||||
public final static String TEMPLATE_TYPE_SELF = "self";
|
||||
|
||||
public final static String PANEL_TYPE_SYSTEM = "system";
|
||||
|
||||
public final static String PANEL_TYPE_SELF = "self";
|
||||
|
||||
public final static String PANEL_NODE_TYPE_FOlDER = "folder";
|
||||
|
||||
public final static String PANEL_NODE_TYPE_PANEL = "panel";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ public class PanelGroupRequest extends PanelGroupDTO {
|
||||
|
||||
private String userId;
|
||||
|
||||
private String optType;
|
||||
|
||||
public PanelGroupRequest() {
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class PanelGroupService {
|
||||
}
|
||||
|
||||
public List<PanelGroupDTO> getDefaultTree(PanelGroupRequest panelGroupRequest) {
|
||||
return extPanelGroupMapper.panelGroupList(panelGroupRequest);
|
||||
return extPanelGroupMapper.panelGroupListDefault(panelGroupRequest);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,19 @@ public class PanelGroupService {
|
||||
request.setCreateBy(AuthUtils.getUser().getUsername());
|
||||
panelGroupMapper.insert(request);
|
||||
} else {
|
||||
panelGroupMapper.updateByPrimaryKeySelective(request);
|
||||
// 复制为默认仪表盘
|
||||
if("toDefaultPanel".equals(request.getOptType())){
|
||||
PanelGroupWithBLOBs newDefaultPanel = panelGroupMapper.selectByPrimaryKey(request.getId());
|
||||
newDefaultPanel.setPanelType(PanelConstants.PANEL_TYPE_SYSTEM);
|
||||
newDefaultPanel.setNodeType(PanelConstants.PANEL_NODE_TYPE_PANEL);
|
||||
newDefaultPanel.setName(request.getName());
|
||||
newDefaultPanel.setId(UUID.randomUUID().toString());
|
||||
newDefaultPanel.setPid(null);
|
||||
newDefaultPanel.setLevel(0);
|
||||
panelGroupMapper.insertSelective(newDefaultPanel);
|
||||
}else{
|
||||
panelGroupMapper.updateByPrimaryKeySelective(request);
|
||||
}
|
||||
}
|
||||
PanelGroupDTO panelGroupDTO = new PanelGroupDTO();
|
||||
BeanUtils.copyBean(panelGroupDTO, request);
|
||||
|
||||
Reference in New Issue
Block a user