Blame view
src/pages/Mark/viewMark.vue
17.1 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 |
</v-layout> <v-flex xs12 sm12 id="printMe"> |
bdaae72ca
|
23 24 25 26 |
<!-- <v-layout wrap> --> <!-- ****** TABLE DATA MARK ****** --> <v-flex xs12 sm12 md12> <v-layout> |
4d8198ee4
|
27 |
<v-flex xs12 sm12 md12 style="text-align:center"> |
bdaae72ca
|
28 29 30 31 32 33 34 35 |
<!-- <img :src="userData.schoolLogoUrl" width="140" alt="logo" /> --> <v-avatar> <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" /> <img src="/static/schoolIcons/INTRACK_White.png" v-else-if="!userData.schoolLogoUrl" /> </v-avatar> |
4d8198ee4
|
36 37 38 39 40 41 42 43 |
<p style=" font-size: 20px !important; font-weight: 500; line-height: 2 !important; letter-spacing: 0.02em !important;" >{{ userData.name }}</p> <p style="margin-bottom: 16px;">{{ userData.address }}</p> |
bdaae72ca
|
44 45 46 |
</v-flex> </v-layout> <v-layout wrap> |
4d8198ee4
|
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
<v-flex xs12 sm12 md3> <v-card style=" margin:auto 4px; padding:20px; background-color: #fff; border-color: #fff; color: rgba(0,0,0,0.87); border: 1px solid rgb(226, 231, 235); -webkit-box-shadow:inherit !important; box-shadow: inherit !important;" > <v-layout style="padding:20px;"> <v-avatar size="80" style="margin:10px auto;"> |
bdaae72ca
|
61 |
<img src="/static/icon/user.png" v-if="!markData[0].studentId.profilePicUrl" /> |
74abc502c
|
62 |
<img |
bdaae72ca
|
63 64 |
:src="markData[0].studentId.profilePicUrl" v-else-if="markData[0].studentId.profilePicUrl" |
74abc502c
|
65 66 |
/> </v-avatar> |
bdaae72ca
|
67 |
</v-layout> |
4d8198ee4
|
68 69 70 71 72 73 |
<v-layout style=" margin-bottom: -1px; border: 1px solid #ddd; margin: 0px;" > |
bdaae72ca
|
74 |
<v-flex xs6 sm6> |
4d8198ee4
|
75 |
<h4 style="float:right;margin: 4px 0px;"> |
bdaae72ca
|
76 77 78 79 |
<b>Name :</b> </h4> </v-flex> <v-flex sm6 xs6> |
4d8198ee4
|
80 |
<h4 style="float:left;margin: 4px 0px;">{{ markData[0].studentId.name }}</h4> |
bdaae72ca
|
81 82 |
</v-flex> </v-layout> |
4d8198ee4
|
83 84 85 86 87 88 |
<v-layout style=" margin-bottom: -1px; border: 1px solid #ddd; margin: 0px;" > |
bdaae72ca
|
89 |
<v-flex xs6 sm6> |
4d8198ee4
|
90 |
<h4 style="float:right;margin: 4px 0px;"> |
bdaae72ca
|
91 92 93 94 |
<b>Class :</b> </h4> </v-flex> <v-flex sm6 xs6> |
4d8198ee4
|
95 |
<h4 style="float:left;margin: 4px 0px;">{{ markData[0].classId.classNum }}</h4> |
bdaae72ca
|
96 97 |
</v-flex> </v-layout> |
4d8198ee4
|
98 99 100 101 102 103 |
<v-layout style=" margin-bottom: -1px; border: 1px solid #ddd; margin: 0px;" > |
bdaae72ca
|
104 |
<v-flex xs6 sm6> |
4d8198ee4
|
105 |
<h4 style="float:right;margin: 4px 0px;"> |
bdaae72ca
|
106 107 108 109 |
<b>Section :</b> </h4> </v-flex> <v-flex sm6 xs6> |
4d8198ee4
|
110 |
<h4 style="float:left;margin: 4px 0px;">{{ markData[0].sectionId.name }}</h4> |
bdaae72ca
|
111 112 |
</v-flex> </v-layout> |
4d8198ee4
|
113 114 115 116 117 118 |
<v-layout style=" margin-bottom: -1px; border: 1px solid #ddd; margin: 0px;" > |
bdaae72ca
|
119 |
<v-flex xs6 sm6> |
4d8198ee4
|
120 |
<h4 style="float:right;margin: 4px 0px;"> |
bdaae72ca
|
121 122 123 124 |
<b>Roll No :</b> </h4> </v-flex> <v-flex sm6 xs6> |
4d8198ee4
|
125 |
<h4 style="float:left;margin: 4px 0px;">{{ markData[0].studentId.rollNo }}</h4> |
bdaae72ca
|
126 127 128 |
</v-flex> </v-layout> <!-- <p |
4ba513413
|
129 |
style="font-size:20px;margin:0px;margin-bottom:4px;" |
74abc502c
|
130 |
>{{ markData[0].studentId.name }}</p> |
4ba513413
|
131 132 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
74abc502c
|
133 |
>Class : {{ markData[0].classId.classNum }}</p> |
4ba513413
|
134 135 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
74abc502c
|
136 |
>Section : {{ markData[0].sectionId.name }}</p> |
4ba513413
|
137 138 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
bdaae72ca
|
139 140 141 |
>Roll No : {{ markData[0].studentId.rollNo }}</p>--> </v-card> </v-flex> |
4d8198ee4
|
142 143 144 145 146 147 148 149 150 151 152 153 |
<v-flex xs12 sm12 md9 v-show="showMark"> <v-card style=" margin:auto 14px; padding:20px 0px; background-color: #fff; border: 1px solid lightgrey; color: rgba(0,0,0,0.87); border: 1px solid rgb(226, 231, 235); -webkit-box-shadow:inherit !important; box-shadow: inherit !important;" > <div> |
bdaae72ca
|
154 155 156 157 158 |
<table v-for="(value, id) in filterData" :key="id" class="mb-5 tableRsponsive feeTypeTable subheading" style="border: 1px solid black; |
4ba513413
|
159 160 |
border-collapse: collapse;!important table-layout: auto !important; |
bdaae72ca
|
161 162 163 164 165 166 |
width: 100% !important;" > <thead style="border: 1px solid transparent !important;"> <td colspan="4" style="text-align: inherit !important; |
1d7227237
|
167 168 169 |
border-right: inherit; border-top: inherit; padding:14px;" |
bdaae72ca
|
170 |
>{{value[0].examId.examName}}</td> |
bdaae72ca
|
171 172 173 174 175 176 |
<tr style="border: 1px solid lightgrey !important;"> <td rowspan="2" style="border: 1px solid lightgrey !important;;padding:4px; text-align: left;" >Subject</td> <template v-for="(studentData,ind) in value"> |
4ba513413
|
177 |
<td |
bdaae72ca
|
178 179 180 181 182 |
v-if="ind == 0" colspan="2" v-for="studentMark in studentData.studentsMarks" style="border: 1px solid lightgrey !important;padding:10px; text-align: left;" >{{studentMark.markDistributionId.distributionType}}</td> |
74abc502c
|
183 |
<td |
bdaae72ca
|
184 185 186 187 188 189 190 191 192 193 194 |
v-if="ind == 0" style="border: 1px solid lightgrey !important text-align: left;" >Total Marks</td> </template> </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"> |
4ba513413
|
195 |
<td |
bdaae72ca
|
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
style="border: 1px solid lightgrey !important;padding: 10px; text-align: left;" >Marks</td> <td style="border: 1px solid lightgrey !important;padding: 10px; text-align: left;" >Highest Marks</td> </template> </tr> </thead> <tbody style="border: 1px solid lightgrey !important;"> <tr v-for="subject in value" style="border: 1px solid lightgrey !important;" class="tr" > <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; text-align: left;" >{{exam.marksScored}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px; text-align: left;" >{{exam.markDistributionId.markValue}}</td> </template> <td style="border: 1px solid lightgrey !important;padding: 10px; text-align: left;" >{{subject.totalMarks}}</td> </tr> </tbody> </table> </div> </v-card> </v-flex> <!-- ****** TABLE GRADE MARK ****** --> <v-flex xs12 sm12 md8 v-show="showGrade"> <v-card v-for="(value, id, index) in filterData" :key="index" flat style="border: 1px solid lightgrey;margin-bottom:14px;" > <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> <table class="mb-5 tableRsponsive feeTypeTable" style="border: 1px solid lightgrey; |
1d7227237
|
242 243 244 |
border-collapse: collapse;!important table-layout: auto !important; width: 100% !important;" |
bdaae72ca
|
245 246 247 248 249 |
> <thead style="border: 1px solid lightgrey !important;"> <tr class="info white--text" style="border: 1px solid lightgrey !important;padding:4px;" |
1d7227237
|
250 |
> |
bdaae72ca
|
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Subject</td> <td style="border: 1px solid lightgrey !important;padding: 10px;">Grade</td> </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> <td style="border: 1px solid lightgrey !important;padding: 10px;" >{{ subject.grade }}</td> </tr> </tbody> </table> </v-card> <v-card v-if="markData == ''"> <v-layout> <v-flex xs12> <h5 class="text-xs-center pa-3">No Data Found</h5> </v-flex> </v-layout> </v-card> </v-flex> </v-layout> </v-flex> |
006544386
|
277 278 279 280 281 282 283 284 285 286 287 |
</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
|
288 |
import _ from "underscore"; |
006544386
|
289 290 291 |
export default { data: () => ({ |
ec5677f43
|
292 293 |
showLoader: true, nameShow: false, |
66a5c3b75
|
294 295 |
showMark: true, showGrade: false, |
006544386
|
296 297 298 |
markData: [], token: "", markDistributions: [], |
79583580d
|
299 |
markParticularDistributionData: [], |
ec5677f43
|
300 |
filterData: [], |
66a5c3b75
|
301 302 303 304 305 306 307 308 309 |
output: null, gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", gradeC: "C", selectMarkList: "Mark", selectMark: ["Mark", "Grade"], |
67a276510
|
310 311 |
MarkData: "", userData: {} |
006544386
|
312 313 314 315 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); |
67a276510
|
316 |
this.getUserData(); |
006544386
|
317 318 319 |
}, methods: { getMarkList() { |
ec5677f43
|
320 |
this.showLoader = true; |
006544386
|
321 322 323 324 325 326 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
66a5c3b75
|
327 |
this.markData = response.data.data; |
79583580d
|
328 |
let newData = response.data.data; |
4d1fcaddc
|
329 |
// console.log("newData", newData); |
79583580d
|
330 331 332 333 |
for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
4d1fcaddc
|
334 |
// console.log("this.filterData", this.filterData); |
79583580d
|
335 |
for (let data in this.filterData) { |
79583580d
|
336 |
for (let item in this.filterData[data]) { |
79583580d
|
337 |
var totalMarks = 0; |
006544386
|
338 |
for ( |
79583580d
|
339 340 341 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
342 |
) { |
4d1fcaddc
|
343 344 |
// console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] // .marksScored) |
79583580d
|
345 346 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
347 |
} |
79583580d
|
348 |
this.filterData[data][item].totalMarks = totalMarks; |
4d1fcaddc
|
349 |
|
66a5c3b75
|
350 351 352 353 354 355 356 357 358 359 360 361 362 |
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
|
363 364 |
} } |
ec5677f43
|
365 |
this.showLoader = false; |
006544386
|
366 367 |
}) .catch(error => { |
006544386
|
368 369 370 371 372 373 374 375 376 |
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
|
377 378 379 380 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
66a5c3b75
|
381 |
}, |
67a276510
|
382 383 384 385 386 387 388 |
getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { |
25205ccca
|
389 390 391 392 393 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
67a276510
|
394 395 |
}); }, |
66a5c3b75
|
396 397 398 399 400 401 402 403 |
selectMarkData(select) { if (select == "Mark") { this.showMark = true; this.showGrade = false; } else if (select == "Grade") { this.showGrade = true; this.showMark = false; } |
006544386
|
404 405 406 407 408 409 |
} } }; </script> <style scoped> |
68d742034
|
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
.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; } |
4ba513413
|
426 |
/* table { |
006544386
|
427 428 429 |
border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
430 431 432 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
433 434 435 436 437 |
text-align: center; } table.feeTypeTable { table-layout: auto !important; width: 100% !important; |
4ba513413
|
438 |
} */ |
006544386
|
439 440 441 442 443 444 445 446 447 448 449 450 |
.bg-sky { background-color: #98b2cc !important; } .bg-sky-light { background-color: #89a0b8; } .bg-purple { background-color: #9583ac; } .bg-skyDark { background-color: #956785; } |
ec5677f43
|
451 452 453 454 455 456 457 458 459 460 |
.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; } |
bdaae72ca
|
461 |
/* .tr:nth-child(odd){background-color: #f2f2f2} */ |
ec5677f43
|
462 463 464 465 466 |
.loader > div { position: relative; top: calc(50% - 16px); } |
006544386
|
467 468 |
@media screen and (max-width: 380px) { .tableRsponsive { |
d4735dce7
|
469 |
/* display: block; */ |
006544386
|
470 471 472 473 |
position: relative; overflow: scroll; } } |
74abc502c
|
474 |
</style> |