上传方式修改
parent
fe67ef0189
commit
6250e957f0
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "EICS",
|
||||
"version": "1.0.0",
|
||||
"version": "1.3.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -4269,6 +4269,26 @@
|
|||
"zip-stream": "^4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"compress-commons": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/compress-commons/-/compress-commons-4.1.2.tgz",
|
||||
"integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==",
|
||||
"requires": {
|
||||
"buffer-crc32": "^0.2.13",
|
||||
"crc32-stream": "^4.0.2",
|
||||
"normalize-path": "^3.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
}
|
||||
},
|
||||
"crc32-stream": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/crc32-stream/-/crc32-stream-4.0.3.tgz",
|
||||
"integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==",
|
||||
"requires": {
|
||||
"crc-32": "^1.2.0",
|
||||
"readable-stream": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
|
@ -4278,6 +4298,35 @@
|
|||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"zip-stream": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/zip-stream/-/zip-stream-4.1.1.tgz",
|
||||
"integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==",
|
||||
"requires": {
|
||||
"archiver-utils": "^3.0.4",
|
||||
"compress-commons": "^4.1.2",
|
||||
"readable-stream": "^3.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"archiver-utils": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/archiver-utils/-/archiver-utils-3.0.4.tgz",
|
||||
"integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==",
|
||||
"requires": {
|
||||
"glob": "^7.2.3",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"lazystream": "^1.0.0",
|
||||
"lodash.defaults": "^4.2.0",
|
||||
"lodash.difference": "^4.5.0",
|
||||
"lodash.flatten": "^4.4.0",
|
||||
"lodash.isplainobject": "^4.0.6",
|
||||
"lodash.union": "^4.6.0",
|
||||
"normalize-path": "^3.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -6189,29 +6238,6 @@
|
|||
"integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==",
|
||||
"dev": true
|
||||
},
|
||||
"compress-commons": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/compress-commons/-/compress-commons-4.1.2.tgz",
|
||||
"integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==",
|
||||
"requires": {
|
||||
"buffer-crc32": "^0.2.13",
|
||||
"crc32-stream": "^4.0.2",
|
||||
"normalize-path": "^3.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"compressible": {
|
||||
"version": "2.0.18",
|
||||
"resolved": "https://registry.npmmirror.com/compressible/-/compressible-2.0.18.tgz",
|
||||
|
@ -6529,27 +6555,6 @@
|
|||
"resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz",
|
||||
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="
|
||||
},
|
||||
"crc32-stream": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/crc32-stream/-/crc32-stream-4.0.3.tgz",
|
||||
"integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==",
|
||||
"requires": {
|
||||
"crc-32": "^1.2.0",
|
||||
"readable-stream": "^3.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"create-ecdh": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/create-ecdh/-/create-ecdh-4.0.4.tgz",
|
||||
|
@ -15778,6 +15783,11 @@
|
|||
"resolved": "https://registry.npmmirror.com/stream-wormhole/-/stream-wormhole-1.1.0.tgz",
|
||||
"integrity": "sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew=="
|
||||
},
|
||||
"streamsaver": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/streamsaver/-/streamsaver-2.0.3.tgz",
|
||||
"integrity": "sha512-IpXeZ67YxcsrfZHe3yg/IyZ5KPfRSn1teDy5mRX2e8M6K410NcJNcR+SFQ2Z92DO36VBUArQP4Vy3Qu33MwIOQ=="
|
||||
},
|
||||
"strict-uri-encode": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
|
||||
|
@ -18923,45 +18933,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"zip-stream": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/zip-stream/-/zip-stream-4.1.1.tgz",
|
||||
"integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==",
|
||||
"requires": {
|
||||
"archiver-utils": "^3.0.4",
|
||||
"compress-commons": "^4.1.2",
|
||||
"readable-stream": "^3.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"archiver-utils": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/archiver-utils/-/archiver-utils-3.0.4.tgz",
|
||||
"integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==",
|
||||
"requires": {
|
||||
"glob": "^7.2.3",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"lazystream": "^1.0.0",
|
||||
"lodash.defaults": "^4.2.0",
|
||||
"lodash.difference": "^4.5.0",
|
||||
"lodash.flatten": "^4.4.0",
|
||||
"lodash.isplainobject": "^4.0.6",
|
||||
"lodash.union": "^4.6.0",
|
||||
"normalize-path": "^3.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
}
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"zrender": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-4.3.2.tgz",
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
"sass-loader": "^8.0.0",
|
||||
"screenfull": "^4.2.0",
|
||||
"sortablejs": "^1.15.0",
|
||||
"streamsaver": "^2.0.3",
|
||||
"v-viewer": "^1.6.4",
|
||||
"vcrontab": "^0.3.5",
|
||||
"vue": "^2.6.11",
|
||||
|
|
|
@ -103,6 +103,7 @@ import uploadList from "./components/upload-list.vue";
|
|||
import studyView from "./components/study-view.vue";
|
||||
import { getSubjectImageUploadList, deleteTaskStudy } from "@/api/load.js";
|
||||
import { downloadImage } from "@/utils/uploadZip.js";
|
||||
import store from "@/store";
|
||||
export default {
|
||||
name: "uploadImage",
|
||||
props: {
|
||||
|
@ -247,16 +248,356 @@ export default {
|
|||
},
|
||||
// 打包下载
|
||||
async downloadImage(item) {
|
||||
try {
|
||||
await downloadImage(
|
||||
this.$route.query.trialId,
|
||||
item.SourceSubjectVisitId
|
||||
);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
let zipName = "压缩包.zip";
|
||||
let InstanceInfoList = [
|
||||
{
|
||||
Id: "e634352c-6465-32ba-04b3-824ec8d346a8",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/e634352c-6465-32ba-04b3-824ec8d346a8",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 1,
|
||||
},
|
||||
{
|
||||
Id: "d4ad1dd2-747b-6de7-8ad4-3e81c58943dd",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/d4ad1dd2-747b-6de7-8ad4-3e81c58943dd",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 2,
|
||||
},
|
||||
{
|
||||
Id: "6a1d1d12-2b4a-0368-c7e1-d44f7180b280",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/6a1d1d12-2b4a-0368-c7e1-d44f7180b280",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 3,
|
||||
},
|
||||
{
|
||||
Id: "7a8fb1b4-9ea8-1189-4ca6-b9a9b9547a39",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/7a8fb1b4-9ea8-1189-4ca6-b9a9b9547a39",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 4,
|
||||
},
|
||||
{
|
||||
Id: "8d00be19-5ac5-c608-dbd0-41f84cfacd95",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/8d00be19-5ac5-c608-dbd0-41f84cfacd95",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 5,
|
||||
},
|
||||
{
|
||||
Id: "729ded91-0eca-78f2-1c17-5182d4f27e3a",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/729ded91-0eca-78f2-1c17-5182d4f27e3a",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 6,
|
||||
},
|
||||
{
|
||||
Id: "9e2fd28c-72fe-bb66-e0ce-40115cd82260",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/9e2fd28c-72fe-bb66-e0ce-40115cd82260",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 7,
|
||||
},
|
||||
{
|
||||
Id: "9b31613f-3c9e-28ad-fd9e-7001a69e09b5",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/9b31613f-3c9e-28ad-fd9e-7001a69e09b5",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 8,
|
||||
},
|
||||
{
|
||||
Id: "4982b453-d068-7e56-2acd-a361d8584f35",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/4982b453-d068-7e56-2acd-a361d8584f35",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 9,
|
||||
},
|
||||
{
|
||||
Id: "8279cf5a-2551-43ea-3fe4-673e88ba7e5a",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/8279cf5a-2551-43ea-3fe4-673e88ba7e5a",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 10,
|
||||
},
|
||||
{
|
||||
Id: "6424e9c5-d31b-9388-3b64-a56705ab6fc8",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/6424e9c5-d31b-9388-3b64-a56705ab6fc8",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 11,
|
||||
},
|
||||
{
|
||||
Id: "a73cf3f9-defa-0c22-dfdc-8c5bfb93c9a7",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/a73cf3f9-defa-0c22-dfdc-8c5bfb93c9a7",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 12,
|
||||
},
|
||||
{
|
||||
Id: "dbfaafea-f721-0a93-37c6-69bcc0d957c3",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/dbfaafea-f721-0a93-37c6-69bcc0d957c3",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 13,
|
||||
},
|
||||
{
|
||||
Id: "52000ac1-6a5b-83e2-5468-4dfdf394e455",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/52000ac1-6a5b-83e2-5468-4dfdf394e455",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 14,
|
||||
},
|
||||
{
|
||||
Id: "de34a347-41f4-1018-a710-48d81fa9aadc",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/de34a347-41f4-1018-a710-48d81fa9aadc",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 15,
|
||||
},
|
||||
{
|
||||
Id: "251d6a13-26b7-935b-d765-0c5db1ed7dfc",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/251d6a13-26b7-935b-d765-0c5db1ed7dfc",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 16,
|
||||
},
|
||||
{
|
||||
Id: "b22e93c8-3f6a-484a-a32b-f7626689f8da",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/b22e93c8-3f6a-484a-a32b-f7626689f8da",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 17,
|
||||
},
|
||||
{
|
||||
Id: "6517400b-d4b5-db65-d026-8c06c40bf244",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/6517400b-d4b5-db65-d026-8c06c40bf244",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 18,
|
||||
},
|
||||
{
|
||||
Id: "8e70df99-525a-4ecd-5cf1-6c32698eaa3f",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/8e70df99-525a-4ecd-5cf1-6c32698eaa3f",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 19,
|
||||
},
|
||||
{
|
||||
Id: "7df907f2-b6a6-fd03-67ab-be86c497d412",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/7df907f2-b6a6-fd03-67ab-be86c497d412",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 20,
|
||||
},
|
||||
{
|
||||
Id: "ba31ba5b-728e-8301-273d-459fd3c65a43",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/ba31ba5b-728e-8301-273d-459fd3c65a43",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 21,
|
||||
},
|
||||
{
|
||||
Id: "7528c70c-5ba1-59c1-413c-7bfc984c0066",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/7528c70c-5ba1-59c1-413c-7bfc984c0066",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 22,
|
||||
},
|
||||
{
|
||||
Id: "15dd574d-fc82-c5b7-fefb-497346d4abbb",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/15dd574d-fc82-c5b7-fefb-497346d4abbb",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 23,
|
||||
},
|
||||
{
|
||||
Id: "6cd76aca-91fa-64ce-6077-af48c5e5b18b",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/6cd76aca-91fa-64ce-6077-af48c5e5b18b",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 24,
|
||||
},
|
||||
{
|
||||
Id: "2f0f9f4e-12b8-a6a8-d3f9-f43e2055653d",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/2f0f9f4e-12b8-a6a8-d3f9-f43e2055653d",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 25,
|
||||
},
|
||||
{
|
||||
Id: "3c49f379-8548-67cd-1333-dde28219c6e9",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/3c49f379-8548-67cd-1333-dde28219c6e9",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 26,
|
||||
},
|
||||
{
|
||||
Id: "910f43c8-123a-0753-aaf7-11081eef4268",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/910f43c8-123a-0753-aaf7-11081eef4268",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 27,
|
||||
},
|
||||
{
|
||||
Id: "ffad6b36-74aa-1c7d-01eb-18524da91f6e",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/ffad6b36-74aa-1c7d-01eb-18524da91f6e",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 28,
|
||||
},
|
||||
{
|
||||
Id: "9e2bf22d-8734-62ae-881a-7404064a95ce",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/9e2bf22d-8734-62ae-881a-7404064a95ce",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 29,
|
||||
},
|
||||
{
|
||||
Id: "eef8b291-ffdf-dbfb-244d-5e63dc5b8cc7",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/eef8b291-ffdf-dbfb-244d-5e63dc5b8cc7",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 30,
|
||||
},
|
||||
{
|
||||
Id: "12b0de3a-243c-78b9-b006-82f2cc633a0f",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/12b0de3a-243c-78b9-b006-82f2cc633a0f",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 31,
|
||||
},
|
||||
{
|
||||
Id: "4341ea87-7d54-2608-184e-01e5c976ce9f",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/4341ea87-7d54-2608-184e-01e5c976ce9f",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 32,
|
||||
},
|
||||
{
|
||||
Id: "4db2bac2-18eb-0589-d520-f297b2840e1d",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/4db2bac2-18eb-0589-d520-f297b2840e1d",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 33,
|
||||
},
|
||||
{
|
||||
Id: "9442c2a3-0972-67f7-afc3-6f1a47abefab",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/9442c2a3-0972-67f7-afc3-6f1a47abefab",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 34,
|
||||
},
|
||||
{
|
||||
Id: "a7fb75b0-0b09-5340-70cf-a11afd84b1ec",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/a7fb75b0-0b09-5340-70cf-a11afd84b1ec",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 35,
|
||||
},
|
||||
{
|
||||
Id: "753d7795-451a-bd32-69ea-fd58c1e89d63",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/753d7795-451a-bd32-69ea-fd58c1e89d63",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 36,
|
||||
},
|
||||
{
|
||||
Id: "33bf7274-de0a-e8f9-f97a-c58fb2ea3aaf",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/33bf7274-de0a-e8f9-f97a-c58fb2ea3aaf",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 37,
|
||||
},
|
||||
{
|
||||
Id: "adadae31-37a1-818d-3721-09a1d371c6a5",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/adadae31-37a1-818d-3721-09a1d371c6a5",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 38,
|
||||
},
|
||||
{
|
||||
Id: "f64e8b0d-d2ab-b112-5705-92c23cfc5df6",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/f64e8b0d-d2ab-b112-5705-92c23cfc5df6",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 39,
|
||||
},
|
||||
{
|
||||
Id: "781088b0-5afd-6eb3-5f87-9bfec210d490",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/781088b0-5afd-6eb3-5f87-9bfec210d490",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 40,
|
||||
},
|
||||
{
|
||||
Id: "56df4cef-8053-bff3-21f7-1b1841a3d6e6",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/56df4cef-8053-bff3-21f7-1b1841a3d6e6",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 41,
|
||||
},
|
||||
{
|
||||
Id: "a3e3dab9-7a61-f822-d113-42f46bc5e8ce",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/a3e3dab9-7a61-f822-d113-42f46bc5e8ce",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 42,
|
||||
},
|
||||
{
|
||||
Id: "1cc195b9-e498-179d-b927-6d706266decb",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/1cc195b9-e498-179d-b927-6d706266decb",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 43,
|
||||
},
|
||||
{
|
||||
Id: "7dca834f-d959-898e-a0cb-5c8244c4c4a9",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/7dca834f-d959-898e-a0cb-5c8244c4c4a9",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 44,
|
||||
},
|
||||
{
|
||||
Id: "13eeba83-2e93-800e-e934-a56061633c64",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/13eeba83-2e93-800e-e934-a56061633c64",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 45,
|
||||
},
|
||||
{
|
||||
Id: "971f0a62-92a3-6d04-53c5-51fa9155e28c",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/971f0a62-92a3-6d04-53c5-51fa9155e28c",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 46,
|
||||
},
|
||||
{
|
||||
Id: "2959d06c-5ac7-f3b9-63d4-1a56e3974fc7",
|
||||
Path: "/01000000-c0a8-0242-ff9a-08dc8a84633c/Image/01000000-c0a8-0242-2179-08dc8a9e55b4/01000000-c0a8-0242-7f99-08dc8abdc649/01000000-c0a8-0242-89ca-08dc8abdc65d/1.2.840.113619.2.334.3.2831181473.554.1419910103.185/2959d06c-5ac7-f3b9-63d4-1a56e3974fc7",
|
||||
HtmlPath: "",
|
||||
NumberOfFrames: 0,
|
||||
InstanceNumber: 47,
|
||||
},
|
||||
];
|
||||
let path = "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com";
|
||||
let files = new Array();
|
||||
for (let i = 0; i < InstanceInfoList.length; i++) {
|
||||
let item = InstanceInfoList[i];
|
||||
let obj = {
|
||||
name: "file" + i,
|
||||
url: path + item.Path,
|
||||
};
|
||||
files.push(obj);
|
||||
}
|
||||
store.dispatch("trials/setUnLock", true);
|
||||
let res = await downloadImage(zipName, files);
|
||||
store.dispatch("trials/setUnLock", false);
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
store.dispatch("trials/setUnLock", false);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,144 +1,36 @@
|
|||
import JSZip from "jszip";
|
||||
import axios from "axios";
|
||||
import { saveAs } from "file-saver";
|
||||
import Vue from 'vue';
|
||||
import {
|
||||
requestPackageAndAnonymizImage,
|
||||
} from "@/api/load.js";
|
||||
let flag = {};
|
||||
export const downloadImage = async (id, id2) => {
|
||||
if (flag[id2]) return
|
||||
flag[id2] = true
|
||||
try {
|
||||
let params = {
|
||||
TrialId: id,
|
||||
SubjectVisitId: id2
|
||||
}
|
||||
let res = await requestPackageAndAnonymizImage(params);
|
||||
flag[id2] = false;
|
||||
if (res.IsSuccess) {
|
||||
if (!res.Result) {
|
||||
Vue.prototype.$message.warning(Vue.prototype.$t("trials:upload:message:not"))
|
||||
return 1;
|
||||
}
|
||||
let a = document.createElement("a");
|
||||
let href = Vue.prototype.OSSclientConfig.basePath + res.Result;
|
||||
let fileName =
|
||||
res.Result.split("/")[res.Result.split("/").length - 1];
|
||||
a.download = fileName;
|
||||
a.href = href;
|
||||
a.click();
|
||||
URL.revokeObjectURL(href);
|
||||
let timer = setTimeout(() => {
|
||||
a = null;
|
||||
href = null;
|
||||
timer = null;
|
||||
}, 500)
|
||||
return 2;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (err) {
|
||||
flag[id2] = false;
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
const setfolder = async (item) => {
|
||||
const zip = new JSZip(); // 创建实例对象
|
||||
let patientIds = item.PatientList.map(i => i.PatientIdStr);
|
||||
let zipName = `${item.SubjectCode}_${patientIds.join(',')}`;
|
||||
let zipObj = {};
|
||||
const promises = [];
|
||||
for (let visit of item.VisitList) {
|
||||
if (!zipObj[`${visit.VisitName}`]) {
|
||||
zipObj[`${visit.VisitName}`] = zip.folder(visit.VisitName);
|
||||
}
|
||||
for (let study of visit.StudyList) {
|
||||
let date = study.StudyTime.split(" ")[0];
|
||||
for (let series of study.SeriesList) {
|
||||
if (
|
||||
!zipObj[
|
||||
`${visit.VisitName}${series.Modality}`
|
||||
]
|
||||
) {
|
||||
zipObj[
|
||||
`${visit.VisitName}${series.Modality}`
|
||||
] = zipObj[`${visit.VisitName}`].folder(
|
||||
`${date}_${series.Modality}`
|
||||
);
|
||||
}
|
||||
for (let instance of series.InstancePathList) {
|
||||
let obj = {
|
||||
subjectCode: item.SubjectCode,
|
||||
visitName: visit.VisitName,
|
||||
date: study.StudyTime.split(" ")[0],
|
||||
modality: series.Modality,
|
||||
instancePath: instance.Path,
|
||||
dicomName: instance.Path.split("/Dicom/")[1],
|
||||
};
|
||||
const promise = handleBatchDown(
|
||||
obj,
|
||||
zipObj[
|
||||
`${visit.VisitName}${series.Modality}`
|
||||
],
|
||||
);
|
||||
promises.push(promise);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 生成 zip 文件
|
||||
Promise.all(promises)
|
||||
.then(() => {
|
||||
// 生成zip 文件
|
||||
zip
|
||||
.generateAsync({
|
||||
type: "blob",
|
||||
compression: "DEFLATE", // STORE: 默认不压缩, DEFLATE:需要压缩
|
||||
compressionOptions: {
|
||||
level: 9, // 压缩等级 1~9 1 压缩速度最快, 9 最优压缩方式
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
saveAs(res, zipName + ".zip"); // 使用FileSaver.saveAs保存文件,文件名可自定义
|
||||
flag[id2] = false;
|
||||
zipObj = null;
|
||||
});
|
||||
})
|
||||
.catch((reason) => { flag[id2] = false; });
|
||||
};
|
||||
const handleBatchDown = async (item, zip) => {
|
||||
import streamSaver from "streamsaver";
|
||||
import "streamsaver/examples/zip-stream.js"
|
||||
export const downloadImage = (zipName, files) => {
|
||||
return new Promise((resolve) => {
|
||||
getFileData(
|
||||
Vue.prototype.OSSclientConfig.basePath + item.instancePath
|
||||
).then((res) => {
|
||||
const fileName = item.dicomName + ".dcm";
|
||||
zip.file(fileName, res.data, { binary: true });
|
||||
resolve();
|
||||
console.log("同步下载打包开始时间:" + new Date());
|
||||
// 创建压缩文件输出流
|
||||
const zipFileOutputStream = streamSaver.createWriteStream(zipName);
|
||||
// 创建下载文件流
|
||||
const fileIterator = files.values();
|
||||
const readableZipStream = new window.ZIP({
|
||||
async pull(ctrl) {
|
||||
const fileInfo = fileIterator.next();
|
||||
if (fileInfo.done) {//迭代终止
|
||||
ctrl.close();
|
||||
} else {
|
||||
const { name, url } = fileInfo.value;
|
||||
return fetch(url).then(res => {
|
||||
ctrl.enqueue({
|
||||
name,
|
||||
stream: () => res.body
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
if (window.WritableStream && readableZipStream.pipeTo) {
|
||||
// 开始下载
|
||||
readableZipStream
|
||||
.pipeTo(zipFileOutputStream)
|
||||
.then(() => { console.log("同步下载打包结束时间:" + new Date()); resolve(true) })
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
})
|
||||
|
||||
};
|
||||
const getFileData = (fileUrl) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios(fileUrl, {
|
||||
method: "GET",
|
||||
responseType: "blob", // 返回的数据会被强制转为blob类型 ,转换成arraybuffer 也行
|
||||
})
|
||||
.then((res) => {
|
||||
resolve(res);
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
};
|
||||
export const fileDownload = (content, filename) => {
|
||||
const eleLink = document.createElement("a");
|
||||
eleLink.download = filename;
|
||||
eleLink.style.display = "none";
|
||||
const blob = new Blob([content]);
|
||||
eleLink.href = URL.createObjectURL(blob);
|
||||
document.body.appendChild(eleLink);
|
||||
eleLink.click();
|
||||
document.body.removeChild(eleLink);
|
||||
};
|
|
@ -25,8 +25,8 @@ module.exports = {
|
|||
devServer: {
|
||||
port: '8080',
|
||||
headers: {
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
'Cross-Origin-Embedder-Policy': 'require-corp'
|
||||
// 'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
// 'Cross-Origin-Embedder-Policy': 'require-corp'
|
||||
},
|
||||
// open: true,
|
||||
overlay: {
|
||||
|
|
Loading…
Reference in New Issue