Skip to content

Commit b7f7d9d

Browse files
gongjsvanoneang
authored andcommitted
Component (#134):调整form表单宽度
* fix:优化lin-table * 调整form表单宽度 * fix
1 parent 4c78dbb commit b7f7d9d

5 files changed

Lines changed: 41 additions & 35 deletions

File tree

src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default {
2828
</script>
2929

3030
<style lang="scss">
31+
3132
#app {
3233
-webkit-font-smoothing: antialiased;
3334
-moz-osx-font-smoothing: grayscale;

src/assets/styles/realize/element-variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ $--font-path: "~element-ui/lib/theme-chalk/fonts";
196196

197197
// pagination
198198
.el-pagination__editor.el-input .el-input__inner {
199-
border-radius: 14px;
199+
border-radius: 4px;
200200
}
201201

202202
.el-pagination.is-background .el-pager li:not(.disabled).active {

src/components/layout/User.vue

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@
44
<span class="el-dropdown-link">
55
<img src="../../assets/img/user/user.png" alt="管理员头像" class="nav-avatar">
66
</span>
7-
<el-dropdown-menu slot="dropdown" class="user-box" style="border:none;
8-
background-color:none;
9-
background:transparent;
10-
margin-bottom:0;
11-
padding-bottom:0;">
7+
<el-dropdown-menu slot="dropdown" class="user-box">
128
<div class="user-info">
139
<img src="../../assets/img/user/user.png" class="avatar" alt="管理员头像">
1410
<div class="text">
1511
<div class="username">{{nickname}}</div>
1612
<div class="desc">{{title}}</div>
1713
</div>
18-
<img src="../../assets/img/user/corner.png" class="corner" />
14+
<img src="../../assets/img/user/corner.png" class="corner">
1915
</div>
2016
<ul class="dropdown-box">
21-
<li class=" password" @click="changePassword">
17+
<li class="password" @click="changePassword">
2218
<i class="iconfont icon-weibaoxitongshangchuanlogo-"></i>
2319
<span>修改登录密码</span>
2420
</li>
@@ -29,19 +25,19 @@
2925
</ul>
3026
</el-dropdown-menu>
3127
</el-dropdown>
32-
<el-dialog
28+
<el-dialog
3329
title="修改密码"
3430
:append-to-body="true"
3531
:before-close="handleClose"
36-
:visible.sync="dialogFormVisible">
37-
<el-divider style="margin-top:-20px;margin-bottom:20px;"></el-divider>
32+
:visible.sync="dialogFormVisible"
33+
class="user-dialog">
3834
<el-form
3935
:model="form"
4036
status-icon
4137
:rules="rules"
4238
label-position="left"
4339
ref="form"
44-
label-width="100px"
40+
label-width="90px"
4541
@submit.native.prevent>
4642
<el-form-item label="原始密码" prop="old_password">
4743
<el-input type="password" v-model="form.old_password" autocomplete="off"></el-input>
@@ -58,6 +54,7 @@
5854
</el-form-item>
5955
</el-form>
6056
</el-dialog>
57+
6158
</div>
6259
</template>
6360

@@ -67,7 +64,8 @@ import User from '@/lin/models/user'
6764
6865
export default {
6966
data() {
70-
const oldPassword = (rule, value, callback) => { // eslint-disable-line
67+
const oldPassword = (rule, value, callback) => {
68+
// eslint-disable-line
7169
if (!value) {
7270
return callback(new Error('原始密码不能为空'))
7371
}
@@ -135,15 +133,20 @@ export default {
135133
window.location.href = origin
136134
},
137135
submitForm(formName) {
138-
if (this.form.old_password === '' && this.form.new_password === '' && this.form.confirm_password === '') {
136+
if (
137+
this.form.old_password === ''
138+
&& this.form.new_password === ''
139+
&& this.form.confirm_password === ''
140+
) {
139141
this.dialogFormVisible = false
140142
return
141143
}
142144
if (this.form.old_password === this.form.new_password) {
143145
this.$message.error('新密码不能与原始密码一样')
144146
return
145147
}
146-
this.$refs[formName].validate(async (valid) => { // eslint-disable-line
148+
this.$refs[formName].validate(async (valid) => {
149+
// eslint-disable-line
147150
if (valid) {
148151
const res = await User.updatePassword(this.form)
149152
if (res.error_code === 0) {
@@ -180,20 +183,34 @@ export default {
180183
}
181184
</script>
182185

183-
<style lang="scss">
186+
<style lang="scss" scoped>
187+
.user-dialog /deep/ .el-dialog .el-dialog__header {
188+
border-bottom: 1px solid #dae1ed;
189+
padding-bottom:20px;
190+
}
184191
185-
.el-dropdown-link {
186-
cursor: pointer;
192+
.user-dialog /deep/ .el-dialog .el-dialog__body {
193+
padding-bottom:00px;
194+
}
187195
188-
.nav-avatar {
189-
width: 40px;
190-
height: 40px;
191-
margin-right: 10px;
196+
.user {
197+
.el-dropdown-link {
198+
cursor: pointer;
199+
200+
.nav-avatar {
201+
width: 40px;
202+
height: 40px;
203+
margin-right: 10px;
204+
}
192205
}
193206
}
194207
195208
.user-box {
196209
width: 326px;
210+
background-color: none;
211+
background: transparent;
212+
margin-bottom: 0;
213+
padding-bottom: 0;
197214
border: none;
198215
199216
.user-info {

src/plugins/LinCmsUi/views/table/TableCombo.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,5 @@ export default {
528528
justify-content: flex-end;
529529
margin: 20px;
530530
}
531-
.pagination /deep/ .el-pagination__editor.el-input .el-input__inner {
532-
border-radius: 4px;
533-
}
534-
}
535-
</style>
536-
<style>
537-
.tableSample .el-table .cell {
538-
display: inline-block;
539-
width: 100%;
540531
}
541532
</style>

src/views/admin/user/UserInfo.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<template>
22
<div class="container">
3-
<el-row>
4-
<el-col :lg="16" :md="20" :sm="24" :xs="24">
53
<el-form
64
:model="form"
75
status-icon
@@ -39,8 +37,6 @@
3937
<el-button @click="resetForm('form')">重 置</el-button>
4038
</el-form-item>
4139
</el-form>
42-
</el-col>
43-
</el-row>
4440
</div>
4541
</template>
4642

@@ -245,6 +241,7 @@ export default {
245241
.container {
246242
margin-top: 20px;
247243
margin-left: -5px;
244+
max-width:800px;
248245
249246
.submit {
250247
float: left;

0 commit comments

Comments
 (0)