fix(X-Pack): [工作台]给角色分配了数据填报的权限后,如果不分配仪表板/大屏/数据源/数据集的权限时,填报人无法查看自己的填报任务

修改为默认直接展示“我的填报”
This commit is contained in:
ulleo 2024-11-19 17:17:45 +08:00
parent dfe57468f3
commit f7bdd0fb20

View File

@ -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_pc_outlined from '@/assets/svg/icon_pc_outlined.svg'
import icon_cancel_store from '@/assets/svg/icon_cancel_store.svg' import icon_cancel_store from '@/assets/svg/icon_cancel_store.svg'
import { useI18n } from '@/hooks/web/useI18n' 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 type { TabsPaneContext } from 'element-plus-secondary'
import GridTable from '@/components/grid-table/src/GridTable.vue' import GridTable from '@/components/grid-table/src/GridTable.vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -34,6 +34,7 @@ const appStore = useAppStoreWithOut()
const embeddedStore = useEmbedded() const embeddedStore = useEmbedded()
import { useShareStoreWithOut } from '@/store/modules/share' import { useShareStoreWithOut } from '@/store/modules/share'
import { cloneDeep } from 'lodash-es'
const shareStore = useShareStoreWithOut() const shareStore = useShareStoreWithOut()
const { push } = useRouter() const { push } = useRouter()
defineProps({ defineProps({
@ -89,8 +90,8 @@ const getBusiListWithPermission = () => {
busiFlagList.push(baseFlagList[parseInt(key)]) busiFlagList.push(baseFlagList[parseInt(key)])
} }
} }
tablePaneList.value[0].disabled = !busiFlagList?.length baseTablePaneList.value[0].disabled = !busiFlagList?.length
tablePaneList.value[1].disabled = baseTablePaneList.value[1].disabled =
!busiFlagList.includes('panel') && !busiFlagList.includes('screen') !busiFlagList.includes('panel') && !busiFlagList.includes('screen')
return busiFlagList 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.recently_used'), name: 'recent', disabled: false },
{ title: t('work_branch.my_collection'), name: 'store', disabled: false }, { title: t('work_branch.my_collection'), name: 'store', disabled: false },
{ title: t('visualization.share_out'), name: 'share', disabled: false } { title: t('visualization.share_out'), name: 'share', disabled: false }
]) ])
const dfTablePaneList = ref([])
const loadedDataFilling = data => { const loadedDataFilling = data => {
tablePaneList.value.push(data) dfTablePaneList.value.push(data)
} }
const busiAuthList = getBusiListWithPermission() 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(() => { onMounted(() => {
!!busiAuthList.length && !!busiAuthList.length &&
handleClick({ handleClick({
@ -251,7 +275,7 @@ const getEmptyDesc = (): string => {
<div <div
class="dashboard-type" class="dashboard-type"
:class="expand && 'expand'" :class="expand && 'expand'"
v-if="busiAuthList.length" v-if="tablePaneList.length"
v-loading="loading" v-loading="loading"
> >
<el-tabs v-model="activeName" class="dashboard-type-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="dashboard-type-tabs" @tab-click="handleClick">
@ -276,6 +300,7 @@ const getEmptyDesc = (): string => {
</template> </template>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<template v-if="busiAuthList.length">
<share-grid v-if="!shareDisable" :active-name="activeName" @set-loading="setLoading" /> <share-grid v-if="!shareDisable" :active-name="activeName" @set-loading="setLoading" />
<el-row v-if="activeName === 'recent' || activeName === 'store'"> <el-row v-if="activeName === 'recent' || activeName === 'store'">
<el-col :span="12"> <el-col :span="12">
@ -325,11 +350,16 @@ const getEmptyDesc = (): string => {
<div class="name-content" :class="{ 'jump-active': jumpActiveCheck(scope.row) }"> <div class="name-content" :class="{ 'jump-active': jumpActiveCheck(scope.row) }">
<el-icon v-if="scope.row.extFlag" style="margin-right: 12px; font-size: 18px"> <el-icon v-if="scope.row.extFlag" style="margin-right: 12px; font-size: 18px">
<Icon <Icon
><component class="svg-icon" :is="iconMap[scope.row.type + 'Mobile']"></component ><component
class="svg-icon"
:is="iconMap[scope.row.type + 'Mobile']"
></component
></Icon> ></Icon>
</el-icon> </el-icon>
<el-icon v-else :class="`main-color color-${scope.row.type}`"> <el-icon v-else :class="`main-color color-${scope.row.type}`">
<Icon><component class="svg-icon" :is="iconMap[scope.row.type]"></component></Icon> <Icon
><component class="svg-icon" :is="iconMap[scope.row.type]"></component
></Icon>
</el-icon> </el-icon>
<el-tooltip placement="top"> <el-tooltip placement="top">
<template #content>{{ scope.row.name }}</template> <template #content>{{ scope.row.name }}</template>
@ -429,10 +459,7 @@ const getEmptyDesc = (): string => {
</el-table-column> </el-table-column>
</GridTable> </GridTable>
</div> </div>
<XpackComponent </template>
jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5l"
@loaded="loadedDataFilling"
/>
<XpackComponent <XpackComponent
jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5lVGFibGU=" jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5lVGFibGU="
v-if="activeName === 'data-filling'" v-if="activeName === 'data-filling'"
@ -443,6 +470,10 @@ const getEmptyDesc = (): string => {
v-else v-else
:description="t('work_branch.administrator_for_authorization')" :description="t('work_branch.administrator_for_authorization')"
/> />
<XpackComponent
jsname="L21lbnUvZGF0YS9kYXRhLWZpbGxpbmcvZmlsbC9UYWJQYW5l"
@loaded="loadedDataFilling"
/>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>