|
|
|
@ -1,16 +1,16 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div style="padding: 0 15px;">
|
|
|
|
|
<i-menu-unfold-one @contextmenu.prevent.stop="toggleClick" @click="showDrawer = !showDrawer" class="hamburger"
|
|
|
|
|
:class="{'is-active':isActive}" theme="outline" size="22" fill="#FFFFFF"/>
|
|
|
|
|
:class="{'is-active':isActive}" theme="outline" size="22" :fill="fill"/>
|
|
|
|
|
<div>
|
|
|
|
|
<el-drawer v-model="showDrawer" direction="ltr" append-to-body style="top: 50px" :z-index="165"
|
|
|
|
|
<el-drawer v-model="showDrawer" direction="ltr" append-to-body style="top: 50px;height: calc(100% - 50px)" :z-index="165"
|
|
|
|
|
:with-header="false">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="classify" style="margin-top: 0;">
|
|
|
|
|
<i-system theme="outline" size="24" fill="#333"/>
|
|
|
|
|
<el-link style="color: #000000 !important;font-size: 16px" @click="openRouter('/index')">概览</el-link>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-for="item in menuList" :key="item.label">
|
|
|
|
|
<div v-if="true" v-for="item in menuList" :key="item.label">
|
|
|
|
|
<div class="classify">
|
|
|
|
|
<i-system theme="outline" size="24" fill="#333"/>
|
|
|
|
|
{{ item.label }}
|
|
|
|
@ -25,6 +25,23 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else v-for="item in sidebarRouters" :key="item.path">
|
|
|
|
|
<div v-if="!item.hidden && item.redirect !== '/index'">
|
|
|
|
|
<div class="classify">
|
|
|
|
|
<i-system theme="outline" size="24" fill="#333"/>
|
|
|
|
|
{{ item.meta?.title }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="children">
|
|
|
|
|
<el-row v-if="item.children" :gutter="20">
|
|
|
|
|
<el-col v-for="child in item.children" :key="child.path" :span="8">
|
|
|
|
|
<div class="children-item">
|
|
|
|
|
<el-link @click="openRouter(`${item.path}/${child.path}`)">{{ child.meta?.title }}</el-link>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</el-drawer>
|
|
|
|
@ -33,15 +50,24 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import usePermissionStore from "@/store/modules/permission.js";
|
|
|
|
|
import {isExternal} from "@/utils/validate.js";
|
|
|
|
|
|
|
|
|
|
defineProps({
|
|
|
|
|
isActive: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fill:{
|
|
|
|
|
type: String,
|
|
|
|
|
default: '#FFF'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['toggleClick'])
|
|
|
|
|
const showDrawer = ref(false)
|
|
|
|
|
const permissionStore = usePermissionStore()
|
|
|
|
|
|
|
|
|
|
const sidebarRouters = computed(() => permissionStore.sidebarRouters);
|
|
|
|
|
const menuList = ref([
|
|
|
|
|
{
|
|
|
|
|
label: '基础数据管理', children: [
|
|
|
|
@ -74,9 +100,15 @@ const menuList = ref([
|
|
|
|
|
])
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const openRouter = (href) => {
|
|
|
|
|
if (href){
|
|
|
|
|
router.push(href)
|
|
|
|
|
showDrawer.value = false
|
|
|
|
|
console.log(href);
|
|
|
|
|
if (href){
|
|
|
|
|
if (isExternal(href)) {
|
|
|
|
|
window.open(href)
|
|
|
|
|
}else {
|
|
|
|
|
router.push(href)
|
|
|
|
|
showDrawer.value = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const toggleClick = () => {
|
|
|
|
|