forked from github/dataease
Merge pull request #9958 from dataease/pr@dev-v2@refactor_workbranch
refactor(工作台): 优化首页资源跳转,解决收藏资源点击未调整到指定页面问题
This commit is contained in:
commit
d3b9e1bf29
@ -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() {
|
||||
|
@ -376,7 +376,7 @@ em {
|
||||
}
|
||||
|
||||
.color-dataV {
|
||||
background: rgb(0, 214, 185);
|
||||
background: rgb(0, 214, 185)!important;
|
||||
}
|
||||
|
||||
.color-dataset {
|
||||
|
@ -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"
|
||||
>
|
||||
<el-table-column key="name" width="280" prop="name" :label="t('common.name')">
|
||||
@ -167,8 +191,8 @@ watch(
|
||||
<el-icon style="margin-right: 12px; font-size: 18px" v-if="scope.row.extFlag">
|
||||
<Icon name="dv-dashboard-spine-mobile"></Icon>
|
||||
</el-icon>
|
||||
<el-icon class="main-color" v-else>
|
||||
<Icon name="icon_dashboard_outlined" />
|
||||
<el-icon v-else :class="`main-color color-${scope.row.type}`">
|
||||
<Icon :name="iconMap[scope.row.type]" />
|
||||
</el-icon>
|
||||
<el-tooltip placement="top">
|
||||
<template #content>{{ scope.row.name }}</template>
|
||||
|
@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -38,4 +38,7 @@ public class XpackShareGridVO implements Serializable {
|
||||
|
||||
private Integer extFlag;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user