Commit 90675607 by sendya

fix: display problem in mobile mode

parent 2ddf9e9d
<template>
<a-locale-provider :locale="locale">
<div id="app">
<router-view/>
</div>
</a-locale-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device'
export default {
data () {
return {
locale: zhCN,
}
},
created () {
let that = this
enquireScreen(deviceType => {
// tablet
if (deviceType === 0) {
that.$store.commit('TOGGLE_DEVICE', 'tablet')
that.$store.commit('CLOSE_SIDEBAR', false)
}
// mobile
else if (deviceType === 1) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.commit('CLOSE_SIDEBAR', false)
}
else {
that.$store.commit('TOGGLE_DEVICE', 'desktop')
that.$store.commit('SET_SIDEBAR_TYPE', true)
}
})
}
}
</script>
<style>
#app {
height: 100%;
}
<template>
<a-locale-provider :locale="locale">
<div id="app">
<router-view/>
</div>
</a-locale-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device'
export default {
data () {
return {
locale: zhCN,
}
},
created () {
let that = this
enquireScreen(deviceType => {
// tablet
if (deviceType === 0) {
that.$store.commit('TOGGLE_DEVICE', 'tablet')
that.$store.dispatch('setSidebar', false)
}
// mobile
else if (deviceType === 1) {
that.$store.commit('TOGGLE_DEVICE', 'mobile')
that.$store.dispatch('setSidebar', false)
}
else {
that.$store.commit('TOGGLE_DEVICE', 'desktop')
that.$store.dispatch('setSidebar', true)
}
})
}
}
</script>
<style>
#app {
height: 100%;
}
</style>
\ No newline at end of file
......@@ -102,6 +102,12 @@
device: state => state.app.device,
})
},
watch: {
sidebarOpened(val) {
console.log('watch',val)
this.collapsed = !val
},
},
created() {
this.menus = this.mainMenu.find((item) => item.path === '/').children
},
......@@ -144,10 +150,17 @@
}
}
/**
* ant-table-wrapper
* 覆盖的表格手机模式样式,如果想修改在手机上表格最低宽度,可以在这里改动
*/
.ant-table-wrapper {
.ant-table-body {
.ant-table-content {
overflow-y: auto;
}
.ant-table-body {
min-width: 800px;
}
}
.sidemenu {
.ant-header-fixedHeader {
......
......@@ -13,7 +13,7 @@ export const asyncRouterMap = [
{
path: '/dashboard',
name: 'dashboard',
redirect: '/dashboard/analysis',
redirect: '/dashboard/workplace',
component: RouteView,
meta: { title: '仪表盘', icon: 'dashboard', permission: [ 'dashboard' ] },
children: [
......
......@@ -40,10 +40,10 @@
:gutter="24"
:style="{ marginBottom: '12px' }">
<a-col :span="12" v-for="(role, index) in record.permissions" :key="index" :style="{ marginBottom: '12px' }">
<a-col :span="4">
<a-col :lg="4" :md="24">
<span>{{ role.permissionName }}</span>
</a-col>
<a-col :span="20" v-if="role.actionEntitySet.length > 0">
<a-col :lg="20" :md="24" v-if="role.actionEntitySet.length > 0">
<a-tag color="cyan" v-for="(action, k) in role.actionEntitySet" :key="k">{{ action.describe }}</a-tag>
</a-col>
<a-col :span="20" v-else>-</a-col>
......
......@@ -110,7 +110,7 @@
loginBtn: false,
// login type: 0 email, 1 username, 2 telephone
loginType: 0,
requiredTwoStepCaptcha: true,
requiredTwoStepCaptcha: false,
stepCaptchaVisible: false,
form: null,
state: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment