Blame view
src/pages/Mark/viewMark.vue
13.5 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> |
74abc502c
|
26 |
<v-card flat style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px"> |
d4735dce7
|
27 |
<v-layout> |
25205ccca
|
28 |
<v-flex xs12 sm12 md12 class="text-xs-center"> |
74abc502c
|
29 30 31 32 33 34 35 36 |
<!-- <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> |
d4735dce7
|
37 38 |
<p class="title">{{ userData.name }}</p> <p>{{ userData.address }}</p> |
67a276510
|
39 |
</v-flex> |
4ba513413
|
40 41 42 43 |
</v-layout> <v-layout wrap> <v-flex xs12 sm12 md12 class="text-xs-center"> <v-card class="student-card" xs6 sm6 md6> |
74abc502c
|
44 45 |
<v-avatar style="padding-top: 8%"> <img src="/static/icon/user.png" v-if="!markData[0].studentId.profilePicUrl" /> |
4ba513413
|
46 |
<img |
74abc502c
|
47 48 |
:src="markData[0].studentId.profilePicUrl" v-else-if="markData[0].studentId.profilePicUrl" |
4ba513413
|
49 50 |
/> </v-avatar> |
74abc502c
|
51 52 53 54 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 |
<v-layout style=" padding-top: 8%"> <v-flex xs6 sm6 class="pa-0"> <h4 class="right"> <b>Name :</b> </h4> </v-flex> <v-flex sm6 xs6 class="pa-0"> <h4>{{ markData[0].studentId.name }}</h4> </v-flex> </v-layout> <v-layout style=" padding-top: 8%"> <v-flex xs6 sm6 class="pa-0"> <h4 class="right"> <b>Class :</b> </h4> </v-flex> <v-flex sm6 xs6 class="pa-0"> <h4>{{ markData[0].classId.classNum }}</h4> </v-flex> </v-layout> <v-layout style=" padding-top: 8%"> <v-flex xs6 sm6 class="pa-0"> <h4 class="right"> <b>Section :</b> </h4> </v-flex> <v-flex sm6 xs6 class="pa-0"> <h4>{{ markData[0].sectionId.name }}</h4> </v-flex> </v-layout> <v-layout style=" padding-top: 8%"> <v-flex xs6 sm6 class="pa-0"> <h4 class="right"> <b>Roll No :</b> </h4> </v-flex> <v-flex sm6 xs6 class="pa-0"> <h4>{{ markData[0].studentId.rollNo }}</h4> </v-flex> </v-layout> <!-- <p |
4ba513413
|
92 |
style="font-size:20px;margin:0px;margin-bottom:4px;" |
74abc502c
|
93 |
>{{ markData[0].studentId.name }}</p> |
4ba513413
|
94 95 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
74abc502c
|
96 |
>Class : {{ markData[0].classId.classNum }}</p> |
4ba513413
|
97 98 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
74abc502c
|
99 |
>Section : {{ markData[0].sectionId.name }}</p> |
4ba513413
|
100 101 |
<p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" |
74abc502c
|
102 |
>Roll No : {{ markData[0].studentId.rollNo }}</p> --> |
4ba513413
|
103 104 |
</v-card> <v-card class="student-table" xs6 sm6 md6> |
74abc502c
|
105 |
<!-- <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> --> |
4ba513413
|
106 |
<table |
74abc502c
|
107 108 |
v-for="(value, id) in filterData" :key="id" |
4ba513413
|
109 110 111 112 113 114 115 116 |
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;"> |
74abc502c
|
117 |
<v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title> |
4ba513413
|
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 |
<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> |
4ba513413
|
145 146 147 148 149 150 151 |
</tr> </thead> <tbody style="border: 1px solid lightgrey !important;"> <tr v-for="subject in value" style="border: 1px solid lightgrey !important;" > |
74abc502c
|
152 |
<td |
4ba513413
|
153 |
style="border: 1px solid lightgrey !important;padding: 10px;" |
74abc502c
|
154 |
>{{subject.subjectName}}</td> |
4ba513413
|
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
<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
|
170 171 |
</v-flex> </v-layout> |
ec5677f43
|
172 173 174 |
</v-card> </v-flex> </v-layout> |
006544386
|
175 176 177 178 179 180 181 182 183 184 185 |
</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
|
186 |
import _ from "underscore"; |
006544386
|
187 188 189 |
export default { data: () => ({ |
ec5677f43
|
190 191 |
showLoader: true, nameShow: false, |
66a5c3b75
|
192 193 |
showMark: true, showGrade: false, |
006544386
|
194 195 196 |
markData: [], token: "", markDistributions: [], |
79583580d
|
197 |
markParticularDistributionData: [], |
ec5677f43
|
198 |
filterData: [], |
66a5c3b75
|
199 200 201 202 203 204 205 206 207 |
output: null, gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", gradeC: "C", selectMarkList: "Mark", selectMark: ["Mark", "Grade"], |
67a276510
|
208 209 |
MarkData: "", userData: {} |
006544386
|
210 211 212 213 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); |
67a276510
|
214 |
this.getUserData(); |
006544386
|
215 216 217 |
}, methods: { getMarkList() { |
ec5677f43
|
218 |
this.showLoader = true; |
006544386
|
219 220 221 222 223 224 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
66a5c3b75
|
225 |
this.markData = response.data.data; |
79583580d
|
226 |
let newData = response.data.data; |
4d1fcaddc
|
227 |
// console.log("newData", newData); |
79583580d
|
228 229 230 231 |
for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
4d1fcaddc
|
232 |
// console.log("this.filterData", this.filterData); |
79583580d
|
233 |
for (let data in this.filterData) { |
79583580d
|
234 |
for (let item in this.filterData[data]) { |
79583580d
|
235 |
var totalMarks = 0; |
006544386
|
236 |
for ( |
79583580d
|
237 238 239 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
240 |
) { |
4d1fcaddc
|
241 242 |
// console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] // .marksScored) |
79583580d
|
243 244 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
245 |
} |
79583580d
|
246 |
this.filterData[data][item].totalMarks = totalMarks; |
4d1fcaddc
|
247 |
|
66a5c3b75
|
248 249 250 251 252 253 254 255 256 257 258 259 260 |
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
|
261 262 |
} } |
ec5677f43
|
263 |
this.showLoader = false; |
006544386
|
264 265 |
}) .catch(error => { |
006544386
|
266 267 268 269 270 271 272 273 274 |
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
|
275 276 277 278 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
66a5c3b75
|
279 |
}, |
67a276510
|
280 281 282 283 284 285 286 |
getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { |
25205ccca
|
287 288 289 290 291 |
// if (error.response.status === 401) { // this.$router.replace({ path: "/" }); // this.$store.dispatch("setToken", null); // this.$store.dispatch("Id", null); // } |
67a276510
|
292 293 |
}); }, |
66a5c3b75
|
294 295 296 297 298 299 300 301 |
selectMarkData(select) { if (select == "Mark") { this.showMark = true; this.showGrade = false; } else if (select == "Grade") { this.showGrade = true; this.showMark = false; } |
006544386
|
302 303 304 305 306 307 |
} } }; </script> <style scoped> |
4ba513413
|
308 309 310 311 312 313 314 315 316 |
.student-card { float: left; width: 20%; height: 70%; } .student-table { margin-left: 28%; height: -webkit-fill-available; } |
68d742034
|
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
.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
|
333 |
/* table { |
006544386
|
334 335 336 |
border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
337 338 339 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
340 341 342 343 344 |
text-align: center; } table.feeTypeTable { table-layout: auto !important; width: 100% !important; |
4ba513413
|
345 |
} */ |
006544386
|
346 347 348 349 350 351 352 353 354 355 356 357 |
.bg-sky { background-color: #98b2cc !important; } .bg-sky-light { background-color: #89a0b8; } .bg-purple { background-color: #9583ac; } .bg-skyDark { background-color: #956785; } |
ec5677f43
|
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
.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
|
373 374 |
@media screen and (max-width: 380px) { .tableRsponsive { |
d4735dce7
|
375 |
/* display: block; */ |
006544386
|
376 377 378 379 |
position: relative; overflow: scroll; } } |
74abc502c
|
380 |
</style> |