From f3c8d7c26e0fd4462fde49df074b8e5dc5b4c025 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 29 May 2024 17:50:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E8=B5=84=E6=BA=90=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=94=B6=E8=97=8F=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E7=82=B9=E5=87=BB=E6=9C=AA=E8=B0=83=E6=95=B4=E5=88=B0?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=A1=B5=E9=9D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/manage/XpackShareManage.java | 2 +- core/core-frontend/src/style/index.less | 2 +- .../src/views/share/share/ShareGrid.vue | 28 +++++++++++++++++-- .../src/views/workbranch/ShortcutTable.vue | 9 +++--- .../api/xpack/share/vo/XpackShareGridVO.java | 3 ++ 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java b/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java index 1a8974802c..5a0584d040 100644 --- a/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java +++ b/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java @@ -174,7 +174,7 @@ public class XpackShareManage { return pos.stream().map(po -> new XpackShareGridVO( po.getShareId(), po.getResourceId(), po.getName(), po.getCreator().toString(), - po.getTime(), po.getExp(), 9,po.getExtFlag())).toList(); + po.getTime(), po.getExp(), 9,po.getExtFlag(),po.getType())).toList(); } private XpackShareManage proxy() { diff --git a/core/core-frontend/src/style/index.less b/core/core-frontend/src/style/index.less index a3e1165209..82cb97a7c9 100644 --- a/core/core-frontend/src/style/index.less +++ b/core/core-frontend/src/style/index.less @@ -376,7 +376,7 @@ em { } .color-dataV { - background: rgb(0, 214, 185); + background: rgb(0, 214, 185)!important; } .color-dataset { diff --git a/core/core-frontend/src/views/share/share/ShareGrid.vue b/core/core-frontend/src/views/share/share/ShareGrid.vue index f690c810c9..3140d06983 100644 --- a/core/core-frontend/src/views/share/share/ShareGrid.vue +++ b/core/core-frontend/src/views/share/share/ShareGrid.vue @@ -105,6 +105,29 @@ const getEmptyDesc = (): string => { return '' } + +const handleCellClick = row => { + if (row) { + const sourceId = row.resourceId + if (['dashboard', 'panel'].includes(row.type)) { + window.open('#/panel/index?dvId=' + sourceId, '_self') + } else if (['dataV', 'screen'].includes(row.type)) { + window.open('#/screen/index?dvId=' + sourceId, '_self') + } + } +} + +const iconMap = { + panel: 'icon_dashboard_outlined', + panelMobile: 'dv-dashboard-spine-mobile', + dashboard: 'icon_dashboard_outlined', + dashboardMobile: 'dv-dashboard-spine-mobile', + screen: 'icon_operation-analysis_outlined', + dataV: 'icon_operation-analysis_outlined', + dataset: 'icon_app_outlined', + datasource: 'icon_database_outlined' +} + watch( () => props.activeName, () => { @@ -159,6 +182,7 @@ watch( @sort-change="sortChange" :empty-desc="emptyDesc" :empty-img="imgType" + @cell-click="handleCellClick" class="workbranch-grid" > @@ -167,8 +191,8 @@ watch( - - + + diff --git a/core/core-frontend/src/views/workbranch/ShortcutTable.vue b/core/core-frontend/src/views/workbranch/ShortcutTable.vue index 6c3dc68b8a..512d748c8a 100644 --- a/core/core-frontend/src/views/workbranch/ShortcutTable.vue +++ b/core/core-frontend/src/views/workbranch/ShortcutTable.vue @@ -163,24 +163,25 @@ const sortChange = param => { const handleCellClick = row => { if (row) { + const sourceId = activeName.value === 'recent' ? row.id : row.resourceId if (['dashboard', 'panel'].includes(row.type)) { - window.open('#/panel/index?dvId=' + row.id, '_self') + window.open('#/panel/index?dvId=' + sourceId, '_self') } else if (['dataV', 'screen'].includes(row.type)) { - window.open('#/screen/index?dvId=' + row.id, '_self') + window.open('#/screen/index?dvId=' + sourceId, '_self') } else if (['dataset'].includes(row.type)) { const routeName = embeddedStore.getToken && appStore.getIsIframe ? 'dataset-embedded' : 'dataset' push({ name: routeName, params: { - id: row.id + id: sourceId } }) } else if (['datasource'].includes(row.type)) { push({ name: 'datasource', params: { - id: row.id + id: sourceId } }) } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/vo/XpackShareGridVO.java b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/vo/XpackShareGridVO.java index 55b37a69b1..4bc9f9d905 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/vo/XpackShareGridVO.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/xpack/share/vo/XpackShareGridVO.java @@ -38,4 +38,7 @@ public class XpackShareGridVO implements Serializable { private Integer extFlag; + @Schema(description = "类型") + private String type; + }