Parcourir la source

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table into beta

lsc il y a 3 mois
Parent
commit
e6d8458de8

+ 1 - 1
dist/index.html

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

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.fdbe584f895b003f39cda92f5a5e6c20.css


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/css/app.fdbe584f895b003f39cda92f5a5e6c20.css.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.5ee375743bf565dfb7ba.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/app.5ee375743bf565dfb7ba.js.map


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 130 - 3
src/components/pages/components/lookWork.vue

@@ -192,7 +192,45 @@
                       </div>
                     </div>
                     <div v-for="(i, codex) in l.content" :key="codex + 'co'">
-                      <div class="answerTxt" v-html="i"></div>
+                      <iframe
+                        v-if="getFileExtension(i) == 'PDF'"
+                        style="width: 90%; height: 500px; border: none"
+                        :src="
+                          'https://cloud.cocorobo.cn/pdf.js/web/viewer.html?file=' +
+                            encodeURIComponent(i)
+                        "
+                      ></iframe>
+
+                      <iframe
+                        v-if="words.indexOf(getFileExtension(i)) != -1"
+                        style="width: 90%; height: 500px; border: none"
+                        :src="
+                          'https://view.officeapps.live.com/op/view.aspx?src=' +
+                            encodeURIComponent(i)
+                        "
+                        frameborder="0"
+                      ></iframe>
+
+
+                      <img    
+                        @click.stop="previewImg(i)"
+                        style="max-width: 200px" 
+                        v-if="pictures.indexOf(getFileExtension(i)) != -1 " 
+                        :src="i" alt="">
+
+                      <div v-if="xianObj.indexOf(getFileExtension(i)) != -1 && TxtMd" >{{ TxtMd }}</div>
+                      
+                      <video-player
+                          v-if="getFileExtension(i) == 'MP4'"
+                          class="video-player vjs-custom-skin"
+                          :playsinline="true"
+                          :options="playerOptions"
+                          @play="onPlayerPlay($event)"
+                          style="width: 90%; height: 500px; margin: 0 0 0 30px"
+                        ></video-player>
+
+                        <div class="answerTxt" v-html="i"></div>
+
                     </div>
                   </div>
                   <div
@@ -748,6 +786,46 @@
 </template>
 
 <script>
+
+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 {
   props: {
     id: {
@@ -776,14 +854,42 @@ export default {
       workEvaList: [],
       // 上一个下一个学生位置
       positP: 0,
-
+      TxtMd:'',
       dyList: [],
       courseName: "",
       workList: [],
       CState: 0,
       tableData: [],
       loading: false,
-      resData: {}
+      resData: {},
+      playerOptions: {
+        playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
+        autoplay: false, //如果true,浏览器准备好时开始回放。
+        muted: false, // 默认情况下将会消除任何音频。
+        loop: false, // 导致视频一结束就重新开始。
+        preload: "auto", // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
+        language: "zh-CN",
+        aspectRatio: "16:9", // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
+        fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
+        sources: [
+          {
+            type: "video/mp4", //这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目   || "video/ogg"|| "video/webm"
+            src: "" //url地址require("../../../assets/media/aaa.mp4")
+          }
+        ],
+        // poster: require("../../../assets/tu31.png"), //你的封面地址
+        // poster: dataRes.imgUrl, //你的封面地址
+        notSupportedMessage: "此视频暂无法播放,请稍后再试", //允许覆盖Video.js无法播放媒体源时显示的默认信息。
+        controlBar: {
+          timeDivider: true, //当前时间和持续时间的分隔符
+          durationDisplay: true, //显示持续时间
+          remainingTimeDisplay: false, //是否显示剩余时间功能
+          fullscreenToggle: true //全屏按钮
+        }
+      },
+      xianObj: [ "MD", "TXT"],
+      words:["DOCX","XLSX", "PPT" ,"PPTX"],
+      pictures:["JPG", "PNG" ,"JPEG"]
     };
   },
 
@@ -895,6 +1001,27 @@ export default {
     }
   },
   methods: {
+    onPlayerPlay() {},
+
+    // 作业提交进行判断展示
+    getFileExtension(fileName) {
+      let der = fileName.slice(fileName.lastIndexOf(".") + 1).toUpperCase()
+      console.log('getFileExtension',der);
+
+      if (der == 'MP4') {
+        this.playerOptions.sources[0].src = fileName;
+        return der;
+      }
+
+      if (this.xianObj.indexOf(der) != -1) {
+        getFile(fileName).then(res => {
+          this.TxtMd = res.data;
+        });
+        return der;
+      }
+      
+      return der;
+    },
      // 时间戳转时间
      convertToTimestamp(val) {
       const date = new Date(val);

+ 19 - 1
src/components/pages/test/check/docxTemplateDialog.vue

@@ -331,7 +331,25 @@ export default {
             value: choseTxt
           });
           _index++;
-        }
+        }else if(_item.type == 8){
+					let _item2 = _item.json;
+					_list.push({
+						name:_item2.title,
+						field:`ti_${_index}`,
+						type:"text",
+						value:_item2.answer2
+					})
+					_index++;
+				}else if(_item.type == 12){
+					let _item2 = _item.json;
+					_list.push({
+						name:_item2.title,
+						field:`ti_${_index}`,
+						type:"text",
+						value:_item2.answer2
+					})
+					_index++;
+				}
       }
       return _list;
     },

+ 3 - 0
src/components/pages/test/check/index.vue

@@ -630,6 +630,9 @@
                   </div>
                   <div v-if="scope.row.array[index].type == 11" style="display: flex; flex-wrap: wrap;">
                     {{ scope.row.array[index].json.answer2}}
+                  </div>
+									<div v-if="scope.row.array[index].type == 12" style="display: flex; flex-wrap: wrap;">
+                    {{ scope.row.array[index].json.answer2}}
                   </div>
                 </template>
               </el-table-column>

+ 6 - 1
src/components/pages/test/smarter.vue

@@ -274,6 +274,7 @@ export default {
                     let obj = JSON.parse(row.json)
                     this.menuList = obj;
                     this.$refs.aiChat.fileList = obj.map(i=>i.url)
+										this.menuIndex = 0;
                 } else {
                     console.error('aiChat ref is not available');
                 }
@@ -529,7 +530,11 @@ export default {
     computed: {
         showFileUrl() {
             if (this.menuList.length) {
-                return this.menuList[this.menuIndex].url
+              if(this.menuList[this.menuIndex]){
+								return this.menuList[this.menuIndex].url
+							}else {
+								return ""
+							}
             } else {
                 return "";
             }

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff