1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
<div class="app-content from-table" style="max-height:460px;overflow:auto;">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>单位信息</span>
</div>
</a-col>
</a-row>
<unit-info :data="unitData" />
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>管理员信息</span>
</div>
</a-col>
</a-row>
<unit-manager-info :data="managerData" />
</a-spin>
</div>
</template>
<script>
import unitInfo from '@/views/manager/unit/components/unitInfo'
import unitManagerInfo from '@/views/manager/unit/components/unitManagerInfo'
export default {
name: "unitView",
components: {
unitInfo, unitManagerInfo
},
data () {
return {
unitData: {},
managerData: [],
loading: false,
}
},
props: {
value: {
type: String,
default: () => {
return null
}
}
},
created () {
this.getUnitById()
},
methods: {
getUnitById () {
if (this.value) {
this.loading = true
this.$api.unit.getUnitById({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.unitData = data
this.managerData = data.managers
} this.loading = false
}).catch(() => { this.loading = false })
}
}
}
}
</script>