mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 17:49:20 +08:00
style: 岗位菜单
This commit is contained in:
+79
-443
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onMounted, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { Button, Card, Input, message, Pagination, Select, Spin, Tree } from 'ant-design-vue'
|
import { Button, Card, Input, message, Pagination, Select, Spin, Tree, Flex } from 'ant-design-vue'
|
||||||
import { Page } from '@vben/common-ui'
|
import { Page } from '@vben/common-ui'
|
||||||
import { getPositionPageApi } from '#/api/organization/position'
|
import { getPositionPageApi } from '#/api/organization/position'
|
||||||
import { getCompanyMenuTreeApi } from '#/api/organization/company-menu'
|
import { getCompanyMenuTreeApi } from '#/api/organization/company-menu'
|
||||||
@@ -42,14 +42,7 @@ const permissionLoading = ref(false)
|
|||||||
const checkedKeys = ref<number[]>([])
|
const checkedKeys = ref<number[]>([])
|
||||||
const expandedKeys = ref<number[]>([])
|
const expandedKeys = ref<number[]>([])
|
||||||
|
|
||||||
// 分组选择
|
// 不区分超管与普通菜单
|
||||||
const selectedGroup = ref<'super' | 'normal' | undefined>(undefined)
|
|
||||||
|
|
||||||
// 分组选项
|
|
||||||
const groupOptions = [
|
|
||||||
{ label: '超管菜单', value: 'super' as const },
|
|
||||||
{ label: '普通菜单', value: 'normal' as const },
|
|
||||||
]
|
|
||||||
|
|
||||||
// 搜索岗位列表
|
// 搜索岗位列表
|
||||||
async function searchPositions() {
|
async function searchPositions() {
|
||||||
@@ -229,69 +222,24 @@ function handleSelectAll() {
|
|||||||
// 获取所有可选择的菜单ID(排除禁用的)
|
// 获取所有可选择的菜单ID(排除禁用的)
|
||||||
let selectableMenus = getAllSelectableMenus()
|
let selectableMenus = getAllSelectableMenus()
|
||||||
|
|
||||||
// 如果选择了分组,则只选择该分组的菜单
|
|
||||||
if (selectedGroup.value) {
|
|
||||||
if (selectedGroup.value === 'super') {
|
|
||||||
selectableMenus = selectableMenus.filter((menu) => menu.superMenu === 1)
|
|
||||||
} else if (selectedGroup.value === 'normal') {
|
|
||||||
selectableMenus = selectableMenus.filter((menu) => menu.superMenu !== 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 只选择叶子节点(没有子节点的菜单)
|
// 只选择叶子节点(没有子节点的菜单)
|
||||||
const leafMenus = selectableMenus.filter((menu) => {
|
const leafMenus = selectableMenus.filter((menu) => {
|
||||||
return !hasMenuChildren(menu.id)
|
return !hasMenuChildren(menu.id)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (selectedGroup.value) {
|
// 全选所有叶子节点
|
||||||
// 保留其他分组的选中状态,只替换当前分组的选中状态
|
|
||||||
const otherGroupCheckedKeys = checkedKeys.value.filter((id) => {
|
|
||||||
const menu = findMenuById(id)
|
|
||||||
if (!menu) return false
|
|
||||||
|
|
||||||
if (selectedGroup.value === 'super') {
|
|
||||||
return menu.superMenu !== 1
|
|
||||||
} else if (selectedGroup.value === 'normal') {
|
|
||||||
return menu.superMenu === 1
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
checkedKeys.value = [...otherGroupCheckedKeys, ...leafMenus.map((menu) => menu.id)]
|
|
||||||
} else {
|
|
||||||
// 如果没有选择分组,全选所有叶子节点
|
|
||||||
checkedKeys.value = leafMenus.map((menu) => menu.id)
|
checkedKeys.value = leafMenus.map((menu) => menu.id)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 取消全选
|
// 取消全选
|
||||||
function handleSelectNone() {
|
function handleSelectNone() {
|
||||||
if (selectedGroup.value) {
|
// 取消所有叶子节点的选中状态
|
||||||
// 如果选择了分组,只取消该分组的叶子节点选中状态
|
|
||||||
const leafMenuIds = getAllSelectableMenus()
|
|
||||||
.filter((menu) => {
|
|
||||||
// 只处理叶子节点
|
|
||||||
if (hasMenuChildren(menu.id)) return false
|
|
||||||
|
|
||||||
// 根据分组过滤
|
|
||||||
if (selectedGroup.value === 'super') {
|
|
||||||
return menu.superMenu === 1
|
|
||||||
} else if (selectedGroup.value === 'normal') {
|
|
||||||
return menu.superMenu !== 1
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
.map((menu) => menu.id)
|
|
||||||
|
|
||||||
checkedKeys.value = checkedKeys.value.filter((id) => !leafMenuIds.includes(id))
|
|
||||||
} else {
|
|
||||||
// 如果没有选择分组,取消所有叶子节点的选中状态
|
|
||||||
const allLeafMenuIds = getAllSelectableMenus()
|
const allLeafMenuIds = getAllSelectableMenus()
|
||||||
.filter((menu) => !hasMenuChildren(menu.id))
|
.filter((menu) => !hasMenuChildren(menu.id))
|
||||||
.map((menu) => menu.id)
|
.map((menu) => menu.id)
|
||||||
|
|
||||||
checkedKeys.value = checkedKeys.value.filter((id) => !allLeafMenuIds.includes(id))
|
checkedKeys.value = checkedKeys.value.filter((id) => !allLeafMenuIds.includes(id))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 获取所有可选择的菜单
|
// 获取所有可选择的菜单
|
||||||
function getAllSelectableMenus(): CompanyMenuVO.CompanyMenuInfo[] {
|
function getAllSelectableMenus(): CompanyMenuVO.CompanyMenuInfo[] {
|
||||||
@@ -355,17 +303,13 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page
|
<Page
|
||||||
title="岗位权限管理"
|
:auto-content-height="true"
|
||||||
description="管理岗位的菜单权限配置"
|
|
||||||
:auto-content-height="false"
|
|
||||||
>
|
>
|
||||||
<div class="position-permission-container">
|
<Flex gap="middle" class="h-full">
|
||||||
<!-- 左栏:岗位列表 -->
|
<!-- 左栏:岗位列表 -->
|
||||||
<div class="left-panel">
|
<Card title="岗位列表" class="h-full flex flex-col max-w-[400px]" :bodyStyle="{ height: '100%', display: 'flex', flexDirection: 'column',gap: '10px' }">
|
||||||
<Card title="岗位列表" class="position-card">
|
|
||||||
<!-- 搜索区域 -->
|
<!-- 搜索区域 -->
|
||||||
<div class="search-section">
|
<Flex class="flex-wrap gap-2">
|
||||||
<div class="search-form">
|
|
||||||
<Input
|
<Input
|
||||||
v-model:value="searchForm.name"
|
v-model:value="searchForm.name"
|
||||||
placeholder="请输入岗位名称"
|
placeholder="请输入岗位名称"
|
||||||
@@ -387,38 +331,46 @@ onMounted(() => {
|
|||||||
<Button @click="resetSearch">
|
<Button @click="resetSearch">
|
||||||
重置
|
重置
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</Flex>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<!-- 岗位列表区域 -->
|
||||||
|
<Flex vertical class="flex-1">
|
||||||
<!-- 岗位列表 -->
|
<!-- 岗位列表 -->
|
||||||
<div class="position-list">
|
<Flex vertical class="flex-1">
|
||||||
<Spin :spinning="positionLoading">
|
<Spin :spinning="positionLoading">
|
||||||
<div class="position-items">
|
<Card
|
||||||
<div
|
|
||||||
v-for="position in positionList"
|
v-for="position in positionList"
|
||||||
:key="position.id"
|
:key="position.id"
|
||||||
class="position-item"
|
hoverable
|
||||||
:class="{ active: currentPosition?.id === position.id }"
|
size="small"
|
||||||
|
:bodyStyle="{ padding: '10px 12px' }"
|
||||||
|
:class="[
|
||||||
|
'group mb-2 cursor-pointer transition-all duration-200',
|
||||||
|
(currentPosition?.id === position.id) && 'ring-1 ring-primary shadow'
|
||||||
|
]"
|
||||||
@click="selectPosition(position)"
|
@click="selectPosition(position)"
|
||||||
>
|
>
|
||||||
<div class="position-info">
|
<div class="flex items-start justify-between gap-2">
|
||||||
<div class="position-name">{{ position.name }}</div>
|
<div class="min-w-0">
|
||||||
<div class="position-meta">
|
<div class="flex items-center gap-2 mb-1">
|
||||||
|
<span
|
||||||
|
class="inline-block h-2 w-2 rounded-full"
|
||||||
|
:class="position.status === 1 ? 'bg-green-500' : 'bg-red-500'"
|
||||||
|
/>
|
||||||
|
<span class="text-sm font-semibold text-[var(--text-primary)] truncate">{{ position.name }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-xs text-[var(--text-secondary)] mb-1">编码:{{ position.code }}</div>
|
||||||
|
<div v-if="position.remark" class="text-xs text-[var(--text-secondary)] truncate">{{ position.remark }}</div>
|
||||||
|
</div>
|
||||||
<Tag :color="position.status === 1 ? 'green' : 'red'">
|
<Tag :color="position.status === 1 ? 'green' : 'red'">
|
||||||
{{ position.status === 1 ? '启用' : '禁用' }}
|
{{ position.status === 1 ? '启用' : '禁用' }}
|
||||||
</Tag>
|
</Tag>
|
||||||
<span class="position-code">{{ position.code }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="position-remark" v-if="position.remark">
|
|
||||||
{{ position.remark }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</Spin>
|
</Spin>
|
||||||
|
</Flex>
|
||||||
<!-- 分页 -->
|
<!-- 分页器 -->
|
||||||
<div class="pagination-wrapper">
|
<Flex justify="center">
|
||||||
<Pagination
|
<Pagination
|
||||||
v-model:current="positionPagination.current"
|
v-model:current="positionPagination.current"
|
||||||
v-model:page-size="positionPagination.pageSize"
|
v-model:page-size="positionPagination.pageSize"
|
||||||
@@ -428,93 +380,61 @@ onMounted(() => {
|
|||||||
:show-total="(total) => `共 ${total} 条`"
|
:show-total="(total) => `共 ${total} 条`"
|
||||||
@change="handlePageChange"
|
@change="handlePageChange"
|
||||||
/>
|
/>
|
||||||
</div>
|
</Flex>
|
||||||
</div>
|
</Flex>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 右栏:权限管理 -->
|
<!-- 右栏:权限管理 -->
|
||||||
<div class="right-panel">
|
<Card title="权限管理" class="h-full flex flex-col flex-1" :bodyStyle="{ height: '100%' }">
|
||||||
<Card title="权限管理" class="permission-card">
|
|
||||||
<template v-if="currentPosition">
|
<template v-if="currentPosition">
|
||||||
<!-- 当前岗位信息 -->
|
<!-- 岗位信息 + 统计与操作 -->
|
||||||
<div class="current-position">
|
<div class="p-4 rounded mb-4 bg-gray-50 dark:bg-neutral-800">
|
||||||
<div class="position-header">
|
<div class="flex items-center justify-between gap-2 mb-3">
|
||||||
<span class="position-name">{{ currentPosition.name }}</span>
|
<div class="flex items-center gap-2">
|
||||||
<Tag :color="currentPosition.status === 1 ? 'green' : 'red'">
|
<span class="text-base font-semibold">{{ currentPosition.name }}</span>
|
||||||
{{ currentPosition.status === 1 ? '启用' : '禁用' }}
|
|
||||||
</Tag>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="position-details">
|
<div class="flex items-center gap-2">
|
||||||
<span class="position-code">编码:{{ currentPosition.code }}</span>
|
<Button @click="handleSelectNone">取消全选</Button>
|
||||||
<span class="position-company">公司ID:{{ currentPosition.companyId }}</span>
|
<Button type="primary" @click="handleSelectAll">一键全选</Button>
|
||||||
|
<Button type="primary" @click="savePositionPermissions">保存权限</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex items-center gap-6 text-xs text-gray-500">
|
||||||
<!-- 统计信息 -->
|
<span>编码:{{ currentPosition.code }}</span>
|
||||||
<div class="stats-section">
|
<span class="flex items-center gap-1">
|
||||||
<div class="stats-left">
|
<span class="text-[var(--text-secondary)]">系统菜单:</span>
|
||||||
<div class="stat-item">
|
<span class="font-semibold text-sm">{{ stats.total }}</span>
|
||||||
<span class="label">系统菜单:</span>
|
</span>
|
||||||
<span class="value">{{ stats.total }}</span>
|
<span class="flex items-center gap-1">
|
||||||
</div>
|
<span class="text-[var(--text-secondary)]">已配置:</span>
|
||||||
<div class="stat-item">
|
<span class="font-semibold text-sm text-[var(--success)]">{{ stats.position }}</span>
|
||||||
<span class="label">已配置:</span>
|
</span>
|
||||||
<span class="value success">{{ stats.position }}</span>
|
<span class="flex items-center gap-1">
|
||||||
</div>
|
<span class="text-[var(--text-secondary)]">当前选择:</span>
|
||||||
<div class="stat-item">
|
<span class="font-semibold text-sm text-[var(--primary)]">{{ stats.selected }}</span>
|
||||||
<span class="label">当前选择:</span>
|
</span>
|
||||||
<span class="value primary">{{ stats.selected }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="stats-right">
|
|
||||||
<Select
|
|
||||||
v-model:value="selectedGroup"
|
|
||||||
placeholder="选择分组"
|
|
||||||
allow-clear
|
|
||||||
style="width: 120px; margin-right: 8px"
|
|
||||||
>
|
|
||||||
<Select.Option
|
|
||||||
v-for="option in groupOptions"
|
|
||||||
:key="option.value || 'all'"
|
|
||||||
:value="option.value"
|
|
||||||
>
|
|
||||||
{{ option.label }}
|
|
||||||
</Select.Option>
|
|
||||||
</Select>
|
|
||||||
<Button type="primary" @click="handleSelectAll">
|
|
||||||
一键全选
|
|
||||||
</Button>
|
|
||||||
<Button @click="handleSelectNone">
|
|
||||||
取消全选
|
|
||||||
</Button>
|
|
||||||
<Button type="primary" @click="savePositionPermissions">
|
|
||||||
保存权限
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 菜单树 -->
|
<!-- 菜单树 -->
|
||||||
<div class="menu-tree-container">
|
<div class="flex-1 overflow-y-auto min-h-0">
|
||||||
<Spin :spinning="permissionLoading">
|
<Spin :spinning="permissionLoading">
|
||||||
<Tree
|
<Tree
|
||||||
v-model:checked-keys="checkedKeys"
|
v-model:checked-keys="checkedKeys"
|
||||||
v-model:expanded-keys="expandedKeys"
|
v-model:expanded-keys="expandedKeys"
|
||||||
:tree-data="convertToTreeData(companyMenuTree)"
|
:tree-data="convertToTreeData(companyMenuTree)"
|
||||||
checkable
|
checkable
|
||||||
class="menu-tree"
|
block-node
|
||||||
|
class="border rounded"
|
||||||
@check="handleTreeCheckChange"
|
@check="handleTreeCheckChange"
|
||||||
>
|
>
|
||||||
<template #title="{ title, status, disabled, superMenu }">
|
<template #title="{ title, status, disabled }">
|
||||||
<div class="menu-item">
|
<div class="flex items-center gap-2">
|
||||||
<span class="menu-name">{{ title }}</span>
|
<span class="font-medium">{{ title }}</span>
|
||||||
<span v-if="superMenu === 1" class="menu-tag super">
|
<span v-if="status === 0" class="text-red-600 bg-red-50 dark:bg-red-900/30 text-xs px-1.5 py-0.5 rounded">
|
||||||
超管
|
|
||||||
</span>
|
|
||||||
<span v-if="status === 0" class="menu-status disabled">
|
|
||||||
已禁用
|
已禁用
|
||||||
</span>
|
</span>
|
||||||
<span v-if="disabled" class="menu-status disabled">
|
<span v-if="disabled" class="text-red-600 bg-red-50 dark:bg-red-900/30 text-xs px-1.5 py-0.5 rounded">
|
||||||
不可选择
|
不可选择
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -524,301 +444,17 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div v-else class="no-selection">
|
<div v-else class="flex-1 flex items-center justify-center h-full">
|
||||||
<div class="no-selection-content">
|
<div class="text-center text-gray-500">
|
||||||
<div class="no-selection-icon">👈</div>
|
<div class="text-5xl mb-4">👈</div>
|
||||||
<div class="no-selection-text">请先选择一个岗位</div>
|
<div class="text-base">请先选择一个岗位</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
|
||||||
</div>
|
</Flex>
|
||||||
|
<!-- <div class="flex h-full gap-4 max-lg:flex-col">
|
||||||
|
|
||||||
|
</div> -->
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.position-permission-container {
|
|
||||||
display: flex;
|
|
||||||
height: 100%;
|
|
||||||
gap: 16px;
|
|
||||||
|
|
||||||
.left-panel {
|
|
||||||
width: 400px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
.position-card {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
:deep(.ant-card-body) {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-section {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
.search-form {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 8px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.position-list {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: 0;
|
|
||||||
|
|
||||||
.position-items {
|
|
||||||
flex: 1;
|
|
||||||
overflow-y: auto;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
|
|
||||||
.position-item {
|
|
||||||
padding: 12px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s;
|
|
||||||
background-color: var(--background-color);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--primary);
|
|
||||||
background-color: var(--primary-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
border-color: var(--primary);
|
|
||||||
background-color: var(--primary-light);
|
|
||||||
box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.position-info {
|
|
||||||
.position-name {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-primary);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.position-meta {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
|
|
||||||
.position-code {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.position-remark {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pagination-wrapper {
|
|
||||||
flex-shrink: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 16px;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-panel {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
.permission-card {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
:deep(.ant-card-body) {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.current-position {
|
|
||||||
padding: 16px;
|
|
||||||
background-color: var(--background-secondary);
|
|
||||||
border-radius: 6px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
.position-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
|
|
||||||
.position-name {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.position-details {
|
|
||||||
display: flex;
|
|
||||||
gap: 16px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
|
|
||||||
.position-code,
|
|
||||||
.position-company {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-section {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
gap: 16px;
|
|
||||||
padding: 12px 16px;
|
|
||||||
background-color: var(--background-secondary);
|
|
||||||
border-radius: 6px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
|
|
||||||
.stats-left {
|
|
||||||
display: flex;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-right {
|
|
||||||
display: flex;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
|
|
||||||
.label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
&.success {
|
|
||||||
color: var(--success);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.primary {
|
|
||||||
color: var(--primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-tree-container {
|
|
||||||
flex: 1;
|
|
||||||
overflow-y: auto;
|
|
||||||
min-height: 0;
|
|
||||||
|
|
||||||
.menu-tree {
|
|
||||||
padding: 12px;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 6px;
|
|
||||||
|
|
||||||
.menu-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
.menu-name {
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-tag {
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 3px;
|
|
||||||
|
|
||||||
&.super {
|
|
||||||
color: var(--warning);
|
|
||||||
background-color: var(--warning-light);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-status {
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 3px;
|
|
||||||
|
|
||||||
&.disabled {
|
|
||||||
color: var(--error);
|
|
||||||
background-color: var(--error-light);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-selection {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.no-selection-content {
|
|
||||||
text-align: center;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
|
|
||||||
.no-selection-icon {
|
|
||||||
font-size: 48px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-selection-text {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 响应式设计
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
.position-permission-container {
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.left-panel {
|
|
||||||
width: 100%;
|
|
||||||
height: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-panel {
|
|
||||||
height: calc(100vh - 300px - 32px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user