Blame view
src/pages/Mark/viewMark.vue
11.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 23 |
</v-layout> <v-flex xs12 sm12 id="printMe"> <v-layout wrap> |
67a276510
|
24 25 |
<!-- ****** TABLE DATA MARK ****** --> <v-flex xs12 sm12 md12> |
ec5677f43
|
26 27 28 29 |
<v-card 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 33 34 35 36 37 38 39 40 41 42 43 44 |
<!-- <v-layout> <v-flex xs12> <v-btn class="add-button right" round dark @click="printStudentReport()"> Print <v-icon right dark>print</v-icon> </v-btn> </v-flex> </v-layout> --> <v-layout> <v-flex xs12 class="text-xs-center"> <img :src="userData.schoolLogoUrl" width="140" alt="logo" /> <p class="title">{{ userData.name }}</p> <p>{{ userData.address }}</p> |
67a276510
|
45 46 47 48 |
</v-flex> </v-layout> <v-layout style="padding-top:10px" v-if="index === 0"> <v-flex xs5> |
67a276510
|
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 |
<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;" >Roll NO : {{ value[0].studentId.rollNo }}</p> <p style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;" >Section : {{ value[0].sectionId.name }}</p> </v-flex> <v-flex xs2> <v-avatar size="100"> <img :src="value[0].studentId.profilePicUrl" v-if="value[0].studentId.profilePicUrl" width="100px" /> <img src="/static/icon/user.png" v-else-if="!value[0].studentId.profilePicUrl" width="100px" /> </v-avatar> </v-flex> </v-layout> |
ec5677f43
|
77 78 79 80 81 82 |
<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; |
67a276510
|
83 |
width: 100% !important; |
d4735dce7
|
84 |
" |
ec5677f43
|
85 86 |
> <thead style="border: 1px solid lightgrey !important;"> |
67a276510
|
87 |
<tr style="border: 1px solid lightgrey !important;padding:4px;"> |
ec5677f43
|
88 89 90 91 |
<td rowspan="2" style="border: 1px solid lightgrey !important;padding: 10px;" >Subject</td> |
4d1fcaddc
|
92 93 94 95 96 97 98 99 |
<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
|
100 101 102 103 104 105 106 |
</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
|
107 108 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> <td style="border: 1px solid lightgrey !important;padding: 10px;">Highest Mark</td> |
ec5677f43
|
109 |
</template> |
d4735dce7
|
110 |
<td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td> |
ec5677f43
|
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
</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
|
135 136 137 138 139 140 141 142 143 144 145 |
</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
|
146 |
import _ from "underscore"; |
006544386
|
147 148 149 |
export default { data: () => ({ |
ec5677f43
|
150 151 |
showLoader: true, nameShow: false, |
66a5c3b75
|
152 153 |
showMark: true, showGrade: false, |
006544386
|
154 155 156 |
markData: [], token: "", markDistributions: [], |
79583580d
|
157 |
markParticularDistributionData: [], |
ec5677f43
|
158 |
filterData: [], |
66a5c3b75
|
159 160 161 162 163 164 165 166 167 |
output: null, gradeAPlus: "A+", gradeA: "A", gradeBPlus: "B+", gradeB: "B", gradeCPlus: "C+", gradeC: "C", selectMarkList: "Mark", selectMark: ["Mark", "Grade"], |
67a276510
|
168 169 |
MarkData: "", userData: {} |
006544386
|
170 171 172 173 |
}), mounted() { this.token = this.$store.state.token; this.getMarkList(); |
67a276510
|
174 |
this.getUserData(); |
006544386
|
175 176 177 |
}, methods: { getMarkList() { |
ec5677f43
|
178 |
this.showLoader = true; |
006544386
|
179 180 181 182 183 184 |
http() .get("/getParticularMark", { params: { studentId: this.$route.params.markId }, headers: { Authorization: "Bearer " + this.token } }) .then(response => { |
66a5c3b75
|
185 |
this.markData = response.data.data; |
79583580d
|
186 |
let newData = response.data.data; |
4d1fcaddc
|
187 |
// console.log("newData", newData); |
79583580d
|
188 189 190 191 |
for (var i = 0; i < newData.length; i++) { newData[i].examination = newData[i].examId._id; } this.filterData = _.groupBy(newData, ["examination"]); |
4d1fcaddc
|
192 |
// console.log("this.filterData", this.filterData); |
79583580d
|
193 |
for (let data in this.filterData) { |
79583580d
|
194 |
for (let item in this.filterData[data]) { |
79583580d
|
195 |
var totalMarks = 0; |
006544386
|
196 |
for ( |
79583580d
|
197 198 199 |
let i = 0; i < this.filterData[data][item].studentsMarks.length; i++ |
006544386
|
200 |
) { |
4d1fcaddc
|
201 202 |
// console.log("this.filterData[data][item].studentsMarks[i]",this.filterData[data][item].studentsMarks[i] // .marksScored) |
79583580d
|
203 204 |
totalMarks += this.filterData[data][item].studentsMarks[i] .marksScored; |
006544386
|
205 |
} |
79583580d
|
206 |
this.filterData[data][item].totalMarks = totalMarks; |
4d1fcaddc
|
207 |
|
66a5c3b75
|
208 209 210 211 212 213 214 215 216 217 218 219 220 |
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
|
221 222 |
} } |
ec5677f43
|
223 |
this.showLoader = false; |
006544386
|
224 225 |
}) .catch(error => { |
006544386
|
226 227 228 229 230 231 232 233 234 |
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
|
235 236 237 238 |
}, print() { // Pass the element id here this.$htmlToPaper("printMe"); |
66a5c3b75
|
239 |
}, |
67a276510
|
240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
getUserData() { http() .get("/getParticularUserDetail") .then(response => { this.userData = response.data.data; }) .catch(error => { if (error.response.status === 401) { this.$router.replace({ path: "/" }); this.$store.dispatch("setToken", null); this.$store.dispatch("Id", null); } }); }, |
66a5c3b75
|
254 255 256 257 258 259 260 261 |
selectMarkData(select) { if (select == "Mark") { this.showMark = true; this.showGrade = false; } else if (select == "Grade") { this.showGrade = true; this.showMark = false; } |
006544386
|
262 263 264 265 266 267 |
} } }; </script> <style scoped> |
68d742034
|
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
.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
|
284 285 286 287 |
table { border-collapse: collapse; border: 1px solid #e2e7eb; } |
006544386
|
288 289 290 |
th, td { border: 1px solid #e2e7eb; |
006544386
|
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
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
|
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
.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
|
324 325 |
@media screen and (max-width: 380px) { .tableRsponsive { |
d4735dce7
|
326 |
/* display: block; */ |
006544386
|
327 328 329 330 |
position: relative; overflow: scroll; } } |
ec5677f43
|
331 |
</style> |