Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing Details

uat_us
caiyiling 2024-09-03 18:05:11 +08:00
commit a14f144066
9 changed files with 721 additions and 316 deletions

View File

@ -47,4 +47,20 @@ export function getCRCUploadedStudyInfo(data) {
method: 'post', method: 'post',
data data
}) })
}
// 获取ir阅片和任务列表
export function getSubjectImageDownloadSelectList(data) {
return request({
url: '/DownloadAndUpload/getSubjectImageDownloadSelectList',
method: 'post',
data
})
}
// 获取ir阅片和任务下载文件信息
export function getIRReadingDownloadStudyInfo(data) {
return request({
url: '/DownloadAndUpload/getIRReadingDownloadStudyInfo',
method: 'post',
data
})
} }

View File

@ -0,0 +1,382 @@
<template>
<el-dialog
:visible.sync="visible"
:fullscreen="true"
:close-on-click-modal="false"
:before-close="beforeClose"
class="downloadDicomAndNonedicom"
>
<span slot="title">{{ title }}</span>
<div class="top">
<span>{{ $t('download:top:title') }}</span>
<div class="btnBox">
<el-button
type="primary"
size="mini"
:loading="btnLoading"
v-if="hasDicom"
@click.stop="getIRReadingDownloadStudyInfo('dicom')"
>
{{ $t('download:button:downloadDicom') }}
</el-button>
<el-button
type="primary"
size="mini"
:loading="btnLoading"
v-if="hasNonedicom"
@click.stop="getIRReadingDownloadStudyInfo('noneDicom')"
>
{{ $t('download:button:downloadNonedicom') }}
</el-button>
<el-button
type="primary"
size="mini"
:loading="btnLoading"
@click.stop="getIRReadingDownloadStudyInfo('all')"
>
{{ $t('download:button:downloadAll') }}
</el-button>
</div>
</div>
<!--上传列表@selection-change="handleSelectionChange"-->
<el-table
ref="dicomFilesTable"
v-adaptive="{ bottomOffset: 85 }"
height="100"
:data="list"
class="dicomFiles-table"
@sort-change="handleSortByColumn"
:default-sort="{ prop: 'TaskBlindName', order: 'descending' }"
>
<!-- <el-table-column
type="selection"
width="55"
:selectable="handleSelectable"
/> -->
<el-table-column type="index" width="40" />
<!--受试者-->
<el-table-column
:label="$t('download:table:subjectCode')"
min-width="130"
prop="SubjectCode"
show-overflow-tooltip
/>
<!--任务名称-->
<el-table-column
:label="$t('download:table:taskName')"
min-width="130"
show-overflow-tooltip
prop="TaskBlindName"
sortable="custom"
/>
<!--检查类型-->
<el-table-column
:label="$t('download:table:studyType')"
min-width="130"
show-overflow-tooltip
prop="IsDicom"
sortable="custom"
>
<template slot-scope="scope">
<span>{{ $fd('IsDicom', scope.row.IsDicom) }}</span>
</template>
</el-table-column>
<el-table-column
:label="$t('download:table:orginalStudyListNum')"
min-width="150"
show-overflow-tooltip
>
<template slot-scope="scope">
<el-button
v-if="
(scope.row.IsDicom &&
scope.row.DicomStudyList &&
scope.row.DicomStudyList.length >= 1) ||
(!scope.row.IsDicom &&
scope.row.NoneDicomStudyList &&
scope.row.NoneDicomStudyList.length >= 1)
"
type="text"
@click="handleOpenDialog(scope.row)"
>
<span>{{
scope.row.IsDicom
? scope.row.DicomStudyList.length
: scope.row.NoneDicomStudyList.length
}}</span>
</el-button>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column
:label="$t('common:action:action')"
fixed="right"
width="150"
>
<template slot-scope="scope">
<!--预览--->
<el-button
circle
icon="el-icon-view"
:title="$t('download:button:preview')"
@click.stop="preview(scope.row)"
/>
<!--下载--->
<el-button
circle
icon="el-icon-download"
:title="$t('download:button:download')"
@click.stop="getIRReadingDownloadStudyInfo('one', scope.row)"
/>
</template>
</el-table-column>
</el-table>
<study-view
v-if="model_cfg.visible"
:model_cfg="model_cfg"
:modelList="modelList"
:IsDicom="IsDicom"
/>
</el-dialog>
</template>
<script>
import {
getSubjectImageDownloadSelectList,
getIRReadingDownloadStudyInfo,
} from '@/api/load.js'
import studyView from '@/components/uploadDicomAndNonedicom/study-view.vue'
import store from '@/store'
import { downLoadFile } from '@/utils/stream.js'
let defaultSearchData = () => {
return {
SubjectId: null,
TrialReadingCriterionId: null,
SubjectCode: null,
Asc: false,
SortField: 'TaskBlindName',
}
}
export default {
name: 'downloadDicomAndNonedicom',
components: {
'study-view': studyView,
},
props: {
visible: {
required: true,
type: Boolean,
default: false,
},
SubjectId: {
type: String,
default: '',
},
SubjectCode: {
type: String,
default: '',
},
Criterion: {
type: Object,
default: () => {
return {}
},
},
},
data() {
return {
title: null,
list: [],
searchData: defaultSearchData(),
btnLoading: false,
hasDicom: false,
hasNonedicom: false,
//
model_cfg: {
visible: false,
showClose: true,
width: '1000px',
title: '',
appendToBody: true,
},
modelList: [],
IsDicom: true,
}
},
mounted() {
this.getList()
this.title = `Download Images${this.SubjectCode}${this.Criterion.TrialReadingCriterionName}`
},
beforeDestroy() {
store.dispatch('trials/setUnLock', false)
},
methods: {
beforeClose() {
this.$emit('update:visible', false)
},
//
async getList() {
try {
this.searchData.SubjectId = this.SubjectId
this.searchData.TrialReadingCriterionId =
this.Criterion.TrialReadingCriterionId
this.searchData.SubjectCode = this.SubjectCode
let res = await getSubjectImageDownloadSelectList(this.searchData)
if (res.IsSuccess) {
this.list = res.Result
this.hasDicom = this.list.some((item) => item.IsDicom)
this.hasNonedicom = this.list.some((item) => !item.IsDicom)
}
} catch (err) {
console.log(err)
}
},
//
async getIRReadingDownloadStudyInfo(type, row) {
try {
let data = {
SubjectId: this.SubjectId,
TrialReadingCriterionId: this.Criterion.TrialReadingCriterionId,
SubjectCode: this.SubjectCode,
SubjectVisitIdList: [],
DicomStudyIdList: [],
NoneDicomStudyIdList: [],
}
if (type === 'dicom' || type === 'all') {
this.list.forEach((item) => {
if (item.DicomStudyList && item.DicomStudyList.length > 0) {
data.SubjectVisitIdList.push(item.SourceSubjectVisitId)
let arr = item.DicomStudyList.map((d) => d.Id)
data.DicomStudyIdList = [...data.DicomStudyIdList, ...arr]
}
})
}
if (type === 'noneDicom' || type === 'all') {
this.list.forEach((item) => {
if (
item.NoneDicomStudyIdList &&
item.NoneDicomStudyIdList.length > 0
) {
data.SubjectVisitIdList.push(item.SourceSubjectVisitId)
let arr = item.NoneDicomStudyIdList.map((d) => d.Id)
data.NoneDicomStudyIdList = [...data.NoneDicomStudyIdList, ...arr]
}
})
}
if (type === 'one') {
if (
row.IsDicom &&
row.DicomStudyList &&
row.DicomStudyList.length > 0
) {
data.SubjectVisitIdList.push(row.SourceSubjectVisitId)
let arr = row.DicomStudyList.map((d) => d.Id)
data.DicomStudyIdList = [...data.DicomStudyIdList, ...arr]
}
if (
!row.IsDicom &&
row.NoneDicomStudyIdList &&
row.NoneDicomStudyIdList.length > 0
) {
data.SubjectVisitIdList.push(row.SourceSubjectVisitId)
let arr = row.NoneDicomStudyIdList.map((d) => d.Id)
data.NoneDicomStudyIdList = [...data.NoneDicomStudyIdList, ...arr]
}
}
this.btnLoading = true
let res = await getIRReadingDownloadStudyInfo(data)
this.btnLoading = false
if (res.IsSuccess) {
this.downloadImage(res.Result)
}
} catch (err) {
this.btnLoading = false
console.log(err)
}
},
//
async downloadImage(data) {
try {
let { files, name, fileType } = this.formatDownloadFile(data)
await downLoadFile(files, name, 'zip')
} catch (err) {
console.log(err)
}
},
//
formatDownloadFile(data) {
let files = [],
name = `${data.SubjectCode}_${data.VisitName}.zip`
if (data.StudyList && data.StudyList.length > 0) {
let StudyList = data.StudyList
StudyList.forEach((study) => {
if (study.SeriesList.length > 0) {
study.SeriesList.forEach((series) => {
if (series.InstancePathList.length > 0) {
series.InstancePathList.forEach((instance) => {
let fileName = instance.Path.split('/').pop()
let obj = {
name: `${data.SubjectCode}_${data.VisitName}/${this.$fd(
'IsDicom',
true
)}/${study.StudyCode}/${fileName}`,
path: this.OSSclientConfig.basePath + instance.Path,
}
files.push(obj)
})
}
})
}
})
}
if (data.NoneDicomStudyList && data.NoneDicomStudyList.length > 0) {
let NoneDicomStudyList = data.NoneDicomStudyList
//
NoneDicomStudyList.forEach((study) => {
if (study.FileList.length > 0) {
study.FileList.forEach((item) => {
let obj = {
name: `${data.SubjectCode}_${data.VisitName}/${this.$fd(
'IsDicom',
false
)}/${study.StudyCode}/${item.FileName}`,
url: this.OSSclientConfig.basePath + item.Path,
}
files.push(obj)
})
}
})
}
return { files, name }
},
handleOpenDialog(item) {
this.model_cfg.title = `${item.SubejctCode || ''}>${item.TaskBlindName}`
if (item.IsDicom) {
this.modelList = item.DicomStudyList
} else {
this.modelList = item.NoneDicomStudyList
}
this.IsDicom = item.IsDicom
this.model_cfg.visible = true
},
//
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" scoped>
.top {
display: flex;
align-items: center;
justify-content: space-between;
margin: 10px 0;
}
</style>

View File

@ -0,0 +1,131 @@
<template>
<base-model :config="model_cfg">
<div slot="dialog-body">
<el-table :data="modelList" style="width: 100%" height="300">
<!--检查编号-->
<el-table-column
prop="StudyCode"
:label="$t('trials:uploadImage:table:StudyCode')"
/>
<!--检查类型-->
<el-table-column
prop="ModalityForEdit"
:label="$t('trials:uploadImage:table:ModalityForEdit')"
v-if="IsDicom"
/>
<!--检查模态-->
<el-table-column
prop="Modalities"
:label="$t('trials:uploadImage:table:Modalities')"
v-if="IsDicom"
/>
<!--检查部位-->
<el-table-column
prop="BodyPartForEdit"
:label="$t('trials:uploadImage:table:BodyPartForEdit')"
v-if="IsDicom"
/>
<!--序列数量-->
<el-table-column
prop="SeriesCount"
:label="$t('trials:uploadImage:table:SeriesCount')"
v-if="IsDicom"
/>
<!--图像数量-->
<el-table-column
prop="InstanceCount"
:label="$t('trials:uploadImage:table:InstanceCount')"
v-if="IsDicom"
/>
<!--检查时间-->
<el-table-column
prop="StudyTime"
:label="$t('trials:uploadImage:table:StudyTime')"
v-if="IsDicom"
min-width="130"
/>
<!--检查模态-->
<el-table-column
prop="Modality"
:label="$t('trials:uploadImage:table:Modalities')"
v-if="!IsDicom"
/>
<!--检查部位-->
<el-table-column
prop="BodyPart"
:label="$t('trials:uploadImage:table:BodyPartForEdit')"
v-if="!IsDicom"
/>
<!--文件数量-->
<el-table-column
prop="FileCount"
:label="$t('trials:uploadImage:table:FileCount')"
v-if="!IsDicom"
/>
<!--检查时间-->
<el-table-column
prop="ImageDate"
:label="$t('trials:uploadImage:table:StudyTime')"
v-if="!IsDicom"
min-width="130"
/>
<el-table-column
:label="$t('common:action:action')"
fixed="right"
width="80"
>
<template slot-scope="scope">
<!--预览--->
<el-button
circle
icon="el-icon-view"
:title="$t('trials:uploadImage:button:download')"
@click.stop="preview(scope.row)"
/>
</template>
</el-table-column>
</el-table>
</div>
</base-model>
</template>
<script>
import baseModel from '@/components/BaseModel'
import { getToken } from '@/utils/auth'
export default {
name: 'studyView',
props: {
model_cfg: {
type: Object,
default: () => {
return {}
},
},
modelList: {
type: Array,
default: () => {
return []
},
},
IsDicom: {
required: true,
type: Boolean,
default: true,
},
},
components: {
'base-model': baseModel,
},
methods: {
//
preview(row) {
var token = getToken()
const routeData = this.$router.resolve({
path: `/showdicom?studyId=${row.Id}&TokenKey=${token}&type=Study`,
})
window.open(routeData.href, '_blank')
},
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -102,7 +102,6 @@
import uploadList from "./components/upload-list.vue"; import uploadList from "./components/upload-list.vue";
import studyView from "./components/study-view.vue"; import studyView from "./components/study-view.vue";
import { getSubjectImageUploadList, deleteTaskStudy } from "@/api/load.js"; import { getSubjectImageUploadList, deleteTaskStudy } from "@/api/load.js";
import { downloadImage } from "@/utils/uploadZip.js";
import store from "@/store"; import store from "@/store";
export default { export default {
name: "uploadImage", name: "uploadImage",
@ -591,7 +590,7 @@ export default {
files.push(obj); files.push(obj);
} }
store.dispatch("trials/setUnLock", true); store.dispatch("trials/setUnLock", true);
let res = await downloadImage(zipName, files); // let res = await downloadImage(zipName, files);
store.dispatch("trials/setUnLock", false); store.dispatch("trials/setUnLock", false);
}, },
}, },

View File

@ -1,9 +1,10 @@
import streamSaver from "streamsaver"; import streamSaver from "streamsaver";
import "streamsaver/examples/zip-stream.js"; import "streamsaver/examples/zip-stream.js";
import store from '@/store'
// 下载文件并压缩 // 下载文件并压缩
function zipFiles(zipName, files) { function zipFiles(zipName, files) {
console.log("同步下载打包开始时间:" + new Date()); console.log("同步下载打包开始时间:" + new Date());
store.dispatch('trials/setUnLock', true)
// 创建压缩文件输出流 // 创建压缩文件输出流
const zipFileOutputStream = streamSaver.createWriteStream(zipName); const zipFileOutputStream = streamSaver.createWriteStream(zipName);
// 创建下载文件流 // 创建下载文件流
@ -28,15 +29,21 @@ function zipFiles(zipName, files) {
// 开始下载 // 开始下载
readableZipStream readableZipStream
.pipeTo(zipFileOutputStream) .pipeTo(zipFileOutputStream)
.then(() => console.log("同步下载打包结束时间:" + new Date())); .then(() => {
console.log("同步下载打包结束时间:" + new Date());
store.dispatch('trials/setUnLock', false)
});
} }
} }
// 下载文件并修改名称 // 下载文件并修改名称
async function updateFile(file, name) { async function updateFile(file, name) {
try { try {
store.dispatch('trials/setUnLock', true)
const fileOutputStream = streamSaver.createWriteStream(name); const fileOutputStream = streamSaver.createWriteStream(name);
let res = await fetch(file); let res = await fetch(file);
res.body.pipeTo(fileOutputStream); res.body.pipeTo(fileOutputStream).then(() => {
store.dispatch('trials/setUnLock', true)
});
} catch (err) { } catch (err) {
console.log(err) console.log(err)
} }

View File

@ -1,168 +0,0 @@
import Vue from 'vue';
import store from "@/store";
import {
requestPackageAndAnonymizImage,
} from "@/api/load.js";
import streamSaver from "streamsaver";
import "streamsaver/examples/zip-stream.js"
let flag = {};
export const resetFlag = () => {
flag = {};
store.state.trials.uploadTip = null;
if (store.state.trials.timer) {
clearInterval(store.state.trials.timer);
store.state.trials.timer = null;
}
store.dispatch("trials/setUnLock", false);
}
export const downloadImage = async (id, id2, IsDicom = true) => {
// if (flag[`${id2}_${IsDicom}`]) return Vue.prototype.$message.warning(Vue.prototype.$t('trials:upload:tip:uploading'));
if (flag[`${id2}_${IsDicom}`]) return false;
flag[`${id2}_${IsDicom}`] = true
try {
let params = {
TrialId: id,
SubjectVisitId: id2,
IsDicom: IsDicom
}
store.dispatch("trials/setUnLock", true);
let res = await requestPackageAndAnonymizImage(params);
if (res.IsSuccess) {
if (!res.Result) {
flag[`${id2}_${IsDicom}`] = false;
// Vue.prototype.$message.warning(Vue.prototype.$t("trials:upload:message:not"))
let message = Vue.prototype.$t('trials:upload:tip:uploading').replace("xxx", res.OtherInfo.FileName);
store.state.trials.uploadTip = message;
if (!store.state.trials.timer) {
store.state.trials.timer = setInterval(() => {
downloadImage(id, id2, IsDicom);
}, 2000);
}
return false;
}
if (store.state.trials.timer) {
clearInterval(store.state.trials.timer);
store.state.trials.timer = null;
}
let fileName = res.Result.split("/").pop();
let href = Vue.prototype.OSSclientConfig.basePath + res.Result;
if (fileName !== res.OtherInfo.FileName) {
let message = Vue.prototype.$t('trials:upload:tip:uploading').replace("xxx", res.OtherInfo.FileName);
store.state.trials.uploadTip = message;
// Vue.prototype.$message.success(Vue.prototype.$t("trials:upload:message:startUpload"));
return download(href, res.OtherInfo.FileName, { id2, IsDicom });
}
let a = document.createElement("a");
a.download = res.OtherInfo.FileName;
a.href = href;
a.click();
URL.revokeObjectURL(href);
let timer = setTimeout(() => {
a = null;
href = null;
timer = null;
}, 500)
store.state.trials.uploadTip = null;
return true;
} else {
flag[`${id2}_${IsDicom}`] = false;
return false;
}
} catch (err) {
flag[`${id2}_${IsDicom}`] = false;
console.log(err);
}
};
export const fileDownload = (content, filename) => {
const eleLink = document.createElement("a");
eleLink.download = filename;
eleLink.style.display = "none";
const blob = new Blob([content]);
eleLink.href = URL.createObjectURL(blob);
document.body.appendChild(eleLink);
eleLink.click();
document.body.removeChild(eleLink);
};
let download = async (downloadUrl, downloadFileName, res) => {
const blob = await getBlob(downloadUrl);
flag[`${res.id2}_${res.IsDicom}`] = false;
store.state.trials.uploadTip = null;
store.dispatch("trials/setUnLock", false);
saveAsB(blob, downloadFileName);
return true;
}
let getBlob = (url) => {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
xhr.onload = () => {
if (xhr.status === 200) {
resolve(xhr.response);
} else {
reject(new Error(`Request failed with status ${xhr.status}`));
}
};
xhr.onerror = () => {
reject(new Error('Request failed'));
};
xhr.send();
});
}
let saveAsB = (blob, filename) => {
const link = document.createElement('a');
const body = document.body;
link.href = window.URL.createObjectURL(blob);
link.download = filename;
// hide the link
link.style.display = 'none';
body.appendChild(link);
link.click();
body.removeChild(link);
window.URL.revokeObjectURL(link.href);
}
// 前端流式打包下载
const handleBatchDown = async (item, zip) => {
return new Promise((resolve) => {
console.log("同步下载打包开始时间:" + new Date());
// 创建压缩文件输出流
const zipFileOutputStream = streamSaver.createWriteStream(zipName);
// 创建下载文件流
const fileIterator = files.values();
const readableZipStream = new window.ZIP({
async pull(ctrl) {
const fileInfo = fileIterator.next();
if (fileInfo.done) {//迭代终止
ctrl.close();
} else {
const { name, url } = fileInfo.value;
return fetch(url).then(res => {
ctrl.enqueue({
name,
stream: () => res.body
})
})
}
}
});
if (window.WritableStream && readableZipStream.pipeTo) {
// 开始下载
readableZipStream
.pipeTo(zipFileOutputStream)
.then(() => { console.log("同步下载打包结束时间:" + new Date()); resolve(true) })
} else {
resolve(false);
}
})
};

View File

@ -18,7 +18,7 @@
v-if=" v-if="
(isReadingTaskViewInOrder === 1 || (isReadingTaskViewInOrder === 1 ||
isReadingTaskViewInOrder === 2) && isReadingTaskViewInOrder === 2) &&
TrialReadingCriterionId === item.TrialReadingCriterionId TrialReadingCriterionId === item.TrialReadingCriterionId
" "
> >
<div slot="search-container"> <div slot="search-container">
@ -41,7 +41,7 @@
icon="el-icon-search" icon="el-icon-search"
@click="handleSearch" @click="handleSearch"
> >
{{ $t("common:button:search") }} {{ $t('common:button:search') }}
</el-button> </el-button>
<!-- 重置 --> <!-- 重置 -->
<el-button <el-button
@ -49,7 +49,7 @@
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="handleReset" @click="handleReset"
> >
{{ $t("common:button:reset") }} {{ $t('common:button:reset') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -75,10 +75,11 @@
scope.row.UrgentColor === 1 scope.row.UrgentColor === 1
? 'danger' ? 'danger'
: scope.row.UrgentColor === 2 : scope.row.UrgentColor === 2
? 'warning' ? 'warning'
: 'primary' : 'primary'
" "
>{{ $fd("YesOrNo", scope.row.IsUrgent) }}</el-tag> >{{ $fd('YesOrNo', scope.row.IsUrgent) }}</el-tag
>
</template> </template>
</el-table-column> </el-table-column>
<!-- 受试者编号 --> <!-- 受试者编号 -->
@ -113,10 +114,11 @@
scope.row.UrgentColor === 1 scope.row.UrgentColor === 1
? '#F56C6C' ? '#F56C6C'
: scope.row.UrgentColor === 2 : scope.row.UrgentColor === 2
? '#E6A23C' ? '#E6A23C'
: '#409EFF', : '#409EFF',
}" }"
>{{ scope.row.UrgentCount }}</span> >{{ scope.row.UrgentCount }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<!-- 建议完成时间 --> <!-- 建议完成时间 -->
@ -130,7 +132,7 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.SuggesteFinishedTime.split(":")[0] + ":00:00" }} {{ scope.row.SuggesteFinishedTime.split(':')[0] + ':00:00' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -146,8 +148,8 @@
:title=" :title="
scope.row.ExistReadingApply scope.row.ExistReadingApply
? $t( ? $t(
'trials:pendingReadingTasks:button:ExistReadingApply' 'trials:pendingReadingTasks:button:ExistReadingApply'
) )
: $t('trials:pendingReadingTasks:button:review') : $t('trials:pendingReadingTasks:button:review')
" "
icon="el-icon-edit-outline" icon="el-icon-edit-outline"
@ -157,8 +159,8 @@
<el-button <el-button
v-if=" v-if="
item.CriterionType === 0 && item.CriterionType === 0 &&
item.ImageUploadEnum > 0 && item.ImageUploadEnum > 0 &&
item.IsReadingTaskViewInOrder > 0 item.IsReadingTaskViewInOrder > 0
" "
v-hasPermi="['role:ir']" v-hasPermi="['role:ir']"
circle circle
@ -170,8 +172,8 @@
<el-button <el-button
v-if=" v-if="
item.CriterionType === 0 && item.CriterionType === 0 &&
item.ImageDownloadEnum === 1 && item.ImageDownloadEnum === 1 &&
item.IsReadingTaskViewInOrder > 0 item.IsReadingTaskViewInOrder > 0
" "
v-hasPermi="['role:ir']" v-hasPermi="['role:ir']"
circle circle
@ -194,7 +196,7 @@
<div <div
v-else-if=" v-else-if="
isReadingTaskViewInOrder === 0 && isReadingTaskViewInOrder === 0 &&
TrialReadingCriterionId === item.TrialReadingCriterionId TrialReadingCriterionId === item.TrialReadingCriterionId
" "
> >
<el-descriptions :column="2" border style="width: 800px"> <el-descriptions :column="2" border style="width: 800px">
@ -248,48 +250,64 @@
:disabled=" :disabled="
randomReadInfo.UnReadTaskCount + randomReadInfo.UnReadTaskCount +
randomReadInfo.UnReadJudgeTaskCount === randomReadInfo.UnReadJudgeTaskCount ===
0 0
" "
@click="handleOutOfOrderReading" @click="handleOutOfOrderReading"
> >
{{ $t("trials:pendingReadingTasks:button:beginRandomReview") }} {{ $t('trials:pendingReadingTasks:button:beginRandomReview') }}
</el-button> </el-button>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<upload-image <!-- <upload-image
v-if="uploadImageVisible" v-if="uploadImageVisible"
:visible.sync="uploadImageVisible" :visible.sync="uploadImageVisible"
:subject-id="uploadSubjectId" :subject-id="uploadSubjectId"
:criterion="uploadTrialCriterion" :criterion="uploadTrialCriterion"
:status="uploadStatus" :status="uploadStatus"
@getList="getList" @getList="getList"
/> -->
<upload-dicom-and-nonedicom
v-if="uploadImageVisible"
:visible.sync="uploadImageVisible"
/>
<download-dicom-and-nonedicom
v-if="downloadImageVisible"
:SubjectId="uploadSubjectId"
:SubjectCode="uploadSubjectCode"
:Criterion="uploadTrialCriterion"
:visible.sync="downloadImageVisible"
/> />
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
import { import { getIRUnReadSubjectTaskList, verifyReadingRestTime } from '@/api/trials'
getIRUnReadSubjectTaskList,
verifyReadingRestTime
} from '@/api/trials'
import { getTrialCriterionList } from '@/api/trials/reading' import { getTrialCriterionList } from '@/api/trials/reading'
import { clearSkipReadingCache } from '@/api/reading' import { clearSkipReadingCache } from '@/api/reading'
import BaseContainer from '@/components/BaseContainer' import BaseContainer from '@/components/BaseContainer'
import uploadImage from '@/components/uploadImage' import uploadImage from '@/components/uploadImage'
import uploadDicomAndNonedicom from '@/components/uploadDicomAndNonedicom'
import downloadDicomAndNonedicom from '@/components/downloadDicomAndNonedicom'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
SubjectCode: '', SubjectCode: '',
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
} }
} }
export default { export default {
name: 'ReadingTaskList', name: 'ReadingTaskList',
components: { BaseContainer, Pagination, 'upload-image': uploadImage }, components: {
BaseContainer,
Pagination,
'upload-image': uploadImage,
'upload-dicom-and-nonedicom': uploadDicomAndNonedicom,
'download-dicom-and-nonedicom': downloadDicomAndNonedicom,
},
data() { data() {
return { return {
searchData: searchDataDefault(), searchData: searchDataDefault(),
@ -308,10 +326,12 @@ export default {
openWindow: null, openWindow: null,
// //
downloadImageVisible: false,
uploadImageVisible: false, uploadImageVisible: false,
uploadSubjectId: null, uploadSubjectId: null,
uploadSubjectCode: null,
uploadTrialCriterion: {}, uploadTrialCriterion: {},
uploadStatus: 'upload' uploadStatus: 'upload',
} }
}, },
watch: { watch: {
@ -319,7 +339,7 @@ export default {
if (v) { if (v) {
this.getList() this.getList()
} }
} },
}, },
mounted() { mounted() {
window.addEventListener('message', this.receiveMsg) window.addEventListener('message', this.receiveMsg)
@ -335,10 +355,11 @@ export default {
methods: { methods: {
// //
openUploadImage(item, trialCriterion, status) { openUploadImage(item, trialCriterion, status) {
this.uploadSubjectCode = item.SubjectCode
this.uploadSubjectId = item.SubjectId this.uploadSubjectId = item.SubjectId
this.uploadTrialCriterion = trialCriterion this.uploadTrialCriterion = trialCriterion
this.uploadStatus = status this.uploadStatus = status
this.uploadImageVisible = true this[`${status}ImageVisible`] = true
}, },
async getTrialCriterionList() { async getTrialCriterionList() {
try { try {
@ -360,8 +381,7 @@ export default {
this.isRender = false this.isRender = false
const res = await getIRUnReadSubjectTaskList(this.searchData) const res = await getIRUnReadSubjectTaskList(this.searchData)
if (res.IsSuccess) { if (res.IsSuccess) {
this.isReadingTaskViewInOrder = this.isReadingTaskViewInOrder = res.OtherInfo.IsReadingTaskViewInOrder
res.OtherInfo.IsReadingTaskViewInOrder
this.readingTool = res.OtherInfo.ReadingTool this.readingTool = res.OtherInfo.ReadingTool
this.criterionType = res.OtherInfo.CriterionType this.criterionType = res.OtherInfo.CriterionType
if (res.OtherInfo.IsReadingTaskViewInOrder) { if (res.OtherInfo.IsReadingTaskViewInOrder) {
@ -395,7 +415,10 @@ export default {
await clearSkipReadingCache() await clearSkipReadingCache()
await verifyReadingRestTime() await verifyReadingRestTime()
this.loading = false this.loading = false
window.localStorage.setItem('TrialReadingCriterionId', this.TrialReadingCriterionId) window.localStorage.setItem(
'TrialReadingCriterionId',
this.TrialReadingCriterionId
)
var token = getToken() var token = getToken()
var path = '' var path = ''
if (this.readingTool === 0) { if (this.readingTool === 0) {
@ -420,7 +443,10 @@ export default {
await clearSkipReadingCache() await clearSkipReadingCache()
await verifyReadingRestTime() await verifyReadingRestTime()
this.loading = false this.loading = false
window.localStorage.setItem('TrialReadingCriterionId', this.TrialReadingCriterionId) window.localStorage.setItem(
'TrialReadingCriterionId',
this.TrialReadingCriterionId
)
var token = getToken() var token = getToken()
var path = '' var path = ''
if (this.readingTool === 0) { if (this.readingTool === 0) {
@ -450,7 +476,7 @@ export default {
this.searchData.SortField = column.prop this.searchData.SortField = column.prop
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1
this.getList() this.getList()
} },
} },
} }
</script> </script>

View File

@ -34,7 +34,7 @@
type="text" type="text"
@click="handleDownloadTpl" @click="handleDownloadTpl"
> >
{{ $t("trials:readingPeriod:cd:title:downloadTpl") }} {{ $t('trials:readingPeriod:cd:title:downloadTpl') }}
</el-button> </el-button>
</el-col> </el-col>
</el-form-item> </el-form-item>
@ -53,7 +53,7 @@
" "
> >
<el-button type="primary" style="width: 56px" size="small"> <el-button type="primary" style="width: 56px" size="small">
{{ $t("trials:uploadClinicalData:button:selectFile") }} {{ $t('trials:uploadClinicalData:button:selectFile') }}
</el-button> </el-button>
<input <input
type="file" type="file"
@ -72,7 +72,7 @@
@change="beginScanFiles($event)" @change="beginScanFiles($event)"
/> />
<span style="margin-left: 10px">{{ <span style="margin-left: 10px">{{
$t("trials:attachment:message:pdf") $t('trials:attachment:message:pdf')
}}</span> }}</span>
</div> </div>
</div> </div>
@ -139,7 +139,7 @@
type="primary" type="primary"
@click="close" @click="close"
> >
{{ $t("common:button:cancel") }} {{ $t('common:button:cancel') }}
</el-button> </el-button>
<!-- 保存 --> <!-- 保存 -->
<el-button <el-button
@ -148,7 +148,7 @@
:loading="btnLoading" :loading="btnLoading"
@click="save" @click="save"
> >
{{ $t("common:button:save") }} {{ $t('common:button:save') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</div> </div>
@ -159,23 +159,23 @@ import {
getTrialClinicalDataSelect, getTrialClinicalDataSelect,
addOrUpdateReadingClinicalData, addOrUpdateReadingClinicalData,
addOrUpdateConsistencyAnalysisReadingClinicalData, addOrUpdateConsistencyAnalysisReadingClinicalData,
} from "@/api/trials"; } from '@/api/trials'
import { fileDownload } from "@/utils/uploadZip.js"; import { downLoadFile } from '@/utils/stream.js'
export default { export default {
name: "AddOrUpdateClinicalData", name: 'AddOrUpdateClinicalData',
props: { props: {
trialReadingCriterionId: { trialReadingCriterionId: {
type: String, type: String,
default: "", default: '',
}, },
data: { data: {
type: Object, type: Object,
default() { default() {
return {}; return {}
}, },
}, },
type: { type: {
default: "readingPeriod", default: 'readingPeriod',
}, },
option: { option: {
default: () => [], default: () => [],
@ -185,13 +185,13 @@ export default {
data() { data() {
return { return {
fileList: [], fileList: [],
faccept: [".pdf"], faccept: ['.pdf'],
form: { form: {
Id: "", Id: '',
TrialId: "", TrialId: '',
SubjectId: "", SubjectId: '',
ReadingId: "", ReadingId: '',
ClinicalDataTrialSetId: "", ClinicalDataTrialSetId: '',
IsVisist: true, IsVisist: true,
AddFileList: [], AddFileList: [],
DeleteFileIds: [], DeleteFileIds: [],
@ -201,8 +201,8 @@ export default {
ClinicalDataTrialSetId: [ ClinicalDataTrialSetId: [
{ {
required: true, required: true,
message: this.$t("common:ruleMessage:select"), message: this.$t('common:ruleMessage:select'),
trigger: ["blur", "change"], trigger: ['blur', 'change'],
}, },
], ],
}, },
@ -211,194 +211,190 @@ export default {
clinicalDatas: [], clinicalDatas: [],
pendingUploadList: [], pendingUploadList: [],
pendingDeleteList: [], pendingDeleteList: [],
currentTpl: { id: "", isExist: false }, currentTpl: { id: '', isExist: false },
}; }
}, },
mounted() { mounted() {
this.initForm(); this.initForm()
}, },
methods: { methods: {
// //
handleUploadFile(row) { handleUploadFile(row) {
let href = this.OSSclientConfig.basePath + row.Path; let href = this.OSSclientConfig.basePath + row.Path
let name = row.FileName; let name = row.FileName
fileDownload(href, name); downLoadFile(href, name)
}, },
async initForm() { async initForm() {
if (this.type === "readingPeriod") { if (this.type === 'readingPeriod') {
await this.getClinicalDatas(); await this.getClinicalDatas()
} else { } else {
this.clinicalDatas = this.option; this.clinicalDatas = this.option
} }
if (Object.keys(this.data).length > 0) { if (Object.keys(this.data).length > 0) {
for (const k in this.form) { for (const k in this.form) {
if (this.data.hasOwnProperty(k)) { if (this.data.hasOwnProperty(k)) {
this.form[k] = this.data[k]; this.form[k] = this.data[k]
} }
} }
this.handleClinicalDataSetChange(this.form.ClinicalDataTrialSetId); this.handleClinicalDataSetChange(this.form.ClinicalDataTrialSetId)
this.fileList = this.form.FileList.concat(); this.fileList = this.form.FileList.concat()
} }
}, },
save() { save() {
this.$refs.clinicalDataForm.validate((valid) => { this.$refs.clinicalDataForm.validate((valid) => {
if (!valid) return; if (!valid) return
if (this.fileList.length === 0) { if (this.fileList.length === 0) {
// //
this.$alert(this.$t("trials:readingPeriod:cd:message:uploadFile")); this.$alert(this.$t('trials:readingPeriod:cd:message:uploadFile'))
return; return
} }
this.pendingUploadList = []; this.pendingUploadList = []
for (let i = 0; i < this.fileList.length; ++i) { for (let i = 0; i < this.fileList.length; ++i) {
if (this.fileList[i].Status === 0) { if (this.fileList[i].Status === 0) {
this.pendingUploadList.push(this.fileList[i].Files); this.pendingUploadList.push(this.fileList[i].Files)
} }
} }
if (this.pendingUploadList.length > 0) { if (this.pendingUploadList.length > 0) {
this.uploadFilesAndSave(); this.uploadFilesAndSave()
} else { } else {
this.saveClinicalData(); this.saveClinicalData()
} }
}); })
}, },
uploadFilesAndSave() { uploadFilesAndSave() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
this.form.AddFileList = []; this.form.AddFileList = []
for (var i = 0; i < this.pendingUploadList.length; ++i) { for (var i = 0; i < this.pendingUploadList.length; ++i) {
// const file = await this.convertBase64ToBlob(this.pendingUploadList[i]) // const file = await this.convertBase64ToBlob(this.pendingUploadList[i])
const file = await this.fileToBlob(this.pendingUploadList[i]); const file = await this.fileToBlob(this.pendingUploadList[i])
const res = await this.OSSclient.put( const res = await this.OSSclient.put(
`/${this.data.TrialId}/ClinicalData/${this.pendingUploadList[i].name}`, `/${this.data.TrialId}/ClinicalData/${this.pendingUploadList[i].name}`,
file file
); )
this.form.AddFileList.push({ this.form.AddFileList.push({
fileName: this.pendingUploadList[i].name, fileName: this.pendingUploadList[i].name,
path: this.$getObjectName(res.url), path: this.$getObjectName(res.url),
size: this.pendingUploadList[i].size, size: this.pendingUploadList[i].size,
type: this.pendingUploadList[i].type, type: this.pendingUploadList[i].type,
}); })
} }
this.saveClinicalData(this.form.AddFileList); this.saveClinicalData(this.form.AddFileList)
resolve(); resolve()
}); })
}, },
saveClinicalData() { saveClinicalData() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.btnLoading = true; this.btnLoading = true
this.form.DeleteFileIds = this.pendingDeleteList; this.form.DeleteFileIds = this.pendingDeleteList
if (this.type === "consistencyAnalysis") { if (this.type === 'consistencyAnalysis') {
addOrUpdateConsistencyAnalysisReadingClinicalData(this.form) addOrUpdateConsistencyAnalysisReadingClinicalData(this.form)
.then((response) => { .then((response) => {
this.btnLoading = false; this.btnLoading = false
this.$emit("getList"); this.$emit('getList')
this.$emit("close"); this.$emit('close')
this.$message.success( this.$message.success(this.$t('common:message:savedSuccessfully'))
this.$t("common:message:savedSuccessfully") resolve()
);
resolve();
}) })
.catch(() => { .catch(() => {
this.btnLoading = false; this.btnLoading = false
reject(); reject()
}); })
} else { } else {
addOrUpdateReadingClinicalData(this.form) addOrUpdateReadingClinicalData(this.form)
.then((response) => { .then((response) => {
this.btnLoading = false; this.btnLoading = false
this.$emit("getList"); this.$emit('getList')
this.$emit("close"); this.$emit('close')
this.$message.success( this.$message.success(this.$t('common:message:savedSuccessfully'))
this.$t("common:message:savedSuccessfully") resolve()
);
resolve();
}) })
.catch(() => { .catch(() => {
this.btnLoading = false; this.btnLoading = false
reject(); reject()
}); })
} }
}); })
}, },
getClinicalDatas() { getClinicalDatas() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.loading = true; this.loading = true
var param = { var param = {
trialId: this.data.TrialId, trialId: this.data.TrialId,
IsVisit: this.data.IsVisit, IsVisit: this.data.IsVisit,
ReadingId: this.data.ReadingId, ReadingId: this.data.ReadingId,
SubjectId: this.data.SubjectId, SubjectId: this.data.SubjectId,
ReadingClinicalDataId: this.data.Id ? this.data.Id : "", ReadingClinicalDataId: this.data.Id ? this.data.Id : '',
IsBaseLine: this.data.IsBaseLine, IsBaseLine: this.data.IsBaseLine,
TrialReadingCriterionId: this.trialReadingCriterionId, TrialReadingCriterionId: this.trialReadingCriterionId,
}; }
getTrialClinicalDataSelect(param) getTrialClinicalDataSelect(param)
.then((res) => { .then((res) => {
this.clinicalDatas = res.Result; this.clinicalDatas = res.Result
this.loading = false; this.loading = false
resolve(); resolve()
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
reject(); reject()
}); })
}); })
}, },
handleDeleteFile(index, row) { handleDeleteFile(index, row) {
this.$confirm(this.$t("trials:readingPeriod:cd:message:delete"), { this.$confirm(this.$t('trials:readingPeriod:cd:message:delete'), {
type: "warning", type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}) })
.then(() => { .then(() => {
if (row.Id) { if (row.Id) {
this.pendingDeleteList.push(row.Id); this.pendingDeleteList.push(row.Id)
} }
this.fileList.splice(index, 1); this.fileList.splice(index, 1)
}) })
.catch(() => {}); .catch(() => {})
}, },
beginScanFiles(e) { beginScanFiles(e) {
var files = e.target.files; var files = e.target.files
for (var i = 0; i < files.length; ++i) { for (var i = 0; i < files.length; ++i) {
const fileName = files[i].name; const fileName = files[i].name
var extendName = fileName var extendName = fileName
.substring(fileName.lastIndexOf(".")) .substring(fileName.lastIndexOf('.'))
.toLocaleLowerCase(); .toLocaleLowerCase()
if (this.faccept.indexOf(extendName) !== -1) { if (this.faccept.indexOf(extendName) !== -1) {
this.fileList.push({ this.fileList.push({
FileName: fileName, FileName: fileName,
Path: "", Path: '',
Status: 0, Status: 0,
Files: files[i], Files: files[i],
size: files[i].size, size: files[i].size,
type: fileName.split(".")[1], type: fileName.split('.')[1],
}); })
} }
} }
}, },
handleClinicalDataSetChange(v) { handleClinicalDataSetChange(v) {
var index = this.clinicalDatas.findIndex((item) => item.Id === v); var index = this.clinicalDatas.findIndex((item) => item.Id === v)
if (index > -1) { if (index > -1) {
this.currentTpl.id = this.clinicalDatas[index].Id; this.currentTpl.id = this.clinicalDatas[index].Id
this.currentTpl.path = this.clinicalDatas[index].Path; this.currentTpl.path = this.clinicalDatas[index].Path
this.currentTpl.isExist = !!this.clinicalDatas[index].FileName; this.currentTpl.isExist = !!this.clinicalDatas[index].FileName
} }
}, },
handleDownloadTpl() { handleDownloadTpl() {
this.loading = true; this.loading = true
window.open( window.open(
this.OSSclientConfig.basePath + this.currentTpl.path, this.OSSclientConfig.basePath + this.currentTpl.path,
"_blank" '_blank'
); )
this.loading = false; this.loading = false
// DownloadTrialClinicalFile(this.currentTpl.id).then(data => { // DownloadTrialClinicalFile(this.currentTpl.id).then(data => {
// this.loading = false // this.loading = false
// }).catch(() => { this.loading = false }) // }).catch(() => { this.loading = false })
}, },
close() { close() {
this.$emit("close"); this.$emit('close')
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

View File

@ -1252,9 +1252,9 @@ import SignForm from '@/views/trials/components/newSignForm'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import const_ from '@/const/sign-code' import const_ from '@/const/sign-code'
import uploadPetClinicalData from '@/views/trials/trials-panel/visit/crc-upload/components/uploadPetClinicalData.vue' import uploadPetClinicalData from '@/views/trials/trials-panel/visit/crc-upload/components/uploadPetClinicalData.vue'
import { downloadImage, resetFlag } from '@/utils/uploadZip.js'
import { downLoadFile } from '@/utils/stream.js' import { downLoadFile } from '@/utils/stream.js'
import { getCRCUploadedStudyInfo } from '@/api/load.js' import { getCRCUploadedStudyInfo } from '@/api/load.js'
import store from '@/store'
export default { export default {
name: 'QualityAssurance', name: 'QualityAssurance',
components: { components: {
@ -1392,7 +1392,7 @@ export default {
if (this.open) { if (this.open) {
this.open.close() this.open.close()
} }
resetFlag() store.dispatch('trials/setUnLock', false)
}, },
methods: { methods: {
// dicom // dicom
@ -1452,7 +1452,10 @@ export default {
let files = [], let files = [],
name = null name = null
if (type === 'dicom') { if (type === 'dicom') {
name = `${data.SubjectCode}_${data.VisitName}_DICOM.zip` name = `${data.SubjectCode}_${data.VisitName}_${this.$fd(
'IsDicom',
true
)}.zip`
let StudyList = data.StudyList let StudyList = data.StudyList
StudyList.forEach((study) => { StudyList.forEach((study) => {
if (study.SeriesList.length > 0) { if (study.SeriesList.length > 0) {
@ -1461,7 +1464,12 @@ export default {
series.InstanceList.forEach((instance) => { series.InstanceList.forEach((instance) => {
let fileName = instance.Path.split('/').pop() let fileName = instance.Path.split('/').pop()
let obj = { let obj = {
name: `${data.SubjectCode}_${data.VisitName}_DICOM/${study.StudyCode}_${study.StudyTime}_${series.Modality}/${fileName}`, name: `${data.SubjectCode}_${data.VisitName}_${this.$fd(
'IsDicom',
true
)}/${study.StudyCode}_${study.StudyTime}_${
series.Modality
}/${fileName}`,
path: this.OSSclientConfig.basePath + instance.Path, path: this.OSSclientConfig.basePath + instance.Path,
} }
files.push(obj) files.push(obj)
@ -1472,7 +1480,10 @@ export default {
}) })
} }
if (type === 'noneDicom') { if (type === 'noneDicom') {
name = `${data.SubjectCode}_${data.VisitName}_非DICOM.zip` name = `${data.SubjectCode}_${data.VisitName}_${this.$fd(
'IsDicom',
false
)}.zip`
let NoneDicomStudyList = data.NoneDicomStudyList let NoneDicomStudyList = data.NoneDicomStudyList
// zip // zip
if ( if (
@ -1490,7 +1501,12 @@ export default {
if (study.FileList.length > 0) { if (study.FileList.length > 0) {
study.FileList.forEach((item) => { study.FileList.forEach((item) => {
let obj = { let obj = {
name: `${data.SubjectCode}_${data.VisitName}_非DICOM/${study.StudyCode}_${study.ImageDate}_${study.Modality}/${item.FileName}`, name: `${data.SubjectCode}_${data.VisitName}_${this.$fd(
'IsDicom',
true
)}/${study.StudyCode}_${study.ImageDate}_${study.Modality}/${
item.FileName
}`,
url: this.OSSclientConfig.basePath + item.Path, url: this.OSSclientConfig.basePath + item.Path,
} }
files.push(obj) files.push(obj)