centaline-data-driven 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/centaline/comfirm/src/comfirm.vue +3 -3
- package/src/centaline/common/index.js +1 -1
- package/src/centaline/css/common.css +1 -1
- package/src/centaline/dynamicFile/src/dynamicFile.vue +18 -10
- package/src/centaline/loader/src/ctl/SliceUpload.js +16 -9
- package/src/main.js +1 -1
- package/wwwroot/static/centaline/centaline-data-driven.js +2 -2
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ct-comfirm-content max-comfirm-content">
|
|
3
|
-
<div style="margin-top: 15px;margin-bottom: 15px;min-width: 150px;text-align: center;">
|
|
4
|
-
<
|
|
3
|
+
<div style="margin-top: 15px;margin-bottom: 15px;min-width: 150px;text-align: center; display: flex; justify-content: center;">
|
|
4
|
+
<div style="text-align: left;">{{text}}</div>
|
|
5
5
|
</div>
|
|
6
|
-
<div style="text-align:center;width:100
|
|
6
|
+
<div style="text-align:center;width:100%;margin-bottom: 15px;">
|
|
7
7
|
<el-button @click="clickHandler($event,true)" type="primary" size="mini">{{options.confirmButtonText||'确定'}}</el-button>
|
|
8
8
|
<el-button v-if="options.flagShowcCancelButton===undefined || options.flagShowcCancelButton==='1'" @click="clickHandler($event,false)" size="mini">{{options.cancelButtonText||'取消'}}</el-button>
|
|
9
9
|
</div>
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
return false;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
if (this.model.min && this.
|
|
332
|
+
if (this.model.min && this.model.required) {
|
|
333
333
|
if (this.model.getfileListLength() < this.model.min) {
|
|
334
334
|
//change时需要判断有没有上传图片如果没有图片则不提示
|
|
335
335
|
if (eventName == "change" && this.model.getfileListLength() > 0) {
|
|
@@ -460,18 +460,26 @@
|
|
|
460
460
|
uploadguid() {
|
|
461
461
|
return (this.S4() + this.S4() + '-' + this.S4() + '-' + this.S4() + '-' + this.S4() + '-' + this.S4() + this.S4() + this.S4());
|
|
462
462
|
},
|
|
463
|
-
uploadpro(uploadOptions, res) {
|
|
463
|
+
uploadpro(uploadOptions, res, xhr) {
|
|
464
464
|
|
|
465
|
-
if (
|
|
466
|
-
this.$message.error(res
|
|
467
|
-
return;
|
|
465
|
+
if (xhr.status >= 400) {
|
|
466
|
+
this.$message.error(res);
|
|
468
467
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
else if (xhr.status == 0) {
|
|
469
|
+
this.$message.error(res);
|
|
470
|
+
}
|
|
471
|
+
else if (xhr.status == 200) {
|
|
472
|
+
if (res.rtnCode != 200 && res.rtnMsg != "") {
|
|
473
|
+
this.$message.error(res.rtnMsg);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
const { file, onProgress, onSuccess, onError } = uploadOptions;
|
|
477
|
+
const Progress = Math.min(100, Math.floor(1E4 * parseInt(res.content.nextOffSet) / parseInt(file.size)) / 100);
|
|
478
|
+
this.model.setByPieces(res, Progress, file);
|
|
472
479
|
|
|
473
|
-
|
|
474
|
-
|
|
480
|
+
if (res.content.finished == 1) {
|
|
481
|
+
this.handleChange();
|
|
482
|
+
}
|
|
475
483
|
}
|
|
476
484
|
},
|
|
477
485
|
|
|
@@ -5,7 +5,11 @@ async function postFile(api, data, callback) {
|
|
|
5
5
|
xhr.onreadystatechange = function () {
|
|
6
6
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
7
7
|
var rtn = JSON.parse(xhr.responseText);
|
|
8
|
-
callback(rtn);
|
|
8
|
+
callback(xhr, rtn);
|
|
9
|
+
}
|
|
10
|
+
else if (xhr.readyState === 4 && (xhr.status === 0 || xhr.status >= 400)) {
|
|
11
|
+
var rtn = xhr.responseText || xhr.statusText;
|
|
12
|
+
callback(xhr, rtn);
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
xhr.send(data)
|
|
@@ -13,7 +17,7 @@ async function postFile(api, data, callback) {
|
|
|
13
17
|
|
|
14
18
|
//分片上传
|
|
15
19
|
const uploadByPieces = async (url, { file }, callback, uploadOptions) => {
|
|
16
|
-
var uploadData = { blockSize: 5 * 1024 * 1024, nextOffSet: 0 };
|
|
20
|
+
var uploadData = { blockSize: 0.5 * 1024 * 1024, nextOffSet: 0 };
|
|
17
21
|
// 获取当前chunk数据
|
|
18
22
|
const getChunkInfo = (file, data) => {
|
|
19
23
|
let start = data.nextOffSet;
|
|
@@ -21,16 +25,19 @@ const uploadByPieces = async (url, { file }, callback, uploadOptions) => {
|
|
|
21
25
|
let chunk = file.slice(start, end);
|
|
22
26
|
return { start, end, chunk };
|
|
23
27
|
};
|
|
28
|
+
|
|
24
29
|
// 分片上传接口
|
|
25
|
-
const uploadChunk = async (data) => {
|
|
30
|
+
const uploadChunk = async (xhr, data) => {
|
|
26
31
|
return new Promise((resolve, reject) => {
|
|
27
32
|
|
|
28
|
-
callback(uploadOptions, data);
|
|
29
|
-
if (
|
|
30
|
-
if (data.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
callback(uploadOptions, data, xhr);
|
|
34
|
+
if (xhr.status === 200) {
|
|
35
|
+
if (data.rtnCode == 200) {
|
|
36
|
+
if (data.content.finished != 1) {
|
|
37
|
+
uploadData.nextOffSet = data.content.nextOffSet;
|
|
38
|
+
uploadData.blockSize = data.content.blockSize;
|
|
39
|
+
readChunk(uploadData);
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
|
package/src/main.js
CHANGED
|
@@ -43,7 +43,7 @@ Vue.use(centaline, {
|
|
|
43
43
|
getRequestHeaders: function () {
|
|
44
44
|
return {
|
|
45
45
|
oldToken: '854e91e2-3a5e-42af-a522-c51a0f5c09bc',
|
|
46
|
-
token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.
|
|
46
|
+
token:'aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjEOgkAQRe8yNZMwMDszSycLNh6CuGFJsDICicZ4dzVCR-8rXvGa_58wLREq0BXc0UbnV3BHGx0ReyVp8eA1IAuXaBQMA0vgY9OWoW4gg3S_QkUi6p0WuWYwnudfMM3tG5Yp3U7p8Y9zl3n8zBIPYs4bRjcocuEMPYkh5cZ9ZNeXHOH1BgAA__8.J4WTk1z7IsB5k_3a-fvnnjm6AUgGBRi7Y631pFLVCPo',
|
|
47
47
|
|
|
48
48
|
originalRequestURL: 'http://10.88.22.67:8080',
|
|
49
49
|
EstateInfo: '{"estateId":"FAF029E8-EC28-4297-83CF-B8FFD826DB91","estateName":"AABBCC"}',
|