summaryrefslogtreecommitdiff
path: root/src/views/_sila/Power/Static/SupplyTabs.vue
diff options
context:
space:
mode:
authorMaksim Zakharov <m.zakharov@IBS.RU>2022-07-28 16:35:22 +0300
committerMaksim Zakharov <m.zakharov@IBS.RU>2022-07-28 16:35:22 +0300
commit829963143d0a4ac3093a81f932b5956872f10cfa (patch)
tree734f82d6eb98efac77799cfb14fc2dd879135d6a /src/views/_sila/Power/Static/SupplyTabs.vue
parentfb0d2495353d2f45d5d5081155abe0ac7ca9e6c7 (diff)
downloadwebui-vue-829963143d0a4ac3093a81f932b5956872f10cfa.tar.xz
SILABMC-N206 add power supply page
Diffstat (limited to 'src/views/_sila/Power/Static/SupplyTabs.vue')
-rw-r--r--src/views/_sila/Power/Static/SupplyTabs.vue70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/views/_sila/Power/Static/SupplyTabs.vue b/src/views/_sila/Power/Static/SupplyTabs.vue
new file mode 100644
index 00000000..7a1ea20d
--- /dev/null
+++ b/src/views/_sila/Power/Static/SupplyTabs.vue
@@ -0,0 +1,70 @@
+<template>
+ <b-col
+ ref="content"
+ class="d-flex align-items-center data-tab"
+ @wheel.prevent="wheelItBetter($event)"
+ >
+ <span
+ v-for="item in slots"
+ :key="item.id"
+ :class="{ 'tab-active': currentSlot === item.id }"
+ @click="switchTab(item.id)"
+ >{{ item.id }}</span
+ >
+ </b-col>
+</template>
+
+<script>
+export default {
+ props: {
+ slots: {
+ type: Array,
+ default: null,
+ },
+ currentSlot: {
+ type: String,
+ default: null,
+ },
+ switchTab: {
+ type: Function,
+ required: true,
+ },
+ },
+ data() {
+ return {
+ container: this.$refs.content,
+ };
+ },
+ methods: {
+ wheelItBetter(event) {
+ if (event.deltaY < 0) {
+ this.$refs.content.scrollLeft -= 25;
+ } else {
+ this.$refs.content.scrollLeft += 25;
+ }
+ },
+ },
+};
+</script>
+<style lang="scss" scoped>
+.data-tab {
+ height: 48px;
+ max-width: 150%;
+ width: auto;
+ margin: -2rem -1.95rem 0px -2rem;
+ padding-left: 2rem;
+ overflow-x: auto;
+ @include media-breakpoint-down(md) {
+ padding-left: 1rem;
+ padding-right: 1rem;
+ margin-left: -0.95rem;
+ }
+ border-bottom: 1px solid $gray-10;
+ gap: 24px;
+}
+
+.tab-active {
+ color: $primary;
+ transition: ease-in 0.15s;
+}
+</style>