This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="analysis-dashboard">
|
<div class="analysis-dashboard">
|
||||||
<PollingStats />
|
<PollingStats v-if="hasPermission('dashboard_analysis:polling_stats')" />
|
||||||
<CommissionSummary />
|
<CommissionSummary v-if="hasPermission('dashboard_analysis:commission_summary')" />
|
||||||
<CommissionStats />
|
<CommissionStats v-if="hasPermission('dashboard_analysis:commission_stats')" />
|
||||||
<WithdrawalSettings />
|
<WithdrawalSettings v-if="hasPermission('dashboard_analysis:withdrawal_settings')" />
|
||||||
<ActiveWechatConfig />
|
<ActiveWechatConfig v-if="hasPermission('dashboard_analysis:wechat_config')" />
|
||||||
|
|
||||||
<!--<el-row :gutter="20">-->
|
<!--<el-row :gutter="20">-->
|
||||||
<!-- <el-col :xl="14" :lg="15" :xs="24">-->
|
<!-- <el-col :xl="14" :lg="15" :xs="24">-->
|
||||||
@@ -47,8 +47,11 @@
|
|||||||
import CommissionStats from './widget/CommissionStats.vue'
|
import CommissionStats from './widget/CommissionStats.vue'
|
||||||
import WithdrawalSettings from './widget/WithdrawalSettings.vue'
|
import WithdrawalSettings from './widget/WithdrawalSettings.vue'
|
||||||
import ActiveWechatConfig from './widget/ActiveWechatConfig.vue'
|
import ActiveWechatConfig from './widget/ActiveWechatConfig.vue'
|
||||||
|
import { usePermission } from '@/composables/usePermission'
|
||||||
|
|
||||||
defineOptions({ name: 'Analysis' })
|
defineOptions({ name: 'Analysis' })
|
||||||
|
|
||||||
|
const { hasPermission } = usePermission()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -74,9 +74,12 @@
|
|||||||
import { ElTag } from 'element-plus'
|
import { ElTag } from 'element-plus'
|
||||||
import type { WechatConfig, PaymentProviderType } from '@/types/api'
|
import type { WechatConfig, PaymentProviderType } from '@/types/api'
|
||||||
import { formatDateTime } from '@/utils/business/format'
|
import { formatDateTime } from '@/utils/business/format'
|
||||||
|
import { usePermission } from '@/composables/usePermission'
|
||||||
|
|
||||||
defineOptions({ name: 'ActiveWechatConfigWidget' })
|
defineOptions({ name: 'ActiveWechatConfigWidget' })
|
||||||
|
|
||||||
|
const { hasPermission } = usePermission()
|
||||||
|
|
||||||
// 当前生效的支付配置
|
// 当前生效的支付配置
|
||||||
const activeConfig = ref<WechatConfig | null>(null)
|
const activeConfig = ref<WechatConfig | null>(null)
|
||||||
|
|
||||||
@@ -102,6 +105,11 @@
|
|||||||
|
|
||||||
// 加载当前生效配置
|
// 加载当前生效配置
|
||||||
const loadActiveConfig = async () => {
|
const loadActiveConfig = async () => {
|
||||||
|
// 检查权限,没有权限不调用接口
|
||||||
|
if (!hasPermission('dashboard_analysis:wechat_config')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await WechatConfigService.getActiveWechatConfig()
|
const res = await WechatConfigService.getActiveWechatConfig()
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
|
|||||||
@@ -82,9 +82,11 @@
|
|||||||
import type { CommissionStatsResponse } from '@/types/api/commission'
|
import type { CommissionStatsResponse } from '@/types/api/commission'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { formatMoney } from '@/utils/business/format'
|
import { formatMoney } from '@/utils/business/format'
|
||||||
|
import { usePermission } from '@/composables/usePermission'
|
||||||
|
|
||||||
defineOptions({ name: 'CommissionStatsWidget' })
|
defineOptions({ name: 'CommissionStatsWidget' })
|
||||||
|
|
||||||
|
const { hasPermission } = usePermission()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const currentShopId = computed(() => userStore.info?.shop_id)
|
const currentShopId = computed(() => userStore.info?.shop_id)
|
||||||
|
|
||||||
@@ -97,6 +99,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadCommissionStats = async () => {
|
const loadCommissionStats = async () => {
|
||||||
|
// 检查权限,没有权限不调用接口
|
||||||
|
if (!hasPermission('dashboard_analysis:commission_stats')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!currentShopId.value) return
|
if (!currentShopId.value) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -116,9 +116,11 @@
|
|||||||
import type { MyCommissionSummary } from '@/types/api/commission'
|
import type { MyCommissionSummary } from '@/types/api/commission'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { formatMoney } from '@/utils/business/format'
|
import { formatMoney } from '@/utils/business/format'
|
||||||
|
import { usePermission } from '@/composables/usePermission'
|
||||||
|
|
||||||
defineOptions({ name: 'CommissionSummaryWidget' })
|
defineOptions({ name: 'CommissionSummaryWidget' })
|
||||||
|
|
||||||
|
const { hasPermission } = usePermission()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const currentShopId = computed(() => userStore.info?.shop_id)
|
const currentShopId = computed(() => userStore.info?.shop_id)
|
||||||
@@ -142,6 +144,11 @@
|
|||||||
} | null>(null)
|
} | null>(null)
|
||||||
|
|
||||||
const loadSummary = async () => {
|
const loadSummary = async () => {
|
||||||
|
// 检查权限,没有权限不调用接口
|
||||||
|
if (!hasPermission('dashboard_analysis:commission_summary')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!currentShopId.value) {
|
if (!currentShopId.value) {
|
||||||
errorMsg.value = '当前账号未关联店铺'
|
errorMsg.value = '当前账号未关联店铺'
|
||||||
return
|
return
|
||||||
@@ -181,6 +188,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadWithdrawalSetting = async () => {
|
const loadWithdrawalSetting = async () => {
|
||||||
|
// 检查权限,没有权限不调用接口
|
||||||
|
if (!hasPermission('dashboard_analysis:commission_summary')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await CommissionService.getCurrentWithdrawalSetting()
|
const res = await CommissionService.getCurrentWithdrawalSetting()
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="header-left">
|
<div class="header-left">
|
||||||
<span class="header-title">实时统计</span>
|
<span class="header-title">轮询初始化进度</span>
|
||||||
<ElTag type="primary" effect="dark" size="small">实时</ElTag>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<ElButton size="small" @click="loadOverviewStats" :loading="loading">刷新</ElButton>
|
<ElButton size="small" @click="loadOverviewStats" :loading="loading">刷新</ElButton>
|
||||||
@@ -91,14 +90,21 @@
|
|||||||
import { Document, CircleCheck, User, Box, DataLine } from '@element-plus/icons-vue'
|
import { Document, CircleCheck, User, Box, DataLine } from '@element-plus/icons-vue'
|
||||||
import { PollingMonitorService } from '@/api/modules'
|
import { PollingMonitorService } from '@/api/modules'
|
||||||
import type { PollingOverviewStats } from '@/types/api'
|
import type { PollingOverviewStats } from '@/types/api'
|
||||||
|
import { usePermission } from '@/composables/usePermission'
|
||||||
|
|
||||||
defineOptions({ name: 'PollingStats' })
|
defineOptions({ name: 'PollingStats' })
|
||||||
|
|
||||||
|
const { hasPermission } = usePermission()
|
||||||
const overviewStats = ref<PollingOverviewStats>()
|
const overviewStats = ref<PollingOverviewStats>()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
// 加载总览统计
|
// 加载总览统计
|
||||||
const loadOverviewStats = async () => {
|
const loadOverviewStats = async () => {
|
||||||
|
// 检查权限,没有权限不调用接口
|
||||||
|
if (!hasPermission('dashboard_analysis:polling_stats')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const { data } = await PollingMonitorService.getOverviewStats()
|
const { data } = await PollingMonitorService.getOverviewStats()
|
||||||
|
|||||||
@@ -61,9 +61,11 @@
|
|||||||
import type { DailyCommissionStatsItem } from '@/types/api/commission'
|
import type { DailyCommissionStatsItem } from '@/types/api/commission'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { formatMoney } from '@/utils/business/format'
|
import { formatMoney } from '@/utils/business/format'
|
||||||
|
import { usePermission } from '@/composables/usePermission'
|
||||||
|
|
||||||
defineOptions({ name: 'DailyCommissionStatsWidget' })
|
defineOptions({ name: 'DailyCommissionStatsWidget' })
|
||||||
|
|
||||||
|
const { hasPermission } = usePermission()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const currentShopId = computed(() => userStore.info?.shop_id)
|
const currentShopId = computed(() => userStore.info?.shop_id)
|
||||||
|
|
||||||
@@ -101,6 +103,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadDailyStats = async () => {
|
const loadDailyStats = async () => {
|
||||||
|
// 检查权限,没有权限不调用接口
|
||||||
|
if (!hasPermission('dashboard_analysis:withdrawal_settings')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!currentShopId.value) return
|
if (!currentShopId.value) return
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|||||||
Reference in New Issue
Block a user