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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
@@ -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
- <span>{{text}}</span>
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>
@@ -247,7 +247,7 @@ const common = {
247
247
  options: options,
248
248
  text: message,
249
249
  width: '400px',
250
- height: '95px'
250
+ height: 'auto'
251
251
  },
252
252
  on: {
253
253
  access() {
@@ -789,7 +789,7 @@ html {
789
789
  min-width: initial;
790
790
  }
791
791
 
792
- .el-message__content{
792
+ .el-message__content,.ct-comfirm-content{
793
793
  white-space: pre-line;
794
794
  line-height: 20px!important;
795
795
  }
@@ -329,7 +329,7 @@
329
329
  return false;
330
330
  }
331
331
  }
332
- if (this.model.min && this.modelPhotoselect.required) {
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 (res.rtnCode != 200 && res.rtnMsg != "") {
466
- this.$message.error(res.rtnMsg);
467
- return;
465
+ if (xhr.status >= 400) {
466
+ this.$message.error(res);
468
467
  }
469
- const { file, onProgress, onSuccess, onError } = uploadOptions;
470
- const Progress = Math.min(100, Math.floor(1E4 * parseInt(res.content.nextOffSet) / parseInt(file.size)) / 100);
471
- this.model.setByPieces(res, Progress, file);
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
- if (res.content.finished == 1) {
474
- this.handleChange();
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 (data.rtnCode == 200) {
30
- if (data.content.finished != 1) {
31
- uploadData.nextOffSet = data.content.nextOffSet;
32
- uploadData.blockSize = data.content.blockSize;
33
- readChunk(uploadData);
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.eNrEjrEKg0AQRP9laxdcXXfv7OJpmnyEeGQFU4WokBDy7zFwdvZ5xSuGgZk3zGuEGjSBB9rpfQIPtNMTsVeSDk9eA7JwiY6Cw8AS-Nx2ZWhayMCed6hJRJ3Tgn0G07CkIM_dL1hne1zs9Y9zt2XaZn2lZcxpxGEsqq3sGH0sBiS6morZGMXg8wUAAP__.pRHigsL1V-LoAhchjSKQEXLI9EJv4RKjXEm6tliOaqk',
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"}',