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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/**
* @Description: 相关基线
* @author 李亦康
* @date 2020/11/2
*/
<template>
<div class="relevant-baseline">
<dee-table
:index-row="{title:'序号',width: '60'}"
:data="baselineData"
:columns="baselineColumns"
>
<div slot="header" class="version-select">
<el-select v-model="type" size="small" @change="typeChange">
<el-option
v-for="item in versionData"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</dee-table>
</div>
</template>
<script>
import { linkColor } from '../styles/variables.scss'
export default {
name: 'RelevantBaseline',
components: {},
props: {
basicData: {
type: Object,
required: true
}
},
data() {
const that = this
const link = {
color: linkColor,
cursor: 'pointer'
}
return {
type: '1',
versionData: [{
value: '1',
label: '全部版本'
},
{
value: '2',
label: '修订版本'
},
{
value: '3',
label: '当前版本'
}],
baselineData: [],
baselineColumns: [
{
title: '编号', key: 'name', align: 'center',
component: {
render: function(h, data) {
return <span style={link} v-on:click={() => {
that.jump(data)
}}>{data.displayVersion}</span>
}
}
},
{
title: '名称', key: 'name1', align: 'center',
component: {
render: function(h, data) {
return <span style={link} v-on:click={() => {
that.jump(data)
}}>{data.displayVersion}</span>
}
}
},
{
title: '包含所选件的版本',
key: 'displayVersion',
align: 'center'
},
{
title: '基线类型', key: 'name1', align: 'center'
},
{ title: '状态', key: 'state', width: 80, align: 'center' },
{ title: '上次修改时间', key: 'modifyTime', sortable: true, align: 'center' }
]
}
},
computed: {},
watch: {
basicData: {
deep: true,
handler: function(val) {
if (Object.keys(val).length > 0) {
this.typeChange('1')
}
},
immediate: true
}
},
mounted: function() {
this.$nextTick(function() {
})
},
methods: {
// 跳转到对应对象详情页
jump(data) {
},
typeChange(type) {
this.baselineData = []
}
}
}
</script>
<style lang="scss" scoped>
.relevant-baseline{
.version-select {
width: 100%;
display: flex;
justify-content: flex-end;
}
}
</style>