bullpen view progress
This commit is contained in:
parent
acfaffad2c
commit
464cf60153
|
|
@ -50,6 +50,7 @@ onMounted(() => {
|
||||||
router.push({path: '/login'});
|
router.push({path: '/login'});
|
||||||
} else {
|
} else {
|
||||||
store.dispatch('pitchTypes/fetch');
|
store.dispatch('pitchTypes/fetch');
|
||||||
|
console.log('App', user.value);
|
||||||
store.dispatch("player/selectPlayer", user.value);
|
store.dispatch("player/selectPlayer", user.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, reactive, ref} from "vue";
|
import {computed, onMounted, reactive, ref} from "vue";
|
||||||
import {
|
import {
|
||||||
InfiniteScrollCustomEvent,
|
InfiniteScrollCustomEvent,
|
||||||
|
IonFab,
|
||||||
|
IonFabButton,
|
||||||
IonIcon,
|
IonIcon,
|
||||||
IonInfiniteScroll,
|
IonInfiniteScroll,
|
||||||
IonInfiniteScrollContent,
|
IonInfiniteScrollContent,
|
||||||
IonItem,
|
IonItem,
|
||||||
IonLabel,
|
IonLabel,
|
||||||
IonList
|
IonList,
|
||||||
|
IonNote,
|
||||||
|
IonProgressBar
|
||||||
} from '@ionic/vue';
|
} from '@ionic/vue';
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import {baseballOutline} from 'ionicons/icons';
|
import {add, baseballOutline, chevronForward} from 'ionicons/icons';
|
||||||
import Bullpen from '@/types/Bullpen';
|
import Bullpen from '@/types/Bullpen';
|
||||||
import BullpenSessionService from "@/services/BullpenSessionService";
|
import BullpenSessionService from "@/services/BullpenSessionService";
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
@ -26,6 +30,12 @@ const pitchTypes = computed(() => store.state.pitchTypes.pitchTypes);
|
||||||
const items = reactive<Bullpen[]>([]);
|
const items = reactive<Bullpen[]>([]);
|
||||||
const page = ref(0);
|
const page = ref(0);
|
||||||
|
|
||||||
|
const emit = defineEmits(['updateTitle']);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
emit('updateTitle', 'Bullpens');
|
||||||
|
});
|
||||||
|
|
||||||
const startBullpenSession = () => {
|
const startBullpenSession = () => {
|
||||||
router.push({ path: "/bullpen" });
|
router.push({ path: "/bullpen" });
|
||||||
};
|
};
|
||||||
|
|
@ -63,30 +73,40 @@ generateItems();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ion-list>
|
<ion-list inset="false">
|
||||||
<ion-item v-for="(bullpen, index) in items" :key="index" lines="none" class="custom-item" :button="true" detail="false">
|
<ion-item v-for="(bullpen, index) in items" :key="index" class="custom-item" :button="true" detail="false">
|
||||||
<!-- Top-left icon -->
|
<!-- Top-left icon -->
|
||||||
<ion-icon :icon="baseballOutline" slot="start" class="item-icon"></ion-icon>
|
<ion-icon :icon="baseballOutline" slot="start" class="item-icon"></ion-icon>
|
||||||
|
<ion-label>
|
||||||
|
<strong>{{formatDate(bullpen.startedAt)}}</strong>
|
||||||
<ion-label class="item-labels">
|
<ion-label class="item-labels">
|
||||||
<!-- First Progress Bar -->
|
|
||||||
<div class="progress-section">
|
<div class="progress-section">
|
||||||
<div class="top-row">
|
<div class="top-row">
|
||||||
<span class="left-label">Task 1</span>
|
<span class="left-label">Strike</span>
|
||||||
<span class="right-label">{{ (0.57 * 100).toFixed(0) }}%</span>
|
<span class="right-label">{{ (0.57 * 100).toFixed(0) }}%</span>
|
||||||
</div>
|
</div>
|
||||||
<ion-progress-bar :value="0.57"></ion-progress-bar>
|
<ion-progress-bar :value="0.57" color="success"></ion-progress-bar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Second Progress Bar -->
|
|
||||||
<div class="progress-section">
|
<div class="progress-section">
|
||||||
<div class="top-row">
|
<div class="top-row">
|
||||||
<span class="left-label">Task 2</span>
|
<span class="left-label">Balls</span>
|
||||||
<span class="right-label">{{ (0.33 * 100).toFixed(0) }}%</span>
|
<span class="right-label">{{ (0.33 * 100).toFixed(0) }}%</span>
|
||||||
</div>
|
</div>
|
||||||
<ion-progress-bar :value="0.33" color="secondary"></ion-progress-bar>
|
<ion-progress-bar :value="0.33" color="warning"></ion-progress-bar>
|
||||||
|
</div>
|
||||||
|
<div class="progress-section">
|
||||||
|
<div class="top-row">
|
||||||
|
<span class="left-label">Precision</span>
|
||||||
|
<span class="right-label">{{ (0.77 * 100).toFixed(0) }}%</span>
|
||||||
|
</div>
|
||||||
|
<ion-progress-bar :value="0.77" color="danger"></ion-progress-bar>
|
||||||
</div>
|
</div>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
</ion-label>
|
||||||
|
<div class="metadata-end-wrapper" slot="end">
|
||||||
|
<ion-note color="medium">{{bullpen.pitches.length}} Pitches</ion-note>
|
||||||
|
<ion-icon color="medium" :icon="chevronForward"></ion-icon>
|
||||||
|
</div>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<!-- <ion-item v-for="(bullpen, index) in items" :key="index">-->
|
<!-- <ion-item v-for="(bullpen, index) in items" :key="index">-->
|
||||||
|
|
@ -105,9 +125,31 @@ generateItems();
|
||||||
<ion-infinite-scroll @ionInfinite="ionInfinite">
|
<ion-infinite-scroll @ionInfinite="ionInfinite">
|
||||||
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||||
</ion-infinite-scroll>
|
</ion-infinite-scroll>
|
||||||
|
<ion-fab slot="fixed" vertical="bottom" horizontal="end">
|
||||||
|
<ion-fab-button @click="startBullpenSession">
|
||||||
|
<ion-icon :icon="add"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
</ion-fab>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.metadata-end-wrapper{
|
||||||
|
position:absolute;
|
||||||
|
top:10px;
|
||||||
|
inset-inline-end:10px;
|
||||||
|
font-size:0.8rem;
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-label strong{
|
||||||
|
display: block;
|
||||||
|
max-width: calc(100% - 60px);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.custom-item {
|
.custom-item {
|
||||||
align-items: flex-start !important; /* important override */
|
align-items: flex-start !important; /* important override */
|
||||||
--padding-start: 16px;
|
--padding-start: 16px;
|
||||||
|
|
@ -119,7 +161,7 @@ generateItems();
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: var(--ion-color-danger);
|
color: var(--ion-color-danger);
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
margin-top: 18px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-labels {
|
.item-labels {
|
||||||
|
|
@ -131,6 +173,7 @@ generateItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-row {
|
.top-row {
|
||||||
|
padding: 2px 0 0 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -138,7 +181,7 @@ generateItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
.left-label {
|
.left-label {
|
||||||
font-weight: bold;
|
font-weight: normal;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ const auth: Module<AuthState, RootState> = {
|
||||||
mutations: {
|
mutations: {
|
||||||
loginSuccess(state, user) {
|
loginSuccess(state, user) {
|
||||||
state.isAuthenticated = true;
|
state.isAuthenticated = true;
|
||||||
|
console.log('auth', user);
|
||||||
state.user = user;
|
state.user = user;
|
||||||
},
|
},
|
||||||
loginFailure(state) {
|
loginFailure(state) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ const store = useStore();
|
||||||
|
|
||||||
const user = computed(() => store.state.auth.user);
|
const user = computed(() => store.state.auth.user);
|
||||||
|
|
||||||
|
console.log('home', user.value);
|
||||||
import PlayerContent from "@/components/PlayerComponent.vue"
|
import PlayerContent from "@/components/PlayerComponent.vue"
|
||||||
import CoachContent from "@/components/CoachComponent.vue";
|
import CoachContent from "@/components/CoachComponent.vue";
|
||||||
|
|
||||||
|
|
@ -100,11 +101,7 @@ const addPlayer = () => {
|
||||||
<!-- Add Player-->
|
<!-- Add Player-->
|
||||||
<!-- </ion-button>-->
|
<!-- </ion-button>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<ion-fab slot="fixed" vertical="bottom" horizontal="end">
|
|
||||||
<ion-fab-button>
|
|
||||||
<ion-icon :icon="add"></ion-icon>
|
|
||||||
</ion-fab-button>
|
|
||||||
</ion-fab>
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-page>
|
</ion-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue