Merge pull request #1842 from dataease/v1.8

V1.8
This commit is contained in:
王嘉豪 2022-02-28 11:41:25 +08:00 committed by GitHub
commit 762df101c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 9 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

@ -255,7 +255,9 @@ const data = {
for (let index = 0; index < state.componentData.length; index++) {
const element = state.componentData[index]
if (!element.type || element.type !== 'view') continue
const currentFilters = element.linkageFilters || [] // 当前联动filter
// const currentFilters = element.linkageFilters || [] // 当前联动filter
// 联动的视图情况历史条件
const currentFilters = []
data.dimensionList.forEach(dimension => {
const sourceInfo = viewId + '#' + dimension.id

View File

@ -48,7 +48,7 @@ export const buildFilterMap = panelItems => {
}
if (element.type === 'de-tabs') {
element.options.tabList && element.options.tabList.forEach(tab => {
if (tab.content.propValue && tab.content.propValue.viewId) {
if (tab.content && tab.content.propValue && tab.content.propValue.viewId) {
result[tab.content.propValue.viewId] = []
}
})

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))