<template>
	<div style="width: 100%">
		<el-breadcrumb separator-class="el-icon-arrow-right">
			<el-breadcrumb-item>首页</el-breadcrumb-item>
			<el-breadcrumb-item>个人中心</el-breadcrumb-item>
		</el-breadcrumb>
		<div class="title">
			个人中心
		</div>

		<el-form :model="form" label-width="100px">
			<el-form-item label="登录账号" prop="form.username" required>
				<el-input v-model="form.username" :disabled="true"></el-input>
			</el-form-item>
			<el-form-item label="用户名称" prop="form.name" required>
				<el-input v-model="form.name" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="别名" prop="form.name_other" required>
				<el-input v-model="form.name_other" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="组别" prop="form.groupname" required>
				<el-input v-model="form.groupname" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="机构属性" prop="form.properties" required>
				<el-input v-model="form.properties" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="联系人姓名" prop="form.contact_name" required>
				<el-input v-model="form.contact_name" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="联系人电话" prop="form.contact_phone" required>
				<el-input v-model="form.contact_phone" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="创建时间" prop="form.create_time" required>
				<el-input v-model="form.create_time" :disabled="true"></el-input>
			</el-form-item>
            <el-form-item label="修改时间" prop="form.update_time" required>
				<el-input v-model="form.update_time" :disabled="true"></el-input>
			</el-form-item>



			<el-form-item>
				<el-button type="success" @click="putAccount()">修改账户信息</el-button>
				<!-- <el-button @click="reBack()">返回</el-button> -->
			</el-form-item>
		</el-form>
	</div>
</template>
<script>
	const rymc = window.sessionStorage.getItem('rymc')
	const token = window.sessionStorage.getItem('token')
	export default {
		data() {
			return {
				form: {
                    username:'',
                    name:'', 
                    name_other:'', 
                    groupname: '', 
                    properties: '', 
                    contact_name: '', 
                    contact_phone: '',
                    create_time:'' ,
                    update_time:''
				},
            }
		},
		created() {	
            this.getAccount()
		},
		mounted() {
            this.getAccount()
		},
		methods: {
            async getAccount() {
				const result = await this.$http.post('getAccount')
				console.log(result.data.data)
                this.form = result.data.data
                if (this.form.properties == 1){
                      this.form.properties ='政府部门';
                }else if(this.form.properties == 2){
                    this.form.properties ='事业单位';
                }else{
                     this.form.properties ='企业';
                }
              
                    
					
        },
        //修改信息
            putAccount(){
                 this.$router.push('putAccount')
                },
	}
    }
</script>
<style lang="less" scoped>
	.title {
		margin-left: 50%;
		margin-bottom: 20px;
	}

	.el-form {
		width: 800px;
		margin: 0 auto;
	}

	.footer {
		margin-top: 5px;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}
</style>
