meixioacomponent 2.0.44 → 2.0.45

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": "meixioacomponent",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -10,8 +10,21 @@
10
10
  {{ filterContent() }}
11
11
  </div>
12
12
  <div v-else-if="type==='money'" :class="[type]">
13
- <t-statistic :value="parseFloat(content)" prefix="¥" trend="increase"/>
13
+ <t-statistic
14
+ :value="parseFloat(content)" prefix="¥" trend="increase"/>
14
15
  </div>
16
+
17
+ <div v-else-if="type==='money+'" :class="[type]">
18
+ <t-statistic
19
+ :color="parseFloat(content)>0?'var(--color-error)': 'var(--font-color-d)'"
20
+ :value="parseFloat(content)" prefix="¥" trend="increase"/>
21
+ </div>
22
+ <div v-else-if="type==='money-'" :class="[type]">
23
+ <t-statistic
24
+ :color="parseFloat(content)<0?'var(--color-success)':'var(--font-color-d)'"
25
+ :value="parseFloat(content)" prefix="¥" trend="increase"/>
26
+ </div>
27
+
15
28
  <div v-else-if="type==='number'" :class="[type]">
16
29
  {{ filterContent() }}
17
30
  </div>
@@ -19,13 +32,8 @@
19
32
  <div v-else class="default">
20
33
  {{ filterContent() }}
21
34
  </div>
22
-
23
35
  </div>
24
-
25
-
26
36
  <div v-else class="empty">暂无数据</div>
27
-
28
-
29
37
  </template>
30
38
 
31
39
 
@@ -150,11 +158,11 @@ export default {
150
158
  justify-content: flex-start;
151
159
  }
152
160
 
153
- .time, .number, .money {
161
+ .time, .number, .money, .money +, .money- {
154
162
  font-family: TCloudNumber !important;
155
163
  }
156
164
 
157
- .money {
165
+ .money, .money +, .money- {
158
166
  font-weight: var(--font-weight-kg);
159
167
  }
160
168
 
@@ -65,6 +65,7 @@ export const baseUploadMixins = {
65
65
  },
66
66
 
67
67
  async uploadEd(evt) {
68
+ console.log('uploadEd',evt);
68
69
  let filterList = [];
69
70
  let callBackParams = null;
70
71
  try {
@@ -204,7 +204,6 @@ export default {
204
204
  })
205
205
  },
206
206
  uploadEd(evt) {
207
-
208
207
  this.stepActive = 2
209
208
  if (evt instanceof Array) {
210
209
  const {url} = evt[0]
@@ -23,10 +23,10 @@
23
23
  </div>
24
24
  <div class="upload-content">
25
25
  <uploadItemVue
26
- v-for="(item, index) in filterArray"
27
- :key="index"
28
- :item="item"
29
- @deleteAppendixItem="deleteAppendixItem"
26
+ v-for="(item, index) in filterArray"
27
+ :key="index"
28
+ :item="item"
29
+ @deleteAppendixItem="deleteAppendixItem"
30
30
  ></uploadItemVue>
31
31
  </div>
32
32
  </div>
@@ -36,7 +36,7 @@
36
36
  import uploadItemVue from "./uploadItem.vue";
37
37
  //
38
38
  import Upload from "../../../utils/upload";
39
- import {ArrowDownIcon,ArrowUpIcon,CloseIcon} from "tdesign-icons-vue"
39
+ import {ArrowDownIcon, ArrowUpIcon, CloseIcon} from "tdesign-icons-vue"
40
40
 
41
41
  export default {
42
42
  name: "upload",
@@ -89,13 +89,13 @@ export default {
89
89
  completed() {
90
90
  let uploadArray = this.uploadArray;
91
91
  return (
92
- uploadArray?.filter((item) => {
93
- return item.process === 100;
94
- }).length / uploadArray?.length
92
+ uploadArray?.filter((item) => {
93
+ return item.process === 100;
94
+ }).length / uploadArray?.length
95
95
  );
96
96
  },
97
97
  totalStyle() {
98
- return { width: `${this.completed * 100}%` };
98
+ return {width: `${this.completed * 100}%`};
99
99
  },
100
100
  },
101
101
  methods: {
@@ -139,27 +139,26 @@ export default {
139
139
  }
140
140
 
141
141
  this.$set(
142
- uploadItem,
143
- "upload",
144
- new Upload({
145
- file: uploadItem.file,
146
- uploadProgressFn: (process) => {
147
- uploadItem.process = process;
148
- },
149
- })
142
+ uploadItem,
143
+ "upload",
144
+ new Upload({
145
+ file: uploadItem.file,
146
+ uploadProgressFn: (process) => {
147
+ uploadItem.process = process;
148
+ },
149
+ })
150
150
  );
151
151
 
152
152
  uploadItem.upload
153
- .start(this.$props.isOss)
154
- .then((uploadEdUrl) => {
155
- this.$set(uploadItem, "url", uploadEdUrl);
156
-
157
- this.uploadEd();
158
- })
159
- .catch((error) => {
160
- this.$set(uploadItem, "url", "cancel");
161
- this.uploadEd(error);
162
- });
153
+ .start(this.$props.isOss)
154
+ .then((uploadEdUrl) => {
155
+ this.$set(uploadItem, "url", uploadEdUrl);
156
+ this.uploadEd();
157
+ })
158
+ .catch((error) => {
159
+ this.$set(uploadItem, "url", "cancel");
160
+ this.uploadEd(error);
161
+ });
163
162
  }
164
163
  },
165
164
 
@@ -174,21 +173,22 @@ export default {
174
173
  cancelButtonText: "取消",
175
174
  type: "warning",
176
175
  })
177
- .then(() => {
178
- this.uploadArray.forEach((item) => {
179
- if (item.upload?.state === 0) {
180
- item.upload.cancel();
181
- }
176
+ .then(() => {
177
+ this.uploadArray.forEach((item) => {
178
+ if (item.upload?.state === 0) {
179
+ item.upload.cancel();
180
+ }
181
+ });
182
+ this.uploadEd();
183
+ })
184
+ .catch(() => {
182
185
  });
183
- this.uploadEd();
184
- })
185
- .catch(() => {});
186
186
  } else {
187
187
  this.uploadEd();
188
188
  }
189
189
  },
190
190
 
191
- judgeUploadMapItemUploaded() {
191
+ judgeUploadMapItemUploaded(statusOfError = false) {
192
192
  this.uploadArrayMap.forEach((value, key) => {
193
193
  let uploadArr = this.uploadArrayMap.get(key);
194
194
 
@@ -197,14 +197,14 @@ export default {
197
197
  });
198
198
  // 判断群组是否上传了 只需要执行数组的第一个就行了
199
199
  if (flag) {
200
- uploadArr[0]?.cb(uploadArr);
200
+ uploadArr[0]?.cb(statusOfError ? statusOfError : uploadArr);
201
201
  }
202
202
  });
203
203
  },
204
204
 
205
205
  uploadEd(statusOfError = false) {
206
206
  let uploadArray = this.uploadArray;
207
- this.judgeUploadMapItemUploaded();
207
+ this.judgeUploadMapItemUploaded(statusOfError);
208
208
  let flag = uploadArray.every((item) => {
209
209
  return !item.upload || item.upload.state !== 0 || item.url === "cancel";
210
210
  });
@@ -216,7 +216,7 @@ export default {
216
216
  });
217
217
 
218
218
  this.$props.uploadEdEvent(
219
- statusOfError ? statusOfError : uploadArray
219
+ statusOfError ? statusOfError : uploadArray
220
220
  );
221
221
  }
222
222
  }
@@ -228,12 +228,13 @@ export default {
228
228
  cancelButtonText: "取消",
229
229
  type: "warning",
230
230
  })
231
- .then(() => {
232
- if (item.upload?.state === 0) {
233
- item.upload.cancel();
234
- }
235
- })
236
- .catch(() => {});
231
+ .then(() => {
232
+ if (item.upload?.state === 0) {
233
+ item.upload.cancel();
234
+ }
235
+ })
236
+ .catch(() => {
237
+ });
237
238
  },
238
239
 
239
240
  uploadFailed() {
@@ -36,6 +36,7 @@ var UseUpload = /** @class */ (function () {
36
36
  this.dynamicMount = new DynamicMountClass_1["default"]({
37
37
  componentProps: {
38
38
  uploadEdEvent: function (evt) {
39
+ console.log('evt', evt);
39
40
  _this.uploadEd(evt);
40
41
  },
41
42
  isOss: isOss,
@@ -48,22 +49,20 @@ var UseUpload = /** @class */ (function () {
48
49
  return true;
49
50
  };
50
51
  UseUpload.prototype.uploadEd = function (evt) {
51
- var _this = this;
52
52
  if (evt === void 0) { evt = null; }
53
+ console.log('useUpload', evt);
53
54
  this.lock = true;
54
- setTimeout(function () {
55
- _this.cbList.forEach(function (item) {
56
- item.cb(evt ? evt : item.uploadList);
57
- });
58
- if (_this.dynamicMount) {
59
- var component = _this.dynamicMount.getComponent();
60
- // @ts-ignore
61
- component.$destroy();
62
- _this.dynamicMount = null;
63
- _this.cbList = [];
64
- _this.lock = false;
65
- }
66
- }, 500);
55
+ this.cbList.forEach(function (item) {
56
+ item.cb(evt ? evt : item.uploadList);
57
+ });
58
+ if (this.dynamicMount) {
59
+ var component = this.dynamicMount.getComponent();
60
+ // @ts-ignore
61
+ component.$destroy();
62
+ this.dynamicMount = null;
63
+ this.cbList = [];
64
+ this.lock = false;
65
+ }
67
66
  };
68
67
  UseUpload.prototype.appendUploadItem = function (list) {
69
68
  if (this.dynamicMount) {
@@ -39,6 +39,7 @@ class UseUpload implements UseUploadInterFace {
39
39
  this.dynamicMount = new DynamicMount({
40
40
  componentProps: {
41
41
  uploadEdEvent: (evt) => {
42
+ console.log('evt',evt);
42
43
  this.uploadEd(evt);
43
44
  },
44
45
  isOss: isOss,
@@ -53,20 +54,19 @@ class UseUpload implements UseUploadInterFace {
53
54
  }
54
55
 
55
56
  uploadEd(evt = null) {
57
+ console.log('useUpload',evt);
56
58
  this.lock = true;
57
- setTimeout(() => {
58
- this.cbList.forEach((item) => {
59
- item.cb(evt ? evt : item.uploadList);
60
- });
61
- if (this.dynamicMount) {
62
- let component = this.dynamicMount.getComponent();
63
- // @ts-ignore
64
- component.$destroy();
65
- this.dynamicMount = null;
66
- this.cbList = [];
67
- this.lock = false;
68
- }
69
- }, 500);
59
+ this.cbList.forEach((item) => {
60
+ item.cb(evt ? evt : item.uploadList);
61
+ });
62
+ if (this.dynamicMount) {
63
+ let component = this.dynamicMount.getComponent();
64
+ // @ts-ignore
65
+ component.$destroy();
66
+ this.dynamicMount = null;
67
+ this.cbList = [];
68
+ this.lock = false;
69
+ }
70
70
  }
71
71
 
72
72
  appendUploadItem(list) {
@@ -47,6 +47,7 @@ class Upload {
47
47
  this.state = 1;
48
48
  resolve(uploadEdUrl);
49
49
  } catch (error) {
50
+ console.log('error',error);
50
51
  this.state = 2;
51
52
  reject(error);
52
53
  } finally {