Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
commit
ee6c5bf8a5
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,33 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function addOrUpdateFileUploadRecord(params) {
|
||||
return request({
|
||||
url: `/FileUploadRecord/addOrUpdateFileUploadRecord`,
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export function getSubjectUploadRecordList(params) {
|
||||
return request({
|
||||
url: `/FileUploadRecord/getSubjectUploadRecordList`,
|
||||
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,6 +1174,7 @@ export default {
|
|||
},
|
||||
}
|
||||
let arr = []
|
||||
let uploadBatchId = scope.$guid()
|
||||
for (let i = 0; i < seriesList.length; i++) {
|
||||
let v = seriesList[i]
|
||||
let instanceList = []
|
||||
|
|
@ -1266,6 +1267,16 @@ export default {
|
|||
) {
|
||||
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) {
|
||||
|
|
@ -1289,7 +1300,17 @@ export default {
|
|||
let OSSclient = scope.OSSclient
|
||||
let seriesRes = await OSSclient.put(
|
||||
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) {
|
||||
ImageResizePath = scope.$getObjectName(
|
||||
|
|
@ -1430,7 +1451,20 @@ export default {
|
|||
}
|
||||
let OSSclient = scope.OSSclient
|
||||
try {
|
||||
let seriesRes = await OSSclient.put(thumbnailPath, blob)
|
||||
let seriesRes = await OSSclient.put(
|
||||
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) {
|
||||
o.ImageResizePath = scope.$getObjectName(seriesRes.url)
|
||||
}
|
||||
|
|
@ -1448,6 +1482,7 @@ export default {
|
|||
if (scope.IsImageSegment) {
|
||||
params.IsImageSegmentLabel = true
|
||||
}
|
||||
params.UploadBatchId = uploadBatchId
|
||||
addOrUpdateArchiveTaskStudy(params)
|
||||
.then((res) => {
|
||||
if (dicomInfo.failedFileCount === dicomInfo.fileCount) {
|
||||
|
|
|
|||
|
|
@ -548,8 +548,9 @@ export default {
|
|||
})
|
||||
if (res.IsSuccess) {
|
||||
this.studyMonitorId = res.Result
|
||||
let uploadBatchId = this.$guid()
|
||||
for (let i = 0; i < num; i++) {
|
||||
funArr.push(this.handleUploadTask(this.selectArr, i))
|
||||
funArr.push(this.handleUploadTask(this.selectArr, i, uploadBatchId))
|
||||
}
|
||||
if (funArr.length > 0) {
|
||||
let res = await Promise.all(funArr)
|
||||
|
|
@ -560,7 +561,7 @@ export default {
|
|||
}
|
||||
},
|
||||
// 并发上传
|
||||
async handleUploadTask(arr, index) {
|
||||
async handleUploadTask(arr, index, uploadBatchId) {
|
||||
if (!this.uploadVisible) return
|
||||
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
||||
file.status = 1
|
||||
|
|
@ -576,7 +577,7 @@ export default {
|
|||
}
|
||||
file.curPath = path
|
||||
const fileData = await this.fileToBlob(file.file)
|
||||
let res = await this.fileToOss(path, fileData, file)
|
||||
let res = await this.fileToOss(path, fileData, file, uploadBatchId)
|
||||
if (res) {
|
||||
file.status = 2
|
||||
this.successFileList.push({
|
||||
|
|
@ -610,13 +611,13 @@ export default {
|
|||
}
|
||||
let ind = arr.findIndex((item) => item.status === 0)
|
||||
if (ind >= 0) {
|
||||
return this.handleUploadTask(arr, ind)
|
||||
return this.handleUploadTask(arr, ind, uploadBatchId)
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// file上传到oss
|
||||
async fileToOss(path, file, item) {
|
||||
async fileToOss(path, file, item, uploadBatchId) {
|
||||
try {
|
||||
let res = await this.OSSclient.multipartUpload(
|
||||
{
|
||||
|
|
@ -629,6 +630,17 @@ export default {
|
|||
if (item.uploadFileSize > file.fileSize) {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import Vue from 'vue'
|
||||
import { anonymization } from './anonymization'
|
||||
export const dcmUpload = async function (data, config, progressFn) {
|
||||
export const dcmUpload = async function (data, config, progressFn, fileInfo) {
|
||||
return new Promise(async resolve => {
|
||||
try {
|
||||
// let blob = await encoder(file, config)
|
||||
|
|
@ -8,7 +8,8 @@ export const dcmUpload = async function (data, config, progressFn) {
|
|||
if (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({
|
||||
...res,
|
||||
image: blob.pixelDataElement
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ const stream = require('stream')
|
|||
import Vue from 'vue'
|
||||
import { customerHttp, OSSclose } from "@/utils/multipartUpload/oss"
|
||||
import { exist, AWSclose } from "@/utils/multipartUpload/aws"
|
||||
import { addOrUpdateFileUploadRecord } from '@/api/file'
|
||||
const { GetObjectStoreToken } = require('../api/user.js')
|
||||
const {
|
||||
S3Client,
|
||||
|
|
@ -22,7 +23,6 @@ async function ossGenerateSTS() {
|
|||
res = await GetObjectStoreToken()
|
||||
localStorage.setItem('stsToken', JSON.stringify(res))
|
||||
}
|
||||
|
||||
// res.Result.ObjectStoreUse = 'AWS';
|
||||
Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] }
|
||||
Vue.prototype.OSSclientConfig.ObjectStoreUse = res.Result.ObjectStoreUse;
|
||||
|
|
@ -34,7 +34,8 @@ async function ossGenerateSTS() {
|
|||
Vue.prototype.OSSclientConfig.timeout = 10 * 60 * 1000
|
||||
let OSSclient = new OSS(Vue.prototype.OSSclientConfig)
|
||||
Vue.prototype.OSSclient = {
|
||||
put: async function (objectName, object) {
|
||||
put: async function (objectName, object, fileInfo = {}) {
|
||||
|
||||
OSSclient = await RefreshClient(OSSclient)
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
|
|
@ -52,6 +53,15 @@ async function ossGenerateSTS() {
|
|||
}
|
||||
let res = await OSSclient.put(objectName, object)
|
||||
if (res && res.url) {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const trialId = urlParams.get('trialId')
|
||||
if (Object.keys(fileInfo).length !== 0) {
|
||||
let params = Object.assign({path: objectName}, fileInfo)
|
||||
addOrUpdateFileUploadRecord(params)
|
||||
} else if (trialId) {
|
||||
let params = { trialId }
|
||||
addOrUpdateFileUploadRecord(params)
|
||||
}
|
||||
resolve({
|
||||
name: objectName,
|
||||
url: res.url
|
||||
|
|
@ -65,7 +75,7 @@ async function ossGenerateSTS() {
|
|||
}
|
||||
})
|
||||
},
|
||||
multipartUpload: async (data, progress) => {
|
||||
multipartUpload: async (data, progress, fileInfo = {}) => {
|
||||
OSSclient = await RefreshClient(OSSclient)
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
|
|
@ -95,6 +105,16 @@ async function ossGenerateSTS() {
|
|||
}
|
||||
let res = await customerHttp(OSSclient, data, progress);
|
||||
if (res) {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const trialId = urlParams.get('trialId')
|
||||
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({
|
||||
name: data.path,
|
||||
url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(res.name)
|
||||
|
|
@ -169,17 +189,17 @@ async function ossGenerateSTS() {
|
|||
}
|
||||
});
|
||||
Vue.prototype.OSSclient = {
|
||||
put: async function (objectName, object) {
|
||||
put: async function (objectName, object, fileInfo = {}) {
|
||||
let data = {
|
||||
file: object,
|
||||
path: objectName
|
||||
}
|
||||
aws = await RefreshClient(aws);
|
||||
return uploadAWS(aws, data, () => { });
|
||||
return uploadAWS(aws, data, () => { }, fileInfo);
|
||||
},
|
||||
multipartUpload: async (data, progress) => {
|
||||
multipartUpload: async (data, progress, fileInfo = {}) => {
|
||||
aws = await RefreshClient(aws);
|
||||
return uploadAWS(aws, data, progress);
|
||||
return uploadAWS(aws, data, progress, fileInfo);
|
||||
},
|
||||
close: () => {
|
||||
AWSclose();
|
||||
|
|
@ -189,7 +209,7 @@ async function ossGenerateSTS() {
|
|||
return
|
||||
}
|
||||
// AWS上传函数
|
||||
function uploadAWS(aws, data, progress) {
|
||||
function uploadAWS(aws, data, progress, fileInfo) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const { file, path } = data;
|
||||
|
|
@ -211,6 +231,16 @@ function uploadAWS(aws, data, progress) {
|
|||
data.path = data.path.replace(`/${bucketName}/`, '');
|
||||
await exist(aws, bucketName, data, progress, (path, status) => {
|
||||
if (status === 'success') {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
|
||||
const trialId = urlParams.get('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({
|
||||
name: decodeUtf8(curPath),
|
||||
url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(curPath)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,24 @@
|
|||
<!-- 配置信息表单 -->
|
||||
<el-form ref="processConfigForm" v-loading="loading" :model="form" label-width="300px" style="width: 800px"
|
||||
: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-radio-group v-model="form.ReadingMode" :disabled="form.IsTrialProcessConfirmed && !isEdit">
|
||||
|
|
@ -78,6 +96,7 @@
|
|||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 修约小数位数 -->
|
||||
<!-- <el-form-item
|
||||
:label="$t('trials:processCfg:form:digitPlaces')"
|
||||
|
|
@ -724,6 +743,7 @@ export default {
|
|||
VUE_IS_TEST: process.env.VUE_APP_IS_TEST,
|
||||
form: {
|
||||
TrialId: '',
|
||||
TrialDataStoreType: 0,
|
||||
ClinicalInformationTransmissionEnum: 1,
|
||||
ClinicalDataSetNames: [],
|
||||
ClinicalDataTrialSetIds: [],
|
||||
|
|
@ -750,6 +770,13 @@ export default {
|
|||
TrialCriterionIdEnums: [],
|
||||
},
|
||||
rules: {
|
||||
TrialDataStoreType: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
ClinicalDataSetNamesStr: [
|
||||
{
|
||||
required: true,
|
||||
|
|
@ -1005,6 +1032,11 @@ export default {
|
|||
// initialCriterions.push(this.$fd('ReadingStandard', id, 'id'))
|
||||
// })
|
||||
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'), // 阅片方式
|
||||
NewVal: this.$fd('ReadingMode', this.form.ReadingMode),
|
||||
|
|
|
|||
|
|
@ -261,12 +261,23 @@ export default {
|
|||
uploadFilesAndSave() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
this.form.AddFileList = []
|
||||
let uploadBatchId = this.$guid()
|
||||
for (var i = 0; i < this.pendingUploadList.length; ++i) {
|
||||
// const file = await this.convertBase64ToBlob(this.pendingUploadList[i])
|
||||
const file = await this.fileToBlob(this.pendingUploadList[i])
|
||||
const res = await this.OSSclient.put(
|
||||
`/${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({
|
||||
fileName: this.pendingUploadList[i].name,
|
||||
|
|
|
|||
|
|
@ -551,6 +551,7 @@ export default {
|
|||
IsVisit: this.data.IsVisit,
|
||||
SubjectId: this.data.SubjectId,
|
||||
IsBaseLine: this.data.IsBaseLine,
|
||||
SubjectVisitId: this.data.SubjectVisitId
|
||||
}
|
||||
)
|
||||
this.addOrUpdateCD.title = this.$t('common:button:new')
|
||||
|
|
@ -565,6 +566,7 @@ export default {
|
|||
}
|
||||
this.currentData.IsVisit = this.data.IsVisit
|
||||
this.currentData.IsBaseLine = this.data.IsBaseLine
|
||||
this.currentData.SubjectVisitId = this.data.SubjectVisitId
|
||||
this.addOrUpdateCD.title = this.$t('common:button:edit')
|
||||
this.currentOption = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,207 @@
|
|||
<template>
|
||||
<BaseContainer>
|
||||
<template slot="search-container">
|
||||
<el-form :inline="true">
|
||||
<!-- 文件名称 -->
|
||||
<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="文件类型" prop="FileType">
|
||||
<el-input v-model="searchData.FileType" size="small" clearable style="width: 120px" />
|
||||
</el-form-item>
|
||||
<!-- 源区域 -->
|
||||
<el-form-item label="源区域" prop="UploadRegion">
|
||||
<el-select v-model="searchData.UploadRegion" style="width: 120px">
|
||||
<el-option
|
||||
v-for="item in regionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 目标区域 -->
|
||||
<el-form-item label="目标区域" prop="TargetRegion">
|
||||
<el-select v-model="searchData.TargetRegion" style="width: 120px">
|
||||
<el-option
|
||||
v-for="item in regionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 是否同步完成 -->
|
||||
<el-form-item label="是否同步完成" prop="IsSync">
|
||||
<el-select v-model="searchData.IsSync" clearable style="width: 120px">
|
||||
<el-option
|
||||
v-for="item of $d.YesOrNo"
|
||||
:key="'IsSync' + item.label"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</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: 70 }" 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="FileName" 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="FileType" min-width="90" show-overflow-tooltip sortable="custom">
|
||||
</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="Path" 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="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>
|
||||
</BaseContainer>
|
||||
</template>
|
||||
<script>
|
||||
import { getFileUploadRecordList } from '@/api/file'
|
||||
import BaseContainer from '@/components/BaseContainer'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import moment from 'moment'
|
||||
const searchDataDefault = () => {
|
||||
return {
|
||||
TrialId: '',
|
||||
DataFileType: 1,
|
||||
SubjectCode: '',
|
||||
VisitName: '',
|
||||
StudyCode: '',
|
||||
FileName: '',
|
||||
UploadRegion: null,
|
||||
TargetRegion: null,
|
||||
IsSync: null,
|
||||
Asc: false,
|
||||
SortField: 'UpdateTime',
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'FileList',
|
||||
components: { BaseContainer, Pagination },
|
||||
props: {
|
||||
rowInfo: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
searchData: searchDataDefault(),
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
datetimerange: [],
|
||||
regionOptions: [
|
||||
{
|
||||
value: 'CN',
|
||||
label: 'CN'
|
||||
}, {
|
||||
value: 'US',
|
||||
label: 'US'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.searchData.TrialId = this.$route.query.trialId
|
||||
this.searchData.SubjectCode = this.rowInfo.SubjectCode
|
||||
this.searchData.VisitName = this.rowInfo.VisitName
|
||||
this.searchData.StudyCode = this.rowInfo.StudyCode
|
||||
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) {
|
||||
this.$emit('openTaskTable', row)
|
||||
},
|
||||
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>
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
<template>
|
||||
<BaseContainer>
|
||||
<template slot="search-container">
|
||||
<el-form :inline="true">
|
||||
<!-- 文件名称 -->
|
||||
<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="文件路径" prop="Path">
|
||||
<el-input v-model="searchData.Path" size="small" clearable />
|
||||
</el-form-item>
|
||||
<!-- 任务状态 -->
|
||||
<el-form-item label="任务状态" prop="JobState">
|
||||
<el-select v-model="searchData.JobState" clearable style="width: 120px">
|
||||
<el-option
|
||||
v-for="item of $d.JobState"
|
||||
:key="'JobState' + item.label"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</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: 70 }" 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="FileName" min-width="90" show-overflow-tooltip sortable="custom">
|
||||
</el-table-column>
|
||||
<el-table-column label="路径" prop="Path" min-width="90" show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column label="任务状态" prop="JobState" min-width="90" show-overflow-tooltip sortable="custom">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.JobState === 1" type="infoinf0">
|
||||
{{ $fd('JobState', scope.row.JobState) }}
|
||||
</el-tag>
|
||||
<el-tag v-else-if="scope.row.JobState === 1" type="warning">
|
||||
{{ $fd('JobState', scope.row.JobState) }}
|
||||
</el-tag>
|
||||
<el-tag v-else-if="scope.row.JobState === 2" type="success">
|
||||
{{ $fd('JobState', scope.row.JobState) }}
|
||||
</el-tag>
|
||||
<el-tag v-else-if="scope.row.JobState === 3" type="danger">
|
||||
{{ $fd('JobState', scope.row.JobState) }}
|
||||
</el-tag>
|
||||
<el-tag v-else>{{ $fd('JobState', scope.row.JobState) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="创建时间" prop="CreateTime" min-width="90" show-overflow-tooltip sortable="custom" />
|
||||
|
||||
<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">
|
||||
重启
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
|
||||
@pagination="getList" />
|
||||
</template>
|
||||
</BaseContainer>
|
||||
</template>
|
||||
<script>
|
||||
import { getUploadFileSyncRecordList } from '@/api/file'
|
||||
import BaseContainer from '@/components/BaseContainer'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import moment from 'moment'
|
||||
const searchDataDefault = () => {
|
||||
return {
|
||||
TrialId: '',
|
||||
StudyCode: '',
|
||||
SubjectCode: '',
|
||||
VisitName: '',
|
||||
FileUploadRecordId: '',
|
||||
JobState: null,
|
||||
FileName: '',
|
||||
Path: '',
|
||||
Asc: false,
|
||||
SortField: '',
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'TaskList',
|
||||
components: { BaseContainer, Pagination },
|
||||
props: {
|
||||
fileUploadRecordId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
path: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
rowInfo: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
searchData: searchDataDefault(),
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
datetimerange: [],
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// fileUploadRecordId: {
|
||||
// deep: true,
|
||||
// immediate: true,
|
||||
// handler(v) {
|
||||
// if (v) {
|
||||
// this.searchData.FileUploadRecordId = v
|
||||
// }
|
||||
// this.getList()
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
mounted() {
|
||||
this.$nextTick(()=>{
|
||||
this.searchData.Path = this.path
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.searchData.TrialId = this.$route.query.trialId
|
||||
this.searchData.StudyCode = this.rowInfo.StudyCode
|
||||
this.searchData.SubjectCode = this.rowInfo.SubjectCode
|
||||
this.searchData.VisitName = this.rowInfo.VisitName
|
||||
this.searchData.FileUploadRecordId = this.fileUploadRecordId
|
||||
this.searchData.Path = this.path
|
||||
let res = await getUploadFileSyncRecordList(this.searchData)
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
} catch(e) {
|
||||
this.loading = false
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
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>
|
||||
|
|
@ -0,0 +1,299 @@
|
|||
<template>
|
||||
<BaseContainer>
|
||||
<template slot="search-container">
|
||||
<el-form :inline="true">
|
||||
<!-- 受试者编号 -->
|
||||
<el-form-item label="受试者编号" prop="SubjectCode">
|
||||
<el-input v-model="searchData.SubjectCode" size="small" clearable style="width: 120px" />
|
||||
</el-form-item>
|
||||
<!-- 访视名称 -->
|
||||
<el-form-item label="访视名称">
|
||||
<el-select v-model="searchData.VisitName" style="width: 140px" clearable>
|
||||
<el-option v-for="(item, index) of visitPlanOptions" :key="index" :label="item.VisitName"
|
||||
:value="item.VisitNum">
|
||||
<span style="float: left">{{ item.VisitName }}</span>
|
||||
</el-option>
|
||||
<!-- <el-option key="Other" label="Out of Plan" value="1.11" /> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 检查编号 -->
|
||||
<el-form-item label="检查编号" prop="StudyCode">
|
||||
<el-input v-model="searchData.StudyCode" size="small" clearable style="width: 120px" />
|
||||
</el-form-item>
|
||||
<!-- 源区域 -->
|
||||
<el-form-item label="源区域" prop="UploadRegion">
|
||||
<el-select v-model="searchData.UploadRegion" style="width: 120px">
|
||||
<el-option
|
||||
v-for="item in regionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 目标区域 -->
|
||||
<el-form-item label="目标区域" prop="TargetRegion">
|
||||
<el-select v-model="searchData.TargetRegion" style="width: 120px">
|
||||
<el-option
|
||||
v-for="item in regionOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 是否同步完成 -->
|
||||
<el-form-item label="是否同步完成" prop="IsSync">
|
||||
<el-select v-model="searchData.IsSync" clearable style="width: 120px">
|
||||
<el-option
|
||||
v-for="item of $d.YesOrNo"
|
||||
:key="'IsSync' + item.label"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</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="SubjectCode" min-width="90" show-overflow-tooltip sortable="custom"/>
|
||||
<el-table-column label="访视名称" prop="VisitName" min-width="90" show-overflow-tooltip sortable="custom"/>
|
||||
<el-table-column label="检查编号" prop="StudyCode" min-width="90" show-overflow-tooltip sortable="custom"/>
|
||||
<el-table-column label="文件数" prop="FileCount" min-width="90" show-overflow-tooltip sortable="custom"/>
|
||||
<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="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="操作" min-width="80" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="openDetailTable(scope.row)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button type="text">
|
||||
同步
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
|
||||
@pagination="getList" />
|
||||
</template>
|
||||
<el-dialog
|
||||
v-if="detailDialog.visible"
|
||||
:visible.sync="detailDialog.visible"
|
||||
fullscreen
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
class="detail-dialog"
|
||||
>
|
||||
<span slot="title">{{ detailDialog.title }}</span>
|
||||
<span v-if="detailDialog.currentRow">{{`${detailDialog.currentRow.SubjectCode} / ${detailDialog.currentRow.VisitName} ${detailDialog.currentRow.StudyCode ? ' / ' + detailDialog.currentRow.StudyCode : ''}`}}</span>
|
||||
<el-tabs class="detail-tabs" v-model="detailDialog.activeTab" @tab-click="handleDetailTabClick">
|
||||
<el-tab-pane label="文件级别" name="file">
|
||||
<FileList
|
||||
v-if="detailDialog.activeTab === 'file'"
|
||||
:rowInfo="detailDialog.currentRow"
|
||||
@openTaskTable="openTaskTable"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="任务级别" name="task">
|
||||
<TaskList
|
||||
v-if="detailDialog.activeTab === 'task'"
|
||||
:rowInfo="detailDialog.currentRow"
|
||||
:fileUploadRecordId="fileUploadRecordId"
|
||||
:path="path"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</BaseContainer>
|
||||
</template>
|
||||
<script>
|
||||
import { getSubjectUploadRecordList } from '@/api/file'
|
||||
import { getTrialVisitStageSelect } from '@/api/trials'
|
||||
import BaseContainer from '@/components/BaseContainer'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import FileList from './components/FileList'
|
||||
import TaskList from './components/TaskList'
|
||||
import moment from 'moment'
|
||||
const searchDataDefault = () => {
|
||||
return {
|
||||
TrialId: '',
|
||||
SubjectCode: '',
|
||||
VisitName: null,
|
||||
StudyCode: '',
|
||||
UploadRegion: '',
|
||||
TargetRegion: '',
|
||||
IsSync: null,
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
Asc: true,
|
||||
SortField: 'StudyCode'
|
||||
}
|
||||
}
|
||||
export default {
|
||||
components: { BaseContainer, Pagination, FileList, TaskList },
|
||||
data() {
|
||||
return {
|
||||
trialId: '',
|
||||
moment,
|
||||
searchData: searchDataDefault(),
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
visitPlanOptions: [],
|
||||
detailDialog: {
|
||||
visible: false,
|
||||
title: '详情',
|
||||
activeTab: 'file',
|
||||
currentRow: null
|
||||
},
|
||||
regionOptions: [
|
||||
{
|
||||
value: 'CN',
|
||||
label: 'CN'
|
||||
}, {
|
||||
value: 'US',
|
||||
label: 'US'
|
||||
}
|
||||
],
|
||||
fileUploadRecordId: '',
|
||||
path: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.trialId = this.$route.query.trialId
|
||||
this.getList()
|
||||
this.getVisitPlanOptions()
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.searchData.TrialId = this.trialId
|
||||
let res = await getSubjectUploadRecordList(this.searchData)
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
} catch(e) {
|
||||
this.loading = false
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
openDetailTable(row) {
|
||||
this.detailDialog.currentRow = row || null
|
||||
this.detailDialog.activeTab = 'file'
|
||||
this.detailDialog.visible = true
|
||||
},
|
||||
openTaskTable(row) {
|
||||
this.fileUploadRecordId = row.Id
|
||||
this.path = row.Path
|
||||
this.detailDialog.activeTab = 'task'
|
||||
|
||||
},
|
||||
handleDetailTabClick(tab) {
|
||||
const name = tab.name
|
||||
if (name === 'file') {
|
||||
this.fileUploadRecordId = ''
|
||||
this.path = ''
|
||||
}
|
||||
// if (name !== 'upload' && name !== 'sync') return
|
||||
// if (this.detailDialog[name].list && this.detailDialog[name].list.length) return
|
||||
// this.fetchDetailList(name)
|
||||
},
|
||||
// 获取访视下拉框数据
|
||||
async getVisitPlanOptions() {
|
||||
try {
|
||||
let res = await getTrialVisitStageSelect(this.trialId)
|
||||
this.visitPlanOptions = res.Result
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
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>
|
||||
<style lang="scss">
|
||||
.detail-dialog {
|
||||
margin: 0;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.el-dialog__header {
|
||||
flex: 0 0 auto;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding-top: 10px;
|
||||
flex: 1 1 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&.is-fullscreen {
|
||||
.el-dialog__body {
|
||||
margin-top: 10px;
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-tabs {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.el-tabs__header {
|
||||
flex: 0 0 auto;
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
.el-tabs__content {
|
||||
flex: 1 1 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
.el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
|
@ -382,6 +382,7 @@ export default {
|
|||
size: files[i].size,
|
||||
type: extendName.split('.')[1],
|
||||
file: files[i],
|
||||
fileType: files[i].type
|
||||
}
|
||||
this.fileList.push(obj);
|
||||
}
|
||||
|
|
@ -401,7 +402,17 @@ export default {
|
|||
var timestamp = Date.now();
|
||||
const res = await this.OSSclient.put(
|
||||
`/${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({
|
||||
fileName: this.fileList[i].file.name,
|
||||
|
|
|
|||
|
|
@ -1520,6 +1520,7 @@ export default {
|
|||
},
|
||||
}
|
||||
let arr = []
|
||||
let uploadBatchId = scope.$guid()
|
||||
for (let i = 0; i < seriesList.length; i++) {
|
||||
let v = seriesList[i]
|
||||
let instanceList = []
|
||||
|
|
@ -1587,6 +1588,7 @@ export default {
|
|||
params.trialId
|
||||
)}`
|
||||
if (scope.isClose) return
|
||||
console.log(o.file)
|
||||
let res = await dcmUpload(
|
||||
{
|
||||
path: path,
|
||||
|
|
@ -1607,6 +1609,16 @@ export default {
|
|||
) {
|
||||
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) {
|
||||
|
|
@ -1623,11 +1635,22 @@ export default {
|
|||
o.imageColumns,
|
||||
o.imageRows
|
||||
)
|
||||
|
||||
let thumbnailPath = `/${params.trialId}/Image/${params.subjectId}/${params.subjectVisitId}/${dicomInfo.studyUid}/${v.seriesUid}.jpg`
|
||||
let OSSclient = scope.OSSclient
|
||||
let seriesRes = await OSSclient.put(
|
||||
thumbnailPath,
|
||||
blob
|
||||
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) {
|
||||
ImageResizePath = scope.$getObjectName(
|
||||
|
|
@ -1762,7 +1785,20 @@ export default {
|
|||
let thumbnailPath = `/${params.trialId}/Image/${params.trialSiteId}/${params.subjectId}/${params.subjectVisitId}/${dicomInfo.studyUid}/${v.seriesUid}.jpg`
|
||||
let OSSclient = scope.OSSclient
|
||||
try {
|
||||
let seriesRes = await OSSclient.put(thumbnailPath, blob)
|
||||
let seriesRes = await OSSclient.put(
|
||||
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) {
|
||||
o.ImageResizePath = scope.$getObjectName(seriesRes.url)
|
||||
}
|
||||
|
|
@ -1775,7 +1811,8 @@ export default {
|
|||
params.study.instanceCount = dicomInfo.failedFileCount
|
||||
params.RecordPath = scope.$getObjectName(logRes.url)
|
||||
if (scope.isClose) return false
|
||||
console.log(params)
|
||||
|
||||
params.UploadBatchId = uploadBatchId
|
||||
addOrUpdateArchiveStudy(params)
|
||||
.then((res) => {
|
||||
if (dicomInfo.failedFileCount === dicomInfo.fileCount) {
|
||||
|
|
|
|||
|
|
@ -756,6 +756,7 @@ export default {
|
|||
.substring(fileName.lastIndexOf('.'))
|
||||
.toLocaleLowerCase()
|
||||
if (this.faccept.indexOf(extendName) !== -1) {
|
||||
files[i].fileName = files[i].name
|
||||
files[i].id = `${files[i].lastModified}${files[i].name}`
|
||||
this.fileList.push(files[i])
|
||||
}
|
||||
|
|
@ -809,8 +810,9 @@ export default {
|
|||
})
|
||||
if (res.IsSuccess) {
|
||||
this.studyMonitorId = res.Result
|
||||
let uploadBatchId = this.$guid()
|
||||
for (let i = 0; i < num; i++) {
|
||||
funArr.push(this.handleUploadTask(this.selectArr, i))
|
||||
funArr.push(this.handleUploadTask(this.selectArr, i, uploadBatchId))
|
||||
}
|
||||
if (funArr.length > 0) {
|
||||
let res = await Promise.all(funArr)
|
||||
|
|
@ -821,17 +823,16 @@ export default {
|
|||
}
|
||||
},
|
||||
// 并发上传
|
||||
async handleUploadTask(arr, index) {
|
||||
async handleUploadTask(arr, index, uploadBatchId) {
|
||||
if (!this.uploadVisible) return
|
||||
let file = this.fileList.filter((item) => item.id === arr[index].id)[0]
|
||||
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
|
||||
}/${this.$guid()}${file.name
|
||||
.substring(file.name.lastIndexOf('.'))
|
||||
.toLocaleLowerCase()}`
|
||||
}/${fileName}`
|
||||
file.curPath = path
|
||||
const fileData = await this.fileToBlob(file.file)
|
||||
let res = await this.fileToOss(path, fileData, file)
|
||||
let res = await this.fileToOss(path, fileData, file, uploadBatchId)
|
||||
if (res) {
|
||||
file.status = 2
|
||||
this.successFileList.push({
|
||||
|
|
@ -865,13 +866,13 @@ export default {
|
|||
}
|
||||
let ind = arr.findIndex((item) => item.status === 0)
|
||||
if (ind >= 0) {
|
||||
return this.handleUploadTask(arr, ind)
|
||||
return this.handleUploadTask(arr, ind, uploadBatchId)
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
// file上传到oss
|
||||
async fileToOss(path, file, item) {
|
||||
async fileToOss(path, file, item, uploadBatchId) {
|
||||
try {
|
||||
let res = await this.OSSclient.multipartUpload(
|
||||
{
|
||||
|
|
@ -884,6 +885,18 @@ export default {
|
|||
if (item.uploadFileSize > file.fileSize) {
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -361,6 +361,7 @@ export default {
|
|||
size: files[i].size,
|
||||
type: extendName.split('.')[1],
|
||||
file: files[i],
|
||||
fileType: files[i].type
|
||||
}
|
||||
this.fileList.push(obj)
|
||||
}
|
||||
|
|
@ -380,7 +381,17 @@ export default {
|
|||
var timestamp = Date.now()
|
||||
const res = await this.OSSclient.put(
|
||||
`/${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({
|
||||
fileName: this.fileList[i].file.name,
|
||||
|
|
|
|||
Loading…
Reference in New Issue