Blame view
src/pages/Mark/viewMark.vue
15.6 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> |
4ba513413
|
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> |
4ba513413
|
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> |
4ba513413
|
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
</v-flex>--> </v-layout> <v-layout wrap> <v-flex xs12 sm12 md12 class="text-xs-center"> <v-card class="student-card" xs6 sm6 md6> <v-avatar> <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" /> </v-avatar> <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;" >Class : {{ value[0].classId.classNum }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Section : {{ value[0].sectionId.name }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Roll No : {{ value[0].studentId.rollNo }}</p> </v-card> <v-card class="student-table" xs6 sm6 md6> <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> <table class="mb-5 tableRsponsive feeTypeTable subheading" style="border: 1px solid black; border-collapse: collapse;!important table-layout: auto !important; width: 100% !important; overflow: hidden;" > <thead style="border: 1px solid lightgrey !important;"> <tr style="border: 1px solid lightgrey !important;padding:4px;"> <td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> <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 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"> <td style="border: 1px solid lightgrey !important;padding: 10px;">Marks</td> <td style="border: 1px solid lightgrey !important;padding: 10px;" >Highest Marks</td> </template> <!-- <td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</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;"></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> |
67a276510
|
145 146 |
</v-flex> </v-layout> |
4ba513413
|
147 |
<!-- <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> |
ec5677f43
|
148 149 150 151 152 |
<table class="mb-5 tableRsponsive feeTypeTable" style="border: 1px solid lightgrey; border-collapse: collapse;!important table-layout: auto !important; |
67a276510
|
153 |
width: 100% !important; |
46993dc1d
|
154 |
overflow: hidden;" |
ec5677f43
|
155 156 |
> <thead style="border: 1px solid lightgrey !important;"> |
67a276510
|
157 |
<tr style="border: 1px solid lightgrey !important;padding:4px;"> |
ec5677f43
|
158 159 160 161 |
<td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> |
4d1fcaddc
|
162 163 164 165 166 167 |
<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> |
46993dc1d
|
168 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Total Marks</td> |
4d1fcaddc
|
169 |
</template> |
ec5677f43
|
170 171 172 173 174 175 176 |
</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"> |
46993dc1d
|
177 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Marks</td> |
4ba513413
|
178 179 180 |
<td style="border: 1px solid lightgrey !important;padding: 10px;" >Highest Marks</td> |
ec5677f43
|
181 |
</template> |
4ba513413
|
182 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> |
ec5677f43
|
183 184 185 186 |
</tr> </thead> <tbody style="border: 1px solid lightgrey !important;"> <tr v-for="subject in value" style="border: 1px solid lightgrey !important;"> |
4ba513413
|
187 |
<td |
ec5677f43
|
188 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
4ba513413
|
189 |
>{{subject.subjectName}}</td> |
8627b2890
|
190 |
<td style="border: 1px solid lightgrey !important;padding: 10px;"></td> |
ec5677f43
|
191 192 193 194 195 196 197 198 199 200 201 202 203 |
<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> |
4ba513413
|
204 |
</table>--> |
ec5677f43
|
205 206 207 |
</v-card> </v-flex> </v-layout> |
006544386
|
208 209 210 211 212 213 214 215 216 217 218 |
</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
|
219 |
import _ from "underscore"; |
006544386
|
220 221 222 |
export default { data: () => ({ |
ec5677f43
|
223 224 |
showLoader: true, nameShow: false, |
66a5c3b75
|
225 226 |
showMark: true, showGrade: false, |
006544386
|
227 228 229 |
markData: [], token: "", markDistributions: [], |
79583580d
|
230 |
markParticularDistributionData: [], |
ec5677f43
|
231 |
filterData: [], |
66a5c3b75
|
232 233 234 235 236 237 238 239 240 |
output: null, gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", gradeC: "C", selectMarkList: "Mark", selectMark: ["Mark", "Grade"], |
67a276510
|
241 242 |
MarkData: "", userData: {} |
006544386
|
243 244 245 246 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); |
67a276510
|
247 |
this.getUserData(); |
006544386
|
248 249 250 |
}, methods: { getMarkList() { |
ec5677f43
|
251 |
this.showLoader = true; |
006544386
|
252 253 254 255 256 257 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
66a5c3b75
|
258 |
this.markData = response.data.data; |
79583580d
|
259 |
let newData = response.data.data; |
4d1fcaddc
|
260 |
// console.log("newData", newData); |
79583580d
|
261 262 263 264 |
for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
4d1fcaddc
|
265 |
// console.log("this.filterData", this.filterData); |
79583580d
|
266 |
for (let data in this.filterData) { |
79583580d
|
267 |
for (let item in this.filterData[data]) { |
79583580d
|
268 |
var totalMarks = 0; |
006544386
|
269 |
for ( |
79583580d
|
270 271 272 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
273 |
) { |
4d1fcaddc
|
274 275 |
// console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] // .marksScored) |
79583580d
|
276 277 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
278 |
} |
79583580d
|
279 |
this.filterData[data][item].totalMarks = totalMarks; |
4d1fcaddc
|
280 |
|
66a5c3b75
|
281 282 283 284 285 286 287 288 289 290 291 292 293 |
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
|
294 295 |
} } |
ec5677f43
|
296 |
this.showLoader = false; |
006544386
|
297 298 |
}) .catch(error => { |
006544386
|
299 300 301 302 303 304 305 306 307 |
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
|
308 309 310 311 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
66a5c3b75
|
312 |
}, |
67a276510
|
313 314 315 316 317 318 319 |
getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { |
25205ccca
|
320 321 322 323 324 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
67a276510
|
325 326 |
}); }, |
66a5c3b75
|
327 328 329 330 331 332 333 334 |
selectMarkData(select) { if (select == "Mark") { this.showMark = true; this.showGrade = false; } else if (select == "Grade") { this.showGrade = true; this.showMark = false; } |
006544386
|
335 336 337 338 339 340 |
} } }; </script> <style scoped> |
4ba513413
|
341 342 343 344 345 346 347 348 349 |
.student-card { float: left; width: 20%; height: 70%; } .student-table { margin-left: 28%; height: -webkit-fill-available; } |
68d742034
|
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
.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
|
366 |
/* table { |
006544386
|
367 368 369 |
border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
370 371 372 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
373 374 375 376 377 |
text-align: center; } table.feeTypeTable { table-layout: auto !important; width: 100% !important; |
4ba513413
|
378 |
} */ |
006544386
|
379 380 381 382 383 384 385 386 387 388 389 390 |
.bg-sky { background-color: #98b2cc !important; } .bg-sky-light { background-color: #89a0b8; } .bg-purple { background-color: #9583ac; } .bg-skyDark { background-color: #956785; } |
ec5677f43
|
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
.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
|
406 407 |
@media screen and (max-width: 380px) { .tableRsponsive { |
d4735dce7
|
408 |
/* display: block; */ |
006544386
|
409 410 411 412 |
position: relative; overflow: scroll; } } |
ec5677f43
|
413 |
</style> |