1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-11 13:39:48 +08:00

support style mode mobile (#350)

Co-authored-by: Edwin Betancourt <EdwinBetanc0urt@hotmail.com>
This commit is contained in:
elsiosanchez 2020-02-25 09:06:13 -04:00 committed by GitHub
parent 1126c00c1f
commit b44b71f418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 106 additions and 17 deletions

View File

@ -2,9 +2,9 @@
<div> <div>
<el-card <el-card
v-if="getIsChangeLog" v-if="getIsChangeLog"
class="box-card" :class="classIsMobilePanel"
> >
<el-scrollbar wrap-class="scroll-window-log-change"> <el-scrollbar :wrap-class="classIsMobilePanel">
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
v-for="(listLogs, key) in gettersListRecordLogs" v-for="(listLogs, key) in gettersListRecordLogs"
@ -37,7 +37,24 @@
import { MixinInfo } from '@/components/ADempiere/ContainerInfo/mixinInfo' import { MixinInfo } from '@/components/ADempiere/ContainerInfo/mixinInfo'
export default { export default {
name: 'RecordLogs', name: 'RecordLogs',
mixins: [MixinInfo] mixins: [MixinInfo],
computed: {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
classIsMobileScroll() {
if (this.isMobile) {
return 'scroll-window-log-change-mobile'
}
return 'scroll-window-log-change'
},
classIsMobilePanel() {
if (this.isMobile) {
return 'panel-mobile'
}
return 'panel'
}
}
} }
</script> </script>
@ -45,4 +62,13 @@ export default {
.scroll-window-log-change { .scroll-window-log-change {
max-height: 74vh !important; max-height: 74vh !important;
} }
.scroll-window-log-change-mobile {
max-height: 56vh !important;
}
.panel-mobile {
height: 57vh;
}
.panel {
height: 100vh;
}
</style> </style>

View File

@ -5,7 +5,7 @@
> >
<el-container style="height: 86vh;"> <el-container style="height: 86vh;">
<Split> <Split>
<SplitArea :size="show ? 50 : 100" :min-size="100"> <SplitArea :size="show ? isSizePanel : 100" :min-size="100">
<el-aside width="100%"> <el-aside width="100%">
<split-pane :min-percent="10" :default-percent="defaultPorcentSplitPane" split="vertical"> <split-pane :min-percent="10" :default-percent="defaultPorcentSplitPane" split="vertical">
<template> <template>
@ -73,7 +73,7 @@
:tabs-list="windowMetadata.tabsListParent" :tabs-list="windowMetadata.tabsListParent"
class="tab-window" class="tab-window"
/> />
<div style="right: 0%; top: 40%; position: absolute;"> <div :class="classIsContainerInfo">
<el-button v-show="!show" type="info" icon="el-icon-info" circle style="float: right;" class="el-button-window" @click="conteInfo" /> <el-button v-show="!show" type="info" icon="el-icon-info" circle style="float: right;" class="el-button-window" @click="conteInfo" />
</div> </div>
<div class="small-4 columns"> <div class="small-4 columns">
@ -142,9 +142,9 @@
</split-pane> </split-pane>
</el-aside> </el-aside>
</SplitArea> </SplitArea>
<SplitArea :size="show ? 50 : 0"> <SplitArea :size="show ? isSize : 0">
<el-main> <el-main>
<div style="top: 40%; position: absolute;"> <div :class="isCloseInfo">
<el-button v-show="show" type="info" icon="el-icon-info" circle style="float: right;" class="el-button-window" @click="conteInfo" /> <el-button v-show="show" type="info" icon="el-icon-info" circle style="float: right;" class="el-button-window" @click="conteInfo" />
</div> </div>
<div id="example-1"> <div id="example-1">
@ -292,6 +292,30 @@ export default {
} }
return 'open-table-detail' return 'open-table-detail'
}, },
classIsContainerInfo() {
if (this.isMobile) {
return 'container-info-mobile'
}
return 'container-info'
},
isSize() {
if (this.isMobile && (this.show)) {
return 98
}
return 50
},
isSizePanel() {
if (this.isMobile && (this.show)) {
return 2
}
return 50
},
isCloseInfo() {
if (this.isMobile) {
return 'close-info-mobile'
}
return 'close-info'
},
iconShowedRecordNavigation() { iconShowedRecordNavigation() {
if (this.isShowedRecordNavigation) { if (this.isShowedRecordNavigation) {
return 'el-icon-caret-left' return 'el-icon-caret-left'
@ -383,6 +407,24 @@ export default {
}, },
getterShowContainerInfo() { getterShowContainerInfo() {
return this.$store.getters.getShowContainerInfo return this.$store.getters.getShowContainerInfo
},
getterDataRecordsAndSelection() {
return this.$store.getters.getDataRecordAndSelection(this.windowMetadata.firstTabUuid)
},
getterDataRecords() {
return this.getterDataRecordsAndSelection.record
},
getTableName() {
return this.$store.getters.getPanel(this.windowMetadata.firstTabUuid, false).tableName
},
// current record
getRecord() {
const record = this.getterDataRecords.find(record => {
if (record.UUID === this.$route.query.action) {
return record
}
})
return record
} }
}, },
watch: { watch: {
@ -404,20 +446,22 @@ export default {
methods: { methods: {
conteInfo() { conteInfo() {
this.show = !this.show this.show = !this.show
this.$store.dispatch('listWorkflowLogs', { if (this.show) {
tableName: this.$route.params.tableName, this.$store.dispatch('listWorkflowLogs', {
recordId: this.$route.params.recordId tableName: this.getTableName,
}) recordId: this.getRecord[this.getTableName + '_ID']
this.$store.dispatch('listChatEntries', { })
tableName: this.$route.params.tableName, this.$store.dispatch(this.activeInfo, {
recordId: this.$route.params.recordId tableName: this.getTableName,
}) recordId: this.getRecord[this.getTableName + '_ID']
})
}
this.$store.dispatch('showContainerInfo', !this.getterShowContainerInfo) this.$store.dispatch('showContainerInfo', !this.getterShowContainerInfo)
}, },
handleClick(tab, event) { handleClick(tab, event) {
this.$store.dispatch(tab.name, { this.$store.dispatch(tab.name, {
tableName: this.$route.params.tableName, tableName: this.getTableName,
recordId: this.$route.params.recordId recordId: this.getRecord[this.getTableName + '_ID']
}) })
}, },
// callback new size // callback new size
@ -425,6 +469,7 @@ export default {
this.$store.dispatch('setSplitHeightTop', { this.$store.dispatch('setSplitHeightTop', {
splitHeightTop: size[0] splitHeightTop: size[0]
}) })
this.$store.dispatch('setSplitHeight', { this.$store.dispatch('setSplitHeight', {
splitHeight: size[1] splitHeight: size[1]
}) })
@ -621,6 +666,24 @@ export default {
color: white; color: white;
background: #008fd3; background: #008fd3;
} }
.container-info-mobile {
top: 29%;
position: absolute;
right: 0%;
}
.container-info {
top: 40%;
position: absolute;
right: 0%;
}
.close-info {
top: 40%;
position: absolute;
}
.close-info-mobile {
top: 29%;
position: absolute;
}
.vertical-panes { .vertical-panes {
width: 100%; width: 100%;
height: 85vh; height: 85vh;