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
129
130
| <template>
| <div class="posR">
| <div class="inner">
| <a-card class="main">
| <!-- 列表 -->
| <div class="contain">
| <div
| :class="['item', { selected: currentV == item.id }]"
| v-for="(item, idx) in list"
| :key="'item_' + idx"
| @click="selectHandle(item)"
| >
| <span :class="['status', { actived: item.status }]"></span>
| <div class="version">{{ item.fileVersion }}</div>
| </div>
| </div>
| </a-card>
| </div>
| </div>
| </template>
|
| <script>
| export default {
| name: "",
| props: {
| list: {
| type: Array,
| default() {
| return [];
| },
| },
| },
| computed: {
| // data() {
| // return this.list.filter((v) => {
| // const reg = new RegExp(this.keyword, "i");
| // return reg.test(v.subModel);
| // });
| // },
| },
| watch: {
| list(n) {
| if (n.length) {
| this.selectHandle(this.list[0]);
| }
| },
| },
| data() {
| return {
| // keyword: '',
| currentV: "-1",
| };
| },
| components: {},
| methods: {
| selectHandle(item) {
| this.currentV = item.id;
| this.$emit("select", item);
| },
| },
|
| mounted() {},
| };
| </script>
|
| <style scoped lang="less">
| .posR {
| position: relative;
| }
| .inner {
| position: absolute;
| left: 0;
| top: 0;
| right: 0;
| bottom: 0;
| }
| .main {
| height: 100%;
| /deep/.ant-card-body {
| height: 100%;
| display: flex;
| flex-direction: column;
| }
| }
| .contain {
| margin-top: 8px;
| border: 1px solid #e8e8e8;
| flex: 1;
| overflow: auto;
| padding: 0 4px;
| }
| .item {
| cursor: pointer;
| box-shadow: 0px 4px 5px -2px #000;
| padding: 6px 0;
| border-radius: 4px;
| display: flex;
| flex-direction: row;
| align-items: center;
| & + .item {
| margin-top: 4px;
| }
| &:hover {
| transform: scale(0.98, 0.9);
| box-shadow: 0px 2px 5px -2px #000;
| background: #f0f0f0;
| }
| &.selected {
| transform: scale(0.98, 0.9);
| box-shadow: 0px 2px 5px -2px #000;
| color: #13c2c2;
| font-weight: bold;
| }
| .version {
| flex: 1;
| }
| .status {
| display: inline-block;
| width: 10px;
| height: 10px;
| background: #aaa;
| border-radius: 50%;
| margin-left: 10px;
| margin-right: 20px;
| &.actived {
| background: #00ff79;
| }
| }
| }
| </style>
|
|