北尚诉办前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

69 lines
1.8 KiB

<template>
<el-dialog :visible.sync="visible"
title="查看"
width="500px"
:close-on-click-modal="false"
:close-on-press-escape="false">
<el-form :model="dataForm" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '160px' : '160px'">
<el-form-item label="昵称:">
<span>{{dataForm.nickname}}</span>
</el-form-item>
<el-form-item label="手机号:">
<span>{{dataForm.mobile}}</span>
</el-form-item>
<el-form-item label="注册时间:">
<span>{{dataForm.registerTime}}</span>
</el-form-item>
<el-form-item label="最后登录时间:">
<span>{{dataForm.lastLoginTime}}</span>
</el-form-item>
<el-form-item label="最后登录IP:">
<span>{{dataForm.lastLoginIp}}</span>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
nickname: '',
mobile: '',
registerTime: '',
lastLoginTime: '',
lastLoginIp: ''
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
// 获取信息
getInfo () {
this.$http.get(`/app-user/user/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => { })
}
}
}
</script>