|
@@ -760,7 +760,8 @@ export default {
|
|
showClassNum: false,
|
|
showClassNum: false,
|
|
showMemberlist: true,
|
|
showMemberlist: true,
|
|
currentMemberList: {},
|
|
currentMemberList: {},
|
|
- customMemberlist: [], //最後存到偏好設定的自訂名單
|
|
|
|
|
|
+ customMemberlist: [], //最後存到偏好設定的自訂名單,
|
|
|
|
+ currentTA:'',
|
|
showGptBox:false,
|
|
showGptBox:false,
|
|
checkGptExtensionInstalled:false,
|
|
checkGptExtensionInstalled:false,
|
|
isWaitingGptFeedbackDone:false,
|
|
isWaitingGptFeedbackDone:false,
|
|
@@ -1384,14 +1385,14 @@ export default {
|
|
let classnum = sessionStorage.getItem("classNum");
|
|
let classnum = sessionStorage.getItem("classNum");
|
|
// let classname = sessionStorage.getItem('classname')
|
|
// let classname = sessionStorage.getItem('classname')
|
|
// let TeachDeviceId = sessionStorage.getItem('deviceId')
|
|
// let TeachDeviceId = sessionStorage.getItem('deviceId')
|
|
- this.shareQRInfo.gn = classnum; //教室編號
|
|
|
|
- this.shareQRInfo.pin = "8888"; //4數字驗證碼
|
|
|
|
- this.shareQRInfo.host = "CC"; //必須是大寫的CC代表教師端類型
|
|
|
|
- let serverLocation = this.$jsFn.isCN() ? "cn" : "global";
|
|
|
|
- this.shareQRCode = profile.irs5Url[serverLocation] + "/?m=" + encodeURIComponent(this.$t("login.loginBox.qrcode.text4"), "utf-8") + "&o=1"; // 配合HiTA5新掃碼的功能
|
|
|
|
- this.shareQRCode += "&s=" + this.encode64(JSON.stringify(this.shareQRInfo)); //大陸數據中心, 全球就要另外換
|
|
|
|
- this.qrcodeIRS5link = profile.irs5Url[serverLocation].replace("https://", "");
|
|
|
|
- this.innerVisible = true;
|
|
|
|
|
|
+ this.shareQRInfo.gn = classnum //教室編號
|
|
|
|
+ this.shareQRInfo.pin = '8888' //4數字驗證碼
|
|
|
|
+ this.shareQRInfo.ip = ''
|
|
|
|
+ let serverLocation = this.$jsFn.isCN() ? 'cn' : 'global'
|
|
|
|
+ this.shareQRCode = profile.irs5Url[serverLocation]
|
|
|
|
+ this.shareQRCode += '/?s=' + this.encode64(JSON.stringify(this.shareQRInfo)) //大陸數據中心, 全球就要另外換
|
|
|
|
+ this.qrcodeIRS5link = profile.irs5Url[serverLocation].replace('https://', '')
|
|
|
|
+ this.innerVisible = true
|
|
// 二维码内容 地址內容
|
|
// 二维码内容 地址內容
|
|
this.qrcode = this.shareQRCode;
|
|
this.qrcode = this.shareQRCode;
|
|
// 使用$nextTick确保数据渲染
|
|
// 使用$nextTick确保数据渲染
|
|
@@ -3616,13 +3617,13 @@ export default {
|
|
if (fileType === "pdf") {
|
|
if (fileType === "pdf") {
|
|
this.stageScreenShotToImgArr(slide, 1);
|
|
this.stageScreenShotToImgArr(slide, 1);
|
|
|
|
|
|
- let layerInfo = await that.layer.clone(); // 画布内容提取
|
|
|
|
|
|
+ let layerInfo = await that.layer.clone() // 画布内容提取
|
|
|
|
|
|
console.log(layerInfo, "最新的背景圖次序");
|
|
console.log(layerInfo, "最新的背景圖次序");
|
|
|
|
|
|
- that.saveArr[slide - 1 + ""] = layerInfo;
|
|
|
|
- console.log(that.saveArr, "页面的提取");
|
|
|
|
- await sessionStorage.setItem("stageInfo", JSON.stringify(that.saveArr));
|
|
|
|
|
|
+ that.saveArr[slide - 1 + ''] = layerInfo
|
|
|
|
+ console.log(that.saveArr, '页面的提取')
|
|
|
|
+ await sessionStorage.setItem('stageInfo', JSON.stringify(that.saveArr))
|
|
|
|
|
|
that.stage.clear();
|
|
that.stage.clear();
|
|
console.log(slideNext, "页数页数页数");
|
|
console.log(slideNext, "页数页数页数");
|
|
@@ -3901,8 +3902,8 @@ export default {
|
|
//避免无线循环发送接收消息
|
|
//避免无线循环发送接收消息
|
|
if (stateinfo && stateinfo.sender != userSub) {
|
|
if (stateinfo && stateinfo.sender != userSub) {
|
|
//因为频道10秒广播一次state,所以这里要屏蔽掉自己的发的广播
|
|
//因为频道10秒广播一次state,所以这里要屏蔽掉自己的发的广播
|
|
- console.log("收到消息后调用发送消息方法了!!");
|
|
|
|
- that.singnalRMessage(stateinfo, "8888", message.ConnectionId);
|
|
|
|
|
|
+ console.log('收到消息后调用发送消息方法了!!')
|
|
|
|
+ that.singnalRMessage(stateinfo, '8888', message.ConnectionId)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function onDisconnected(message) {
|
|
function onDisconnected(message) {
|
|
@@ -3910,7 +3911,39 @@ export default {
|
|
message.id = this.IMcounter++; // vue transitions need an id
|
|
message.id = this.IMcounter++; // vue transitions need an id
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //防止當頁狀態跑掉獨立送normal 給webIRS
|
|
|
|
|
|
+ sendAcktoTA(messages){
|
|
|
|
+ let user = JSON.parse(sessionStorage.getItem("user"));
|
|
|
|
+ let channelapi = this.imConnect.channel_api + "/messages";
|
|
|
|
+ let sender = user.sub;
|
|
|
|
+ let receive=[this.currentTA]
|
|
|
|
+ let messageText = {
|
|
|
|
+ action: "Ack",
|
|
|
|
+ clientType: "HiTeachCC",
|
|
|
|
+ sender: "HiTeachCC-" + sender,
|
|
|
|
+ timestamp: new Date().getTime(),
|
|
|
|
+ waitReturn: false,
|
|
|
|
+ payload: {
|
|
|
|
+ ack_Action: messages.action,
|
|
|
|
+ ack_Timestamp: messages.timestamp,
|
|
|
|
+ error: "",
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ this.$api
|
|
|
|
+ .tomessage(channelapi, {
|
|
|
|
+ connectionId: "",
|
|
|
|
+ sender: sender,
|
|
|
|
+ isPrivate: true,
|
|
|
|
+ groupname: null,
|
|
|
|
+ to: receive,
|
|
|
|
+ Text: JSON.stringify(messageText),
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log(res, "消息发送成功");
|
|
|
|
+ })
|
|
|
|
+ .catch((res) => {
|
|
|
|
+ console.log(res, "消息发送失败");
|
|
|
|
+ });
|
|
|
|
+ },
|
|
sendCloseClass() {
|
|
sendCloseClass() {
|
|
let user = JSON.parse(sessionStorage.getItem("user"));
|
|
let user = JSON.parse(sessionStorage.getItem("user"));
|
|
let channelapi = this.imConnect.channel_api + "/messages";
|
|
let channelapi = this.imConnect.channel_api + "/messages";
|
|
@@ -3948,8 +3981,9 @@ export default {
|
|
});
|
|
});
|
|
this.$store.state.currentState = "Class.Close";
|
|
this.$store.state.currentState = "Class.Close";
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ //防止當頁狀態跑掉獨立送normal 給webIRS
|
|
sendNormalInCurrentPage() {
|
|
sendNormalInCurrentPage() {
|
|
|
|
+ let randomId = this.genID();
|
|
let messages = {
|
|
let messages = {
|
|
action: "State.Get",
|
|
action: "State.Get",
|
|
clientType: "HiTeachCC",
|
|
clientType: "HiTeachCC",
|
|
@@ -3974,10 +4008,67 @@ export default {
|
|
collateType: "None",
|
|
collateType: "None",
|
|
examFileURL: "",
|
|
examFileURL: "",
|
|
mode: "Normal",
|
|
mode: "Normal",
|
|
|
|
+ content: {
|
|
|
|
+ id: randomId,
|
|
|
|
+ exercise: {
|
|
|
|
+ answer: [],
|
|
|
|
+ blankCount: 0,
|
|
|
|
+ children: [],
|
|
|
|
+ createTime: 0,
|
|
|
|
+ creator: "",
|
|
|
|
+ explain: "",
|
|
|
|
+ type: "Single",
|
|
|
|
+ knowledges: [],
|
|
|
|
+ objective: false,
|
|
|
|
+ order: 0,
|
|
|
|
+ opts: 4,
|
|
|
|
+ field: 1,
|
|
|
|
+ level: 3,
|
|
|
|
+ periodId: "",
|
|
|
|
+ gradeIds: [],
|
|
|
|
+ repair: [],
|
|
|
|
+ subjectId: "",
|
|
|
|
+ scope: null,
|
|
|
|
+ score: 10,
|
|
|
|
+ },
|
|
|
|
+ render: 0,
|
|
|
|
+ item: [
|
|
|
|
+ {
|
|
|
|
+ question: "_popquiz_",
|
|
|
|
+ option: [
|
|
|
|
+ { code: "A", timeStamp: 0 },
|
|
|
|
+ { code: "B", timeStamp: 0 },
|
|
|
|
+ { code: "C", timeStamp: 0 },
|
|
|
|
+ { code: "D", timeStamp: 0 },
|
|
|
|
+ { code: "E", timeStamp: 0 },
|
|
|
|
+ { code: "F", timeStamp: 0 },
|
|
|
|
+ { code: "G", timeStamp: 0 },
|
|
|
|
+ { code: "H", timeStamp: 0 },
|
|
|
|
+ { code: "I", timeStamp: 0 },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ blob: null,
|
|
|
|
+ lite: false,
|
|
|
|
+ repair: [],
|
|
|
|
+ contentQuestionCategory: "Knowledge",
|
|
|
|
+ concept: "",
|
|
|
|
+ keyword: "",
|
|
|
|
+ questionAnsweredState: "Unanswered",
|
|
|
|
+ questionDurationTime: "00:00:00",
|
|
|
|
+ questionIndex: 0,
|
|
|
|
+ questionLocationType: "Local",
|
|
|
|
+ questionRenderType: "Htex",
|
|
|
|
+ questionSpendTime: "00:00:00",
|
|
|
|
+ shaCode: "",
|
|
|
|
+ totalAnsweredMemberCount: 0,
|
|
|
|
+ },
|
|
pageID: this.nowpageRender.nowpageIds,
|
|
pageID: this.nowpageRender.nowpageIds,
|
|
pagePushHistory: this.pagePushHistory,
|
|
pagePushHistory: this.pagePushHistory,
|
|
resourcePushHistory: [],
|
|
resourcePushHistory: [],
|
|
messagePushHistory: this.messagePushHistory,
|
|
messagePushHistory: this.messagePushHistory,
|
|
|
|
+ currentTA:this.currentTA,
|
|
|
|
+
|
|
};
|
|
};
|
|
//学生加入教室一系列操作
|
|
//学生加入教室一系列操作
|
|
let messageText = {
|
|
let messageText = {
|
|
@@ -4008,6 +4099,7 @@ export default {
|
|
},
|
|
},
|
|
/*signalR发送消息*/
|
|
/*signalR发送消息*/
|
|
async singnalRMessage(message, pincode, connectionId, statusname) {
|
|
async singnalRMessage(message, pincode, connectionId, statusname) {
|
|
|
|
+ let that=this
|
|
//發給之後廣播使用
|
|
//發給之後廣播使用
|
|
if (statusname != undefined) {
|
|
if (statusname != undefined) {
|
|
this.$store.state.currentState = statusname;
|
|
this.$store.state.currentState = statusname;
|
|
@@ -4032,9 +4124,98 @@ export default {
|
|
let classnum = sessionStorage.getItem("classNum");
|
|
let classnum = sessionStorage.getItem("classNum");
|
|
let time = Math.floor(Date.now());
|
|
let time = Math.floor(Date.now());
|
|
//学生加入教室一系列操作
|
|
//学生加入教室一系列操作
|
|
- var messageText = {};
|
|
|
|
- if (messages.action === "Announce.Ask") {
|
|
|
|
|
|
+ var messageText = {}
|
|
|
|
+ if (messages.clientType == 'TA') {
|
|
|
|
+ that.currentTA=messages.sender
|
|
|
|
+ //針對TA畫板控制獨立動作
|
|
|
|
+ switch (messages.action) {
|
|
|
|
+ case 'Board.Ctrl': {
|
|
|
|
+ this.$refs.hd.boardCtrlbyTA(messages.payload.BoardAction)
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ case 'IRS.Ctrl': {
|
|
|
|
+ this.$refs.hd.irsCtrlbyTA(messages.payload)
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ case 'Timer.Ctrl': {
|
|
|
|
+ let waitingPopupTimer
|
|
|
|
+ clearTimeout(waitingPopupTimer)
|
|
|
|
+ if (messages.payload.Operation.toLowerCase() == 'start') {
|
|
|
|
+ this.toolIndexList.push(2)
|
|
|
|
+
|
|
|
|
+ let timer = Number(messages.payload.Time) / 1000
|
|
|
|
+ let hours = Math.floor(timer / 3600)
|
|
|
|
+ let minutes = Math.floor((timer % 3600) / 60)
|
|
|
|
+ let seconds = Math.floor(timer % 60)
|
|
|
|
+
|
|
|
|
+ hours = minutes < 10 ? '0' + hours : hours
|
|
|
|
+ minutes = minutes < 10 ? '0' + minutes : minutes
|
|
|
|
+ seconds = seconds < 10 ? '0' + seconds : seconds
|
|
|
|
+
|
|
|
|
+ waitingPopupTimer = setTimeout(() => {
|
|
|
|
+ if (this.$refs?.ButtonTimer) {
|
|
|
|
+ this.$refs.ButtonTimer.handleReset()
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (this.$refs?.ButtonTimer) {
|
|
|
|
+ this.$refs.ButtonTimer.minuteVal = minutes.toString()
|
|
|
|
+ this.$refs.ButtonTimer.secondVal = seconds.toString()
|
|
|
|
+ this.$refs.ButtonTimer.countDown()
|
|
|
|
+ }
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
|
|
+ }, 1000)
|
|
|
|
+ }
|
|
|
|
+ if (messages.payload.Operation.toLowerCase() == 'stop') {
|
|
|
|
+ if (this.$refs?.ButtonTimer) this.$refs.ButtonTimer.onhandlePause()
|
|
|
|
+ } else if (messages.payload.Operation.toLowerCase() == 'close') {
|
|
|
|
+ if (this.$refs?.ButtonTimer) this.$refs.ButtonTimer.handleReset()
|
|
|
|
+ this.toolIndexList.splice(this.toolIndexList.indexOf(2, 1))
|
|
|
|
+ this.$store.state.timerIsStart = false
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ case 'Pickup.Ctrl': {
|
|
|
|
+ if (!this.toolIndexList.includes(1)) {
|
|
|
|
+ this.toolIndexList.push(1)
|
|
|
|
+ let waitingPopupTimer
|
|
|
|
+ clearTimeout(waitingPopupTimer)
|
|
|
|
+
|
|
|
|
+ waitingPopupTimer = setTimeout(() => {
|
|
|
|
+ that.$refs.TurnTable.pickOne()
|
|
|
|
+ }, 1000)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ this.handleCloseTool(1)
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ case 'Media.Push': {
|
|
|
|
+ const works= messages.payload.MediaList.map(item=>item.source)
|
|
|
|
+ this.$store.state.timeLineEvent.push({
|
|
|
|
+ Time: (Math.floor(Date.now()) - this.$store.state.startTime) / 1000,
|
|
|
|
+ Pgid: this.nowpageRender.nowpageIds,
|
|
|
|
+ EventId: 917529,
|
|
|
|
+ Event: "WrkCmp",
|
|
|
|
+ WrkCmpSrcTypeId: 655440,
|
|
|
|
+ WrkCmpSrcType: "HitaClientCmp",
|
|
|
|
+ WrkCmpCount: messages.payload.MediaList.length,
|
|
|
|
+ WrkType: 0,
|
|
|
|
+ Works:works,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ for (let i in messages.payload.MediaList) {
|
|
|
|
+ let link=messages.payload.MediaList[i]
|
|
|
|
+ that.$refs.addImgBox.addTAImgObj(that.classInfo.blob.url + '/records/' + that.activityRecordNumberS + link.source, i,messages.payload.MediaList.length )
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (messages.action === 'Announce.Ask') {
|
|
//加入教室返回相应课程相关信息
|
|
//加入教室返回相应课程相关信息
|
|
|
|
+ if(messages.clientType=='TA') this.sendAcktoTA(messages)
|
|
messageText = {
|
|
messageText = {
|
|
payload: {
|
|
payload: {
|
|
announceURL: "",
|
|
announceURL: "",
|
|
@@ -4063,39 +4244,22 @@ export default {
|
|
clientType: "HiTeachCC",
|
|
clientType: "HiTeachCC",
|
|
sender: "HiTeachCC-" + sender,
|
|
sender: "HiTeachCC-" + sender,
|
|
timestamp: time,
|
|
timestamp: time,
|
|
- waitReturn: false,
|
|
|
|
- };
|
|
|
|
- } else if (messages.action === "MemberBinding") {
|
|
|
|
- // 過濾是否為先前登入
|
|
|
|
- console.log(this.students, "this.students");
|
|
|
|
- console.log(this.currentMemberList, "currentMemberList");
|
|
|
|
- this.students = this.$store.state.students;
|
|
|
|
- let filterStudy = this.students.filter((item) => {
|
|
|
|
- return item.accountid == messages.payload.memberID;
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- let onlineClients = this.students.filter((item) => {
|
|
|
|
- return item.status == "online";
|
|
|
|
- });
|
|
|
|
|
|
+ waitReturn: false
|
|
|
|
+ }
|
|
|
|
+ } else if (messages.action === 'MemberBinding') {
|
|
|
|
+ console.log('MemberBinding')
|
|
|
|
+ if (messages.clientType == 'TA') {
|
|
|
|
+ this.sendAcktoTA(messages)
|
|
|
|
+ console.log(messages, 'MemberBinding')
|
|
|
|
|
|
- if (onlineClients.length >= this.limitClient && filterStudy.length == 0) {
|
|
|
|
- // 額滿
|
|
|
|
- if (this.limitClientHint === false) {
|
|
|
|
- this.$Message.info({
|
|
|
|
- content: this.$t("board['偵測到有請求加入,但加入教室人數已達您的權限人數上限']") + ":" + this.limitClient,
|
|
|
|
- duration: 5,
|
|
|
|
- });
|
|
|
|
- this.limitClientHint = true;
|
|
|
|
- }
|
|
|
|
|
|
+ let blobUrl = this.classInfo.blob
|
|
|
|
|
|
- let blobUrl = this.classInfo.blob;
|
|
|
|
- // this.seatNum = Number(this.seatNum) + 1
|
|
|
|
messageText = {
|
|
messageText = {
|
|
payload: {
|
|
payload: {
|
|
activityRecordNumber: this.activityRecordNumberS,
|
|
activityRecordNumber: this.activityRecordNumberS,
|
|
- id: null,
|
|
|
|
|
|
+ id: messages.payload.hostID,
|
|
seatID: 0,
|
|
seatID: 0,
|
|
- name: messages.payload.memberName,
|
|
|
|
|
|
+ name: messages.payload.hostName,
|
|
className: this.className,
|
|
className: this.className,
|
|
schoolId: this.schoolId,
|
|
schoolId: this.schoolId,
|
|
schoolName: this.schoolName,
|
|
schoolName: this.schoolName,
|
|
@@ -4104,132 +4268,76 @@ export default {
|
|
blobSAS: blobUrl.sas,
|
|
blobSAS: blobUrl.sas,
|
|
blobSAS_Write: blobUrl.sas_write,
|
|
blobSAS_Write: blobUrl.sas_write,
|
|
blobSAS_Read: blobUrl.sas_read,
|
|
blobSAS_Read: blobUrl.sas_read,
|
|
- errorCode: 307,
|
|
|
|
- resourcePushHistory: [],
|
|
|
|
- messagePushHistory: this.messagePushHistory,
|
|
|
|
|
|
+ errorCode: 0
|
|
},
|
|
},
|
|
- action: "BindingResult",
|
|
|
|
- clientType: "HiTeachCC",
|
|
|
|
- sender: "HiTeachCC-" + sender,
|
|
|
|
|
|
+ action: 'BindingResult',
|
|
|
|
+ clientType: 'HiTeachCC',
|
|
|
|
+ sender: 'HiTeachCC-' + sender,
|
|
timestamp: time,
|
|
timestamp: time,
|
|
waitReturn: false,
|
|
waitReturn: false,
|
|
- };
|
|
|
|
- } else if (onlineClients.length <= this.limitClient) {
|
|
|
|
- // 加入
|
|
|
|
- console.log(onlineClients.length, this.limitClient);
|
|
|
|
- //绑定request(座位号及相关学生个人信息)
|
|
|
|
- this.seatNum = Number(this.seatNum) + 1;
|
|
|
|
- let blobUrl = this.classInfo.blob;
|
|
|
|
- console.log(blobUrl, "BLOB相关信息");
|
|
|
|
- messageText = {
|
|
|
|
- payload: {
|
|
|
|
- activityRecordNumber: this.activityRecordNumberS,
|
|
|
|
- id: messages.payload.memberID,
|
|
|
|
- seatID: this.seatNum,
|
|
|
|
- name: messages.payload.memberName,
|
|
|
|
- className: this.className,
|
|
|
|
- schoolId: this.schoolId,
|
|
|
|
- schoolName: this.schoolName,
|
|
|
|
- hostBlobUrl: blobUrl.url,
|
|
|
|
- clientBlobUrl: blobUrl.url,
|
|
|
|
- blobSAS: blobUrl.sas,
|
|
|
|
- blobSAS_Write: blobUrl.sas_write,
|
|
|
|
- blobSAS_Read: blobUrl.sas_read,
|
|
|
|
- errorCode: 0,
|
|
|
|
- resourcePushHistory: [],
|
|
|
|
- messagePushHistory: this.messagePushHistory,
|
|
|
|
- },
|
|
|
|
- action: "BindingResult",
|
|
|
|
- clientType: "HiTeachCC",
|
|
|
|
- sender: "HiTeachCC-" + sender,
|
|
|
|
- timestamp: time,
|
|
|
|
- waitReturn: false,
|
|
|
|
- };
|
|
|
|
- //确认学生加入和把学生加入到 学生列表
|
|
|
|
- this.studentAlone = {
|
|
|
|
- id: messages.sender,
|
|
|
|
- accountid: messages.payload.memberID,
|
|
|
|
- studentName: messages.payload.memberName,
|
|
|
|
- sendTime: time,
|
|
|
|
- headImg: "",
|
|
|
|
- };
|
|
|
|
|
|
+ isNewTA: false
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 不是TA,其餘視為IRS學生
|
|
|
|
+ // 過濾是否為先前登入
|
|
|
|
+ this.students = this.$store.state.students
|
|
|
|
+ let filterStudy = this.students.filter(item => {
|
|
|
|
+ return item.accountid == messages.payload.memberID
|
|
|
|
+ })
|
|
|
|
|
|
- let oneStudent = {
|
|
|
|
- sort: this.seatNum,
|
|
|
|
- id: this.studentAlone.id,
|
|
|
|
- accountid: this.studentAlone.accountid,
|
|
|
|
- studentName: this.studentAlone.studentName,
|
|
|
|
- sendTime: this.studentAlone.sendTime,
|
|
|
|
- headImg: this.studentAlone.headImg,
|
|
|
|
- option: "",
|
|
|
|
- done: true,
|
|
|
|
- score: 0,
|
|
|
|
- rank: "",
|
|
|
|
- class: "studyboxone",
|
|
|
|
- showcardclass: "brand",
|
|
|
|
- answerclass: "studyboxone",
|
|
|
|
- answerbrand: "brand",
|
|
|
|
- statement: "", //发言,
|
|
|
|
- status: "online",
|
|
|
|
- type: 0,
|
|
|
|
- };
|
|
|
|
|
|
+ let onlineClients = this.students.filter(item => {
|
|
|
|
+ return item.status == 'online'
|
|
|
|
+ })
|
|
|
|
|
|
- console.log(filterStudy, "filter的返回值, 若有找到表示重新加入原本就在名單裡");
|
|
|
|
- if (filterStudy.length == 0) {
|
|
|
|
- // 全新加入
|
|
|
|
- this.students.push(oneStudent);
|
|
|
|
- this.memberList.push({
|
|
|
|
- memberID: oneStudent.accountid,
|
|
|
|
- memberName: oneStudent.studentName,
|
|
|
|
- seatID: oneStudent.sort,
|
|
|
|
- groupName: null,
|
|
|
|
- groupID: null,
|
|
|
|
- isHiGroup: false,
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.seatNum = Number(this.seatNum) - 1; //Reclaim exist Seat Number
|
|
|
|
- // 如果 accountid 已經存在, 但是 deviceid 不同踢掉先前加入的
|
|
|
|
- if (filterStudy[0].id != this.studentAlone.id && filterStudy[0].id != "") {
|
|
|
|
- messageText = {
|
|
|
|
- action: "FuckOff",
|
|
|
|
- clientType: "HiTeachCC",
|
|
|
|
- sender: "HiTeachCC-" + sender,
|
|
|
|
- timestamp: time,
|
|
|
|
- waitReturn: false,
|
|
|
|
- isNewTA: false,
|
|
|
|
- };
|
|
|
|
- console.log(messageText, filterStudy[0].id, "發送踢人消息");
|
|
|
|
- this.$api
|
|
|
|
- .tomessage(channelapi, {
|
|
|
|
- connectionId: connectionId,
|
|
|
|
- sender: sender,
|
|
|
|
- isPrivate: true,
|
|
|
|
- groupname: null,
|
|
|
|
- to: [filterStudy[0].id],
|
|
|
|
- Text: JSON.stringify(messageText),
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- console.log(res, "消息发送成功");
|
|
|
|
- })
|
|
|
|
- .catch((res) => {
|
|
|
|
- console.log(res, "消息发送失败");
|
|
|
|
- });
|
|
|
|
|
|
+ if (onlineClients.length >= this.limitClient && filterStudy.length == 0) {
|
|
|
|
+ // 額滿
|
|
|
|
+ if (this.limitClientHint === false) {
|
|
|
|
+ this.$Message.info({
|
|
|
|
+ content: this.$t("board['偵測到有請求加入,但加入教室人數已達您的權限人數上限']") + ':' + this.limitClient,
|
|
|
|
+ duration: 5
|
|
|
|
+ })
|
|
|
|
+ this.limitClientHint = true
|
|
}
|
|
}
|
|
- //處理 device id 可能有重複的狀況
|
|
|
|
- this.students.forEach((item) => {
|
|
|
|
- if (item.id == this.studentAlone.id) {
|
|
|
|
- item.id = "";
|
|
|
|
- item.status = "offline";
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
|
|
- // 回應加入
|
|
|
|
|
|
+ let blobUrl = this.classInfo.blob
|
|
|
|
+ // this.seatNum = Number(this.seatNum) + 1
|
|
|
|
+ messageText = {
|
|
|
|
+ payload: {
|
|
|
|
+ activityRecordNumber: this.activityRecordNumberS,
|
|
|
|
+ id: null,
|
|
|
|
+ seatID: 0,
|
|
|
|
+ name: messages.payload.memberName,
|
|
|
|
+ className: this.className,
|
|
|
|
+ schoolId: this.schoolId,
|
|
|
|
+ schoolName: this.schoolName,
|
|
|
|
+ hostBlobUrl: blobUrl.url,
|
|
|
|
+ clientBlobUrl: blobUrl.url,
|
|
|
|
+ blobSAS: blobUrl.sas,
|
|
|
|
+ blobSAS_Write: blobUrl.sas_write,
|
|
|
|
+ blobSAS_Read: blobUrl.sas_read,
|
|
|
|
+ errorCode: 307,
|
|
|
|
+ resourcePushHistory: [],
|
|
|
|
+ messagePushHistory: this.messagePushHistory
|
|
|
|
+ },
|
|
|
|
+ action: 'BindingResult',
|
|
|
|
+ clientType: 'HiTeachCC',
|
|
|
|
+ sender: 'HiTeachCC-' + sender,
|
|
|
|
+ timestamp: time,
|
|
|
|
+ waitReturn: false
|
|
|
|
+ }
|
|
|
|
+ } else if (onlineClients.length <= this.limitClient) {
|
|
|
|
+ // 加入
|
|
|
|
+ console.log(onlineClients.length, this.limitClient)
|
|
|
|
+ //绑定request(座位号及相关学生个人信息)
|
|
|
|
+ this.seatNum = Number(this.seatNum) + 1
|
|
|
|
+ let blobUrl = this.classInfo.blob
|
|
|
|
+ console.log(blobUrl, 'BLOB相关信息')
|
|
messageText = {
|
|
messageText = {
|
|
payload: {
|
|
payload: {
|
|
activityRecordNumber: this.activityRecordNumberS,
|
|
activityRecordNumber: this.activityRecordNumberS,
|
|
- id: filterStudy[0].accountid,
|
|
|
|
- seatID: filterStudy[0].sort,
|
|
|
|
- name: filterStudy[0].studentName,
|
|
|
|
|
|
+ id: messages.payload.memberID,
|
|
|
|
+ seatID: this.seatNum,
|
|
|
|
+ name: messages.payload.memberName,
|
|
className: this.className,
|
|
className: this.className,
|
|
schoolId: this.schoolId,
|
|
schoolId: this.schoolId,
|
|
schoolName: this.schoolName,
|
|
schoolName: this.schoolName,
|
|
@@ -4240,34 +4348,139 @@ export default {
|
|
blobSAS_Read: blobUrl.sas_read,
|
|
blobSAS_Read: blobUrl.sas_read,
|
|
errorCode: 0,
|
|
errorCode: 0,
|
|
resourcePushHistory: [],
|
|
resourcePushHistory: [],
|
|
- messagePushHistory: this.messagePushHistory,
|
|
|
|
|
|
+ messagePushHistory: this.messagePushHistory
|
|
},
|
|
},
|
|
- action: "BindingResult",
|
|
|
|
- clientType: "HiTeachCC",
|
|
|
|
- sender: "HiTeachCC-" + sender,
|
|
|
|
|
|
+ action: 'BindingResult',
|
|
|
|
+ clientType: 'HiTeachCC',
|
|
|
|
+ sender: 'HiTeachCC-' + sender,
|
|
timestamp: time,
|
|
timestamp: time,
|
|
- waitReturn: false,
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
|
|
+ waitReturn: false
|
|
|
|
+ }
|
|
|
|
+ //确认学生加入和把学生加入到 学生列表
|
|
|
|
+ this.studentAlone = {
|
|
|
|
+ id: messages.sender,
|
|
|
|
+ accountid: messages.payload.memberID,
|
|
|
|
+ studentName: messages.payload.memberName,
|
|
|
|
+ sendTime: time,
|
|
|
|
+ headImg: ''
|
|
|
|
+ }
|
|
|
|
|
|
- // replace device id/status for reclaim
|
|
|
|
- for (let ii = 0; ii < this.students.length; ++ii) {
|
|
|
|
- if (this.students[ii].accountid == this.studentAlone.accountid) {
|
|
|
|
- this.students[ii].id = this.studentAlone.id;
|
|
|
|
- if (this.studentAlone.studentName) (this.students[ii].studentName = this.studentAlone.studentName), (this.students[ii].status = "online");
|
|
|
|
- break;
|
|
|
|
|
|
+ let oneStudent = {
|
|
|
|
+ sort: this.seatNum,
|
|
|
|
+ id: this.studentAlone.id,
|
|
|
|
+ accountid: this.studentAlone.accountid,
|
|
|
|
+ studentName: this.studentAlone.studentName,
|
|
|
|
+ sendTime: this.studentAlone.sendTime,
|
|
|
|
+ headImg: this.studentAlone.headImg,
|
|
|
|
+ option: '',
|
|
|
|
+ done: true,
|
|
|
|
+ score: 0,
|
|
|
|
+ rank: '',
|
|
|
|
+ class: 'studyboxone',
|
|
|
|
+ showcardclass: 'brand',
|
|
|
|
+ answerclass: 'studyboxone',
|
|
|
|
+ answerbrand: 'brand',
|
|
|
|
+ statement: '', //发言,
|
|
|
|
+ status: 'online',
|
|
|
|
+ type: 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ console.log(filterStudy, 'filter的返回值, 若有找到表示重新加入原本就在名單裡')
|
|
|
|
+ if (filterStudy.length == 0) {
|
|
|
|
+ // 全新加入
|
|
|
|
+ this.students.push(oneStudent)
|
|
|
|
+ this.memberList.push({
|
|
|
|
+ memberID: oneStudent.accountid,
|
|
|
|
+ memberName: oneStudent.studentName,
|
|
|
|
+ seatID: oneStudent.sort,
|
|
|
|
+ groupName: null,
|
|
|
|
+ groupID: null,
|
|
|
|
+ isHiGroup: false
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.seatNum = Number(this.seatNum) - 1 //Reclaim exist Seat Number
|
|
|
|
+ // 如果 accountid 已經存在, 但是 deviceid 不同踢掉先前加入的
|
|
|
|
+ if (filterStudy[0].id != this.studentAlone.id && filterStudy[0].id != '') {
|
|
|
|
+ messageText = {
|
|
|
|
+ action: 'FuckOff',
|
|
|
|
+ clientType: 'HiTeachCC',
|
|
|
|
+ sender: 'HiTeachCC-' + sender,
|
|
|
|
+ timestamp: time,
|
|
|
|
+ waitReturn: false,
|
|
|
|
+ isNewTA: false
|
|
|
|
+ }
|
|
|
|
+ console.log(messageText, filterStudy[0].id, '發送踢人消息')
|
|
|
|
+ this.$api
|
|
|
|
+ .tomessage(channelapi, {
|
|
|
|
+ connectionId: connectionId,
|
|
|
|
+ sender: sender,
|
|
|
|
+ isPrivate: true,
|
|
|
|
+ groupname: null,
|
|
|
|
+ to: [filterStudy[0].id],
|
|
|
|
+ Text: JSON.stringify(messageText)
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ console.log(res, '消息发送成功')
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ console.log(res, '消息发送失败')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //處理 device id 可能有重複的狀況
|
|
|
|
+ this.students.forEach(item => {
|
|
|
|
+ if (item.id == this.studentAlone.id) {
|
|
|
|
+ item.id = ''
|
|
|
|
+ item.status = 'offline'
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ // 回應加入
|
|
|
|
+ messageText = {
|
|
|
|
+ payload: {
|
|
|
|
+ activityRecordNumber: this.activityRecordNumberS,
|
|
|
|
+ id: filterStudy[0].accountid,
|
|
|
|
+ seatID: filterStudy[0].sort,
|
|
|
|
+ name: filterStudy[0].studentName,
|
|
|
|
+ className: this.className,
|
|
|
|
+ schoolId: this.schoolId,
|
|
|
|
+ schoolName: this.schoolName,
|
|
|
|
+ hostBlobUrl: blobUrl.url,
|
|
|
|
+ clientBlobUrl: blobUrl.url,
|
|
|
|
+ blobSAS: blobUrl.sas,
|
|
|
|
+ blobSAS_Write: blobUrl.sas_write,
|
|
|
|
+ blobSAS_Read: blobUrl.sas_read,
|
|
|
|
+ errorCode: 0,
|
|
|
|
+ resourcePushHistory: [],
|
|
|
|
+ messagePushHistory: this.messagePushHistory
|
|
|
|
+ },
|
|
|
|
+ action: 'BindingResult',
|
|
|
|
+ clientType: 'HiTeachCC',
|
|
|
|
+ sender: 'HiTeachCC-' + sender,
|
|
|
|
+ timestamp: time,
|
|
|
|
+ waitReturn: false,
|
|
|
|
+ isNewTA: false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // replace device id/status for reclaim
|
|
|
|
+ for (let ii = 0; ii < this.students.length; ++ii) {
|
|
|
|
+ if (this.students[ii].accountid == this.studentAlone.accountid) {
|
|
|
|
+ this.students[ii].id = this.studentAlone.id
|
|
|
|
+ if (this.studentAlone.studentName) (this.students[ii].studentName = this.studentAlone.studentName), (this.students[ii].status = 'online')
|
|
|
|
+ break
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ let Ss = 0
|
|
|
|
+ this.students.forEach(item => {
|
|
|
|
+ if (item.status == 'online') Ss++
|
|
|
|
+ if (item.headImg === undefined || item.headImg === '') item.headImg = require('../assets/img/profile-user.svg')
|
|
|
|
+ })
|
|
|
|
+ this.onlineSs = Ss
|
|
|
|
+ console.log(this.students, '学生情况')
|
|
|
|
+ this.$store.state.students = this.students
|
|
}
|
|
}
|
|
- let Ss = 0;
|
|
|
|
- this.students.forEach((item) => {
|
|
|
|
- if (item.status == "online") Ss++;
|
|
|
|
- if (item.headImg === undefined || item.headImg === "") item.headImg = require("../assets/img/profile-user.svg");
|
|
|
|
- });
|
|
|
|
- this.onlineSs = Ss;
|
|
|
|
- console.log(this.students, "学生情况");
|
|
|
|
- this.$store.state.students = this.students;
|
|
|
|
}
|
|
}
|
|
- } else if (messages.action === "Leave") {
|
|
|
|
|
|
+ } else if (messages.action === 'Leave') {
|
|
// 登出
|
|
// 登出
|
|
console.log("Leave ask", messages.sender);
|
|
console.log("Leave ask", messages.sender);
|
|
this.students = this.$store.state.students;
|
|
this.students = this.$store.state.students;
|
|
@@ -4282,6 +4495,10 @@ export default {
|
|
}
|
|
}
|
|
this.onlineSs = Ss;
|
|
this.onlineSs = Ss;
|
|
this.$store.state.students = this.students;
|
|
this.$store.state.students = this.students;
|
|
|
|
+
|
|
|
|
+ if(messages.clientType=='TA'){
|
|
|
|
+ this.currentTA=''
|
|
|
|
+ }
|
|
} else if (messages.action === "State.Get") {
|
|
} else if (messages.action === "State.Get") {
|
|
if (sessionStorage.getItem("fileType") == "pdf") {
|
|
if (sessionStorage.getItem("fileType") == "pdf") {
|
|
let pagenums = sessionStorage.getItem("slide") ? sessionStorage.getItem("slide") - 1 : 0;
|
|
let pagenums = sessionStorage.getItem("slide") ? sessionStorage.getItem("slide") - 1 : 0;
|
|
@@ -4645,6 +4862,8 @@ export default {
|
|
console.log(payloadContent, "重啟作品收集");
|
|
console.log(payloadContent, "重啟作品收集");
|
|
this.irsModel = "irsGather";
|
|
this.irsModel = "irsGather";
|
|
}
|
|
}
|
|
|
|
+ //加入當前TA發送到State
|
|
|
|
+ payloadContent.currentTA=that.currentTA
|
|
|
|
|
|
messageText = {
|
|
messageText = {
|
|
action: "State",
|
|
action: "State",
|
|
@@ -4893,6 +5112,7 @@ export default {
|
|
PushPgNo: this.slidenum,
|
|
PushPgNo: this.slidenum,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
|
|
if (JSON.stringify(messageText) != "{}") {
|
|
if (JSON.stringify(messageText) != "{}") {
|
|
console.log(messageText, "发送的消息");
|
|
console.log(messageText, "发送的消息");
|
|
@@ -6703,7 +6923,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
isAuthWordCloud() {
|
|
isAuthWordCloud() {
|
|
- return this.getFunc("clients").get > 50;
|
|
|
|
|
|
+ return this.getFunc('clients').get > 50
|
|
},
|
|
},
|
|
isAuthAccount() {
|
|
isAuthAccount() {
|
|
//17.授權:(0: 無, 1: ID, 2: 機器, 3: ID+機器) 0不是IES5也沒權益的純登入 1:ID有包含權益, 2.IES5過來的CC就是機器授權 3.:1和2都有
|
|
//17.授權:(0: 無, 1: ID, 2: 機器, 3: ID+機器) 0不是IES5也沒權益的純登入 1:ID有包含權益, 2.IES5過來的CC就是機器授權 3.:1和2都有
|