下载优化
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-12-24 09:59:28 +08:00
parent 6e70d32397
commit e2ca9e582e
5 changed files with 168 additions and 76 deletions

View File

@ -214,7 +214,7 @@
<el-dialog title="" :visible.sync="RecordVisible" :fullscreen="true"> <el-dialog title="" :visible.sync="RecordVisible" :fullscreen="true">
<downloadRecord :isSystem="true" v-if="RecordVisible" /> <downloadRecord :isSystem="true" v-if="RecordVisible" />
</el-dialog> </el-dialog>
<el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%" <!-- <el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%"
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose"> :close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'"> <div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span> <span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
@ -224,7 +224,7 @@
<div v-else> <div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span> <span>{{ $t('dialog:sattus:ziping') }}</span>
</div> </div>
</el-dialog> </el-dialog> -->
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
@ -239,7 +239,7 @@ import { getPatientList, deletePatientStudyAllData, getDownloadPatientStudyInfo,
import { getDicomCalledAEList, getDicomCallingAEList } from '@/api/dicomAE.js' import { getDicomCalledAEList, getDicomCallingAEList } from '@/api/dicomAE.js'
import downloadRecord from "@/views/trials/trials-panel/trial-summary/download-record" import downloadRecord from "@/views/trials/trials-panel/trial-summary/download-record"
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import * as signalR from '@microsoft/signalr' // import * as signalR from '@microsoft/signalr'
import { import {
downloadImageSuccess, downloadImageSuccess,
} from '@/api/trials.js' } from '@/api/trials.js'
@ -644,17 +644,6 @@ export default {
this.$EventBus.$on("reload", (data) => { this.$EventBus.$on("reload", (data) => {
window.location.reload() window.location.reload()
}); });
let connection = new signalR.HubConnectionBuilder()
.withUrl("/DownloadHub", { accessTokenFactory: () => getToken() })
.configureLogging(signalR.LogLevel.Information)
.withAutomaticReconnect()
.build()
connection.start()
connection.on("ReceivProgressAsync", (id, obj) => {
console.log(obj)
this.speed = obj.speed
this.onUploadProgress(id, obj.sizePercent, 'downLoad')
});
} }
} }
</script> </script>

View File

@ -186,7 +186,7 @@
<editStudyList :visible.sync="editStudyVisible" :data="editStudyData" v-if="editStudyVisible" @getList="getList" /> <editStudyList :visible.sync="editStudyVisible" :data="editStudyData" v-if="editStudyVisible" @getList="getList" />
<!--访视详情--> <!--访视详情-->
<visitInfo v-if="visitVisible" :visible.sync="visitVisible" :rowData="rowData" /> <visitInfo v-if="visitVisible" :visible.sync="visitVisible" :rowData="rowData" />
<el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%" <!-- <el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%"
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose"> :close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'"> <div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span> <span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
@ -196,7 +196,7 @@
<div v-else> <div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span> <span>{{ $t('dialog:sattus:ziping') }}</span>
</div> </div>
</el-dialog> </el-dialog> -->
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
@ -209,7 +209,7 @@ import { getPatientSubejctVisitList } from '@/api/trials/visit.js'
import { submitVisitStudyBinding } from '@/api/inspection.js' import { submitVisitStudyBinding } from '@/api/inspection.js'
import { downLoadFile } from '@/utils/stream.js' import { downLoadFile } from '@/utils/stream.js'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import * as signalR from '@microsoft/signalr' // import * as signalR from '@microsoft/signalr'
import { import {
getDownloadSubjectVisitStudyInfo, getDownloadSubjectVisitStudyInfo,
VisitImageDownload, VisitImageDownload,
@ -277,17 +277,17 @@ export default {
this.getList() this.getList()
}, },
mounted() { mounted() {
let connection = new signalR.HubConnectionBuilder() // let connection = new signalR.HubConnectionBuilder()
.withUrl("/DownloadHub", { accessTokenFactory: () => getToken() }) // .withUrl("/DownloadHub", { accessTokenFactory: () => getToken() })
.configureLogging(signalR.LogLevel.Information) // .configureLogging(signalR.LogLevel.Information)
.withAutomaticReconnect() // .withAutomaticReconnect()
.build() // .build()
connection.start() // connection.start()
connection.on("ReceivProgressAsync", (id, obj) => { // connection.on("ReceivProgressAsync", (id, obj) => {
console.log(obj) // console.log(obj)
this.speed = obj.speed // this.speed = obj.speed
this.onUploadProgress(id, obj.sizePercent, 'downLoad') // this.onUploadProgress(id, obj.sizePercent, 'downLoad')
}); // });
}, },
methods: { methods: {
handleSelectionChange(val) { handleSelectionChange(val) {
@ -454,9 +454,39 @@ export default {
} }
this.downloadId = this.generate() this.downloadId = this.generate()
data.CurrentNoticeId = this.downloadId data.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId) // this.onUploadProgress(this.downloadId)
// this.downloading = true // this.downloading = true
await VisitImageDownload(data) let params = null
data.SubjectVisitIdList.forEach(item => {
if (!params) {
params = `SubjectVisitIdList=${item}`
} else {
params += `&SubjectVisitIdList=${item}`
}
})
// data.ScpStudyIdList.forEach(item => {
// if (!params) {
// params = `ScpStudyIdList=${item}`
// } else {
// params += `&ScpStudyIdList=${item}`
// }
// })
if (!params) {
params = `CurrentNoticeId=${this.downloadId}`
} else {
params += `&CurrentNoticeId=${this.downloadId}`
}
params += `&TrialId=${this.$route.query.trialId}`
if (params) {
params += `&access_token=${getToken()}`
let url = `/api/download/VisitImageDownload?${params}`
// let url = `http://106.14.89.110:30021/download/DownloadBigFileBatch?fileName=Test_HIR_New_log.ldf`
let a = document.createElement('a')
a.href = url
a.click()
a = null
}
// await VisitImageDownload(data)
// this.downloading = false // this.downloading = false
// if (res.IsSuccess) { // if (res.IsSuccess) {
// this.downloadId = res.OtherInfo // this.downloadId = res.OtherInfo

View File

@ -437,7 +437,7 @@
width="600px"> width="600px">
<ChatForm :row-data="currentRow" @getList="getList" @close="auditRecordVisible = false" /> <ChatForm :row-data="currentRow" @getList="getList" @close="auditRecordVisible = false" />
</el-dialog> </el-dialog>
<el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%" <!-- <el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%"
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose"> :close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'"> <div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span> <span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
@ -447,7 +447,7 @@
<div v-else> <div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span> <span>{{ $t('dialog:sattus:ziping') }}</span>
</div> </div>
</el-dialog> </el-dialog> -->
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
@ -563,17 +563,17 @@ export default {
mounted() { mounted() {
this.trialId = this.$route.query.trialId this.trialId = this.$route.query.trialId
this.getTrialCriterionList() this.getTrialCriterionList()
let connection = new signalR.HubConnectionBuilder() // let connection = new signalR.HubConnectionBuilder()
.withUrl("/DownloadHub", { accessTokenFactory: () => getToken() }) // .withUrl("/DownloadHub", { accessTokenFactory: () => getToken() })
.configureLogging(signalR.LogLevel.Information) // .configureLogging(signalR.LogLevel.Information)
.withAutomaticReconnect() // .withAutomaticReconnect()
.build() // .build()
connection.start() // connection.start()
connection.on("ReceivProgressAsync", (id, obj) => { // connection.on("ReceivProgressAsync", (id, obj) => {
console.log(obj) // console.log(obj)
this.speed = obj.speed // this.speed = obj.speed
this.onUploadProgress(id, obj.sizePercent, 'downLoad') // this.onUploadProgress(id, obj.sizePercent, 'downLoad')
}); // });
}, },
beforeDestroy() { beforeDestroy() {
if (this.openWindow) { if (this.openWindow) {
@ -670,9 +670,36 @@ export default {
} }
this.downloadId = this.generate() this.downloadId = this.generate()
data.CurrentNoticeId = this.downloadId data.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId) let params = null
// this.downloading = true data.SubjectVisitIdList.forEach(item => {
await VisitImageDownload(data) if (!params) {
params = `SubjectVisitIdList=${item}`
} else {
params += `&SubjectVisitIdList=${item}`
}
})
// data.ScpStudyIdList.forEach(item => {
// if (!params) {
// params = `ScpStudyIdList=${item}`
// } else {
// params += `&ScpStudyIdList=${item}`
// }
// })
if (!params) {
params = `CurrentNoticeId=${this.downloadId}`
} else {
params += `&CurrentNoticeId=${this.downloadId}`
}
params += `&TrialId=${this.$route.query.trialId}`
if (params) {
params += `&access_token=${getToken()}`
let url = `/api/download/VisitImageDownload?${params}`
// let url = `http://106.14.89.110:30021/download/DownloadBigFileBatch?fileName=Test_HIR_New_log.ldf`
let a = document.createElement('a')
a.href = url
a.click()
a = null
}
// this.downloading = false // this.downloading = false
// if (res.IsSuccess) { // if (res.IsSuccess) {
// this.downloadId = res.OtherInfo // this.downloadId = res.OtherInfo

View File

@ -224,7 +224,7 @@
</template> </template>
</base-model> </base-model>
</template> </template>
<el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%" <!-- <el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%"
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose"> :close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'"> <div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span> <span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
@ -234,7 +234,7 @@
<div v-else> <div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span> <span>{{ $t('dialog:sattus:ziping') }}</span>
</div> </div>
</el-dialog> </el-dialog> -->
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
@ -351,17 +351,17 @@ export default {
} }
}, },
mounted() { mounted() {
let connection = new signalR.HubConnectionBuilder() // let connection = new signalR.HubConnectionBuilder()
.withUrl("/DownloadHub", { accessTokenFactory: () => getToken() }) // .withUrl("/DownloadHub", { accessTokenFactory: () => getToken() })
.configureLogging(signalR.LogLevel.Information) // .configureLogging(signalR.LogLevel.Information)
.withAutomaticReconnect() // .withAutomaticReconnect()
.build() // .build()
connection.start() // connection.start()
connection.on("ReceivProgressAsync", (id, obj) => { // connection.on("ReceivProgressAsync", (id, obj) => {
console.log(obj) // console.log(obj)
this.speed = obj.speed // this.speed = obj.speed
this.onUploadProgress(id, obj.sizePercent, 'downLoad') // this.onUploadProgress(id, obj.sizePercent, 'downLoad')
}); // });
}, },
methods: { methods: {
handleSelectionChange(val) { handleSelectionChange(val) {
@ -609,9 +609,38 @@ export default {
} }
this.downloadId = this.generate() this.downloadId = this.generate()
data.CurrentNoticeId = this.downloadId data.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId) // this.onUploadProgress(this.downloadId)
// this.downloading = true // this.downloading = true
await VisitImageDownload(data) let params = null
data.SubjectVisitIdList.forEach(item => {
if (!params) {
params = `SubjectVisitIdList=${item}`
} else {
params += `&SubjectVisitIdList=${item}`
}
})
// data.ScpStudyIdList.forEach(item => {
// if (!params) {
// params = `ScpStudyIdList=${item}`
// } else {
// params += `&ScpStudyIdList=${item}`
// }
// })
if (!params) {
params = `CurrentNoticeId=${this.downloadId}`
} else {
params += `&CurrentNoticeId=${this.downloadId}`
}
params += `&TrialId=${this.$route.query.trialId}`
if (params) {
params += `&access_token=${getToken()}`
let url = `/api/download/VisitImageDownload?${params}`
// let url = `http://106.14.89.110:30021/download/DownloadBigFileBatch?fileName=Test_HIR_New_log.ldf`
let a = document.createElement('a')
a.href = url
a.click()
a = null
}
// this.downloading = false // this.downloading = false
// if (res.IsSuccess) { // if (res.IsSuccess) {
// this.downloadId = res.OtherInfo // this.downloadId = res.OtherInfo

View File

@ -317,7 +317,7 @@
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
<el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%" <!-- <el-dialog :title="$t('dialog:title:downLoadProgress')" :visible.sync="downloadVisible" width="35%"
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose"> :close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'"> <div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span> <span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
@ -327,7 +327,7 @@
<div v-else> <div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span> <span>{{ $t('dialog:sattus:ziping') }}</span>
</div> </div>
</el-dialog> </el-dialog> -->
</div> </div>
</template> </template>
<script> <script>
@ -415,17 +415,17 @@ export default {
this.getList() this.getList()
} }
}) })
let connection = new signalR.HubConnectionBuilder() // let connection = new signalR.HubConnectionBuilder()
.withUrl("/DownloadHub", { accessTokenFactory: () => getToken() }) // .withUrl("/DownloadHub", { accessTokenFactory: () => getToken() })
.configureLogging(signalR.LogLevel.Information) // .configureLogging(signalR.LogLevel.Information)
.withAutomaticReconnect() // .withAutomaticReconnect()
.build() // .build()
connection.start() // connection.start()
connection.on("ReceivProgressAsync", (id, obj) => { // connection.on("ReceivProgressAsync", (id, obj) => {
console.log(obj) // console.log(obj)
this.speed = obj.speed // this.speed = obj.speed
this.onUploadProgress(id, obj.sizePercent, 'downLoad') // this.onUploadProgress(id, obj.sizePercent, 'downLoad')
}); // });
}, },
methods: { methods: {
handleClose(done) { handleClose(done) {
@ -487,8 +487,25 @@ export default {
} }
this.downloadId = this.generate() this.downloadId = this.generate()
param.CurrentNoticeId = this.downloadId param.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId) // this.onUploadProgress(this.downloadId)
await ClinicalDataDownload(param) let params = null
Object.keys(param).forEach(key => {
if (!params) {
params = `${key}=${param[key]}`
} else {
params += `&${key}=${param[key]}`
}
})
if (params) {
params += `&access_token=${getToken()}`
let url = `/api/download/ClinicalDataDownload?${params}`
// let url = `http://106.14.89.110:30021/download/DownloadBigFileBatch?fileName=Test_HIR_New_log.ldf`
let a = document.createElement('a')
a.href = url
a.click()
a = null
}
// await ClinicalDataDownload(param)
} catch (err) { } catch (err) {
console.log(err) console.log(err)
} }