DELETE
FROM
- chart_view
+ chart_view
WHERE
- chart_view.chart_type = 'private'
- AND chart_view.scene_id = #{panelId}
+ chart_view.chart_type = 'private'
+ AND chart_view.scene_id = #{panelId}
AND id NOT IN
-
+
#{viewId}
diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
index ed05bbbf6d..5ad6ab684e 100644
--- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
+++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
@@ -947,4 +947,15 @@ public class PanelGroupService {
//数据源变更
panelAppTemplateService.editDatasource(request.getDatasourceList());
}
+
+ public void toTop(String panelId) {
+ Long time = System.currentTimeMillis();
+ PanelGroupWithBLOBs request = new PanelGroupWithBLOBs();
+ request.setId(panelId);
+ request.setPanelSort(time);
+ request.setUpdateTime(time);
+ request.setUpdateBy(AuthUtils.getUser().getUsername());
+ panelGroupMapper.updateByPrimaryKeySelective(request);
+
+ }
}
diff --git a/backend/src/main/resources/db/migration/V44__1.17.sql b/backend/src/main/resources/db/migration/V44__1.17.sql
index 0726c5ed68..30b3206948 100644
--- a/backend/src/main/resources/db/migration/V44__1.17.sql
+++ b/backend/src/main/resources/db/migration/V44__1.17.sql
@@ -36,3 +36,6 @@ WHERE (`component` = 'msg/all');
UPDATE `sys_menu`
SET `component` = 'msg/Setting'
WHERE (`component` = 'msg/setting');
+
+ALTER TABLE `panel_group`
+ ADD COLUMN `panel_sort` bigint(13) NULL COMMENT '排序' AFTER `watermark_open`;
diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js
index dc41cd5079..6bd6714b92 100644
--- a/frontend/src/api/panel/panel.js
+++ b/frontend/src/api/panel/panel.js
@@ -358,3 +358,11 @@ export function findOneWithParent(panelId) {
loading: false
})
}
+
+export function panelToTop(panelId) {
+ return request({
+ url: 'panel/group/toTop/' + panelId,
+ method: 'post',
+ loading: false
+ })
+}
diff --git a/frontend/src/components/canvas/components/editor/EditBar.vue b/frontend/src/components/canvas/components/editor/EditBar.vue
index 5802d847ca..6a4d7bd3c2 100644
--- a/frontend/src/components/canvas/components/editor/EditBar.vue
+++ b/frontend/src/components/canvas/components/editor/EditBar.vue
@@ -137,7 +137,7 @@
:target="curComponent.hyperlinks.openMode "
:href="curComponent.hyperlinks.content "
>
-
+
diff --git a/frontend/src/components/canvas/components/editor/Preview.vue b/frontend/src/components/canvas/components/editor/Preview.vue
index a304a149cd..ed527059d7 100644
--- a/frontend/src/components/canvas/components/editor/Preview.vue
+++ b/frontend/src/components/canvas/components/editor/Preview.vue
@@ -9,7 +9,7 @@
:style="customStyle"
@scroll="canvasScroll"
>
-
+
-
+
{{ data.name }}
+
+
+
{
+ this.defaultTree()
+ })
+ },
fromAppActive() {
this.activeNodeAndClickOnly(this.lastActiveNode)
this.clearLocalStorage.forEach((item) => {
@@ -637,7 +667,7 @@ export default {
closeEditPanelDialog(panelInfo) {
this.editPanel.visible = false
if (panelInfo) {
- this.defaultTree()
+ this.defaultTree(false)
this.tree()
if (this.editPanel.optType === 'rename' && panelInfo.id === this.$store.state.panel.panelInfo.id) {
this.$store.state.panel.panelInfo.name = panelInfo.name
@@ -809,7 +839,7 @@ export default {
showClose: true
})
this.tree()
- this.defaultTree()
+ this.defaultTree(false)
})
} else {
this.$message({
@@ -837,7 +867,7 @@ export default {
})
this.clearCanvas()
this.tree()
- this.defaultTree()
+ this.defaultTree(false)
})
})
.catch(() => {
@@ -887,7 +917,7 @@ export default {
}
})
},
- defaultTree(cache = false) {
+ defaultTree(cache = false, showFirst = false) {
const requestInfo = {
panelType: 'system'
}
@@ -896,21 +926,38 @@ export default {
if (userCache) {
this.defaultData = JSON.parse(modelInfo)
+ if (showFirst && this.defaultData.length > 0) {
+ 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))
if (!userCache) {
this.defaultData = res.data
+ if (showFirst && this.defaultData.length > 0) {
+ this.activeDefaultNodeAndClickOnly(this.defaultData[0].id)
+ }
}
if (this.filterText) {
this.$nextTick(() => {
this.$refs.default_panel_tree.filter(this.filterText)
})
}
+ if (currentKey) {
+ this.$nextTick(() => {
+ this.$refs.default_panel_tree.setCurrentKey(currentKey)
+ })
+ }
})
},
nodeClick(data, node) {
+ if (data.panelType === 'self') {
+ this.$refs.default_panel_tree.setCurrentKey(null)
+ } else {
+ this.$refs.panel_list_tree.setCurrentKey(null)
+ }
this.lastActiveNode = node
this.lastActiveNodeData = data
this.activeTree = data.panelType
@@ -1029,6 +1076,20 @@ export default {
})
}
},
+ // 激活当前默认仪表板节点节点
+ activeDefaultNodeAndClickOnly(panelId) {
+ if (panelId) {
+ const _this = this
+ _this.$nextTick(() => {
+ _this.$refs.panel_list_tree.setCurrentKey(null)
+ // 延迟设置CurrentKey
+ _this.$refs.default_panel_tree.setCurrentKey(panelId)
+ _this.$nextTick(() => {
+ document.querySelector('.is-current').firstChild.click()
+ })
+ })
+ }
+ },
moveTo(data) {
const _this = this
this.moveInfo = data