mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 12:03:05 +08:00
fix(X-Pack): [工作台]给角色分配了数据填报的权限后,如果不分配仪表板/大屏/数据源/数据集的权限时,填报人无法查看自己的填报任务
修改为默认直接展示“我的填报”
This commit is contained in:
parent
dfe57468f3
commit
f7bdd0fb20
@ -10,7 +10,7 @@ import dvDashboardSpineMobile from '@/assets/svg/dv-dashboard-spine-mobile.svg'
|
||||
import icon_pc_outlined from '@/assets/svg/icon_pc_outlined.svg'
|
||||
import icon_cancel_store from '@/assets/svg/icon_cancel_store.svg'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ref, reactive, onMounted, computed, watch } from 'vue'
|
||||
import type { TabsPaneContext } from 'element-plus-secondary'
|
||||
import GridTable from '@/components/grid-table/src/GridTable.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@ -34,6 +34,7 @@ const appStore = useAppStoreWithOut()
|
||||
const embeddedStore = useEmbedded()
|
||||
|
||||
import { useShareStoreWithOut } from '@/store/modules/share'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
const shareStore = useShareStoreWithOut()
|
||||
const { push } = useRouter()
|
||||
defineProps({
|
||||
@ -89,8 +90,8 @@ const getBusiListWithPermission = () => {
|
||||
busiFlagList.push(baseFlagList[parseInt(key)])
|
||||
}
|
||||
}
|
||||
tablePaneList.value[0].disabled = !busiFlagList?.length
|
||||
tablePaneList.value[1].disabled =
|
||||
baseTablePaneList.value[0].disabled = !busiFlagList?.length
|
||||
baseTablePaneList.value[1].disabled =
|
||||
!busiFlagList.includes('panel') && !busiFlagList.includes('screen')
|
||||
return busiFlagList
|
||||
}
|
||||
@ -141,17 +142,40 @@ const loadTableData = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const tablePaneList = ref([
|
||||
const baseTablePaneList = ref([
|
||||
{ title: t('work_branch.recently_used'), name: 'recent', disabled: false },
|
||||
{ title: t('work_branch.my_collection'), name: 'store', disabled: false },
|
||||
{ title: t('visualization.share_out'), name: 'share', disabled: false }
|
||||
])
|
||||
|
||||
const dfTablePaneList = ref([])
|
||||
|
||||
const loadedDataFilling = data => {
|
||||
tablePaneList.value.push(data)
|
||||
dfTablePaneList.value.push(data)
|
||||
}
|
||||
|
||||
const busiAuthList = getBusiListWithPermission()
|
||||
|
||||
const tablePaneList = computed(() => {
|
||||
const list = cloneDeep(!!busiAuthList.length ? baseTablePaneList.value : [])
|
||||
for (const valueElement of dfTablePaneList.value) {
|
||||
list.push(valueElement)
|
||||
}
|
||||
return list
|
||||
})
|
||||
|
||||
const firstChangeActiveName = ref(false)
|
||||
|
||||
watch(
|
||||
() => tablePaneList.value.length,
|
||||
(v1, v2) => {
|
||||
if (tablePaneList.value.length > 0 && !firstChangeActiveName.value) {
|
||||
firstChangeActiveName.value = true
|
||||
activeName.value = tablePaneList.value[0].name
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
!!busiAuthList.length &&
|
||||
handleClick({
|
||||
@ -251,7 +275,7 @@ const getEmptyDesc = (): string => {
|
||||
<div
|
||||
class="dashboard-type"
|
||||
:class="expand && 'expand'"
|
||||
v-if="busiAuthList.length"
|
||||
v-if="tablePaneList.length"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-tabs v-model="activeName" class="dashboard-type-tabs" @tab-click="handleClick">
|
||||
@ -276,163 +300,166 @@ const getEmptyDesc = (): string => {
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<share-grid v-if="!shareDisable" :active-name="activeName" @set-loading="setLoading" />
|
||||
<el-row v-if="activeName === 'recent' || activeName === 'store'">
|
||||
<el-col :span="12">
|
||||
<el-select
|
||||
popper-class="menu-panel-select_popper"
|
||||
class="select-type-list"
|
||||
v-model="activeCommand"
|
||||
@change="loadTableData"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in state.curTypeList"
|
||||
:key="item"
|
||||
:label="t(`auth.${item}`)"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col class="search" :span="12">
|
||||
<el-input
|
||||
v-model="panelKeyword"
|
||||
clearable
|
||||
@change="triggerFilterPanel"
|
||||
:placeholder="t('work_branch.search_keyword')"
|
||||
>
|
||||
<template #prefix>
|
||||
<el-icon>
|
||||
<Icon name="icon_search-outline_outlined"
|
||||
><icon_searchOutline_outlined class="svg-icon"
|
||||
/></Icon>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="activeName === 'recent' || activeName === 'store'" class="panel-table">
|
||||
<GridTable
|
||||
:show-pagination="false"
|
||||
:table-data="state.tableData"
|
||||
@sort-change="sortChange"
|
||||
@cell-click="handleCellClick"
|
||||
:empty-desc="emptyDesc"
|
||||
:empty-img="imgType"
|
||||
class="workbranch-grid"
|
||||
>
|
||||
<el-table-column key="name" width="280" prop="name" :label="t('common.name')">
|
||||
<template v-slot:default="scope">
|
||||
<div class="name-content" :class="{ 'jump-active': jumpActiveCheck(scope.row) }">
|
||||
<el-icon v-if="scope.row.extFlag" style="margin-right: 12px; font-size: 18px">
|
||||
<Icon
|
||||
><component class="svg-icon" :is="iconMap[scope.row.type + 'Mobile']"></component
|
||||
></Icon>
|
||||
<template v-if="busiAuthList.length">
|
||||
<share-grid v-if="!shareDisable" :active-name="activeName" @set-loading="setLoading" />
|
||||
<el-row v-if="activeName === 'recent' || activeName === 'store'">
|
||||
<el-col :span="12">
|
||||
<el-select
|
||||
popper-class="menu-panel-select_popper"
|
||||
class="select-type-list"
|
||||
v-model="activeCommand"
|
||||
@change="loadTableData"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in state.curTypeList"
|
||||
:key="item"
|
||||
:label="t(`auth.${item}`)"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col class="search" :span="12">
|
||||
<el-input
|
||||
v-model="panelKeyword"
|
||||
clearable
|
||||
@change="triggerFilterPanel"
|
||||
:placeholder="t('work_branch.search_keyword')"
|
||||
>
|
||||
<template #prefix>
|
||||
<el-icon>
|
||||
<Icon name="icon_search-outline_outlined"
|
||||
><icon_searchOutline_outlined class="svg-icon"
|
||||
/></Icon>
|
||||
</el-icon>
|
||||
<el-icon v-else :class="`main-color color-${scope.row.type}`">
|
||||
<Icon><component class="svg-icon" :is="iconMap[scope.row.type]"></component></Icon>
|
||||
</el-icon>
|
||||
<el-tooltip placement="top">
|
||||
<template #content>{{ scope.row.name }}</template>
|
||||
<span class="ellipsis" style="max-width: 250px">{{ scope.row.name }}</span>
|
||||
</el-tooltip>
|
||||
<el-icon
|
||||
v-if="activeName === 'recent' && ['screen', 'panel'].includes(scope.row.type)"
|
||||
class="custom-icon"
|
||||
@click.stop="executeStore(scope.row)"
|
||||
:style="{ color: scope.row.favorite ? '#FFC60A' : '#646A73' }"
|
||||
>
|
||||
<icon
|
||||
><component
|
||||
:is="scope.row.favorite ? visualStar : icon_collection_outlined"
|
||||
></component
|
||||
></icon>
|
||||
</el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in state.tableColumn"
|
||||
:key="item.label"
|
||||
:prop="item.field"
|
||||
show-overflow-tooltip
|
||||
:sortable="item.type === 'time'"
|
||||
:label="item.label"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span :class="{ 'jump-active': jumpActiveCheck(scope.row) }">
|
||||
<span v-if="item.type && item.type === 'time'">{{
|
||||
formatterTime(null, null, scope.row[item.field])
|
||||
}}</span>
|
||||
<span v-else-if="item.field && item.field === 'type'">{{
|
||||
typeMap[scope.row[item.field]]
|
||||
}}</span>
|
||||
<span v-else-if="desktop && item.field && item.field.endsWith('tor')">{{
|
||||
userStore.getName
|
||||
}}</span>
|
||||
<span v-else>{{ scope.row[item.field] }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="100" fixed="right" key="_operation" :label="$t('common.operate')">
|
||||
<template #default="scope">
|
||||
<template v-if="['dashboard', 'dataV', 'panel', 'screen'].includes(scope.row.type)">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="t('work_branch.new_page_preview')"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon
|
||||
class="hover-icon hover-icon-in-table"
|
||||
@click.stop="
|
||||
preview(activeName === 'recent' ? scope.row.id : scope.row.resourceId)
|
||||
"
|
||||
>
|
||||
<Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<ShareHandler
|
||||
v-if="!shareDisable"
|
||||
:in-grid="true"
|
||||
:weight="scope.row.weight"
|
||||
:resource-id="activeName === 'recent' ? scope.row.id : scope.row.resourceId"
|
||||
:resource-type="scope.row.type"
|
||||
/>
|
||||
<el-tooltip
|
||||
v-if="activeName === 'store'"
|
||||
effect="dark"
|
||||
:content="t('work_branch.cancel_favorites')"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon
|
||||
class="hover-icon hover-icon-in-table"
|
||||
@click.stop="executeCancelStore(scope.row)"
|
||||
>
|
||||
<Icon name="icon_cancel_store"><icon_cancel_store class="svg-icon" /></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="['dataset'].includes(scope.row.type)">
|
||||
<el-tooltip effect="dark" :content="t('work_branch.open_dataset')" placement="top">
|
||||
<el-icon
|
||||
class="hover-icon hover-icon-in-table"
|
||||
@click.stop="
|
||||
openDataset(activeName === 'recent' ? scope.row.id : scope.row.resourceId)
|
||||
"
|
||||
>
|
||||
<Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div v-if="activeName === 'recent' || activeName === 'store'" class="panel-table">
|
||||
<GridTable
|
||||
:show-pagination="false"
|
||||
:table-data="state.tableData"
|
||||
@sort-change="sortChange"
|
||||
@cell-click="handleCellClick"
|
||||
:empty-desc="emptyDesc"
|
||||
:empty-img="imgType"
|
||||
class="workbranch-grid"
|
||||
>
|
||||
<el-table-column key="name" width="280" prop="name" :label="t('common.name')">
|
||||
<template v-slot:default="scope">
|
||||
<div class="name-content" :class="{ 'jump-active': jumpActiveCheck(scope.row) }">
|
||||
<el-icon v-if="scope.row.extFlag" style="margin-right: 12px; font-size: 18px">
|
||||
<Icon
|
||||
><component
|
||||
class="svg-icon"
|
||||
:is="iconMap[scope.row.type + 'Mobile']"
|
||||
></component
|
||||
></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<el-icon v-else :class="`main-color color-${scope.row.type}`">
|
||||
<Icon
|
||||
><component class="svg-icon" :is="iconMap[scope.row.type]"></component
|
||||
></Icon>
|
||||
</el-icon>
|
||||
<el-tooltip placement="top">
|
||||
<template #content>{{ scope.row.name }}</template>
|
||||
<span class="ellipsis" style="max-width: 250px">{{ scope.row.name }}</span>
|
||||
</el-tooltip>
|
||||
<el-icon
|
||||
v-if="activeName === 'recent' && ['screen', 'panel'].includes(scope.row.type)"
|
||||
class="custom-icon"
|
||||
@click.stop="executeStore(scope.row)"
|
||||
:style="{ color: scope.row.favorite ? '#FFC60A' : '#646A73' }"
|
||||
>
|
||||
<icon
|
||||
><component
|
||||
:is="scope.row.favorite ? visualStar : icon_collection_outlined"
|
||||
></component
|
||||
></icon>
|
||||
</el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</GridTable>
|
||||
</div>
|
||||
<XpackComponent
|
||||
jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5l"
|
||||
@loaded="loadedDataFilling"
|
||||
/>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in state.tableColumn"
|
||||
:key="item.label"
|
||||
:prop="item.field"
|
||||
show-overflow-tooltip
|
||||
:sortable="item.type === 'time'"
|
||||
:label="item.label"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span :class="{ 'jump-active': jumpActiveCheck(scope.row) }">
|
||||
<span v-if="item.type && item.type === 'time'">{{
|
||||
formatterTime(null, null, scope.row[item.field])
|
||||
}}</span>
|
||||
<span v-else-if="item.field && item.field === 'type'">{{
|
||||
typeMap[scope.row[item.field]]
|
||||
}}</span>
|
||||
<span v-else-if="desktop && item.field && item.field.endsWith('tor')">{{
|
||||
userStore.getName
|
||||
}}</span>
|
||||
<span v-else>{{ scope.row[item.field] }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="100" fixed="right" key="_operation" :label="$t('common.operate')">
|
||||
<template #default="scope">
|
||||
<template v-if="['dashboard', 'dataV', 'panel', 'screen'].includes(scope.row.type)">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="t('work_branch.new_page_preview')"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon
|
||||
class="hover-icon hover-icon-in-table"
|
||||
@click.stop="
|
||||
preview(activeName === 'recent' ? scope.row.id : scope.row.resourceId)
|
||||
"
|
||||
>
|
||||
<Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
<ShareHandler
|
||||
v-if="!shareDisable"
|
||||
:in-grid="true"
|
||||
:weight="scope.row.weight"
|
||||
:resource-id="activeName === 'recent' ? scope.row.id : scope.row.resourceId"
|
||||
:resource-type="scope.row.type"
|
||||
/>
|
||||
<el-tooltip
|
||||
v-if="activeName === 'store'"
|
||||
effect="dark"
|
||||
:content="t('work_branch.cancel_favorites')"
|
||||
placement="top"
|
||||
>
|
||||
<el-icon
|
||||
class="hover-icon hover-icon-in-table"
|
||||
@click.stop="executeCancelStore(scope.row)"
|
||||
>
|
||||
<Icon name="icon_cancel_store"><icon_cancel_store class="svg-icon" /></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="['dataset'].includes(scope.row.type)">
|
||||
<el-tooltip effect="dark" :content="t('work_branch.open_dataset')" placement="top">
|
||||
<el-icon
|
||||
class="hover-icon hover-icon-in-table"
|
||||
@click.stop="
|
||||
openDataset(activeName === 'recent' ? scope.row.id : scope.row.resourceId)
|
||||
"
|
||||
>
|
||||
<Icon name="icon_pc_outlined"><icon_pc_outlined class="svg-icon" /></Icon>
|
||||
</el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</GridTable>
|
||||
</div>
|
||||
</template>
|
||||
<XpackComponent
|
||||
jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5lVGFibGU="
|
||||
v-if="activeName === 'data-filling'"
|
||||
@ -443,6 +470,10 @@ const getEmptyDesc = (): string => {
|
||||
v-else
|
||||
:description="t('work_branch.administrator_for_authorization')"
|
||||
/>
|
||||
<XpackComponent
|
||||
jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5l"
|
||||
@loaded="loadedDataFilling"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user