77ebf04d
梁保满
个人版
|
1
2
3
4
5
6
7
8
9
10
|
<template>
<div>
<back-box>
<template slot="title">
<span>个人信息</span>
</template>
</back-box>
<div class="page-content">
<div class="content-box">
<i class="el-icon-edit" @click="diaSchool = true"></i>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
11
|
<i class="el-icon-key" @click="diaPass = true"></i>
|
77ebf04d
梁保满
个人版
|
12
13
14
|
<ul class="school-info">
<li class="school-item">
<span class="s1">学校名称:</span>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
15
|
<span class="s2">{{ Info.tenantName || "--" }}</span>
|
77ebf04d
梁保满
个人版
|
16
17
18
|
</li>
<li class="school-item">
<span class="s1">教师姓名:</span>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
19
|
<span class="s2">{{ Info.contactPerson || "--" }}</span>
|
77ebf04d
梁保满
个人版
|
20
21
22
|
</li>
<li class="school-item">
<span class="s1">手机号码:</span>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
23
|
<span class="s2">{{ Info.contactPhone || "--" }}</span>
|
77ebf04d
梁保满
个人版
|
24
|
</li>
|
77ebf04d
梁保满
个人版
|
25
26
27
|
</ul>
</div>
</div>
|
5cfb0264
梁保满
班级管理交互优化
|
28
|
<el-dialog :close-on-click-modal="false" title="修改个人信息" :visible.sync="diaSchool" width="400">
|
77ebf04d
梁保满
个人版
|
29
30
31
32
33
34
35
|
<el-form
ref="formSchool"
class="form-box"
:model="formSchool"
:rules="rulesSchool"
label-width="160px"
>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
36
37
38
39
40
41
42
43
|
<el-form-item label="学校名称:" prop="tenantName"
><el-col :span="10"
><el-input
maxlength="30"
v-model="formSchool.tenantName"
placeholder="请输入教师姓名"
></el-input></el-col
></el-form-item>
|
77ebf04d
梁保满
个人版
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<el-form-item label="教师姓名:" prop="contactPerson"
><el-col :span="10"
><el-input
maxlength="30"
v-model="formSchool.contactPerson"
placeholder="请输入教师姓名"
></el-input></el-col
></el-form-item>
<el-form-item label="手机号码:" prop="contactPhone"
><el-col :span="10"
><el-input
v-model="formSchool.contactPhone"
type="number"
oninput="if(value.length > 11) value = value.slice(0,11)"
placeholder="请输入教师姓名手机号码"
></el-input></el-col
></el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="editSchool">确 定</el-button>
<el-button @click="diaSchool = false">取 消</el-button>
</div>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
66
|
</el-dialog>
|
5cfb0264
梁保满
班级管理交互优化
|
67
|
<el-dialog :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
<el-form
ref="formPass"
class="form-box"
:model="password"
:rules="rulesPassword"
label-width="160px"
>
<el-form-item label="旧密码:" prop="oldPassword"
><el-col :span="10"
><el-input
maxlength="30"
v-model="password.oldPassword"
placeholder="请输入密码"
show-password
></el-input></el-col
></el-form-item>
<el-form-item label="新密码:" prop="password"
><el-col :span="10"
><el-input
maxlength="30"
v-model="password.password"
placeholder="请输入新密码"
show-password
></el-input></el-col
></el-form-item>
<el-form-item label="确认密码:" prop="resetPassword"
><el-col :span="10"
><el-input
maxlength="30"
v-model="password.resetPassword"
placeholder="请输入新密码"
show-password
></el-input></el-col
></el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="editPass">确 定</el-button>
<el-button @click="diaPass = false">取 消</el-button>
</div>
</el-dialog>
|
77ebf04d
梁保满
个人版
|
108
109
110
111
|
</div>
</template>
<script>
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
112
|
import { downloadFile, encryptLoginPassword } from "@/utils";
|
77ebf04d
梁保满
个人版
|
113
|
export default {
|
77ebf04d
梁保满
个人版
|
114
115
116
117
|
data() {
return {
loading: false,
diaSchool: false,
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
118
119
120
|
diaPass: false,
Info: {
tenantName: "",
|
77ebf04d
梁保满
个人版
|
121
122
123
124
|
contactPerson: "",
contactPhone: "",
sections: "",
},
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
password: {
oldPassword: "",
password: "",
resetPassword: "",
},
rulesPassword: {
oldPassword: [
{ required: true, message: "请输入旧密码", trigger: "blur" },
],
password: [
{ required: true, message: "请输入新密码", trigger: "blur" },
],
resetPassword: [
{ required: true, message: "请输入新密码", trigger: "blur" },
],
},
|
77ebf04d
梁保满
个人版
|
141
142
|
tableData: [],
formSchool: {
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
143
|
tenantName: "",
|
77ebf04d
梁保满
个人版
|
144
145
146
|
contactPerson: "",
contactPhone: "",
},
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
147
|
rulesSchool: {},
|
77ebf04d
梁保满
个人版
|
148
149
150
|
};
},
created() {
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
151
|
this._QueryData();
|
77ebf04d
梁保满
个人版
|
152
153
|
},
methods: {
|
77ebf04d
梁保满
个人版
|
154
|
editSchool() {
|
77ebf04d
梁保满
个人版
|
155
156
157
158
159
160
161
|
if (this.loading) {
return;
}
this.$refs.formSchool.validate(async (valid) => {
if (valid) {
this.loading = true;
let form = { ...this.formSchool };
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
162
|
const { data, status, info } = await this.$request.modifyInfo({
|
77ebf04d
梁保满
个人版
|
163
164
165
166
167
168
|
...form,
});
this.loading = false;
if (status === 0) {
this.$message.success("修改成功~");
this.diaSchool = false;
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
this._QueryData();
} else {
this.$message.error(info);
}
} else {
this.$message.error("数据有误,请检查!");
}
});
},
editPass() {
if (this.loading) {
return;
}
this.$refs.formPass.validate(async (valid) => {
if (valid) {
if (this.password.password != this.password.resetPassword) {
this.$message.warning("两次输入密码不一致请检查!");
return;
}
this.loading = true;
const { data, status, info } = await this.$request.modifyInfo({
oldPassword: encryptLoginPassword(this.password.oldPassword),
password: encryptLoginPassword(this.password.password),
});
this.loading = false;
if (status === 0) {
this.$message.success("密码修改成功~");
this.diaPass = false;
const res = await this.$request.logout();
this.$store.commit("setToken", "");
this.$store.commit("setInfo", {});
this.$store.commit("setRouters", []);
this.$store.commit("resetTabnavBox");
this.$router.push({
path: "/login",
});
|
77ebf04d
梁保满
个人版
|
205
206
207
208
209
210
211
212
|
} else {
this.$message.error(info);
}
} else {
this.$message.error("数据有误,请检查!");
}
});
},
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
213
|
async _QueryData() {
|
77ebf04d
梁保满
个人版
|
214
|
this.loading = true;
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
215
|
const { data, status, info } = await this.$request.getInfo();
|
77ebf04d
梁保满
个人版
|
216
217
218
|
this.loading = false;
console.log(status);
if (status === 0) {
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
219
|
this.Info = { ...data };
|
77ebf04d
梁保满
个人版
|
220
221
222
|
for (let key in this.formSchool) {
this.formSchool[key] = data[key] || "";
}
|
77ebf04d
梁保满
个人版
|
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
} else {
this.$message.error(info);
}
},
async downExcel() {
let data = await this.$request.downDevice({
id: this.id,
});
if (data && !data.code) {
let blob = new Blob([data], {
type: "application/vnd.ms-excel;charset=utf-8",
});
downloadFile(`设备信息.xlsx`, blob);
} else {
this.$message.error(data.info);
}
},
},
};
</script>
<style lang="scss" scoped>
.page-content {
padding: 20px;
.content-box {
background: #f8f8f8;
border-radius: 16px;
position: relative;
.el-icon-edit {
position: absolute;
top: 12px;
|
d703d72c
梁保满
首页,个人信息,班级名单,部分备题...
|
254
255
256
257
258
259
260
261
262
263
264
|
right: 40px;
padding: 5px;
font-size: 18px;
cursor: pointer;
&:hover {
color: #36f;
}
}
.el-icon-key {
position: absolute;
top: 12px;
|
77ebf04d
梁保满
个人版
|
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
right: 12px;
padding: 5px;
font-size: 18px;
cursor: pointer;
&:hover {
color: #36f;
}
}
}
.school-info {
display: flex;
flex-wrap: wrap;
padding: 16px 0;
border-bottom: 0.5px solid #f2f2f2;
.school-item {
width: 50%;
line-height: 48px;
padding-left: 100px;
display: flex;
box-sizing: border-box;
.s1 {
width: 160px;
font-size: 15px;
color: #888;
}
.s2 {
flex: 1;
}
}
}
}
.form-box {
margin: 0 20px;
.subject-box {
height: 90px;
overflow: hidden;
position: relative;
&.active {
height: auto;
overflow: auto;
}
.showAll {
position: absolute;
bottom: 0;
right: 10px;
font-size: 12px;
color: #7f7f7f;
cursor: pointer;
padding: 2px;
&:hover {
color: #667ffd;
}
}
}
}
.el-icon-plus {
cursor: pointer;
&:hover {
color: #667ffd;
}
}
</style>
|