Compare commits
	
		
			No commits in common. "7615ca760559774c83ddf6bd895e0feaea7a6fc6" and "315a0ab0d7d388290e6257ba3cb5c600764183b6" have entirely different histories.
		
	
	
		
			7615ca7605
			...
			315a0ab0d7
		
	
		
|  | @ -1,6 +1,5 @@ | ||||||
| import './js/bootstrap'; | import './js/bootstrap'; | ||||||
| import {createApp} from 'vue' | import {createApp} from 'vue' | ||||||
| import { createPinia } from 'pinia' |  | ||||||
| import App from './views/basya/Basya.vue' | import App from './views/basya/Basya.vue' | ||||||
| import { createVuetify } from 'vuetify' | import { createVuetify } from 'vuetify' | ||||||
| import { mdi } from "vuetify/iconsets/mdi"; | import { mdi } from "vuetify/iconsets/mdi"; | ||||||
|  | @ -9,11 +8,9 @@ import * as components from 'vuetify/components' | ||||||
| import * as directives from 'vuetify/directives' | import * as directives from 'vuetify/directives' | ||||||
| import '@mdi/font/css/materialdesignicons.css' | import '@mdi/font/css/materialdesignicons.css' | ||||||
| 
 | 
 | ||||||
| const pinia = createPinia(); |  | ||||||
| 
 |  | ||||||
| const vuetify = createVuetify({ | const vuetify = createVuetify({ | ||||||
|     components, |     components, | ||||||
|     directives |     directives | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| createApp(App).use(vuetify).use(pinia).mount("#app") | createApp(App).use(vuetify).mount("#app") | ||||||
|  |  | ||||||
|  | @ -0,0 +1,15 @@ | ||||||
|  | import {defineStore} from "pinia"; | ||||||
|  | 
 | ||||||
|  | export const useScheduleStore = defineStore('Schedule', { | ||||||
|  |     state: () => ({ | ||||||
|  |         fetchingDates: true, | ||||||
|  |         fetchingTable: true, | ||||||
|  |         fetchingLinks: true | ||||||
|  |     }), | ||||||
|  |     getters: { | ||||||
|  | 
 | ||||||
|  |     }, | ||||||
|  |     actions: { | ||||||
|  | 
 | ||||||
|  |     }, | ||||||
|  | }) | ||||||
|  | @ -1,20 +0,0 @@ | ||||||
| import {defineStore} from "pinia"; |  | ||||||
| import axios from "axios"; |  | ||||||
| 
 |  | ||||||
| export const useBasyaStore = defineStore('basya', { |  | ||||||
|     state: () => ({ |  | ||||||
|         phrases: Object |  | ||||||
|     }), |  | ||||||
|     getters: { |  | ||||||
| 
 |  | ||||||
|     }, |  | ||||||
|     actions: { |  | ||||||
|         async getPhrases(){ |  | ||||||
|             await axios |  | ||||||
|                 .get('/api/v1/phrases') |  | ||||||
|                 .then((response) => { |  | ||||||
|                     this.phrases = response.data; |  | ||||||
|                 }); |  | ||||||
|         } |  | ||||||
|     }, |  | ||||||
| }) |  | ||||||
|  | @ -1,37 +0,0 @@ | ||||||
| import {defineStore} from "pinia"; |  | ||||||
| import axios from "axios"; |  | ||||||
| 
 |  | ||||||
| export const useScheduleStore = defineStore('schedule', { |  | ||||||
|     state: () => ({ |  | ||||||
|         dates: Object, |  | ||||||
|         links: Object, |  | ||||||
|         schedules: Object |  | ||||||
|     }), |  | ||||||
|     getters: { |  | ||||||
| 
 |  | ||||||
|     }, |  | ||||||
|     actions: { |  | ||||||
|         async getDates(){ |  | ||||||
|             await axios |  | ||||||
|                 .get('/api/v1/dates') |  | ||||||
|                 .then((response) => { |  | ||||||
|                     this.dates = response.data; |  | ||||||
|                 }); |  | ||||||
|         }, |  | ||||||
|         async getLinks(){ |  | ||||||
|             await axios |  | ||||||
|                 .get('/api/v1/links') |  | ||||||
|                 .then((response)=>{ |  | ||||||
|                     this.links = response.data; |  | ||||||
|                 }) |  | ||||||
|         }, |  | ||||||
|         async getSchedules(){ |  | ||||||
|             await axios |  | ||||||
|                 .get('/api/v1/schedules') |  | ||||||
|                 .then((response)=>{ |  | ||||||
|                     this.schedules = response.data; |  | ||||||
|                 }) |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|     }, |  | ||||||
| }) |  | ||||||
|  | @ -10,30 +10,33 @@ | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|  | import axios from "axios"; | ||||||
| import ScheduleTable from "./Schedule/ScheduleTable.vue"; | import ScheduleTable from "./Schedule/ScheduleTable.vue"; | ||||||
| import Links from "./Schedule/Links.vue"; | import Links from "./Schedule/Links.vue"; | ||||||
| import {ref} from "vue"; |  | ||||||
| import {useScheduleStore} from '../stores/schedule.js'; |  | ||||||
| 
 | 
 | ||||||
| export default { | export default { | ||||||
|     name: "Schedule", |     name: "Schedule", | ||||||
|     components: {Links, ScheduleTable}, |     components: {Links, ScheduleTable}, | ||||||
|     data: () => ({ |     data: () => ({ | ||||||
|         dates: ref(), |         dates: [], | ||||||
|         scheduleStore: useScheduleStore(), |  | ||||||
|         fetching: true |         fetching: true | ||||||
|     }), |     }), | ||||||
|     methods: { |     methods: { | ||||||
|         parseDate(date){ |         parseDate(date){ | ||||||
|             let dateArr = date.split("-"); |             let dateArr = date.split("-"); | ||||||
|             return dateArr[2] + "." + dateArr[1]; |             return dateArr[2] + "." + dateArr[1]; | ||||||
|  |         }, | ||||||
|  |         async getDates(){ | ||||||
|  |             await axios | ||||||
|  |                 .get('/api/v1/dates') | ||||||
|  |                 .then(response => { | ||||||
|  |                     this.dates = response.data; | ||||||
|  |                     this.fetching = false; | ||||||
|  |                 }); | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     mounted() { |     mounted() { | ||||||
|         this.scheduleStore.getDates().then(()=>{ |         this.getDates(); | ||||||
|             this.dates = this.scheduleStore.dates; |  | ||||||
|             this.fetching = false; |  | ||||||
|         }); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -1,22 +1,22 @@ | ||||||
| <script> | <script> | ||||||
|     import {ref} from "vue"; |     import axios from "axios"; | ||||||
|     import {useScheduleStore} from '../../stores/schedule.js'; |  | ||||||
| 
 | 
 | ||||||
|     export default { |     export default { | ||||||
|         name: "Links", |         name: "Links", | ||||||
|         data: () => ({ |         data: () => ({ | ||||||
|             links: ref(), |             links: [], | ||||||
|             fetching: true, |             fetching: true, | ||||||
|             scheduleStore: useScheduleStore(), |  | ||||||
|             windowHeight: document.documentElement.clientHeight, |             windowHeight: document.documentElement.clientHeight, | ||||||
|             windowWidth: document.documentElement.clientWidth, |             windowWidth: document.documentElement.clientWidth, | ||||||
|             isWide: window.innerWidth >= 460 |             isWide: window.innerWidth >= 460 | ||||||
|         }), |         }), | ||||||
|         mounted() { |         mounted() { | ||||||
|             this.scheduleStore.getLinks().then(()=>{ |             axios | ||||||
|                 this.links = this.scheduleStore.links; |                 .get('/api/v1/links') | ||||||
|                 this.fetching = false; |                 .then(response => { | ||||||
|             }); |                     this.links = response.data; | ||||||
|  |                     this.fetching = false; | ||||||
|  |                 }); | ||||||
|             this.myEventHandler(); |             this.myEventHandler(); | ||||||
|             window.addEventListener("resize", this.myEventHandler, { passive: true }); |             window.addEventListener("resize", this.myEventHandler, { passive: true }); | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
|  | @ -1,12 +1,10 @@ | ||||||
| <script> | <script> | ||||||
|     import {useScheduleStore} from '../../stores/schedule.js'; |     import axios from "axios"; | ||||||
|     import {ref} from "vue"; |  | ||||||
| 
 | 
 | ||||||
|     export default { |     export default { | ||||||
|         name: "ScheduleTable", |         name: "ScheduleTable", | ||||||
|         data: () => ({ |         data: () => ({ | ||||||
|             schedules: ref(), |             schedules: [], | ||||||
|             scheduleStore: useScheduleStore(), |  | ||||||
|             fetching: true |             fetching: true | ||||||
|         }), |         }), | ||||||
|         methods: { |         methods: { | ||||||
|  | @ -16,10 +14,12 @@ | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         mounted() { |         mounted() { | ||||||
|             this.scheduleStore.getSchedules().then(()=>{ |             axios | ||||||
|                 this.schedules = this.scheduleStore.schedules; |                 .get('/api/v1/schedules') | ||||||
|                 this.fetching = false; |                 .then(response => { | ||||||
|             }); |                     this.schedules = response.data; | ||||||
|  |                     this.fetching = false; | ||||||
|  |                 }); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -34,8 +34,7 @@ | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import {ref} from 'vue'; | import {ref} from 'vue'; | ||||||
| import {useBasyaStore} from "../../stores/basya.js"; | import axios from "axios"; | ||||||
| 
 |  | ||||||
| export default { | export default { | ||||||
|     name: "Basya", |     name: "Basya", | ||||||
|     data: () => ({ |     data: () => ({ | ||||||
|  | @ -45,8 +44,7 @@ export default { | ||||||
|         currentPhrase: ref(), |         currentPhrase: ref(), | ||||||
|         winWidth: ref(document.documentElement.clientWidth), |         winWidth: ref(document.documentElement.clientWidth), | ||||||
|         // size: ref(), |         // size: ref(), | ||||||
|         isLess: false, |         isLess: false | ||||||
|         basyaStore: useBasyaStore() |  | ||||||
|     }), |     }), | ||||||
|     methods: { |     methods: { | ||||||
|         reloadPhrase(){ |         reloadPhrase(){ | ||||||
|  | @ -63,11 +61,13 @@ export default { | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     mounted() { |     mounted() { | ||||||
|         this.basyaStore.getPhrases().then(()=>{ |         axios | ||||||
|             this.phrases = this.basyaStore.phrases; |             .get('/api/v1/phrases') | ||||||
|             this.reloadPhrase(); |             .then(response => { | ||||||
|             this.fetching = false; |                 this.phrases = response.data; | ||||||
|         }) |                 this.reloadPhrase(); | ||||||
|  |                 this.fetching = false; | ||||||
|  |             }); | ||||||
|         this.isLess = ref(this.winWidth.value <= 600 ? 'flex-column' : ''); |         this.isLess = ref(this.winWidth.value <= 600 ? 'flex-column' : ''); | ||||||
|         /* |         /* | ||||||
|         this.size = this.winWidth <= 600 ?  'x-small' : |         this.size = this.winWidth <= 600 ?  'x-small' : | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue