|
|
@ -1085,7 +1085,7 @@ import { |
|
|
import row from "element-ui/packages/row"; |
|
|
import row from "element-ui/packages/row"; |
|
|
import moment from 'moment'; |
|
|
import moment from 'moment'; |
|
|
import 'moment/locale/zh-cn'; |
|
|
import 'moment/locale/zh-cn'; |
|
|
import {downLoadObjectFile} from "../../../api/eam/eam_object_list"; |
|
|
|
|
|
|
|
|
import {downLoadObjectFile2} from "../../../api/eam/eam_object_list"; |
|
|
import {EventBus} from "../../../main"; |
|
|
import {EventBus} from "../../../main"; |
|
|
/*打样记录組件*/ |
|
|
/*打样记录組件*/ |
|
|
|
|
|
|
|
|
@ -4772,7 +4772,7 @@ import {EventBus} from "../../../main"; |
|
|
let pdf = ['pdf'] |
|
|
let pdf = ['pdf'] |
|
|
if (image.includes(row.fileType.toLowerCase())) { |
|
|
if (image.includes(row.fileType.toLowerCase())) { |
|
|
type = 'image/' + row.fileType |
|
|
type = 'image/' + row.fileType |
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
|
|
|
|
|
downLoadObjectFile2(row).then(({data}) => { |
|
|
const blob = new Blob([data], { type: type }); |
|
|
const blob = new Blob([data], { type: type }); |
|
|
// 创建URL来生成预览 |
|
|
// 创建URL来生成预览 |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
@ -4782,7 +4782,7 @@ import {EventBus} from "../../../main"; |
|
|
} |
|
|
} |
|
|
else if (video.includes(row.fileType.toLowerCase())) { |
|
|
else if (video.includes(row.fileType.toLowerCase())) { |
|
|
type = 'video/' + row.fileType |
|
|
type = 'video/' + row.fileType |
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
|
|
|
|
|
downLoadObjectFile2(row).then(({data}) => { |
|
|
const blob = new Blob([data], { type: type }); |
|
|
const blob = new Blob([data], { type: type }); |
|
|
// 创建URL来生成预览 |
|
|
// 创建URL来生成预览 |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
@ -4792,7 +4792,7 @@ import {EventBus} from "../../../main"; |
|
|
} |
|
|
} |
|
|
else if (txt.includes(row.fileType.toLowerCase())) { |
|
|
else if (txt.includes(row.fileType.toLowerCase())) { |
|
|
type = 'text/plain' |
|
|
type = 'text/plain' |
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
|
|
|
|
|
downLoadObjectFile2(row).then(({data}) => { |
|
|
const blob = new Blob([data], { type: type }); |
|
|
const blob = new Blob([data], { type: type }); |
|
|
// 创建URL来生成预览 |
|
|
// 创建URL来生成预览 |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
@ -4808,7 +4808,7 @@ import {EventBus} from "../../../main"; |
|
|
} else { |
|
|
} else { |
|
|
type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
} |
|
|
} |
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
|
|
|
|
|
downLoadObjectFile2(row).then(({data}) => { |
|
|
// 不限制文件下载类型 |
|
|
// 不限制文件下载类型 |
|
|
const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) |
|
|
const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) |
|
|
// 下载文件名称 |
|
|
// 下载文件名称 |
|
|
@ -4826,7 +4826,7 @@ import {EventBus} from "../../../main"; |
|
|
} |
|
|
} |
|
|
else if (pdf.includes(row.fileType.toLowerCase())) { |
|
|
else if (pdf.includes(row.fileType.toLowerCase())) { |
|
|
type = 'application/pdf' |
|
|
type = 'application/pdf' |
|
|
downLoadObjectFile(row).then(({data}) => { |
|
|
|
|
|
|
|
|
downLoadObjectFile2(row).then(({data}) => { |
|
|
const blob = new Blob([data], { type: type }); |
|
|
const blob = new Blob([data], { type: type }); |
|
|
// 创建URL来生成预览 |
|
|
// 创建URL来生成预览 |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
const fileURL = URL.createObjectURL(blob); |
|
|
@ -4843,7 +4843,7 @@ import {EventBus} from "../../../main"; |
|
|
}, |
|
|
}, |
|
|
// 下载 |
|
|
// 下载 |
|
|
downloadFile (row) { |
|
|
downloadFile (row) { |
|
|
downLoadObjectFile(row) |
|
|
|
|
|
|
|
|
downLoadObjectFile2(row) |
|
|
.then(({data}) => { |
|
|
.then(({data}) => { |
|
|
// 不限制文件下载类型 |
|
|
// 不限制文件下载类型 |
|
|
const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) |
|
|
const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) |
|
|
|