增加前端格式检查配置
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
||||
User,
|
||||
UserFilled,
|
||||
Wallet,
|
||||
CreditCard
|
||||
CreditCard,
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElSubMenu } from 'element-plus'
|
||||
import type { Component } from 'vue'
|
||||
@@ -70,7 +70,12 @@ const allNavGroups: NavGroup[] = [
|
||||
{ label: '用户管理', to: '/admin/users', icon: User, permission: 'user:view' },
|
||||
{ label: '订单管理', to: '/admin/orders', icon: Tickets, permission: 'order:view' },
|
||||
{ label: '商品管理', to: '/admin/listings', icon: Shop, permission: 'listing:view' },
|
||||
{ label: '商品审核', to: '/admin/listings/review', icon: DocumentChecked, permission: 'listing:approve' },
|
||||
{
|
||||
label: '商品审核',
|
||||
to: '/admin/listings/review',
|
||||
icon: DocumentChecked,
|
||||
permission: 'listing:approve',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -78,7 +83,12 @@ const allNavGroups: NavGroup[] = [
|
||||
index: 'support-risk',
|
||||
icon: Service,
|
||||
children: [
|
||||
{ label: '仲裁中心', to: '/admin/disputes', icon: ScaleToOriginal, permission: 'dispute:view' },
|
||||
{
|
||||
label: '仲裁中心',
|
||||
to: '/admin/disputes',
|
||||
icon: ScaleToOriginal,
|
||||
permission: 'dispute:view',
|
||||
},
|
||||
{ label: '客服群聊', to: '/admin/chats', icon: ChatDotRound, permission: 'chat:view' },
|
||||
],
|
||||
},
|
||||
@@ -89,7 +99,12 @@ const allNavGroups: NavGroup[] = [
|
||||
children: [
|
||||
{ label: '资金流水', to: '/admin/wallet-ledger', icon: Wallet, permission: 'wallet:view' },
|
||||
{ label: '提现审核', to: '/admin/withdrawals', icon: Money, permission: 'withdrawal:list' },
|
||||
{ label: '支付配置', to: '/admin/payment-configs', icon: CreditCard, permission: 'payment_config:list' },
|
||||
{
|
||||
label: '支付配置',
|
||||
to: '/admin/payment-configs',
|
||||
icon: CreditCard,
|
||||
permission: 'payment_config:list',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -97,8 +112,18 @@ const allNavGroups: NavGroup[] = [
|
||||
index: 'content-config',
|
||||
icon: Tools,
|
||||
children: [
|
||||
{ label: '公告管理', to: '/admin/announcements', icon: Bell, permission: 'announcement:view' },
|
||||
{ label: '系统配置', to: '/admin/system-configs', icon: Operation, permission: 'system_config:view' },
|
||||
{
|
||||
label: '公告管理',
|
||||
to: '/admin/announcements',
|
||||
icon: Bell,
|
||||
permission: 'announcement:view',
|
||||
},
|
||||
{
|
||||
label: '系统配置',
|
||||
to: '/admin/system-configs',
|
||||
icon: Operation,
|
||||
permission: 'system_config:view',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -107,13 +132,18 @@ const allNavGroups: NavGroup[] = [
|
||||
icon: Lock,
|
||||
children: [
|
||||
{ label: '审计日志', to: '/admin/audit-logs', icon: Document, permission: 'audit_log:view' },
|
||||
{ label: '管理员管理', to: '/admin/admin-users', icon: UserFilled, permission: 'admin_user:manage' },
|
||||
{
|
||||
label: '管理员管理',
|
||||
to: '/admin/admin-users',
|
||||
icon: UserFilled,
|
||||
permission: 'admin_user:manage',
|
||||
},
|
||||
{ label: '角色管理', to: '/admin/roles', icon: Setting, permission: 'role:manage' },
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
const allNavItems = allNavGroups.flatMap((group) => group.children)
|
||||
const allNavItems = allNavGroups.flatMap(group => group.children)
|
||||
|
||||
function canAccessNavItem(item: NavItem) {
|
||||
if (adminSession.isSuperAdmin) return true
|
||||
@@ -123,11 +153,11 @@ function canAccessNavItem(item: NavItem) {
|
||||
|
||||
const navGroups = computed(() => {
|
||||
return allNavGroups
|
||||
.map((group) => ({
|
||||
.map(group => ({
|
||||
...group,
|
||||
children: group.children.filter((item) => canAccessNavItem(item)),
|
||||
children: group.children.filter(item => canAccessNavItem(item)),
|
||||
}))
|
||||
.filter((group) => group.children.length > 0)
|
||||
.filter(group => group.children.length > 0)
|
||||
})
|
||||
|
||||
const activeMenu = computed(() => {
|
||||
@@ -135,14 +165,14 @@ const activeMenu = computed(() => {
|
||||
const matchedItem = allNavItems
|
||||
.slice()
|
||||
.sort((a, b) => b.to.length - a.to.length)
|
||||
.find((item) => currentPath === item.to || currentPath.startsWith(`${item.to}/`))
|
||||
.find(item => currentPath === item.to || currentPath.startsWith(`${item.to}/`))
|
||||
|
||||
return matchedItem?.to || currentPath
|
||||
})
|
||||
|
||||
const defaultOpeneds = computed(() => {
|
||||
const activeGroup = allNavGroups.find((group) =>
|
||||
group.children.some((item) => item.to === activeMenu.value)
|
||||
const activeGroup = allNavGroups.find(group =>
|
||||
group.children.some(item => item.to === activeMenu.value)
|
||||
)
|
||||
|
||||
return activeGroup ? [activeGroup.index] : []
|
||||
@@ -240,23 +270,31 @@ async function handleLogout() {
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="topbar-right">
|
||||
<el-dropdown v-if="hasChatPermission" trigger="click" @command="handleStatusChange" :disabled="updatingStatus">
|
||||
<el-dropdown
|
||||
v-if="hasChatPermission"
|
||||
trigger="click"
|
||||
@command="handleStatusChange"
|
||||
:disabled="updatingStatus"
|
||||
>
|
||||
<span class="status-badge" :style="{ borderColor: statusColors[supportStatus] }">
|
||||
<span class="status-dot" :style="{ backgroundColor: statusColors[supportStatus] }"></span>
|
||||
<span
|
||||
class="status-dot"
|
||||
:style="{ backgroundColor: statusColors[supportStatus] }"
|
||||
></span>
|
||||
<span class="status-text">{{ statusLabels[supportStatus] }}</span>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="online">
|
||||
<span class="status-dot" style="background-color: #10b981;"></span>
|
||||
<span class="status-dot" style="background-color: #10b981"></span>
|
||||
在线
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="busy">
|
||||
<span class="status-dot" style="background-color: #f59e0b;"></span>
|
||||
<span class="status-dot" style="background-color: #f59e0b"></span>
|
||||
忙碌
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="offline">
|
||||
<span class="status-dot" style="background-color: #9ca3af;"></span>
|
||||
<span class="status-dot" style="background-color: #9ca3af"></span>
|
||||
离线
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@@ -269,7 +307,9 @@ async function handleLogout() {
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item :icon="SwitchButton" @click="handleLogout">退出登录</el-dropdown-item>
|
||||
<el-dropdown-item :icon="SwitchButton" @click="handleLogout"
|
||||
>退出登录</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
||||
Reference in New Issue
Block a user