Commit f5329b707cdfc7d36a22f6648739804d946b1dcf
1 parent
dcbf19cba4
Exists in
master
and in
2 other branches
added form reset to announcement
Showing
6 changed files
with
9 additions
and
7 deletions
Show diff stats
index.html
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html> | 2 | <html> |
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
6 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> | 6 | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
7 | <!-- <link href="https://fonts.googleapis.com/css?family=Nunito,700%7CMaterial+Icons" rel="stylesheet"> --> | 7 | <!-- <link href="https://fonts.googleapis.com/css?family=Nunito,700%7CMaterial+Icons" rel="stylesheet"> --> |
8 | <!-- <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500i,800|Material+Icons&display=swap" rel="stylesheet"> --> | 8 | <!-- <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500i,800|Material+Icons&display=swap" rel="stylesheet"> --> |
9 | <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,700,800|Material+Icons&display=swap" rel="stylesheet"> | 9 | <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,700,800|Material+Icons&display=swap" rel="stylesheet"> |
10 | <title>School Management</title> | 10 | <title>School Management</title> |
11 | <link rel="shortcut icon" href="/static/logo.png" type="image/x-icon"> | 11 | <link rel="shortcut icon" href="/static/logo.png" type="image/x-icon"> |
12 | <meta name="description" content="School Management"> | 12 | <meta name="description" content="School Management"> |
13 | <script src='https://meet.intrack.in/external_api.js'></script> | 13 | <script src='https://meet.intrack.in/external_api.js'></script> |
14 | <link href="./static/css/custom.css" rel="stylesheet" /> | 14 | <link href="./static/css/custom.css" rel="stylesheet" /> |
15 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | 15 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
16 | <!-- <style> | 16 | <!-- <style> |
17 | [v-cloak] { | 17 | [v-cloak] { |
18 | display: none; | 18 | display: none; |
19 | } | 19 | } |
20 | </style> --> | 20 | </style> --> |
21 | </head> | 21 | </head> |
22 | 22 | ||
23 | <body> | 23 | <body > |
24 | <div id="app"> | 24 | <div id="app"> |
25 | </div> | 25 | </div> |
26 | <!-- built files will be auto injected --> | 26 | <!-- built files will be auto injected --> |
27 | <!-- Global site tag (gtag.js) - Google Analytics --> | 27 | <!-- Global site tag (gtag.js) - Google Analytics --> |
28 | <!-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-3881136-11"></script> --> | 28 | <!-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-3881136-11"></script> --> |
29 | <!-- <script> | 29 | <!-- <script> |
30 | window.dataLayer = window.dataLayer || []; | 30 | window.dataLayer = window.dataLayer || []; |
31 | 31 | ||
32 | function gtag() { | 32 | function gtag() { |
33 | dataLayer.push(arguments); | 33 | dataLayer.push(arguments); |
34 | } | 34 | } |
35 | gtag('js', new Date()); | 35 | gtag('js', new Date()); |
36 | gtag('config', 'UA-3881136-11'); | 36 | gtag('config', 'UA-3881136-11'); |
37 | </script> --> | 37 | </script> --> |
38 | </body> | 38 | </body> |
39 | 39 | ||
40 | </html> | 40 | </html> |
src/App.vue
1 | <template> | 1 | <template> |
2 | <div id="appRoot"> | 2 | <div id="appRoot"> |
3 | <template v-if="!$route.meta.public"> | 3 | <template v-if="!$route.meta.public"> |
4 | <!-- Go to top --> | 4 | <!-- Go to top --> |
5 | <v-app id="inspire" class="app"> | 5 | <v-app id="inspire" class="app"> |
6 | <app-drawer class="app--drawer"></app-drawer> | 6 | <app-drawer class="app--drawer"></app-drawer> |
7 | <v-content> | 7 | <v-content > |
8 | <div class="page-wrapper"> | 8 | <div class="page-wrapper"> |
9 | <!-- Header toolbar with Seacrh --> | 9 | <!-- Header toolbar with Seacrh --> |
10 | <app-toolbar class="app--toolbar"></app-toolbar> | 10 | <app-toolbar class="app--toolbar" ></app-toolbar> |
11 | <router-view :key="$route.fullPath"></router-view> | 11 | <router-view :key="$route.fullPath"></router-view> |
12 | </div> | 12 | </div> |
13 | <!-- App Footer --> | 13 | <!-- App Footer --> |
14 | </v-content> | 14 | </v-content> |
15 | <!-- theme setting --> | 15 | <!-- theme setting --> |
16 | <!-- <v-btn small fab dark falt fixed top="top" right="right" class="setting-fab" color="red" @click="openThemeSettings"> | 16 | <!-- <v-btn small fab dark falt fixed top="top" right="right" class="setting-fab" color="red" @click="openThemeSettings"> |
17 | <v-icon>settings</v-icon> | 17 | <v-icon>settings</v-icon> |
18 | </v-btn> | 18 | </v-btn> |
19 | <v-navigation-drawer | 19 | <v-navigation-drawer |
20 | class="setting-drawer" | 20 | class="setting-drawer" |
21 | temporary | 21 | temporary |
22 | right | 22 | right |
23 | v-model="rightDrawer" | 23 | v-model="rightDrawer" |
24 | hide-overlay | 24 | hide-overlay |
25 | fixed | 25 | fixed |
26 | > | 26 | > |
27 | <theme-settings></theme-settings> | 27 | <theme-settings></theme-settings> |
28 | </v-navigation-drawer>--> | 28 | </v-navigation-drawer>--> |
29 | </v-app> | 29 | </v-app> |
30 | </template> | 30 | </template> |
31 | <template v-else> | 31 | <template v-else> |
32 | <transition> | 32 | <transition> |
33 | <keep-alive> | 33 | <keep-alive> |
34 | <router-view></router-view> | 34 | <router-view></router-view> |
35 | </keep-alive> | 35 | </keep-alive> |
36 | </transition> | 36 | </transition> |
37 | </template> | 37 | </template> |
38 | <v-snackbar :timeout="3000" bottom right :color="snackbar.color" v-model="snackbar.show"> | 38 | <v-snackbar :timeout="3000" bottom right :color="snackbar.color" v-model="snackbar.show"> |
39 | {{ snackbar.text }} | 39 | {{ snackbar.text }} |
40 | <v-btn dark flat @click.native="snackbar.show = false" icon> | 40 | <v-btn dark flat @click.native="snackbar.show = false" icon> |
41 | <v-icon>close</v-icon> | 41 | <v-icon>close</v-icon> |
42 | </v-btn> | 42 | </v-btn> |
43 | </v-snackbar> | 43 | </v-snackbar> |
44 | </div> | 44 | </div> |
45 | </template> | 45 | </template> |
46 | <script> | 46 | <script> |
47 | import AppDrawer from "@/components/pageHeader/AppDrawer"; | 47 | import AppDrawer from "@/components/pageHeader/AppDrawer"; |
48 | import AppToolbar from "@/components/pageHeader/AppToolbar"; | 48 | import AppToolbar from "@/components/pageHeader/AppToolbar"; |
49 | import menu from "@/api/menu"; | 49 | import menu from "@/api/menu"; |
50 | import AppEvents from "./event"; | 50 | import AppEvents from "./event"; |
51 | import ThemeSettings from "@/components/ThemeSettings"; | 51 | import ThemeSettings from "@/components/ThemeSettings"; |
52 | // import { FunctionalCalendar } from "vue-functional-calendar"; | 52 | // import { FunctionalCalendar } from "vue-functional-calendar"; |
53 | 53 | ||
54 | export default { | 54 | export default { |
55 | components: { | 55 | components: { |
56 | AppDrawer, | 56 | AppDrawer, |
57 | AppToolbar, | 57 | AppToolbar, |
58 | ThemeSettings | 58 | ThemeSettings |
59 | // FunctionalCalendar | 59 | // FunctionalCalendar |
60 | }, | 60 | }, |
61 | data: () => ({ | 61 | data: () => ({ |
62 | expanded: true, | 62 | expanded: true, |
63 | rightDrawer: false, | 63 | rightDrawer: false, |
64 | snackbar: { | 64 | snackbar: { |
65 | show: false, | 65 | show: false, |
66 | text: "", | 66 | text: "", |
67 | color: "" | 67 | color: "" |
68 | } | 68 | } |
69 | }), | 69 | }), |
70 | 70 | ||
71 | computed: {}, | 71 | computed: {}, |
72 | 72 | ||
73 | created() { | 73 | created() { |
74 | AppEvents.forEach(item => { | 74 | AppEvents.forEach(item => { |
75 | this.$on(item.name, item.callback); | 75 | this.$on(item.name, item.callback); |
76 | }); | 76 | }); |
77 | window.getApp = this; | 77 | window.getApp = this; |
78 | }, | 78 | }, |
79 | methods: { | 79 | methods: { |
80 | openThemeSettings() { | 80 | openThemeSettings() { |
81 | this.$vuetify.goTo(0); | 81 | this.$vuetify.goTo(0); |
82 | this.rightDrawer = !this.rightDrawer; | 82 | this.rightDrawer = !this.rightDrawer; |
83 | } | 83 | } |
84 | } | 84 | } |
85 | }; | 85 | }; |
86 | </script> | 86 | </script> |
87 | 87 | ||
88 | 88 | ||
89 | <style lang="stylus" scoped> | 89 | <style lang="stylus" scoped> |
90 | .setting-fab { | 90 | .setting-fab { |
91 | top: 50% !important; | 91 | top: 50% !important; |
92 | right: 0; | 92 | right: 0; |
93 | border-radius: 0; | 93 | border-radius: 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | .page-wrapper { | 96 | .page-wrapper { |
97 | min-height: calc(1200px - 64px - 50px - 81px); | 97 | min-height: calc(1200px - 64px - 50px - 81px); |
98 | } | 98 | } |
99 | </style> | 99 | </style> |
100 | <style> | 100 | <style> |
101 | .application { | 101 | .application { |
102 | background-color: white !important; | 102 | background-color: white !important; |
103 | font-family: "Poppins", sans-serif; | 103 | font-family: "Poppins", sans-serif; |
104 | -webkit-font-smoothing: antialiased; | 104 | -webkit-font-smoothing: antialiased; |
105 | -moz-osx-font-smoothing: grayscale; | 105 | -moz-osx-font-smoothing: grayscale; |
106 | scroll-behavior: smooth; | 106 | scroll-behavior: smooth; |
107 | } | 107 | } |
108 | </style> | 108 | </style> |
109 | 109 |
src/components/pageHeader/AppDrawer.vue
1 | <template> | 1 | <template> |
2 | <v-navigation-drawer | 2 | <v-navigation-drawer |
3 | id="appDrawer" | 3 | id="appDrawer" |
4 | :mini-variant.sync="mini" | 4 | :mini-variant.sync="mini" |
5 | :dark="$vuetify.dark" | 5 | :dark="$vuetify.dark" |
6 | app | 6 | app |
7 | fixed | 7 | fixed |
8 | v-model="drawer" | 8 | v-model="drawer" |
9 | hide-overlay | 9 | hide-overlay |
10 | width="260" | 10 | width="260" |
11 | class="white--text side-bar-color" | 11 | class="white--text side-bar-color" |
12 | style='height: 100%;' | ||
12 | > | 13 | > |
13 | <!-- <vue-perfect-scrollbar | 14 | <!-- <vue-perfect-scrollbar |
14 | class="drawer-menu--scroll side-bar-color mt-3" | 15 | class="drawer-menu--scroll side-bar-color mt-3" |
15 | :settings="scrollSettings" | 16 | :settings="scrollSettings" |
16 | >--> | 17 | >--> |
17 | <v-toolbar class="white" flat> | 18 | <v-toolbar class="white" flat> |
18 | <img | 19 | <img |
19 | v-bind:src="computeLogo" | 20 | v-bind:src="computeLogo" |
20 | height="40" | 21 | height="40" |
21 | width="130" | 22 | width="130" |
22 | class="imgLogo mb-3 mt-3" | 23 | class="imgLogo mb-3 mt-3" |
23 | alt="logo" | 24 | alt="logo" |
24 | style="margin: auto; | 25 | style="margin: auto; |
25 | display: block;" | 26 | display: block;" |
26 | /> | 27 | /> |
27 | </v-toolbar> | 28 | </v-toolbar> |
28 | <v-list dense dark> | 29 | <v-list dense dark> |
29 | <template v-for="(item, i) in menus" v-if="role === 'ADMIN'"> | 30 | <template v-for="(item, i) in menus" v-if="role === 'ADMIN'"> |
30 | <!-- {{menus}} --> | 31 | <!-- {{menus}} --> |
31 | <!--group with subitems--> | 32 | <!--group with subitems--> |
32 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action> | 33 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action> |
33 | <v-list-tile slot="activator" ripple="ripple"> | 34 | <v-list-tile slot="activator" ripple="ripple"> |
34 | <v-list-tile-action v-if="item.icon"> | 35 | <v-list-tile-action v-if="item.icon"> |
35 | <img :src="item.icon" width="22" alt="icons" /> | 36 | <img :src="item.icon" width="22" alt="icons" /> |
36 | </v-list-tile-action> | 37 | </v-list-tile-action> |
37 | <v-list-tile-content> | 38 | <v-list-tile-content> |
38 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 39 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
39 | </v-list-tile-content> | 40 | </v-list-tile-content> |
40 | </v-list-tile> | 41 | </v-list-tile> |
41 | <template v-for="(subItem, i) in item.items"> | 42 | <template v-for="(subItem, i) in item.items"> |
42 | <!--sub group--> | 43 | <!--sub group--> |
43 | <v-list-group | 44 | <v-list-group |
44 | v-if="subItem.items" | 45 | v-if="subItem.items" |
45 | :key="subItem.name" | 46 | :key="subItem.name" |
46 | :group="subItem.group" | 47 | :group="subItem.group" |
47 | sub-group="sub-group" | 48 | sub-group="sub-group" |
48 | > | 49 | > |
49 | <v-list-tile slot="activator" ripple="ripple"> | 50 | <v-list-tile slot="activator" ripple="ripple"> |
50 | <v-list-tile-content> | 51 | <v-list-tile-content> |
51 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 52 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
52 | </v-list-tile-content> | 53 | </v-list-tile-content> |
53 | </v-list-tile> | 54 | </v-list-tile> |
54 | <v-list-tile | 55 | <v-list-tile |
55 | v-for="(grand, i) in subItem.children" | 56 | v-for="(grand, i) in subItem.children" |
56 | :key="i" | 57 | :key="i" |
57 | :to="genChildTarget(item, grand)" | 58 | :to="genChildTarget(item, grand)" |
58 | :href="grand.href" | 59 | :href="grand.href" |
59 | ripple="ripple" | 60 | ripple="ripple" |
60 | > | 61 | > |
61 | <v-list-tile-content> | 62 | <v-list-tile-content> |
62 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 63 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
63 | </v-list-tile-content> | 64 | </v-list-tile-content> |
64 | </v-list-tile> | 65 | </v-list-tile> |
65 | </v-list-group> | 66 | </v-list-group> |
66 | <!--child item--> | 67 | <!--child item--> |
67 | <v-list-tile | 68 | <v-list-tile |
68 | v-else | 69 | v-else |
69 | :key="i" | 70 | :key="i" |
70 | :to="genChildTarget(item, subItem)" | 71 | :to="genChildTarget(item, subItem)" |
71 | :href="subItem.href" | 72 | :href="subItem.href" |
72 | :disabled="subItem.disabled" | 73 | :disabled="subItem.disabled" |
73 | :target="subItem.target" | 74 | :target="subItem.target" |
74 | ripple="ripple" | 75 | ripple="ripple" |
75 | > | 76 | > |
76 | <v-list-tile-action v-if="subItem.action"> | 77 | <v-list-tile-action v-if="subItem.action"> |
77 | <img | 78 | <img |
78 | width="30" | 79 | width="30" |
79 | :src="subItem.action" | 80 | :src="subItem.action" |
80 | :class="[subItem.actionClass || 'success--text']" | 81 | :class="[subItem.actionClass || 'success--text']" |
81 | /> | 82 | /> |
82 | </v-list-tile-action> | 83 | </v-list-tile-action> |
83 | <v-list-tile-content> | 84 | <v-list-tile-content> |
84 | <v-list-tile-title class="body-2"> | 85 | <v-list-tile-title class="body-2"> |
85 | <span>{{ subItem.title }}</span> | 86 | <span>{{ subItem.title }}</span> |
86 | </v-list-tile-title> | 87 | </v-list-tile-title> |
87 | </v-list-tile-content> | 88 | </v-list-tile-content> |
88 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 89 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
89 | </v-list-tile> | 90 | </v-list-tile> |
90 | </template> | 91 | </template> |
91 | </v-list-group> | 92 | </v-list-group> |
92 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 93 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
93 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 94 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
94 | <!--top-level link--> | 95 | <!--top-level link--> |
95 | <v-list-tile | 96 | <v-list-tile |
96 | v-else | 97 | v-else |
97 | ripple="ripple" | 98 | ripple="ripple" |
98 | :disabled="item.disabled" | 99 | :disabled="item.disabled" |
99 | :target="item.target" | 100 | :target="item.target" |
100 | rel="noopener" | 101 | rel="noopener" |
101 | :key="item.name" | 102 | :key="item.name" |
102 | :to="!item.href ? { name: item.name } : null" | 103 | :to="!item.href ? { name: item.name } : null" |
103 | :href="item.href" | 104 | :href="item.href" |
104 | > | 105 | > |
105 | <!-- <a :href="item.path"> --> | 106 | <!-- <a :href="item.path"> --> |
106 | <v-list-tile-action v-if="item.icon"> | 107 | <v-list-tile-action v-if="item.icon"> |
107 | <img :src="item.icon" width="22" alt="icons" /> | 108 | <img :src="item.icon" width="22" alt="icons" /> |
108 | </v-list-tile-action> | 109 | </v-list-tile-action> |
109 | <v-list-tile-content class="pt-2"> | 110 | <v-list-tile-content class="pt-2"> |
110 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 111 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
111 | </v-list-tile-content> | 112 | </v-list-tile-content> |
112 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 113 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
113 | <v-list-tile-action v-if="item.subAction"> | 114 | <v-list-tile-action v-if="item.subAction"> |
114 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 115 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
115 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> | 116 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> |
116 | </v-list-tile-action> | 117 | </v-list-tile-action> |
117 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 118 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
118 | <!-- </a> --> | 119 | <!-- </a> --> |
119 | </v-list-tile> | 120 | </v-list-tile> |
120 | </template> | 121 | </template> |
121 | <template v-for="(item, i) in menuAccount" v-if="role === 'ACCOUNTANT'"> | 122 | <template v-for="(item, i) in menuAccount" v-if="role === 'ACCOUNTANT'"> |
122 | <!-- {{menus}} --> | 123 | <!-- {{menus}} --> |
123 | <!--group with subitems--> | 124 | <!--group with subitems--> |
124 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> | 125 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> |
125 | <v-list-tile slot="activator" ripple="ripple"> | 126 | <v-list-tile slot="activator" ripple="ripple"> |
126 | <v-list-tile-action v-if="item.icon"> | 127 | <v-list-tile-action v-if="item.icon"> |
127 | <img :src="item.icon" width="22" alt="icons" /> | 128 | <img :src="item.icon" width="22" alt="icons" /> |
128 | </v-list-tile-action> | 129 | </v-list-tile-action> |
129 | <v-list-tile-content> | 130 | <v-list-tile-content> |
130 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 131 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
131 | </v-list-tile-content> | 132 | </v-list-tile-content> |
132 | </v-list-tile> | 133 | </v-list-tile> |
133 | <template v-for="(subItem, i) in item.items"> | 134 | <template v-for="(subItem, i) in item.items"> |
134 | <!--sub group--> | 135 | <!--sub group--> |
135 | <v-list-group | 136 | <v-list-group |
136 | v-if="subItem.items" | 137 | v-if="subItem.items" |
137 | :key="subItem.name" | 138 | :key="subItem.name" |
138 | :group="subItem.group" | 139 | :group="subItem.group" |
139 | sub-group="sub-group" | 140 | sub-group="sub-group" |
140 | > | 141 | > |
141 | <v-list-tile slot="activator" ripple="ripple"> | 142 | <v-list-tile slot="activator" ripple="ripple"> |
142 | <v-list-tile-content> | 143 | <v-list-tile-content> |
143 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 144 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
144 | </v-list-tile-content> | 145 | </v-list-tile-content> |
145 | </v-list-tile> | 146 | </v-list-tile> |
146 | <v-list-tile | 147 | <v-list-tile |
147 | v-for="(grand, i) in subItem.children" | 148 | v-for="(grand, i) in subItem.children" |
148 | :key="i" | 149 | :key="i" |
149 | :to="genChildTarget(item, grand)" | 150 | :to="genChildTarget(item, grand)" |
150 | :href="grand.href" | 151 | :href="grand.href" |
151 | ripple="ripple" | 152 | ripple="ripple" |
152 | > | 153 | > |
153 | <v-list-tile-content> | 154 | <v-list-tile-content> |
154 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 155 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
155 | </v-list-tile-content> | 156 | </v-list-tile-content> |
156 | </v-list-tile> | 157 | </v-list-tile> |
157 | </v-list-group> | 158 | </v-list-group> |
158 | <!--child item--> | 159 | <!--child item--> |
159 | <v-list-tile | 160 | <v-list-tile |
160 | v-else | 161 | v-else |
161 | :key="i" | 162 | :key="i" |
162 | :to="genChildTarget(item, subItem)" | 163 | :to="genChildTarget(item, subItem)" |
163 | :href="subItem.href" | 164 | :href="subItem.href" |
164 | :disabled="subItem.disabled" | 165 | :disabled="subItem.disabled" |
165 | :target="subItem.target" | 166 | :target="subItem.target" |
166 | ripple="ripple" | 167 | ripple="ripple" |
167 | > | 168 | > |
168 | <v-list-tile-action v-if="subItem.action"> | 169 | <v-list-tile-action v-if="subItem.action"> |
169 | <img | 170 | <img |
170 | width="30" | 171 | width="30" |
171 | :src="subItem.action" | 172 | :src="subItem.action" |
172 | :class="[subItem.actionClass || 'success--text']" | 173 | :class="[subItem.actionClass || 'success--text']" |
173 | /> | 174 | /> |
174 | </v-list-tile-action> | 175 | </v-list-tile-action> |
175 | <v-list-tile-content> | 176 | <v-list-tile-content> |
176 | <v-list-tile-title class="body-2"> | 177 | <v-list-tile-title class="body-2"> |
177 | <span>{{ subItem.title }}</span> | 178 | <span>{{ subItem.title }}</span> |
178 | </v-list-tile-title> | 179 | </v-list-tile-title> |
179 | </v-list-tile-content> | 180 | </v-list-tile-content> |
180 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 181 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
181 | </v-list-tile> | 182 | </v-list-tile> |
182 | </template> | 183 | </template> |
183 | </v-list-group> | 184 | </v-list-group> |
184 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 185 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
185 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 186 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
186 | <!--top-level link--> | 187 | <!--top-level link--> |
187 | <v-list-tile | 188 | <v-list-tile |
188 | v-else | 189 | v-else |
189 | ripple="ripple" | 190 | ripple="ripple" |
190 | :disabled="item.disabled" | 191 | :disabled="item.disabled" |
191 | :target="item.target" | 192 | :target="item.target" |
192 | rel="noopener" | 193 | rel="noopener" |
193 | :key="item.name" | 194 | :key="item.name" |
194 | :to="!item.href ? { name: item.name } : null" | 195 | :to="!item.href ? { name: item.name } : null" |
195 | :href="item.href" | 196 | :href="item.href" |
196 | > | 197 | > |
197 | <!-- <a :href="item.path"> --> | 198 | <!-- <a :href="item.path"> --> |
198 | <v-list-tile-action v-if="item.icon"> | 199 | <v-list-tile-action v-if="item.icon"> |
199 | <img :src="item.icon" width="22" alt="icons" /> | 200 | <img :src="item.icon" width="22" alt="icons" /> |
200 | </v-list-tile-action> | 201 | </v-list-tile-action> |
201 | <v-list-tile-content class="pt-2"> | 202 | <v-list-tile-content class="pt-2"> |
202 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 203 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
203 | </v-list-tile-content> | 204 | </v-list-tile-content> |
204 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 205 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
205 | <v-list-tile-action v-if="item.subAction"> | 206 | <v-list-tile-action v-if="item.subAction"> |
206 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 207 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
207 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> | 208 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> |
208 | </v-list-tile-action> | 209 | </v-list-tile-action> |
209 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 210 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
210 | <!-- </a> --> | 211 | <!-- </a> --> |
211 | </v-list-tile> | 212 | </v-list-tile> |
212 | </template> | 213 | </template> |
213 | <template v-for="(item, i) in menuLibrarian" v-if="role === 'LIBRARIAN'"> | 214 | <template v-for="(item, i) in menuLibrarian" v-if="role === 'LIBRARIAN'"> |
214 | <!-- {{menus}} --> | 215 | <!-- {{menus}} --> |
215 | <!--group with subitems--> | 216 | <!--group with subitems--> |
216 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> | 217 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> |
217 | <v-list-tile slot="activator" ripple="ripple"> | 218 | <v-list-tile slot="activator" ripple="ripple"> |
218 | <v-list-tile-action v-if="item.icon"> | 219 | <v-list-tile-action v-if="item.icon"> |
219 | <img :src="item.icon" width="22" alt="icons" /> | 220 | <img :src="item.icon" width="22" alt="icons" /> |
220 | </v-list-tile-action> | 221 | </v-list-tile-action> |
221 | <v-list-tile-content> | 222 | <v-list-tile-content> |
222 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 223 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
223 | </v-list-tile-content> | 224 | </v-list-tile-content> |
224 | </v-list-tile> | 225 | </v-list-tile> |
225 | <template v-for="(subItem, i) in item.items"> | 226 | <template v-for="(subItem, i) in item.items"> |
226 | <!--sub group--> | 227 | <!--sub group--> |
227 | <v-list-group | 228 | <v-list-group |
228 | v-if="subItem.items" | 229 | v-if="subItem.items" |
229 | :key="subItem.name" | 230 | :key="subItem.name" |
230 | :group="subItem.group" | 231 | :group="subItem.group" |
231 | sub-group="sub-group" | 232 | sub-group="sub-group" |
232 | > | 233 | > |
233 | <v-list-tile slot="activator" ripple="ripple"> | 234 | <v-list-tile slot="activator" ripple="ripple"> |
234 | <v-list-tile-content> | 235 | <v-list-tile-content> |
235 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 236 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
236 | </v-list-tile-content> | 237 | </v-list-tile-content> |
237 | </v-list-tile> | 238 | </v-list-tile> |
238 | <v-list-tile | 239 | <v-list-tile |
239 | v-for="(grand, i) in subItem.children" | 240 | v-for="(grand, i) in subItem.children" |
240 | :key="i" | 241 | :key="i" |
241 | :to="genChildTarget(item, grand)" | 242 | :to="genChildTarget(item, grand)" |
242 | :href="grand.href" | 243 | :href="grand.href" |
243 | ripple="ripple" | 244 | ripple="ripple" |
244 | > | 245 | > |
245 | <v-list-tile-content> | 246 | <v-list-tile-content> |
246 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 247 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
247 | </v-list-tile-content> | 248 | </v-list-tile-content> |
248 | </v-list-tile> | 249 | </v-list-tile> |
249 | </v-list-group> | 250 | </v-list-group> |
250 | <!--child item--> | 251 | <!--child item--> |
251 | <v-list-tile | 252 | <v-list-tile |
252 | v-else | 253 | v-else |
253 | :key="i" | 254 | :key="i" |
254 | :to="genChildTarget(item, subItem)" | 255 | :to="genChildTarget(item, subItem)" |
255 | :href="subItem.href" | 256 | :href="subItem.href" |
256 | :disabled="subItem.disabled" | 257 | :disabled="subItem.disabled" |
257 | :target="subItem.target" | 258 | :target="subItem.target" |
258 | ripple="ripple" | 259 | ripple="ripple" |
259 | > | 260 | > |
260 | <v-list-tile-action v-if="subItem.action"> | 261 | <v-list-tile-action v-if="subItem.action"> |
261 | <img | 262 | <img |
262 | width="30" | 263 | width="30" |
263 | :src="subItem.action" | 264 | :src="subItem.action" |
264 | :class="[subItem.actionClass || 'success--text']" | 265 | :class="[subItem.actionClass || 'success--text']" |
265 | /> | 266 | /> |
266 | </v-list-tile-action> | 267 | </v-list-tile-action> |
267 | <v-list-tile-content> | 268 | <v-list-tile-content> |
268 | <v-list-tile-title class="body-2"> | 269 | <v-list-tile-title class="body-2"> |
269 | <span>{{ subItem.title }}</span> | 270 | <span>{{ subItem.title }}</span> |
270 | </v-list-tile-title> | 271 | </v-list-tile-title> |
271 | </v-list-tile-content> | 272 | </v-list-tile-content> |
272 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 273 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
273 | </v-list-tile> | 274 | </v-list-tile> |
274 | </template> | 275 | </template> |
275 | </v-list-group> | 276 | </v-list-group> |
276 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 277 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
277 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 278 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
278 | <!--top-level link--> | 279 | <!--top-level link--> |
279 | <v-list-tile | 280 | <v-list-tile |
280 | v-else | 281 | v-else |
281 | ripple="ripple" | 282 | ripple="ripple" |
282 | :disabled="item.disabled" | 283 | :disabled="item.disabled" |
283 | :target="item.target" | 284 | :target="item.target" |
284 | rel="noopener" | 285 | rel="noopener" |
285 | :key="item.name" | 286 | :key="item.name" |
286 | :to="!item.href ? { name: item.name } : null" | 287 | :to="!item.href ? { name: item.name } : null" |
287 | :href="item.href" | 288 | :href="item.href" |
288 | > | 289 | > |
289 | <!-- <a :href="item.path"> --> | 290 | <!-- <a :href="item.path"> --> |
290 | <v-list-tile-action v-if="item.icon"> | 291 | <v-list-tile-action v-if="item.icon"> |
291 | <img :src="item.icon" width="22" alt="icons" /> | 292 | <img :src="item.icon" width="22" alt="icons" /> |
292 | </v-list-tile-action> | 293 | </v-list-tile-action> |
293 | <v-list-tile-content class="pt-2"> | 294 | <v-list-tile-content class="pt-2"> |
294 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 295 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
295 | </v-list-tile-content> | 296 | </v-list-tile-content> |
296 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 297 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
297 | <v-list-tile-action v-if="item.subAction"> | 298 | <v-list-tile-action v-if="item.subAction"> |
298 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 299 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
299 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> | 300 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> |
300 | </v-list-tile-action> | 301 | </v-list-tile-action> |
301 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 302 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
302 | <!-- </a> --> | 303 | <!-- </a> --> |
303 | </v-list-tile> | 304 | </v-list-tile> |
304 | </template> | 305 | </template> |
305 | <template v-for="(item, i) in menuSchool" v-if="schoolRole === 'SUPERADMIN'"> | 306 | <template v-for="(item, i) in menuSchool" v-if="schoolRole === 'SUPERADMIN'"> |
306 | <!-- {{menus}} --> | 307 | <!-- {{menus}} --> |
307 | <!--group with subitems--> | 308 | <!--group with subitems--> |
308 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> | 309 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> |
309 | <v-list-tile slot="activator" ripple="ripple"> | 310 | <v-list-tile slot="activator" ripple="ripple"> |
310 | <v-list-tile-action v-if="item.icon"> | 311 | <v-list-tile-action v-if="item.icon"> |
311 | <img :src="item.icon" width="22" alt="icons" /> | 312 | <img :src="item.icon" width="22" alt="icons" /> |
312 | </v-list-tile-action> | 313 | </v-list-tile-action> |
313 | <v-list-tile-content> | 314 | <v-list-tile-content> |
314 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 315 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
315 | </v-list-tile-content> | 316 | </v-list-tile-content> |
316 | </v-list-tile> | 317 | </v-list-tile> |
317 | <template v-for="(subItem, i) in item.items"> | 318 | <template v-for="(subItem, i) in item.items"> |
318 | <!--sub group--> | 319 | <!--sub group--> |
319 | <v-list-group | 320 | <v-list-group |
320 | v-if="subItem.items" | 321 | v-if="subItem.items" |
321 | :key="subItem.name" | 322 | :key="subItem.name" |
322 | :group="subItem.group" | 323 | :group="subItem.group" |
323 | sub-group="sub-group" | 324 | sub-group="sub-group" |
324 | > | 325 | > |
325 | <v-list-tile slot="activator" ripple="ripple"> | 326 | <v-list-tile slot="activator" ripple="ripple"> |
326 | <v-list-tile-content> | 327 | <v-list-tile-content> |
327 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 328 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
328 | </v-list-tile-content> | 329 | </v-list-tile-content> |
329 | </v-list-tile> | 330 | </v-list-tile> |
330 | <v-list-tile | 331 | <v-list-tile |
331 | v-for="(grand, i) in subItem.children" | 332 | v-for="(grand, i) in subItem.children" |
332 | :key="i" | 333 | :key="i" |
333 | :to="genChildTarget(item, grand)" | 334 | :to="genChildTarget(item, grand)" |
334 | :href="grand.href" | 335 | :href="grand.href" |
335 | ripple="ripple" | 336 | ripple="ripple" |
336 | > | 337 | > |
337 | <v-list-tile-content> | 338 | <v-list-tile-content> |
338 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 339 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
339 | </v-list-tile-content> | 340 | </v-list-tile-content> |
340 | </v-list-tile> | 341 | </v-list-tile> |
341 | </v-list-group> | 342 | </v-list-group> |
342 | <!--child item--> | 343 | <!--child item--> |
343 | <v-list-tile | 344 | <v-list-tile |
344 | v-else | 345 | v-else |
345 | :key="i" | 346 | :key="i" |
346 | :to="genChildTarget(item, subItem)" | 347 | :to="genChildTarget(item, subItem)" |
347 | :href="subItem.href" | 348 | :href="subItem.href" |
348 | :disabled="subItem.disabled" | 349 | :disabled="subItem.disabled" |
349 | :target="subItem.target" | 350 | :target="subItem.target" |
350 | ripple="ripple" | 351 | ripple="ripple" |
351 | > | 352 | > |
352 | <v-list-tile-action v-if="subItem.action"> | 353 | <v-list-tile-action v-if="subItem.action"> |
353 | <img | 354 | <img |
354 | width="30" | 355 | width="30" |
355 | :src="subItem.action" | 356 | :src="subItem.action" |
356 | :class="[subItem.actionClass || 'success--text']" | 357 | :class="[subItem.actionClass || 'success--text']" |
357 | /> | 358 | /> |
358 | </v-list-tile-action> | 359 | </v-list-tile-action> |
359 | <v-list-tile-content> | 360 | <v-list-tile-content> |
360 | <v-list-tile-title class="body-2"> | 361 | <v-list-tile-title class="body-2"> |
361 | <span>{{ subItem.title }}</span> | 362 | <span>{{ subItem.title }}</span> |
362 | </v-list-tile-title> | 363 | </v-list-tile-title> |
363 | </v-list-tile-content> | 364 | </v-list-tile-content> |
364 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 365 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
365 | </v-list-tile> | 366 | </v-list-tile> |
366 | </template> | 367 | </template> |
367 | </v-list-group> | 368 | </v-list-group> |
368 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 369 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
369 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 370 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
370 | <!--top-level link--> | 371 | <!--top-level link--> |
371 | <v-list-tile | 372 | <v-list-tile |
372 | v-else | 373 | v-else |
373 | ripple="ripple" | 374 | ripple="ripple" |
374 | :disabled="item.disabled" | 375 | :disabled="item.disabled" |
375 | :target="item.target" | 376 | :target="item.target" |
376 | rel="noopener" | 377 | rel="noopener" |
377 | :key="item.name" | 378 | :key="item.name" |
378 | :to="!item.href ? { name: item.name } : null" | 379 | :to="!item.href ? { name: item.name } : null" |
379 | :href="item.href" | 380 | :href="item.href" |
380 | > | 381 | > |
381 | <!-- <a :href="item.path"> --> | 382 | <!-- <a :href="item.path"> --> |
382 | <v-list-tile-action v-if="item.icon"> | 383 | <v-list-tile-action v-if="item.icon"> |
383 | <img :src="item.icon" width="22" alt="icons" /> | 384 | <img :src="item.icon" width="22" alt="icons" /> |
384 | </v-list-tile-action> | 385 | </v-list-tile-action> |
385 | <v-list-tile-content class="pt-2"> | 386 | <v-list-tile-content class="pt-2"> |
386 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 387 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
387 | </v-list-tile-content> | 388 | </v-list-tile-content> |
388 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 389 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
389 | <v-list-tile-action v-if="item.subAction"> | 390 | <v-list-tile-action v-if="item.subAction"> |
390 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 391 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
391 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> | 392 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> |
392 | </v-list-tile-action> | 393 | </v-list-tile-action> |
393 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 394 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
394 | <!-- </a> --> | 395 | <!-- </a> --> |
395 | </v-list-tile> | 396 | </v-list-tile> |
396 | </template> | 397 | </template> |
397 | 398 | ||
398 | <!-- NAVIGATION DRAWER IF ROLE IS TEACHER --> | 399 | <!-- NAVIGATION DRAWER IF ROLE IS TEACHER --> |
399 | <template v-for="(item, i) in menuTeacher" v-if="role === 'TEACHER'"> | 400 | <template v-for="(item, i) in menuTeacher" v-if="role === 'TEACHER'"> |
400 | <!-- {{menus}} --> | 401 | <!-- {{menus}} --> |
401 | <!--group with subitems--> | 402 | <!--group with subitems--> |
402 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> | 403 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> |
403 | <v-list-tile slot="activator" ripple="ripple"> | 404 | <v-list-tile slot="activator" ripple="ripple"> |
404 | <v-list-tile-action v-if="item.icon"> | 405 | <v-list-tile-action v-if="item.icon"> |
405 | <img :src="item.icon" width="22" alt="icons" /> | 406 | <img :src="item.icon" width="22" alt="icons" /> |
406 | </v-list-tile-action> | 407 | </v-list-tile-action> |
407 | <v-list-tile-content> | 408 | <v-list-tile-content> |
408 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 409 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
409 | </v-list-tile-content> | 410 | </v-list-tile-content> |
410 | </v-list-tile> | 411 | </v-list-tile> |
411 | <template v-for="(subItem, i) in item.items"> | 412 | <template v-for="(subItem, i) in item.items"> |
412 | <!--sub group--> | 413 | <!--sub group--> |
413 | <v-list-group | 414 | <v-list-group |
414 | v-if="subItem.items" | 415 | v-if="subItem.items" |
415 | :key="subItem.name" | 416 | :key="subItem.name" |
416 | :group="subItem.group" | 417 | :group="subItem.group" |
417 | sub-group="sub-group" | 418 | sub-group="sub-group" |
418 | > | 419 | > |
419 | <v-list-tile slot="activator" ripple="ripple"> | 420 | <v-list-tile slot="activator" ripple="ripple"> |
420 | <v-list-tile-content> | 421 | <v-list-tile-content> |
421 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 422 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
422 | </v-list-tile-content> | 423 | </v-list-tile-content> |
423 | </v-list-tile> | 424 | </v-list-tile> |
424 | <v-list-tile | 425 | <v-list-tile |
425 | v-for="(grand, i) in subItem.children" | 426 | v-for="(grand, i) in subItem.children" |
426 | :key="i" | 427 | :key="i" |
427 | :to="genChildTarget(item, grand)" | 428 | :to="genChildTarget(item, grand)" |
428 | :href="grand.href" | 429 | :href="grand.href" |
429 | ripple="ripple" | 430 | ripple="ripple" |
430 | > | 431 | > |
431 | <v-list-tile-content> | 432 | <v-list-tile-content> |
432 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 433 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
433 | </v-list-tile-content> | 434 | </v-list-tile-content> |
434 | </v-list-tile> | 435 | </v-list-tile> |
435 | </v-list-group> | 436 | </v-list-group> |
436 | <!--child item--> | 437 | <!--child item--> |
437 | <v-list-tile | 438 | <v-list-tile |
438 | v-else | 439 | v-else |
439 | :key="i" | 440 | :key="i" |
440 | :to="genChildTarget(item, subItem)" | 441 | :to="genChildTarget(item, subItem)" |
441 | :href="subItem.href" | 442 | :href="subItem.href" |
442 | :disabled="subItem.disabled" | 443 | :disabled="subItem.disabled" |
443 | :target="subItem.target" | 444 | :target="subItem.target" |
444 | ripple="ripple" | 445 | ripple="ripple" |
445 | > | 446 | > |
446 | <v-list-tile-action v-if="subItem.action"> | 447 | <v-list-tile-action v-if="subItem.action"> |
447 | <img | 448 | <img |
448 | width="30" | 449 | width="30" |
449 | :src="subItem.action" | 450 | :src="subItem.action" |
450 | :class="[subItem.actionClass || 'success--text']" | 451 | :class="[subItem.actionClass || 'success--text']" |
451 | /> | 452 | /> |
452 | </v-list-tile-action> | 453 | </v-list-tile-action> |
453 | <v-list-tile-content> | 454 | <v-list-tile-content> |
454 | <v-list-tile-title class="body-2"> | 455 | <v-list-tile-title class="body-2"> |
455 | <span>{{ subItem.title }}</span> | 456 | <span>{{ subItem.title }}</span> |
456 | </v-list-tile-title> | 457 | </v-list-tile-title> |
457 | </v-list-tile-content> | 458 | </v-list-tile-content> |
458 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 459 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
459 | </v-list-tile> | 460 | </v-list-tile> |
460 | </template> | 461 | </template> |
461 | </v-list-group> | 462 | </v-list-group> |
462 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 463 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
463 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 464 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
464 | <!--top-level link--> | 465 | <!--top-level link--> |
465 | <v-list-tile | 466 | <v-list-tile |
466 | v-else | 467 | v-else |
467 | ripple="ripple" | 468 | ripple="ripple" |
468 | :disabled="item.disabled" | 469 | :disabled="item.disabled" |
469 | :target="item.target" | 470 | :target="item.target" |
470 | rel="noopener" | 471 | rel="noopener" |
471 | :key="item.name" | 472 | :key="item.name" |
472 | :to="!item.href ? { name: item.name } : null" | 473 | :to="!item.href ? { name: item.name } : null" |
473 | :href="item.href" | 474 | :href="item.href" |
474 | > | 475 | > |
475 | <!-- <a :href="item.path"> --> | 476 | <!-- <a :href="item.path"> --> |
476 | <v-list-tile-action v-if="item.icon"> | 477 | <v-list-tile-action v-if="item.icon"> |
477 | <img :src="item.icon" width="22" alt="icons" /> | 478 | <img :src="item.icon" width="22" alt="icons" /> |
478 | </v-list-tile-action> | 479 | </v-list-tile-action> |
479 | <v-list-tile-content class="pt-2"> | 480 | <v-list-tile-content class="pt-2"> |
480 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 481 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
481 | </v-list-tile-content> | 482 | </v-list-tile-content> |
482 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 483 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
483 | <v-list-tile-action v-if="item.subAction"> | 484 | <v-list-tile-action v-if="item.subAction"> |
484 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 485 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
485 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> | 486 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> |
486 | </v-list-tile-action> | 487 | </v-list-tile-action> |
487 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 488 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
488 | <!-- </a> --> | 489 | <!-- </a> --> |
489 | </v-list-tile> | 490 | </v-list-tile> |
490 | </template> | 491 | </template> |
491 | 492 | ||
492 | <!-- NAVIGATION DRAWER IF ROLE IS PARENT --> | 493 | <!-- NAVIGATION DRAWER IF ROLE IS PARENT --> |
493 | <template v-for="(item, i) in menuParent" v-if="role === 'PARENT'"> | 494 | <template v-for="(item, i) in menuParent" v-if="role === 'PARENT'"> |
494 | <!-- {{menus}} --> | 495 | <!-- {{menus}} --> |
495 | <!--group with subitems--> | 496 | <!--group with subitems--> |
496 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> | 497 | <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action"> |
497 | <v-list-tile slot="activator" ripple="ripple"> | 498 | <v-list-tile slot="activator" ripple="ripple"> |
498 | <v-list-tile-action v-if="item.icon"> | 499 | <v-list-tile-action v-if="item.icon"> |
499 | <img :src="item.icon" width="22" alt="icons" /> | 500 | <img :src="item.icon" width="22" alt="icons" /> |
500 | </v-list-tile-action> | 501 | </v-list-tile-action> |
501 | <v-list-tile-content> | 502 | <v-list-tile-content> |
502 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 503 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
503 | </v-list-tile-content> | 504 | </v-list-tile-content> |
504 | </v-list-tile> | 505 | </v-list-tile> |
505 | <template v-for="(subItem, i) in item.items"> | 506 | <template v-for="(subItem, i) in item.items"> |
506 | <!--sub group--> | 507 | <!--sub group--> |
507 | <v-list-group | 508 | <v-list-group |
508 | v-if="subItem.items" | 509 | v-if="subItem.items" |
509 | :key="subItem.name" | 510 | :key="subItem.name" |
510 | :group="subItem.group" | 511 | :group="subItem.group" |
511 | sub-group="sub-group" | 512 | sub-group="sub-group" |
512 | > | 513 | > |
513 | <v-list-tile slot="activator" ripple="ripple"> | 514 | <v-list-tile slot="activator" ripple="ripple"> |
514 | <v-list-tile-content> | 515 | <v-list-tile-content> |
515 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> | 516 | <v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
516 | </v-list-tile-content> | 517 | </v-list-tile-content> |
517 | </v-list-tile> | 518 | </v-list-tile> |
518 | <v-list-tile | 519 | <v-list-tile |
519 | v-for="(grand, i) in subItem.children" | 520 | v-for="(grand, i) in subItem.children" |
520 | :key="i" | 521 | :key="i" |
521 | :to="genChildTarget(item, grand)" | 522 | :to="genChildTarget(item, grand)" |
522 | :href="grand.href" | 523 | :href="grand.href" |
523 | ripple="ripple" | 524 | ripple="ripple" |
524 | > | 525 | > |
525 | <v-list-tile-content> | 526 | <v-list-tile-content> |
526 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> | 527 | <v-list-tile-title>{{ grand.title }}</v-list-tile-title> |
527 | </v-list-tile-content> | 528 | </v-list-tile-content> |
528 | </v-list-tile> | 529 | </v-list-tile> |
529 | </v-list-group> | 530 | </v-list-group> |
530 | <!--child item--> | 531 | <!--child item--> |
531 | <v-list-tile | 532 | <v-list-tile |
532 | v-else | 533 | v-else |
533 | :key="i" | 534 | :key="i" |
534 | :to="genChildTarget(item, subItem)" | 535 | :to="genChildTarget(item, subItem)" |
535 | :href="subItem.href" | 536 | :href="subItem.href" |
536 | :disabled="subItem.disabled" | 537 | :disabled="subItem.disabled" |
537 | :target="subItem.target" | 538 | :target="subItem.target" |
538 | ripple="ripple" | 539 | ripple="ripple" |
539 | > | 540 | > |
540 | <v-list-tile-action v-if="subItem.action"> | 541 | <v-list-tile-action v-if="subItem.action"> |
541 | <img | 542 | <img |
542 | width="30" | 543 | width="30" |
543 | :src="subItem.action" | 544 | :src="subItem.action" |
544 | :class="[subItem.actionClass || 'success--text']" | 545 | :class="[subItem.actionClass || 'success--text']" |
545 | /> | 546 | /> |
546 | </v-list-tile-action> | 547 | </v-list-tile-action> |
547 | <v-list-tile-content> | 548 | <v-list-tile-content> |
548 | <v-list-tile-title class="body-2"> | 549 | <v-list-tile-title class="body-2"> |
549 | <span>{{ subItem.title }}</span> | 550 | <span>{{ subItem.title }}</span> |
550 | </v-list-tile-title> | 551 | </v-list-tile-title> |
551 | </v-list-tile-content> | 552 | </v-list-tile-content> |
552 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> | 553 | <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> |
553 | </v-list-tile> | 554 | </v-list-tile> |
554 | </template> | 555 | </template> |
555 | </v-list-group> | 556 | </v-list-group> |
556 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> | 557 | <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> |
557 | <v-divider v-else-if="item.divider" :key="i"></v-divider> | 558 | <v-divider v-else-if="item.divider" :key="i"></v-divider> |
558 | <!--top-level link--> | 559 | <!--top-level link--> |
559 | <v-list-tile | 560 | <v-list-tile |
560 | v-else | 561 | v-else |
561 | ripple="ripple" | 562 | ripple="ripple" |
562 | :disabled="item.disabled" | 563 | :disabled="item.disabled" |
563 | :target="item.target" | 564 | :target="item.target" |
564 | rel="noopener" | 565 | rel="noopener" |
565 | :key="item.name" | 566 | :key="item.name" |
566 | :to="!item.href ? { name: item.name } : null" | 567 | :to="!item.href ? { name: item.name } : null" |
567 | :href="item.href" | 568 | :href="item.href" |
568 | > | 569 | > |
569 | <!-- <a :href="item.path"> --> | 570 | <!-- <a :href="item.path"> --> |
570 | <v-list-tile-action v-if="item.icon"> | 571 | <v-list-tile-action v-if="item.icon"> |
571 | <img :src="item.icon" width="22" alt="icons" /> | 572 | <img :src="item.icon" width="22" alt="icons" /> |
572 | </v-list-tile-action> | 573 | </v-list-tile-action> |
573 | <v-list-tile-action v-if="item.Vicon"> | 574 | <v-list-tile-action v-if="item.Vicon"> |
574 | <div style="position: relative; top: 3px;"> | 575 | <div style="position: relative; top: 3px;"> |
575 | <v-icon color="white" size="25">{{item.Vicon}}</v-icon> | 576 | <v-icon color="white" size="25">{{item.Vicon}}</v-icon> |
576 | </div> | 577 | </div> |
577 | </v-list-tile-action> | 578 | </v-list-tile-action> |
578 | <v-list-tile-content class="pt-2"> | 579 | <v-list-tile-content class="pt-2"> |
579 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> | 580 | <v-list-tile-title>{{ item.title }}</v-list-tile-title> |
580 | </v-list-tile-content> | 581 | </v-list-tile-content> |
581 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> | 582 | <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> |
582 | <v-list-tile-action v-if="item.subAction"> | 583 | <v-list-tile-action v-if="item.subAction"> |
583 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> | 584 | <!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> |
584 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> | 585 | <!-- <img :src="item.icon" width="40" alt="icons" /> --> |
585 | </v-list-tile-action> | 586 | </v-list-tile-action> |
586 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> | 587 | <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
587 | <!-- </a> --> | 588 | <!-- </a> --> |
588 | </v-list-tile> | 589 | </v-list-tile> |
589 | </template> | 590 | </template> |
590 | </v-list> | 591 | </v-list> |
591 | <!-- </vue-perfect-scrollbar> --> | 592 | <!-- </vue-perfect-scrollbar> --> |
592 | </v-navigation-drawer> | 593 | </v-navigation-drawer> |
593 | </template> | 594 | </template> |
594 | <script> | 595 | <script> |
595 | import menu from "@/api/menu"; | 596 | import menu from "@/api/menu"; |
596 | import VuePerfectScrollbar from "vue-perfect-scrollbar"; | 597 | import VuePerfectScrollbar from "vue-perfect-scrollbar"; |
597 | export default { | 598 | export default { |
598 | name: "app-drawer", | 599 | name: "app-drawer", |
599 | components: { | 600 | components: { |
600 | VuePerfectScrollbar | 601 | VuePerfectScrollbar |
601 | }, | 602 | }, |
602 | props: { | 603 | props: { |
603 | expanded: { | 604 | expanded: { |
604 | type: Boolean, | 605 | type: Boolean, |
605 | default: true | 606 | default: true |
606 | } | 607 | } |
607 | }, | 608 | }, |
608 | data: () => ({ | 609 | data: () => ({ |
609 | mini: false, | 610 | mini: false, |
610 | drawer: true, | 611 | drawer: true, |
611 | menus: [], | 612 | menus: [], |
612 | menuSchool: [], | 613 | menuSchool: [], |
613 | menuTeacher: [], | 614 | menuTeacher: [], |
614 | menuAccount: [], | 615 | menuAccount: [], |
615 | menuLibrarian: [], | 616 | menuLibrarian: [], |
616 | menuParent: [], | 617 | menuParent: [], |
617 | schoolRole: "", | 618 | schoolRole: "", |
618 | role: "", | 619 | role: "", |
619 | scrollSettings: { | 620 | scrollSettings: { |
620 | maxScrollbarLength: 160 | 621 | maxScrollbarLength: 160 |
621 | } | 622 | } |
622 | }), | 623 | }), |
623 | computed: { | 624 | computed: { |
624 | computeGroupActive() { | 625 | computeGroupActive() { |
625 | return true; | 626 | return true; |
626 | }, | 627 | }, |
627 | computeLogo() { | 628 | computeLogo() { |
628 | return "/static/icon.png"; | 629 | return "/static/icon.png"; |
629 | }, | 630 | }, |
630 | 631 | ||
631 | sideToolbarColor() { | 632 | sideToolbarColor() { |
632 | return this.$vuetify.options.extra.sideNav; | 633 | return this.$vuetify.options.extra.sideNav; |
633 | } | 634 | } |
634 | }, | 635 | }, |
635 | created() { | 636 | created() { |
636 | this.schoolRole = this.$store.state.schoolRole; | 637 | this.schoolRole = this.$store.state.schoolRole; |
637 | this.role = this.$store.state.role; | 638 | this.role = this.$store.state.role; |
638 | this.menus = menu.adminMenu; | 639 | this.menus = menu.adminMenu; |
639 | this.menuSchool = menu.schoolMenu; | 640 | this.menuSchool = menu.schoolMenu; |
640 | this.menuTeacher = menu.teacherMenu; | 641 | this.menuTeacher = menu.teacherMenu; |
641 | this.menuAccount = menu.accountMenu; | 642 | this.menuAccount = menu.accountMenu; |
642 | this.menuLibrarian = menu.libraryMenu; | 643 | this.menuLibrarian = menu.libraryMenu; |
643 | this.menuParent = menu.parentMenu; | 644 | this.menuParent = menu.parentMenu; |
644 | // console.log("this.$route.name", this.$route.name); | 645 | // console.log("this.$route.name", this.$route.name); |
645 | // if (this.$route.name === "School") { | 646 | // if (this.$route.name === "School") { |
646 | // localStorage.setItem("SchoolName", this.$route.name); | 647 | // localStorage.setItem("SchoolName", this.$route.name); |
647 | // } | 648 | // } |
648 | // if (this.$route.name === "Dashboard") { | 649 | // if (this.$route.name === "Dashboard") { |
649 | // localStorage.setItem("AdminName", this.$route.name); | 650 | // localStorage.setItem("AdminName", this.$route.name); |
650 | // } | 651 | // } |
651 | // console.log("SN", localStorage.getItem("SchoolName")); | 652 | // console.log("SN", localStorage.getItem("SchoolName")); |
652 | // if (localStorage.getItem("SchoolName") === "School") { | 653 | // if (localStorage.getItem("SchoolName") === "School") { |
653 | // if (this.$store.state.schoolRole === "SUPERADMIN") { | 654 | // if (this.$store.state.schoolRole === "SUPERADMIN") { |
654 | // console.log("rolA", this.$store.state.schoolRole); | 655 | // console.log("rolA", this.$store.state.schoolRole); |
655 | // if (this.$store.state.schoolRole === "SUPERADMIN") { | 656 | // if (this.$store.state.schoolRole === "SUPERADMIN") { |
656 | // } | 657 | // } |
657 | // console.log("this.menus", this.menus); | 658 | // console.log("this.menus", this.menus); |
658 | // } | 659 | // } |
659 | // // } | 660 | // // } |
660 | // // console.log("AN", localStorage.getItem("AdminName")); | 661 | // // console.log("AN", localStorage.getItem("AdminName")); |
661 | // // if (localStorage.getItem("AdminName") === "Dashboard") { | 662 | // // if (localStorage.getItem("AdminName") === "Dashboard") { |
662 | // if (this.$store.state.role === "ADMIN") { | 663 | // if (this.$store.state.role === "ADMIN") { |
663 | // console.log("role", this.$store.state.role); | 664 | // console.log("role", this.$store.state.role); |
664 | // else if (this.$store.state.role === "ADMIN") { | 665 | // else if (this.$store.state.role === "ADMIN") { |
665 | // } | 666 | // } |
666 | // // } | 667 | // // } |
667 | // } | 668 | // } |
668 | 669 | ||
669 | // else if (this.$store.state.role === "LIBRARIAN") { | 670 | // else if (this.$store.state.role === "LIBRARIAN") { |
670 | // this.menus = menu.libraryMenu; | 671 | // this.menus = menu.libraryMenu; |
671 | // } else if (this.$store.state.role === "ACCOUNTANT") { | 672 | // } else if (this.$store.state.role === "ACCOUNTANT") { |
672 | // this.menus = menu.accountMenu; | 673 | // this.menus = menu.accountMenu; |
673 | // } | 674 | // } |
674 | window.getApp.$on("APP_DRAWER_TOGGLED", () => { | 675 | window.getApp.$on("APP_DRAWER_TOGGLED", () => { |
675 | this.drawer = !this.drawer; | 676 | this.drawer = !this.drawer; |
676 | }); | 677 | }); |
677 | }, | 678 | }, |
678 | methods: { | 679 | methods: { |
679 | genChildTarget(item, subItem) { | 680 | genChildTarget(item, subItem) { |
680 | if (subItem.href) return; | 681 | if (subItem.href) return; |
681 | if (subItem.component) { | 682 | if (subItem.component) { |
682 | return { | 683 | return { |
683 | name: subItem.component | 684 | name: subItem.component |
684 | }; | 685 | }; |
685 | } | 686 | } |
686 | return { name: `${item.group}/${subItem.name}` }; | 687 | return { name: `${item.group}/${subItem.name}` }; |
687 | } | 688 | } |
688 | }, | 689 | }, |
689 | mounted() { | 690 | mounted() { |
690 | if (this.$store.state.role === "ADMIN") { | 691 | if (this.$store.state.role === "ADMIN") { |
691 | this.token = this.$store.state.token; | 692 | this.token = this.$store.state.token; |
692 | } | 693 | } |
693 | if (this.$store.state.schoolRole === "SUPERADMIN") { | 694 | if (this.$store.state.schoolRole === "SUPERADMIN") { |
694 | this.token = this.$store.schoolToken; | 695 | this.token = this.$store.schoolToken; |
695 | } | 696 | } |
696 | if (this.$store.state.role === "TEACHER") { | 697 | if (this.$store.state.role === "TEACHER") { |
697 | this.token = this.$store.state.token; | 698 | this.token = this.$store.state.token; |
698 | } | 699 | } |
699 | if (this.$store.state.role === "ACCOUNTANT") { | 700 | if (this.$store.state.role === "ACCOUNTANT") { |
700 | this.token = this.$store.state.token; | 701 | this.token = this.$store.state.token; |
701 | } | 702 | } |
702 | if (this.$store.state.role === "LIBRARIAN") { | 703 | if (this.$store.state.role === "LIBRARIAN") { |
703 | this.token = this.$store.state.token; | 704 | this.token = this.$store.state.token; |
704 | } | 705 | } |
705 | if (this.$store.state.role === "PARENT") { | 706 | if (this.$store.state.role === "PARENT") { |
706 | this.token = this.$store.state.token; | 707 | this.token = this.$store.state.token; |
707 | } | 708 | } |
708 | } | 709 | } |
709 | }; | 710 | }; |
710 | </script> | 711 | </script> |
711 | 712 | ||
712 | 713 | ||
713 | <style lang="stylus"> | 714 | <style lang="stylus"> |
714 | // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl'; | 715 | // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl'; |
715 | #appDrawer { | 716 | #appDrawer { |
716 | overflow: hidden; | 717 | overflow: hidden; |
717 | 718 | ||
718 | .drawer-menu--scroll { | 719 | .drawer-menu--scroll { |
719 | height: calc(100vh - 48px); | 720 | height: calc(100vh - 48px); |
720 | overflow: auto; | 721 | overflow: auto; |
721 | } | 722 | } |
722 | } | 723 | } |
723 | 724 | ||
724 | .v-list__group__items--no-action .v-list__tile { | 725 | .v-list__group__items--no-action .v-list__tile { |
725 | padding-left: 72px !important; | 726 | padding-left: 72px !important; |
726 | } | 727 | } |
727 | 728 | ||
728 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { | 729 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
729 | height: 54px; | 730 | height: 54px; |
730 | font-size: 17px; | 731 | font-size: 17px; |
731 | } | 732 | } |
732 | 733 | ||
733 | .v-list__tile__action { | 734 | .v-list__tile__action { |
734 | min-width: 36px; | 735 | min-width: 36px; |
735 | } | 736 | } |
736 | 737 | ||
737 | // .theme--light .v-icon, .application .theme--light.v-icon { | 738 | // .theme--light .v-icon, .application .theme--light.v-icon { |
738 | // color: #f1f1f1; | 739 | // color: #f1f1f1; |
739 | // } | 740 | // } |
740 | .ps>.ps__scrollbar-y-rail>.ps__scrollbar-y { | 741 | .ps>.ps__scrollbar-y-rail>.ps__scrollbar-y { |
741 | background-color: #f5f5f5; | 742 | background-color: #f5f5f5; |
742 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148))); | 743 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148))); |
743 | width: 8px !important; | 744 | width: 8px !important; |
744 | } | 745 | } |
745 | 746 | ||
746 | .ps>.ps__scrollbar-y-rail { | 747 | .ps>.ps__scrollbar-y-rail { |
747 | width: 0px !important; | 748 | width: 0px !important; |
748 | } | 749 | } |
749 | 750 | ||
750 | .ps:hover > .ps__scrollbar-y-rail:hover { | 751 | .ps:hover > .ps__scrollbar-y-rail:hover { |
751 | background-color: #5f2171 !important; | 752 | background-color: #5f2171 !important; |
752 | opacity: 0.9; | 753 | opacity: 0.9; |
753 | } | 754 | } |
754 | 755 | ||
755 | .ps > .ps__scrollbar-y-rail:hover > .ps__scrollbar-y { | 756 | .ps > .ps__scrollbar-y-rail:hover > .ps__scrollbar-y { |
756 | width: 8px !important; | 757 | width: 8px !important; |
757 | background-color: #f5f5f5; | 758 | background-color: #f5f5f5; |
758 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148))); | 759 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148))); |
759 | } | 760 | } |
760 | 761 | ||
761 | .ps:hover > .ps__scrollbar-y-rail:hover > .ps__scrollbar-y { | 762 | .ps:hover > .ps__scrollbar-y-rail:hover > .ps__scrollbar-y { |
762 | // background-color: #5f2171 !important; | 763 | // background-color: #5f2171 !important; |
763 | width: 8px !important; | 764 | width: 8px !important; |
764 | background-color: #f5f5f5; | 765 | background-color: #f5f5f5; |
765 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148))); | 766 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.44, rgb(122, 153, 217)), color-stop(0.72, rgb(73, 125, 189)), color-stop(0.86, rgb(28, 58, 148))); |
766 | } | 767 | } |
767 | 768 | ||
768 | .v-list__tile--active { | 769 | .v-list__tile--active { |
769 | color: #71d9ea !important; | 770 | color: #71d9ea !important; |
770 | } | 771 | } |
771 | 772 | ||
772 | .my-1 { | 773 | .my-1 { |
773 | text-align: left !important; | 774 | text-align: left !important; |
774 | } | 775 | } |
775 | 776 | ||
776 | .title { | 777 | .title { |
777 | line-height: 2 !important; | 778 | line-height: 2 !important; |
778 | } | 779 | } |
779 | 780 | ||
780 | // .v-list__tile--hover { | 781 | // .v-list__tile--hover { |
781 | // color: white !important; | 782 | // color: white !important; |
782 | // background: red !important; | 783 | // background: red !important; |
783 | // } | 784 | // } |
784 | .v-list .v-list__tile--link:hover, .v-list .v-list__tile--highlighted, .v-list .v-list__group__header:hover, .v-list .v-list__group--active:before, .v-list .v-list__group--active:after { | 785 | .v-list .v-list__tile--link:hover, .v-list .v-list__tile--highlighted, .v-list .v-list__group__header:hover, .v-list .v-list__group--active:before, .v-list .v-list__group--active:after { |
785 | background: #7f62f8 !important; | 786 | background: #7f62f8 !important; |
786 | color: #71d9ea !important; | 787 | color: #71d9ea !important; |
787 | box-shadow: 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12) !important; | 788 | box-shadow: 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12) !important; |
788 | // border-radius: 12px !important; | 789 | // border-radius: 12px !important; |
789 | } | 790 | } |
790 | 791 | ||
791 | @media screen and (max-width: 420px) { | 792 | @media screen and (max-width: 420px) { |
792 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { | 793 | .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
793 | font-size: 14px; | 794 | font-size: 14px; |
794 | } | 795 | } |
795 | 796 | ||
796 | .imgLogo { | 797 | .imgLogo { |
797 | height: 32px; | 798 | height: 32px; |
798 | width: 120px; | 799 | width: 120px; |
799 | } | 800 | } |
800 | } | 801 | } |
801 | </style> | 802 | </style> |
802 | 803 | ||
803 | 804 | ||
804 | <style scoped> | 805 | <style scoped> |
805 | .theme--light .v-icon, | 806 | .theme--light .v-icon, |
806 | .application .theme--light.v-icon { | 807 | .application .theme--light.v-icon { |
807 | color: #39b982; | 808 | color: #39b982; |
808 | } | 809 | } |
809 | .side-bar-color { | 810 | .side-bar-color { |
810 | background: #827bfa !important; | 811 | background: #827bfa !important; |
811 | /* border-top-right-radius: 74px !important; */ | 812 | /* border-top-right-radius: 74px !important; */ |
812 | } | 813 | } |
813 | .v-navigation-drawer--fixed { | 814 | .v-navigation-drawer--fixed { |
814 | position: absolute !important; | 815 | position: absolute !important; |
815 | 816 | ||
816 | min-height: calc(2000px - 64px - 50px - 81px) !important; | 817 | min-height: calc(2000px - 64px - 50px - 81px) !important; |
817 | /* max-height: inherit !important; */ | 818 | /* max-height: inherit !important; */ |
818 | } | 819 | } |
819 | .hover:hover { | 820 | .hover:hover { |
820 | color: red !important; | 821 | color: red !important; |
821 | background: red !important; | 822 | background: red !important; |
822 | } | 823 | } |
823 | </style> | 824 | </style> |
824 | 825 | ||
825 | 826 | ||
826 | 827 |
src/pages/Annoucement/annoucement.vue
1 | <template> | 1 | <template> |
2 | <v-container fluid class="body-color"> | 2 | <v-container fluid class="body-color"> |
3 | <!-- ****** EDITS COURSES DETAILS ****** --> | 3 | <!-- ****** EDITS COURSES DETAILS ****** --> |
4 | <v-dialog v-model="editStudentDialog" max-width="600px" scrollable> | 4 | <v-dialog v-model="editStudentDialog" max-width="600px" scrollable> |
5 | <v-card flat class="card-style pa-2" dark> | 5 | <v-card flat class="card-style pa-2" dark> |
6 | <v-layout> | 6 | <v-layout> |
7 | <v-flex xs12> | 7 | <v-flex xs12> |
8 | <label class="title text-xs-center">Edit Annoucement</label> | 8 | <label class="title text-xs-center">Edit Annoucement</label> |
9 | <v-icon size="24" class="right" @click="editStudentDialog = false">cancel</v-icon> | 9 | <v-icon size="24" class="right" @click="editStudentDialog = false">cancel</v-icon> |
10 | </v-flex> | 10 | </v-flex> |
11 | </v-layout> | 11 | </v-layout> |
12 | <v-card-text> | 12 | <v-card-text> |
13 | <v-form ref="form"> | 13 | <v-form ref="form"> |
14 | <v-container fluid> | 14 | <v-container fluid> |
15 | <v-layout> | 15 | <v-layout> |
16 | <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center"> | 16 | <v-flex xs12 class="text-xs-center text-sm-center text-md-center text-lg-center"> |
17 | <v-avatar size="100px" v-if="!editedItem.attachementUrl && !editImageUrl"> | 17 | <v-avatar size="100px" v-if="!editedItem.attachementUrl && !editImageUrl"> |
18 | <img src="/static/icon/user.png" /> | 18 | <img src="/static/icon/user.png" /> |
19 | </v-avatar> | 19 | </v-avatar> |
20 | <img | 20 | <img |
21 | :src="editedItem.attachementUrl" | 21 | :src="editedItem.attachementUrl" |
22 | v-else-if="editedItem.attachementUrl && !editImageUrl" | 22 | v-else-if="editedItem.attachementUrl && !editImageUrl" |
23 | height="150" | 23 | height="150" |
24 | style="border-radius:50%; width:150px" | 24 | style="border-radius:50%; width:150px" |
25 | /> | 25 | /> |
26 | <img | 26 | <img |
27 | v-if="editImageUrl" | 27 | v-if="editImageUrl" |
28 | :src="editImageUrl" | 28 | :src="editImageUrl" |
29 | style="border-radius:50%; width:150px;height:150px" | 29 | style="border-radius:50%; width:150px;height:150px" |
30 | /> | 30 | /> |
31 | <input | 31 | <input |
32 | type="file" | 32 | type="file" |
33 | style="display: none" | 33 | style="display: none" |
34 | ref="editDataImage" | 34 | ref="editDataImage" |
35 | accept="image/*" | 35 | accept="image/*" |
36 | @change="onEditFilePicked" | 36 | @change="onEditFilePicked" |
37 | /> | 37 | /> |
38 | </v-flex> | 38 | </v-flex> |
39 | </v-layout> | 39 | </v-layout> |
40 | <v-layout wrap> | 40 | <v-layout wrap> |
41 | <v-flex xs12 sm12> | 41 | <v-flex xs12 sm12> |
42 | <v-layout> | 42 | <v-layout> |
43 | <v-flex xs4 sm5 class="pt-4 subheading"> | 43 | <v-flex xs4 sm5 class="pt-4 subheading"> |
44 | <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> | 44 | <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> |
45 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> | 45 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> |
46 | </v-flex> | 46 | </v-flex> |
47 | <v-flex xs8 sm7 class="ml-3"> | 47 | <v-flex xs8 sm7 class="ml-3"> |
48 | <v-select | 48 | <v-select |
49 | :items="addclass" | 49 | :items="addclass" |
50 | label="Select Class" | 50 | label="Select Class" |
51 | v-model="editedItem.select" | 51 | v-model="editedItem.select" |
52 | item-text="classNum" | 52 | item-text="classNum" |
53 | item-value="_id" | 53 | item-value="_id" |
54 | name="Select Class" | 54 | name="Select Class" |
55 | required | 55 | required |
56 | ></v-select> | 56 | ></v-select> |
57 | </v-flex> | 57 | </v-flex> |
58 | </v-layout> | 58 | </v-layout> |
59 | <v-layout> | 59 | <v-layout> |
60 | <v-flex xs4 sm5 class="pt-4 subheading"> | 60 | <v-flex xs4 sm5 class="pt-4 subheading"> |
61 | <label class="right hidden-xs-only hidden-sm-only">Course Name:</label> | 61 | <label class="right hidden-xs-only hidden-sm-only">Course Name:</label> |
62 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Course:</label> | 62 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Course:</label> |
63 | </v-flex> | 63 | </v-flex> |
64 | <v-flex xs8 sm7 class="ml-3"> | 64 | <v-flex xs8 sm7 class="ml-3"> |
65 | <v-select | 65 | <v-select |
66 | :items="courseData" | 66 | :items="courseData" |
67 | item-text="courseName" | 67 | item-text="courseName" |
68 | item-value="_id" | 68 | item-value="_id" |
69 | v-model="editedItem.courseName" | 69 | v-model="editedItem.courseName" |
70 | placeholder="fill your Course name" | 70 | placeholder="fill your Course name" |
71 | type="text" | 71 | type="text" |
72 | :rules="courseRules" | 72 | :rules="courseRules" |
73 | required | 73 | required |
74 | ></v-select> | 74 | ></v-select> |
75 | </v-flex> | 75 | </v-flex> |
76 | </v-layout> | 76 | </v-layout> |
77 | <v-layout> | 77 | <v-layout> |
78 | <v-flex xs4 sm5 class="pt-4 subheading"> | 78 | <v-flex xs4 sm5 class="pt-4 subheading"> |
79 | <label class="right hidden-xs-only hidden-sm-only">Discussion Type:</label> | 79 | <label class="right hidden-xs-only hidden-sm-only">Discussion Type:</label> |
80 | <label | 80 | <label |
81 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | 81 | class="right hidden-lg-only hidden-md-only hidden-xl-only" |
82 | >DiscussionType:</label> | 82 | >DiscussionType:</label> |
83 | </v-flex> | 83 | </v-flex> |
84 | <v-flex xs8 sm7 class="ml-3"> | 84 | <v-flex xs8 sm7 class="ml-3"> |
85 | <v-text-field | 85 | <v-text-field |
86 | v-model="editedItem.discussionType" | 86 | v-model="editedItem.discussionType" |
87 | placeholder="fill your Course Name" | 87 | placeholder="fill your Course Name" |
88 | type="text" | 88 | type="text" |
89 | required | 89 | required |
90 | ></v-text-field> | 90 | ></v-text-field> |
91 | </v-flex> | 91 | </v-flex> |
92 | </v-layout> | 92 | </v-layout> |
93 | <v-layout> | 93 | <v-layout> |
94 | <v-flex xs4 sm5 class="pt-4 subheading"> | 94 | <v-flex xs4 sm5 class="pt-4 subheading"> |
95 | <label class="right hidden-xs-only hidden-sm-only">Upload Image:</label> | 95 | <label class="right hidden-xs-only hidden-sm-only">Upload Image:</label> |
96 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Upload:</label> | 96 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Upload:</label> |
97 | </v-flex> | 97 | </v-flex> |
98 | <v-flex xs8 sm7 class="ml-3"> | 98 | <v-flex xs8 sm7 class="ml-3"> |
99 | <v-text-field | 99 | <v-text-field |
100 | label="Select Image" | 100 | label="Select Image" |
101 | @click="pickEditFile" | 101 | @click="pickEditFile" |
102 | v-model="editImageName" | 102 | v-model="editImageName" |
103 | append-icon="attach_file" | 103 | append-icon="attach_file" |
104 | ></v-text-field> | 104 | ></v-text-field> |
105 | </v-flex> | 105 | </v-flex> |
106 | </v-layout> | 106 | </v-layout> |
107 | </v-flex> | 107 | </v-flex> |
108 | </v-layout> | 108 | </v-layout> |
109 | <v-layout> | 109 | <v-layout> |
110 | <v-flex xs12 sm12 class="px-0 mx-0"> | 110 | <v-flex xs12 sm12 class="px-0 mx-0"> |
111 | <v-layout class="right"> | 111 | <v-layout class="right"> |
112 | <v-btn @click="save" round dark :loading="editLoading" class="add-button">Save</v-btn> | 112 | <v-btn @click="save" round dark :loading="editLoading" class="add-button">Save</v-btn> |
113 | </v-layout> | 113 | </v-layout> |
114 | </v-flex> | 114 | </v-flex> |
115 | </v-layout> | 115 | </v-layout> |
116 | </v-container> | 116 | </v-container> |
117 | </v-form> | 117 | </v-form> |
118 | </v-card-text> | 118 | </v-card-text> |
119 | </v-card> | 119 | </v-card> |
120 | </v-dialog> | 120 | </v-dialog> |
121 | 121 | ||
122 | <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** --> | 122 | <!-- ****** PROFILE VIEW STUDENTS DEATILS ****** --> |
123 | 123 | ||
124 | <v-dialog v-model="profileStudentDialog" max-width="600px" scrollable> | 124 | <v-dialog v-model="profileStudentDialog" max-width="600px" scrollable> |
125 | <v-card flat class="card-style pa-3" dark> | 125 | <v-card flat class="card-style pa-3" dark> |
126 | <v-layout> | 126 | <v-layout> |
127 | <v-flex xs12> | 127 | <v-flex xs12> |
128 | <label class="title text-xs-center">View Annoucement</label> | 128 | <label class="title text-xs-center">View Annoucement</label> |
129 | <v-icon size="24" class="right" @click="profileStudentDialog = false">cancel</v-icon> | 129 | <v-icon size="24" class="right" @click="profileStudentDialog = false">cancel</v-icon> |
130 | </v-flex> | 130 | </v-flex> |
131 | </v-layout> | 131 | </v-layout> |
132 | <v-card-text> | 132 | <v-card-text> |
133 | <v-flex align-center justify-center layout text-xs-center class="mt-3"> | 133 | <v-flex align-center justify-center layout text-xs-center class="mt-3"> |
134 | <v-avatar size="100px"> | 134 | <v-avatar size="100px"> |
135 | <img src="/static/icon/user.png" v-if="!editedItem.attachementUrl" /> | 135 | <img src="/static/icon/user.png" v-if="!editedItem.attachementUrl" /> |
136 | <img :src="editedItem.attachementUrl" v-else-if="editedItem.attachementUrl" /> | 136 | <img :src="editedItem.attachementUrl" v-else-if="editedItem.attachementUrl" /> |
137 | </v-avatar> | 137 | </v-avatar> |
138 | </v-flex> | 138 | </v-flex> |
139 | <v-container grid-list-md> | 139 | <v-container grid-list-md> |
140 | <v-layout wrap> | 140 | <v-layout wrap> |
141 | <v-flex xs12> | 141 | <v-flex xs12> |
142 | <v-layout> | 142 | <v-layout> |
143 | <v-flex xs6 sm6> | 143 | <v-flex xs6 sm6> |
144 | <h5 class="right my-1"> | 144 | <h5 class="right my-1"> |
145 | <b>Discussion Type :</b> | 145 | <b>Discussion Type :</b> |
146 | </h5> | 146 | </h5> |
147 | </v-flex> | 147 | </v-flex> |
148 | <v-flex sm6 xs6> | 148 | <v-flex sm6 xs6> |
149 | <h5 class="my-1 left">{{ editedItem.discussionType }}</h5> | 149 | <h5 class="my-1 left">{{ editedItem.discussionType }}</h5> |
150 | </v-flex> | 150 | </v-flex> |
151 | </v-layout> | 151 | </v-layout> |
152 | </v-flex> | 152 | </v-flex> |
153 | </v-layout> | 153 | </v-layout> |
154 | </v-container> | 154 | </v-container> |
155 | </v-card-text> | 155 | </v-card-text> |
156 | </v-card> | 156 | </v-card> |
157 | </v-dialog> | 157 | </v-dialog> |
158 | 158 | ||
159 | <!-- ****** Annoucement TABLE ****** --> | 159 | <!-- ****** Annoucement TABLE ****** --> |
160 | <v-toolbar color="transparent" flat> | 160 | <v-toolbar color="transparent" flat> |
161 | <v-btn | 161 | <v-btn |
162 | fab | 162 | fab |
163 | dark | 163 | dark |
164 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | 164 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" |
165 | small | 165 | small |
166 | @click="addAnnoucementDialog = true" | 166 | @click="addAnnoucementDialog = true" |
167 | > | 167 | > |
168 | <v-icon dark>add</v-icon> | 168 | <v-icon dark>add</v-icon> |
169 | </v-btn> | 169 | </v-btn> |
170 | <v-btn | 170 | <v-btn |
171 | round | 171 | round |
172 | class="open-dialog-button hidden-sm-only hidden-xs-only" | 172 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
173 | dark | 173 | dark |
174 | @click="addAnnoucementDialog = true" | 174 | @click="addAnnoucementDialog = true" |
175 | > | 175 | > |
176 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Annoucement | 176 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Annoucement |
177 | </v-btn> | 177 | </v-btn> |
178 | <v-card-actions class="hidden-xs-only hidden-sm-only"> | 178 | <v-card-actions class="hidden-xs-only hidden-sm-only"> |
179 | <v-flex md13 lg12> | 179 | <v-flex md13 lg12> |
180 | <v-layout> | 180 | <v-layout> |
181 | <v-flex lg6 md12> | 181 | <v-flex lg6 md12> |
182 | <v-layout> | 182 | <v-layout> |
183 | <v-select | 183 | <v-select |
184 | :items="addclass" | 184 | :items="addclass" |
185 | label="Select Class" | 185 | label="Select Class" |
186 | v-model="selectAnnoucement.classId" | 186 | v-model="selectAnnoucement.classId" |
187 | item-text="classNum" | 187 | item-text="classNum" |
188 | item-value="_id" | 188 | item-value="_id" |
189 | name="Select Class" | 189 | name="Select Class" |
190 | :rules="classRules" | 190 | :rules="classRules" |
191 | required | 191 | required |
192 | class="ml-2" | 192 | class="ml-2" |
193 | @change="getCourses(selectAnnoucement.classId)" | 193 | @change="getCourses(selectAnnoucement.classId)" |
194 | ></v-select> | 194 | ></v-select> |
195 | <v-select | 195 | <v-select |
196 | :items="courseData" | 196 | :items="courseData" |
197 | label="Select Course" | 197 | label="Select Course" |
198 | v-model="selectAnnoucement.courseId" | 198 | v-model="selectAnnoucement.courseId" |
199 | item-text="courseName" | 199 | item-text="courseName" |
200 | item-value="_id" | 200 | item-value="_id" |
201 | :rules="courseRules" | 201 | :rules="courseRules" |
202 | required | 202 | required |
203 | class="ml-4" | 203 | class="ml-4" |
204 | ></v-select> | 204 | ></v-select> |
205 | </v-layout> | 205 | </v-layout> |
206 | </v-flex> | 206 | </v-flex> |
207 | </v-layout> | 207 | </v-layout> |
208 | </v-flex> | 208 | </v-flex> |
209 | </v-card-actions> | 209 | </v-card-actions> |
210 | <v-spacer></v-spacer> | 210 | <v-spacer></v-spacer> |
211 | <v-btn | 211 | <v-btn |
212 | @click="getAnnoucementes()" | 212 | @click="getAnnoucementes()" |
213 | round | 213 | round |
214 | dark | 214 | dark |
215 | :loading="loading" | 215 | :loading="loading" |
216 | class="open-dialog-button hidden-xs-only hidden-sm-only" | 216 | class="open-dialog-button hidden-xs-only hidden-sm-only" |
217 | >Find</v-btn> | 217 | >Find</v-btn> |
218 | <v-card-title class="body-1" v-show="show"> | 218 | <v-card-title class="body-1" v-show="show"> |
219 | <v-btn icon large flat @click="displaySearch"> | 219 | <v-btn icon large flat @click="displaySearch"> |
220 | <v-avatar size="27"> | 220 | <v-avatar size="27"> |
221 | <img src="/static/icon/search.png" alt="icon" /> | 221 | <img src="/static/icon/search.png" alt="icon" /> |
222 | </v-avatar> | 222 | </v-avatar> |
223 | </v-btn> | 223 | </v-btn> |
224 | </v-card-title> | 224 | </v-card-title> |
225 | <v-flex xs8 sm7 lg2 md3 v-if="showSearch"> | 225 | <v-flex xs8 sm7 lg2 md3 v-if="showSearch"> |
226 | <v-layout> | 226 | <v-layout> |
227 | <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | 227 | <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> |
228 | <v-icon @click="closeSearch" color="error">close</v-icon> | 228 | <v-icon @click="closeSearch" color="error">close</v-icon> |
229 | </v-layout> | 229 | </v-layout> |
230 | </v-flex> | 230 | </v-flex> |
231 | </v-toolbar> | 231 | </v-toolbar> |
232 | <v-card flat class="elevation-0 transparent"> | 232 | <v-card flat class="elevation-0 transparent"> |
233 | <v-flex class="hidden-xl-only hidden-lg-only hidden-md-only"> | 233 | <v-flex class="hidden-xl-only hidden-lg-only hidden-md-only"> |
234 | <v-layout> | 234 | <v-layout> |
235 | <v-flex xs12> | 235 | <v-flex xs12> |
236 | <v-select | 236 | <v-select |
237 | :items="addclass" | 237 | :items="addclass" |
238 | label="Select Class" | 238 | label="Select Class" |
239 | v-model="selectAnnoucement.select" | 239 | v-model="selectAnnoucement.select" |
240 | item-text="classNum" | 240 | item-text="classNum" |
241 | item-value="_id" | 241 | item-value="_id" |
242 | name="Select Class" | 242 | name="Select Class" |
243 | :rules="classRules" | 243 | :rules="classRules" |
244 | class="px-2" | 244 | class="px-2" |
245 | ></v-select> | 245 | ></v-select> |
246 | </v-flex> | 246 | </v-flex> |
247 | </v-layout> | 247 | </v-layout> |
248 | <v-layout> | 248 | <v-layout> |
249 | <v-flex xs5 class="mx-auto mb-2"> | 249 | <v-flex xs5 class="mx-auto mb-2"> |
250 | <v-btn | 250 | <v-btn |
251 | @click="getAnnoucementes()" | 251 | @click="getAnnoucementes()" |
252 | block | 252 | block |
253 | round | 253 | round |
254 | dark | 254 | dark |
255 | :loading="loading" | 255 | :loading="loading" |
256 | class="add-button" | 256 | class="add-button" |
257 | >Find</v-btn> | 257 | >Find</v-btn> |
258 | </v-flex> | 258 | </v-flex> |
259 | </v-layout> | 259 | </v-layout> |
260 | </v-flex> | 260 | </v-flex> |
261 | </v-card> | 261 | </v-card> |
262 | <v-data-table | 262 | <v-data-table |
263 | :headers="headers" | 263 | :headers="headers" |
264 | :items="annoucementData" | 264 | :items="annoucementData" |
265 | :pagination.sync="pagination" | 265 | :pagination.sync="pagination" |
266 | :search="search" | 266 | :search="search" |
267 | > | 267 | > |
268 | <template slot="items" slot-scope="props"> | 268 | <template slot="items" slot-scope="props"> |
269 | <tr class="tr row-click" @click="rowAnnoucement(props.item._id)"> | 269 | <tr class="tr row-click" @click="rowAnnoucement(props.item._id)"> |
270 | <td class="text-xs-center td td-row"> | 270 | <td class="text-xs-center td td-row"> |
271 | <v-avatar size="40"> | 271 | <v-avatar size="40"> |
272 | <img :src="props.item.attachementUrl" v-if="props.item.attachementUrl" /> | 272 | <img :src="props.item.attachementUrl" v-if="props.item.attachementUrl" /> |
273 | <img src="/static/icon/user.png" v-else-if="!props.item.attachementUrl" /> | 273 | <img src="/static/icon/user.png" v-else-if="!props.item.attachementUrl" /> |
274 | </v-avatar> | 274 | </v-avatar> |
275 | </td> | 275 | </td> |
276 | <td class="text-xs-center td td-row">{{ props.item.discussionType}}</td> | 276 | <td class="text-xs-center td td-row">{{ props.item.discussionType}}</td> |
277 | <td class="text-xs-center td td-row"> | 277 | <td class="text-xs-center td td-row"> |
278 | <span> | 278 | <span> |
279 | <v-tooltip top> | 279 | <v-tooltip top> |
280 | <img | 280 | <img |
281 | slot="activator" | 281 | slot="activator" |
282 | style="cursor:pointer; width:25px; height:25px; " | 282 | style="cursor:pointer; width:25px; height:25px; " |
283 | class="mr-3" | 283 | class="mr-3" |
284 | @click="profile(props.item)" | 284 | @click="profile(props.item)" |
285 | src="/static/icon/view.png" | 285 | src="/static/icon/view.png" |
286 | /> | 286 | /> |
287 | <span>View</span> | 287 | <span>View</span> |
288 | </v-tooltip> | 288 | </v-tooltip> |
289 | <v-tooltip top> | 289 | <v-tooltip top> |
290 | <img | 290 | <img |
291 | slot="activator" | 291 | slot="activator" |
292 | style="cursor:pointer; width:20px; height:18px; " | 292 | style="cursor:pointer; width:20px; height:18px; " |
293 | class="mr-3" | 293 | class="mr-3" |
294 | @click="editItem(props.item)" | 294 | @click="editItem(props.item)" |
295 | src="/static/icon/edit.png" | 295 | src="/static/icon/edit.png" |
296 | /> | 296 | /> |
297 | <span>Edit</span> | 297 | <span>Edit</span> |
298 | </v-tooltip> | 298 | </v-tooltip> |
299 | <v-tooltip top> | 299 | <v-tooltip top> |
300 | <img | 300 | <img |
301 | slot="activator" | 301 | slot="activator" |
302 | style="cursor:pointer; width:20px; height:20px; " | 302 | style="cursor:pointer; width:20px; height:20px; " |
303 | class="mr-3" | 303 | class="mr-3" |
304 | @click="deleteItem(props.item)" | 304 | @click="deleteItem(props.item)" |
305 | src="/static/icon/delete.png" | 305 | src="/static/icon/delete.png" |
306 | /> | 306 | /> |
307 | <span>Delete</span> | 307 | <span>Delete</span> |
308 | </v-tooltip> | 308 | </v-tooltip> |
309 | </span> | 309 | </span> |
310 | </td> | 310 | </td> |
311 | </tr> | 311 | </tr> |
312 | </template> | 312 | </template> |
313 | <v-alert | 313 | <v-alert |
314 | slot="no-results" | 314 | slot="no-results" |
315 | :value="true" | 315 | :value="true" |
316 | color="error" | 316 | color="error" |
317 | icon="warning" | 317 | icon="warning" |
318 | >Your search for "{{ search }}" found no results.</v-alert> | 318 | >Your search for "{{ search }}" found no results.</v-alert> |
319 | </v-data-table> | 319 | </v-data-table> |
320 | <!-- ****** Add Annoucement DETAILS******--> | 320 | <!-- ****** Add Annoucement DETAILS******--> |
321 | <v-dialog v-model="addAnnoucementDialog" max-width="500"> | 321 | <v-dialog v-model="addAnnoucementDialog" max-width="500"> |
322 | <v-card flat class="card-style pa-2" dark> | 322 | <v-card flat class="card-style pa-2" dark> |
323 | <v-layout> | 323 | <v-layout> |
324 | <v-flex xs12> | 324 | <v-flex xs12> |
325 | <label class="title text-xs-center">Add Annoucement</label> | 325 | <label class="title text-xs-center">Add Annoucement</label> |
326 | <v-icon size="24" class="right" @click="addAnnoucementDialog = false">cancel</v-icon> | 326 | <v-icon size="24" class="right" @click="$refs.form.reset();addAnnoucementDialog = false">cancel</v-icon> |
327 | </v-flex> | 327 | </v-flex> |
328 | </v-layout> | 328 | </v-layout> |
329 | <v-container fluid> | 329 | <v-container fluid> |
330 | <v-layout align-center> | 330 | <v-layout align-center> |
331 | <v-flex xs12> | 331 | <v-flex xs12> |
332 | <v-flex xs12 sm12> | 332 | <v-flex xs12 sm12> |
333 | <v-form ref="form" v-model="valid" lazy-validation> | 333 | <v-form ref="form" v-model="valid" lazy-validation> |
334 | <v-layout> | 334 | <v-layout> |
335 | <v-flex | 335 | <v-flex |
336 | xs12 | 336 | xs12 |
337 | class="text-xs-center text-sm-center text-md-center text-lg-center" | 337 | class="text-xs-center text-sm-center text-md-center text-lg-center" |
338 | > | 338 | > |
339 | <v-avatar size="100px" v-if="!imageUrl"> | 339 | <v-avatar size="100px" v-if="!imageUrl"> |
340 | <img src="/static/icon/user.png" /> | 340 | <img src="/static/icon/user.png" /> |
341 | </v-avatar> | 341 | </v-avatar> |
342 | <input | 342 | <input |
343 | type="file" | 343 | type="file" |
344 | style="display: none" | 344 | style="display: none" |
345 | ref="image" | 345 | ref="image" |
346 | accept="image/*" | 346 | accept="image/*" |
347 | @change="onFilePicked" | 347 | @change="onFilePicked" |
348 | /> | 348 | /> |
349 | <img | 349 | <img |
350 | :src="imageData.imageUrl" | 350 | :src="imageData.imageUrl" |
351 | height="150" | 351 | height="150" |
352 | width="150" | 352 | width="150" |
353 | v-if="imageUrl" | 353 | v-if="imageUrl" |
354 | style="border-radius:50%; width:200px" | 354 | style="border-radius:50%; width:200px" |
355 | /> | 355 | /> |
356 | </v-flex> | 356 | </v-flex> |
357 | </v-layout> | 357 | </v-layout> |
358 | <v-layout wrap> | 358 | <v-layout wrap> |
359 | <v-flex xs12 sm12> | 359 | <v-flex xs12 sm12> |
360 | <v-layout> | 360 | <v-layout> |
361 | <v-flex x4 sm4 class="pt-4 subheading"> | 361 | <v-flex x4 sm4 class="pt-4 subheading"> |
362 | <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> | 362 | <label class="right hidden-xs-only hidden-sm-only">Select Class:</label> |
363 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> | 363 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Class:</label> |
364 | </v-flex> | 364 | </v-flex> |
365 | <v-flex xs8 sm8 class="ml-3"> | 365 | <v-flex xs8 sm8 class="ml-3"> |
366 | <v-select | 366 | <v-select |
367 | :items="addclass" | 367 | :items="addclass" |
368 | label="Select Class" | 368 | label="Select Class" |
369 | v-model="addAnnoucement.select" | 369 | v-model="addAnnoucement.select" |
370 | item-text="classNum" | 370 | item-text="classNum" |
371 | item-value="_id" | 371 | item-value="_id" |
372 | name="Select Class" | 372 | name="Select Class" |
373 | :rules="classRules" | 373 | :rules="classRules" |
374 | @change="getCourses(addAnnoucement.select)" | 374 | @change="getCourses(addAnnoucement.select)" |
375 | required | 375 | required |
376 | ></v-select> | 376 | ></v-select> |
377 | </v-flex> | 377 | </v-flex> |
378 | </v-layout> | 378 | </v-layout> |
379 | </v-flex> | 379 | </v-flex> |
380 | </v-layout> | 380 | </v-layout> |
381 | <v-layout wrap> | 381 | <v-layout wrap> |
382 | <v-flex xs12 sm12> | 382 | <v-flex xs12 sm12> |
383 | <v-layout> | 383 | <v-layout> |
384 | <v-flex xs4 sm4 class="pt-4 subheading"> | 384 | <v-flex xs4 sm4 class="pt-4 subheading"> |
385 | <label class="right hidden-xs-only hidden-sm-only">Course Name:</label> | 385 | <label class="right hidden-xs-only hidden-sm-only">Course Name:</label> |
386 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Course:</label> | 386 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Course:</label> |
387 | </v-flex> | 387 | </v-flex> |
388 | <v-flex xs8 sm8 class="ml-3"> | 388 | <v-flex xs8 sm8 class="ml-3"> |
389 | <v-select | 389 | <v-select |
390 | :items="courseData" | 390 | :items="courseData" |
391 | item-text="courseName" | 391 | item-text="courseName" |
392 | item-value="_id" | 392 | item-value="_id" |
393 | v-model="addAnnoucement.courseName" | 393 | v-model="addAnnoucement.courseName" |
394 | placeholder="fill your Course name" | 394 | placeholder="fill your Course name" |
395 | type="text" | 395 | type="text" |
396 | :rules="courseRules" | 396 | :rules="courseRules" |
397 | required | 397 | required |
398 | ></v-select> | 398 | ></v-select> |
399 | </v-flex> | 399 | </v-flex> |
400 | </v-layout> | 400 | </v-layout> |
401 | </v-flex> | 401 | </v-flex> |
402 | <v-flex xs12 sm12> | 402 | <v-flex xs12 sm12> |
403 | <v-layout> | 403 | <v-layout> |
404 | <v-flex xs4 sm4 class="pt-4 subheading"> | 404 | <v-flex xs4 sm4 class="pt-4 subheading"> |
405 | <label class="right hidden-xs-only hidden-sm-only">Discussion Type:</label> | 405 | <label class="right hidden-xs-only hidden-sm-only">Discussion Type:</label> |
406 | <label | 406 | <label |
407 | class="right hidden-lg-only hidden-md-only hidden-xl-only" | 407 | class="right hidden-lg-only hidden-md-only hidden-xl-only" |
408 | >DiscussionType:</label> | 408 | >DiscussionType:</label> |
409 | </v-flex> | 409 | </v-flex> |
410 | <v-flex xs8 sm8 class="ml-3"> | 410 | <v-flex xs8 sm8 class="ml-3"> |
411 | <v-text-field | 411 | <v-text-field |
412 | v-model="addAnnoucement.discussionType" | 412 | v-model="addAnnoucement.discussionType" |
413 | placeholder="fill your Course name" | 413 | placeholder="fill your Course name" |
414 | type="text" | 414 | type="text" |
415 | :rules="courseRules" | 415 | :rules="courseRules" |
416 | required | 416 | required |
417 | ></v-text-field> | 417 | ></v-text-field> |
418 | </v-flex> | 418 | </v-flex> |
419 | </v-layout> | 419 | </v-layout> |
420 | </v-flex> | 420 | </v-flex> |
421 | <v-flex xs12 sm12> | 421 | <v-flex xs12 sm12> |
422 | <v-layout> | 422 | <v-layout> |
423 | <v-flex xs4 class="pt-4 subheading"> | 423 | <v-flex xs4 class="pt-4 subheading"> |
424 | <label class="right hidden-xs-only hidden-sm-only">Upload Image:</label> | 424 | <label class="right hidden-xs-only hidden-sm-only">Upload Image:</label> |
425 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Upload :</label> | 425 | <label class="right hidden-lg-only hidden-md-only hidden-xl-only">Upload :</label> |
426 | </v-flex> | 426 | </v-flex> |
427 | <v-flex xs8 class="ml-3"> | 427 | <v-flex xs8 class="ml-3"> |
428 | <v-text-field | 428 | <v-text-field |
429 | label="Select Image" | 429 | label="Select Image" |
430 | @click="pickFile" | 430 | @click="pickFile" |
431 | v-model="imageName" | 431 | v-model="imageName" |
432 | append-icon="attach_file" | 432 | append-icon="attach_file" |
433 | ></v-text-field> | 433 | ></v-text-field> |
434 | </v-flex> | 434 | </v-flex> |
435 | </v-layout> | 435 | </v-layout> |
436 | </v-flex> | 436 | </v-flex> |
437 | </v-layout> | 437 | </v-layout> |
438 | <v-layout> | 438 | <v-layout> |
439 | <v-flex xs12 sm12> | 439 | <v-flex xs12 sm12> |
440 | <v-layout class="right"> | 440 | <v-layout class="right"> |
441 | <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> | 441 | <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> |
442 | </v-layout> | 442 | </v-layout> |
443 | </v-flex> | 443 | </v-flex> |
444 | </v-layout> | 444 | </v-layout> |
445 | </v-form> | 445 | </v-form> |
446 | </v-flex> | 446 | </v-flex> |
447 | </v-flex> | 447 | </v-flex> |
448 | </v-layout> | 448 | </v-layout> |
449 | </v-container> | 449 | </v-container> |
450 | </v-card> | 450 | </v-card> |
451 | </v-dialog> | 451 | </v-dialog> |
452 | <v-snackbar | 452 | <v-snackbar |
453 | :timeout="timeout" | 453 | :timeout="timeout" |
454 | :top="y === 'top'" | 454 | :top="y === 'top'" |
455 | :right="x === 'right'" | 455 | :right="x === 'right'" |
456 | :vertical="mode === 'vertical'" | 456 | :vertical="mode === 'vertical'" |
457 | v-model="snackbar" | 457 | v-model="snackbar" |
458 | :color="color" | 458 | :color="color" |
459 | >{{ text }}</v-snackbar> | 459 | >{{ text }}</v-snackbar> |
460 | <div class="loader" v-if="showLoader"> | 460 | <div class="loader" v-if="showLoader"> |
461 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 461 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
462 | </div> | 462 | </div> |
463 | </v-container> | 463 | </v-container> |
464 | </template> | 464 | </template> |
465 | 465 | ||
466 | <script> | 466 | <script> |
467 | import http from "@/Services/http.js"; | 467 | import http from "@/Services/http.js"; |
468 | import moment from "moment"; | 468 | import moment from "moment"; |
469 | import countryList from "@/script/country.js"; | 469 | import countryList from "@/script/country.js"; |
470 | import parent from "@/script/parents.js"; | 470 | import parent from "@/script/parents.js"; |
471 | 471 | ||
472 | export default { | 472 | export default { |
473 | data: () => ({ | 473 | data: () => ({ |
474 | showNext: false, | 474 | showNext: false, |
475 | snackbar: false, | 475 | snackbar: false, |
476 | y: "top", | 476 | y: "top", |
477 | x: "right", | 477 | x: "right", |
478 | role: "", | 478 | role: "", |
479 | mode: "", | 479 | mode: "", |
480 | append: "", | 480 | append: "", |
481 | timeout: 3000, | 481 | timeout: 3000, |
482 | text: "", | 482 | text: "", |
483 | show: true, | 483 | show: true, |
484 | color: "", | 484 | color: "", |
485 | showSearch: false, | 485 | showSearch: false, |
486 | showLoader: false, | 486 | showLoader: false, |
487 | loading: false, | 487 | loading: false, |
488 | editLoading: false, | 488 | editLoading: false, |
489 | date: null, | 489 | date: null, |
490 | search: "", | 490 | search: "", |
491 | menu: false, | 491 | menu: false, |
492 | menu1: false, | 492 | menu1: false, |
493 | editStudentDialog: false, | 493 | editStudentDialog: false, |
494 | profileStudentDialog: false, | 494 | profileStudentDialog: false, |
495 | addAnnoucementDialog: false, | 495 | addAnnoucementDialog: false, |
496 | valid: true, | 496 | valid: true, |
497 | addclass: [], | 497 | addclass: [], |
498 | addSection: [], | 498 | addSection: [], |
499 | pagination: { | 499 | pagination: { |
500 | rowsPerPage: 10, | 500 | rowsPerPage: 10, |
501 | }, | 501 | }, |
502 | imageData: {}, | 502 | imageData: {}, |
503 | imageName: "", | 503 | imageName: "", |
504 | imageUrl: "", | 504 | imageUrl: "", |
505 | imageFile: "", | 505 | imageFile: "", |
506 | editImageName: "", | 506 | editImageName: "", |
507 | editImageUrl: "", | 507 | editImageUrl: "", |
508 | courseRules: [(v) => !!v || " Course Name is required"], | 508 | courseRules: [(v) => !!v || " Course Name is required"], |
509 | classRules: [(v) => !!v || " Class Name is required"], | 509 | classRules: [(v) => !!v || " Class Name is required"], |
510 | sectionRules: [(v) => !!v || "Section Name is required"], | 510 | sectionRules: [(v) => !!v || "Section Name is required"], |
511 | errorMessages: "", | 511 | errorMessages: "", |
512 | headers: [ | 512 | headers: [ |
513 | { | 513 | { |
514 | text: "Image", | 514 | text: "Image", |
515 | value: "attachementUrl", | 515 | value: "attachementUrl", |
516 | sortable: false, | 516 | sortable: false, |
517 | align: "center", | 517 | align: "center", |
518 | }, | 518 | }, |
519 | { | 519 | { |
520 | text: "Discussion Type", | 520 | text: "Discussion Type", |
521 | value: "discussionType", | 521 | value: "discussionType", |
522 | sortable: false, | 522 | sortable: false, |
523 | align: "center", | 523 | align: "center", |
524 | }, | 524 | }, |
525 | { text: "Action", value: "", sortable: false, align: "center" }, | 525 | { text: "Action", value: "", sortable: false, align: "center" }, |
526 | ], | 526 | ], |
527 | courseData: [], | 527 | courseData: [], |
528 | editedIndex: -1, | 528 | editedIndex: -1, |
529 | addAnnoucement: { | 529 | addAnnoucement: { |
530 | select: "", | 530 | select: "", |
531 | }, | 531 | }, |
532 | selectAnnoucement: {}, | 532 | selectAnnoucement: {}, |
533 | editedItem: {}, | 533 | editedItem: {}, |
534 | annoucementData: [], | 534 | annoucementData: [], |
535 | }), | 535 | }), |
536 | methods: { | 536 | methods: { |
537 | getCourses(selectCourseId) { | 537 | getCourses(selectCourseId) { |
538 | this.showLoader = true; | 538 | this.showLoader = true; |
539 | http() | 539 | http() |
540 | .get("/getCourseesList", { | 540 | .get("/getCourseesList", { |
541 | params: { | 541 | params: { |
542 | classId: selectCourseId, | 542 | classId: selectCourseId, |
543 | }, | 543 | }, |
544 | }) | 544 | }) |
545 | .then((response) => { | 545 | .then((response) => { |
546 | this.courseData = response.data.data; | 546 | this.courseData = response.data.data; |
547 | this.showLoader = false; | 547 | this.showLoader = false; |
548 | }) | 548 | }) |
549 | .catch((err) => { | 549 | .catch((err) => { |
550 | console.log("err====>", err); | 550 | console.log("err====>", err); |
551 | this.showLoader = false; | 551 | this.showLoader = false; |
552 | }); | 552 | }); |
553 | }, | 553 | }, |
554 | getAnnoucementes() { | 554 | getAnnoucementes() { |
555 | this.showLoader = true; | 555 | this.showLoader = true; |
556 | http() | 556 | http() |
557 | .get("/getAnnoucementesList", { | 557 | .get("/getAnnoucementesList", { |
558 | params: { | 558 | params: { |
559 | courseId: this.selectAnnoucement.courseId, | 559 | courseId: this.selectAnnoucement.courseId, |
560 | classId: this.selectAnnoucement.classId, | 560 | classId: this.selectAnnoucement.classId, |
561 | }, | 561 | }, |
562 | }) | 562 | }) |
563 | .then((response) => { | 563 | .then((response) => { |
564 | this.annoucementData = response.data.data; | 564 | this.annoucementData = response.data.data; |
565 | this.showLoader = false; | 565 | this.showLoader = false; |
566 | }) | 566 | }) |
567 | .catch((err) => { | 567 | .catch((err) => { |
568 | console.log("err====>", err); | 568 | console.log("err====>", err); |
569 | this.showLoader = false; | 569 | this.showLoader = false; |
570 | }); | 570 | }); |
571 | }, | 571 | }, |
572 | // getSections(_id) { | 572 | // getSections(_id) { |
573 | // var token = this.$store.state.token; | 573 | // var token = this.$store.state.token; |
574 | // this.showLoader = true; | 574 | // this.showLoader = true; |
575 | // http() | 575 | // http() |
576 | // .get( | 576 | // .get( |
577 | // "/getSectionsList", | 577 | // "/getSectionsList", |
578 | // { params: { classId: _id } }, | 578 | // { params: { classId: _id } }, |
579 | // { | 579 | // { |
580 | // headers: { Authorization: "Bearer " + token } | 580 | // headers: { Authorization: "Bearer " + token } |
581 | // } | 581 | // } |
582 | // ) | 582 | // ) |
583 | // .then(response => { | 583 | // .then(response => { |
584 | // this.addSection = response.data.data; | 584 | // this.addSection = response.data.data; |
585 | // this.showLoader = false; | 585 | // this.showLoader = false; |
586 | // }) | 586 | // }) |
587 | // .catch(err => { | 587 | // .catch(err => { |
588 | // this.showLoader = false; | 588 | // this.showLoader = false; |
589 | // }); | 589 | // }); |
590 | // }, | 590 | // }, |
591 | pickFile() { | 591 | pickFile() { |
592 | this.$refs.image.click(); | 592 | this.$refs.image.click(); |
593 | }, | 593 | }, |
594 | pickEditFile() { | 594 | pickEditFile() { |
595 | this.$refs.editDataImage.click(); | 595 | this.$refs.editDataImage.click(); |
596 | }, | 596 | }, |
597 | dates: function (date) { | 597 | dates: function (date) { |
598 | return moment(date).format("MMMM DD, YYYY"); | 598 | return moment(date).format("MMMM DD, YYYY"); |
599 | return date; | 599 | return date; |
600 | }, | 600 | }, |
601 | onFilePicked(e) { | 601 | onFilePicked(e) { |
602 | // console.log(e) | 602 | // console.log(e) |
603 | const files = e.target.files; | 603 | const files = e.target.files; |
604 | this.imageData.upload = e.target.files[0]; | 604 | this.imageData.upload = e.target.files[0]; |
605 | if (files[0] !== undefined) { | 605 | if (files[0] !== undefined) { |
606 | this.imageName = files[0].name; | 606 | this.imageName = files[0].name; |
607 | if (this.imageName.lastIndexOf(".") <= 0) { | 607 | if (this.imageName.lastIndexOf(".") <= 0) { |
608 | return; | 608 | return; |
609 | } | 609 | } |
610 | const fr = new FileReader(); | 610 | const fr = new FileReader(); |
611 | fr.readAsDataURL(files[0]); | 611 | fr.readAsDataURL(files[0]); |
612 | fr.addEventListener("load", () => { | 612 | fr.addEventListener("load", () => { |
613 | this.imageUrl = fr.result; | 613 | this.imageUrl = fr.result; |
614 | this.imageFile = files[0]; // this is an image file that can be sent to server... | 614 | this.imageFile = files[0]; // this is an image file that can be sent to server... |
615 | this.imageData.imageUrl = URL.createObjectURL(this.imageFile); | 615 | this.imageData.imageUrl = URL.createObjectURL(this.imageFile); |
616 | }); | 616 | }); |
617 | } else { | 617 | } else { |
618 | this.imageName = ""; | 618 | this.imageName = ""; |
619 | this.imageFile = ""; | 619 | this.imageFile = ""; |
620 | this.imageUrl = ""; | 620 | this.imageUrl = ""; |
621 | } | 621 | } |
622 | }, | 622 | }, |
623 | onEditFilePicked(e) { | 623 | onEditFilePicked(e) { |
624 | console.log(e); | 624 | console.log(e); |
625 | const files = e.target.files; | 625 | const files = e.target.files; |
626 | if (files[0] !== undefined) { | 626 | if (files[0] !== undefined) { |
627 | this.editImageName = files[0].name; | 627 | this.editImageName = files[0].name; |
628 | if (this.editImageName.lastIndexOf(".") <= 0) { | 628 | if (this.editImageName.lastIndexOf(".") <= 0) { |
629 | return; | 629 | return; |
630 | } | 630 | } |
631 | const fr = new FileReader(); | 631 | const fr = new FileReader(); |
632 | fr.readAsDataURL(files[0]); | 632 | fr.readAsDataURL(files[0]); |
633 | fr.addEventListener("load", () => { | 633 | fr.addEventListener("load", () => { |
634 | this.editImageUrl = fr.result; | 634 | this.editImageUrl = fr.result; |
635 | this.editiImageFile = files[0]; // this is an image file that can be sent to server... | 635 | this.editiImageFile = files[0]; // this is an image file that can be sent to server... |
636 | }); | 636 | }); |
637 | } else { | 637 | } else { |
638 | this.editImageName = ""; | 638 | this.editImageName = ""; |
639 | this.editiImageFile = ""; | 639 | this.editiImageFile = ""; |
640 | } | 640 | } |
641 | }, | 641 | }, |
642 | editItem(item) { | 642 | editItem(item) { |
643 | this.editedIndex = this.courseData.indexOf(item); | 643 | this.editedIndex = this.courseData.indexOf(item); |
644 | this.editedItem = Object.assign({}, item); | 644 | this.editedItem = Object.assign({}, item); |
645 | this.editStudentDialog = true; | 645 | this.editStudentDialog = true; |
646 | }, | 646 | }, |
647 | profile(item) { | 647 | profile(item) { |
648 | this.editedIndex = this.courseData.indexOf(item); | 648 | this.editedIndex = this.courseData.indexOf(item); |
649 | this.editedItem = Object.assign({}, item); | 649 | this.editedItem = Object.assign({}, item); |
650 | this.profileStudentDialog = true; | 650 | this.profileStudentDialog = true; |
651 | }, | 651 | }, |
652 | deleteItem(item) { | 652 | deleteItem(item) { |
653 | let deleteAnnoucement = { | 653 | let deleteAnnoucement = { |
654 | annoucementId: item._id, | 654 | annoucementId: item._id, |
655 | }; | 655 | }; |
656 | http() | 656 | http() |
657 | .delete( | 657 | .delete( |
658 | "/deleteAnnoucement", | 658 | "/deleteAnnoucement", |
659 | confirm("Are you sure you want to delete this?") && { | 659 | confirm("Are you sure you want to delete this?") && { |
660 | params: deleteAnnoucement, | 660 | params: deleteAnnoucement, |
661 | } | 661 | } |
662 | ) | 662 | ) |
663 | .then((response) => { | 663 | .then((response) => { |
664 | this.snackbar = true; | 664 | this.snackbar = true; |
665 | this.text = response.data.message; | 665 | this.text = response.data.message; |
666 | this.color = "green"; | 666 | this.color = "green"; |
667 | this.getAnnoucementes(); | 667 | this.getAnnoucementes(); |
668 | }) | 668 | }) |
669 | .catch((error) => { | 669 | .catch((error) => { |
670 | this.snackbar = true; | 670 | this.snackbar = true; |
671 | this.text = error.response.data.message; | 671 | this.text = error.response.data.message; |
672 | this.color = "error"; | 672 | this.color = "error"; |
673 | }); | 673 | }); |
674 | }, | 674 | }, |
675 | close() { | 675 | close() { |
676 | this.editStudentDialog = false; | 676 | this.editStudentDialog = false; |
677 | }, | 677 | }, |
678 | closeStudentProfile() { | 678 | closeStudentProfile() { |
679 | this.profileStudentDialog = false; | 679 | this.profileStudentDialog = false; |
680 | }, | 680 | }, |
681 | rowAnnoucement(id) { | 681 | rowAnnoucement(id) { |
682 | this.$router.push({ | 682 | this.$router.push({ |
683 | name: "Annoucement Forum", | 683 | name: "Annoucement Forum", |
684 | params: { annoucementId: id }, | 684 | params: { annoucementId: id }, |
685 | }); | 685 | }); |
686 | }, | 686 | }, |
687 | submit() { | 687 | submit() { |
688 | if (this.$refs.form.validate()) { | 688 | if (this.$refs.form.validate()) { |
689 | let addCourse = { | 689 | let addCourse = { |
690 | classId: this.addAnnoucement.select, | 690 | classId: this.addAnnoucement.select, |
691 | sectionId: this.addAnnoucement.selectSection, | 691 | sectionId: this.addAnnoucement.selectSection, |
692 | discussionType: this.addAnnoucement.discussionType, | 692 | discussionType: this.addAnnoucement.discussionType, |
693 | courseId: this.addAnnoucement.courseName, | 693 | courseId: this.addAnnoucement.courseName, |
694 | }; | 694 | }; |
695 | if (this.imageUrl) { | 695 | if (this.imageUrl) { |
696 | var str = this.imageUrl; | 696 | var str = this.imageUrl; |
697 | const [baseUrl, imageUrl] = str.split(/,/); | 697 | const [baseUrl, imageUrl] = str.split(/,/); |
698 | addCourse.upload = imageUrl; | 698 | addCourse.upload = imageUrl; |
699 | } | 699 | } |
700 | this.loading = true; | 700 | this.loading = true; |
701 | http() | 701 | http() |
702 | .post("/createAnnoucement", addCourse) | 702 | .post("/createAnnoucement", addCourse) |
703 | .then((response) => { | 703 | .then((response) => { |
704 | this.snackbar = true; | 704 | this.snackbar = true; |
705 | this.text = "New Annoucement added successfully"; | 705 | this.text = "New Annoucement added successfully"; |
706 | this.color = "green"; | 706 | this.color = "green"; |
707 | this.addAnnoucementDialog = false; | 707 | this.addAnnoucementDialog = false; |
708 | this.clear(); | 708 | this.clear(); |
709 | this.loading = false; | 709 | this.loading = false; |
710 | }) | 710 | }) |
711 | .catch((error) => { | 711 | .catch((error) => { |
712 | this.snackbar = true; | 712 | this.snackbar = true; |
713 | this.text = error.response.data.message; | 713 | this.text = error.response.data.message; |
714 | this.color = "error"; | 714 | this.color = "error"; |
715 | this.loading = false; | 715 | this.loading = false; |
716 | }); | 716 | }); |
717 | } | 717 | } |
718 | }, | 718 | }, |
719 | clear() { | 719 | clear() { |
720 | this.$refs.form.reset(); | 720 | this.$refs.form.reset(); |
721 | this.imageUrl = ""; | 721 | this.imageUrl = ""; |
722 | }, | 722 | }, |
723 | save() { | 723 | save() { |
724 | let editAnnoucement = { | 724 | let editAnnoucement = { |
725 | annoucementId: this.editedItem._id, | 725 | annoucementId: this.editedItem._id, |
726 | discussionType: this.editedItem.discussionType, | 726 | discussionType: this.editedItem.discussionType, |
727 | classId: this.editedItem.select, | 727 | classId: this.editedItem.select, |
728 | courseId: this.editedItem.courseName, | 728 | courseId: this.editedItem.courseName, |
729 | }; | 729 | }; |
730 | if (this.editImageUrl) { | 730 | if (this.editImageUrl) { |
731 | var str = this.editImageUrl; | 731 | var str = this.editImageUrl; |
732 | const [baseUrl, editImageUrl] = str.split(/,/); | 732 | const [baseUrl, editImageUrl] = str.split(/,/); |
733 | editAnnoucement.upload = editImageUrl; | 733 | editAnnoucement.upload = editImageUrl; |
734 | } | 734 | } |
735 | this.editLoading = true; | 735 | this.editLoading = true; |
736 | http() | 736 | http() |
737 | .put("/updateAnnoucement", editAnnoucement) | 737 | .put("/updateAnnoucement", editAnnoucement) |
738 | .then((response) => { | 738 | .then((response) => { |
739 | this.snackbar = true; | 739 | this.snackbar = true; |
740 | this.text = response.data.message; | 740 | this.text = response.data.message; |
741 | this.color = "green"; | 741 | this.color = "green"; |
742 | this.imageUrl = ""; | 742 | this.imageUrl = ""; |
743 | this.getAnnoucementes(); | 743 | this.getAnnoucementes(); |
744 | this.close(); | 744 | this.close(); |
745 | this.editLoading = false; | 745 | this.editLoading = false; |
746 | }) | 746 | }) |
747 | .catch((error) => { | 747 | .catch((error) => { |
748 | this.snackbar = true; | 748 | this.snackbar = true; |
749 | this.text = error.response.data.statusText; | 749 | this.text = error.response.data.statusText; |
750 | this.color = "error"; | 750 | this.color = "error"; |
751 | this.editLoading = false; | 751 | this.editLoading = false; |
752 | }); | 752 | }); |
753 | }, | 753 | }, |
754 | displaySearch() { | 754 | displaySearch() { |
755 | this.show = false; | 755 | this.show = false; |
756 | this.showSearch = true; | 756 | this.showSearch = true; |
757 | }, | 757 | }, |
758 | closeSearch() { | 758 | closeSearch() { |
759 | this.showSearch = false; | 759 | this.showSearch = false; |
760 | this.show = true; | 760 | this.show = true; |
761 | this.search = ""; | 761 | this.search = ""; |
762 | }, | 762 | }, |
763 | }, | 763 | }, |
764 | mounted() { | 764 | mounted() { |
765 | var token = this.$store.state.token; | 765 | var token = this.$store.state.token; |
766 | http() | 766 | http() |
767 | .get("/getClassesList", { | 767 | .get("/getClassesList", { |
768 | headers: { Authorization: "Bearer " + token }, | 768 | headers: { Authorization: "Bearer " + token }, |
769 | }) | 769 | }) |
770 | .then((response) => { | 770 | .then((response) => { |
771 | this.addclass = response.data.data; | 771 | this.addclass = response.data.data; |
772 | }) | 772 | }) |
773 | .catch((error) => { | 773 | .catch((error) => { |
774 | this.showLoader = false; | 774 | this.showLoader = false; |
775 | if (error.response.status === 401) { | 775 | if (error.response.status === 401) { |
776 | this.$router.replace({ path: "/" }); | 776 | this.$router.replace({ path: "/" }); |
777 | this.$store.dispatch("setToken", null); | 777 | this.$store.dispatch("setToken", null); |
778 | this.$store.dispatch("Id", null); | 778 | this.$store.dispatch("Id", null); |
779 | this.$store.dispatch("Role", null); | 779 | this.$store.dispatch("Role", null); |
780 | } | 780 | } |
781 | }); | 781 | }); |
782 | }, | 782 | }, |
783 | }; | 783 | }; |
784 | </script> | 784 | </script> |
785 | <style> | 785 | <style> |
786 | .row-click { | 786 | .row-click { |
787 | cursor: pointer; | 787 | cursor: pointer; |
788 | } | 788 | } |
789 | </style> | 789 | </style> |
src/pages/Attendence/studentAttendence.vue
1 | <template> | 1 | <template> |
2 | <v-container fluid class="body-color"> | 2 | <v-container fluid class="body-color"> |
3 | <v-snackbar | 3 | <v-snackbar |
4 | :timeout="timeout" | 4 | :timeout="timeout" |
5 | :top="y === 'top'" | 5 | :top="y === 'top'" |
6 | :right="x === 'right'" | 6 | :right="x === 'right'" |
7 | :vertical="mode === 'vertical'" | 7 | :vertical="mode === 'vertical'" |
8 | v-model="snackbar" | 8 | v-model="snackbar" |
9 | color="success" | 9 | color="success" |
10 | >{{ text }}</v-snackbar> | 10 | >{{ text }}</v-snackbar> |
11 | <!-- ****** ATTENDENCE STUDENTS TABLE ****** --> | 11 | <!-- ****** ATTENDENCE STUDENTS TABLE ****** --> |
12 | <!-- <download-csv :data="json_data"> | 12 | <!-- <download-csv :data="json_data"> |
13 | <v-btn>Download Data</v-btn> | 13 | <v-btn>Download Data</v-btn> |
14 | </download-csv>--> | 14 | </download-csv>--> |
15 | <v-toolbar color="transparent" flat> | 15 | <v-toolbar color="transparent" flat> |
16 | <v-btn | 16 | <v-btn |
17 | fab | 17 | fab |
18 | dark | 18 | dark |
19 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | 19 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" |
20 | small | 20 | small |
21 | @click="addStudentAttendenceDialog = true" | 21 | @click="addStudentAttendenceDialog = true" |
22 | > | 22 | > |
23 | <v-icon dark>add</v-icon> | 23 | <v-icon dark>add</v-icon> |
24 | </v-btn> | 24 | </v-btn> |
25 | <v-btn | 25 | <v-btn |
26 | v-if="role != 'ADMIN' && schoolRole != 'SCHOOLADMIN' " | 26 | v-if="role != 'ADMIN' && schoolRole != 'SCHOOLADMIN' " |
27 | round | 27 | round |
28 | class="open-dialog-button hidden-sm-only hidden-xs-only" | 28 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
29 | dark | 29 | dark |
30 | @click="addStudentAttendenceDialog = true" | 30 | @click="addStudentAttendenceDialog = true" |
31 | > | 31 | > |
32 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student Attendence | 32 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Student Attendence |
33 | </v-btn> | 33 | </v-btn> |
34 | 34 | ||
35 | <v-spacer></v-spacer> | 35 | <v-spacer></v-spacer> |
36 | <v-flex xs12 sm4 md2> | 36 | <v-flex xs12 sm4 md2> |
37 | <v-select | 37 | <v-select |
38 | small | 38 | small |
39 | :items="addclass" | 39 | :items="addclass" |
40 | label="Select Class" | 40 | label="Select Class" |
41 | v-model="getAttendence.classId" | 41 | v-model="getAttendence.classId" |
42 | item-text="classNum" | 42 | item-text="classNum" |
43 | item-value="_id" | 43 | item-value="_id" |
44 | name="Select Class" | 44 | name="Select Class" |
45 | @change="getSection(getAttendence.classId)" | 45 | @change="getSection(getAttendence.classId)" |
46 | class="px-2" | 46 | class="px-2" |
47 | required | 47 | required |
48 | ></v-select> | 48 | ></v-select> |
49 | </v-flex> | 49 | </v-flex> |
50 | <v-flex xs12 sm4 md2> | 50 | <v-flex xs12 sm4 md2> |
51 | <v-select | 51 | <v-select |
52 | small | 52 | small |
53 | :items="addSection" | 53 | :items="addSection" |
54 | label="Select Section" | 54 | label="Select Section" |
55 | v-model="getAttendence.sectionId" | 55 | v-model="getAttendence.sectionId" |
56 | item-text="name" | 56 | item-text="name" |
57 | item-value="_id" | 57 | item-value="_id" |
58 | name="Select Section" | 58 | name="Select Section" |
59 | @change="getStudents(getAttendence.sectionId)" | 59 | @change="getStudents(getAttendence.sectionId)" |
60 | class="px-2" | 60 | class="px-2" |
61 | required | 61 | required |
62 | ></v-select> | 62 | ></v-select> |
63 | </v-flex> | 63 | </v-flex> |
64 | <v-card-title class="body-1" v-show="show"> | 64 | <v-card-title class="body-1" v-show="show"> |
65 | <v-btn icon large flat @click="displaySearch"> | 65 | <v-btn icon large flat @click="displaySearch"> |
66 | <v-avatar size="27"> | 66 | <v-avatar size="27"> |
67 | <img src="/static/icon/search.png" alt="icon" /> | 67 | <img src="/static/icon/search.png" alt="icon" /> |
68 | </v-avatar> | 68 | </v-avatar> |
69 | </v-btn> | 69 | </v-btn> |
70 | </v-card-title> | 70 | </v-card-title> |
71 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> | 71 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
72 | <v-layout> | 72 | <v-layout> |
73 | <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | 73 | <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> |
74 | <v-icon @click="closeSearch" color="error">close</v-icon> | 74 | <v-icon @click="closeSearch" color="error">close</v-icon> |
75 | </v-layout> | 75 | </v-layout> |
76 | </v-flex> | 76 | </v-flex> |
77 | </v-toolbar> | 77 | </v-toolbar> |
78 | <v-data-table | 78 | <v-data-table |
79 | :headers="headers" | 79 | :headers="headers" |
80 | :items="studentsData" | 80 | :items="studentsData" |
81 | :pagination.sync="pagination" | 81 | :pagination.sync="pagination" |
82 | :search="search" | 82 | :search="search" |
83 | > | 83 | > |
84 | <template slot="items" slot-scope="props"> | 84 | <template slot="items" slot-scope="props"> |
85 | <tr class="tr"> | 85 | <tr class="tr"> |
86 | <td class="td td-row">{{ props.index + 1}}</td> | 86 | <td class="td td-row">{{ props.index + 1}}</td> |
87 | <td class="text-xs-center td td-row"> | 87 | <td class="text-xs-center td td-row"> |
88 | <v-avatar size="40"> | 88 | <v-avatar size="40"> |
89 | <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | 89 | <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> |
90 | <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | 90 | <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> |
91 | </v-avatar> | 91 | </v-avatar> |
92 | </td> | 92 | </td> |
93 | <td class="text-xs-center td td-row">{{ props.item.name}}</td> | 93 | <td class="text-xs-center td td-row">{{ props.item.name}}</td> |
94 | <td class="text-xs-center td td-row">{{ props.item.fatherCellNo}}</td> | 94 | <td class="text-xs-center td td-row">{{ props.item.fatherCellNo}}</td> |
95 | <td class="text-xs-center td td-row">{{ props.item.email }}</td> | 95 | <td class="text-xs-center td td-row">{{ props.item.email }}</td> |
96 | <td class="text-xs-center td td-row"> | 96 | <td class="text-xs-center td td-row"> |
97 | <router-link :to="{ name:'View Students Attendence',params: { id:props.item._id } }"> | 97 | <router-link :to="{ name:'View Students Attendence',params: { id:props.item._id } }"> |
98 | <v-tooltip top> | 98 | <v-tooltip top> |
99 | <img | 99 | <img |
100 | slot="activator" | 100 | slot="activator" |
101 | style="cursor:pointer; width:20px; height:25px; " | 101 | style="cursor:pointer; width:20px; height:25px; " |
102 | class="mr-3" | 102 | class="mr-3" |
103 | src="/static/icon/view.png" | 103 | src="/static/icon/view.png" |
104 | /> | 104 | /> |
105 | <span>View</span> | 105 | <span>View</span> |
106 | </v-tooltip> | 106 | </v-tooltip> |
107 | </router-link> | 107 | </router-link> |
108 | </td> | 108 | </td> |
109 | </tr> | 109 | </tr> |
110 | </template> | 110 | </template> |
111 | <v-alert | 111 | <v-alert |
112 | slot="no-results" | 112 | slot="no-results" |
113 | :value="true" | 113 | :value="true" |
114 | color="error" | 114 | color="error" |
115 | icon="warning" | 115 | icon="warning" |
116 | >Your search for "{{ search }}" found no results.</v-alert> | 116 | >Your search for "{{ search }}" found no results.</v-alert> |
117 | </v-data-table> | 117 | </v-data-table> |
118 | <!-- ****** Add Students Attendece****** --> | 118 | <!-- ****** Add Students Attendece****** --> |
119 | <v-dialog v-model="addStudentAttendenceDialog" width="1600"> | 119 | <v-dialog v-model="addStudentAttendenceDialog" width="1600"> |
120 | <v-card flat class="pa-2"> | 120 | <v-card flat class="pa-2"> |
121 | <v-layout> | 121 | <v-layout> |
122 | <v-flex xs12> | 122 | <v-flex xs12> |
123 | <label class="title text-xs-center">Add Student Attendence</label> | 123 | <label class="title text-xs-center">Add Student Attendence</label> |
124 | <v-icon size="24" class="right" @click="addStudentAttendenceDialog = false">cancel</v-icon> | 124 | <v-icon size="24" class="right" @click="$refs.form.reset();addStudentAttendenceDialog = false">cancel</v-icon> |
125 | </v-flex> | 125 | </v-flex> |
126 | </v-layout> | 126 | </v-layout> |
127 | <v-flex xs12 class="mt-4"> | 127 | <v-flex xs12 class="mt-4"> |
128 | <v-form ref="form" v-model="valid" lazy-validation> | 128 | <v-form ref="form" v-model="valid" lazy-validation> |
129 | <v-flex xs12 sm12 lg12> | 129 | <v-flex xs12 sm12 lg12> |
130 | <v-layout wrap> | 130 | <v-layout wrap> |
131 | <v-flex xs6 sm6 lg3 md4> | 131 | <v-flex xs6 sm6 lg3 md4> |
132 | <v-layout> | 132 | <v-layout> |
133 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> | 133 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> |
134 | <label class="right">Class:</label> | 134 | <label class="right">Class:</label> |
135 | </v-flex> | 135 | </v-flex> |
136 | <v-flex xs9 sm6 lg8 class="ml-2"> | 136 | <v-flex xs9 sm6 lg8 class="ml-2"> |
137 | <v-select | 137 | <v-select |
138 | v-model="getReport.classId" | 138 | v-model="getReport.classId" |
139 | label="Select your class" | 139 | label="Select your class" |
140 | type="text" | 140 | type="text" |
141 | :items="addclass" | 141 | :items="addclass" |
142 | item-text="classNum" | 142 | item-text="classNum" |
143 | item-value="_id" | 143 | item-value="_id" |
144 | :rules="classRules" | 144 | :rules="classRules" |
145 | @change="getSection(getReport.classId)" | 145 | @change="getSection(getReport.classId)" |
146 | required | 146 | required |
147 | ></v-select> | 147 | ></v-select> |
148 | </v-flex> | 148 | </v-flex> |
149 | </v-layout> | 149 | </v-layout> |
150 | </v-flex> | 150 | </v-flex> |
151 | <v-flex xs6 sm6 lg3 md8> | 151 | <v-flex xs6 sm6 lg3 md8> |
152 | <v-layout> | 152 | <v-layout> |
153 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> | 153 | <v-flex xs3 sm6 lg2 class="subheading mt-4"> |
154 | <label class="right">Section:</label> | 154 | <label class="right">Section:</label> |
155 | </v-flex> | 155 | </v-flex> |
156 | <v-flex xs9 sm6 lg8 class="ml-2"> | 156 | <v-flex xs9 sm6 lg8 class="ml-2"> |
157 | <v-select | 157 | <v-select |
158 | :items="addSection" | 158 | :items="addSection" |
159 | label="Select your Section" | 159 | label="Select your Section" |
160 | v-model="getReport.sectionId" | 160 | v-model="getReport.sectionId" |
161 | item-text="name" | 161 | item-text="name" |
162 | item-value="_id" | 162 | item-value="_id" |
163 | name="Select Section" | 163 | name="Select Section" |
164 | :rules="sectionRules" | 164 | :rules="sectionRules" |
165 | required | 165 | required |
166 | ></v-select> | 166 | ></v-select> |
167 | </v-flex> | 167 | </v-flex> |
168 | </v-layout> | 168 | </v-layout> |
169 | </v-flex> | 169 | </v-flex> |
170 | <v-flex xs6 sm6 lg3 md4> | 170 | <v-flex xs6 sm6 lg3 md4> |
171 | <v-menu | 171 | <v-menu |
172 | ref="menu" | 172 | ref="menu" |
173 | :close-on-content-click="false" | 173 | :close-on-content-click="false" |
174 | v-model="menu" | 174 | v-model="menu" |
175 | :nudge-right="40" | 175 | :nudge-right="40" |
176 | lazy | 176 | lazy |
177 | transition="scale-transition" | 177 | transition="scale-transition" |
178 | offset-y | 178 | offset-y |
179 | full-width | 179 | full-width |
180 | min-width="290px" | 180 | min-width="290px" |
181 | > | 181 | > |
182 | <v-text-field | 182 | <v-text-field |
183 | slot="activator" | 183 | slot="activator" |
184 | v-model="date" | 184 | v-model="date" |
185 | label="Select Date" | 185 | label="Select Date" |
186 | append-icon="event" | 186 | append-icon="event" |
187 | :rules="dataValid" | 187 | :rules="dataValid" |
188 | readonly | 188 | readonly |
189 | ></v-text-field> | 189 | ></v-text-field> |
190 | <v-date-picker | 190 | <v-date-picker |
191 | ref="picker" | 191 | ref="picker" |
192 | v-model="date" | 192 | v-model="date" |
193 | :max="new Date().toISOString().substr(0, 10)" | 193 | :max="new Date().toISOString().substr(0, 10)" |
194 | min="1950-01-01" | 194 | min="1950-01-01" |
195 | @change="save" | 195 | @change="save" |
196 | ></v-date-picker> | 196 | ></v-date-picker> |
197 | </v-menu> | 197 | </v-menu> |
198 | </v-flex> | 198 | </v-flex> |
199 | <v-flex xs6 sm6 lg9 md8> | 199 | <v-flex xs6 sm6 lg9 md8> |
200 | <v-btn round dark class="add-button" @click="showTable">Attendence</v-btn> | 200 | <v-btn round dark class="add-button" @click="showTable">Attendence</v-btn> |
201 | </v-flex> | 201 | </v-flex> |
202 | </v-layout> | 202 | </v-layout> |
203 | </v-flex> | 203 | </v-flex> |
204 | </v-form> | 204 | </v-form> |
205 | </v-flex> | 205 | </v-flex> |
206 | <v-flex xs12 v-show="attendeceTable" class> | 206 | <v-flex xs12 v-show="attendeceTable" class> |
207 | <v-data-table | 207 | <v-data-table |
208 | :headers="headers" | 208 | :headers="headers" |
209 | :items="studentsData" | 209 | :items="studentsData" |
210 | :pagination.sync="pagination" | 210 | :pagination.sync="pagination" |
211 | :search="search" | 211 | :search="search" |
212 | > | 212 | > |
213 | <template slot="items" slot-scope="props"> | 213 | <template slot="items" slot-scope="props"> |
214 | <tr class="tr"> | 214 | <tr class="tr"> |
215 | <td class="td td-row">{{ props.index + 1}}</td> | 215 | <td class="td td-row">{{ props.index + 1}}</td> |
216 | <td class="text-xs-center td td-row"> | 216 | <td class="text-xs-center td td-row"> |
217 | <v-avatar size="40"> | 217 | <v-avatar size="40"> |
218 | <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> | 218 | <img :src="props.item.profilePicUrl" v-if="props.item.profilePicUrl" /> |
219 | <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> | 219 | <img src="/static/icon/user.png" v-else-if="!props.item.profilePicUrl" /> |
220 | </v-avatar> | 220 | </v-avatar> |
221 | </td> | 221 | </td> |
222 | <td class="text-xs-center td td-row">{{ props.item.name}}</td> | 222 | <td class="text-xs-center td td-row">{{ props.item.name}}</td> |
223 | <td class="text-xs-center td td-row">{{ props.item.fatherCellNo }}</td> | 223 | <td class="text-xs-center td td-row">{{ props.item.fatherCellNo }}</td> |
224 | <td class="text-xs-center td td-row">{{ props.item.email }}</td> | 224 | <td class="text-xs-center td td-row">{{ props.item.email }}</td> |
225 | <td class="text-xs-center td td-row"> | 225 | <td class="text-xs-center td td-row"> |
226 | <v-radio-group v-model="props.item.attendence" :mandatory="false" row> | 226 | <v-radio-group v-model="props.item.attendence" :mandatory="false" row> |
227 | <v-radio | 227 | <v-radio |
228 | v-for="attendences in attendenceType" | 228 | v-for="attendences in attendenceType" |
229 | :key="attendences.value" | 229 | :key="attendences.value" |
230 | :label="`${attendences.label}`" | 230 | :label="`${attendences.label}`" |
231 | :value="attendences.value" | 231 | :value="attendences.value" |
232 | ></v-radio> | 232 | ></v-radio> |
233 | </v-radio-group> | 233 | </v-radio-group> |
234 | </td> | 234 | </td> |
235 | </tr> | 235 | </tr> |
236 | </template> | 236 | </template> |
237 | </v-data-table> | 237 | </v-data-table> |
238 | <v-flex xs12> | 238 | <v-flex xs12> |
239 | <v-card-actions> | 239 | <v-card-actions> |
240 | <v-spacer></v-spacer> | 240 | <v-spacer></v-spacer> |
241 | <v-btn @click="update()" class="add-button" round dark>Submit</v-btn> | 241 | <v-btn @click="update()" class="add-button" round dark>Submit</v-btn> |
242 | </v-card-actions> | 242 | </v-card-actions> |
243 | </v-flex> | 243 | </v-flex> |
244 | </v-flex> | 244 | </v-flex> |
245 | </v-card> | 245 | </v-card> |
246 | </v-dialog> | 246 | </v-dialog> |
247 | <v-snackbar | 247 | <v-snackbar |
248 | :timeout="timeout" | 248 | :timeout="timeout" |
249 | :top="y === 'top'" | 249 | :top="y === 'top'" |
250 | :right="x === 'right'" | 250 | :right="x === 'right'" |
251 | :vertical="mode === 'vertical'" | 251 | :vertical="mode === 'vertical'" |
252 | v-model="snackbar" | 252 | v-model="snackbar" |
253 | color="success" | 253 | color="success" |
254 | >{{ text }}</v-snackbar> | 254 | >{{ text }}</v-snackbar> |
255 | <div class="loader" v-if="showLoader"> | 255 | <div class="loader" v-if="showLoader"> |
256 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 256 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
257 | </div> | 257 | </div> |
258 | </v-container> | 258 | </v-container> |
259 | </template> | 259 | </template> |
260 | 260 | ||
261 | <script> | 261 | <script> |
262 | import http from "@/Services/http.js"; | 262 | import http from "@/Services/http.js"; |
263 | import moment from "moment"; | 263 | import moment from "moment"; |
264 | 264 | ||
265 | export default { | 265 | export default { |
266 | data: () => ({ | 266 | data: () => ({ |
267 | snackbar: false, | 267 | snackbar: false, |
268 | y: "top", | 268 | y: "top", |
269 | x: "right", | 269 | x: "right", |
270 | mode: "", | 270 | mode: "", |
271 | timeout: 3000, | 271 | timeout: 3000, |
272 | text: "", | 272 | text: "", |
273 | show: true, | 273 | show: true, |
274 | showSearch: false, | 274 | showSearch: false, |
275 | showLoader: false, | 275 | showLoader: false, |
276 | loading: false, | 276 | loading: false, |
277 | date: null, | 277 | date: null, |
278 | search: "", | 278 | search: "", |
279 | addclass: [], | 279 | addclass: [], |
280 | pagination: { | 280 | pagination: { |
281 | rowsPerPage: 10, | 281 | rowsPerPage: 10, |
282 | }, | 282 | }, |
283 | imageData: {}, | 283 | imageData: {}, |
284 | imageName: "", | 284 | imageName: "", |
285 | imageUrl: "", | 285 | imageUrl: "", |
286 | imageFile: "", | 286 | imageFile: "", |
287 | headers: [ | 287 | headers: [ |
288 | { | 288 | { |
289 | text: "No", | 289 | text: "No", |
290 | align: "", | 290 | align: "", |
291 | sortable: false, | 291 | sortable: false, |
292 | value: "index", | 292 | value: "index", |
293 | }, | 293 | }, |
294 | { | 294 | { |
295 | text: "Profile Pic", | 295 | text: "Profile Pic", |
296 | value: "profilprofilePicUrlePicUrl", | 296 | value: "profilprofilePicUrlePicUrl", |
297 | sortable: false, | 297 | sortable: false, |
298 | align: "center", | 298 | align: "center", |
299 | }, | 299 | }, |
300 | { text: "Name", value: "name", sortable: false, align: "center" }, | 300 | { text: "Name", value: "name", sortable: false, align: "center" }, |
301 | { | 301 | { |
302 | text: "Mobile No", | 302 | text: "Mobile No", |
303 | value: "fatherCellNo", | 303 | value: "fatherCellNo", |
304 | sortable: false, | 304 | sortable: false, |
305 | align: "center", | 305 | align: "center", |
306 | }, | 306 | }, |
307 | { text: "Email", value: "email", sortable: false, align: "center" }, | 307 | { text: "Email", value: "email", sortable: false, align: "center" }, |
308 | { text: "Attendance", value: "", sortable: false, align: "center" }, | 308 | { text: "Attendance", value: "", sortable: false, align: "center" }, |
309 | ], | 309 | ], |
310 | // json_data: [], | 310 | // json_data: [], |
311 | parentId: "", | 311 | parentId: "", |
312 | token: "", | 312 | token: "", |
313 | selectStudents: { | 313 | selectStudents: { |
314 | select: "", | 314 | select: "", |
315 | selectSection: "", | 315 | selectSection: "", |
316 | }, | 316 | }, |
317 | 317 | ||
318 | role: "", | 318 | role: "", |
319 | schoolRole: "", | 319 | schoolRole: "", |
320 | addStudentAttendenceDialog: false, | 320 | addStudentAttendenceDialog: false, |
321 | attendeceTable: false, | 321 | attendeceTable: false, |
322 | menu: false, | 322 | menu: false, |
323 | valid: true, | 323 | valid: true, |
324 | 324 | ||
325 | getReport: {}, | 325 | getReport: {}, |
326 | getAttendence: {}, | 326 | getAttendence: {}, |
327 | studentsList: [], | 327 | studentsList: [], |
328 | studentsData: [], | 328 | studentsData: [], |
329 | addSection: [], | 329 | addSection: [], |
330 | 330 | ||
331 | SectionName: ["A", "B", "C", "D", "E", "F"], | 331 | SectionName: ["A", "B", "C", "D", "E", "F"], |
332 | classRules: [(v) => !!v || "Class is required"], | 332 | classRules: [(v) => !!v || "Class is required"], |
333 | sectionRules: [(v) => !!v || "Class is required"], | 333 | sectionRules: [(v) => !!v || "Class is required"], |
334 | studentRules: [(v) => !!v || "Student is required"], | 334 | studentRules: [(v) => !!v || "Student is required"], |
335 | dataValid: [(v) => !!v || "Date is required"], | 335 | dataValid: [(v) => !!v || "Date is required"], |
336 | 336 | ||
337 | attendenceType: [ | 337 | attendenceType: [ |
338 | { | 338 | { |
339 | label: "Present", | 339 | label: "Present", |
340 | value: true, | 340 | value: true, |
341 | }, | 341 | }, |
342 | { | 342 | { |
343 | label: "Absent", | 343 | label: "Absent", |
344 | value: false, | 344 | value: false, |
345 | }, | 345 | }, |
346 | ], | 346 | ], |
347 | }), | 347 | }), |
348 | methods: { | 348 | methods: { |
349 | save(date) { | 349 | save(date) { |
350 | this.$refs.menu.save(date); | 350 | this.$refs.menu.save(date); |
351 | }, | 351 | }, |
352 | showTable() { | 352 | showTable() { |
353 | this.attendeceTable = true; | 353 | this.attendeceTable = true; |
354 | this.getStudents(); | 354 | this.getStudents(); |
355 | }, | 355 | }, |
356 | getAllClass() { | 356 | getAllClass() { |
357 | http() | 357 | http() |
358 | .get("/getClassesList", { | 358 | .get("/getClassesList", { |
359 | headers: { Authorization: "Bearer " + this.token }, | 359 | headers: { Authorization: "Bearer " + this.token }, |
360 | }) | 360 | }) |
361 | .then((response) => { | 361 | .then((response) => { |
362 | this.addclass = response.data.data; | 362 | this.addclass = response.data.data; |
363 | }) | 363 | }) |
364 | .catch((error) => { | 364 | .catch((error) => { |
365 | // console.log("err====>", err); | 365 | // console.log("err====>", err); |
366 | // this.$router.replace({ path: "/" }); | 366 | // this.$router.replace({ path: "/" }); |
367 | }); | 367 | }); |
368 | }, | 368 | }, |
369 | getSection(_id) { | 369 | getSection(_id) { |
370 | this.showLoader = true; | 370 | this.showLoader = true; |
371 | http() | 371 | http() |
372 | .get( | 372 | .get( |
373 | "/getSectionsList", | 373 | "/getSectionsList", |
374 | { params: { classId: _id } }, | 374 | { params: { classId: _id } }, |
375 | { | 375 | { |
376 | headers: { Authorization: "Bearer " + this.token }, | 376 | headers: { Authorization: "Bearer " + this.token }, |
377 | } | 377 | } |
378 | ) | 378 | ) |
379 | .then((response) => { | 379 | .then((response) => { |
380 | this.addSection = response.data.data; | 380 | this.addSection = response.data.data; |
381 | this.showLoader = false; | 381 | this.showLoader = false; |
382 | }) | 382 | }) |
383 | .catch((err) => { | 383 | .catch((err) => { |
384 | this.showLoader = false; | 384 | this.showLoader = false; |
385 | // console.log("err====>", err); | 385 | // console.log("err====>", err); |
386 | }); | 386 | }); |
387 | }, | 387 | }, |
388 | getStudents(_id) { | 388 | getStudents(_id) { |
389 | this.showLoader = true; | 389 | this.showLoader = true; |
390 | http() | 390 | http() |
391 | .get("/getStudentWithClass", { | 391 | .get("/getStudentWithClass", { |
392 | params: { | 392 | params: { |
393 | classId: this.getAttendence.classId, | 393 | classId: this.getAttendence.classId, |
394 | sectionId: this.getAttendence.sectionId, | 394 | sectionId: this.getAttendence.sectionId, |
395 | }, | 395 | }, |
396 | }) | 396 | }) |
397 | .then((response) => { | 397 | .then((response) => { |
398 | this.studentsData = response.data.data; | 398 | this.studentsData = response.data.data; |
399 | this.showLoader = false; | 399 | this.showLoader = false; |
400 | // this.addStudentAttendenceDialog = false; | 400 | // this.addStudentAttendenceDialog = false; |
401 | var attendence = ""; | 401 | var attendence = ""; |
402 | for (let i = 0; i < this.studentsData.length; i++) { | 402 | for (let i = 0; i < this.studentsData.length; i++) { |
403 | this.studentsData[i].attendence = true; | 403 | this.studentsData[i].attendence = true; |
404 | } | 404 | } |
405 | }) | 405 | }) |
406 | .catch((error) => { | 406 | .catch((error) => { |
407 | console.log("err====>", error); | 407 | console.log("err====>", error); |
408 | this.showLoader = false; | 408 | this.showLoader = false; |
409 | }); | 409 | }); |
410 | }, | 410 | }, |
411 | update() { | 411 | update() { |
412 | var studentsAttendence = []; | 412 | var studentsAttendence = []; |
413 | for (var j = 0; j < this.studentsData.length; j++) { | 413 | for (var j = 0; j < this.studentsData.length; j++) { |
414 | studentsAttendence.push({ | 414 | studentsAttendence.push({ |
415 | studentId: this.studentsData[j]._id, | 415 | studentId: this.studentsData[j]._id, |
416 | isPresent: this.studentsData[j].attendence, | 416 | isPresent: this.studentsData[j].attendence, |
417 | }); | 417 | }); |
418 | } | 418 | } |
419 | if (this.$refs.form.validate()) { | 419 | if (this.$refs.form.validate()) { |
420 | let attendanceData = { | 420 | let attendanceData = { |
421 | sectionId: this.getReport.sectionId, | 421 | sectionId: this.getReport.sectionId, |
422 | date: this.date, | 422 | date: this.date, |
423 | students: studentsAttendence, | 423 | students: studentsAttendence, |
424 | }; | 424 | }; |
425 | http() | 425 | http() |
426 | .put("/updateAttendance", attendanceData) | 426 | .put("/updateAttendance", attendanceData) |
427 | .then((response) => { | 427 | .then((response) => { |
428 | this.snackbar = true; | 428 | this.snackbar = true; |
429 | this.text = response.data.message; | 429 | this.text = response.data.message; |
430 | this.addStudentAttendenceDialog = false; | 430 | this.addStudentAttendenceDialog = false; |
431 | }) | 431 | }) |
432 | .catch((error) => { | 432 | .catch((error) => { |
433 | this.snackbar = true; | 433 | this.snackbar = true; |
434 | this.text = error.response.data.message; | 434 | this.text = error.response.data.message; |
435 | }); | 435 | }); |
436 | } | 436 | } |
437 | }, | 437 | }, |
438 | 438 | ||
439 | displaySearch() { | 439 | displaySearch() { |
440 | (this.show = false), (this.showSearch = true); | 440 | this.show = false |
441 | this.showSearch = true; | ||
441 | }, | 442 | }, |
442 | closeSearch() { | 443 | closeSearch() { |
443 | this.showSearch = false; | 444 | this.showSearch = false; |
444 | this.show = true; | 445 | this.show = true; |
445 | this.search = ""; | 446 | this.search = ""; |
446 | }, | 447 | }, |
447 | }, | 448 | }, |
448 | mounted() { | 449 | mounted() { |
449 | // this.getStudentList(); | 450 | // this.getStudentList(); |
450 | this.token = this.$store.state.token; | 451 | this.token = this.$store.state.token; |
451 | this.getAllClass(); | 452 | this.getAllClass(); |
452 | this.role = this.$store.state.role; | 453 | this.role = this.$store.state.role; |
453 | }, | 454 | }, |
454 | }; | 455 | }; |
455 | </script> | 456 | </script> |
src/pages/Library/books.vue
1 | <template> | 1 | <template> |
2 | <v-container fluid class="body-color"> | 2 | <v-container fluid class="body-color"> |
3 | <!-- ****** Edit Member ****** --> | 3 | <!-- ****** Edit Member ****** --> |
4 | <v-dialog v-model="editBookDialog" max-width="500px"> | 4 | <v-dialog v-model="editBookDialog" max-width="500px"> |
5 | <v-card flat class="card-style pa-2" dark> | 5 | <v-card flat class="card-style pa-2" dark> |
6 | <v-layout> | 6 | <v-layout> |
7 | <v-flex xs12> | 7 | <v-flex xs12> |
8 | <label class="title text-xs-center">Edit Book</label> | 8 | <label class="title text-xs-center">Edit Book</label> |
9 | <v-icon size="24" class="right" @click="editBookDialog = false">cancel</v-icon> | 9 | <v-icon size="24" class="right" @click="editBookDialog = false">cancel</v-icon> |
10 | </v-flex> | 10 | </v-flex> |
11 | </v-layout> | 11 | </v-layout> |
12 | <v-card-text> | 12 | <v-card-text> |
13 | <v-container> | 13 | <v-container> |
14 | <v-layout wrap justify-center> | 14 | <v-layout wrap justify-center> |
15 | <v-flex xs12> | 15 | <v-flex xs12> |
16 | <v-form> | 16 | <v-form> |
17 | <v-layout> | 17 | <v-layout> |
18 | <v-flex xs4 class="pt-4 subheading"> | 18 | <v-flex xs4 class="pt-4 subheading"> |
19 | <label class="right pr-3">Name:</label> | 19 | <label class="right pr-3">Name:</label> |
20 | </v-flex> | 20 | </v-flex> |
21 | <v-flex xs8> | 21 | <v-flex xs8> |
22 | <v-text-field v-model="editedItem.name" placeholder="fill your Name"></v-text-field> | 22 | <v-text-field v-model="editedItem.name" placeholder="fill your Name"></v-text-field> |
23 | </v-flex> | 23 | </v-flex> |
24 | </v-layout> | 24 | </v-layout> |
25 | <v-layout> | 25 | <v-layout> |
26 | <v-flex xs4 class="pt-4 subheading"> | 26 | <v-flex xs4 class="pt-4 subheading"> |
27 | <label class="right pr-3">Author:</label> | 27 | <label class="right pr-3">Author:</label> |
28 | </v-flex> | 28 | </v-flex> |
29 | <v-flex xs8> | 29 | <v-flex xs8> |
30 | <v-text-field v-model="editedItem.author" placeholder="fill your Author Name"></v-text-field> | 30 | <v-text-field v-model="editedItem.author" placeholder="fill your Author Name"></v-text-field> |
31 | </v-flex> | 31 | </v-flex> |
32 | </v-layout> | 32 | </v-layout> |
33 | <v-layout> | 33 | <v-layout> |
34 | <v-flex xs4 class="pt-4 subheading"> | 34 | <v-flex xs4 class="pt-4 subheading"> |
35 | <label class="right pr-3">Subject Code:</label> | 35 | <label class="right pr-3">Subject Code:</label> |
36 | </v-flex> | 36 | </v-flex> |
37 | <v-flex xs8> | 37 | <v-flex xs8> |
38 | <v-text-field | 38 | <v-text-field |
39 | v-model="editedItem.subjectCode" | 39 | v-model="editedItem.subjectCode" |
40 | placeholder="fill your Subject Code" | 40 | placeholder="fill your Subject Code" |
41 | ></v-text-field> | 41 | ></v-text-field> |
42 | </v-flex> | 42 | </v-flex> |
43 | </v-layout> | 43 | </v-layout> |
44 | <v-layout> | 44 | <v-layout> |
45 | <v-flex xs4 class="pt-4 subheading"> | 45 | <v-flex xs4 class="pt-4 subheading"> |
46 | <label class="right pr-3">Price:</label> | 46 | <label class="right pr-3">Price:</label> |
47 | </v-flex> | 47 | </v-flex> |
48 | <v-flex xs8> | 48 | <v-flex xs8> |
49 | <v-text-field | 49 | <v-text-field |
50 | v-model="editedItem.price" | 50 | v-model="editedItem.price" |
51 | placeholder="fill your Subject Code" | 51 | placeholder="fill your Subject Code" |
52 | ></v-text-field> | 52 | ></v-text-field> |
53 | </v-flex> | 53 | </v-flex> |
54 | </v-layout> | 54 | </v-layout> |
55 | <v-layout> | 55 | <v-layout> |
56 | <v-flex xs4 class="pt-4 subheading"> | 56 | <v-flex xs4 class="pt-4 subheading"> |
57 | <label class="right pr-3">Quantity:</label> | 57 | <label class="right pr-3">Quantity:</label> |
58 | </v-flex> | 58 | </v-flex> |
59 | <v-flex xs8> | 59 | <v-flex xs8> |
60 | <v-text-field | 60 | <v-text-field |
61 | v-model="editedItem.quantity" | 61 | v-model="editedItem.quantity" |
62 | type="number" | 62 | type="number" |
63 | placeholder="fill your Quantity" | 63 | placeholder="fill your Quantity" |
64 | ></v-text-field> | 64 | ></v-text-field> |
65 | </v-flex> | 65 | </v-flex> |
66 | </v-layout> | 66 | </v-layout> |
67 | <v-layout> | 67 | <v-layout> |
68 | <v-flex xs4 class="pt-4 subheading"> | 68 | <v-flex xs4 class="pt-4 subheading"> |
69 | <label class="right pr-3">Rack No:</label> | 69 | <label class="right pr-3">Rack No:</label> |
70 | </v-flex> | 70 | </v-flex> |
71 | <v-flex xs8> | 71 | <v-flex xs8> |
72 | <v-text-field v-model="editedItem.rackNo" placeholder="fill your Rack No"></v-text-field> | 72 | <v-text-field v-model="editedItem.rackNo" placeholder="fill your Rack No"></v-text-field> |
73 | </v-flex> | 73 | </v-flex> |
74 | </v-layout> | 74 | </v-layout> |
75 | <v-card-actions> | 75 | <v-card-actions> |
76 | <v-spacer></v-spacer> | 76 | <v-spacer></v-spacer> |
77 | <v-btn round dark @click="save" class="add-button">Save</v-btn> | 77 | <v-btn round dark @click="save" class="add-button">Save</v-btn> |
78 | <v-spacer></v-spacer> | 78 | <v-spacer></v-spacer> |
79 | </v-card-actions> | 79 | </v-card-actions> |
80 | </v-form> | 80 | </v-form> |
81 | </v-flex> | 81 | </v-flex> |
82 | </v-layout> | 82 | </v-layout> |
83 | </v-container> | 83 | </v-container> |
84 | </v-card-text> | 84 | </v-card-text> |
85 | </v-card> | 85 | </v-card> |
86 | </v-dialog> | 86 | </v-dialog> |
87 | 87 | ||
88 | <!-- ****** PROFILE VIEW BOOKS DATA ****** --> | 88 | <!-- ****** PROFILE VIEW BOOKS DATA ****** --> |
89 | 89 | ||
90 | <v-dialog v-model="viewBookDialog" max-width="500px"> | 90 | <v-dialog v-model="viewBookDialog" max-width="500px"> |
91 | <v-card flat class="card-style pa-3" dark> | 91 | <v-card flat class="card-style pa-3" dark> |
92 | <v-layout> | 92 | <v-layout> |
93 | <v-flex xs12> | 93 | <v-flex xs12> |
94 | <label class="title text-xs-center">View Book</label> | 94 | <label class="title text-xs-center">View Book</label> |
95 | <v-icon size="24" class="right" @click="viewBookDialog = false">cancel</v-icon> | 95 | <v-icon size="24" class="right" @click="viewBookDialog = false">cancel</v-icon> |
96 | </v-flex> | 96 | </v-flex> |
97 | </v-layout> | 97 | </v-layout> |
98 | <v-card-text> | 98 | <v-card-text> |
99 | <v-container grid-list-md> | 99 | <v-container grid-list-md> |
100 | <v-layout wrap> | 100 | <v-layout wrap> |
101 | <v-flex> | 101 | <v-flex> |
102 | <v-layout> | 102 | <v-layout> |
103 | <v-flex xs5 sm6> | 103 | <v-flex xs5 sm6> |
104 | <h5 class="right my-1"> | 104 | <h5 class="right my-1"> |
105 | <b>Name :</b> | 105 | <b>Name :</b> |
106 | </h5> | 106 | </h5> |
107 | </v-flex> | 107 | </v-flex> |
108 | <v-flex sm6 xs8> | 108 | <v-flex sm6 xs8> |
109 | <h5 class="my-1">{{ editedItem.name }}</h5> | 109 | <h5 class="my-1">{{ editedItem.name }}</h5> |
110 | </v-flex> | 110 | </v-flex> |
111 | </v-layout> | 111 | </v-layout> |
112 | <v-layout> | 112 | <v-layout> |
113 | <v-flex xs5 sm6> | 113 | <v-flex xs5 sm6> |
114 | <h5 class="right my-1"> | 114 | <h5 class="right my-1"> |
115 | <b>Author :</b> | 115 | <b>Author :</b> |
116 | </h5> | 116 | </h5> |
117 | </v-flex> | 117 | </v-flex> |
118 | <v-flex sm6 xs8> | 118 | <v-flex sm6 xs8> |
119 | <h5 class="my-1">{{ editedItem.author }}</h5> | 119 | <h5 class="my-1">{{ editedItem.author }}</h5> |
120 | </v-flex> | 120 | </v-flex> |
121 | </v-layout> | 121 | </v-layout> |
122 | <v-layout> | 122 | <v-layout> |
123 | <v-flex xs5 sm6> | 123 | <v-flex xs5 sm6> |
124 | <h5 class="right my-1"> | 124 | <h5 class="right my-1"> |
125 | <b>Subject Code :</b> | 125 | <b>Subject Code :</b> |
126 | </h5> | 126 | </h5> |
127 | </v-flex> | 127 | </v-flex> |
128 | <v-flex sm6 xs8> | 128 | <v-flex sm6 xs8> |
129 | <h5 class="my-1">{{ editedItem.subjectCode }}</h5> | 129 | <h5 class="my-1">{{ editedItem.subjectCode }}</h5> |
130 | </v-flex> | 130 | </v-flex> |
131 | </v-layout> | 131 | </v-layout> |
132 | <v-layout> | 132 | <v-layout> |
133 | <v-flex xs5 sm6> | 133 | <v-flex xs5 sm6> |
134 | <h5 class="right my-1"> | 134 | <h5 class="right my-1"> |
135 | <b>Price :</b> | 135 | <b>Price :</b> |
136 | </h5> | 136 | </h5> |
137 | </v-flex> | 137 | </v-flex> |
138 | <v-flex sm6 xs8> | 138 | <v-flex sm6 xs8> |
139 | <h5 class="my-1">{{ editedItem.price }}</h5> | 139 | <h5 class="my-1">{{ editedItem.price }}</h5> |
140 | </v-flex> | 140 | </v-flex> |
141 | </v-layout> | 141 | </v-layout> |
142 | <v-layout> | 142 | <v-layout> |
143 | <v-flex xs5 sm6> | 143 | <v-flex xs5 sm6> |
144 | <h5 class="right my-1"> | 144 | <h5 class="right my-1"> |
145 | <b>Quantity :</b> | 145 | <b>Quantity :</b> |
146 | </h5> | 146 | </h5> |
147 | </v-flex> | 147 | </v-flex> |
148 | <v-flex sm6 xs8> | 148 | <v-flex sm6 xs8> |
149 | <h5 class="my-1">{{ editedItem.quantity}}</h5> | 149 | <h5 class="my-1">{{ editedItem.quantity}}</h5> |
150 | </v-flex> | 150 | </v-flex> |
151 | </v-layout> | 151 | </v-layout> |
152 | <v-layout> | 152 | <v-layout> |
153 | <v-flex xs5 sm6> | 153 | <v-flex xs5 sm6> |
154 | <h5 class="right my-1"> | 154 | <h5 class="right my-1"> |
155 | <b>Rack No :</b> | 155 | <b>Rack No :</b> |
156 | </h5> | 156 | </h5> |
157 | </v-flex> | 157 | </v-flex> |
158 | <v-flex sm6 xs8> | 158 | <v-flex sm6 xs8> |
159 | <h5 class="my-1">{{ editedItem.rackNo}}</h5> | 159 | <h5 class="my-1">{{ editedItem.rackNo}}</h5> |
160 | </v-flex> | 160 | </v-flex> |
161 | </v-layout> | 161 | </v-layout> |
162 | </v-flex> | 162 | </v-flex> |
163 | </v-layout> | 163 | </v-layout> |
164 | </v-container> | 164 | </v-container> |
165 | </v-card-text> | 165 | </v-card-text> |
166 | </v-card> | 166 | </v-card> |
167 | </v-dialog> | 167 | </v-dialog> |
168 | <!-- ****** BOOKS TABLE ****** --> | 168 | <!-- ****** BOOKS TABLE ****** --> |
169 | 169 | ||
170 | <v-toolbar color="transparent" flat> | 170 | <v-toolbar color="transparent" flat> |
171 | <v-btn | 171 | <v-btn |
172 | fab | 172 | fab |
173 | dark | 173 | dark |
174 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" | 174 | class="open-dialog-button hidden-xl-only hidden-md-only hidden-lg-only" |
175 | small | 175 | small |
176 | @click="addBookDialog = true" | 176 | @click="addBookDialog = true" |
177 | > | 177 | > |
178 | <v-icon dark>add</v-icon> | 178 | <v-icon dark>add</v-icon> |
179 | </v-btn> | 179 | </v-btn> |
180 | <v-btn | 180 | <v-btn |
181 | round | 181 | round |
182 | class="open-dialog-button hidden-sm-only hidden-xs-only" | 182 | class="open-dialog-button hidden-sm-only hidden-xs-only" |
183 | dark | 183 | dark |
184 | @click="addBookDialog = true" | 184 | @click="addBookDialog = true" |
185 | > | 185 | > |
186 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Book | 186 | <v-icon class="white--text pr-1" size="20">add</v-icon>Add Book |
187 | </v-btn> | 187 | </v-btn> |
188 | <v-spacer></v-spacer> | 188 | <v-spacer></v-spacer> |
189 | <v-card-title class="body-1" v-show="show"> | 189 | <v-card-title class="body-1" v-show="show"> |
190 | <v-btn icon large flat @click="displaySearch"> | 190 | <v-btn icon large flat @click="displaySearch"> |
191 | <v-avatar size="27"> | 191 | <v-avatar size="27"> |
192 | <img src="/static/icon/search.png" alt="icon" /> | 192 | <img src="/static/icon/search.png" alt="icon" /> |
193 | </v-avatar> | 193 | </v-avatar> |
194 | </v-btn> | 194 | </v-btn> |
195 | </v-card-title> | 195 | </v-card-title> |
196 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> | 196 | <v-flex xs8 sm8 md3 lg2 v-if="showSearch"> |
197 | <v-layout> | 197 | <v-layout> |
198 | <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> | 198 | <v-text-field autofocus v-model="search" label="Search" prepend-inner-icon="search" color="primary"></v-text-field> |
199 | <v-icon @click="closeSearch" color="error">close</v-icon> | 199 | <v-icon @click="closeSearch" color="error">close</v-icon> |
200 | </v-layout> | 200 | </v-layout> |
201 | </v-flex> | 201 | </v-flex> |
202 | </v-toolbar> | 202 | </v-toolbar> |
203 | <v-data-table | 203 | <v-data-table |
204 | :headers="headers" | 204 | :headers="headers" |
205 | :items="bookData" | 205 | :items="bookData" |
206 | :pagination.sync="pagination" | 206 | :pagination.sync="pagination" |
207 | :search="search" | 207 | :search="search" |
208 | > | 208 | > |
209 | <template slot="items" slot-scope="props"> | 209 | <template slot="items" slot-scope="props"> |
210 | <td class="td td-row text-xs-center">{{ props.index + 1}}</td> | 210 | <td class="td td-row text-xs-center">{{ props.index + 1}}</td> |
211 | <td class="td td-row text-xs-center">{{ props.item.name }}</td> | 211 | <td class="td td-row text-xs-center">{{ props.item.name }}</td> |
212 | <td class="td td-row text-xs-center">{{ props.item.author }}</td> | 212 | <td class="td td-row text-xs-center">{{ props.item.author }}</td> |
213 | <td class="td td-row text-xs-center">{{ props.item.subjectCode }}</td> | 213 | <td class="td td-row text-xs-center">{{ props.item.subjectCode }}</td> |
214 | <td class="td td-row text-xs-center">{{ props.item.price }}</td> | 214 | <td class="td td-row text-xs-center">{{ props.item.price }}</td> |
215 | <td class="td td-row text-xs-center">{{ props.item.quantity }}</td> | 215 | <td class="td td-row text-xs-center">{{ props.item.quantity }}</td> |
216 | <td class="td td-row text-xs-center">{{ props.item.rackNo }}</td> | 216 | <td class="td td-row text-xs-center">{{ props.item.rackNo }}</td> |
217 | <td class="td td-row text-xs-center"> | 217 | <td class="td td-row text-xs-center"> |
218 | <span | 218 | <span |
219 | v-if="props.item.status === 'AVAILABLE'" | 219 | v-if="props.item.status === 'AVAILABLE'" |
220 | class="green lighten-1 pa-1 px-2 white--text paymentStatus" | 220 | class="green lighten-1 pa-1 px-2 white--text paymentStatus" |
221 | >{{ props.item.status}}</span> | 221 | >{{ props.item.status}}</span> |
222 | <span | 222 | <span |
223 | v-if="props.item.status === 'UNAVAILABLE'" | 223 | v-if="props.item.status === 'UNAVAILABLE'" |
224 | class="red lighten-1 pa-1 px-2 white--text paymentStatus" | 224 | class="red lighten-1 pa-1 px-2 white--text paymentStatus" |
225 | >{{ props.item.status}}</span> | 225 | >{{ props.item.status}}</span> |
226 | </td> | 226 | </td> |
227 | <td class="text-xs-center td td-row"> | 227 | <td class="text-xs-center td td-row"> |
228 | <span> | 228 | <span> |
229 | <!-- <v-tooltip top> | 229 | <!-- <v-tooltip top> |
230 | <img | 230 | <img |
231 | slot="activator" | 231 | slot="activator" |
232 | style="cursor:pointer; width:25px; height:25px; " | 232 | style="cursor:pointer; width:25px; height:25px; " |
233 | class="mr-3" | 233 | class="mr-3" |
234 | @click="profile(props.item)" | 234 | @click="profile(props.item)" |
235 | src="/static/icon/view.png" | 235 | src="/static/icon/view.png" |
236 | /> | 236 | /> |
237 | <span>View</span> | 237 | <span>View</span> |
238 | </v-tooltip>--> | 238 | </v-tooltip>--> |
239 | <v-tooltip top> | 239 | <v-tooltip top> |
240 | <img | 240 | <img |
241 | slot="activator" | 241 | slot="activator" |
242 | style="cursor:pointer; width:20px; height:18px; " | 242 | style="cursor:pointer; width:20px; height:18px; " |
243 | class="mr-3" | 243 | class="mr-3" |
244 | @click="editItem(props.item)" | 244 | @click="editItem(props.item)" |
245 | src="/static/icon/edit.png" | 245 | src="/static/icon/edit.png" |
246 | /> | 246 | /> |
247 | <span>Edit</span> | 247 | <span>Edit</span> |
248 | </v-tooltip> | 248 | </v-tooltip> |
249 | <v-tooltip top v-if="role != 'TEACHER' "> | 249 | <v-tooltip top v-if="role != 'TEACHER' "> |
250 | <img | 250 | <img |
251 | slot="activator" | 251 | slot="activator" |
252 | style="cursor:pointer; width:20px; height:20px; " | 252 | style="cursor:pointer; width:20px; height:20px; " |
253 | @click="deleteItem(props.item)" | 253 | @click="deleteItem(props.item)" |
254 | src="/static/icon/delete.png" | 254 | src="/static/icon/delete.png" |
255 | /> | 255 | /> |
256 | <span>Delete</span> | 256 | <span>Delete</span> |
257 | </v-tooltip> | 257 | </v-tooltip> |
258 | </span> | 258 | </span> |
259 | </td> | 259 | </td> |
260 | </template> | 260 | </template> |
261 | <v-alert | 261 | <v-alert |
262 | slot="no-results" | 262 | slot="no-results" |
263 | :value="true" | 263 | :value="true" |
264 | color="error" | 264 | color="error" |
265 | icon="warning" | 265 | icon="warning" |
266 | >Your search for "{{ search }}" found no results.</v-alert> | 266 | >Your search for "{{ search }}" found no results.</v-alert> |
267 | </v-data-table> | 267 | </v-data-table> |
268 | <!-- ****** ADD BOOK ****** --> | 268 | <!-- ****** ADD BOOK ****** --> |
269 | <v-dialog v-model="addBookDialog" max-width="600px"> | 269 | <v-dialog v-model="addBookDialog" max-width="600px"> |
270 | <v-card flat class="card-style pa-2" dark> | 270 | <v-card flat class="card-style pa-2" dark> |
271 | <v-layout> | 271 | <v-layout> |
272 | <v-flex xs12> | 272 | <v-flex xs12> |
273 | <label class="title text-xs-center">Add Book</label> | 273 | <label class="title text-xs-center">Add Book</label> |
274 | <v-icon size="24" class="right" @click="addBookDialog = false">cancel</v-icon> | 274 | <v-icon size="24" class="right" @click="$refs.form.reset();addBookDialog = false">cancel</v-icon> |
275 | </v-flex> | 275 | </v-flex> |
276 | </v-layout> | 276 | </v-layout> |
277 | <v-container fluid fill-height> | 277 | <v-container fluid fill-height> |
278 | <v-layout align-center> | 278 | <v-layout align-center> |
279 | <v-flex xs12 class="mt-4"> | 279 | <v-flex xs12 class="mt-4"> |
280 | <v-form ref="form" v-model="valid" lazy-validation> | 280 | <v-form ref="form" v-model="valid" lazy-validation> |
281 | <v-layout> | 281 | <v-layout> |
282 | <v-flex xs4 class="pt-4 subheading"> | 282 | <v-flex xs4 class="pt-4 subheading"> |
283 | <label class="right">Name:</label> | 283 | <label class="right">Name:</label> |
284 | </v-flex> | 284 | </v-flex> |
285 | <v-flex xs7 class="ml-3"> | 285 | <v-flex xs7 class="ml-3"> |
286 | <v-text-field | 286 | <v-text-field |
287 | v-model="BooksData.name" | 287 | v-model="BooksData.name" |
288 | placeholder="fill your Name" | 288 | placeholder="fill your Name" |
289 | type="text" | 289 | type="text" |
290 | :rules="nameRules" | 290 | :rules="nameRules" |
291 | required | 291 | required |
292 | ></v-text-field> | 292 | ></v-text-field> |
293 | </v-flex> | 293 | </v-flex> |
294 | </v-layout> | 294 | </v-layout> |
295 | <v-layout> | 295 | <v-layout> |
296 | <v-flex xs4 class="pt-4 subheading"> | 296 | <v-flex xs4 class="pt-4 subheading"> |
297 | <label class="right">Author:</label> | 297 | <label class="right">Author:</label> |
298 | </v-flex> | 298 | </v-flex> |
299 | <v-flex xs7 class="ml-3"> | 299 | <v-flex xs7 class="ml-3"> |
300 | <v-text-field | 300 | <v-text-field |
301 | v-model="BooksData.author" | 301 | v-model="BooksData.author" |
302 | placeholder="fill your Author Name" | 302 | placeholder="fill your Author Name" |
303 | type="text" | 303 | type="text" |
304 | :rules="authorRules" | 304 | :rules="authorRules" |
305 | required | 305 | required |
306 | ></v-text-field> | 306 | ></v-text-field> |
307 | </v-flex> | 307 | </v-flex> |
308 | </v-layout> | 308 | </v-layout> |
309 | <v-layout> | 309 | <v-layout> |
310 | <v-flex xs4 class="pt-4 subheading"> | 310 | <v-flex xs4 class="pt-4 subheading"> |
311 | <label class="right">Subject Code:</label> | 311 | <label class="right">Subject Code:</label> |
312 | </v-flex> | 312 | </v-flex> |
313 | <v-flex xs7 class="ml-3"> | 313 | <v-flex xs7 class="ml-3"> |
314 | <v-text-field | 314 | <v-text-field |
315 | v-model="BooksData.subjectCode" | 315 | v-model="BooksData.subjectCode" |
316 | placeholder="fill your Subject Code" | 316 | placeholder="fill your Subject Code" |
317 | type="text" | 317 | type="text" |
318 | :rules="subjectRules" | 318 | :rules="subjectRules" |
319 | required | 319 | required |
320 | ></v-text-field> | 320 | ></v-text-field> |
321 | </v-flex> | 321 | </v-flex> |
322 | </v-layout> | 322 | </v-layout> |
323 | <v-layout> | 323 | <v-layout> |
324 | <v-flex xs4 class="pt-4 subheading"> | 324 | <v-flex xs4 class="pt-4 subheading"> |
325 | <label class="right">Price:</label> | 325 | <label class="right">Price:</label> |
326 | </v-flex> | 326 | </v-flex> |
327 | <v-flex xs7 class="ml-3"> | 327 | <v-flex xs7 class="ml-3"> |
328 | <v-text-field | 328 | <v-text-field |
329 | v-model="BooksData.price" | 329 | v-model="BooksData.price" |
330 | placeholder="fill your Price" | 330 | placeholder="fill your Price" |
331 | :rules="priceRules" | 331 | :rules="priceRules" |
332 | required | 332 | required |
333 | ></v-text-field> | 333 | ></v-text-field> |
334 | </v-flex> | 334 | </v-flex> |
335 | </v-layout> | 335 | </v-layout> |
336 | <v-layout> | 336 | <v-layout> |
337 | <v-flex xs4 class="pt-4 subheading"> | 337 | <v-flex xs4 class="pt-4 subheading"> |
338 | <label class="right">Quantity:</label> | 338 | <label class="right">Quantity:</label> |
339 | </v-flex> | 339 | </v-flex> |
340 | <v-flex xs7 class="ml-3"> | 340 | <v-flex xs7 class="ml-3"> |
341 | <v-text-field | 341 | <v-text-field |
342 | v-model="BooksData.quantity" | 342 | v-model="BooksData.quantity" |
343 | placeholder="fill your Quantity" | 343 | placeholder="fill your Quantity" |
344 | :rules="quantityRules" | 344 | :rules="quantityRules" |
345 | required | 345 | required |
346 | ></v-text-field> | 346 | ></v-text-field> |
347 | </v-flex> | 347 | </v-flex> |
348 | </v-layout> | 348 | </v-layout> |
349 | <v-layout> | 349 | <v-layout> |
350 | <v-flex xs4 class="pt-4 subheading"> | 350 | <v-flex xs4 class="pt-4 subheading"> |
351 | <label class="right">Rack No:</label> | 351 | <label class="right">Rack No:</label> |
352 | </v-flex> | 352 | </v-flex> |
353 | <v-flex xs7 class="ml-3"> | 353 | <v-flex xs7 class="ml-3"> |
354 | <v-text-field | 354 | <v-text-field |
355 | v-model="BooksData.rackNo" | 355 | v-model="BooksData.rackNo" |
356 | placeholder="fill your Rack No" | 356 | placeholder="fill your Rack No" |
357 | :rules="rackNoRules" | 357 | :rules="rackNoRules" |
358 | required | 358 | required |
359 | ></v-text-field> | 359 | ></v-text-field> |
360 | </v-flex> | 360 | </v-flex> |
361 | </v-layout> | 361 | </v-layout> |
362 | <v-layout> | 362 | <v-layout> |
363 | <v-flex xs12> | 363 | <v-flex xs12> |
364 | <v-card-actions> | 364 | <v-card-actions> |
365 | <v-spacer></v-spacer> | 365 | <v-spacer></v-spacer> |
366 | <v-btn @click="clear" round dark class="clear-button">clear</v-btn> | 366 | <v-btn @click="clear" round dark class="clear-button">clear</v-btn> |
367 | <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> | 367 | <v-btn @click="submit" round dark :loading="loading" class="add-button">Add</v-btn> |
368 | </v-card-actions> | 368 | </v-card-actions> |
369 | </v-flex> | 369 | </v-flex> |
370 | </v-layout> | 370 | </v-layout> |
371 | </v-form> | 371 | </v-form> |
372 | </v-flex> | 372 | </v-flex> |
373 | </v-layout> | 373 | </v-layout> |
374 | </v-container> | 374 | </v-container> |
375 | </v-card> | 375 | </v-card> |
376 | </v-dialog> | 376 | </v-dialog> |
377 | <v-snackbar | 377 | <v-snackbar |
378 | :timeout="timeout" | 378 | :timeout="timeout" |
379 | :top="y === 'top'" | 379 | :top="y === 'top'" |
380 | :right="x === 'right'" | 380 | :right="x === 'right'" |
381 | :vertical="mode === 'vertical'" | 381 | :vertical="mode === 'vertical'" |
382 | v-model="snackbar" | 382 | v-model="snackbar" |
383 | :color="color" | 383 | :color="color" |
384 | >{{ text }}</v-snackbar> | 384 | >{{ text }}</v-snackbar> |
385 | <div class="loader" v-if="showLoader"> | 385 | <div class="loader" v-if="showLoader"> |
386 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 386 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
387 | </div> | 387 | </div> |
388 | </v-container> | 388 | </v-container> |
389 | </template> | 389 | </template> |
390 | 390 | ||
391 | <script> | 391 | <script> |
392 | import http from "@/Services/http.js"; | 392 | import http from "@/Services/http.js"; |
393 | import Util from "@/util"; | 393 | import Util from "@/util"; |
394 | 394 | ||
395 | export default { | 395 | export default { |
396 | data: () => ({ | 396 | data: () => ({ |
397 | snackbar: false, | 397 | snackbar: false, |
398 | y: "top", | 398 | y: "top", |
399 | x: "right", | 399 | x: "right", |
400 | mode: "", | 400 | mode: "", |
401 | timeout: 5000, | 401 | timeout: 5000, |
402 | text: "", | 402 | text: "", |
403 | color: "", | 403 | color: "", |
404 | show: true, | 404 | show: true, |
405 | showSearch: false, | 405 | showSearch: false, |
406 | showLoader: false, | 406 | showLoader: false, |
407 | loading: false, | 407 | loading: false, |
408 | date: null, | 408 | date: null, |
409 | search: "", | 409 | search: "", |
410 | editBookDialog: false, | 410 | editBookDialog: false, |
411 | viewBookDialog: false, | 411 | viewBookDialog: false, |
412 | valid: true, | 412 | valid: true, |
413 | validEdit: true, | 413 | validEdit: true, |
414 | addBookDialog: false, | 414 | addBookDialog: false, |
415 | pagination: { | 415 | pagination: { |
416 | rowsPerPage: 10, | 416 | rowsPerPage: 10, |
417 | }, | 417 | }, |
418 | nameRules: [(v) => !!v || " Name is required"], | 418 | nameRules: [(v) => !!v || " Name is required"], |
419 | authorRules: [(v) => !!v || "Author Name Monthly"], | 419 | authorRules: [(v) => !!v || "Author Name Monthly"], |
420 | subjectRules: [(v) => !!v || "Subject Code is required"], | 420 | subjectRules: [(v) => !!v || "Subject Code is required"], |
421 | priceRules: [(v) => !!v || "Price is required"], | 421 | priceRules: [(v) => !!v || "Price is required"], |
422 | quantityRules: [(v) => !!v || "Quantity is required"], | 422 | quantityRules: [(v) => !!v || "Quantity is required"], |
423 | rackNoRules: [(v) => !!v || "Rack No. is required"], | 423 | rackNoRules: [(v) => !!v || "Rack No. is required"], |
424 | 424 | ||
425 | headers: [ | 425 | headers: [ |
426 | { | 426 | { |
427 | text: "No", | 427 | text: "No", |
428 | align: "", | 428 | align: "", |
429 | sortable: false, | 429 | sortable: false, |
430 | value: "No", | 430 | value: "No", |
431 | }, | 431 | }, |
432 | { | 432 | { |
433 | text: "Name", | 433 | text: "Name", |
434 | value: "name", | 434 | value: "name", |
435 | sortable: false, | 435 | sortable: false, |
436 | align: "center", | 436 | align: "center", |
437 | }, | 437 | }, |
438 | { text: "Authour", value: "author", sortable: false, align: "center" }, | 438 | { text: "Authour", value: "author", sortable: false, align: "center" }, |
439 | { | 439 | { |
440 | text: "Subject Code", | 440 | text: "Subject Code", |
441 | value: "subjectCode", | 441 | value: "subjectCode", |
442 | sortable: false, | 442 | sortable: false, |
443 | align: "center", | 443 | align: "center", |
444 | }, | 444 | }, |
445 | { text: "Price", value: "price", sortable: false, align: "center" }, | 445 | { text: "Price", value: "price", sortable: false, align: "center" }, |
446 | { text: "Quantity", value: "quantity", sortable: false, align: "center" }, | 446 | { text: "Quantity", value: "quantity", sortable: false, align: "center" }, |
447 | { text: "Rack No", value: "rackNo", sortable: false, align: "center" }, | 447 | { text: "Rack No", value: "rackNo", sortable: false, align: "center" }, |
448 | { text: "Status", value: "status", sortable: false, align: "center" }, | 448 | { text: "Status", value: "status", sortable: false, align: "center" }, |
449 | 449 | ||
450 | { text: "Action", value: "", sortable: false, align: "center" }, | 450 | { text: "Action", value: "", sortable: false, align: "center" }, |
451 | ], | 451 | ], |
452 | bookData: [], | 452 | bookData: [], |
453 | select: "", | 453 | select: "", |
454 | token: "", | 454 | token: "", |
455 | editedItem: {}, | 455 | editedItem: {}, |
456 | BooksData: {}, | 456 | BooksData: {}, |
457 | }), | 457 | }), |
458 | methods: { | 458 | methods: { |
459 | getBookData() { | 459 | getBookData() { |
460 | this.showLoader = true; | 460 | this.showLoader = true; |
461 | http() | 461 | http() |
462 | .get("/getBooksList", { | 462 | .get("/getBooksList", { |
463 | params: { | 463 | params: { |
464 | schoolId: this.$store.state.schoolId, | 464 | schoolId: this.$store.state.schoolId, |
465 | }, | 465 | }, |
466 | headers: { Authorization: "Bearer " + this.token }, | 466 | headers: { Authorization: "Bearer " + this.token }, |
467 | }) | 467 | }) |
468 | .then((response) => { | 468 | .then((response) => { |
469 | this.bookData = response.data.data; | 469 | this.bookData = response.data.data; |
470 | this.showLoader = false; | 470 | this.showLoader = false; |
471 | }) | 471 | }) |
472 | .catch((error) => { | 472 | .catch((error) => { |
473 | this.showLoader = false; | 473 | this.showLoader = false; |
474 | if (error.response.status === 401) { | 474 | if (error.response.status === 401) { |
475 | this.$router.replace({ path: "/" }); | 475 | this.$router.replace({ path: "/" }); |
476 | this.$store.dispatch("setToken", null); | 476 | this.$store.dispatch("setToken", null); |
477 | this.$store.dispatch("Id", null); | 477 | this.$store.dispatch("Id", null); |
478 | } | 478 | } |
479 | }); | 479 | }); |
480 | }, | 480 | }, |
481 | editItem(item) { | 481 | editItem(item) { |
482 | this.editedIndex = this.bookData.indexOf(item); | 482 | this.editedIndex = this.bookData.indexOf(item); |
483 | this.editedItem = Object.assign({}, item); | 483 | this.editedItem = Object.assign({}, item); |
484 | console.log(this.editedItem); | 484 | console.log(this.editedItem); |
485 | this.editBookDialog = true; | 485 | this.editBookDialog = true; |
486 | }, | 486 | }, |
487 | profile(item) { | 487 | profile(item) { |
488 | this.editedIndex = this.bookData.indexOf(item); | 488 | this.editedIndex = this.bookData.indexOf(item); |
489 | this.editedItem = Object.assign({}, item); | 489 | this.editedItem = Object.assign({}, item); |
490 | this.viewBookDialog = true; | 490 | this.viewBookDialog = true; |
491 | }, | 491 | }, |
492 | deleteItem(item) { | 492 | deleteItem(item) { |
493 | let deleteStudent = { | 493 | let deleteStudent = { |
494 | bookId: item._id, | 494 | bookId: item._id, |
495 | }; | 495 | }; |
496 | http() | 496 | http() |
497 | .delete( | 497 | .delete( |
498 | "/deleteBook", | 498 | "/deleteBook", |
499 | confirm("Are you sure you want to delete this?") && { | 499 | confirm("Are you sure you want to delete this?") && { |
500 | params: deleteStudent, | 500 | params: deleteStudent, |
501 | } | 501 | } |
502 | ) | 502 | ) |
503 | .then((response) => { | 503 | .then((response) => { |
504 | this.snackbar = true; | 504 | this.snackbar = true; |
505 | this.text = response.data.message; | 505 | this.text = response.data.message; |
506 | this.color = "green"; | 506 | this.color = "green"; |
507 | this.getBookData(); | 507 | this.getBookData(); |
508 | }) | 508 | }) |
509 | .catch((error) => { | 509 | .catch((error) => { |
510 | this.snackbar = true; | 510 | this.snackbar = true; |
511 | this.text = error.response.data.message; | 511 | this.text = error.response.data.message; |
512 | this.color = "error"; | 512 | this.color = "error"; |
513 | }); | 513 | }); |
514 | }, | 514 | }, |
515 | closeEditProfile() { | 515 | closeEditProfile() { |
516 | this.editBookDialog = false; | 516 | this.editBookDialog = false; |
517 | }, | 517 | }, |
518 | close2() { | 518 | close2() { |
519 | this.dialog2 = false; | 519 | this.dialog2 = false; |
520 | }, | 520 | }, |
521 | submit() { | 521 | submit() { |
522 | this.BooksData.quantity = Number(this.BooksData.quantity); | 522 | this.BooksData.quantity = Number(this.BooksData.quantity); |
523 | this.BooksData.schoolId = this.$store.state.schoolId; | 523 | this.BooksData.schoolId = this.$store.state.schoolId; |
524 | if (this.$refs.form.validate()) { | 524 | if (this.$refs.form.validate()) { |
525 | this.loading = true; | 525 | this.loading = true; |
526 | http() | 526 | http() |
527 | .post("/createBook", this.BooksData) | 527 | .post("/createBook", this.BooksData) |
528 | .then((response) => { | 528 | .then((response) => { |
529 | this.getBookData(); | 529 | this.getBookData(); |
530 | this.snackbar = true; | 530 | this.snackbar = true; |
531 | this.text = response.data.message; | 531 | this.text = response.data.message; |
532 | this.color = "green"; | 532 | this.color = "green"; |
533 | this.addBookDialog = false; | 533 | this.addBookDialog = false; |
534 | this.clear(); | 534 | this.clear(); |
535 | this.loading = false; | 535 | this.loading = false; |
536 | }) | 536 | }) |
537 | .catch((error) => { | 537 | .catch((error) => { |
538 | this.snackbar = true; | 538 | this.snackbar = true; |
539 | this.text = error.response.data.message; | 539 | this.text = error.response.data.message; |
540 | this.color = "error"; | 540 | this.color = "error"; |
541 | this.loading = false; | 541 | this.loading = false; |
542 | }); | 542 | }); |
543 | } | 543 | } |
544 | }, | 544 | }, |
545 | clear() { | 545 | clear() { |
546 | this.$refs.form.reset(); | 546 | this.$refs.form.reset(); |
547 | }, | 547 | }, |
548 | save() { | 548 | save() { |
549 | this.editedItem.bookId = this.editedItem._id; | 549 | this.editedItem.bookId = this.editedItem._id; |
550 | http() | 550 | http() |
551 | .put("/updateBook", this.editedItem) | 551 | .put("/updateBook", this.editedItem) |
552 | .then((response) => { | 552 | .then((response) => { |
553 | this.snackbar = true; | 553 | this.snackbar = true; |
554 | this.text = response.data.message; | 554 | this.text = response.data.message; |
555 | this.color = "green"; | 555 | this.color = "green"; |
556 | this.getBookData(); | 556 | this.getBookData(); |
557 | this.closeEditProfile(); | 557 | this.closeEditProfile(); |
558 | }) | 558 | }) |
559 | .catch((error) => { | 559 | .catch((error) => { |
560 | this.snackbar = true; | 560 | this.snackbar = true; |
561 | this.text = error.response.data.message; | 561 | this.text = error.response.data.message; |
562 | this.color = "error"; | 562 | this.color = "error"; |
563 | // console.log(error); | 563 | // console.log(error); |
564 | }); | 564 | }); |
565 | }, | 565 | }, |
566 | displaySearch() { | 566 | displaySearch() { |
567 | (this.show = false), (this.showSearch = true); | 567 | (this.show = false), (this.showSearch = true); |
568 | }, | 568 | }, |
569 | closeSearch() { | 569 | closeSearch() { |
570 | this.showSearch = false; | 570 | this.showSearch = false; |
571 | this.show = true; | 571 | this.show = true; |
572 | this.search = ""; | 572 | this.search = ""; |
573 | }, | 573 | }, |
574 | }, | 574 | }, |
575 | mounted() { | 575 | mounted() { |
576 | this.token = this.$store.state.token; | 576 | this.token = this.$store.state.token; |
577 | this.getBookData(); | 577 | this.getBookData(); |
578 | this.role = this.$store.state.role; | 578 | this.role = this.$store.state.role; |
579 | }, | 579 | }, |
580 | }; | 580 | }; |
581 | </script> | 581 | </script> |
582 | 582 |