n20-common-lib 2.7.6 → 2.7.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
|
@@ -324,10 +324,6 @@ export default {
|
|
|
324
324
|
type: Object,
|
|
325
325
|
default: undefined
|
|
326
326
|
},
|
|
327
|
-
height: {
|
|
328
|
-
type: [Number, String],
|
|
329
|
-
default: '300px'
|
|
330
|
-
},
|
|
331
327
|
seePrefix: {
|
|
332
328
|
type: String,
|
|
333
329
|
default: undefined
|
|
@@ -438,48 +434,21 @@ export default {
|
|
|
438
434
|
showClose: true
|
|
439
435
|
})
|
|
440
436
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
437
|
+
const { code, data } = await this.$axios.post(`/api/neams/eamsbaserecord/mergeDownladPdf`,this.selectionList.map(res =>res.beid) || [],{
|
|
438
|
+
responseType: 'blob'
|
|
439
|
+
})
|
|
440
|
+
if (code === 200) {
|
|
441
|
+
let aDom = document.createElement('a')
|
|
442
|
+
aDom.href = data
|
|
443
|
+
aDom.download = '批量附件.pdf'
|
|
444
|
+
aDom.click()
|
|
444
445
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
printable: item.pathUrl,
|
|
449
|
-
type: item.printType,
|
|
450
|
-
onPrintDialogClose: function () {
|
|
451
|
-
// 如果还有剩余的PDF文件,则继续打印下一个
|
|
452
|
-
if (index < selectionList.length - 1) {
|
|
453
|
-
printPdf(selectionList[index + 1], index + 1)
|
|
454
|
-
} else {
|
|
455
|
-
// 所有PDF文件都已打印完毕
|
|
456
|
-
console.log('所有PDF文件打印完成')
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
onError: (error) => {
|
|
460
|
-
console.error('打印PDF文件出错:', error)
|
|
461
|
-
}
|
|
446
|
+
this.$nextTick(() => {
|
|
447
|
+
aDom = undefined
|
|
448
|
+
data && URL.revokeObjectURL(data)
|
|
462
449
|
})
|
|
463
450
|
}
|
|
464
|
-
|
|
465
|
-
if (selectionList.length > 0) {
|
|
466
|
-
printPdf(selectionList[0], 0)
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
async setUrlData(selectionList) {
|
|
470
|
-
let list = selectionList.map((item) => {
|
|
471
|
-
axios
|
|
472
|
-
.get(`/api/neams/eamsbaserecord/download/${item[this.keys.url]}?t=${Date.now()}`, null, {
|
|
473
|
-
responseType: 'blob'
|
|
474
|
-
})
|
|
475
|
-
.then((res) => {
|
|
476
|
-
item.pathUrl = URL.createObjectURL(res)
|
|
477
|
-
let extension = item['_name'].split('.').pop().toLowerCase()
|
|
478
|
-
item.printType = extension === 'pdf' ? 'pdf' : 'image'
|
|
479
|
-
})
|
|
480
|
-
return item
|
|
481
|
-
})
|
|
482
|
-
return await Promise.all(list)
|
|
451
|
+
|
|
483
452
|
},
|
|
484
453
|
batchBeforeUploadFn(file) {
|
|
485
454
|
let bu = this.$listeners['before-upload'] || this.$listeners['beforeUpload']
|