feat:首页新增常用功能模块

This commit is contained in:
不做码农 2023-04-11 17:39:33 +08:00
parent 78fed5ce17
commit bc588890bb
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,48 @@
<template>
<div class="tool-wrap">
<template v-for="item in menuList">
<div class="tool-item" v-if="checkPermi(item)">
<router-link :to="item.path">
<svg-icon :name="item.name" class-name="card-panel-icon mb10" :color="item.color" />
<div>{{ item.title }}</div>
</router-link>
</div>
</template>
</div>
</template>
<script setup>
import { getCurrentInstance } from 'vue'
const { proxy } = getCurrentInstance()
const menuList = ref([
{ path: '/tool/gen', title: '代码生成', color: '#40c9c6', name: 'code', permi: ['tool:gen:list'] },
{ path: '/tool/file', title: '文件存储', color: '#6A5ACD', name: 'upload', permi: ['tool:file:list'] },
// // { path: '/system/user', title: '', color: '#7FFF00', name: 'peoples' },
{ path: '/system/dict', title: '字典管理', color: '#B0E0E6', name: 'dict', permi: ['system:dict:list'] },
{ path: '/monitor/job', title: '定时任务', color: '#D2691E', name: 'job', permi: ['monitor:job:list'] }
])
function checkPermi(v) {
if (v && v.permi) {
return proxy.$auth.hasPermiOr(v.permi)
}
return true
}
</script>
<style lang="scss" scoped>
.tool-wrap {
display: flex;
.tool-item {
display: flex;
flex-direction: column;
text-align: center;
width: 110px;
.card-panel-icon {
width: 30px;
height: 30px;
}
}
}
</style>

View File

@ -84,6 +84,18 @@
</el-card>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :md="24" :lg="24" :xl="24" class="mb10">
<el-card shadow="hover">
<template #header>
<span>常用功能</span>
</template>
<CommonMenu></CommonMenu>
</el-card>
</el-col>
</el-row>
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row :gutter="32">
@ -128,6 +140,7 @@ import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
import WordCloudChat from './dashboard/WordCloud.vue'
import CommonMenu from './components/CommonMenu'
import dayjs from 'dayjs'