applications.vue
2.63 KB
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
<template>
<section class="applications">
<div class="fields">
<span
:class="item.enabled ? (selecteditem === item.key ? 'item selected' : 'item') : 'item disabled'"
v-for="item in items"
:key="item.key"
@click="onSelect(item.key)"
>
<img :src="item.image" />
<div class="text" v-text="$t(item.key)" />
</span>
</div>
</section>
</template>
<script setup>
import { useApplicationsStore } from '@/views/stores/applications/useApplicationsStore';
import { storeToRefs } from 'pinia';
const store = useApplicationsStore();
const { items, selecteditem } = storeToRefs(store);
const { handleSelect } = store;
const onSelect = (key) => {
handleSelect(key);
};
</script>
<style lang="less" scope>
.applications {
display: flex;
.fields {
display: flex;
flex-direction: row;
-webkit-box-pack: justify;
flex-wrap: wrap;
gap: 7px;
justify-content: flex-start;
height: 172px;
.item {
box-sizing: border-box;
display: flex;
cursor: pointer;
background-color: #ffffff;
border: 1px solid #cdd1d5;
border-radius: 8px;
border-image: initial;
display: flex;
flex-direction: column;
width: 62px;
img {
width: 60px;
height: 50px;
margin: auto;
display: block;
}
.text {
margin: 0px;
font-size: 10px;
font-weight: 500;
color: #333333;
margin: auto;
font-weight: 600;
text-align: center;
white-space: pre-wrap;
}
&.selected {
background-color: @color-button-selected-background;
border-color: @color-button-main-selected-border;
}
&.disabled {
background-color: @canvas-background-color;
cursor: not-allowed;
}
&:hover {
background-color: @color-button-hover-background;
}
}
}
}
@media screen and (max-height: 920px) {
.applications {
.fields {
gap: 8px !important;
.item {
width: 60px !important;
img {
width: 59px !important;
height: 50px !important;
}
}
}
height: 50vh !important;
}
}
</style>