feat: 空图片统一

This commit is contained in:
cgd_mac 2022-02-25 19:47:26 +08:00
parent 94fd5ba1e0
commit d40af76800
7 changed files with 27 additions and 16 deletions

View File

@ -18,7 +18,7 @@ import './permission' // permission control
import './utils/filter' // global filter
import './global.less'
import moment from 'moment'
import { FormModel } from 'ant-design-vue'
import { FormModel, Empty } from 'ant-design-vue'
import { hasBtnPermission } from './utils/permissions'
window.Vue = Vue
@ -35,7 +35,9 @@ window.Vue = Vue
// } from 'echarts/components'
Vue.use(FormModel)
Vue.use(Empty)
Vue.prototype.hasPerm = hasBtnPermission
Vue.prototype.$emptyImg = Empty.PRESENTED_IMAGE_SIMPLE
Vue.config.productionTip = false

View File

@ -1,22 +1,26 @@
<template>
<div>
<Myhome v-if="currentRole && currentRole.code === 'student'"></Myhome>
<a-card v-else :bordered="false" style="display: flex;justify-content:center;height: 100%">
<div style="margin:100px auto;">
<img src="~@/assets/welcome.png" class="logo" alt="logo" />
</div>
</a-card>
</div>
<a-card :bordered="false" style="display: flex;justify-content:center;height: 100%">
<div style="margin:100px auto;">
<img src="~@/assets/welcome.png" class="logo" alt="logo" />
</div>
</a-card>
</template>
<script>
import { mapState } from 'vuex'
import Myhome from '@/views/myhome/index.vue'
// import Myhome from '@/views/myhome/index.vue'
export default {
components: { Myhome },
data () {
return {}
},
beforeRouteEnter (to, from, next) {
next(vm => {
const code = vm.$store.state.user && vm.$store.state.user.currentRole.code
if (code === 'student') {
vm.$router.replace({ path: '/myhome' })
}
})
},
computed: {
...mapState({
currentRole: state => state.user.currentRole

View File

@ -98,7 +98,7 @@
/>
</div>
</template>
<a-empty v-else></a-empty>
<a-empty v-else :image="$emptyImg"></a-empty>
</a-tab-pane>
</a-tabs>
</a-card>

View File

@ -14,7 +14,7 @@
</a-card>
</a-col>
</a-row>
<a-empty v-else></a-empty>
<a-empty v-else :image="$emptyImg"></a-empty>
</a-card>
</template>

View File

@ -76,7 +76,7 @@
<!-- 系统推荐课程 start -->
<a-col :span="24" :style="{ marginBottom: '24px' }">
<a-card :bordered="false" title="系统推荐课程" :style="{ height: '100%' }">
<a-row :gutter="16">
<a-row v-if="sysList && sysList.length>0" :gutter="16">
<a-col :span="6" :md="4" :sm="6" v-for="(item, index) in sysList" :key="index">
<a-card
@click="handlerContinue(item)"
@ -94,6 +94,7 @@
</a-card>
</a-col>
</a-row>
<a-empty v-else :image="$emptyImg"></a-empty>
</a-card>
</a-col>
<!-- 系统推荐课程 end -->

View File

@ -48,7 +48,7 @@
</a-row>
</a-card>
</template>
<a-empty v-else />
<a-empty v-else :image="$emptyImg" />
</a-card>
</template>

View File

@ -88,7 +88,11 @@ export default {
},
loginSuccess (res) {
this.loading = false
this.$router.push({ path: '/' })
if (this.form.roleCode === 'student') {
this.$router.push({ path: '/myhome' })
} else {
this.$router.push({ path: '/' })
}
// 1
setTimeout(() => {
this.$notification.success({