Browse Source

Merge branch 'beta'

SanHQin 1 week ago
parent
commit
f9025ac7e8

+ 1 - 1
dist/index.html

@@ -37,7 +37,7 @@
       width: 100%;
       width: 100%;
       background: #e6eaf0;
       background: #e6eaf0;
       font-family: '黑体';
       font-family: '黑体';
-    }</style><link href=./static/css/app.5d43c77839d1e1529b9d10b0479dc240.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.2c492f3d5a39df08f4a3.js></script><script type=text/javascript src=./static/js/app.6a814d59d46fa62f4339.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.da1e804cda5731d737ac867b5785147b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.2c492f3d5a39df08f4a3.js></script><script type=text/javascript src=./static/js/app.74f49b6298bbaadce2c0.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.da1e804cda5731d737ac867b5785147b.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.da1e804cda5731d737ac867b5785147b.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/workPage.2c55608a031fd5e271ad61fde5544c55.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/workPage.2c55608a031fd5e271ad61fde5544c55.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/workPage.96513d9dec6a603b15175ab23d5816ac.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.74f49b6298bbaadce2c0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.74f49b6298bbaadce2c0.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.23ea04dc469b57e2b4f8.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/workPage-manifest.2ece51fa34be51c8610a.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/workPage.79b54f7091dd1f18af9f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/workPage.79b54f7091dd1f18af9f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/workPage.e152c1e61cd721df9c82.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/workPage.e152c1e61cd721df9c82.js.map


+ 1 - 1
dist/workPage.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.96513d9dec6a603b15175ab23d5816ac.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b6275e4cf468b42a92b.js></script><script type=text/javascript src=./static/js/workPage.79b54f7091dd1f18af9f.js></script></body></html><script>function stopSafari() {
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.2c55608a031fd5e271ad61fde5544c55.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b6275e4cf468b42a92b.js></script><script type=text/javascript src=./static/js/workPage.e152c1e61cd721df9c82.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {
     document.documentElement.addEventListener("touchstart", function (event) {

+ 35 - 1
src/components/pages/pptEasy/addCourse3.vue

@@ -1272,6 +1272,7 @@ export default {
   watch: {
   watch: {
     steps(newValue) {
     steps(newValue) {
       if (newValue == 4) {
       if (newValue == 4) {
+        this.saveBeiKe()
         if (this.org == "16ace517-b5c7-4168-a9bb-a9e0035df840") {
         if (this.org == "16ace517-b5c7-4168-a9bb-a9e0035df840") {
           try {
           try {
             window.topU.U.UF.F.closeWindow(window.topU.$("#openCourseUpdate"));
             window.topU.U.UF.F.closeWindow(window.topU.$("#openCourseUpdate"));
@@ -3783,6 +3784,38 @@ export default {
       }
       }
       this.courseUrl = url + "/pbl-student-table/dist/#/courseDetail?userid=" + this.userid + "&oid=" + this.oid + "&org=" + this.org + "&courseId=" + this.courseId + "&tType=1&cid=&screenType=2&noLogin=3"
       this.courseUrl = url + "/pbl-student-table/dist/#/courseDetail?userid=" + this.userid + "&oid=" + this.oid + "&org=" + this.org + "&courseId=" + this.courseId + "&tType=1&cid=&screenType=2&noLogin=3"
     },
     },
+    async saveBeiKe(){
+      if(!this.cid) return;
+      let userArray = ['6fbc6471-1d48-11ed-8c78-005056b86db5','333d0dfc-1cd9-11ef-bee5-005056b86db5','6fbce5ef-1d48-11ed-8c78-005056b86db5','66feffcc-ad35-11ed-b13d-005056b86db5']
+      let endTime = await this.getServerTime()
+      let courseTime = Math.max(1, Math.ceil((new Date(endTime) - new Date(this.startTime)) / (1000 * 60)))
+      if ((this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840' || userArray.includes(this.userid))) {
+        this.syncClassData2({
+          courseId: this.cid,
+          title: this.courseName,
+          ctitle: this.courseName,
+          courseGrade: '',
+          courseTime: courseTime,
+          startTime: this.startTime,
+          endTime: endTime,
+        }, 'selectUser')
+        console.log('同步数据')
+      }
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.cid,
+          type: "5",
+          time: courseTime * 60,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addOperationTimeT2", params)
+        .then((res) => { })
+        .catch((err) => {
+          console.error(err);
+        });
+    }
   },
   },
   beforeDestroy() {
   beforeDestroy() {
 
 
@@ -3797,7 +3830,8 @@ export default {
       this.selectCourseDetail();
       this.selectCourseDetail();
     }, 500);
     }, 500);
   },
   },
-  mounted() {
+  async mounted() {
+    this.startTime = await this.getServerTime()
     // if (this.mergedList.includes(this.org)) {
     // if (this.mergedList.includes(this.org)) {
     //   this.isTeacherSee = true
     //   this.isTeacherSee = true
     // }
     // }

+ 6 - 1
src/components/pages/workPage/components/choiceQuestion.vue

@@ -216,7 +216,11 @@ export default {
             this.showIndex
             this.showIndex
           ].userAnswer.filter(i => i != index);
           ].userAnswer.filter(i => i != index);
         } else {
         } else {
-          this.work.testJson[this.showIndex].userAnswer.push(index);
+          if(this.work.testJson[this.showIndex].answer.length<=1){//单选
+             this.work.testJson[this.showIndex].userAnswer = [index];
+          }else{//多选
+            this.work.testJson[this.showIndex].userAnswer.push(index);
+          }
         }
         }
       }
       }
     },
     },
@@ -258,6 +262,7 @@ export default {
   text-align: center;
   text-align: center;
   max-width: 95%;
   max-width: 95%;
   position: relative;
   position: relative;
+  white-space: pre-wrap;
 }
 }
 
 
 .cq_image {
 .cq_image {

+ 105 - 0
src/mixins/mixin.js

@@ -11,6 +11,22 @@ export const myMixin = {
     };
     };
   },
   },
   methods: {
   methods: {
+    async getServerTime() {
+      try {
+        let res = await this.ajax.get(this.$store.state.api + 'getServerTime'); 
+        console.log(res)
+        let time = res.data.time
+        return new Date(time).toLocaleString("zh-CN", {
+          hour12: false,
+          timeZone: "Asia/Shanghai"
+        }).replace(/\//g, "-")
+      } catch (error) {
+        return new Date().toLocaleString("zh-CN", {
+          hour12: false,
+          timeZone: "Asia/Shanghai"
+        }).replace(/\//g, "-")
+      }
+    },
     detectBrowser() {
     detectBrowser() {
       const ua = navigator.userAgent;
       const ua = navigator.userAgent;
 
 
@@ -226,6 +242,95 @@ export const myMixin = {
           })
           })
         })
         })
       })
       })
+    },
+    // 新增:上课/备课数据实时同步接口
+    async syncClassData2(classData,api = 'selectUser') {
+      if (!this.$route.query.userid) return
+      try {
+        if(!this.userJson || !this.userJson.accountNumber){
+            let res = await this.ajax.get(this.$store.state.api + api, {
+            userid: this.$route.query.userid
+            });
+            this.userJson = res.data[0][0]
+        }
+      } catch (e) {
+        console.log(e);
+        setTimeout(() => {
+          this.syncClassData2(classData,'selectUser2');
+        }, 10000);
+        return;
+      }
+
+      
+      if(!this.packageArray || this.packageArray.length == 0){
+        let res = await this.ajax.get(this.$store.state.api + "selectai6AllCourse");
+        this.packageArray = res.data[0].map(item => {
+          let json = JSON.parse(item.package);
+          return json;
+        });
+        console.log(this.packageArray);
+      }
+      console.log(this.packageArray);
+
+      
+      let coursePackageName2 = '';
+      let courseName = '';
+      let courseGrade2 = '';
+
+      for(let item of this.packageArray){
+        if(classData.ctitle.includes(item.courseName)){
+          coursePackageName2 = item.coursePackage;
+          courseName = item.courseName;
+          courseGrade2 = item.grade;
+          break;
+        }
+      }
+
+      let courseGrade = classData.courseGrade ? await this.ajax.get(this.$store.state.api + "getClassById", { id: classData.courseGrade }) : '';
+      let coursePackageName = await this.ajax.get(this.$store.state.api + "getCopyCourseName", { id: classData.courseId });
+
+      if(courseGrade && !courseGrade2){
+        let array = this.packageArray.sort((a, b) => a.sort - b.sort)
+        for(let item2 of array){
+          if(courseGrade.data && courseGrade.data[0] && courseGrade.data[0][0] && courseGrade.data[0][0].grade.includes(item2.grade)){
+            coursePackageName2 = item2.coursePackage;
+            courseName = item2.courseName;
+            courseGrade2 = item2.grade;
+            break;
+          }
+        }
+      }
+
+      let area = this.areaJson.find(item => this.userJson.schooldest.includes(item.code) || this.userJson.schooldest.includes(item.name));
+      let dest = area ? area.name : '未知';
+
+      let params = {
+        "serverName": "深教AI6",
+        "dataType": 0,
+        "teacherName": this.userJson.username,
+        "teacherAccount": this.userJson.accountNumber,
+        "teacherPhone": this.userJson.phonenumber,
+        "eduId": this.userJson.eduid || this.userJson.sessionid,
+        "schoolName": this.userJson.schoolName,
+        "area": dest,
+        "coursePackageName": coursePackageName2 ? coursePackageName2 : coursePackageName.data[0][0].title,
+        "courseId": classData.courseId,
+        "courseName": courseName || classData.title,
+        "courseGrade": courseGrade2 ? courseGrade2 : courseGrade.data && courseGrade.data[0] && courseGrade.data[0][0] ? 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 };
+      }
     }
     }
   }
   }
 };
 };

Some files were not shown because too many files changed in this diff