bri-components 1.4.91 → 1.4.92

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": "bri-components",
3
- "version": "1.4.91",
3
+ "version": "1.4.92",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -52,7 +52,7 @@
52
52
  >
53
53
  <!-- 上传完 -->
54
54
  <Icon
55
- v-if="percent === 100"
55
+ v-if="Number(percent) === 100"
56
56
  type="ios-checkmark"
57
57
  ></Icon>
58
58
  <!-- 上传中 -->
@@ -150,7 +150,7 @@
150
150
 
151
151
  _multiple: true,
152
152
  _useType: "drag",
153
- _maxSize: 1024 * 1024,
153
+ _maxSize: 1024 * 1024 * 2, // 根据四局要求,限制文件为2G
154
154
  _format: [],
155
155
 
156
156
  ...this.propsObj,
@@ -254,7 +254,6 @@
254
254
  if (!this.multipleMode) {
255
255
  postFiles = postFiles.slice(0, 1);
256
256
  }
257
-
258
257
  postFiles.forEach(fileItem => {
259
258
  if (
260
259
  (!this.format.length || this.format.some(item => item.toLocaleLowerCase() === fileItem.name.split(".").pop().toLocaleLowerCase())) &&
@@ -24,7 +24,8 @@ export default {
24
24
  },
25
25
  data () {
26
26
  return {
27
- percent: 0
27
+ percent: 0,
28
+ uploadSuccess: false
28
29
  };
29
30
  },
30
31
  created () { },
@@ -42,7 +43,7 @@ export default {
42
43
  return this.propsObj._archiveKey || [];
43
44
  },
44
45
  percentColor () {
45
- if (this.percent === 100) {
46
+ if (Number(this.percent) === 100) {
46
47
  return "#5cb85c";
47
48
  } else {
48
49
  return "#6090ed";
@@ -88,9 +89,15 @@ export default {
88
89
  filebody: JSON.stringify(fileBody)
89
90
  },
90
91
  onUploadProgress: progressEvent => {
91
- this.inProgress(Number((progressEvent.loaded / progressEvent.total * 100).toFixed(0)));
92
+ this.inProgress(Number((progressEvent.loaded / progressEvent.total * 100).toFixed(1)));
92
93
  }
93
94
  }).then(response => {
95
+ this.uploadSuccess = true;
96
+ this.percent = 100;
97
+ setTimeout(() => {
98
+ this.percent = 0;
99
+ this.uploadSuccess = false;
100
+ }, 500);
94
101
  this.successCb && this.successCb(response, response.data, file);
95
102
  callback && callback(response.data);
96
103
  }).catch(error => {
@@ -161,7 +168,7 @@ export default {
161
168
 
162
169
  new Oss(newOss).multipartUpload(remoteName, file, {
163
170
  progress: (percentage) => {
164
- this.inProgress(Number((percentage * 100).toFixed(0)));
171
+ this.inProgress(Number((percentage * 100).toFixed(1)));
165
172
  this.handleProgress && this.handleProgress(percentage, file);
166
173
  },
167
174
  headers: {
@@ -169,6 +176,12 @@ export default {
169
176
  "Content-Disposition": type === "pdf" ? `inline;filename=${encodeURI(file.name)}` : `attachment;filename=${encodeURI(file.name)}`
170
177
  }
171
178
  }).then(response => {
179
+ this.uploadSuccess = true;
180
+ this.percent = 100;
181
+ setTimeout(() => {
182
+ this.percent = 0;
183
+ this.uploadSuccess = false;
184
+ }, 500);
172
185
  this.successCb && this.successCb(response, response.data, file);
173
186
  callback && callback(response.data);
174
187
  }).catch((err, response) => {
@@ -303,7 +316,7 @@ export default {
303
316
 
304
317
  new Oss(newOss).multipartUpload(remoteName, file, {
305
318
  progress: (percentage) => {
306
- this.inProgress(Number((percentage * 100).toFixed(0)));
319
+ this.inProgress(Number((percentage * 100).toFixed(1)));
307
320
  this.handleProgress && this.handleProgress(percentage, file);
308
321
  },
309
322
  headers: {
@@ -311,6 +324,12 @@ export default {
311
324
  "Content-Disposition": type === "pdf" ? `inline;filename=${encodeURI(file.name)}` : `attachment;filename=${encodeURI(file.name)}`
312
325
  }
313
326
  }).then(response => {
327
+ this.percent = 100;
328
+ this.uploadSuccess = true;
329
+ setTimeout(() => {
330
+ this.percent = 0;
331
+ this.uploadSuccess = false;
332
+ }, 500);
314
333
  this.successCb && this.successCb(response, response.data, file);
315
334
  callback && callback(response.data);
316
335
  }).catch((err, response) => {
@@ -320,8 +339,12 @@ export default {
320
339
 
321
340
  },
322
341
  inProgress (percent) {
323
- this.percent = percent;
324
- if (percent >= 100) {
342
+ if (percent === 100 && !this.uploadSuccess) {
343
+ this.percent = 99.9;
344
+ } else {
345
+ this.percent = percent;
346
+ }
347
+ if (this.percent >= 100) {
325
348
  this.percent = 100;
326
349
  setTimeout(() => {
327
350
  this.percent = 0;
@@ -109,7 +109,9 @@ export default {
109
109
  this.subType !== "datetime" && this.changeOpen(false, index);
110
110
  },
111
111
  changeOpen (bool, index) {
112
- this[`open${index}`] = bool;
112
+ if (!this.disabled) {
113
+ this[`open${index}`] = bool;
114
+ }
113
115
  },
114
116
 
115
117
  /* -------- 方法 ------- */
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div class="DshListUnit">
2
+ <div :class="{
3
+ DshListUnit: true,
4
+ 'DshListUnit-changed': changedCols.includes(formItem._key)
5
+ }">
3
6
  <template v-if="selfFormItem._type === 'index'">
4
7
  <span>{{ indexStr || rowIndex + 1 }}</span>
5
8
  </template>
@@ -88,6 +91,11 @@
88
91
 
89
92
  <style lang="less" scoped>
90
93
  .DshListUnit {
94
+ &-changed {
95
+ display: flex;
96
+ align-items: center;
97
+ }
98
+
91
99
  &-control {
92
100
  display: inline-block;
93
101
  width: calc(100% - 66px);