|
@@ -59,7 +59,7 @@ export const myMixin = {
|
|
role: this.userJson.type =='1'?'老师':'学生',
|
|
role: this.userJson.type =='1'?'老师':'学生',
|
|
browser: browser,
|
|
browser: browser,
|
|
userTime: userTime == "1" ? _time : userTime, // 使用时间 1次的就1 其次传秒
|
|
userTime: userTime == "1" ? _time : userTime, // 使用时间 1次的就1 其次传秒
|
|
- loadTime: loadTime, //load的时间没有就“”
|
|
|
|
|
|
+ loadTime: loadTime, //load的时间没有就""
|
|
object: JSON.stringify(object), //执行信息传json
|
|
object: JSON.stringify(object), //执行信息传json
|
|
status: status //成功返回success。失败返回error的信息
|
|
status: status //成功返回success。失败返回error的信息
|
|
};
|
|
};
|
|
@@ -78,6 +78,48 @@ export const myMixin = {
|
|
console.log("保存失败");
|
|
console.log("保存失败");
|
|
console.log(e);
|
|
console.log(e);
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ // 新增:上课/备课数据实时同步接口
|
|
|
|
+ async syncClassData(classData) {
|
|
|
|
+ if (!this.$route.query.userid) return
|
|
|
|
+ try {
|
|
|
|
+ if(!this.userJson || !this.userJson.accountNumber){
|
|
|
|
+ let res = await this.ajax.get(this.$store.state.api + "selectUser", {
|
|
|
|
+ userid: this.$route.query.userid
|
|
|
|
+ });
|
|
|
|
+ this.userJson = res.data[0][0]
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ return this.syncClassData(classData);
|
|
|
|
+ }
|
|
|
|
+ let courseGrade = await this.ajax.get(this.$store.state.api + "getClassById", { id: classData.courseGrade });
|
|
|
|
+ let params = {
|
|
|
|
+ "serverName": "深教AI6",
|
|
|
|
+ "dataType": 1,
|
|
|
|
+ "teacherName": this.userJson.username,
|
|
|
|
+ "teacherAccount": this.userJson.accountNumber,
|
|
|
|
+ "teacherPhone": this.userJson.phonenumber,
|
|
|
|
+ "eduId": this.userJson.sessionid,
|
|
|
|
+ "schoolName": this.userJson.schoolName,
|
|
|
|
+ "area": this.schooldest,
|
|
|
|
+ "courseId": classData.courseId,
|
|
|
|
+ "courseName": classData.title,
|
|
|
|
+ "courseGrade": courseGrade.data[0][0].name,
|
|
|
|
+ "courseTime": classData.courseTime,
|
|
|
|
+ "startTime": classData.startTime,
|
|
|
|
+ "endTime": classData.endTime
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ const response = await this.ajax.post(
|
|
|
|
+ this.$store.state.apiSz + 'sync/class',
|
|
|
|
+ params
|
|
|
|
+ );
|
|
|
|
+ return { success: true, data: response.data };
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error("同步失败:", error);
|
|
|
|
+ return { success: false, msg: error };
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|