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

@ -48,3 +48,19 @@ export function getCRCUploadedStudyInfo(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 studyView from "./components/study-view.vue";
import { getSubjectImageUploadList, deleteTaskStudy } from "@/api/load.js";
import { downloadImage } from "@/utils/uploadZip.js";
import store from "@/store";
export default {
name: "uploadImage",
@ -591,7 +590,7 @@ export default {
files.push(obj);
}
store.dispatch("trials/setUnLock", true);
let res = await downloadImage(zipName, files);
// let res = await downloadImage(zipName, files);
store.dispatch("trials/setUnLock", false);
},
},

View File

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

@ -41,7 +41,7 @@
icon="el-icon-search"
@click="handleSearch"
>
{{ $t("common:button:search") }}
{{ $t('common:button:search') }}
</el-button>
<!-- 重置 -->
<el-button
@ -49,7 +49,7 @@
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t("common:button:reset") }}
{{ $t('common:button:reset') }}
</el-button>
</el-form-item>
</el-form>
@ -78,7 +78,8 @@
? 'warning'
: 'primary'
"
>{{ $fd("YesOrNo", scope.row.IsUrgent) }}</el-tag>
>{{ $fd('YesOrNo', scope.row.IsUrgent) }}</el-tag
>
</template>
</el-table-column>
<!-- 受试者编号 -->
@ -116,7 +117,8 @@
? '#E6A23C'
: '#409EFF',
}"
>{{ scope.row.UrgentCount }}</span>
>{{ scope.row.UrgentCount }}</span
>
</template>
</el-table-column>
<!-- 建议完成时间 -->
@ -130,7 +132,7 @@
sortable="custom"
>
<template slot-scope="scope">
{{ scope.row.SuggesteFinishedTime.split(":")[0] + ":00:00" }}
{{ scope.row.SuggesteFinishedTime.split(':')[0] + ':00:00' }}
</template>
</el-table-column>
<el-table-column
@ -252,44 +254,60 @@
"
@click="handleOutOfOrderReading"
>
{{ $t("trials:pendingReadingTasks:button:beginRandomReview") }}
{{ $t('trials:pendingReadingTasks:button:beginRandomReview') }}
</el-button>
</el-descriptions-item>
</el-descriptions>
</div>
</el-tab-pane>
</el-tabs>
<upload-image
<!-- <upload-image
v-if="uploadImageVisible"
:visible.sync="uploadImageVisible"
:subject-id="uploadSubjectId"
:criterion="uploadTrialCriterion"
:status="uploadStatus"
@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>
</template>
<script>
import {
getIRUnReadSubjectTaskList,
verifyReadingRestTime
} from '@/api/trials'
import { getIRUnReadSubjectTaskList, verifyReadingRestTime } from '@/api/trials'
import { getTrialCriterionList } from '@/api/trials/reading'
import { clearSkipReadingCache } from '@/api/reading'
import BaseContainer from '@/components/BaseContainer'
import uploadImage from '@/components/uploadImage'
import uploadDicomAndNonedicom from '@/components/uploadDicomAndNonedicom'
import downloadDicomAndNonedicom from '@/components/downloadDicomAndNonedicom'
import Pagination from '@/components/Pagination'
import { getToken } from '@/utils/auth'
const searchDataDefault = () => {
return {
SubjectCode: '',
PageIndex: 1,
PageSize: 20
PageSize: 20,
}
}
export default {
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() {
return {
searchData: searchDataDefault(),
@ -308,10 +326,12 @@ export default {
openWindow: null,
//
downloadImageVisible: false,
uploadImageVisible: false,
uploadSubjectId: null,
uploadSubjectCode: null,
uploadTrialCriterion: {},
uploadStatus: 'upload'
uploadStatus: 'upload',
}
},
watch: {
@ -319,7 +339,7 @@ export default {
if (v) {
this.getList()
}
}
},
},
mounted() {
window.addEventListener('message', this.receiveMsg)
@ -335,10 +355,11 @@ export default {
methods: {
//
openUploadImage(item, trialCriterion, status) {
this.uploadSubjectCode = item.SubjectCode
this.uploadSubjectId = item.SubjectId
this.uploadTrialCriterion = trialCriterion
this.uploadStatus = status
this.uploadImageVisible = true
this[`${status}ImageVisible`] = true
},
async getTrialCriterionList() {
try {
@ -360,8 +381,7 @@ export default {
this.isRender = false
const res = await getIRUnReadSubjectTaskList(this.searchData)
if (res.IsSuccess) {
this.isReadingTaskViewInOrder =
res.OtherInfo.IsReadingTaskViewInOrder
this.isReadingTaskViewInOrder = res.OtherInfo.IsReadingTaskViewInOrder
this.readingTool = res.OtherInfo.ReadingTool
this.criterionType = res.OtherInfo.CriterionType
if (res.OtherInfo.IsReadingTaskViewInOrder) {
@ -395,7 +415,10 @@ export default {
await clearSkipReadingCache()
await verifyReadingRestTime()
this.loading = false
window.localStorage.setItem('TrialReadingCriterionId', this.TrialReadingCriterionId)
window.localStorage.setItem(
'TrialReadingCriterionId',
this.TrialReadingCriterionId
)
var token = getToken()
var path = ''
if (this.readingTool === 0) {
@ -420,7 +443,10 @@ export default {
await clearSkipReadingCache()
await verifyReadingRestTime()
this.loading = false
window.localStorage.setItem('TrialReadingCriterionId', this.TrialReadingCriterionId)
window.localStorage.setItem(
'TrialReadingCriterionId',
this.TrialReadingCriterionId
)
var token = getToken()
var path = ''
if (this.readingTool === 0) {
@ -450,7 +476,7 @@ export default {
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
}
}
},
},
}
</script>

View File

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

View File

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