<template> <div class="app_content from-table"> <a-spin :spinning="loading" style="width: 100%;height: 100%;"> <person-info :data="personInfo" /> </a-spin> </div> </template> <script> import personInfo from '@/views/person/components/personInfo' export default { name: "personView", components: { personInfo }, data () { return { personInfo: { personName: null, sex: null, certId: null, mobile: null, specName: null, titleName: null, educationName: null, unitName: null }, loading: false, } }, props: { value: { type: String, default: () => { return null } }, }, created () { this.getPersonById() }, methods: { getPersonById () { this.loading = true this.$api.person.getPersonById({ id: this.value }).then(({ data = {} }) => { if (data) { this.personInfo = data } this.loading = false }).catch(() => { this.loading = false }) } } } </script>