|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
$jq = $
|
|
|
-var $180 = $.noConflict();
|
|
|
+var $180 = $.noConflict();
|
|
|
function jietu_shishi(uid, cid, stage, task, tool) {
|
|
|
html2canvas($jq("body")[0]).then(function (canvas) {
|
|
|
//获取截取图片路径
|
|
@@ -66,18 +66,36 @@ function beforeUpload_shishi(nfile, uid, cid, stage, task, tool, loading, atool,
|
|
|
//这里可以写进度条
|
|
|
// console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
|
|
|
}).send(function (err, data) {
|
|
|
- console.log(data.Location);
|
|
|
- var a = {
|
|
|
- name: file.name,
|
|
|
- url: data.Location,
|
|
|
- uid: file.uid,
|
|
|
+ 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);
|
|
|
}
|
|
|
- addSWork_shishi(uid, cid, stage, task, tool, data.Location, loading, atool, text)
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function addSWork_shishi(uid, cid, stage, task, tool, a, loading,atool, text) {
|
|
|
+function addSWork_shishi(uid, cid, stage, task, tool, a, loading, atool, text) {
|
|
|
let params = {
|
|
|
uid: uid,
|
|
|
cid: cid,
|
|
@@ -86,8 +104,8 @@ function addSWork_shishi(uid, cid, stage, task, tool, a, loading,atool, text) {
|
|
|
tool: tool,
|
|
|
content: a,
|
|
|
type: 1,
|
|
|
- atool:atool,
|
|
|
- text:text
|
|
|
+ atool: atool,
|
|
|
+ text: text
|
|
|
// upload: JSON.stringify(this.imgFileUp),
|
|
|
};
|
|
|
$jq.ajax({
|
|
@@ -113,7 +131,7 @@ function addSWork_shishi(uid, cid, stage, task, tool, a, loading,atool, text) {
|
|
|
}, 1000);
|
|
|
},
|
|
|
success: (data) => {
|
|
|
- setTimeout(() =>{
|
|
|
+ setTimeout(() => {
|
|
|
var _a = document.getElementsByTagName("img")
|
|
|
for (var i = 0; i < _a.length; i++) {
|
|
|
_a[i].removeAttribute("crossorigin")
|
|
@@ -131,7 +149,7 @@ function addSWork_shishi(uid, cid, stage, task, tool, a, loading,atool, text) {
|
|
|
document.body.removeChild(_div)
|
|
|
}, 1000);
|
|
|
console.log("截图上传成功");
|
|
|
- },3000)
|
|
|
+ }, 3000)
|
|
|
}
|
|
|
})
|
|
|
}
|