lsc 2 年之前
父节点
当前提交
a42687a7b9
共有 5 个文件被更改,包括 347 次插入10 次删除
  1. 3 0
      js/Common/aws-sdk-2.235.1.min.js
  2. 172 0
      js/Common/jietu2.js
  3. 159 0
      js/Common/jietu4.js
  4. 1 0
      js/Common/jquery-3.6.0.min.js
  5. 12 10
      js/Desktop/DeskTop.js

文件差异内容过多而无法显示
+ 3 - 0
js/Common/aws-sdk-2.235.1.min.js


+ 172 - 0
js/Common/jietu2.js

@@ -0,0 +1,172 @@
+//  let _loading = document.createElement('div')
+//  _loading.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+//  let _lchild = document.createElement('div')
+//  let _limg = document.createElement('img')
+//  _limg.src = 'https://pbl.cocorobo.cn/pbl-student-table/dist/js/loading.gif'
+//  _limg.style = "width: 26px;margin-right: 10px;"
+//  _lchild.appendChild(_limg)
+//  let _lspan = document.createElement('span')
+//  _lspan.innerHTML = "上传中..."
+//  _lchild.appendChild(_lspan)
+//  _lchild.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;display:flex;align-items:center;"
+//  _loading.appendChild(_lchild)
+//  document.body.appendChild(_loading)
+$jq = $
+var $180 = $.noConflict();
+function jietu_shishi(uid, cid, stage, task, tool) {
+  html2canvas($jq("body")[0]).then(function (canvas) {
+    //获取截取图片路径
+
+    var base64Url = canvas.toDataURL('image/png');
+    //后台操作处理
+
+    var base64 = "<img src=" + base64Url + " />"
+    var file = dataURLtoFile_shishi(base64Url, "截图")
+    beforeUpload_shishi(file, uid, cid, stage, task, tool)
+    // $jq("body")[0].innerHTML = base64
+  });
+}
+
+function dataURLtoFile_shishi(dataurl, filename) {
+  let arr = dataurl.split(","),
+    mime = arr[0].match(/:(.*?);/)[1],
+    bstr = atob(arr[1]),
+    n = bstr.length,
+    u8arr = new Uint8Array(n);
+  while (n--) {
+    u8arr[n] = bstr.charCodeAt(n);
+  }
+  return new File([u8arr], filename, {
+    type: mime
+  });
+}
+
+
+function beforeUpload_shishi(nfile, uid, cid, stage, task, tool, loading, atool, text) {
+  // loading.style.display = 'flex'
+  // top.document.getElementById(loading);
+  //  document.body.appendChild(_loading)
+  var file = nfile;
+  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"
+    }
+  }); //选择桶
+
+  if (file) {
+    var params = {
+      Key: file.name.split(".")[0] + new Date().getTime() + "." + "png",
+      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 (data) {
+          console.log(data.Location);
+          var a = {
+            name: file.name,
+            url: data.Location,
+            uid: file.uid,
+          }
+          addSWork_shishi(uid, cid, stage, task, tool, data.Location, loading, atool, text)
+        } else {
+          var _a = document.getElementsByTagName("img")
+          for (var i = 0; i < _a.length; i++) {
+            _a[i].removeAttribute("crossorigin")
+          }
+          top.document.getElementById(loading).children[0].style.display = "none"
+          let _div = document.createElement('div')
+          _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+          let _inner = document.createElement('div')
+          _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+          _inner.innerHTML = "上传失败,网络错误"
+          _div.appendChild(_inner)
+          document.body.appendChild(_div)
+          setTimeout(() => {
+            document.body.removeChild(_div)
+          }, 1000);
+        }
+
+      });
+  }
+}
+
+function addSWork_shishi(uid, cid, stage, task, tool, a, loading, atool, text) {
+  let params = {
+    uid: uid,
+    cid: cid,
+    stage: stage,
+    task: task,
+    tool: tool,
+    content: a,
+    type: 1,
+    atool: atool,
+    text: text
+    // upload: JSON.stringify(this.imgFileUp),
+  };
+  if (!$jq) {
+    $jq = $
+    var $180 = $.noConflict();
+  }
+  $jq.ajax({
+    type: 'POST',
+    url: 'https://pbl.cocorobo.cn/api/pbl/addCourseWorks4',
+    data: params,
+    dataType: "json",
+    error: (XMLHttpRequest, textStatus, errorThrown) => {
+      var _a = document.getElementsByTagName("img")
+      for (var i = 0; i < _a.length; i++) {
+        _a[i].removeAttribute("crossorigin")
+      }
+      top.document.getElementById(loading).children[0].style.display = "none"
+      let _div = document.createElement('div')
+      _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+      let _inner = document.createElement('div')
+      _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+      _inner.innerHTML = "上传失败,网络错误"
+      _div.appendChild(_inner)
+      document.body.appendChild(_div)
+      setTimeout(() => {
+        document.body.removeChild(_div)
+      }, 1000);
+    },
+    success: (data) => {
+      setTimeout(() => {
+        var _a = document.getElementsByTagName("img")
+        for (var i = 0; i < _a.length; i++) {
+          _a[i].removeAttribute("crossorigin")
+        }
+        top.document.getElementById(loading).children[0].style.display = "none"
+        let _div = document.createElement('div')
+        _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+        let _inner = document.createElement('div')
+        _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+        _inner.innerHTML = "截图上传成功"
+        _div.appendChild(_inner)
+        document.body.appendChild(_div)
+        setTimeout(() => {
+          //  document.body.removeChild(_loading)
+          document.body.removeChild(_div)
+        }, 1000);
+        console.log("截图上传成功");
+      }, 3000)
+    }
+  })
+}

+ 159 - 0
js/Common/jietu4.js

@@ -0,0 +1,159 @@
+
+$jq = $
+var $180 = $.noConflict();
+function jietu_shishi(uid, cid, stage, task, tool) {
+  html2canvas($jq("body")[0]).then(function (canvas) {
+    //获取截取图片路径
+
+    var base64Url = canvas.toDataURL('image/png');
+    //后台操作处理
+
+    var base64 = "<img src=" + base64Url + " />"
+    var file = dataURLtoFile_shishi(base64Url, "截图")
+    beforeUpload_shishi(file, uid, cid, stage, task, tool)
+    // $jq("body")[0].innerHTML = base64
+  });
+}
+
+function dataURLtoFile_shishi(dataurl, filename) {
+  let arr = dataurl.split(","),
+    mime = arr[0].match(/:(.*?);/)[1],
+    bstr = atob(arr[1]),
+    n = bstr.length,
+    u8arr = new Uint8Array(n);
+  while (n--) {
+    u8arr[n] = bstr.charCodeAt(n);
+  }
+  return new File([u8arr], filename, {
+    type: mime
+  });
+}
+
+
+function beforeUpload_shishi(nfile, uid, cid, stage, task, tool, loading, atool, text) {
+  // loading.style.display = 'flex'
+  // top.document.getElementById(loading);
+  //  document.body.appendChild(_loading)
+  var file = nfile;
+  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"
+    }
+  }); //选择桶
+
+  if (file) {
+    var params = {
+      Key: file.name.split(".")[0] + new Date().getTime() + "." + "png",
+      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 (data) {
+          console.log(data.Location);
+          var a = {
+            name: file.name,
+            url: data.Location,
+            uid: file.uid,
+          }
+          addSWork_shishi(uid, cid, stage, task, tool, data.Location, loading, atool, text)
+        } else {
+          var _a = document.getElementsByTagName("img")
+          for (var i = 0; i < _a.length; i++) {
+            _a[i].removeAttribute("crossorigin")
+          }
+          top.document.getElementById(loading).children[0].style.display = "none"
+          let _div = document.createElement('div')
+          _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+          let _inner = document.createElement('div')
+          _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+          _inner.innerHTML = "上传失败,网络错误"
+          _div.appendChild(_inner)
+          document.body.appendChild(_div)
+          setTimeout(() => {
+            document.body.removeChild(_div)
+          }, 1000);
+        }
+      });
+  }
+}
+
+function addSWork_shishi(uid, cid, stage, task, tool, a, loading, atool, text) {
+  let params = {
+    uid: uid,
+    cid: cid,
+    stage: stage,
+    task: task,
+    tool: tool,
+    content: a,
+    type: 1,
+    atool: atool,
+    text: text
+    // upload: JSON.stringify(this.imgFileUp),
+  };
+  if (!$jq) {
+    $jq = $
+    var $180 = $.noConflict();
+  }
+  $jq.ajax({
+    type: 'POST',
+    url: 'https://pbl.cocorobo.cn/api/pbl/addCourseWorks4s',
+    data: params,
+    dataType: "json",
+    error: (XMLHttpRequest, textStatus, errorThrown) => {
+      var _a = document.getElementsByTagName("img")
+      for (var i = 0; i < _a.length; i++) {
+        _a[i].removeAttribute("crossorigin")
+      }
+      top.document.getElementById(loading).children[0].style.display = "none"
+      let _div = document.createElement('div')
+      _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+      let _inner = document.createElement('div')
+      _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+      _inner.innerHTML = "上传失败,网络错误"
+      _div.appendChild(_inner)
+      document.body.appendChild(_div)
+      setTimeout(() => {
+        document.body.removeChild(_div)
+      }, 1000);
+    },
+    success: (data) => {
+      setTimeout(() => {
+        var _a = document.getElementsByTagName("img")
+        for (var i = 0; i < _a.length; i++) {
+          _a[i].removeAttribute("crossorigin")
+        }
+        top.document.getElementById(loading).children[0].style.display = "none"
+        let _div = document.createElement('div')
+        _div.style = "width:100%;height:100%;background:#0000008f;position:fixed;top:0;left:0;z-index:99999999999999;display: flex;justify-content: center;align-items: center;"
+        let _inner = document.createElement('div')
+        _inner.style = "color: #fff;padding: 15px;background: #00000070;border-radius: 5px;font-size: 18px;"
+        _inner.innerHTML = "截图上传成功"
+        _div.appendChild(_inner)
+        document.body.appendChild(_div)
+        setTimeout(() => {
+          //  document.body.removeChild(_loading)
+          document.body.removeChild(_div)
+        }, 1000);
+        console.log("截图上传成功");
+      }, 3000)
+    }
+  })
+}

文件差异内容过多而无法显示
+ 1 - 0
js/Common/jquery-3.6.0.min.js


+ 12 - 10
js/Desktop/DeskTop.js

@@ -2979,19 +2979,20 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
     }
     const script1 = document.createElement("script");
     script1.type = "text/javascript";
-    script1.src =
-        "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jquery-3.6.0.min.js";
+    // script1.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jquery-3.6.0.min.js";
+    script1.src = "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js";
     const script2 = document.createElement("script");
     script2.type = "text/javascript";
-    script2.src =
-        "https://pbl.cocorobo.cn/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
+    // script2.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
+    script2.src = "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js";
     const script3 = document.createElement("script");
     script3.type = "text/javascript";
     script3.charset = "UTF-8";
     script3.src = "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js";
     const script4 = document.createElement("script");
     script4.type = "text/javascript";
-    script4.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jietu2.js";
+    // script4.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jietu2.js";
+    script4.src = "https://cloud.cocorobo.cn/js/Common/jietu2.js";
 
     if (_iframe) {
         if (str == 'doc') {
@@ -3324,19 +3325,20 @@ U.MD.D.I.openApplicationJieS = function (str, cid, stage, task, tool) {
     }
     const script1 = document.createElement("script");
     script1.type = "text/javascript";
-    script1.src =
-        "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jquery-3.6.0.min.js";
+    // script1.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jquery-3.6.0.min.js";
+    script1.src = "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js";
     const script2 = document.createElement("script");
     script2.type = "text/javascript";
-    script2.src =
-        "https://pbl.cocorobo.cn/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
+    // script2.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
+    script2.src = "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js";
     const script3 = document.createElement("script");
     script3.type = "text/javascript";
     script3.charset = "UTF-8";
     script3.src = "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js";
     const script4 = document.createElement("script");
     script4.type = "text/javascript";
-    script4.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jietu4.js";
+    // script4.src = "https://pbl.cocorobo.cn/pbl-student-table/dist/js/jietu4.js";
+    script4.src = "https://cloud.cocorobo.cn/js/Common/jietu4.js";
 
     if (_iframe) {
         if (str == 'doc') {

部分文件因为文件数量过多而无法显示