提交 41752b87 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 62075f7e
...@@ -20,7 +20,11 @@ export function getScore(params) { ...@@ -20,7 +20,11 @@ export function getScore(params) {
export function getCerts(params) { export function getCerts(params) {
return httpRequest.get('/api/certs/v1/student/get-certificate', { params }) return httpRequest.get('/api/certs/v1/student/get-certificate', { params })
} }
// // 登出 // 登出
export function logout() { export function logout() {
return httpRequest.get('/api/passport/rest/logout') return httpRequest.get('/api/passport/rest/logout')
} }
// 更新邮箱
export function updateInfo(data) {
return httpRequest.post('/api/certs/v1/student/update-info', data)
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:show-layout="false" :show-layout="false"
:float-layout="false" :float-layout="false"
:enable-download="true" :enable-download="true"
:preview-modal="true" :preview-modal="false"
:manual-pagination="true" :manual-pagination="true"
:paginate-elements-by-height="500" :paginate-elements-by-height="500"
filename="file" filename="file"
......
<template> <template>
<div> <div>
<div class="profile-title">{{ $t('shmsLang.status.proTitle') }}</div> <div class="profile-title">{{ $t('shmsLang.status.proTitle') }}</div>
<div class="profile-content"> <div :class="isPdf ? 'profile-content is-pdf' : 'profile-content'">
<div class="photo"> <div class="photo">
<img :src="info.head_img" /> <img :src="info.head_img" />
</div> </div>
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
<div class="info-temp m-t33"> <div class="info-temp m-t33">
<div class="name w120">{{ $t('shmsLang.status.email') }}</div> <div class="name w120">{{ $t('shmsLang.status.email') }}</div>
<div class="value">{{ info.email }}</div> <div class="value">{{ info.email }}</div>
<div
@click="dialogVisible = true"
v-if="!isPdf"
class="email-icon el-icon-edit-outline"
style="color: #4eaeea"
></div>
</div> </div>
</div> </div>
<div class="info-box"> <div class="info-box">
...@@ -41,17 +47,31 @@ ...@@ -41,17 +47,31 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="email" :visible.sync="dialogVisible" width="30%">
<el-input v-model="emailValue" autocomplete="off"></el-input>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="updateInfo">确 定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import * as api from '@/api/account.js'
export default { export default {
props: { props: {
info: { info: {
type: Object type: Object
},
isPdf: {
type: Boolean
} }
}, },
data() { data() {
return {} return {
emailValue: '',
dialogVisible: false
}
}, },
computed: { computed: {
setSex() { setSex() {
...@@ -78,9 +98,30 @@ export default { ...@@ -78,9 +98,30 @@ export default {
} }
}, },
mounted() { mounted() {
this.emailValue = this.info.email
this.setDate() this.setDate()
}, },
methods: { methods: {
updateInfo() {
const reg = /^([a-zA-Z]|[0-9])(\w|-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if (!reg.test(this.emailValue)) {
this.$message({
message: 'The email format is incorrect',
type: 'warning'
})
return false
}
api
.updateInfo({ email: this.emailValue })
.then(response => {
if (response.code === 0) {
this.dialogVisible = false
this.info.email = this.emailValue
this.$forceUpdate()
}
})
.finally(() => {})
},
setDate() { setDate() {
const substringDate = '2021-01-01'.substring(0, '2021-01-01 01:01:00'.indexOf(' ')) const substringDate = '2021-01-01'.substring(0, '2021-01-01 01:01:00'.indexOf(' '))
const splitDate = substringDate.split('-') const splitDate = substringDate.split('-')
...@@ -104,6 +145,16 @@ export default { ...@@ -104,6 +145,16 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// ::v-deep {
// .el-dialog__wrapper {
// background: rgba(0,0,0,0.3) !important;
// }
// }
.email-icon {
color: '#4EAEEA';
font-size: 20px;
margin-left: 10px;
}
.profile-title { .profile-title {
font-size: 20px; font-size: 20px;
line-height: 24px; line-height: 24px;
...@@ -115,6 +166,11 @@ export default { ...@@ -115,6 +166,11 @@ export default {
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
&.is-pdf {
.value {
max-width: 100px !important;
}
}
.photo { .photo {
width: 146px; width: 146px;
min-width: 146px; min-width: 146px;
...@@ -165,7 +221,6 @@ export default { ...@@ -165,7 +221,6 @@ export default {
text-align: right; text-align: right;
} }
.value { .value {
max-width: 100px;
font-size: 16px; font-size: 16px;
color: #838383; color: #838383;
margin-left: 19px; margin-left: 19px;
......
...@@ -17,19 +17,24 @@ ...@@ -17,19 +17,24 @@
</div> </div>
<div class="btn" @click="generateReport">{{ $t('shmsLang.downloadBtn') }}</div> <div class="btn" @click="generateReport">{{ $t('shmsLang.downloadBtn') }}</div>
</div> </div>
<div class="pdf-down_box">
<profile :info="info" @changes="changes" />
<degrees :degreesItem="degreesItem" />
</div>
<vue-html2pdf <vue-html2pdf
:show-layout="false" :show-layout="false"
:float-layout="false" :float-layout="true"
:enable-download="true" :enable-download="true"
:preview-modal="true" :preview-modal="false"
:paginate-elements-by-height="1000" :paginate-elements-by-height="1000"
:manual-pagination="true"
filename="file" filename="file"
pdf-content-width="100%" pdf-content-width="100%"
ref="html2Pdf" ref="html2Pdf"
> >
<section slot="pdf-content"> <section slot="pdf-content">
<div class="pdf-down_box"> <div class="pdf-down_box">
<profile :info="info" @changes="changes" /> <profile :info="info" :isPdf="true" @changes="changes" />
<degrees :degreesItem="degreesItem" /> <degrees :degreesItem="degreesItem" />
</div> </div>
</section> </section>
...@@ -85,6 +90,11 @@ export default { ...@@ -85,6 +90,11 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep {
.vue-html2pdf {
display: none;
}
}
.pdf-down_box { .pdf-down_box {
padding: 0 30px; padding: 0 30px;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论