<template>
	<el-card shadow="never" header="个人信息" style="margin: 10px;">
		<el-form ref="form" :model="user" label-width="120px" style="margin-top:10px;">
			<el-form-item label="账号">
				<el-input v-model="user.username" disabled></el-input>
				<div class="el-form-item-msg">账号信息用于登录，系统不允许修改</div>
			</el-form-item>
			<el-form-item label="头像">
				<x-upload v-model="user.avatar" icon="el-icon-avatar" :cropper="true" :compress="1" :aspectRatio="1/1"></x-upload>
			</el-form-item>
			<el-form-item label="姓名">
				<el-input v-model="user.nickname"></el-input>
			</el-form-item>
			<el-form-item label="邮箱">
				<el-input v-model="user.email"></el-input>
			</el-form-item>
			<el-form-item label="手机号">
				<el-input v-model="user.mobile"></el-input>
			</el-form-item>
			<el-form-item label="性别">
				<el-select v-model="user.gender" placeholder="请选择">
					<el-option label="保密" value="0"></el-option>
					<el-option label="男" value="1"></el-option>
					<el-option label="女" value="2"></el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="个性签名">
				<el-input v-model="user.about" type="textarea"></el-input>
			</el-form-item>

			<el-form-item :label="i.label" v-for="(i,index) in form" :key="index">
				<x-item :item="i" v-model="user"></x-item>
			</el-form-item>

			<el-form-item>
				<el-button type="primary" @click="submit">保存</el-button>
			</el-form-item>
		</el-form>
	</el-card>
</template>

<script>

	export default {
		props: {
		   data: { type: Object, default: () => ({}) }
		},
		components: {
		},
		data() {
			return {
				user: {},
				form: [],
				token:null
			}
		},
		watch:{

		},
		mounted() {
			// this.$http.post('system/user/get', { uid:this.data.uid }).then((res) => {
			//     if (res.code == 200) {
			//     	this.user = res.data.user;
			//     	this.token = res.data.token;
			//     	this.form = res.data.form;
			//     }
			// });
		},
		methods: {
			updateParentValue(val) {
				console.log(val)
			      alert('fdsafa')
			 },
			submit(){
				alert(1)
			}
		}
	}
</script>

<style>
</style>
