如果上传影像都是问题影像,此时会显示数量0/0
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-06-19 11:28:14 +08:00
parent fead8b8c8f
commit 6f5d48cdcd
2 changed files with 99 additions and 242 deletions

View File

@ -4,123 +4,63 @@
<span>{{ $t('upload:dicom:title') }}</span> <span>{{ $t('upload:dicom:title') }}</span>
<div class="tip"> <div class="tip">
<i class="el-icon-warning-outline"></i> <i class="el-icon-warning-outline"></i>
<div <div v-html="$t(`upload:dicom:tip:message${isReadingTaskViewInOrder}`)"></div>
v-html="$t(`upload:dicom:tip:message${isReadingTaskViewInOrder}`)"
></div>
</div> </div>
</div> </div>
<!--检查列表--> <!--检查列表-->
<el-table :data="list" style="width: 100%" height="300" :loading="loading"> <el-table :data="list" style="width: 100%" height="300" :loading="loading">
<!--受试者--> <!--受试者-->
<el-table-column <el-table-column prop="SubjectCode" :label="$t('upload:dicom:table:subjectCode')" />
prop="SubjectCode"
:label="$t('upload:dicom:table:subjectCode')"
/>
<!--任务名称--> <!--任务名称-->
<el-table-column <el-table-column prop="TaskBlindName" :label="$t('upload:dicom:table:taskBlindName')" />
prop="TaskBlindName"
:label="$t('upload:dicom:table:taskBlindName')"
/>
<!--原始检查数--> <!--原始检查数-->
<el-table-column <el-table-column prop="OrginalStudyList" :label="$t('upload:dicom:table:orginalStudyListNum')">
prop="OrginalStudyList"
:label="$t('upload:dicom:table:orginalStudyListNum')"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-if="
v-if=" scope.row.OrginalStudyList &&
scope.row.OrginalStudyList && scope.row.OrginalStudyList.length >= 1
scope.row.OrginalStudyList.length >= 1 " type="text" @click="handleOpenDialog(scope.row, 'OrginalStudyList')">
"
type="text"
@click="handleOpenDialog(scope.row, 'OrginalStudyList')"
>
<span>{{ scope.row.OrginalStudyList.length }}</span> <span>{{ scope.row.OrginalStudyList.length }}</span>
</el-button> </el-button>
<span v-else>0</span> <span v-else>0</span>
</template> </template>
</el-table-column> </el-table-column>
<!--后处理检查数--> <!--后处理检查数-->
<el-table-column <el-table-column prop="UploadStudyList" :label="$t('upload:dicom:table:uploadStudyListNum')">
prop="UploadStudyList"
:label="$t('upload:dicom:table:uploadStudyListNum')"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button v-if="
v-if=" scope.row.UploadStudyList && scope.row.UploadStudyList.length >= 1
scope.row.UploadStudyList && scope.row.UploadStudyList.length >= 1 " type="text" @click="handleOpenDialog(scope.row, 'UploadStudyList', true)">
"
type="text"
@click="handleOpenDialog(scope.row, 'UploadStudyList', true)"
>
<span>{{ scope.row.UploadStudyList.length }}</span> <span>{{ scope.row.UploadStudyList.length }}</span>
</el-button> </el-button>
<span v-else>0</span> <span v-else>0</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('common:action:action')" fixed="right" width="180">
:label="$t('common:action:action')"
fixed="right"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="btnBox"> <div class="btnBox">
<!--上传---> <!--上传--->
<form <form id="inputForm" :ref="`uploadForm_${scope.row.Id}`" enctype="multipart/form-data">
id="inputForm"
:ref="`uploadForm_${scope.row.Id}`"
enctype="multipart/form-data"
>
<div class="form-group" style="margin-right: 10px"> <div class="form-group" style="margin-right: 10px">
<div <div :id="`directoryInputWrapper_${scope.row.Id}`" class="btn btn-link file-input">
:id="`directoryInputWrapper_${scope.row.Id}`" <el-button circle icon="el-icon-upload2" :disabled="btnLoading" :loading="btnLoading"
class="btn btn-link file-input" :title="$t('upload:dicom:button:upload')" />
> <input :title="$t('upload:dicom:button:upload')" type="file" :name="`file_${scope.row.VisitTaskId}`"
<el-button :ref="`pathClear_${scope.row.VisitTaskId}`" :disabled="btnLoading" webkitdirectory multiple @change="
circle
icon="el-icon-upload2"
:disabled="btnLoading"
:loading="btnLoading"
:title="$t('upload:dicom:button:upload')"
/>
<input
:title="$t('upload:dicom:button:upload')"
type="file"
:name="`file_${scope.row.VisitTaskId}`"
:ref="`pathClear_${scope.row.VisitTaskId}`"
:disabled="btnLoading"
webkitdirectory
multiple
@change="
($event) => beginScanFiles($event, scope.row.VisitTaskId) ($event) => beginScanFiles($event, scope.row.VisitTaskId)
" " />
/>
</div> </div>
</div> </div>
</form> </form>
<!--预览---> <!--预览--->
<el-button <el-button circle icon="el-icon-view" :disabled="!scope.row.UploadStudyList ||
circle scope.row.UploadStudyList.length <= 0
icon="el-icon-view" " @click.stop="handleViewReadingImages(scope.row)" :title="$t('upload:dicom:button:preview')" />
:disabled="
!scope.row.UploadStudyList ||
scope.row.UploadStudyList.length <= 0
"
@click.stop="handleViewReadingImages(scope.row)"
:title="$t('upload:dicom:button:preview')"
/>
<!--删除---> <!--删除--->
<el-button <el-button circle :disabled="!scope.row.UploadStudyList ||
circle scope.row.UploadStudyList.length <= 0 ||
:disabled=" scope.row.ReadingTaskState === 2
!scope.row.UploadStudyList || " icon="el-icon-delete" :title="$t('upload:dicom:button:delete')" @click.stop="remove(scope.row)" />
scope.row.UploadStudyList.length <= 0 ||
scope.row.ReadingTaskState === 2
"
icon="el-icon-delete"
:title="$t('upload:dicom:button:delete')"
@click.stop="remove(scope.row)"
/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -134,38 +74,19 @@
<form id="inputForm" ref="uploadForm" enctype="multipart/form-data"> <form id="inputForm" ref="uploadForm" enctype="multipart/form-data">
<div class="form-group"> <div class="form-group">
<div id="directoryInputWrapper" class="btn btn-link file-input"> <div id="directoryInputWrapper" class="btn btn-link file-input">
<el-button <el-button type="primary" :disabled="btnLoading" :loading="btnLoading" size="mini">
type="primary"
:disabled="btnLoading"
:loading="btnLoading"
size="mini"
>
{{ $t('upload:dicom:button:batchUpload') }} {{ $t('upload:dicom:button:batchUpload') }}
</el-button> </el-button>
<input <input type="file" name="file" ref="pathClear" :disabled="btnLoading" webkitdirectory multiple title=""
type="file" @change="beginScanFiles($event)" />
name="file"
ref="pathClear"
:disabled="btnLoading"
webkitdirectory
multiple
title=""
@change="beginScanFiles($event)"
/>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<!--上传列表--> <!--上传列表-->
<el-table <el-table ref="dicomFilesTable" v-adaptive="{ bottomOffset: 80 }" height="100" :data="uploadQueues"
ref="dicomFilesTable" class="dicomFiles-table" @selection-change="handleSelectionChange">
v-adaptive="{ bottomOffset: 80 }"
height="100"
:data="uploadQueues"
class="dicomFiles-table"
@selection-change="handleSelectionChange"
>
<el-table-column type="index" width="40" /> <el-table-column type="index" width="40" />
<el-table-column min-width="200" show-overflow-tooltip> <el-table-column min-width="200" show-overflow-tooltip>
<template slot="header"> <template slot="header">
@ -182,28 +103,21 @@
<div style="line-height: 15px"> <div style="line-height: 15px">
<div> <div>
<div> <div>
<span v-if="scope.row.dicomInfo.accNumber" <span v-if="scope.row.dicomInfo.accNumber"><span style="font-weight: 500">Acc:</span>
><span style="font-weight: 500">Acc:</span> {{ scope.row.dicomInfo.accNumber }}</span>
{{ scope.row.dicomInfo.accNumber }}</span
>
<span v-else style="color: #f44336">N/A</span> <span v-else style="color: #f44336">N/A</span>
</div> </div>
<div style="display: inline-block; margin-right: 2px"> <div style="display: inline-block; margin-right: 2px">
<span v-if="scope.row.dicomInfo.modality.length > 0"> <span v-if="scope.row.dicomInfo.modality.length > 0">
{{ scope.row.dicomInfo.modality.join('、') }},</span {{ scope.row.dicomInfo.modality.join('、') }},</span>
>
<span v-else style="color: #f44336">N/A,</span> <span v-else style="color: #f44336">N/A,</span>
</div> </div>
<div style="display: inline-block; margin-right: 2px"> <div style="display: inline-block; margin-right: 2px">
<span v-if="scope.row.seriesList.length" <span v-if="scope.row.seriesList.length">{{ scope.row.seriesList.length }} Series,</span>
>{{ scope.row.seriesList.length }} Series,</span
>
<span v-else style="color: #f44336">N/A,</span> <span v-else style="color: #f44336">N/A,</span>
</div> </div>
<div style="display: inline-block"> <div style="display: inline-block">
<span v-if="scope.row.fileList.length" <span v-if="scope.row.fileList.length">{{ scope.row.fileList.length }} Instances</span>
>{{ scope.row.fileList.length }} Instances</span
>
<span v-else style="color: #f44336">N/A</span> <span v-else style="color: #f44336">N/A</span>
</div> </div>
</div> </div>
@ -217,8 +131,7 @@
</div> </div>
<div style="display: inline-block"> <div style="display: inline-block">
<span v-if="scope.row.dicomInfo.description"> <span v-if="scope.row.dicomInfo.description">
{{ scope.row.dicomInfo.description }}</span {{ scope.row.dicomInfo.description }}</span>
>
<span v-else style="color: #f44336">N/A</span> <span v-else style="color: #f44336">N/A</span>
</div> </div>
</div> </div>
@ -242,16 +155,12 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div style="line-height: 15px"> <div style="line-height: 15px">
<div> <div>
<span v-if="scope.row.dicomInfo.patientId" <span v-if="scope.row.dicomInfo.patientId"><span style="font-weight: 500">PID: </span>{{
><span style="font-weight: 500">PID: </span scope.row.dicomInfo.patientId }}</span>
>{{ scope.row.dicomInfo.patientId }}</span
>
<span v-else style="color: #f44336">N/A</span> <span v-else style="color: #f44336">N/A</span>
</div> </div>
<div> <div>
<span <span :class="[scope.row.dicomInfo.patientName ? '' : 'colorOfRed']">
:class="[scope.row.dicomInfo.patientName ? '' : 'colorOfRed']"
>
{{ {{
scope.row.dicomInfo.patientName scope.row.dicomInfo.patientName
? scope.row.dicomInfo.patientName ? scope.row.dicomInfo.patientName
@ -260,9 +169,7 @@
</span> </span>
</div> </div>
<div> <div>
<span <span :class="[scope.row.dicomInfo.patientSex ? '' : 'colorOfRed']">
:class="[scope.row.dicomInfo.patientSex ? '' : 'colorOfRed']"
>
{{ {{
scope.row.dicomInfo.patientSex scope.row.dicomInfo.patientSex
? scope.row.dicomInfo.patientSex ? scope.row.dicomInfo.patientSex
@ -270,9 +177,7 @@
}}, }},
</span> </span>
<span <span :class="[scope.row.dicomInfo.patientAge ? '' : 'colorOfRed']">
:class="[scope.row.dicomInfo.patientAge ? '' : 'colorOfRed']"
>
{{ {{
scope.row.dicomInfo.patientAge scope.row.dicomInfo.patientAge
? scope.row.dicomInfo.patientAge ? scope.row.dicomInfo.patientAge
@ -280,11 +185,9 @@
}}, }},
</span> </span>
<span <span :class="[
:class="[ scope.row.dicomInfo.patientBirthDate ? '' : 'colorOfRed',
scope.row.dicomInfo.patientBirthDate ? '' : 'colorOfRed', ]">
]"
>
{{ {{
scope.row.dicomInfo.patientBirthDate scope.row.dicomInfo.patientBirthDate
? scope.row.dicomInfo.patientBirthDate ? scope.row.dicomInfo.patientBirthDate
@ -295,21 +198,14 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('trials:uploadDicomList:table:failedFileCount')" min-width="150"
:label="$t('trials:uploadDicomList:table:failedFileCount')" show-overflow-tooltip>
min-width="150"
show-overflow-tooltip
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-progress <el-progress color="#409eff" :percentage="(
color="#409eff" (scope.row.dicomInfo.uploadFileSize * 100) /
:percentage=" (scope.row.dicomInfo.fileSize ? scope.row.dicomInfo.fileSize : 1)
( ).toFixed(2) * 1
(scope.row.dicomInfo.uploadFileSize * 100) / " />
scope.row.dicomInfo.fileSize
).toFixed(2) * 1
"
/>
<span> <span>
{{ $t('trials:uploadDicomList:table:uploadNow') {{ $t('trials:uploadDicomList:table:uploadNow')
}}{{ scope.row.dicomInfo.failedFileCount }}/{{ }}{{ scope.row.dicomInfo.failedFileCount }}/{{
@ -324,85 +220,52 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('trials:uploadDicomList:table:status')" min-width="140" show-overflow-tooltip>
:label="$t('trials:uploadDicomList:table:status')"
min-width="140"
show-overflow-tooltip
>
<template slot-scope="scope"> <template slot-scope="scope">
<span <span v-if="
v-if=" !scope.row.dicomInfo.failedFileCount &&
!scope.row.dicomInfo.failedFileCount && !scope.row.dicomInfo.isInit
!scope.row.dicomInfo.isInit ">
" {{ $t('trials:uploadDicomList:table:status1') }}</span>
> <span style="color: #409eff" v-else-if="
{{ $t('trials:uploadDicomList:table:status1') }}</span !scope.row.dicomInfo.failedFileCount &&
> scope.row.dicomInfo.isInit &&
<span btnLoading
style="color: #409eff" ">{{ $t('trials:uploadDicomList:table:status2') }}</span>
v-else-if=" <span style="color: #409eff" v-else-if="
!scope.row.dicomInfo.failedFileCount && scope.row.dicomInfo.failedFileCount <
scope.row.dicomInfo.isInit && scope.row.dicomInfo.fileCount && !scope.row.uploadState.record
btnLoading ">{{ $t('trials:uploadDicomList:table:status2') }}</span>
" <span style="color: #2cc368" v-else-if="
>{{ $t('trials:uploadDicomList:table:status2') }}</span scope.row.dicomInfo.failedFileCount ===
> scope.row.dicomInfo.fileCount
<span ">{{ $t('trials:uploadDicomList:table:status3') }}</span>
style="color: #409eff" <span style="color: #f66" v-else-if="
v-else-if=" scope.row.uploadState.record &&
scope.row.dicomInfo.failedFileCount < scope.row.uploadState.record.fileCount === 0
scope.row.dicomInfo.fileCount && !scope.row.uploadState.record ">{{ $t('trials:uploadDicomList:table:status5') }}</span>
"
>{{ $t('trials:uploadDicomList:table:status2') }}</span
>
<span
style="color: #2cc368"
v-else-if="
scope.row.dicomInfo.failedFileCount ===
scope.row.dicomInfo.fileCount
"
>{{ $t('trials:uploadDicomList:table:status3') }}</span
>
<span
style="color: #f66"
v-else-if="
scope.row.uploadState.record &&
scope.row.uploadState.record.fileCount === 0
"
>{{ $t('trials:uploadDicomList:table:status5') }}</span
>
<span style="color: #f66" v-else>{{ <span style="color: #f66" v-else>{{
$t('trials:uploadDicomList:table:Failed') $t('trials:uploadDicomList:table:Failed')
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('trials:uploadDicomList:table:record')" min-width="140" show-overflow-tooltip>
:label="$t('trials:uploadDicomList:table:record')"
min-width="140"
show-overflow-tooltip
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip placement="top" v-if="scope.row.uploadState.record"> <el-tooltip placement="top" v-if="scope.row.uploadState.record">
<div slot="content"> <div slot="content">
<div style="max-height: 500px; overflow-y: auto"> <div style="max-height: 500px; overflow-y: auto">
{{ $t('trials:uploadDicomList:table:Existed') }}: {{ $t('trials:uploadDicomList:table:Existed') }}:
<div v-if="scope.row.uploadState.record.Existed.length"> <div v-if="scope.row.uploadState.record.Existed.length">
<div <div v-for="item of scope.row.uploadState.record.Existed" :key="item"
v-for="item of scope.row.uploadState.record.Existed" style="font-size: 12px; color: #baa72a">
:key="item"
style="font-size: 12px; color: #baa72a"
>
{{ item }} {{ item }}
</div> </div>
</div> </div>
<div v-else>&nbsp;</div> <div v-else>&nbsp;</div>
{{ $t('trials:uploadDicomList:table:Uploaded') }}: {{ $t('trials:uploadDicomList:table:Uploaded') }}:
<div v-if="scope.row.uploadState.record.Uploaded.length"> <div v-if="scope.row.uploadState.record.Uploaded.length">
<div <div v-for="item of scope.row.uploadState.record.Uploaded" :key="item"
v-for="item of scope.row.uploadState.record.Uploaded" style="font-size: 12px; color: #24b837">
:key="item"
style="font-size: 12px; color: #24b837"
>
{{ item }} {{ item }}
</div> </div>
</div> </div>
@ -410,11 +273,8 @@
<br /> <br />
{{ $t('trials:uploadDicomList:table:Failed') }}: {{ $t('trials:uploadDicomList:table:Failed') }}:
<div v-if="scope.row.uploadState.record.Failed.length"> <div v-if="scope.row.uploadState.record.Failed.length">
<div <div v-for="item of scope.row.uploadState.record.Failed" :key="item"
v-for="item of scope.row.uploadState.record.Failed" style="font-size: 12px; color: #f66">
:key="item"
style="font-size: 12px; color: #f66"
>
{{ item }} {{ item }}
</div> </div>
</div> </div>
@ -438,16 +298,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<study-view <study-view v-if="model_cfg.visible" :model_cfg="model_cfg" :IsDicom="true" :bodyPart="bodyPart"
v-if="model_cfg.visible" :modelList="modelList" :isUpload="openIsUpload" :TrialModality="TrialModality" @getList="getList" />
:model_cfg="model_cfg"
:IsDicom="true"
:bodyPart="bodyPart"
:modelList="modelList"
:isUpload="openIsUpload"
:TrialModality="TrialModality"
@getList="getList"
/>
</div> </div>
</template> </template>
<script> <script>
@ -795,7 +647,7 @@ export default {
}) })
var validFilesCount = 0 var validFilesCount = 0
for (var i = 0; i < checkFiles.length; ++i) { for (var i = 0; i < checkFiles.length; ++i) {
;(function (index) { ; (function (index) {
p = p.then(function () { p = p.then(function () {
if ( if (
checkFiles[index].name.toUpperCase().indexOf('DICOMDIR') === -1 checkFiles[index].name.toUpperCase().indexOf('DICOMDIR') === -1
@ -834,6 +686,7 @@ export default {
var studyUid = data.string('x0020000d') var studyUid = data.string('x0020000d')
if (!studyUid) return resolve() if (!studyUid) return resolve()
var pixelDataElement = data.elements.x7fe00010 var pixelDataElement = data.elements.x7fe00010
if (!pixelDataElement && modality !== 'SR') return resolve()
var studyIndex = 0 var studyIndex = 0
while ( while (
studyIndex < scope.uploadQueues.length && studyIndex < scope.uploadQueues.length &&
@ -1279,16 +1132,14 @@ export default {
dicomInfo.failedFileCount++ dicomInfo.failedFileCount++
Record.FileCount++ Record.FileCount++
} else { } else {
let path = `/${params.trialId}/Image/${ let path = `/${params.trialId}/Image/${params.subjectId
params.subjectId }/${params.subjectVisitId}/${dicomInfo.visitTaskId
}/${params.subjectVisitId}/${ }/${scope.getGuid(
dicomInfo.visitTaskId dicomInfo.studyUid +
}/${scope.getGuid(
dicomInfo.studyUid +
v.seriesUid + v.seriesUid +
o.instanceUid + o.instanceUid +
params.trialId params.trialId
)}` )}`
if (scope.isClose) return if (scope.isClose) return
let res = await dcmUpload( let res = await dcmUpload(
{ {
@ -1559,16 +1410,19 @@ export default {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.btnBox, .btnBox,
.form-group { .form-group {
display: flex; display: flex;
align-items: center; align-items: center;
} }
#inputForm .file-input { #inputForm .file-input {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
display: inline-block; display: inline-block;
} }
#inputForm .file-input input[type='file'] { #inputForm .file-input input[type='file'] {
position: absolute; position: absolute;
top: 0; top: 0;
@ -1578,10 +1432,12 @@ export default {
opacity: 0; opacity: 0;
cursor: pointer; cursor: pointer;
} }
.tip { .tip {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
margin-top: 5px; margin-top: 5px;
i { i {
margin: 3px 5px 0 0; margin: 3px 5px 0 0;
} }

View File

@ -276,7 +276,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-progress color="#409eff" :percentage="( <el-progress color="#409eff" :percentage="(
(scope.row.dicomInfo.uploadFileSize * 100) / (scope.row.dicomInfo.uploadFileSize * 100) /
scope.row.dicomInfo.fileSize (scope.row.dicomInfo.fileSize ? scope.row.dicomInfo.fileSize : 1)
).toFixed(2) * 1 ).toFixed(2) * 1
" /> " />
<span> <span>
@ -851,6 +851,7 @@ export default {
var studyUid = data.string('x0020000d') var studyUid = data.string('x0020000d')
if (!studyUid) return resolve() if (!studyUid) return resolve()
var pixelDataElement = data.elements.x7fe00010 var pixelDataElement = data.elements.x7fe00010
if (!pixelDataElement && modality !== 'SR') return resolve()
var studyIndex = 0 var studyIndex = 0
while ( while (
studyIndex < scope.uploadQueues.length && studyIndex < scope.uploadQueues.length &&