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

main
wangxiaoshuang 2025-12-18 09:51:23 +08:00
parent b024b186b7
commit 6acadf6287
5 changed files with 355 additions and 256 deletions

View File

@ -3672,3 +3672,12 @@ export function visitImageBack(data) {
data
})
}
// 阅片任务退回
export function VisitImageDownload(data) {
return requestDownload({
url: `/download/VisitImageDownload`,
method: 'post',
responseType: 'blob',
data
})
}

View File

@ -218,7 +218,8 @@
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
<el-progress :percentage="percentage * 1"></el-progress>
<span>{{ speed }}</span>
<el-progress :percentage="percentage * 1" v-if="downloadVisible"></el-progress>
</div>
<div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span>
@ -304,7 +305,8 @@ export default {
downloadVisible: false,
downloadType: '',
percentage: 0,
downLoadImageCount: 0
downLoadImageCount: 0,
speed: '0KB/s'
}
},
created() {
@ -319,6 +321,8 @@ export default {
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.speed = '0KB/s'
this.downloadId = null
done()
},
generate() {
@ -604,6 +608,7 @@ export default {
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.speed = '0KB/s'
}
// if (type === 'downLoaded') {
// }
@ -628,6 +633,7 @@ export default {
connection.start()
connection.on("ReceivProgressAsync", (id, obj) => {
console.log(obj)
this.speed = obj.speed
this.onUploadProgress(id, obj.sizePercent, 'downLoad')
});
}

View File

@ -5,79 +5,38 @@
<el-form :inline="true">
<!-- 受试者编号 -->
<el-form-item :label="$t('trials:uploadMonitor:table:subjectId')">
<el-input
v-model="searchData.SubjectCode"
clearable
style="width: 140px"
/>
<el-input v-model="searchData.SubjectCode" clearable style="width: 140px" />
</el-form-item>
<!-- 患者编号 -->
<el-form-item :label="$t('trials:uploadDicomList:table:pId')">
<el-input
v-model="searchData.PatientIdStr"
clearable
style="width: 140px"
/>
<el-input v-model="searchData.PatientIdStr" clearable style="width: 140px" />
</el-form-item>
<!-- 患者姓名 -->
<el-form-item :label="$t('trials:uploadDicomList:table:patientName')">
<el-input
v-model="searchData.PatientName"
clearable
style="width: 140px"
/>
<el-input v-model="searchData.PatientName" clearable style="width: 140px" />
</el-form-item>
<!-- 患者性别 -->
<el-form-item :label="$t('trials:subject:table:gender')">
<el-select
v-model="searchData.SubjectSex"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item of $d.Sex"
:key="item.id"
:label="item.label"
:value="item.value"
/>
<el-select v-model="searchData.SubjectSex" clearable filterable style="width: 150px">
<el-option v-for="item of $d.Sex" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- 访视名称 -->
<el-form-item :label="$t('trials:uploadMonitor:table:visitName')">
<el-input
v-model="searchData.VisitName"
clearable
style="width: 140px"
/>
<el-input v-model="searchData.VisitName" clearable style="width: 140px" />
</el-form-item>
<!--拍片日期-->
<el-form-item :label="$t('trials:trials-panel:table:ScanDate')">
<el-date-picker
v-model="dateValue"
type="datetimerange"
range-separator="-"
<el-date-picker v-model="dateValue" type="datetimerange" range-separator="-"
:start-placeholder="$t('trials:uploadClinicalData:table:beginDate')"
:end-placeholder="$t('trials:uploadClinicalData:table:endDate')"
clearable
:default-time="['00:00:00', '23:59:59']"
>
:end-placeholder="$t('trials:uploadClinicalData:table:endDate')" clearable
:default-time="['00:00:00', '23:59:59']">
</el-date-picker>
</el-form-item>
<!--状态-->
<el-form-item :label="$t('trials:trials-list:table:status')">
<el-select
v-model="searchData.SubmitState"
clearable
filterable
style="width: 150px"
>
<el-option
v-for="item of $d.SubmitState"
:key="item.id"
:label="item.label"
:value="item.value"
/>
<el-select v-model="searchData.SubmitState" clearable filterable style="width: 150px">
<el-option v-for="item of $d.SubmitState" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
@ -86,60 +45,39 @@
{{ $t('common:button:search') }}
</el-button>
<!-- 重置 -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
{{ $t('common:button:reset') }}
</el-button>
<!-- 下载影像 -->
<el-button type="primary" @click="getDownloadSubjectVisitStudyInfo(multipleSelection)"
:disabled="multipleSelection.length <= 0" v-hasPermi="['trials:trials-panel:hirVisit:download']">
{{ $t('trials:inspection:button:downloadImage') }}
</el-button>
</el-form-item>
</el-form>
</template>
<!-- 访视列表:default-sort="{ prop: 'SubmitTime', order: 'descending' }" -->
<template slot="main-container">
<el-table
ref="visitList"
v-loading="loading"
v-adaptive="{ bottomOffset: 60 }"
:data="list"
stripe
height="100"
@sort-change="handleSortByColumn"
>
<el-table ref="visitList" v-loading="loading" v-adaptive="{ bottomOffset: 60 }" :data="list" stripe height="100"
@sort-change="handleSortByColumn" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" v-if="hasPermi(['trials:trials-panel:hirVisit:download'])" />
<el-table-column min-width="20">
<template slot-scope="scope">
<i
v-if="
Number(scope.row.SubmitState) === 1 &&
scope.row.VisitLatestStudyTime
"
class="el-icon-warning-outline"
:title="$t('trials:hirVisit:tipMessage:tipOne')"
style="color: red"
></i>
<i v-if="
Number(scope.row.SubmitState) === 1 &&
scope.row.VisitLatestStudyTime
" class="el-icon-warning-outline" :title="$t('trials:hirVisit:tipMessage:tipOne')" style="color: red"></i>
</template>
</el-table-column>
<!-- 受试者编号 -->
<el-table-column
prop="SubjectCode"
:label="$t('trials:uploadMonitor:table:subjectId')"
show-overflow-tooltip
sortable="custom"
min-width="120"
/>
<el-table-column prop="SubjectCode" :label="$t('trials:uploadMonitor:table:subjectId')" show-overflow-tooltip
sortable="custom" min-width="120" />
<!-- 患者编号 -->
<el-table-column
prop="PatientList.PatientIdStr"
:label="$t('trials:uploadDicomList:table:pId')"
show-overflow-tooltip
>
<el-table-column prop="PatientList.PatientIdStr" :label="$t('trials:uploadDicomList:table:pId')"
show-overflow-tooltip>
<template slot-scope="scope">
<span
v-for="(item, index) in scope.row.PatientList"
:key="`${index}${item.PatientId}`"
>
<span v-for="(item, index) in scope.row.PatientList" :key="`${index}${item.PatientId}`">
{{
index === scope.row.PatientList.length - 1
? item.PatientIdStr
@ -149,32 +87,18 @@
</template>
</el-table-column>
<!-- 患者姓名 -->
<el-table-column
prop="SubjectShortName"
:label="$t('trials:researchStaff:table:Name')"
show-overflow-tooltip
sortable="custom"
min-width="100"
/>
<el-table-column prop="SubjectShortName" :label="$t('trials:researchStaff:table:Name')" show-overflow-tooltip
sortable="custom" min-width="100" />
<!-- 性别 -->
<el-table-column
prop="SubjectSex"
:label="$t('trials:subject:table:gender')"
show-overflow-tooltip
sortable="custom"
>
<el-table-column prop="SubjectSex" :label="$t('trials:subject:table:gender')" show-overflow-tooltip
sortable="custom">
<template slot-scope="scope">
<span>{{ $fd('Sex', scope.row.SubjectSex) }}</span>
</template>
</el-table-column>
<!-- 访视名称 -->
<el-table-column
prop="VisitName"
:label="$t('trials:uploadMonitor:table:visitName')"
show-overflow-tooltip
sortable="custom"
min-width="100"
>
<el-table-column prop="VisitName" :label="$t('trials:uploadMonitor:table:visitName')" show-overflow-tooltip
sortable="custom" min-width="100">
<template slot-scope="scope">
<el-button type="text" @click="handleOpenStudyDialog(scope.row)">
<span>{{ scope.row.VisitName }}</span>
@ -182,39 +106,21 @@
</template>
</el-table-column>
<!-- 最早拍片日期 -->
<el-table-column
prop="VisitEarliestStudyTime"
:label="$t('trials:trials-panel:table:EarliestScanDate')"
show-overflow-tooltip
sortable="custom"
min-width="140"
/>
<el-table-column prop="VisitEarliestStudyTime" :label="$t('trials:trials-panel:table:EarliestScanDate')"
show-overflow-tooltip sortable="custom" min-width="140" />
<!-- 最晚拍片日期 -->
<el-table-column
prop="VisitLatestStudyTime"
:label="$t('trials:linkedRP:table:latestScanDate')"
show-overflow-tooltip
sortable="custom"
min-width="120"
/>
<el-table-column prop="VisitLatestStudyTime" :label="$t('trials:linkedRP:table:latestScanDate')"
show-overflow-tooltip sortable="custom" min-width="120" />
<!-- 状态 -->
<el-table-column
prop="SubmitState"
:label="$t('trials:trials-list:table:status')"
show-overflow-tooltip
sortable="custom"
>
<el-table-column prop="SubmitState" :label="$t('trials:trials-list:table:status')" show-overflow-tooltip
sortable="custom">
<template slot-scope="scope">
<el-tag
:type="
Number(scope.row.SubmitState) === 0
? 'warning'
: Number(scope.row.SubmitState) === 1
? 'danger'
: ''
"
>{{ $fd('SubmitState', Number(scope.row.SubmitState)) }}</el-tag
>
<el-tag :type="Number(scope.row.SubmitState) === 0
? 'warning'
: Number(scope.row.SubmitState) === 1
? 'danger'
: ''
">{{ $fd('SubmitState', Number(scope.row.SubmitState)) }}</el-tag>
</template>
</el-table-column>
<!-- 打包状态 -->
@ -240,94 +146,57 @@
</template>
</el-table-column> -->
<!-- 提交时间 -->
<el-table-column
prop="SubmitTime"
:label="$t('trials:crcUpload:table:submitTime')"
show-overflow-tooltip
min-width="100"
sortable="custom"
/>
<el-table-column prop="SubmitTime" :label="$t('trials:crcUpload:table:submitTime')" show-overflow-tooltip
min-width="100" sortable="custom" />
<!--操作-->
<el-table-column
:label="$t('common:action:action')"
min-width="200"
fixed="right"
v-if="
hasPermi([
'trials:trials-panel:hirVisit:edit',
'trials:trials-panel:hirVisit:submit',
'trials:trials-panel:hirVisit:remove',
'trials:trials-panel:hirVisit:download',
])
"
>
<el-table-column :label="$t('common:action:action')" min-width="200" fixed="right" v-if="
hasPermi([
'trials:trials-panel:hirVisit:edit',
'trials:trials-panel:hirVisit:submit',
'trials:trials-panel:hirVisit:remove',
'trials:trials-panel:hirVisit:download',
])
">
<template slot-scope="scope">
<!--修改检查-->
<el-button
circle
icon="el-icon-edit-outline"
v-hasPermi="['trials:trials-panel:hirVisit:edit']"
:title="$t('trials:hirVisit:button:editStudy')"
:disabled="Number(scope.row.SubmitState) > 1"
@click.stop="editStudy(scope.row)"
/>
<el-button circle icon="el-icon-edit-outline" v-hasPermi="['trials:trials-panel:hirVisit:edit']"
:title="$t('trials:hirVisit:button:editStudy')" :disabled="Number(scope.row.SubmitState) > 1"
@click.stop="editStudy(scope.row)" />
<!--提交-->
<el-button
circle
icon="el-icon-position"
v-hasPermi="['trials:trials-panel:hirVisit:submit']"
:disabled="
Number(scope.row.SubmitState) != 1 ||
!scope.row.VisitLatestStudyTime
"
:title="$t('common:button:submit')"
@click.stop="submit(scope.row)"
/>
<el-button circle icon="el-icon-position" v-hasPermi="['trials:trials-panel:hirVisit:submit']" :disabled="Number(scope.row.SubmitState) != 1 ||
!scope.row.VisitLatestStudyTime
" :title="$t('common:button:submit')" @click.stop="submit(scope.row)" />
<!--删除-->
<el-button
circle
icon="el-icon-delete"
v-hasPermi="['trials:trials-panel:hirVisit:remove']"
@click.stop="remove(scope.row)"
:disabled="Number(scope.row.SubmitState) > 1"
:title="$t('common:button:delete')"
/>
<el-button circle icon="el-icon-delete" v-hasPermi="['trials:trials-panel:hirVisit:remove']"
@click.stop="remove(scope.row)" :disabled="Number(scope.row.SubmitState) > 1"
:title="$t('common:button:delete')" />
<!--下载报告-->
<el-button
v-hasPermi="['trials:trials-panel:hirVisit:download']"
circle
:loading="downloading"
icon="el-icon-download"
:disabled="Number(scope.row.SubmitState) !== 2"
:title="$t('trials:reading:button:download')"
@click="getDownloadSubjectVisitStudyInfo(scope.row)"
/>
<el-button v-hasPermi="['trials:trials-panel:hirVisit:download']" circle :loading="downloading"
icon="el-icon-download" :disabled="Number(scope.row.SubmitState) !== 2"
:title="$t('trials:reading:button:download')" @click="getDownloadSubjectVisitStudyInfo([scope.row])" />
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="getList" />
</template>
<!--修改检查-->
<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%"
:close-on-click-modal="false" :close-on-press-escape="false" :before-close="handleClose">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
<span>{{ speed }}</span>
<el-progress :percentage="percentage * 1"></el-progress>
</div>
<div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span>
</div>
</el-dialog>
</BaseContainer>
</template>
<script>
@ -339,8 +208,11 @@ import { deleteSubjectVisit } from '@/api/trials'
import { getPatientSubejctVisitList } from '@/api/trials/visit.js'
import { submitVisitStudyBinding } from '@/api/inspection.js'
import { downLoadFile } from '@/utils/stream.js'
import { getToken } from '@/utils/auth'
import * as signalR from '@microsoft/signalr'
import {
getDownloadSubjectVisitStudyInfo,
VisitImageDownload,
downloadImageSuccess,
} from '@/api/trials.js'
const defaultSearchData = () => {
@ -389,6 +261,12 @@ export default {
//
downloading: false,
downloadId: null,
downloadVisible: false,
downloadType: '',
percentage: 0,
downLoadImageCount: 0,
speed: '0KB/s',
multipleSelection: []
}
},
created() {
@ -398,7 +276,56 @@ export default {
}
this.getList()
},
mounted() {
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')
});
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClose(done) {
this.downLoadType = 'start'
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.speed = '0KB/s'
this.downloadId = null
done()
},
generate() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
async onUploadProgress(id, num, type = 'start') {
if (id !== this.downloadId) return false
this.downloadType = type
if (type === 'start') {
this.downloadVisible = true
}
if (type === 'downLoad') {
this.percentage = num
}
if (num >= 100) {
this.downLoadType = 'start'
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.speed = '0KB/s'
}
},
//
handleSearch() {
this.getList()
@ -517,20 +444,24 @@ export default {
}
},
//
async getDownloadSubjectVisitStudyInfo(row) {
async getDownloadSubjectVisitStudyInfo(arr) {
if (this.downloading) return
try {
let data = {
SubjectVisitId: row.SubjectVisitId,
// SubjectVisitId: row.SourceSubjectVisitId,
SubjectVisitIdList: arr.map(item => item.SourceSubjectVisitId),
TrialId: this.$route.query.trialId,
}
this.downloading = true
let res = await getDownloadSubjectVisitStudyInfo(data)
this.downloading = false
if (res.IsSuccess) {
this.downloadId = res.OtherInfo
this.downloadImage(res.Result)
}
this.downloadId = this.generate()
data.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId)
// this.downloading = true
await VisitImageDownload(data)
// this.downloading = false
// if (res.IsSuccess) {
// this.downloadId = res.OtherInfo
// this.downloadImage(res.Result)
// }
} catch (err) {
this.downloading = false
console.log(err)
@ -564,11 +495,9 @@ export default {
series.InstanceList.forEach((instance) => {
let fileName = instance.Path.split('/').pop()
let obj = {
name: `${data.SubjectCode}_${data.VisitName}/${
study.StudyCode
}_${study.StudyTime.split(' ')[0]}_${
series.Modality
}/${fileName}`,
name: `${data.SubjectCode}_${data.VisitName}/${study.StudyCode
}_${study.StudyTime.split(' ')[0]}_${series.Modality
}/${fileName}`,
url: this.OSSclientConfig.basePath + instance.Path,
}
files.push(obj)

View File

@ -79,12 +79,18 @@
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
{{ $t('common:button:reset') }}
</el-button>
<!-- 下载影像 -->
<el-button type="primary" @click="getDownloadSubjectVisitStudyInfo(multipleSelection)"
v-hasPermi="['trials:readTask:report']" :disabled="multipleSelection.length <= 0">
{{ $t('trials:inspection:button:downloadImage') }}
</el-button>
</el-form-item>
</el-form>
</div>
<div slot="main-container">
<el-table v-adaptive="{ bottomOffset: 75 }" :data="list" stripe height="100"
@sort-change="handleSortChange">
<el-table v-adaptive="{ bottomOffset: 75 }" :data="list" stripe height="100" @sort-change="handleSortChange"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" v-if="hasPermi(['trials:readTask:report'])" />
<!-- 受试者编号 -->
<el-table-column prop="SubjectCode" min-width="100" :label="$t('trials:reviewTrack:table:subjectCode')"
show-overflow-tooltip sortable="custom" />
@ -240,7 +246,7 @@
:loading="downloading" :title="$t('trials:reading:button:uploadImages')" @click="
handleCommand(
'getDownloadSubjectVisitStudyInfo',
scope.row
[scope.row]
)
" />
</template>
@ -431,6 +437,17 @@
width="600px">
<ChatForm :row-data="currentRow" @getList="getList" @close="auditRecordVisible = false" />
</el-dialog>
<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">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
<span>{{ speed }}</span>
<el-progress :percentage="percentage * 1"></el-progress>
</div>
<div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span>
</div>
</el-dialog>
</BaseContainer>
</template>
<script>
@ -445,11 +462,13 @@ import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
import ChatForm from './components/ChatForm'
import { getToken } from '@/utils/auth'
import * as signalR from '@microsoft/signalr'
import { showReadReport, showTumorReport } from '@/api/export'
import { downLoadFile } from '@/utils/stream.js'
import { getAutoCutNextTask } from '@/api/user'
import {
getDownloadSubjectVisitStudyInfo,
VisitImageDownload,
downloadImageSuccess,
} from '@/api/trials.js'
import { openWindow } from "@/utils/splitScreen";
@ -521,6 +540,12 @@ export default {
//
downloading: false,
downloadId: null,
downloadVisible: false,
downloadType: '',
percentage: 0,
downLoadImageCount: 0,
speed: '0KB/s',
multipleSelection: []
}
},
watch: {
@ -538,6 +563,17 @@ export default {
mounted() {
this.trialId = this.$route.query.trialId
this.getTrialCriterionList()
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')
});
},
beforeDestroy() {
if (this.openWindow) {
@ -545,6 +581,42 @@ export default {
}
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClose(done) {
this.downLoadType = 'start'
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.downloadId = null
this.speed = '0KB/s'
done()
},
generate() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
async onUploadProgress(id, num, type = 'start') {
if (id !== this.downloadId) return false
this.downloadType = type
if (type === 'start') {
this.downloadVisible = true
}
if (type === 'downLoad') {
this.percentage = num
}
if (num >= 100) {
this.downLoadType = 'start'
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.speed = '0KB/s'
}
},
//
handleCommand(command, item, key) {
this[command](item, key)
@ -588,20 +660,24 @@ export default {
}
},
//
async getDownloadSubjectVisitStudyInfo(row) {
async getDownloadSubjectVisitStudyInfo(arr) {
if (this.downloading) return
try {
let data = {
SubjectVisitId: row.SourceSubjectVisitId,
// SubjectVisitId: row.SourceSubjectVisitId,
SubjectVisitIdList: arr.map(item => item.SourceSubjectVisitId),
TrialId: this.$route.query.trialId,
}
this.downloading = true
let res = await getDownloadSubjectVisitStudyInfo(data)
this.downloading = false
if (res.IsSuccess) {
this.downloadId = res.OtherInfo
this.downloadImage(res.Result)
}
this.downloadId = this.generate()
data.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId)
// this.downloading = true
await VisitImageDownload(data)
// this.downloading = false
// if (res.IsSuccess) {
// this.downloadId = res.OtherInfo
// this.downloadImage(res.Result)
// }
} catch (err) {
this.downloading = false
console.log(err)

View File

@ -61,6 +61,11 @@
<el-button type="primary" icon="el-icon-download" @click="handleExport">
{{ $t('common:button:export') }}
</el-button>
<!-- 下载影像 -->
<el-button type="primary" @click="getDownloadSubjectVisitStudyInfo(multipleSelection)"
:disabled="multipleSelection.length <= 0">
{{ $t('trials:inspection:button:downloadImage') }}
</el-button>
</el-form-item>
</el-form>
</template>
@ -69,8 +74,9 @@
<template slot="main-container">
<el-table v-loading="loading" v-adaptive="{ bottomOffset: 60 }" :data="list" stripe height="100"
@sort-change="handleSortByColumn" ref="redManagenentTable"
:default-sort="{ prop: 'CreateTime', order: 'descending' }">
<el-table-column type="index" width="40" />
:default-sort="{ prop: 'CreateTime', order: 'descending' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<!-- <el-table-column type="index" width="40" /> -->
<!-- 受试者编号 -->
<el-table-column prop="SubjectCode" :label="$t('trials:uploadMonitor:table:subjectId')" show-overflow-tooltip
sortable="custom" />
@ -171,7 +177,7 @@
<!--下载影像-->
<el-button circle icon="el-icon-download" :loading="downloading"
:title="$t('trials:reading:button:uploadImages')" @click="
handleCommand('getDownloadSubjectVisitStudyInfo', scope.row)
handleCommand('getDownloadSubjectVisitStudyInfo', [scope.row])
" />
<!--退回-->
<el-button circle icon="el-icon-back" :disabled="![0, 5].includes(scope.row.TaskState)"
@ -218,6 +224,17 @@
</template>
</base-model>
</template>
<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">
<div v-if="downloadType == 'downLoad' || downloadType == 'start'">
<span style="margin-bottom: 5px;">{{ $t('dialog:sattus:downLoading') }}</span>
<span>{{ speed }}</span>
<el-progress :percentage="percentage * 1"></el-progress>
</div>
<div v-else>
<span>{{ $t('dialog:sattus:ziping') }}</span>
</div>
</el-dialog>
</BaseContainer>
</template>
<script>
@ -226,6 +243,7 @@ import Pagination from '@/components/Pagination'
import exportList from './components/exportList.vue'
import { getPatientVisitTaskList } from '@/api/readManagenent.js'
import { getToken } from '@/utils/auth'
import * as signalR from '@microsoft/signalr'
// import { getSystemConfirmedCreiterionList } from "@/api/trials";
import { getTrialCriterionList } from '@/api/trials/reading'
import { showReadReport, showTumorReport } from '@/api/export'
@ -233,6 +251,7 @@ import { downLoadFile } from '@/utils/stream.js'
import { createImageShare, updateImageShare } from '@/api/share'
import {
getDownloadSubjectVisitStudyInfo,
VisitImageDownload,
downloadImageSuccess,
visitImageBack
} from '@/api/trials.js'
@ -314,7 +333,14 @@ export default {
shareId: null,
shareLink: null,
options: [1, 7, 15, 30],
OpenImageShare: false
OpenImageShare: false,
downloadId: null,
downloadVisible: false,
downloadType: '',
percentage: 0,
downLoadImageCount: 0,
speed: '0KB/s',
multipleSelection: []
}
},
created() {
@ -324,7 +350,56 @@ export default {
this.OpenImageShare = JSON.parse(localStorage.getItem('CompanyInfo')).OpenImageShare
}
},
mounted() {
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')
});
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClose(done) {
this.downLoadType = 'start'
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.downloadId = null
this.speed = '0KB/s'
done()
},
generate() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
},
async onUploadProgress(id, num, type = 'start') {
if (id !== this.downloadId) return false
this.downloadType = type
if (type === 'start') {
this.downloadVisible = true
}
if (type === 'downLoad') {
this.percentage = num
}
if (num >= 100) {
this.downLoadType = 'start'
this.percentage = 0
this.downLoadImageCount = 0
this.downloadVisible = false
this.speed = '0KB/s'
}
},
async imageBack(row) {
try {
let confirm = await this.$confirm(this.$t('trials:trials-panel:reading:confirm:imageBack'), '', {
@ -524,20 +599,24 @@ export default {
}
},
//
async getDownloadSubjectVisitStudyInfo(row) {
async getDownloadSubjectVisitStudyInfo(arr) {
if (this.downloading) return
try {
let data = {
SubjectVisitId: row.SourceSubjectVisitId,
// SubjectVisitId: row.SourceSubjectVisitId,
SubjectVisitIdList: arr.map(item => item.SourceSubjectVisitId),
TrialId: this.$route.query.trialId,
}
this.downloading = true
let res = await getDownloadSubjectVisitStudyInfo(data)
this.downloading = false
if (res.IsSuccess) {
this.downloadId = res.OtherInfo
this.downloadImage(res.Result)
}
this.downloadId = this.generate()
data.CurrentNoticeId = this.downloadId
this.onUploadProgress(this.downloadId)
// this.downloading = true
await VisitImageDownload(data)
// this.downloading = false
// if (res.IsSuccess) {
// this.downloadId = res.OtherInfo
// this.downloadImage(res.Result)
// }
} catch (err) {
this.downloading = false
console.log(err)