Compare commits
No commits in common. "34ce5142f2c47b15873e3e6572f32a35e429d94f" and "3f2e39f46c6490015a3f15c2ef08c5177894c841" have entirely different histories.
34ce5142f2
...
3f2e39f46c
File diff suppressed because it is too large
Load Diff
|
|
@ -1,25 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
export function addOrUpdateFileUploadRecord(params) {
|
|
||||||
return request({
|
|
||||||
url: `/FileUploadRecord/addOrUpdateFileUploadRecord`,
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getFileUploadRecordList(params) {
|
|
||||||
return request({
|
|
||||||
url: `/FileUploadRecord/getFileUploadRecordList`,
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUploadFileSyncRecordList(params) {
|
|
||||||
return request({
|
|
||||||
url: `/FileUploadRecord/getUploadFileSyncRecordList`,
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1174,7 +1174,6 @@ export default {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
let arr = []
|
let arr = []
|
||||||
let uploadBatchId = scope.$guid()
|
|
||||||
for (let i = 0; i < seriesList.length; i++) {
|
for (let i = 0; i < seriesList.length; i++) {
|
||||||
let v = seriesList[i]
|
let v = seriesList[i]
|
||||||
let instanceList = []
|
let instanceList = []
|
||||||
|
|
@ -1267,16 +1266,6 @@ export default {
|
||||||
) {
|
) {
|
||||||
dicomInfo.uploadFileSize = dicomInfo.fileSize
|
dicomInfo.uploadFileSize = dicomInfo.fileSize
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
fileName: o.file.name,
|
|
||||||
fileSize: o.file.size,
|
|
||||||
fileType: 'application/dicom',
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 5,
|
|
||||||
trialId: params.trialId,
|
|
||||||
subjectId: params.subjectId,
|
|
||||||
subjectVisitId: params.subjectVisitId
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (!res || !res.url) {
|
if (!res || !res.url) {
|
||||||
|
|
@ -1300,17 +1289,7 @@ export default {
|
||||||
let OSSclient = scope.OSSclient
|
let OSSclient = scope.OSSclient
|
||||||
let seriesRes = await OSSclient.put(
|
let seriesRes = await OSSclient.put(
|
||||||
thumbnailPath,
|
thumbnailPath,
|
||||||
blob,
|
blob
|
||||||
{
|
|
||||||
fileName: `${v.seriesUid}.jpg`,
|
|
||||||
fileSize: blob.size,
|
|
||||||
fileType: 'image/jpeg',
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 6,
|
|
||||||
trialId: params.trialId,
|
|
||||||
subjectId: params.subjectId,
|
|
||||||
subjectVisitId: params.subjectVisitId
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
if (seriesRes && seriesRes.url) {
|
if (seriesRes && seriesRes.url) {
|
||||||
ImageResizePath = scope.$getObjectName(
|
ImageResizePath = scope.$getObjectName(
|
||||||
|
|
@ -1451,20 +1430,7 @@ export default {
|
||||||
}
|
}
|
||||||
let OSSclient = scope.OSSclient
|
let OSSclient = scope.OSSclient
|
||||||
try {
|
try {
|
||||||
let seriesRes = await OSSclient.put(
|
let seriesRes = await OSSclient.put(thumbnailPath, blob)
|
||||||
thumbnailPath,
|
|
||||||
blob,
|
|
||||||
{
|
|
||||||
fileName: `${v.seriesUid}.jpg`,
|
|
||||||
fileSize: blob.size,
|
|
||||||
fileType: 'image/jpeg',
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 6,
|
|
||||||
trialId: params.trialId,
|
|
||||||
subjectId: params.subjectId,
|
|
||||||
subjectVisitId: params.subjectVisitId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (seriesRes && seriesRes.url) {
|
if (seriesRes && seriesRes.url) {
|
||||||
o.ImageResizePath = scope.$getObjectName(seriesRes.url)
|
o.ImageResizePath = scope.$getObjectName(seriesRes.url)
|
||||||
}
|
}
|
||||||
|
|
@ -1482,7 +1448,6 @@ export default {
|
||||||
if (scope.IsImageSegment) {
|
if (scope.IsImageSegment) {
|
||||||
params.IsImageSegmentLabel = true
|
params.IsImageSegmentLabel = true
|
||||||
}
|
}
|
||||||
params.UploadBatchId = uploadBatchId
|
|
||||||
addOrUpdateArchiveTaskStudy(params)
|
addOrUpdateArchiveTaskStudy(params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (dicomInfo.failedFileCount === dicomInfo.fileCount) {
|
if (dicomInfo.failedFileCount === dicomInfo.fileCount) {
|
||||||
|
|
|
||||||
|
|
@ -548,9 +548,8 @@ export default {
|
||||||
})
|
})
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.studyMonitorId = res.Result
|
this.studyMonitorId = res.Result
|
||||||
let uploadBatchId = this.$guid()
|
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
funArr.push(this.handleUploadTask(this.selectArr, i, uploadBatchId))
|
funArr.push(this.handleUploadTask(this.selectArr, i))
|
||||||
}
|
}
|
||||||
if (funArr.length > 0) {
|
if (funArr.length > 0) {
|
||||||
let res = await Promise.all(funArr)
|
let res = await Promise.all(funArr)
|
||||||
|
|
@ -561,7 +560,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 并发上传
|
// 并发上传
|
||||||
async handleUploadTask(arr, index, uploadBatchId) {
|
async handleUploadTask(arr, index) {
|
||||||
if (!this.uploadVisible) return
|
if (!this.uploadVisible) return
|
||||||
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
||||||
file.status = 1
|
file.status = 1
|
||||||
|
|
@ -577,7 +576,7 @@ export default {
|
||||||
}
|
}
|
||||||
file.curPath = path
|
file.curPath = path
|
||||||
const fileData = await this.fileToBlob(file.file)
|
const fileData = await this.fileToBlob(file.file)
|
||||||
let res = await this.fileToOss(path, fileData, file, uploadBatchId)
|
let res = await this.fileToOss(path, fileData, file)
|
||||||
if (res) {
|
if (res) {
|
||||||
file.status = 2
|
file.status = 2
|
||||||
this.successFileList.push({
|
this.successFileList.push({
|
||||||
|
|
@ -611,13 +610,13 @@ export default {
|
||||||
}
|
}
|
||||||
let ind = arr.findIndex((item) => item.status === 0)
|
let ind = arr.findIndex((item) => item.status === 0)
|
||||||
if (ind >= 0) {
|
if (ind >= 0) {
|
||||||
return this.handleUploadTask(arr, ind, uploadBatchId)
|
return this.handleUploadTask(arr, ind)
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// file上传到oss
|
// file上传到oss
|
||||||
async fileToOss(path, file, item, uploadBatchId) {
|
async fileToOss(path, file, item) {
|
||||||
try {
|
try {
|
||||||
let res = await this.OSSclient.multipartUpload(
|
let res = await this.OSSclient.multipartUpload(
|
||||||
{
|
{
|
||||||
|
|
@ -630,17 +629,6 @@ export default {
|
||||||
if (item.uploadFileSize > file.fileSize) {
|
if (item.uploadFileSize > file.fileSize) {
|
||||||
item.uploadFileSize = file.fileSize > 0 ? file.fileSize : 1
|
item.uploadFileSize = file.fileSize > 0 ? file.fileSize : 1
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
fileName: item.name,
|
|
||||||
fileSize: item.size,
|
|
||||||
fileType: item.fileType,
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 7,
|
|
||||||
trialId: this.$route.query.trialId,
|
|
||||||
subjectId: this.currentRow.SubjectId,
|
|
||||||
subjectVisitId: this.currentRow.SourceSubjectVisitId,
|
|
||||||
studyCode: this.SubjectCode
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { anonymization } from './anonymization'
|
import { anonymization } from './anonymization'
|
||||||
export const dcmUpload = async function (data, config, progressFn, fileInfo) {
|
export const dcmUpload = async function (data, config, progressFn) {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
try {
|
try {
|
||||||
// let blob = await encoder(file, config)
|
// let blob = await encoder(file, config)
|
||||||
|
|
@ -8,8 +8,7 @@ export const dcmUpload = async function (data, config, progressFn, fileInfo) {
|
||||||
if (config) {
|
if (config) {
|
||||||
blob = await anonymization(data.file, config)
|
blob = await anonymization(data.file, config)
|
||||||
}
|
}
|
||||||
|
let res = await Vue.prototype.OSSclient.multipartUpload(Object.assign(data, { file: blob.blob }), progressFn)
|
||||||
let res = await Vue.prototype.OSSclient.multipartUpload(Object.assign(data, { file: blob.blob }), progressFn, fileInfo)
|
|
||||||
resolve({
|
resolve({
|
||||||
...res,
|
...res,
|
||||||
image: blob.pixelDataElement
|
image: blob.pixelDataElement
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ const stream = require('stream')
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { customerHttp, OSSclose } from "@/utils/multipartUpload/oss"
|
import { customerHttp, OSSclose } from "@/utils/multipartUpload/oss"
|
||||||
import { exist, AWSclose } from "@/utils/multipartUpload/aws"
|
import { exist, AWSclose } from "@/utils/multipartUpload/aws"
|
||||||
import { addOrUpdateFileUploadRecord } from '@/api/file'
|
|
||||||
const { GetObjectStoreToken } = require('../api/user.js')
|
const { GetObjectStoreToken } = require('../api/user.js')
|
||||||
const {
|
const {
|
||||||
S3Client,
|
S3Client,
|
||||||
|
|
@ -23,7 +22,7 @@ async function ossGenerateSTS() {
|
||||||
res = await GetObjectStoreToken()
|
res = await GetObjectStoreToken()
|
||||||
localStorage.setItem('stsToken', JSON.stringify(res))
|
localStorage.setItem('stsToken', JSON.stringify(res))
|
||||||
}
|
}
|
||||||
let trialId = this.$route.query.trialId
|
|
||||||
// res.Result.ObjectStoreUse = 'AWS';
|
// res.Result.ObjectStoreUse = 'AWS';
|
||||||
Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] }
|
Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] }
|
||||||
Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse;
|
Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse;
|
||||||
|
|
@ -35,8 +34,7 @@ async function ossGenerateSTS() {
|
||||||
Vue.prototype.OSSclientConfig.timeout = 10 * 60 * 1000
|
Vue.prototype.OSSclientConfig.timeout = 10 * 60 * 1000
|
||||||
let OSSclient = new OSS(Vue.prototype.OSSclientConfig)
|
let OSSclient = new OSS(Vue.prototype.OSSclientConfig)
|
||||||
Vue.prototype.OSSclient = {
|
Vue.prototype.OSSclient = {
|
||||||
put: async function (objectName, object, fileInfo = {}) {
|
put: async function (objectName, object) {
|
||||||
|
|
||||||
OSSclient = await RefreshClient(OSSclient)
|
OSSclient = await RefreshClient(OSSclient)
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -54,13 +52,6 @@ async function ossGenerateSTS() {
|
||||||
}
|
}
|
||||||
let res = await OSSclient.put(objectName, object)
|
let res = await OSSclient.put(objectName, object)
|
||||||
if (res && res.url) {
|
if (res && res.url) {
|
||||||
if (Object.keys(fileInfo).length !== 0) {
|
|
||||||
let params = Object.assign({path: objectName}, fileInfo)
|
|
||||||
addOrUpdateFileUploadRecord(params)
|
|
||||||
} else if (trialId) {
|
|
||||||
let params = { trialId }
|
|
||||||
addOrUpdateFileUploadRecord(params)
|
|
||||||
}
|
|
||||||
resolve({
|
resolve({
|
||||||
name: objectName,
|
name: objectName,
|
||||||
url: res.url
|
url: res.url
|
||||||
|
|
@ -74,7 +65,7 @@ async function ossGenerateSTS() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
multipartUpload: async (data, progress, fileInfo = {}) => {
|
multipartUpload: async (data, progress) => {
|
||||||
OSSclient = await RefreshClient(OSSclient)
|
OSSclient = await RefreshClient(OSSclient)
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -104,14 +95,6 @@ async function ossGenerateSTS() {
|
||||||
}
|
}
|
||||||
let res = await customerHttp(OSSclient, data, progress);
|
let res = await customerHttp(OSSclient, data, progress);
|
||||||
if (res) {
|
if (res) {
|
||||||
if (Object.keys(fileInfo).length !== 0) {
|
|
||||||
let params = Object.assign({path: data.path}, fileInfo)
|
|
||||||
addOrUpdateFileUploadRecord(params)
|
|
||||||
} else if (trialId) {
|
|
||||||
let params = { trialId }
|
|
||||||
addOrUpdateFileUploadRecord(params)
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
name: data.path,
|
name: data.path,
|
||||||
url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(res.name)
|
url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(res.name)
|
||||||
|
|
@ -186,17 +169,17 @@ async function ossGenerateSTS() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Vue.prototype.OSSclient = {
|
Vue.prototype.OSSclient = {
|
||||||
put: async function (objectName, object, fileInfo = {}) {
|
put: async function (objectName, object) {
|
||||||
let data = {
|
let data = {
|
||||||
file: object,
|
file: object,
|
||||||
path: objectName
|
path: objectName
|
||||||
}
|
}
|
||||||
aws = await RefreshClient(aws);
|
aws = await RefreshClient(aws);
|
||||||
return uploadAWS(aws, data, () => { }, fileInfo);
|
return uploadAWS(aws, data, () => { });
|
||||||
},
|
},
|
||||||
multipartUpload: async (data, progress, fileInfo = {}) => {
|
multipartUpload: async (data, progress) => {
|
||||||
aws = await RefreshClient(aws);
|
aws = await RefreshClient(aws);
|
||||||
return uploadAWS(aws, data, progress, fileInfo);
|
return uploadAWS(aws, data, progress);
|
||||||
},
|
},
|
||||||
close: () => {
|
close: () => {
|
||||||
AWSclose();
|
AWSclose();
|
||||||
|
|
@ -206,7 +189,7 @@ async function ossGenerateSTS() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// AWS上传函数
|
// AWS上传函数
|
||||||
function uploadAWS(aws, data, progress, fileInfo) {
|
function uploadAWS(aws, data, progress) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const { file, path } = data;
|
const { file, path } = data;
|
||||||
|
|
@ -228,14 +211,6 @@ function uploadAWS(aws, data, progress, fileInfo) {
|
||||||
data.path = data.path.replace(`/${bucketName}/`, '');
|
data.path = data.path.replace(`/${bucketName}/`, '');
|
||||||
await exist(aws, bucketName, data, progress, (path, status) => {
|
await exist(aws, bucketName, data, progress, (path, status) => {
|
||||||
if (status === 'success') {
|
if (status === 'success') {
|
||||||
let trialId = this.$route.query.trialId
|
|
||||||
if (Object.keys(fileInfo).length !== 0) {
|
|
||||||
let params = Object.assign({path: decodeUtf8(curPath)}, fileInfo)
|
|
||||||
addOrUpdateFileUploadRecord(params)
|
|
||||||
} else if (trialId) {
|
|
||||||
let params = { trialId }
|
|
||||||
addOrUpdateFileUploadRecord(params)
|
|
||||||
}
|
|
||||||
resolve({
|
resolve({
|
||||||
name: decodeUtf8(curPath),
|
name: decodeUtf8(curPath),
|
||||||
url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(curPath)
|
url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(curPath)
|
||||||
|
|
|
||||||
|
|
@ -3,24 +3,6 @@
|
||||||
<!-- 配置信息表单 -->
|
<!-- 配置信息表单 -->
|
||||||
<el-form ref="processConfigForm" v-loading="loading" :model="form" label-width="300px" style="width: 800px"
|
<el-form ref="processConfigForm" v-loading="loading" :model="form" label-width="300px" style="width: 800px"
|
||||||
:rules="rules" size="small">
|
:rules="rules" size="small">
|
||||||
<!-- 数据存储 -->
|
|
||||||
<el-form-item
|
|
||||||
:label="$t('trials:processCfg:form:trialDataStoreType')"
|
|
||||||
prop="TrialDataStoreType"
|
|
||||||
>
|
|
||||||
<el-radio-group
|
|
||||||
v-model="form.TrialDataStoreType"
|
|
||||||
:disabled="form.IsTrialProcessConfirmed && !isEdit"
|
|
||||||
>
|
|
||||||
<el-radio
|
|
||||||
v-for="item of $d.TrialDataStoreType"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.value"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
|
||||||
</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 阅片方式 -->
|
<!-- 阅片方式 -->
|
||||||
<el-form-item :label="$t('trials:processCfg:form:readingMode')" prop="ReadingMode">
|
<el-form-item :label="$t('trials:processCfg:form:readingMode')" prop="ReadingMode">
|
||||||
<el-radio-group v-model="form.ReadingMode" :disabled="form.IsTrialProcessConfirmed && !isEdit">
|
<el-radio-group v-model="form.ReadingMode" :disabled="form.IsTrialProcessConfirmed && !isEdit">
|
||||||
|
|
@ -96,7 +78,6 @@
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 修约小数位数 -->
|
<!-- 修约小数位数 -->
|
||||||
<!-- <el-form-item
|
<!-- <el-form-item
|
||||||
:label="$t('trials:processCfg:form:digitPlaces')"
|
:label="$t('trials:processCfg:form:digitPlaces')"
|
||||||
|
|
@ -743,7 +724,6 @@ export default {
|
||||||
VUE_IS_TEST: process.env.VUE_APP_IS_TEST,
|
VUE_IS_TEST: process.env.VUE_APP_IS_TEST,
|
||||||
form: {
|
form: {
|
||||||
TrialId: '',
|
TrialId: '',
|
||||||
TrialDataStoreType: 0,
|
|
||||||
ClinicalInformationTransmissionEnum: 1,
|
ClinicalInformationTransmissionEnum: 1,
|
||||||
ClinicalDataSetNames: [],
|
ClinicalDataSetNames: [],
|
||||||
ClinicalDataTrialSetIds: [],
|
ClinicalDataTrialSetIds: [],
|
||||||
|
|
@ -770,13 +750,6 @@ export default {
|
||||||
TrialCriterionIdEnums: [],
|
TrialCriterionIdEnums: [],
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
TrialDataStoreType: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: this.$t('common:ruleMessage:select'),
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
ClinicalDataSetNamesStr: [
|
ClinicalDataSetNamesStr: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -1032,11 +1005,6 @@ export default {
|
||||||
// initialCriterions.push(this.$fd('ReadingStandard', id, 'id'))
|
// initialCriterions.push(this.$fd('ReadingStandard', id, 'id'))
|
||||||
// })
|
// })
|
||||||
this.confirmData = [
|
this.confirmData = [
|
||||||
{
|
|
||||||
Name: this.$t('trials:processCfg:form:trialDataStoreType'), // 数据存储
|
|
||||||
NewVal: this.$fd('TrialDataStoreType', this.form.TrialDataStoreType),
|
|
||||||
OldVal: this.$fd('TrialDataStoreType', this.initialForm.TrialDataStoreType),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: this.$t('trials:processCfg:form:readingMode'), // 阅片方式
|
Name: this.$t('trials:processCfg:form:readingMode'), // 阅片方式
|
||||||
NewVal: this.$fd('ReadingMode', this.form.ReadingMode),
|
NewVal: this.$fd('ReadingMode', this.form.ReadingMode),
|
||||||
|
|
|
||||||
|
|
@ -261,23 +261,12 @@ export default {
|
||||||
uploadFilesAndSave() {
|
uploadFilesAndSave() {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
this.form.AddFileList = []
|
this.form.AddFileList = []
|
||||||
let uploadBatchId = this.$guid()
|
|
||||||
for (var i = 0; i < this.pendingUploadList.length; ++i) {
|
for (var i = 0; i < this.pendingUploadList.length; ++i) {
|
||||||
// const file = await this.convertBase64ToBlob(this.pendingUploadList[i])
|
// const file = await this.convertBase64ToBlob(this.pendingUploadList[i])
|
||||||
const file = await this.fileToBlob(this.pendingUploadList[i])
|
const file = await this.fileToBlob(this.pendingUploadList[i])
|
||||||
const res = await this.OSSclient.put(
|
const res = await this.OSSclient.put(
|
||||||
`/${this.data.TrialId}/ClinicalData/${this.pendingUploadList[i].name}`,
|
`/${this.data.TrialId}/ClinicalData/${this.pendingUploadList[i].name}`,
|
||||||
file,
|
file
|
||||||
{
|
|
||||||
fileName: this.pendingUploadList[i].name,
|
|
||||||
fileSize: this.pendingUploadList[i].size,
|
|
||||||
fileType: this.pendingUploadList[i].type,
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 4,
|
|
||||||
trialId: this.data.TrialId,
|
|
||||||
subjectId: this.data.SubjectId,
|
|
||||||
subjectVisitId: this.data.SubjectVisitId
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
this.form.AddFileList.push({
|
this.form.AddFileList.push({
|
||||||
fileName: this.pendingUploadList[i].name,
|
fileName: this.pendingUploadList[i].name,
|
||||||
|
|
|
||||||
|
|
@ -551,7 +551,6 @@ export default {
|
||||||
IsVisit: this.data.IsVisit,
|
IsVisit: this.data.IsVisit,
|
||||||
SubjectId: this.data.SubjectId,
|
SubjectId: this.data.SubjectId,
|
||||||
IsBaseLine: this.data.IsBaseLine,
|
IsBaseLine: this.data.IsBaseLine,
|
||||||
SubjectVisitId: this.data.SubjectVisitId
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this.addOrUpdateCD.title = this.$t('common:button:new')
|
this.addOrUpdateCD.title = this.$t('common:button:new')
|
||||||
|
|
@ -566,7 +565,6 @@ export default {
|
||||||
}
|
}
|
||||||
this.currentData.IsVisit = this.data.IsVisit
|
this.currentData.IsVisit = this.data.IsVisit
|
||||||
this.currentData.IsBaseLine = this.data.IsBaseLine
|
this.currentData.IsBaseLine = this.data.IsBaseLine
|
||||||
this.currentData.SubjectVisitId = this.data.SubjectVisitId
|
|
||||||
this.addOrUpdateCD.title = this.$t('common:button:edit')
|
this.addOrUpdateCD.title = this.$t('common:button:edit')
|
||||||
this.currentOption = [
|
this.currentOption = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,220 +0,0 @@
|
||||||
<template>
|
|
||||||
<BaseContainer>
|
|
||||||
<template slot="search-container">
|
|
||||||
<el-form :inline="true">
|
|
||||||
<!-- <el-form-item label="文件上传场景" prop="OptType">
|
|
||||||
<el-select v-model="searchData.BatchDataType" clearable style="width: 200px">
|
|
||||||
<el-option
|
|
||||||
v-for="item of $d.BatchDataType"
|
|
||||||
:key="'BatchDataType' + item.label"
|
|
||||||
:value="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item label="文件名称" prop="FileName">
|
|
||||||
<el-input v-model="searchData.FileName" size="small" clearable style="width: 120px" />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item
|
|
||||||
:label="$t('trials:loginLog:table:incorrectUserName')"
|
|
||||||
prop="LoginFaildName"
|
|
||||||
v-if="!isMine"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
v-model="searchData.LoginFaildName"
|
|
||||||
size="small"
|
|
||||||
clearable
|
|
||||||
style="width: 120px"
|
|
||||||
/>
|
|
||||||
</el-form-item> -->
|
|
||||||
<!-- <el-form-item :label="$t('trials:loginLog:table:userName')" prop="LoginUserName" v-if="!isMine">
|
|
||||||
<el-select v-model="searchData.IdentityUserId" clearable style="width: 120px">
|
|
||||||
<el-option v-for="item of trialUserList" :key="item.IdentityUserId" :value="item.IdentityUserId"
|
|
||||||
:label="item.UserName" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('trials:loginLog:table:optUserName')" prop="TargetIdentityUserId" v-if="!isMine">
|
|
||||||
<el-select v-model="searchData.TargetIdentityUserId" clearable style="width: 120px">
|
|
||||||
<el-option v-for="item of trialUserList" :key="item.IdentityUserId" :value="item.IdentityUserId"
|
|
||||||
:label="item.UserName" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('trials:loginLog:table:userType')" prop="OptType" v-if="!isMine">
|
|
||||||
<el-select v-model="searchData.LoginUserType" clearable style="width: 120px">
|
|
||||||
<el-option v-for="item of $d.UserType" v-show="item.value !== 7 && item.value !== 8"
|
|
||||||
:key="'UserType' + item.label" :value="item.label" :label="item.label" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('trials:loginLog:table:createTime')">
|
|
||||||
<el-date-picker v-model="datetimerange" type="datetimerange" :default-time="['00:00:00', '23:59:59']"
|
|
||||||
:start-placeholder="$t('trials:loginLog:table:beginTime')"
|
|
||||||
:end-placeholder="$t('trials:loginLog:table:endTime')" value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
@change="handleDatetimeChange" />
|
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
|
|
||||||
{{ $t('common:button:search') }}
|
|
||||||
</el-button>
|
|
||||||
<!-- 重置 -->
|
|
||||||
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
|
|
||||||
{{ $t('common:button:reset') }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<template slot="main-container">
|
|
||||||
<el-table v-loading="loading" v-adaptive="{ bottomOffset: 60 }" height="100" :data="list"
|
|
||||||
class="table" @sort-change="handleSortByColumn" :default-sort="{ prop: 'CreateTime', order: 'descending' }">
|
|
||||||
<el-table-column type="index" width="50" />
|
|
||||||
<!-- <el-table-column label="文件上传场景" prop="BatchDataType" min-width="100" show-overflow-tooltip sortable="custom">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ $fd('BatchDataType', scope.row.BatchDataType) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column label="文件名称" prop="FileName" min-width="90" show-overflow-tooltip sortable="custom">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="文件类型" prop="FileType" min-width="90" show-overflow-tooltip sortable="custom">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="文件大小" prop="FileSize" min-width="90" show-overflow-tooltip sortable="custom">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ fileSizeFormatter(scope.row.FileSize) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="源区域" prop="UploadRegion" min-width="90" show-overflow-tooltip sortable="custom" />
|
|
||||||
<el-table-column label="源可用时间" prop="CreateTime" min-width="90" show-overflow-tooltip sortable="custom" />
|
|
||||||
<el-table-column label="目标区域" prop="TargetRegion" min-width="90" show-overflow-tooltip sortable="custom" />
|
|
||||||
<el-table-column label="目标可用时间" prop="TargetRegion" min-width="90" show-overflow-tooltip sortable="custom" />
|
|
||||||
<el-table-column label="是否需要同步" prop="IsNeedSync" min-width="90" show-overflow-tooltip sortable="custom">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ $fd('YesOrNo', scope.row.IsNeedSync) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="优先级" prop="Priority" min-width="90" show-overflow-tooltip sortable="custom" />
|
|
||||||
<el-table-column label="是否同步完成" prop="IsSync" min-width="90" show-overflow-tooltip sortable="custom">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ $fd('YesOrNo', scope.row.IsSync) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="更新时间" prop="UpdateTime" min-width="90" show-overflow-tooltip sortable="custom" />
|
|
||||||
<el-table-column label="操作" min-width="80" show-overflow-tooltip>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button type="text" @click="handleOpenTaskTable(scope.row)">
|
|
||||||
任务表
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
</template>
|
|
||||||
<!-- <detail :config="config" :JsonObj="JsonObj" /> -->
|
|
||||||
</BaseContainer>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import { getFileUploadRecordList, getUploadFileSyncRecordList } from '@/api/file'
|
|
||||||
import BaseContainer from '@/components/BaseContainer'
|
|
||||||
import Pagination from '@/components/Pagination'
|
|
||||||
import moment from 'moment'
|
|
||||||
const searchDataDefault = () => {
|
|
||||||
return {
|
|
||||||
TrialId: '',
|
|
||||||
FileName: '',
|
|
||||||
BatchDataType: null,
|
|
||||||
Asc: false,
|
|
||||||
SortField: '',
|
|
||||||
PageIndex: 1,
|
|
||||||
PageSize: 20,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default {
|
|
||||||
components: { BaseContainer, Pagination },
|
|
||||||
props: {
|
|
||||||
isMine: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
id: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
moment,
|
|
||||||
searchData: searchDataDefault(),
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
loading: false,
|
|
||||||
datetimerange: [],
|
|
||||||
trialUserList: [],
|
|
||||||
config: {
|
|
||||||
visible: false,
|
|
||||||
title: this.$t('trials:loginLog:dialog:title'),
|
|
||||||
width: '500px',
|
|
||||||
top: '10vh',
|
|
||||||
},
|
|
||||||
JsonObj: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async getList() {
|
|
||||||
try {
|
|
||||||
this.loading = true
|
|
||||||
this.searchData.TrialId = this.$route.query.trialId
|
|
||||||
let res = await getFileUploadRecordList(this.searchData)
|
|
||||||
this.loading = false
|
|
||||||
this.list = res.Result.CurrentPageData
|
|
||||||
this.total = res.Result.TotalCount
|
|
||||||
} catch(e) {
|
|
||||||
this.loading = false
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleOpenTaskTable(row) {
|
|
||||||
// const { list, columns, title } = this.buildTaskDialogData(row)
|
|
||||||
// this.taskDialog.title = title
|
|
||||||
// this.taskDialog.list = list
|
|
||||||
// this.taskDialog.columns = columns
|
|
||||||
// this.taskDialog.visible = true
|
|
||||||
},
|
|
||||||
fileSizeFormatter(size) {
|
|
||||||
if (!size) return
|
|
||||||
return (size / Math.pow(1024, 2)).toFixed(3) + 'MB'
|
|
||||||
},
|
|
||||||
handleDatetimeChange(val) {
|
|
||||||
if (val) {
|
|
||||||
this.searchData.BeginDate = val[0]
|
|
||||||
this.searchData.EndDate = val[1]
|
|
||||||
} else {
|
|
||||||
this.searchData.BeginDate = ''
|
|
||||||
this.searchData.EndDate = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleSearch() {
|
|
||||||
this.searchData.PageIndex = 1
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 重置列表查询
|
|
||||||
handleReset() {
|
|
||||||
this.datetimerange = null
|
|
||||||
this.searchData = searchDataDefault()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
// 排序
|
|
||||||
handleSortByColumn(column) {
|
|
||||||
if (column.order === 'ascending') {
|
|
||||||
this.searchData.Asc = true
|
|
||||||
} else {
|
|
||||||
this.searchData.Asc = false
|
|
||||||
}
|
|
||||||
this.searchData.SortField = column.prop
|
|
||||||
this.searchData.PageIndex = 1
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
@ -382,7 +382,6 @@ export default {
|
||||||
size: files[i].size,
|
size: files[i].size,
|
||||||
type: extendName.split('.')[1],
|
type: extendName.split('.')[1],
|
||||||
file: files[i],
|
file: files[i],
|
||||||
fileType: files[i].type
|
|
||||||
}
|
}
|
||||||
this.fileList.push(obj);
|
this.fileList.push(obj);
|
||||||
}
|
}
|
||||||
|
|
@ -402,17 +401,7 @@ export default {
|
||||||
var timestamp = Date.now();
|
var timestamp = Date.now();
|
||||||
const res = await this.OSSclient.put(
|
const res = await this.OSSclient.put(
|
||||||
`/${this.trialId}/ClinicalData/${timestamp}_${this.fileList[i].file.name}`,
|
`/${this.trialId}/ClinicalData/${timestamp}_${this.fileList[i].file.name}`,
|
||||||
file,
|
file
|
||||||
{
|
|
||||||
fileName: `${this.fileList[i].file.name}`,
|
|
||||||
fileSize: file.size,
|
|
||||||
fileType: this.fileList[i].fileType,
|
|
||||||
uploadBatchId: this.$guid(),
|
|
||||||
batchDataType: 4,
|
|
||||||
trialId: this.trialId,
|
|
||||||
subjectId: this.data.SubjectId,
|
|
||||||
subjectVisitId: this.subjectVisitId
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
this.addFileList.push({
|
this.addFileList.push({
|
||||||
fileName: this.fileList[i].file.name,
|
fileName: this.fileList[i].file.name,
|
||||||
|
|
|
||||||
|
|
@ -1520,7 +1520,6 @@ export default {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
let arr = []
|
let arr = []
|
||||||
let uploadBatchId = scope.$guid()
|
|
||||||
for (let i = 0; i < seriesList.length; i++) {
|
for (let i = 0; i < seriesList.length; i++) {
|
||||||
let v = seriesList[i]
|
let v = seriesList[i]
|
||||||
let instanceList = []
|
let instanceList = []
|
||||||
|
|
@ -1588,7 +1587,6 @@ export default {
|
||||||
params.trialId
|
params.trialId
|
||||||
)}`
|
)}`
|
||||||
if (scope.isClose) return
|
if (scope.isClose) return
|
||||||
console.log(o.file)
|
|
||||||
let res = await dcmUpload(
|
let res = await dcmUpload(
|
||||||
{
|
{
|
||||||
path: path,
|
path: path,
|
||||||
|
|
@ -1609,16 +1607,6 @@ export default {
|
||||||
) {
|
) {
|
||||||
dicomInfo.uploadFileSize = dicomInfo.fileSize
|
dicomInfo.uploadFileSize = dicomInfo.fileSize
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
fileName: o.file.name,
|
|
||||||
fileSize: o.file.size,
|
|
||||||
fileType: 'application/dicom',
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 1,
|
|
||||||
trialId: params.trialId,
|
|
||||||
subjectId: params.subjectId,
|
|
||||||
subjectVisitId: params.subjectVisitId
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (!res || !res.url) {
|
if (!res || !res.url) {
|
||||||
|
|
@ -1635,22 +1623,11 @@ export default {
|
||||||
o.imageColumns,
|
o.imageColumns,
|
||||||
o.imageRows
|
o.imageRows
|
||||||
)
|
)
|
||||||
|
|
||||||
let thumbnailPath = `/${params.trialId}/Image/${params.subjectId}/${params.subjectVisitId}/${dicomInfo.studyUid}/${v.seriesUid}.jpg`
|
let thumbnailPath = `/${params.trialId}/Image/${params.subjectId}/${params.subjectVisitId}/${dicomInfo.studyUid}/${v.seriesUid}.jpg`
|
||||||
let OSSclient = scope.OSSclient
|
let OSSclient = scope.OSSclient
|
||||||
let seriesRes = await OSSclient.put(
|
let seriesRes = await OSSclient.put(
|
||||||
thumbnailPath,
|
thumbnailPath,
|
||||||
blob,
|
blob
|
||||||
{
|
|
||||||
fileName: `${v.seriesUid}.jpg`,
|
|
||||||
fileSize: blob.size,
|
|
||||||
fileType: 'image/jpeg',
|
|
||||||
uploadBatchId: scope.$guid(),
|
|
||||||
batchDataType: 2,
|
|
||||||
trialId: params.trialId,
|
|
||||||
subjectId: params.subjectId,
|
|
||||||
subjectVisitId: params.subjectVisitId
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
if (seriesRes && seriesRes.url) {
|
if (seriesRes && seriesRes.url) {
|
||||||
ImageResizePath = scope.$getObjectName(
|
ImageResizePath = scope.$getObjectName(
|
||||||
|
|
@ -1785,20 +1762,7 @@ export default {
|
||||||
let thumbnailPath = `/${params.trialId}/Image/${params.trialSiteId}/${params.subjectId}/${params.subjectVisitId}/${dicomInfo.studyUid}/${v.seriesUid}.jpg`
|
let thumbnailPath = `/${params.trialId}/Image/${params.trialSiteId}/${params.subjectId}/${params.subjectVisitId}/${dicomInfo.studyUid}/${v.seriesUid}.jpg`
|
||||||
let OSSclient = scope.OSSclient
|
let OSSclient = scope.OSSclient
|
||||||
try {
|
try {
|
||||||
let seriesRes = await OSSclient.put(
|
let seriesRes = await OSSclient.put(thumbnailPath, blob)
|
||||||
thumbnailPath,
|
|
||||||
blob,
|
|
||||||
{
|
|
||||||
fileName: `${v.seriesUid}.jpg`,
|
|
||||||
fileSize: blob.size,
|
|
||||||
fileType: 'image/jpeg',
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 2,
|
|
||||||
trialId: params.trialId,
|
|
||||||
subjectId: params.subjectId,
|
|
||||||
subjectVisitId: params.subjectVisitId
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (seriesRes && seriesRes.url) {
|
if (seriesRes && seriesRes.url) {
|
||||||
o.ImageResizePath = scope.$getObjectName(seriesRes.url)
|
o.ImageResizePath = scope.$getObjectName(seriesRes.url)
|
||||||
}
|
}
|
||||||
|
|
@ -1811,8 +1775,7 @@ export default {
|
||||||
params.study.instanceCount = dicomInfo.failedFileCount
|
params.study.instanceCount = dicomInfo.failedFileCount
|
||||||
params.RecordPath = scope.$getObjectName(logRes.url)
|
params.RecordPath = scope.$getObjectName(logRes.url)
|
||||||
if (scope.isClose) return false
|
if (scope.isClose) return false
|
||||||
|
console.log(params)
|
||||||
params.UploadBatchId = uploadBatchId
|
|
||||||
addOrUpdateArchiveStudy(params)
|
addOrUpdateArchiveStudy(params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (dicomInfo.failedFileCount === dicomInfo.fileCount) {
|
if (dicomInfo.failedFileCount === dicomInfo.fileCount) {
|
||||||
|
|
|
||||||
|
|
@ -756,7 +756,6 @@ export default {
|
||||||
.substring(fileName.lastIndexOf('.'))
|
.substring(fileName.lastIndexOf('.'))
|
||||||
.toLocaleLowerCase()
|
.toLocaleLowerCase()
|
||||||
if (this.faccept.indexOf(extendName) !== -1) {
|
if (this.faccept.indexOf(extendName) !== -1) {
|
||||||
files[i].fileName = files[i].name
|
|
||||||
files[i].id = `${files[i].lastModified}${files[i].name}`
|
files[i].id = `${files[i].lastModified}${files[i].name}`
|
||||||
this.fileList.push(files[i])
|
this.fileList.push(files[i])
|
||||||
}
|
}
|
||||||
|
|
@ -810,9 +809,8 @@ export default {
|
||||||
})
|
})
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.studyMonitorId = res.Result
|
this.studyMonitorId = res.Result
|
||||||
let uploadBatchId = this.$guid()
|
|
||||||
for (let i = 0; i < num; i++) {
|
for (let i = 0; i < num; i++) {
|
||||||
funArr.push(this.handleUploadTask(this.selectArr, i, uploadBatchId))
|
funArr.push(this.handleUploadTask(this.selectArr, i))
|
||||||
}
|
}
|
||||||
if (funArr.length > 0) {
|
if (funArr.length > 0) {
|
||||||
let res = await Promise.all(funArr)
|
let res = await Promise.all(funArr)
|
||||||
|
|
@ -823,16 +821,17 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 并发上传
|
// 并发上传
|
||||||
async handleUploadTask(arr, index, uploadBatchId) {
|
async handleUploadTask(arr, index) {
|
||||||
if (!this.uploadVisible) return
|
if (!this.uploadVisible) return
|
||||||
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
||||||
file.status = 1
|
file.status = 1
|
||||||
let fileName = `${this.$guid()}${file.name.substring(file.name.lastIndexOf('.')).toLocaleLowerCase()}`
|
|
||||||
let path = `/${this.trialId}/Image/${this.data.SubjectId}/${this.data.Id
|
let path = `/${this.trialId}/Image/${this.data.SubjectId}/${this.data.Id
|
||||||
}/${fileName}`
|
}/${this.$guid()}${file.name
|
||||||
|
.substring(file.name.lastIndexOf('.'))
|
||||||
|
.toLocaleLowerCase()}`
|
||||||
file.curPath = path
|
file.curPath = path
|
||||||
const fileData = await this.fileToBlob(file.file)
|
const fileData = await this.fileToBlob(file.file)
|
||||||
let res = await this.fileToOss(path, fileData, file, uploadBatchId)
|
let res = await this.fileToOss(path, fileData, file)
|
||||||
if (res) {
|
if (res) {
|
||||||
file.status = 2
|
file.status = 2
|
||||||
this.successFileList.push({
|
this.successFileList.push({
|
||||||
|
|
@ -866,13 +865,13 @@ export default {
|
||||||
}
|
}
|
||||||
let ind = arr.findIndex((item) => item.status === 0)
|
let ind = arr.findIndex((item) => item.status === 0)
|
||||||
if (ind >= 0) {
|
if (ind >= 0) {
|
||||||
return this.handleUploadTask(arr, ind, uploadBatchId)
|
return this.handleUploadTask(arr, ind)
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// file上传到oss
|
// file上传到oss
|
||||||
async fileToOss(path, file, item, uploadBatchId) {
|
async fileToOss(path, file, item) {
|
||||||
try {
|
try {
|
||||||
let res = await this.OSSclient.multipartUpload(
|
let res = await this.OSSclient.multipartUpload(
|
||||||
{
|
{
|
||||||
|
|
@ -885,18 +884,6 @@ export default {
|
||||||
if (item.uploadFileSize > file.fileSize) {
|
if (item.uploadFileSize > file.fileSize) {
|
||||||
item.uploadFileSize = file.fileSize > 0 ? file.fileSize : 1
|
item.uploadFileSize = file.fileSize > 0 ? file.fileSize : 1
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
fileName: item.name,
|
|
||||||
fileSize: item.size,
|
|
||||||
fileType: item.fileType,
|
|
||||||
uploadBatchId: uploadBatchId,
|
|
||||||
batchDataType: 3,
|
|
||||||
trialId: this.trialId,
|
|
||||||
subjectId: this.data.SubjectId,
|
|
||||||
subjectVisitId: this.subjectVisitId,
|
|
||||||
studyCode: this.currentRow.CodeView
|
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,6 @@ export default {
|
||||||
size: files[i].size,
|
size: files[i].size,
|
||||||
type: extendName.split('.')[1],
|
type: extendName.split('.')[1],
|
||||||
file: files[i],
|
file: files[i],
|
||||||
fileType: files[i].type
|
|
||||||
}
|
}
|
||||||
this.fileList.push(obj)
|
this.fileList.push(obj)
|
||||||
}
|
}
|
||||||
|
|
@ -381,17 +380,7 @@ export default {
|
||||||
var timestamp = Date.now()
|
var timestamp = Date.now()
|
||||||
const res = await this.OSSclient.put(
|
const res = await this.OSSclient.put(
|
||||||
`/${this.trialId}/ClinicalData/${timestamp}_${this.fileList[i].file.name}`,
|
`/${this.trialId}/ClinicalData/${timestamp}_${this.fileList[i].file.name}`,
|
||||||
file,
|
file
|
||||||
{
|
|
||||||
fileName: `${this.fileList[i].file.name}`,
|
|
||||||
fileSize: this.fileList[i].size,
|
|
||||||
fileType: this.fileList[i].fileType,
|
|
||||||
uploadBatchId: this.$guid(),
|
|
||||||
batchDataType: 4,
|
|
||||||
trialId: this.trialId,
|
|
||||||
subjectId: this.data.SubjectId,
|
|
||||||
subjectVisitId: this.subjectVisitId
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
this.addFileList.push({
|
this.addFileList.push({
|
||||||
fileName: this.fileList[i].file.name,
|
fileName: this.fileList[i].file.name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue