Blame view
src/pages/Mark/viewMark.vue
10.4 KB
006544386
|
1 2 |
<template> <v-app id="pages-dasboard"> |
495e4037c
|
3 |
<!-- ****** PROFILE MARK ****** --> |
006544386
|
4 |
<v-container fluid grid-list-md> |
ec5677f43
|
5 |
<v-layout> |
66a5c3b75
|
6 |
<v-flex xs12 sm8 md10> |
68d742034
|
7 |
<v-btn class="open-dialog-button mt-3" round dark @click="print()"> |
ec5677f43
|
8 |
|
68d742034
|
9 |
<v-icon size="18" right dark>print</v-icon> |
ec5677f43
|
10 11 |
</v-btn> </v-flex> |
66a5c3b75
|
12 13 14 15 16 17 18 19 20 |
<v-flex xs12 sm4 md2 class="right"> <v-select class :items="selectMark" label="Select" v-model="selectMarkList" @change="selectMarkData(selectMarkList)" ></v-select> </v-flex> |
ec5677f43
|
21 22 23 |
</v-layout> <v-flex xs12 sm12 id="printMe"> <v-layout wrap> |
67a276510
|
24 25 |
<!-- ****** TABLE DATA MARK ****** --> <v-flex xs12 sm12 md12> |
819c223ec
|
26 |
<v-card |
ec5677f43
|
27 28 29 |
v-for="(value, id, index) in filterData" :key="index" flat |
67a276510
|
30 |
style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px" |
ec5677f43
|
31 |
> |
d4735dce7
|
32 |
<v-layout> |
25205ccca
|
33 |
<v-flex xs12 sm12 md12 class="text-xs-center"> |
d4735dce7
|
34 35 36 |
<img :src="userData.schoolLogoUrl" width="140" alt="logo" /> <p class="title">{{ userData.name }}</p> <p>{{ userData.address }}</p> |
67a276510
|
37 |
</v-flex> |
25205ccca
|
38 |
<v-flex xs12 sm12 md12 class="text-xs-center"> |
819c223ec
|
39 40 41 |
<v-avatar size="80px"> <img src="/static/icon/user.png" v-if="!value[0].studentId.profilePicUrl" /> <img :src="value[0].studentId.profilePicUrl" v-else-if="value[0].studentId.profilePicUrl" /> |
67a276510
|
42 |
</v-avatar> |
25205ccca
|
43 44 45 46 47 |
<p style="font-size:20px;margin:0px;margin-bottom:4px;" >{{ value[0].studentId.name }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
819c223ec
|
48 |
> Class : {{ value[0].classId.classNum }}</p> |
25205ccca
|
49 50 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
819c223ec
|
51 |
> Section : {{ value[0].sectionId.name }}</p> |
25205ccca
|
52 53 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
819c223ec
|
54 |
> Roll No : {{ value[0].studentId.rollNo }}</p> |
67a276510
|
55 56 |
</v-flex> </v-layout> |
ec5677f43
|
57 58 59 60 61 |
<table class="mb-5 tableRsponsive feeTypeTable" style="border: 1px solid lightgrey; border-collapse: collapse;!important table-layout: auto !important; |
67a276510
|
62 |
width: 100% !important; |
d4735dce7
|
63 |
" |
ec5677f43
|
64 65 |
> <thead style="border: 1px solid lightgrey !important;"> |
67a276510
|
66 |
<tr style="border: 1px solid lightgrey !important;padding:4px;"> |
ec5677f43
|
67 68 69 70 |
<td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> |
4d1fcaddc
|
71 72 73 74 75 76 77 78 |
<template v-for="studentData in value"> <td colspan="2" v-for="studentMark in studentData.studentsMarks" style="border: 1px solid lightgrey !important;padding: 10px;" >{{studentMark.markDistributionId.distributionType}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> </template> |
ec5677f43
|
79 80 81 82 83 84 85 |
</tr> <tr v-for="(subject, ind) in value" v-if="ind == 0" style="border: 1px solid lightgrey !important;" > <template v-for="(exam, i) in subject.studentsMarks"> |
d4735dce7
|
86 87 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> <td style="border: 1px solid lightgrey !important;padding: 10px;">Highest Mark</td> |
ec5677f43
|
88 |
</template> |
d4735dce7
|
89 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> |
ec5677f43
|
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
</tr> </thead> <tbody style="border: 1px solid lightgrey !important;"> <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{subject.subjectName}}</td> <template v-for="(exam, i) in subject.studentsMarks"> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.marksScored}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.markDistributionId.markValue}}</td> </template> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{subject.totalMarks}}</td> </tr> </tbody> </table> </v-card> </v-flex> </v-layout> |
006544386
|
114 115 116 117 118 119 120 121 122 123 124 |
</v-flex> </v-container> <div class="loader" v-if="showLoader"> <v-progress-circular indeterminate color="white"></v-progress-circular> </div> </v-app> </template> <script> import http from "@/Services/http.js"; import moment from "moment"; |
79583580d
|
125 |
import _ from "underscore"; |
006544386
|
126 127 128 |
export default { data: () => ({ |
ec5677f43
|
129 130 |
showLoader: true, nameShow: false, |
66a5c3b75
|
131 132 |
showMark: true, showGrade: false, |
006544386
|
133 134 135 |
markData: [], token: "", markDistributions: [], |
79583580d
|
136 |
markParticularDistributionData: [], |
ec5677f43
|
137 |
filterData: [], |
66a5c3b75
|
138 139 140 141 142 143 144 145 146 |
output: null, gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", gradeC: "C", selectMarkList: "Mark", selectMark: ["Mark", "Grade"], |
67a276510
|
147 148 |
MarkData: "", userData: {} |
006544386
|
149 150 151 152 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); |
67a276510
|
153 |
this.getUserData(); |
006544386
|
154 155 156 |
}, methods: { getMarkList() { |
ec5677f43
|
157 |
this.showLoader = true; |
006544386
|
158 159 160 161 162 163 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
66a5c3b75
|
164 |
this.markData = response.data.data; |
79583580d
|
165 |
let newData = response.data.data; |
4d1fcaddc
|
166 |
// console.log("newData", newData); |
79583580d
|
167 168 169 170 |
for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
4d1fcaddc
|
171 |
// console.log("this.filterData", this.filterData); |
79583580d
|
172 |
for (let data in this.filterData) { |
79583580d
|
173 |
for (let item in this.filterData[data]) { |
79583580d
|
174 |
var totalMarks = 0; |
006544386
|
175 |
for ( |
79583580d
|
176 177 178 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
179 |
) { |
4d1fcaddc
|
180 181 |
// console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] // .marksScored) |
79583580d
|
182 183 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
184 |
} |
79583580d
|
185 |
this.filterData[data][item].totalMarks = totalMarks; |
4d1fcaddc
|
186 |
|
66a5c3b75
|
187 188 189 190 191 192 193 194 195 196 197 198 199 |
if (totalMarks > 90) { this.filterData[data][item].grade = this.gradeAPlus; } else if (totalMarks > 80 && totalMarks < 90) { this.filterData[data][item].grade = this.gradeA; } else if (totalMarks > 70 && totalMarks < 80) { this.filterData[data][item].grade = this.gradeBPlus; } else if (totalMarks > 60 && totalMarks < 70) { this.filterData[data][item].grade = this.gradeB; } else if (totalMarks > 50 && totalMarks < 60) { this.filterData[data][item].grade = this.gradeCPlus; } else if (totalMarks > 40 && totalMarks < 50) { this.filterData[data][item].grade = this.gradeC; } |
006544386
|
200 201 |
} } |
ec5677f43
|
202 |
this.showLoader = false; |
006544386
|
203 204 |
}) .catch(error => { |
006544386
|
205 206 207 208 209 210 211 212 213 |
this.showLoader = false; this.snackbar = true; this.text = error.response.data.message; if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); |
ec5677f43
|
214 215 216 217 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
66a5c3b75
|
218 |
}, |
67a276510
|
219 220 221 222 223 224 225 |
getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { |
25205ccca
|
226 227 228 229 230 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
67a276510
|
231 232 |
}); }, |
66a5c3b75
|
233 234 235 236 237 238 239 240 |
selectMarkData(select) { if (select == "Mark") { this.showMark = true; this.showGrade = false; } else if (select == "Grade") { this.showGrade = true; this.showMark = false; } |
006544386
|
241 242 243 244 245 246 |
} } }; </script> <style scoped> |
68d742034
|
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
.add-button { background: #feb83c !important; border-color: #feb83c !important; text-transform: none !important; -webkit-box-shadow: none !important; box-shadow: none !important; } .card-styles { background: #7f62f8 !important; border-color: #7f62f8 !important; } .open-dialog-button { background: #827bfa !important; border-color: #827bfa !important; text-transform: none !important; } |
006544386
|
263 264 265 266 |
table { border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
267 268 269 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
text-align: center; } table.feeTypeTable { table-layout: auto !important; width: 100% !important; } .bg-sky { background-color: #98b2cc !important; } .bg-sky-light { background-color: #89a0b8; } .bg-purple { background-color: #9583ac; } .bg-skyDark { background-color: #956785; } |
ec5677f43
|
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
.loader { width: 100%; height: 100%; position: fixed; top: 0; left: 0; text-align: center; background-color: rgba(0, 0, 0, 0.5); z-index: 999; } .loader > div { position: relative; top: calc(50% - 16px); } |
006544386
|
303 304 |
@media screen and (max-width: 380px) { .tableRsponsive { |
d4735dce7
|
305 |
/* display: block; */ |
006544386
|
306 307 308 309 |
position: relative; overflow: scroll; } } |
ec5677f43
|
310 |
</style> |