From a690a86fb95089591233c907b0f171637d9ac301 Mon Sep 17 00:00:00 2001 From: Neeraj Sharma Date: Wed, 19 Aug 2020 20:33:35 +0530 Subject: [PATCH] implement meet functinlaity and id card issues --- index.html | 5 +- src/event.js | 2 + src/pages/Authentication/Login.vue | 4 +- src/pages/Dashboard/LiveOnlineClass.vue | 62 ++++--- src/pages/Report/idCard.vue | 300 ++++++++++++++++---------------- 5 files changed, 199 insertions(+), 174 deletions(-) diff --git a/index.html b/index.html index d33db19..a313ce9 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,8 @@ School Management - + + - +
diff --git a/src/event.js b/src/event.js index 5f8c5f0..94cc07a 100644 --- a/src/event.js +++ b/src/event.js @@ -30,6 +30,7 @@ export default [{ this.$store.dispatch('Role', null) this.$store.dispatch('setSchoolToken', null) this.$store.dispatch('setSchoolRole', null) + localStorage.removeItem("teacherName") this.$router.replace({ path: '/' }); } else if (this.$store.state.role === "ACCOUNTANT") { this.$store.dispatch('setToken', null) @@ -51,6 +52,7 @@ export default [{ this.$store.dispatch('Role', null) this.$store.dispatch('setSchoolToken', null) this.$store.dispatch('setSchoolRole', null) + localStorage.removeItem("studentName") this.$router.replace({ path: '/' }); } } diff --git a/src/pages/Authentication/Login.vue b/src/pages/Authentication/Login.vue index 4583e42..7d28ccf 100644 --- a/src/pages/Authentication/Login.vue +++ b/src/pages/Authentication/Login.vue @@ -147,6 +147,7 @@ export default { this.$store.dispatch("setToken", response.data.data.token); this.$store.dispatch("Id", response.data.data.id); this.$store.dispatch("Role", response.data.data.role); + localStorage.setItem("teacherName", response.data.data.name); this.$router.push("/dashboard"); } else if (response.data.data.role === "LIBRARIAN") { this.$store.dispatch("setToken", response.data.data.token); @@ -225,7 +226,8 @@ export default { } else { this.selectedStudent = response.data.data.students[counter]._id; - + var studentName = response.data.data.students[counter].name; + localStorage.setItem("studentName", studentName); localStorage.setItem( "parentStudentId", this.selectedStudent diff --git a/src/pages/Dashboard/LiveOnlineClass.vue b/src/pages/Dashboard/LiveOnlineClass.vue index 2b91a9b..ee3fa56 100644 --- a/src/pages/Dashboard/LiveOnlineClass.vue +++ b/src/pages/Dashboard/LiveOnlineClass.vue @@ -163,6 +163,7 @@ export default { async startChat() { if (this.$store.state.role === "PARENT") { if (this.counter == 0) { + console.log("enter start chat"); this.startConference(); this.counter += 1; } @@ -225,16 +226,16 @@ export default { teacherName: "", romm: "", }; - - this.api = new JitsiMeetExternalAPI(domain, options); - this.api.addEventListener("videoConferenceJoined", () => { + _this.api = new JitsiMeetExternalAPI(domain, options); + console.log("this.api ", this.api); + _this.api.addEventListener("videoConferenceJoined", () => { console.log("Local User Joined"); _this.api.executeCommand("displayName", _this.username); - _this.api.executeCommand("password", _this.roomPassword); + _this.api.executeCommand("password", this_.roomPassword); }); - this.api.on("readyToClose", () => { - this.$router.push({name:"Refresh"}) + _this.api.on("readyToClose", () => { + this.$router.push({ name: "Refresh" }); }); } catch (error) { console.error("Failed to load Jitsi API", error); @@ -267,24 +268,33 @@ export default { .then((response) => { // this.addSection = response.data.data; console.log("CREATE___ROOOM", response.data); - this.room = response.data.data.roomName; - - // this.username = response.data.data.LiveClasses.teacherName; - this.roomPassword = response.data.data.password; - + var room = response.data.data.roomName; + var username = localStorage.getItem("teacherName") + var roomPassword = response.data.data.password; + console.log( + "room", + room, + "username", + username, + "roomPassword", + roomPassword + ); var this_ = this; - if (this.username != "" || this.room != "") { + if (username != "" || room != "") { if (window.JitsiMeetExternalAPI) { // var person = prompt("Please enter your name:", "Rabie"); - if (this_.username != null || this_.username != "") { - this.username = this.username; + if (username != null || username != "") { + this_.username = username; } // var room = prompt("Please enter your room:", "Test Room"); - if (this_.room != null || this_.room != "") { - this.room = this.room; + if (room != null || room != "") { + this_.room = room; + } + if (roomPassword != null || roomPassword != "") { + this_.password = roomPassword; } - this.startConference(); } else alert("Jitsi Meet API script not loaded"); + this_.startConference(); } this.showLoader = false; }) @@ -320,20 +330,23 @@ export default { } else { this.liveLink = response.data.data[0].link; var room = response.data.data[0].roomName; - var username = response.data.data[0].teacherId.name; - this.roomPassword = response.data.data[0].password; + var username = this.currentUser; + var roomPassword = response.data.data[0].password; var this_ = this; - console.log(this.room, this.roomPassword, this.username); + // console.log(this.room, this.roomPassword, this.username); if (username != "" || room != "") { if (window.JitsiMeetExternalAPI) { // var person = prompt("Please enter your name:", "Rabie"); if (username != null || username != "") { - this.username = username; + this_.username = username; + } + if (roomPassword != null || roomPassword != "") { + this_.roomPassword = roomPassword; } // var room = prompt("Please enter your room:", "Test Room"); if (room != null || room != "") { - this.room = room; + this_.room = room; } // this.startConference(); } @@ -343,6 +356,11 @@ export default { }, async created() { + console.log( + "this.$store.state.studentsData", + this.$store.state.studentsData[0].name + ); + this.currentUser = localStorage.getItem("studentName"); this.token = this.$store.state.token; if (this.$store.state.role === "PARENT") { await this.studentClasses(); diff --git a/src/pages/Report/idCard.vue b/src/pages/Report/idCard.vue index 5667d4d..07f9909 100644 --- a/src/pages/Report/idCard.vue +++ b/src/pages/Report/idCard.vue @@ -168,245 +168,249 @@ - - - - -
+
+ + +
-
- - shape - - + + - - - schoollogo + + + schoollogo - schoollogo - - - profileImage + + profileImage - dummy - + alt="dummy" + src="/static/icon/user.png" + v-if="!getCard.profilePicUrl && getCard.role != '2'" + /> + -

- {{ getCard.name}} -

-

- {{ getCard.gender}} -

-

{{ getCard.classId.classNum }}

-

{{ getCard.sectionId.name }}

-

Roll: {{ getCard.rollNo }}

-

{{ dates(getCard.joinDate) }}

-

{{ dates(getCard.joiningDate) }}

-

{{ getCard.phone }}

-

- {{ getCard.mobile}} - {{ getCard.mobileNo }} -

-

{{ getCard.mobile}} + {{ getCard.mobileNo }} +

+

{{ getCard.email}}

- -
- - - - - schoollogo - schoollogo -

- {{ getCard.name}} -

+ > + {{ getCard.name}} +

-

{{ getCard.city}}

-

- {{ getCard.address }} - {{ getCard.presentAddress }} - ({{ getCard.state }}) -

-

({{ getCard.state }}) +

+

{{ getCard.establishmentYear }}

-
-
- - shape2 + /> +
-
- - - + + +
@@ -560,9 +564,7 @@ export default { prindIDCardReport() { // Pass the element id here - this.$htmlToPaper("printMe"); - - + this.$htmlToPaper("printMe"); }, getUserData() { this.getSelectUserData = []; -- 2.0.0