n20-common-lib 2.5.4 → 2.5.5
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 +2 -2
- package/src/components/Upload/index.vue +34 -8
- package/theme/blue.css +3 -0
- package/theme/cctcRed.css +3 -0
- package/theme/fonts/element-icons.535877f5.woff +0 -0
- package/theme/fonts/element-icons.732389de.ttf +0 -0
- package/theme/fonts/iconfont.47f5da25.woff2 +0 -0
- package/theme/fonts/iconfont.6ad948fe.woff +0 -0
- package/theme/fonts/iconfont.76d19005.woff2 +0 -0
- package/theme/fonts/iconfont.85c70ef9.ttf +0 -0
- package/theme/fonts/iconfont.ab8c366d.ttf +0 -0
- package/theme/fonts/iconfont.b7ea4726.woff +0 -0
- package/theme/fonts/iconfont.e6bdbf43.woff2 +0 -0
- package/theme/fonts/iconfont.f1777a50.woff +0 -0
- package/theme/fonts/iconfont.f4c32765.ttf +0 -0
- package/theme/fonts/iconfont.fbdd69b3.ttf +0 -0
- package/theme/green.css +3 -0
- package/theme/lightBlue.css +3 -0
- package/theme/orange.css +3 -0
- package/theme/purple.css +3 -0
- package/theme/red.css +3 -0
- package/theme/yellow.css +3 -0
package/package.json
CHANGED
|
@@ -131,6 +131,10 @@ export default {
|
|
|
131
131
|
type: Function,
|
|
132
132
|
default: undefined
|
|
133
133
|
},
|
|
134
|
+
beforeRemove: {
|
|
135
|
+
type: Function,
|
|
136
|
+
default: undefined
|
|
137
|
+
},
|
|
134
138
|
beforeUpload: {
|
|
135
139
|
type: Function,
|
|
136
140
|
default: undefined
|
|
@@ -188,13 +192,24 @@ export default {
|
|
|
188
192
|
this.$emit('importError')
|
|
189
193
|
},
|
|
190
194
|
clearFile() {
|
|
191
|
-
if (this.
|
|
192
|
-
this.onRemove
|
|
195
|
+
if (!this.beforeRemove) {
|
|
196
|
+
if (this.onRemove) {
|
|
197
|
+
this.onRemove(this.fileList[0], this.fileList)
|
|
198
|
+
} else {
|
|
199
|
+
this.fileNameC = ''
|
|
200
|
+
this.fileUrlC = ''
|
|
201
|
+
this.fileList.pop()
|
|
202
|
+
console.log('删除上传')
|
|
203
|
+
}
|
|
193
204
|
} else {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
205
|
+
const before = this.beforeRemove(this.fileList)
|
|
206
|
+
if (before && before.then) {
|
|
207
|
+
before.then(() => {
|
|
208
|
+
this.onRemove(this.fileList[0], this.fileList)
|
|
209
|
+
})
|
|
210
|
+
} else if (before !== false) {
|
|
211
|
+
this.onRemove(this.fileList[0], this.fileList)
|
|
212
|
+
}
|
|
198
213
|
}
|
|
199
214
|
},
|
|
200
215
|
beforeUploadFn(file) {
|
|
@@ -333,8 +348,19 @@ export default {
|
|
|
333
348
|
}
|
|
334
349
|
},
|
|
335
350
|
removeFn(file, fileList) {
|
|
336
|
-
if (this.
|
|
337
|
-
this.onRemove
|
|
351
|
+
if (!this.beforeRemove) {
|
|
352
|
+
if (this.onRemove) {
|
|
353
|
+
this.onRemove(file, fileList)
|
|
354
|
+
}
|
|
355
|
+
} else {
|
|
356
|
+
const before = this.beforeRemove(file, fileList)
|
|
357
|
+
if (before && before.then) {
|
|
358
|
+
before.then(() => {
|
|
359
|
+
this.onRemove(file, fileList)
|
|
360
|
+
})
|
|
361
|
+
} else if (before !== false) {
|
|
362
|
+
this.onRemove(file, fileList)
|
|
363
|
+
}
|
|
338
364
|
}
|
|
339
365
|
},
|
|
340
366
|
submit() {
|