mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 01:11:07 +00:00
perf: 优化移动端显示
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<ElFormRender
|
<ElFormRender
|
||||||
ref="form"
|
ref="form"
|
||||||
|
:class="mobile? 'mobile' : ''"
|
||||||
:content="fields"
|
:content="fields"
|
||||||
:form="basicForm"
|
:form="basicForm"
|
||||||
label-position="right"
|
:label-position="labelPosition"
|
||||||
label-width="20%"
|
label-width="20%"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
@@ -68,6 +69,14 @@ export default {
|
|||||||
basicForm: this.form
|
basicForm: this.form
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
mobile() {
|
||||||
|
return this.$store.state.app.device === 'mobile'
|
||||||
|
},
|
||||||
|
labelPosition() {
|
||||||
|
return this.mobile ? 'top' : 'left'
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取表单数据
|
// 获取表单数据
|
||||||
submitForm(formName, addContinue) {
|
submitForm(formName, addContinue) {
|
||||||
@@ -99,27 +108,35 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.el-form ::v-deep .el-form-item {
|
.el-form ::v-deep .el-form-item {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form ::v-deep .el-form-item__content {
|
.el-form ::v-deep .el-form-item__content {
|
||||||
width: 75%;
|
width: 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form ::v-deep .el-form-item__label {
|
.mobile.el-form ::v-deep .el-form-item__content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form ::v-deep .el-form-item__label {
|
||||||
padding: 0 30px 0 0;
|
padding: 0 30px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form ::v-deep .el-form-item__error {
|
.el-form ::v-deep .el-form-item__error {
|
||||||
position: inherit;
|
position: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form ::v-deep .form-group-header {
|
.el-form ::v-deep .form-group-header {
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form ::v-deep .help-block {
|
.el-form.mobile ::v-deep .form-group-header {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form ::v-deep .help-block {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
@@ -127,7 +144,7 @@ export default {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
.el-form ::v-deep .help-block a {
|
.el-form ::v-deep .help-block a {
|
||||||
color: #1c84c6;
|
color: #1c84c6;
|
||||||
}
|
}
|
||||||
.form-buttons {
|
.form-buttons {
|
||||||
|
@@ -65,4 +65,7 @@ export default {
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
.mobile .header-avatar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -4,13 +4,13 @@
|
|||||||
<div class="nav-logo">
|
<div class="nav-logo">
|
||||||
<Logo v-if="showLogo" :collapse="isCollapse" />
|
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-title" :class="{'collapsed': isCollapse}">
|
|
||||||
{{ isTitle }}
|
|
||||||
</div>
|
|
||||||
<div class="active-mobile">
|
<div class="active-mobile">
|
||||||
<ViewSwitcher />
|
<ViewSwitcher />
|
||||||
<Organization class="organization" />
|
<Organization class="organization" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="nav-title" :class="{'collapsed': isCollapse}">
|
||||||
|
{{ isTitle }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<el-menu
|
<el-menu
|
||||||
|
Reference in New Issue
Block a user