refactor: 移除佣金比例字段,将developer统一为admin

This commit is contained in:
2026-05-01 08:08:11 +08:00
parent c5d1dc4b04
commit 4ed00f29e2
235 changed files with 9082 additions and 8952 deletions
+48 -48
View File
@@ -107,10 +107,10 @@ function getTicketStatusColor(status: string) {
function getTicketStatusText(status: string) {
const texts: Record<string, string> = {
open: t('developer.ticketStatusOpen'),
processing: t('developer.ticketStatusProcessing'),
resolved: t('developer.ticketStatusResolved'),
closed: t('developer.ticketStatusClosed'),
open: t('admin.ticketStatusOpen'),
processing: t('admin.ticketStatusProcessing'),
resolved: t('admin.ticketStatusResolved'),
closed: t('admin.ticketStatusClosed'),
}
return texts[status] || status
}
@@ -127,20 +127,20 @@ function getTicketPriorityColor(priority: string) {
function getTicketPriorityText(priority: string) {
const texts: Record<string, string> = {
low: t('developer.priorityLow'),
normal: t('developer.priorityNormal'),
high: t('developer.priorityHigh'),
urgent: t('developer.priorityUrgent'),
low: t('admin.priorityLow'),
normal: t('admin.priorityNormal'),
high: t('admin.priorityHigh'),
urgent: t('admin.priorityUrgent'),
}
return texts[priority] || priority
}
function goToTicket(ticketId: number) {
router.push(`/developer/tickets/${ticketId}`)
router.push(`/admin/tickets/${ticketId}`)
}
function goToTickets() {
router.push('/developer/tickets')
router.push('/admin/tickets')
}
async function fetchDashboard() {
@@ -196,21 +196,21 @@ async function fetchDashboard() {
if (data.data.recentActivities && Array.isArray(data.data.recentActivities)) {
recentActivities.value = data.data.recentActivities.map((log: any) => {
let icon = 'lucide:activity'
let title = log.action || t('developer.operation')
let description = log.details || log.resource || t('developer.noDescription')
let title = log.action || t('admin.operation')
let description = log.details || log.resource || t('admin.noDescription')
if (log.log_type === 'operation') {
icon = 'lucide:plus-circle'
title = t('developer.operationRecord')
title = t('admin.operationRecord')
}
else if (log.log_type === 'verification') {
icon = 'lucide:check-circle'
title = t('developer.cardVerification')
description = `${t('developer.verification')}${log.status === 'success' ? t('developer.success') : t('developer.failed')}`
title = t('admin.cardVerification')
description = `${t('admin.verification')}${log.status === 'success' ? t('admin.success') : t('admin.failed')}`
}
else if (log.log_type === 'exception') {
icon = 'lucide:alert-circle'
title = t('developer.exceptionRecord')
title = t('admin.exceptionRecord')
}
return {
@@ -238,7 +238,7 @@ async function fetchDashboard() {
}
}
catch (error) {
console.error(t('developer.fetchDashboardError'), error)
console.error(t('admin.fetchDashboardError'), error)
}
finally {
loading.value = false
@@ -276,7 +276,7 @@ async function initMapChart() {
})
}
catch (error) {
console.error(t('developer.initMapError'), error)
console.error(t('admin.initMapError'), error)
}
}
@@ -298,12 +298,12 @@ function updateMapOption() {
if (params.data && params.data.count > 0) {
return `<div style="padding: 8px;">
<div style="font-weight: bold; margin-bottom: 4px; color: #f8fafc;">${params.name}</div>
<div style="color: #cbd5e1;">${t('developer.userCount')}: ${params.data.count}</div>
<div style="color: #cbd5e1;">${t('admin.userCount')}: ${params.data.count}</div>
</div>`
}
return `<div style="padding: 8px;">
<div style="font-weight: bold; margin-bottom: 4px; color: #f8fafc;">${params.name}</div>
<div style="color: #cbd5e1;">${t('developer.noUserData')}</div>
<div style="color: #cbd5e1;">${t('admin.noUserData')}</div>
</div>`
},
},
@@ -342,7 +342,7 @@ function updateMapOption() {
},
series: [
{
name: t('developer.userDistribution'),
name: t('admin.userDistribution'),
type: 'map',
geoIndex: 0,
data,
@@ -383,7 +383,7 @@ function initActivityChart() {
labels,
datasets: [
{
label: t('developer.verificationCount'),
label: t('admin.verificationCount'),
data,
borderColor: '#3b82f6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
@@ -413,7 +413,7 @@ function initActivityChart() {
padding: 12,
displayColors: false,
callbacks: {
label: (context: any) => `${context.parsed.y} ${t('developer.online')}`,
label: (context: any) => `${context.parsed.y} ${t('admin.online')}`,
},
},
},
@@ -451,7 +451,7 @@ function initActivityChart() {
})
}
catch (error) {
console.error(t('developer.initActivityChartError'), error)
console.error(t('admin.initActivityChartError'), error)
}
}
@@ -478,14 +478,14 @@ onUnmounted(() => {
<template>
<BasicPage
:title="t('developer.dashboard')"
:description="`${t('developer.welcomeBack')}, ${currentUser?.username || t('developer.developer')}`"
:title="t('admin.dashboard')"
:description="`${t('admin.welcomeBack')}, ${currentUser?.username || t('admin.developer')}`"
>
<div v-if="loading" class="flex items-center justify-center py-12">
<div class="text-center">
<Icon icon="lucide:loader-2" class="size-8 animate-spin mx-auto text-muted-foreground" />
<p class="mt-4 text-muted-foreground">
{{ t('developer.loading') }}...
{{ t('admin.loading') }}...
</p>
</div>
</div>
@@ -495,7 +495,7 @@ onUnmounted(() => {
<UiCard>
<UiCardHeader class="flex flex-row items-center justify-between pb-2 space-y-0">
<UiCardTitle class="text-sm font-medium">
{{ t('developer.totalApplications') }}
{{ t('admin.totalApplications') }}
</UiCardTitle>
<Icon icon="lucide:layout-grid" class="size-4 text-muted-foreground" />
</UiCardHeader>
@@ -504,7 +504,7 @@ onUnmounted(() => {
{{ formatNumber(stats.totalApplications) }}
</div>
<p class="text-xs text-muted-foreground">
+12.5% {{ t('developer.lastMonth') }}
+12.5% {{ t('admin.lastMonth') }}
</p>
</UiCardContent>
</UiCard>
@@ -512,7 +512,7 @@ onUnmounted(() => {
<UiCard>
<UiCardHeader class="flex flex-row items-center justify-between pb-2 space-y-0">
<UiCardTitle class="text-sm font-medium">
{{ t('developer.totalCards') }}
{{ t('admin.totalCards') }}
</UiCardTitle>
<Icon icon="lucide:key" class="size-4 text-muted-foreground" />
</UiCardHeader>
@@ -521,7 +521,7 @@ onUnmounted(() => {
{{ formatNumber(stats.totalCards) }}
</div>
<p class="text-xs text-muted-foreground">
+8.2% {{ t('developer.lastMonth') }}
+8.2% {{ t('admin.lastMonth') }}
</p>
</UiCardContent>
</UiCard>
@@ -529,7 +529,7 @@ onUnmounted(() => {
<UiCard>
<UiCardHeader class="flex flex-row items-center justify-between pb-2 space-y-0">
<UiCardTitle class="text-sm font-medium">
{{ t('developer.totalUsers') }}
{{ t('admin.totalUsers') }}
</UiCardTitle>
<Icon icon="lucide:users" class="size-4 text-muted-foreground" />
</UiCardHeader>
@@ -538,7 +538,7 @@ onUnmounted(() => {
{{ formatNumber(totalUsers) }}
</div>
<p class="text-xs text-muted-foreground">
+15.3% {{ t('developer.lastMonth') }}
+15.3% {{ t('admin.lastMonth') }}
</p>
</UiCardContent>
</UiCard>
@@ -546,7 +546,7 @@ onUnmounted(() => {
<UiCard>
<UiCardHeader class="flex flex-row items-center justify-between pb-2 space-y-0">
<UiCardTitle class="text-sm font-medium">
{{ t('developer.monthlyRevenue') }}
{{ t('admin.monthlyRevenue') }}
</UiCardTitle>
<Icon icon="lucide:dollar-sign" class="size-4 text-muted-foreground" />
</UiCardHeader>
@@ -555,7 +555,7 @@ onUnmounted(() => {
¥{{ formatNumber(stats.monthlyRevenue) }}
</div>
<p class="text-xs text-muted-foreground">
+23.1% {{ t('developer.lastMonth') }}
+23.1% {{ t('admin.lastMonth') }}
</p>
</UiCardContent>
</UiCard>
@@ -566,17 +566,17 @@ onUnmounted(() => {
<UiCardHeader>
<div class="flex items-center justify-between">
<div>
<UiCardTitle>{{ t('developer.userDistribution') }}</UiCardTitle>
<UiCardDescription>{{ t('developer.userDistributionDesc') }}</UiCardDescription>
<UiCardTitle>{{ t('admin.userDistribution') }}</UiCardTitle>
<UiCardDescription>{{ t('admin.userDistributionDesc') }}</UiCardDescription>
</div>
<div class="flex items-center gap-4 text-sm">
<div class="flex items-center gap-2">
<div class="size-3 rounded-full bg-blue-500" />
<span class="text-muted-foreground">{{ t('developer.domesticUsers') }}: {{ formatNumber(domesticUsers) }}</span>
<span class="text-muted-foreground">{{ t('admin.domesticUsers') }}: {{ formatNumber(domesticUsers) }}</span>
</div>
<div class="flex items-center gap-2">
<div class="size-3 rounded-full bg-green-500" />
<span class="text-muted-foreground">{{ t('developer.overseasUsers') }}: {{ formatNumber(overseasUsers) }}</span>
<span class="text-muted-foreground">{{ t('admin.overseasUsers') }}: {{ formatNumber(overseasUsers) }}</span>
</div>
</div>
</div>
@@ -590,8 +590,8 @@ onUnmounted(() => {
<UiCard>
<UiCardHeader>
<UiCardTitle>{{ t('developer.onlineTrend') }}</UiCardTitle>
<UiCardDescription>{{ t('developer.onlineTrendDesc') }}</UiCardDescription>
<UiCardTitle>{{ t('admin.onlineTrend') }}</UiCardTitle>
<UiCardDescription>{{ t('admin.onlineTrendDesc') }}</UiCardDescription>
</UiCardHeader>
<UiCardContent class="pl-2">
<div class="relative h-[350px]">
@@ -605,11 +605,11 @@ onUnmounted(() => {
<UiCardHeader>
<div class="flex items-center justify-between">
<div>
<UiCardTitle>{{ t('developer.recentTickets') }}</UiCardTitle>
<UiCardDescription>{{ t('developer.recentTicketsDesc') }}</UiCardDescription>
<UiCardTitle>{{ t('admin.recentTickets') }}</UiCardTitle>
<UiCardDescription>{{ t('admin.recentTicketsDesc') }}</UiCardDescription>
</div>
<UiButton variant="ghost" size="sm" @click="goToTickets">
{{ t('developer.viewAll') }}
{{ t('admin.viewAll') }}
<Icon icon="lucide:arrow-right" class="ml-1 size-4" />
</UiButton>
</div>
@@ -646,7 +646,7 @@ onUnmounted(() => {
<div v-else class="text-center py-8 text-muted-foreground">
<Icon icon="lucide:ticket" class="mx-auto size-10 text-muted-foreground mb-2" />
<p class="text-sm">
{{ t('developer.noTickets') }}
{{ t('admin.noTickets') }}
</p>
</div>
</UiCardContent>
@@ -654,8 +654,8 @@ onUnmounted(() => {
<UiCard>
<UiCardHeader>
<UiCardTitle>{{ t('developer.recentActivities') }}</UiCardTitle>
<UiCardDescription>{{ t('developer.recentActivitiesDesc') }}</UiCardDescription>
<UiCardTitle>{{ t('admin.recentActivities') }}</UiCardTitle>
<UiCardDescription>{{ t('admin.recentActivitiesDesc') }}</UiCardDescription>
</UiCardHeader>
<UiCardContent>
<div v-if="recentActivities.length > 0" class="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
@@ -685,7 +685,7 @@ onUnmounted(() => {
<div v-else class="text-center py-8 text-muted-foreground">
<Icon icon="lucide:activity" class="mx-auto size-10 text-muted-foreground mb-2" />
<p class="text-sm">
{{ t('developer.noActivities') }}
{{ t('admin.noActivities') }}
</p>
</div>
</UiCardContent>