Blame view
src/pages/Mark/viewMark.vue
11.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 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 92 93 |
<v-layout> <v-flex xs12 sm12> <v-btn class="grey" dark @click="print()"> Print <v-icon right dark>print</v-icon> </v-btn> </v-flex> </v-layout> <v-flex xs12 sm12 id="printMe"> <v-layout wrap> <v-flex xs12 sm12 md3> <v-card class="fixcolors white--text" flat> <v-card-actions class="pa-0"> <v-spacer></v-spacer> <v-card-title class="pa-2"> <h3>Profile</h3> </v-card-title> <v-spacer></v-spacer> </v-card-actions> </v-card> <v-card flat> <v-layout wrap v-for="(value, id, index) in filterData" v-if="index == 0" :key="index" > <v-flex xs12 style="margin:16px;"> <v-layout> <v-flex xs12> <v-avatar size="100px" class="mx-auto" style="margin: auto;display:block;margin-bottom:10px !important" > <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> </v-flex> </v-layout> <v-layout> <v-flex xs12 style="text-align:center;"> <h3> <b>{{ value[0].studentId.name }}</b> </h3> <p class="grey--text">Student</p> </v-flex> </v-layout> <v-layout style="border: 1px solid lightgrey;padding: 4px;border-top-right-radius: 4px; border-top-left-radius: 4px;" > <v-flex xs6 sm3 class="py-1"> <h4> <b>RollNo</b> </h4> </v-flex> <v-flex sm9 xs7 class="py-1"> <h4>: {{ value[0].studentId.rollNo }}</h4> </v-flex> </v-layout> <v-layout style="border: 1px solid lightgrey;padding: 4px;"> <v-flex xs6 sm3 class="py-1"> <h4> <b>Class</b> </h4> </v-flex> <v-flex sm9 xs8 class="py-1"> <h4>: {{value[0].classId.classNum }}</h4> </v-flex> </v-layout> <v-layout style="border: 1px solid lightgrey;padding: 4px;border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;" > <v-flex xs6 sm3 class> <h4> <b>Section</b> </h4> </v-flex> <v-flex sm9 xs6 class> <h4>: {{ value[0].sectionId.name}}</h4> </v-flex> </v-layout> </v-flex> </v-layout> |
c9880acad
|
94 |
<v-layout v-if="filterData === []"> |
37150e7c1
|
95 96 97 98 |
<v-flex xs12> <h5 class="text-xs-center pa-3">No Data Found</h5> </v-flex> </v-layout> |
ec5677f43
|
99 100 |
</v-card> </v-flex> |
495e4037c
|
101 |
|
ec5677f43
|
102 |
<!-- ****** TABLE DATA MARK ****** --> |
495e4037c
|
103 |
|
ec5677f43
|
104 105 106 |
<v-flex xs12 sm12 md9> <v-card class="fixcolors white--text" flat> <v-card-actions class="pa-0"> |
79583580d
|
107 |
<v-spacer></v-spacer> |
ec5677f43
|
108 |
<v-card-title class="pa-2"> |
79583580d
|
109 |
<h3>Mark</h3> |
ec5677f43
|
110 |
</v-card-title> |
79583580d
|
111 |
<v-spacer></v-spacer> |
ec5677f43
|
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 145 146 147 148 149 150 151 152 153 |
</v-card-actions> </v-card> <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; border-collapse: collapse;!important table-layout: auto !important; width: 100% !important;" > <thead style="border: 1px solid lightgrey !important;"> <tr class="info white--text" style="border: 1px solid lightgrey !important;padding:4px;" > <td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> <td colspan="2" v-for="exam in value[index].studentsMarks" style="border: 1px solid lightgrey !important;padding: 10px;" >{{exam.markDistributionId.distributionType}}</td> <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td> </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 class="bg-sky white--text" style="border: 1px solid lightgrey !important;padding: 10px;" >Mark</td> |
79583580d
|
154 |
<td |
ec5677f43
|
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
class="bg-sky-light white--text" style="border: 1px solid lightgrey !important;padding: 10px;" >Highest Mark</td> </template> <td class="bg-sky white--text" 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> <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> |
37150e7c1
|
185 186 187 188 189 190 191 |
<v-card v-if="filterData === []"> <v-layout> <v-flex xs12> <h5 class="text-xs-center pa-3">No Data Found</h5> </v-flex> </v-layout> </v-card> |
ec5677f43
|
192 193 |
</v-flex> </v-layout> |
006544386
|
194 195 196 197 198 199 200 201 202 203 204 |
</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
|
205 |
import _ from "underscore"; |
006544386
|
206 207 208 |
export default { data: () => ({ |
ec5677f43
|
209 210 |
showLoader: true, nameShow: false, |
006544386
|
211 212 213 |
markData: [], token: "", markDistributions: [], |
79583580d
|
214 |
markParticularDistributionData: [], |
ec5677f43
|
215 216 |
filterData: [], output: null |
006544386
|
217 218 219 220 221 222 223 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); }, methods: { getMarkList() { |
ec5677f43
|
224 |
this.showLoader = true; |
006544386
|
225 226 227 228 229 230 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
79583580d
|
231 232 233 234 235 |
let newData = response.data.data; for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
79583580d
|
236 |
for (let data in this.filterData) { |
79583580d
|
237 |
for (let item in this.filterData[data]) { |
79583580d
|
238 |
var totalMarks = 0; |
006544386
|
239 |
for ( |
79583580d
|
240 241 242 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
243 |
) { |
79583580d
|
244 245 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
246 |
} |
79583580d
|
247 |
this.filterData[data][item].totalMarks = totalMarks; |
006544386
|
248 249 |
} } |
79583580d
|
250 251 252 253 254 |
// var aray = []; // this.markData = response.data.data; // for (let i = 0; i < this.markData.length; i++) { // console.log(this.markData[i].examId.examName); // let index = -1; |
79583580d
|
255 256 257 258 259 260 261 262 263 264 265 266 267 |
// aray.forEach((dat_, k) => { // if (dat_.category == this.markData[i].examId.examName) { // index = k; // } // }); // if (index == -1) { // var obj = { // category: this.markData[i].examId.examName, // extraData: [] // }; // obj.extraData.push(this.markData[i]); // aray.push(obj); // } else { |
79583580d
|
268 269 |
// aray[index].extraData.push(this.markData[i]); // } |
ec5677f43
|
270 |
this.showLoader = false; |
006544386
|
271 272 273 274 275 276 277 278 279 280 281 282 |
}) .catch(error => { // console.log("err====>", err); 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
|
283 284 285 286 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
006544386
|
287 288 289 290 291 292 293 294 295 296 |
} } }; </script> <style scoped> table { border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
297 298 299 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
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
|
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
.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
|
333 334 335 336 337 338 339 |
@media screen and (max-width: 380px) { .tableRsponsive { display: block; position: relative; overflow: scroll; } } |
ec5677f43
|
340 |
</style> |