前后端全面升级

This commit is contained in:
pycook
2023-07-10 17:42:15 +08:00
parent c444fed436
commit db5ff60aff
629 changed files with 97789 additions and 23995 deletions

View File

@@ -1,46 +1,70 @@
<template>
<a-config-provider :locale="locale">
<div id="app">
<div id="app" :class="{ 'ops-fullscreen': isOpsFullScreen, 'ops-only-topmenu': isOpsOnlyTopMenu }">
<router-view v-if="alive" />
</div>
</a-config-provider>
</template>
<script>
import i18n from '@/locales'
import { mapActions } from 'vuex'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { AppDeviceEnquire } from '@/utils/mixin'
import { mixin } from '@/store/i18n-mixin'
import { debounce } from './utils/util'
export default {
mixins: [AppDeviceEnquire, mixin],
provide () {
mixins: [AppDeviceEnquire],
provide() {
return {
reload: this.reload
reload: this.reload,
}
},
data () {
data() {
return {
locale: {},
alive: true
locale: zhCN,
alive: true,
timer: null,
}
},
created () {
this.$watch('currentLang', () => {
this.locale = i18n.getLocaleMessage(this.currentLang).antLocale
})
computed: {
isOpsFullScreen() {
return this.$route.name === 'cmdb_screen'
},
isOpsOnlyTopMenu() {
return ['fullscreen_index', 'setting_person'].includes(this.$route.name)
},
},
created() {
this.timer = setInterval(() => {
this.setTime(new Date().getTime())
}, 1000)
},
mounted() {
this.$store.dispatch('setWindowSize')
window.addEventListener(
'resize',
debounce(() => {
this.$store.dispatch('setWindowSize')
})
)
},
beforeDestroy() {
clearInterval(this.timer)
},
methods: {
reload () {
...mapActions(['setTime']),
reload() {
this.alive = false
this.$nextTick(() => {
this.alive = true
})
}
}
},
},
}
</script>
<style>
<style lang="less">
@import './style/index.less';
#app {
height: 100%;
}