Commit 90675607 by sendya

fix: display problem in mobile mode

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