Merge pull request #10492 from dataease/dev

merge v1.18.22
This commit is contained in:
fit2cloudrd 2024-06-25 15:14:34 +08:00 committed by GitHub
commit 75ad0db4ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 9 deletions

View File

@ -167,7 +167,7 @@ public class PanelGroupService {
panelGroupRequest.setUserId(userId);
panelGroupRequest.setIsAdmin(AuthUtils.getUser().getIsAdmin());
List<PanelGroupDTO> panelGroupDTOList = extPanelGroupMapper.panelGroupListDefault(panelGroupRequest);
return TreeUtils.mergeTree(panelGroupDTOList, "default_panel");
return TreeUtils.mergeTree(panelGroupDTOList, "0");
}
public List<PanelGroup> list() {

View File

@ -94,7 +94,7 @@
</el-dropdown>
</el-col>
</el-row>
<el-row class="de-tree">
<el-row class="de-tree" v-if="hasDataPermission('view', rootDefaultAuth)">
<span class="header-title">{{ $t('panel.default_panel') }}</span>
<div class="block">
<el-tree
@ -356,7 +356,7 @@
{{ $t('panel.create_public_links') }}
</el-dropdown-item>
<el-dropdown-item
v-if="data.nodeType === 'panel'"
v-if="data.nodeType === 'panel' && hasDataPermission('manage', rootDefaultAuth)"
:disabled="data.isDefault"
icon="el-icon-copy-document"
:command="beforeClickMore('toDefaultPanel', data, node)"
@ -536,6 +536,7 @@ export default {
data() {
return {
rootAuth: '',
rootDefaultAuth: 'view',
originResourceTree: [],
curSortType: 'time_desc',
localSortParams: null,
@ -1041,11 +1042,12 @@ export default {
this.activeDefaultNodeAndClickOnly(this.defaultData[0].id)
}
}
const currentKey = this.$refs.default_panel_tree.getCurrentKey()
defaultTree(requestInfo, false).then((res) => {
localStorage.setItem('panel-default-tree', JSON.stringify(res.data))
this.rootDefaultAuth = res.data ? res.data[0]?.privileges || '' : ''
const resDefaultData = res.data ? res.data[0]?.children || [] : []
localStorage.setItem('panel-default-tree', JSON.stringify(resDefaultData))
if (!userCache) {
this.defaultData = res.data || []
this.defaultData = resDefaultData
if (showFirst && this.defaultData && this.defaultData.length > 0) {
this.activeDefaultNodeAndClickOnly(this.defaultData[0].id)
}
@ -1055,11 +1057,14 @@ export default {
this.$refs.default_panel_tree.filter(this.filterText)
})
}
if (currentKey) {
this.$nextTick(() => {
this.$refs.default_panel_tree.setCurrentKey(currentKey)
const currentKey = this.$refs.default_panel_tree?.getCurrentKey()
if (currentKey) {
this.$nextTick(() =>{
this.$refs.default_panel_tree.setCurrentKey(currentKey)
})
}
})
}
})
},