meixioacomponent 2.0.43 → 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/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +7 -1
- package/lib/config/use/UseUpload.d.ts.map +1 -1
- package/lib/config/use/UseUpload.js +13 -13
- package/lib/meixioacomponent.common.js +44229 -43866
- package/lib/meixioacomponent.umd.js +44240 -43877
- package/lib/meixioacomponent.umd.min.js +12 -12
- package/package.json +1 -1
- package/packages/components/base/baseInput/baseInput.vue +98 -0
- package/packages/components/base/baseInput/index.js +0 -0
- package/packages/components/base/baseSelect/baseSelect.vue +102 -0
- package/packages/components/base/baseSelect/index.js +6 -0
- package/packages/components/base/baseText/index.vue +16 -8
- package/packages/components/base/baseTimeRangePicker/baseTimeRangePicker.vue +60 -0
- package/packages/components/base/baseTimeRangePicker/index.js +7 -0
- package/packages/components/base/baseTimeTypeSelect/base_time_type_select.vue +11 -7
- package/packages/components/base/baseUpload/mixins.js +1 -0
- package/packages/components/base/baseUploadTemplate/index.vue +0 -1
- package/packages/components/base/tDateRangePicker/index.js +6 -0
- package/packages/components/base/tDateRangePicker/tDateRangePicker.vue +96 -0
- package/packages/components/base/upload/upload.vue +46 -45
- package/packages/components/index.js +7 -1
- package/packages/components/index.ts +9 -2
- package/packages/config/use/UseUpload.js +13 -14
- package/packages/config/use/UseUpload.ts +13 -13
- package/packages/utils/upload.js +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base_input-wrap">
|
|
3
|
+
<t-input
|
|
4
|
+
v-model="module"
|
|
5
|
+
:clearable="clearable"
|
|
6
|
+
:readonly="readonly"
|
|
7
|
+
:maxlength="maxlength"
|
|
8
|
+
:size="size"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
:placeholder="placeholder"
|
|
11
|
+
@change="onChange"
|
|
12
|
+
@blur="onBlur"
|
|
13
|
+
@focus="onFocus"
|
|
14
|
+
@input="onInput"
|
|
15
|
+
@clear="onClear"
|
|
16
|
+
@enter="onEnter"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import {defineComponent} from 'vue'
|
|
24
|
+
|
|
25
|
+
export default defineComponent({
|
|
26
|
+
name: "baseInput",
|
|
27
|
+
props: {
|
|
28
|
+
placeholder: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: '请输入内容'
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: '',
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
size: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'mini'
|
|
40
|
+
},
|
|
41
|
+
readonly: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
maxlength: {
|
|
46
|
+
type: Number,
|
|
47
|
+
},
|
|
48
|
+
clearable: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
disabled: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
computed: {
|
|
59
|
+
module: {
|
|
60
|
+
set(val) {
|
|
61
|
+
this.$emit('input', val);
|
|
62
|
+
},
|
|
63
|
+
get() {
|
|
64
|
+
return this.$props.value
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
methods: {
|
|
71
|
+
onBlur() {
|
|
72
|
+
this.$emit('blur')
|
|
73
|
+
},
|
|
74
|
+
onFocus() {
|
|
75
|
+
this.$emit('focus')
|
|
76
|
+
},
|
|
77
|
+
onChange() {
|
|
78
|
+
this.$emit('change')
|
|
79
|
+
},
|
|
80
|
+
onInput() {
|
|
81
|
+
this.$emit('input')
|
|
82
|
+
},
|
|
83
|
+
onClear() {
|
|
84
|
+
this.$emit('clear')
|
|
85
|
+
},
|
|
86
|
+
onEnter(event) {
|
|
87
|
+
this.$emit('enter', event);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
</script>
|
|
92
|
+
<style scoped lang="less">
|
|
93
|
+
.base_input-wrap {
|
|
94
|
+
width: auto;
|
|
95
|
+
height: auto;
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
98
|
+
|
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div class="base_select-wrap">
|
|
5
|
+
|
|
6
|
+
<t-select v-model="value"
|
|
7
|
+
:clearable="clearable"
|
|
8
|
+
@change="onChange"
|
|
9
|
+
@clear="onClear"
|
|
10
|
+
@blur="onBlur"
|
|
11
|
+
@focus="onFocus"
|
|
12
|
+
@visible-change="onVisibleChange"
|
|
13
|
+
:multiple="multiple" :placeholder="placeholder" :disabled="disabled" :size="size">
|
|
14
|
+
<t-option v-for="(item,index) in options" :key="index" :label="labelKey" :value="valueKey"></t-option>
|
|
15
|
+
</t-select>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import {defineComponent} from 'vue'
|
|
23
|
+
export default defineComponent({
|
|
24
|
+
name: "baseSelect",
|
|
25
|
+
props: {
|
|
26
|
+
multiple: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
value: {},
|
|
35
|
+
size: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'small'
|
|
38
|
+
},
|
|
39
|
+
clearable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
placeholder: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: '请选择'
|
|
46
|
+
},
|
|
47
|
+
options: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => {
|
|
50
|
+
return []
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
valueKey: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: 'value'
|
|
56
|
+
},
|
|
57
|
+
labelKey: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'label'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
computed: {
|
|
63
|
+
module: {
|
|
64
|
+
set(val) {
|
|
65
|
+
this.$emit('input', val);
|
|
66
|
+
},
|
|
67
|
+
get() {
|
|
68
|
+
return this.$props.value
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
onChange(event) {
|
|
75
|
+
this.$emit('change', event);
|
|
76
|
+
},
|
|
77
|
+
onClear(event) {
|
|
78
|
+
this.$emit('clear', event);
|
|
79
|
+
},
|
|
80
|
+
onBlur(event) {
|
|
81
|
+
this.$emit('blur', event);
|
|
82
|
+
},
|
|
83
|
+
onFocus(event) {
|
|
84
|
+
this.$emit('focus', event);
|
|
85
|
+
},
|
|
86
|
+
onVisibleChange(value) {
|
|
87
|
+
this.$emit('visible-change', value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<style scoped lang="less">
|
|
96
|
+
.base_select-wrap {
|
|
97
|
+
width: auto;
|
|
98
|
+
height: auto;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
101
|
+
|
|
102
|
+
|
|
@@ -10,8 +10,21 @@
|
|
|
10
10
|
{{ filterContent() }}
|
|
11
11
|
</div>
|
|
12
12
|
<div v-else-if="type==='money'" :class="[type]">
|
|
13
|
-
<t-statistic
|
|
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
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base_time_range_picker-wrap">
|
|
3
|
+
<t-date-range-picker
|
|
4
|
+
ref="baseTimeRangePickerContentRef"
|
|
5
|
+
v-model="module" v-bind="$attrs"
|
|
6
|
+
@change="onChange"
|
|
7
|
+
@focus="onFocus"
|
|
8
|
+
@blur="onblur"
|
|
9
|
+
></t-date-range-picker>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: "baseTimeRangePicker",
|
|
17
|
+
data() {
|
|
18
|
+
return {}
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
module: {
|
|
22
|
+
set(val) {
|
|
23
|
+
this.$emit('input', val);
|
|
24
|
+
},
|
|
25
|
+
get() {
|
|
26
|
+
return this.$props.value
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
value: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => {
|
|
34
|
+
return []
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
onChange(value) {
|
|
40
|
+
this.$emit('change', value);
|
|
41
|
+
},
|
|
42
|
+
onFocus(value) {
|
|
43
|
+
this.$emit('focus', value);
|
|
44
|
+
},
|
|
45
|
+
onblur(value) {
|
|
46
|
+
this.$emit('blur', value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<style scoped lang="less">
|
|
55
|
+
.base_time_range_picker-wrap {
|
|
56
|
+
width: auto;
|
|
57
|
+
height: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<t-popup
|
|
2
|
+
<t-popup placement="bottom" trigger="click" @visible-change="visibleChange">
|
|
3
3
|
<template #content>
|
|
4
4
|
<div class="time-type-select-content">
|
|
5
5
|
<div class="content-line-wrap">
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
<t-date-range-picker
|
|
28
28
|
v-model="timeModule"
|
|
29
29
|
size="medium"
|
|
30
|
-
enable-time-picker=""
|
|
31
30
|
:clearable="true"
|
|
32
31
|
style="width: 100%; margin-top: var(--margin-4)"
|
|
33
32
|
valueType="time-stamp"
|
|
@@ -70,11 +69,13 @@
|
|
|
70
69
|
|
|
71
70
|
<script>
|
|
72
71
|
import baseButtonHandle from "../baseButtonHandle/baseButtonHandle.vue";
|
|
72
|
+
import tDateRangePicker from "../tDateRangePicker/tDateRangePicker.vue"
|
|
73
73
|
import {TimeIcon} from "tdesign-icons-vue"
|
|
74
74
|
//
|
|
75
75
|
import {baseTimeTypeConfig} from "./config";
|
|
76
76
|
import {FilterTime} from "../../../utils/utils";
|
|
77
77
|
|
|
78
|
+
|
|
78
79
|
export default {
|
|
79
80
|
name: "baseTimeTypeSelect",
|
|
80
81
|
data() {
|
|
@@ -116,7 +117,8 @@ export default {
|
|
|
116
117
|
},
|
|
117
118
|
components: {
|
|
118
119
|
baseButtonHandle,
|
|
119
|
-
TimeIcon
|
|
120
|
+
TimeIcon,
|
|
121
|
+
tDateRangePicker
|
|
120
122
|
},
|
|
121
123
|
computed: {
|
|
122
124
|
module: {
|
|
@@ -183,18 +185,18 @@ export default {
|
|
|
183
185
|
this.timeModule = renderTime;
|
|
184
186
|
}
|
|
185
187
|
},
|
|
186
|
-
|
|
187
188
|
doClose() {
|
|
188
189
|
this.isOpen = false;
|
|
189
190
|
},
|
|
190
|
-
|
|
191
191
|
eventHide() {
|
|
192
192
|
this.isOpen = false;
|
|
193
193
|
},
|
|
194
194
|
|
|
195
195
|
visibleChange(visible) {
|
|
196
196
|
if (visible) {
|
|
197
|
-
this
|
|
197
|
+
this.$nextTick(() => {
|
|
198
|
+
this.eventShow();
|
|
199
|
+
})
|
|
198
200
|
} else {
|
|
199
201
|
this.eventHide();
|
|
200
202
|
}
|
|
@@ -208,6 +210,8 @@ export default {
|
|
|
208
210
|
|
|
209
211
|
if ((Array.isArray(_timeModule) && _timeModule?.length >= 1)) {
|
|
210
212
|
this.module = _timeModule;
|
|
213
|
+
} else {
|
|
214
|
+
this.module = [];
|
|
211
215
|
}
|
|
212
216
|
if (_selectLineItem) {
|
|
213
217
|
this.module = _selectLineItem;
|
|
@@ -272,7 +276,7 @@ export default {
|
|
|
272
276
|
|
|
273
277
|
.content-line-wrap {
|
|
274
278
|
box-sizing: border-box;
|
|
275
|
-
padding: var(--padding-5)
|
|
279
|
+
padding: var(--padding-5) 0;
|
|
276
280
|
|
|
277
281
|
.content-line {
|
|
278
282
|
width: 100%;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<date-range-picker v-model="module"
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
@blur="onBlur"
|
|
5
|
+
@change="onChange"
|
|
6
|
+
@confirm="onConfirm"
|
|
7
|
+
@focus="onFocus"
|
|
8
|
+
@input="onInput"
|
|
9
|
+
@pick="onPick"
|
|
10
|
+
@preset-click="onPresetClick"
|
|
11
|
+
:presets="computedPresets"/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: "tDateRangePicker",
|
|
20
|
+
data() {
|
|
21
|
+
return {}
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
value: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => {
|
|
27
|
+
return []
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
components: {},
|
|
32
|
+
created() {
|
|
33
|
+
},
|
|
34
|
+
computed: {
|
|
35
|
+
module: {
|
|
36
|
+
set(val) {
|
|
37
|
+
this.$emit('input', val);
|
|
38
|
+
},
|
|
39
|
+
get() {
|
|
40
|
+
return this.$props.value;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
computedPresets() {
|
|
44
|
+
const now = {
|
|
45
|
+
'此刻': () => {
|
|
46
|
+
if (this.$attrs['valueType'] === 'time-stamp') {
|
|
47
|
+
return [new Date().valueOf(), new Date().valueOf()]
|
|
48
|
+
}
|
|
49
|
+
return [new Date(), new Date()];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (this.$attrs[`presets`] && typeof this.$attrs[`presets`] === 'object') {
|
|
53
|
+
return {
|
|
54
|
+
...this.$attrs['presets'],
|
|
55
|
+
...now,
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
return {
|
|
59
|
+
...now
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
onBlur(event) {
|
|
66
|
+
this.$emit('blur', event);
|
|
67
|
+
},
|
|
68
|
+
onChange(event) {
|
|
69
|
+
this.$emit('change', event);
|
|
70
|
+
},
|
|
71
|
+
onConfirm(event) {
|
|
72
|
+
this.$emit('confirm', event);
|
|
73
|
+
},
|
|
74
|
+
onFocus(event) {
|
|
75
|
+
this.$emit('focus', event);
|
|
76
|
+
},
|
|
77
|
+
onInput(event) {
|
|
78
|
+
this.$emit('input', event);
|
|
79
|
+
},
|
|
80
|
+
onPick(event) {
|
|
81
|
+
this.$emit('pick', event);
|
|
82
|
+
},
|
|
83
|
+
onPresetClick(event) {
|
|
84
|
+
this.$emit('preset-click', event);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style scoped lang="less">
|
|
91
|
+
.t_date_range_picker-wrap {
|
|
92
|
+
width: auto;
|
|
93
|
+
height: auto;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
</style>
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
<div class="upload-content">
|
|
25
25
|
<uploadItemVue
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
uploadArray?.filter((item) => {
|
|
93
|
+
return item.process === 100;
|
|
94
|
+
}).length / uploadArray?.length
|
|
95
95
|
);
|
|
96
96
|
},
|
|
97
97
|
totalStyle() {
|
|
98
|
-
return {
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
231
|
+
.then(() => {
|
|
232
|
+
if (item.upload?.state === 0) {
|
|
233
|
+
item.upload.cancel();
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
.catch(() => {
|
|
237
|
+
});
|
|
237
238
|
},
|
|
238
239
|
|
|
239
240
|
uploadFailed() {
|