Pārlūkot izejas kodu

Merge branch 'beta'

SanHQin 1 nedēļu atpakaļ
vecāks
revīzija
f00a116ab8

+ 1 - 1
dist/index.html

@@ -27,7 +27,7 @@
     html,
     html,
     body{
     body{
       font-family: '黑体';
       font-family: '黑体';
-    }</style><link href=./static/css/app.e5b068fb5f500e266acc7ab2869eef79.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.b2299056e030e9dd4cb8.js></script><script type=text/javascript src=./static/js/app.5e2ca6c47152d3ec45d9.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.a837e044d6e0e4b20d731b857fb45e77.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.b2299056e030e9dd4cb8.js></script><script type=text/javascript src=./static/js/app.3d8376c057b86bba37d9.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) {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.a837e044d6e0e4b20d731b857fb45e77.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/css/app.a837e044d6e0e4b20d731b857fb45e77.css.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.3d8376c057b86bba37d9.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/app.3d8376c057b86bba37d9.js.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 77 - 13
src/components/components/appStoreC.vue

@@ -71,26 +71,34 @@ import { myMixin } from "@/mixins/mixin.js"
                     document.msExitFullscreen();
                     document.msExitFullscreen();
                 }
                 }
             },
             },
-            uploadWork(){
+            async uploadWork(){
                 // console.log('window.exposed_outputs',window.exposed_outputs);
                 // console.log('window.exposed_outputs',window.exposed_outputs);
                 let _iframe = this.$refs.appStore;
                 let _iframe = this.$refs.appStore;
                 console.log('sStudent',this.userId);
                 console.log('sStudent',this.userId);
-                
-                // window.exposed_outputs
-                let Cow = JSON.stringify(_iframe.contentWindow.exposed_outputs)
 
 
                 if (this.homeWorkLoading) return this.$message.info('点击过快,请稍后...')
                 if (this.homeWorkLoading) return this.$message.info('点击过快,请稍后...')
                 this.homeWorkLoading = true
                 this.homeWorkLoading = true
+                // window.exposed_outputs
+                // let Cow = _iframe.contentWindow.exposed_outputs
+
+                const pptJsonStr = JSON.stringify(_iframe.contentWindow.exposed_outputs);
+                const pptJsonFile = new File([pptJsonStr], "pptData.json", { type: "application/json" });
+                // 你可以根据需要将pptJsonFile上传或保存
+
+                let Cow = await this.uploadFile(pptJsonFile);
+                // console.log(_url)
+                // return
+                
                 let params = [
                 let params = [
                     {
                     {
-                    uid: this.userId,
-                    cid: this.id,
-                    stage: this.courseType,
-                    task: this.taskCount,
-                    tool: this.toolindex,
-                    content: Cow,
-                    type: 20,
-                    atool:72
+                        uid: this.userId,
+                        cid: this.id,
+                        stage: this.courseType,
+                        task: this.taskCount,
+                        tool: this.toolindex,
+                        content: Cow,
+                        type: 20,
+                        atool:72
                     }
                     }
                 ];
                 ];
                 this.ajax
                 this.ajax
@@ -119,7 +127,63 @@ import { myMixin } from "@/mixins/mixin.js"
                         this.$message.error("提交失败");
                         this.$message.error("提交失败");
                         console.error(err);
                         console.error(err);
                     });
                     });
-            }
+            },
+            //上传文件
+            uploadFile(file) {
+                return new Promise((resolve)=>{
+                    var credentials = {
+                    accessKeyId: "AKIATLPEDU37QV5CHLMH",
+                    secretAccessKey: "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"
+                }; //秘钥形式的登录上传
+                window.AWS.config.update(credentials);
+                window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+                var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+                var _this = this;
+
+                if (file) {
+                    var params = {
+                    Key:
+                        file.name.split(".")[0] +
+                        new Date().getTime() +
+                        "." +
+                        file.name.split(".")[file.name.split(".").length - 1],
+                    ContentType: file.type,
+                    Body: file,
+                    "Access-Control-Allow-Credentials": "*",
+                    ACL: "public-read"
+                    }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+                    var options = {
+                    partSize: 2048 * 1024 * 1024,
+                    queueSize: 2,
+                    leavePartsOnError: true
+                    };
+                    bucket
+                    .upload(params, options)
+                    .on("httpUploadProgress", function(evt) {
+                        //这里可以写进度条
+                        // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+                    })
+                    .send(function(err, data) {
+                        if (err) {
+                        // var a = _this.$refs.upload1.uploadFiles;
+                        // a.splice(a.length - 1, a.length);
+                        _this.$message.error("上传失败ppt数据失败");
+                        } else {
+                        //上传成功处理
+                        // _this.unitJson[_this.unitIndex].chapterInfo[0].fileList1.push({
+                        //   name: file.name,
+                        //   url: data.Location,
+                        //   uid: file.uid
+                        // });
+                        // _this.imgChange();
+                        // console.log(data.Location);
+                        resolve(data.Location)
+                        }
+                    });
+                }
+                })
+            },
         },  
         },  
     }
     }
 </script>
 </script>

+ 62 - 2
src/components/components/choseWorksDetailDialog.vue

@@ -1928,14 +1928,18 @@ export default {
   methods: {
   methods: {
 
 
     // 提交应用中心作业
     // 提交应用中心作业
-    upLoadApp(){
+    async upLoadApp(){
       let _iframe = this.$refs.appStore;
       let _iframe = this.$refs.appStore;
       document.getElementById('loadLi_JieE').children[0].style.display = "block"
       document.getElementById('loadLi_JieE').children[0].style.display = "block"
 
 
 
 
         // window.exposed_outputs
         // window.exposed_outputs
-        let Cow = JSON.stringify(_iframe.contentWindow.exposed_outputs)
+        // let Cow = JSON.stringify(_iframe.contentWindow.exposed_outputs)
+        const pptJsonStr = JSON.stringify(_iframe.contentWindow.exposed_outputs);
+        const pptJsonFile = new File([pptJsonStr], "pptData.json", { type: "application/json" });
+        // 你可以根据需要将pptJsonFile上传或保存
 
 
+        let Cow = await this.uploadFile(pptJsonFile);
         // uid: this.userId,
         // uid: this.userId,
         //       cid: this.id,
         //       cid: this.id,
         //       stage: this.courseType,
         //       stage: this.courseType,
@@ -1986,6 +1990,62 @@ export default {
                this.addOp3('1', "", { courseid: this.id,tool: 'AI应用',data: Cow,type: "course_tool_sub" }, err)
                this.addOp3('1', "", { courseid: this.id,tool: 'AI应用',data: Cow,type: "course_tool_sub" }, err)
 
 
             });
             });
+    },
+        //上传文件
+    uploadFile(file) {
+        return new Promise((resolve)=>{
+            var credentials = {
+            accessKeyId: "AKIATLPEDU37QV5CHLMH",
+            secretAccessKey: "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"
+        }; //秘钥形式的登录上传
+        window.AWS.config.update(credentials);
+        window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+        var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+        var _this = this;
+
+        if (file) {
+            var params = {
+            Key:
+                file.name.split(".")[0] +
+                new Date().getTime() +
+                "." +
+                file.name.split(".")[file.name.split(".").length - 1],
+            ContentType: file.type,
+            Body: file,
+            "Access-Control-Allow-Credentials": "*",
+            ACL: "public-read"
+            }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+            var options = {
+            partSize: 2048 * 1024 * 1024,
+            queueSize: 2,
+            leavePartsOnError: true
+            };
+            bucket
+            .upload(params, options)
+            .on("httpUploadProgress", function(evt) {
+                //这里可以写进度条
+                // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+            })
+            .send(function(err, data) {
+                if (err) {
+                // var a = _this.$refs.upload1.uploadFiles;
+                // a.splice(a.length - 1, a.length);
+                _this.$message.error("上传失败ppt数据失败");
+                } else {
+                //上传成功处理
+                // _this.unitJson[_this.unitIndex].chapterInfo[0].fileList1.push({
+                //   name: file.name,
+                //   url: data.Location,
+                //   uid: file.uid
+                // });
+                // _this.imgChange();
+                // console.log(data.Location);
+                resolve(data.Location)
+                }
+            });
+        }
+        })
     },
     },
     // 设置分组
     // 设置分组
     updateGroupJson(){
     updateGroupJson(){

+ 60 - 2
src/components/components/cocoFlowDia.vue

@@ -51,7 +51,45 @@
 
 
 <script>
 <script>
 import MarkdownIt from "markdown-it";
 import MarkdownIt from "markdown-it";
-
+const getFile = url => {
+  return new Promise((resolve, reject) => {
+    var credentials = {
+      accessKeyId: "AKIATLPEDU37QV5CHLMH",
+      secretAccessKey: "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"
+    }; //秘钥形式的登录上传
+    window.AWS.config.update(credentials);
+    window.AWS.config.region = "cn-northwest-1"; //设置区域
+    let url2 = url;
+    let _url2 = "";
+    if (
+      url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+    ) {
+      _url2 = url2.split(
+        "https://view.officeapps.live.com/op/view.aspx?src="
+      )[1];
+    } else {
+      _url2 = url2;
+    }
+    var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+    let name = decodeURIComponent(
+      _url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
+    );
+    var params = {
+      Bucket: "ccrb",
+      Key: name
+    };
+    s3.getObject(params, function(err, data) {
+      if (err) {
+        console.log(err, err.stack);
+        resolve({ data: 1 });
+      } else {
+        const fileContent = data.Body.toString("utf-8");
+        resolve({ data: fileContent });
+      } // sxuccessful response
+    });
+    // axios({
+  });
+};
     export default {
     export default {
         data() {
         data() {
             return {
             return {
@@ -103,8 +141,20 @@ import MarkdownIt from "markdown-it";
             markFullScreenBtn() {
             markFullScreenBtn() {
                 this.markfullscreen = !this.markfullscreen;
                 this.markfullscreen = !this.markfullscreen;
             },
             },
-            openAppWork(val){
+            async openAppWork(val){
                 console.log(val);
                 console.log(val);
+                // val.works = 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/pptData1764063222122.json'
+                
+                // let kk = 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/pptData1764063222122.json'
+
+                // console.log('this.isValidURL(val.works)',this.isValidURL(val.works));
+                
+                if (this.isValidURL(val.works)) {
+                    await getFile(val.works).then((res) => {
+                       val.works = res.data;
+                    });
+                }
+
                 this.username = val.sName
                 this.username = val.sName
                 try {
                 try {
                     this.listData = JSON.parse(val.works)
                     this.listData = JSON.parse(val.works)
@@ -113,6 +163,14 @@ import MarkdownIt from "markdown-it";
                 }
                 }
                 this.FlowVisible = true;
                 this.FlowVisible = true;
             },
             },
+            isValidURL(str){
+                try {
+                        const url = new URL(str);
+                        return ['http:', 'https:', 'ftp:'].includes(url.protocol) && !!url.hostname;
+                } catch (e) {
+                    return false;
+                }
+            },
             handleClose(){
             handleClose(){
                 this.listData = []
                 this.listData = []
                 this.FlowVisible = false;
                 this.FlowVisible = false;

+ 57 - 1
src/components/components/studentWorkPreviewDialog.vue

@@ -309,6 +309,45 @@
 import MarkdownIt from "markdown-it";
 import MarkdownIt from "markdown-it";
 import katex from 'katex'
 import katex from 'katex'
 import 'katex/dist/katex.min.css'
 import 'katex/dist/katex.min.css'
+const getFile = url => {
+  return new Promise((resolve, reject) => {
+    var credentials = {
+      accessKeyId: "AKIATLPEDU37QV5CHLMH",
+      secretAccessKey: "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"
+    }; //秘钥形式的登录上传
+    window.AWS.config.update(credentials);
+    window.AWS.config.region = "cn-northwest-1"; //设置区域
+    let url2 = url;
+    let _url2 = "";
+    if (
+      url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
+    ) {
+      _url2 = url2.split(
+        "https://view.officeapps.live.com/op/view.aspx?src="
+      )[1];
+    } else {
+      _url2 = url2;
+    }
+    var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
+    let name = decodeURIComponent(
+      _url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1]
+    );
+    var params = {
+      Bucket: "ccrb",
+      Key: name
+    };
+    s3.getObject(params, function(err, data) {
+      if (err) {
+        console.log(err, err.stack);
+        resolve({ data: 1 });
+      } else {
+        const fileContent = data.Body.toString("utf-8");
+        resolve({ data: fileContent });
+      } // sxuccessful response
+    });
+    // axios({
+  });
+};
 export default {
 export default {
   components: {},
   components: {},
   data() {
   data() {
@@ -380,13 +419,30 @@ export default {
     };
     };
   },
   },
   methods: {
   methods: {
-    open({ work, testData, testJson, tool }) {
+    async open({ work, testData, testJson, tool }) {
+
+      console.log('work',work);
+      if (this.isValidURL(work.works) && tool == '72') {
+          await getFile(work.works).then((res) => {
+              work.works = res.data;
+          });
+      }
+      
+
       this.studentWork = work;
       this.studentWork = work;
       (this.testData = testData),
       (this.testData = testData),
         (this.testJson = testJson),
         (this.testJson = testJson),
         (this.tool = tool);
         (this.tool = tool);
       this.show = true;
       this.show = true;
     },
     },
+    isValidURL(str){
+      try {
+              const url = new URL(str);
+              return ['http:', 'https:', 'ftp:'].includes(url.protocol) && !!url.hostname;
+      } catch (e) {
+          return false;
+      }
+    },
     close() {
     close() {
       this.show = false;
       this.show = false;
       (this.studentWork = null),
       (this.studentWork = null),

+ 4 - 0
src/components/easy2/studyStudent.vue

@@ -20021,6 +20021,10 @@ export default {
                   }
                   }
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                   var checkL = JSON.parse(data.content)[0].anwer;
                   var checkL = JSON.parse(data.content)[0].anwer;
+                  if(a[i].testJson.testCount != JSON.parse(data.content)[0].testJson.testCount){
+                    continue
+                  }
+                  console.log('选择题')
                   for (var z = 0; z < checkL.length; z++) {
                   for (var z = 0; z < checkL.length; z++) {
                     if (!this.checkJson[i][z]) {
                     if (!this.checkJson[i][z]) {
                       this.checkJson[i].push({
                       this.checkJson[i].push({

+ 4 - 0
src/components/easy3/studyStudent.vue

@@ -15524,6 +15524,10 @@ export default {
                   }
                   }
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                   var checkL = JSON.parse(data.content)[0].anwer;
                   var checkL = JSON.parse(data.content)[0].anwer;
+                  if(a[i].testJson.testCount != JSON.parse(data.content)[0].testJson.testCount){
+                    continue
+                  }
+                  console.log('选择题')
                   for (var z = 0; z < checkL.length; z++) {
                   for (var z = 0; z < checkL.length; z++) {
                     if (!this.checkJson[i][z]) {
                     if (!this.checkJson[i][z]) {
                       this.checkJson[i].push({
                       this.checkJson[i].push({

+ 4 - 0
src/components/studyStudent.vue

@@ -15450,6 +15450,10 @@ export default {
                   }
                   }
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                   var checkL = JSON.parse(data.content)[0].anwer;
                   var checkL = JSON.parse(data.content)[0].anwer;
+                  if(a[i].testJson.testCount != JSON.parse(data.content)[0].testJson.testCount){
+                    continue
+                  }
+                  console.log('选择题')
                   for (var z = 0; z < checkL.length; z++) {
                   for (var z = 0; z < checkL.length; z++) {
                     if (!this.checkJson[i][z]) {
                     if (!this.checkJson[i][z]) {
                       this.checkJson[i].push({
                       this.checkJson[i].push({

+ 4 - 0
src/components/studySutdentClass/studyStudent.vue

@@ -19496,6 +19496,10 @@ export default {
                   }
                   }
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                 } else if (data.type == 8 && a[i].tool[0] == 45) {
                   var checkL = JSON.parse(data.content)[0].anwer;
                   var checkL = JSON.parse(data.content)[0].anwer;
+                  if(a[i].testJson.testCount != JSON.parse(data.content)[0].testJson.testCount){
+                    continue
+                  }
+                  console.log('选择题')
                   for (var z = 0; z < checkL.length; z++) {
                   for (var z = 0; z < checkL.length; z++) {
                     if (!this.checkJson[i][z]) {
                     if (!this.checkJson[i][z]) {
                       this.checkJson[i].push({
                       this.checkJson[i].push({

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels