<template>

	<el-main style="padding:0 20px;">
		<el-descriptions :column="1" border size="small">
			<el-descriptions-item label="请求接口">{{data.route}}</el-descriptions-item>
			<el-descriptions-item label="ip">{{data.ip}}</el-descriptions-item>
			<el-descriptions-item label="ip属地">{{data.location}}</el-descriptions-item>
			<el-descriptions-item label="日志名">{{data.log_title}}</el-descriptions-item>
			<el-descriptions-item label="日志时间">{{data.created_at}}</el-descriptions-item>
		</el-descriptions>
		<el-collapse v-model="activeNames" style="margin-top: 20px;">
			<el-collapse-item title="详细" name="1">
				<el-alert :title="data.remark" :type="typeMap[data.level]" :closable="false"></el-alert>
			</el-collapse-item>
		</el-collapse>
	</el-main>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
				activeNames: ['1'],
				typeMap: {
					'info': "info",
					'warn': "warning",
					'error': "error"
				}
			}
		},
		methods: {
			setData(data){
				this.data = data
			}
		}
	}
</script>

<style scoped>
	.code {background: #848484;padding:15px;color: #fff;font-size: 12px;border-radius: 4px;}
</style>
