feat: logoBar显示程序版本号 (#153)

[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-07-04 21:14:16 +08:00
committed by GitHub
parent 67eaa5b783
commit be5b9a160d
27 changed files with 89 additions and 63 deletions

View File

@ -27,7 +27,7 @@ import selectConfig from '@/config/select'
export default {
props: {
apiObj: {
queryApi: {
type: Object,
default: () => {},
},
@ -55,7 +55,7 @@ export default {
methods: {
//选项显示隐藏事件
visibleChange(isOpen) {
if (isOpen && this.options.length === 0 && (this.dic || this.apiObj)) {
if (isOpen && this.options.length === 0 && (this.dic || this.queryApi)) {
this.getRemoteData()
}
},
@ -64,8 +64,8 @@ export default {
this.loading = true
this.dicParams[selectConfig.request.name] = this.dic
let res = {}
if (this.apiObj) {
res = await this.apiObj.post(this.params)
if (this.queryApi) {
res = await this.queryApi.post(this.params)
} else if (this.dic) {
res = await selectConfig.dicApiObj.get(this.params)
}

View File

@ -5,7 +5,10 @@
<div class="adminui-header-left">
<div class="logo-bar">
<img class="logo" src="@/assets/img/logo.png" />
<span>{{ $CONFIG.APP_NAME }}</span>
<div>
<p>{{ $CONFIG.APP_NAME }}</p>
<p class="version">{{ version }}</p>
</div>
</div>
<ul v-if="!ismobile" class="nav">
<li v-for="item in menu" :class="pmenu.path === item.path ? 'active' : ''" :key="item" @click="showMenu(item)">
@ -63,7 +66,10 @@
<div class="adminui-header-left">
<div class="logo-bar">
<img class="logo" src="@/assets/img/logo.png" />
<span>{{ $CONFIG.APP_NAME }}</span>
<div>
<p>{{ $CONFIG.APP_NAME }}</p>
<p class="version">{{ version }}</p>
</div>
</div>
</div>
<div class="adminui-header-right">
@ -108,7 +114,10 @@
<div class="adminui-header-left">
<div class="logo-bar">
<img class="logo" src="@/assets/img/logo.png" />
<span>{{ $CONFIG.APP_NAME }}</span>
<div>
<p>{{ $CONFIG.APP_NAME }}</p>
<p class="version">{{ version }}</p>
</div>
</div>
</div>
<div class="adminui-header-right">
@ -237,6 +246,7 @@ export default {
nextMenu: [],
pmenu: {},
active: '',
version: '',
}
},
computed: {
@ -253,12 +263,14 @@ export default {
return this.$store.state.global.menuIsCollapse
},
},
created() {
async created() {
this.onLayoutResize()
window.addEventListener('resize', this.onLayoutResize)
const menu = this.$router.sc_getMenu()
this.menu = this.filterUrl(menu)
this.showThis()
const res = await this.$API.sys_tools.getVersion.post()
this.version = res.data.slice(0, res.data.indexOf('+'))
},
watch: {
$route() {
@ -319,4 +331,11 @@ export default {
},
},
}
</script>
</script>
<style scoped>
.version {
font-size: var(--el-font-size-small);
font-weight: var(--el-font-weight-primary);
color: var(--el-text-color-disabled);
}
</style>

View File

@ -150,6 +150,11 @@
margin-left: 0.8rem;
}
.el-button-group {
display: flex;
justify-content: end;
}
.el-button-group + .el-dropdown {
margin-left: 0.8rem;
}

View File

@ -150,4 +150,8 @@
.user-bar .user-avatar label {
display: none !important;
}
.sc-select-filter__item {
width: 100% !important;
}
}

View File

@ -86,7 +86,8 @@
type: 'danger',
})
"
:vue="this" />
:vue="this"
width="150" />
</sc-table>
</el-main>
</el-container>

View File

@ -92,7 +92,8 @@
type: 'danger',
})
"
:vue="this" />
:vue="this"
width="150" />
</sc-table>
</el-main>
</el-container>

View File

@ -52,7 +52,8 @@
type: 'danger',
})
"
:vue="this" />
:vue="this"
width="150" />
</sc-table>
</el-main>
</el-container>

View File

@ -185,7 +185,8 @@
},
)
"
:vue="this" />
:vue="this"
width="200" />
</sc-table>
</el-main>
</el-container>

View File

@ -1,15 +1,9 @@
<template>
<el-container>
<el-header style="border: none">
<el-tabs v-model="tabId" class="w100p">
<el-tab-pane :label="$t('所有作业')" name="all"></el-tab-pane>
<el-tab-pane :label="$t('异常作业')" name="fail"></el-tab-pane>
</el-tabs>
</el-header>
<el-main class="nopadding">
<component :is="tabId" :status-codes="['300,399', '400,499', '500,599', '900,999']" />
</el-main>
</el-container>
<el-tabs v-model="tabId" class="w100p" style="background: var(--el-bg-color-overlay); padding-left: 1rem">
<el-tab-pane :label="$t('所有作业')" name="all"></el-tab-pane>
<el-tab-pane :label="$t('异常作业')" name="fail"></el-tab-pane>
</el-tabs>
<component :is="tabId" :status-codes="['300,399', '400,499', '500,599', '900,999']" />
</template>
<script>

View File

@ -71,7 +71,7 @@ export default {
this.loading = true
this.mode = data.mode
if (data.row?.id) {
const res = await this.$API.sys_job.recordGet.post({ id: data.row.id })
const res = await this.$API.sys_job.getRecord.post({ id: data.row.id })
Object.assign(this.form, res.data)
}
this.loading = false

View File

@ -84,7 +84,8 @@
type: 'danger',
})
"
:vue="this" />
:vue="this"
width="150" />
</sc-table>
</el-main>
</el-container>

View File

@ -138,7 +138,8 @@
},
)
"
:vue="this" />
:vue="this"
width="200" />
</sc-table>
</el-main>
</el-container>