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
65
66
67
<template>
<dee-static-cmp
:cmp-options="tableLayout"
:result-data="tableData"
/>
</template>
<script>
import { get } from '@/utils/http'
export default {
name: 'RelatedCA',
displayName: '相关CA',
modelRelationObjs: ['DxDocument', 'DxPart'],
props: {
modelName: {
type: String,
default: () => ''
},
basicData: {
type: Object,
default: () => null
}
},
data() {
return {
tableLayout: {
typeName: 'DxChangeActivity',
value: 'RelatedCA'
},
tableData: []
}
},
computed: {},
watch: {
basicData: {
deep: true,
handler: function() {
this.getTableData()
}
}
},
// 生命周期 - 创建完成(访问当前this实例)
created() {},
// 生命周期 - 挂载完成(访问DOM元素)
mounted() {
if (this.basicData) {
this.getTableData()
}
},
methods: {
getTableData() {
if (!this.basicData) {
return
}
const id = this.basicData.versionId
get(`/DxChangeActivity/findByAfterAffectedId/${id}`).then(res => {
this.tableData = res.items
})
}
}
}
</script>
<style lang="scss">
/* @import url(); 引入css类 */
</style>