fix: 自己创建的仪表板右上角没有编辑按钮

This commit is contained in:
wangjiahao 2022-02-28 11:35:32 +08:00
parent a0893ae0e0
commit 7aaad18dd9
5 changed files with 11 additions and 7 deletions

View File

@ -15,7 +15,7 @@ public interface ExtPanelGroupMapper {
//会级联删除pid 下的所有数据
int deleteCircle(@Param("pid") String pid);
PanelGroupDTO panelGroup(String id);
PanelGroupDTO findOneWithPrivileges(@Param("panelId") String panelId,@Param("userId") String userId);
void copyPanelView(@Param("pid") String panelId);
@ -24,4 +24,6 @@ public interface ExtPanelGroupMapper {
List<PanelGroupDTO> panelGroupInit();
}

View File

@ -12,8 +12,8 @@
<result column="is_default" property="isDefault"/>
</resultMap>
<select id="panelGroup" resultMap="BaseResultMapDTO">
select panel_group.*,panel_group.name as label from panel_group where id =#{id}
<select id="findOneWithPrivileges" resultMap="BaseResultMapDTO">
select panel_group.*,panel_group.name as label , get_auths(panel_group.id,'panel',#{userId}) as `privileges` from panel_group where id =#{panelId}
</select>
<select id="panelGroupInit" resultMap="BaseResultMapDTO">

View File

@ -206,9 +206,9 @@ public class PanelGroupService {
public PanelGroupWithBLOBs findOne(String panelId) {
PanelGroupWithBLOBs panelGroupWithBLOBs = panelGroupMapper.selectByPrimaryKey(panelId);
PanelGroupWithBLOBs panelGroupWithBLOBs = extPanelGroupMapper.findOneWithPrivileges(panelId,String.valueOf(AuthUtils.getUser().getUserId()));
if (panelGroupWithBLOBs != null && StringUtils.isNotEmpty(panelGroupWithBLOBs.getSource())) {
return panelGroupMapper.selectByPrimaryKey(panelGroupWithBLOBs.getSource());
return extPanelGroupMapper.findOneWithPrivileges(panelGroupWithBLOBs.getSource(),String.valueOf(AuthUtils.getUser().getUserId()));
}
return panelGroupWithBLOBs;
}

View File

@ -141,7 +141,8 @@ export function initPanelData(panelId, callback) {
// 设置当前仪表板全局信息
store.dispatch('panel/setPanelInfo', {
id: response.data.id,
name: response.data.name
name: response.data.name,
privileges: response.data.privileges
})
// 刷新联动信息
getPanelAllLinkageInfo(panelId).then(rsp => {

View File

@ -39,7 +39,8 @@ export default {
loadResource(this.resourceId).then(res => {
this.$store.dispatch('panel/setPanelInfo', {
id: res.data.id,
name: res.data.name
name: res.data.name,
privileges: res.data.privileges
})
panelInit(JSON.parse(res.data.panelData), JSON.parse(res.data.panelStyle))