优化开发展示

This commit is contained in:
aixianling
2022-06-13 10:46:55 +08:00
parent 2a4d9b2b1c
commit b35314bf83
10 changed files with 19 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div id="app">
<header-nav v-if="showTools" :title="serveName">
<header-nav v-if="showTools" title="web端产品库">
<template #right>
<div @click="showTools=false">隐藏工具栏</div>
<div @click="handleLogin">点此登录</div>
@@ -29,13 +29,6 @@ export default {
components: {HeaderNav, MainContent, SliderNav},
computed: {
...mapState(['user']),
serveName() {
let names = {
development: "村微产品库",
oms: "运营平台产品分库",
}
return names[process.env.NODE_ENV]
},
login() {
let url = '/auth/oauth/token';
/project\/sass/g.test(location.pathname) && (url += "?corpId=ww596787bb70f08288")
@@ -75,9 +68,6 @@ export default {
created() {
if (this.user.token) this.getUserInfo()
wx = jWeixin
},
mounted() {
document.title = this.serveName
}
}
</script>

View File

@@ -6,7 +6,7 @@
<ai-empty>欢迎使用村微产品库</ai-empty>
</el-tab-pane>
<el-tab-pane v-for="op in tabs" :key="op.name" :closable="op.name!='工作台'" :name="op.name" :label="op.label" lazy>
<router-view/>
<router-view v-if="currentTab==tabs.name"/>
</el-tab-pane>
</el-tabs>
</section>

View File

@@ -8,6 +8,7 @@
@click.stop="openKidMenu(item)">
<i class="prep-icon" :class="item.style||'iconfont iconloudongmoxing'"/>
<span class="menuName fill" v-text="item.label"/>
<el-badge type="warning" :hidden="!item.project" :value="item.project"/>
<i v-if="item.children" class="iconfont" :class="arrowIcon(item.showChildren)"/>
</div>
<div class="kidMenu" v-if="item.showChildren" @click.stop>
@@ -41,7 +42,14 @@ export default {
...mapState(['user', 'apps']),
navs() {
let reg = new RegExp(`.*${this.searchApp?.replace(/-/g,'')||''}.*`, 'gi')
return (this.apps || []).filter(e => !this.searchApp || reg?.test(e.name) || reg?.test(e.label))
return (this.apps || []).filter(e => !this.searchApp || reg?.test(e.name) || reg?.test(e.label)).map(e => {
if (/project/.test(e.path)) {
e.project = e.path.replace(/.*project\/([^\/]+)\/.+/, '$1')
} else if (/core/.test(e.path)) {
e.project = "core"
}
return e
})
},
isConsoleRoute() {
return this.$route.name == "工作台"
@@ -104,7 +112,7 @@ export default {
</script>
<style lang="scss" scoped>
.sliderNav {
width: 200px;
min-width: 200px;
height: 100%;
transition: width .1s;
display: flex;