Compare commits

...

2 Commits

Author SHA1 Message Date
95da221144 feat 面包屑有重复选项 隐藏 2025-06-27 21:38:27 +08:00
b908832ded feat 添加下载模块 2025-06-27 21:29:55 +08:00
5 changed files with 105 additions and 8 deletions

View File

@ -1,18 +1,18 @@
<template>
<el-breadcrumb separator-class="el-icon-caret-right" class="app-breadcrumb">
<el-breadcrumb-item>
<!-- <router-link to="/">飞机主控</router-link> -->
{{ $route.meta.tapName === "plane" ? "飞机主控" : "小程序后台" }}
</el-breadcrumb-item>
<el-breadcrumb-item v-for="(item, index) in breadcrumb" :key="index">
<!-- <router-link :to="item.path">{{ item.title }}</router-link> -->
<el-breadcrumb-item
v-for="(item, index) in filteredBreadcrumb"
:key="index"
>
{{ item.title }}
</el-breadcrumb-item>
</el-breadcrumb>
</template>
<script>
export default {
name: 'Breadcrumb',
data () {
@ -29,7 +29,9 @@ export default {
*/
routes () {
return this.$router.options.routes.filter(
item => item.meta.hidden !== true && item.meta.roles.indexOf(this.$store.state.user.power.trim()) >= 0
item =>
item.meta.hidden !== true &&
item.meta.roles.indexOf(this.$store.state.user.power.trim()) >= 0
)
},
/**
@ -37,6 +39,16 @@ export default {
*/
presentPath () {
return this.$route.path
},
/**
* @description: 过滤重复的面包屑
*/
filteredBreadcrumb () {
const list = this.breadcrumb
if (list.length <= 1) return list
const last = list[list.length - 1]
const isDuplicate = list.slice(0, -1).some(item => item.title === last.title)
return isDuplicate ? [last] : list
}
},
watch: {
@ -79,7 +91,6 @@ export default {
display: block !important;
}
/* 当屏幕宽度小于等于480px时 */
@media (max-width: 480px) {
.app-breadcrumb {
display: none !important;

View File

@ -628,6 +628,29 @@ const routes = [
}
]
},
{
path: '/download',
component: Layout,
redirect: '/download/index',
meta: {
title: '软件下载',
icon: 'el-icon-download',
roles: ['master', 'admin', 'editor'],
tapName: 'admin'
},
children: [
{
path: '/download/index',
component: () => import('@/views/layout/components/main/download/index'),
meta: {
title: '软件下载',
icon: 'el-icon-download',
roles: ['master', 'admin', 'editor'],
tapName: 'admin'
}
}
]
},
{
path: '/404',
component: Page404,

View File

@ -13,7 +13,8 @@ const defaultModuleVisibilityMap = {
category: true,
broadcast: true,
order: true,
nofly: true
nofly: true,
download: true
}
// 从 localStorage 读取已有配置,合并覆盖默认配置

View File

@ -0,0 +1,61 @@
<template>
<div class="app-container">
<el-row class="m-t-0">
<el-col :span="24">
<el-container>
<el-header height="42px" class="l-h-42 p-l-10 p-r-10 border border-b-n">
<div class="l">
<i class="iconfont icon-xiazai f-s-20"></i>
<font class="m-l-10 f-s-18 fb">软件下载</font>
</div>
</el-header>
<el-main class="border p-20">
<!-- 安卓端下载 -->
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<span class="f-s-16 fb">安卓端</span>
</div>
<div class="m-b-10">
<p><b>软件名称</b>鲲鹏堂 / KPT-SP 运载无机监管平台</p>
<p><b>版本号</b>v1.01</p>
<p><b>系统要求</b>安卓 14 及以上</p>
<p><b>建议分辨率</b>3200 × 2136</p>
<p><b>建议设备</b>小米 Pad 7</p>
</div>
<el-button type="primary" icon="el-icon-download" @click="downloadApk">
下载 APK
</el-button>
</el-card>
</el-main>
</el-container>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
name: 'SoftwareDownload',
methods: {
downloadApk () {
const link = document.createElement('a')
link.href = 'https://szdot.top/app-release.apk'
link.target = '_blank'
link.download = 'KPT-SP_v1.01.apk'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
}
}
</script>
<style scoped>
.box-card {
margin-bottom: 20px;
}
</style>

View File

@ -55,7 +55,8 @@ export default {
{ value: 'planes', label: '作业管理' },
{ value: 'shop', label: '单位管理' },
{ value: 'admin', label: '账户管理' },
{ value: 'message', label: '公告管理' }
{ value: 'message', label: '公告管理' },
{ value: 'download', label: '软件下载' }
],
selectedModules: []
}