<template>
 
	<view  class="employee_card" @click="selectOne">
		<view  :class="{employee_card_left_box:right_nativate==true,
						employee_card_box:right_nativate==false}" >
			<view >
				<image class="image" mode="aspectFill" :src="imgUrl" />
			</view>
			<view class="employee_card_column">
				<label class="employee_card_top_box">{{name}}</label>
				<label class="employee_card_bottom_box">{{position}}</label>			
			</view>			
		</view>
		<view v-if="right_nativate" class="employee_card_right_box">
			<label class="right_label">></label>
		</view>
	</view>
</template>

<script>
	export default {
		
		
	    name: 'employee-card',
		props: {
			right_nativate:
			{
				type:Boolean,
				default:true
			},
			employeeId:
			{
				type:String,
				default:'asdf'
			},
			name: {
			    type: String,
			    default: ''
			},
			position:{
				type:String,
				default:'程序员'
			},
			imgUrl:{
				type:String,
				default:'/static/userpic.png'
			},
		},
		methods:{
			selectOne(i, event) {
				let _id = this.employeeId;
				let _name = this.name; 
				let response = {
				    id: _id,
				    name: _name
				};
				this.$emit('onEmployeeClick',response);
			}
		}
	}
</script>

<style>
	.image {
		margin:20rpx 20rpx 20rpx 20rpx;
		width: 100rpx;
		height: 100rpx;
	}
	
	.employee_card_column
	{
		display: flex;
		flex-direction: column;
	}
	.employee_card
	{
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		position: relative;
		height: 140rpx; 
		top:0rpx;
		left:0rpx;  			
		background-color: #FFFFFF!important;
		width: auto;
		
	}
	.employee_card_left_box
	{
		display: flex;
		flex-direction: row;
		height: 100%;
		width: 90%;
	}	
	.employee_card_box
	{
		display: flex;
		flex-direction: row;
		height: 100%;
		width: 100%;
	}	
	.employee_card_right_box
	{
		height: 100%;
		width: 10%;
		display: flex;
		justify-content: flex-end;
		padding-right: 20rpx;
	}
	.right_label
	{
		color: #C8C8C8;
		line-height: 140rpx;
		font-size: 40rpx;
	}
	.employee_card_top_box
	{
		height: 60%;
		font-weight: bold;
		line-height: 84rpx;
		font-size: 44rpx;
		margin-left: 20rpx;
	}
	.employee_card_bottom_box
	{
		height: 40%;
		line-height: 56rpx;
		font-size: 30rpx;
		margin-left: 20rpx;
	}
	
</style>
