diff --git a/src/utils/oss.js b/src/utils/oss.js index ed0037f2..4a711aed 100644 --- a/src/utils/oss.js +++ b/src/utils/oss.js @@ -56,6 +56,7 @@ async function ossGenerateSTS() { const urlParams = new URLSearchParams(window.location.search) const trialId = urlParams.get('trialId') if (Object.keys(fileInfo).length !== 0) { + fileInfo.fileType = mimeTypeToExt(fileInfo.fileType) let params = Object.assign({path: objectName}, fileInfo) addOrUpdateFileUploadRecord(params) } else if (trialId) { @@ -108,6 +109,7 @@ async function ossGenerateSTS() { const urlParams = new URLSearchParams(window.location.search) const trialId = urlParams.get('trialId') if (Object.keys(fileInfo).length !== 0) { + fileInfo.fileType = mimeTypeToExt(fileInfo.fileType) let params = Object.assign({path: data.path}, fileInfo) addOrUpdateFileUploadRecord(params) } else if (trialId) { @@ -235,6 +237,7 @@ function uploadAWS(aws, data, progress, fileInfo) { const trialId = urlParams.get('trialId') if (Object.keys(fileInfo).length !== 0) { + fileInfo.fileType = mimeTypeToExt(fileInfo.fileType) let params = Object.assign({path: decodeUtf8(curPath)}, fileInfo) addOrUpdateFileUploadRecord(params) } else if (trialId) { @@ -350,5 +353,37 @@ function isCredentialsExpired(credentials) { return expireDate.getTime() - now.getTime() <= 300000; } +function mimeTypeToExt(mimeType) { + const map = { + // 图片 + 'image/jpeg': '.jpg', + 'image/jpg': '.jpg', + 'image/png': '.png', + 'image/gif': '.gif', + 'image/webp': '.webp', + 'image/svg+xml': '.svg', + 'image/bmp': '.bmp', + // 文档 + 'application/dicom': '.dcm', + 'application/pdf': '.pdf', + 'application/msword': '.doc', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': '.docx', + 'application/vnd.ms-excel': '.xls', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': '.xlsx', + 'application/vnd.ms-powerpoint': '.ppt', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation': '.pptx', + 'text/plain': '.txt', + // 音频/视频 + 'audio/mpeg': '.mp3', + 'audio/wav': '.wav', + 'video/mp4': '.mp4', + 'video/mpeg': '.mpeg', + // 压缩包 + 'application/zip': '.zip', + 'application/x-rar-compressed': '.rar', + 'application/x-7z-compressed': '.7z', + }; + return map[mimeType] || ''; // 找不到返回空字符串 +} export const OSSclient = ossGenerateSTS diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue index 9dfae65e..b6b81c86 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/PetCtViewport.vue @@ -840,7 +840,6 @@ export default { this.sliderInfo.isMove = false }, handletoolsMouseWheel(e) { - if (this.activeTool === 'Crosshairs') return const { viewportId, wheel } = e.detail if (this.isMip) { const container = document.getElementById('rotateBar') @@ -864,7 +863,6 @@ export default { this.rotateBarInfo.isMove = false }, rotateBarMousemove(e) { - if (this.activeTool === 'Crosshairs') return // 滚动旋转 if (!this.rotateBarInfo.isMove) return const container = document.getElementById('rotateBar') @@ -875,13 +873,12 @@ export default { if (x < 0) x = 0 if (x > containerWidth - sliderWidth) x = containerWidth - sliderWidth const deltaX = x - this.rotateBarLeft - // const angle = Math.sin((deltaX * (360 / (containerWidth - sliderWidth))) * Math.PI / 180) - const angle = (deltaX / (containerWidth - sliderWidth)) * (2 * Math.PI) + const angle = Math.sin((deltaX * (360 / (containerWidth - sliderWidth))) * Math.PI / 180) + // const angle = (deltaX / (containerWidth - sliderWidth)) * (2 * Math.PI) this.rotate(angle) this.rotateBarLeft = x }, rotateBarMousedown(e) { - if (this.activeTool === 'Crosshairs') return this.rotateBarInfo.initLeft = e.srcElement.offsetLeft this.rotateBarInfo.initX = e.clientX this.rotateBarInfo.isMove = true @@ -920,7 +917,6 @@ export default { viewport.render() }, clickRotate(e) { - if (this.activeTool === 'Crosshairs') return // console.log('clickRotate') const container = document.getElementById('rotateBar') const containerWidth = container.offsetWidth @@ -928,8 +924,8 @@ export default { const sliderWidth = slider.offsetWidth const x = Math.trunc(e.offsetX) const deltaX = x - this.rotateBarLeft - // const angle = Math.sin((deltaX * (360 / (containerWidth - sliderWidth))) * Math.PI / 180) - const angle = (deltaX / (containerWidth - sliderWidth)) * (2 * Math.PI) + const angle = Math.sin((deltaX * (360 / (containerWidth - sliderWidth))) * Math.PI / 180) + // const angle = (deltaX / (containerWidth - sliderWidth)) * (2 * Math.PI) this.rotate(angle) this.rotateBarLeft = x }, diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue index 5733c048..eb315fd2 100644 --- a/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue +++ b/src/views/trials/trials-panel/reading/dicoms3D/components/ReadPage.vue @@ -1605,8 +1605,9 @@ export default { }); } else if (toolGroupId === this.fusionToolGroupId) { toolGroup.addTool(CrosshairsTool.toolName, { - getReferenceLineColor: this.setCrosshairsToolLineColor, - getReferenceLineSlabThicknessControlsOn: () => false + getReferenceLineColor: this.setFusionCrosshairsToolLineColor, + getReferenceLineSlabThicknessControlsOn: () => false, + minimal: { enabled: true, lineLengthInPx: 10000 } }); } else { toolGroup.addTool(WindowLevelTool.toolName) @@ -1665,8 +1666,13 @@ export default { targetViewportIds: fusionViewportIds.filter((id) => id !== viewportId) }) - // Set the initial state of the tools, here we set one tool active on left click. - // This means left click will draw that tool. + toolGroup.setToolActive(VolumeRotateTool.toolName, { + bindings: [ + { + mouseButton: MouseBindings.Wheel, + }, + ] + }) toolGroup.setToolActive(MIPJumpToClickTool.toolName, { bindings: [ { @@ -2267,6 +2273,22 @@ export default { let index = viewportId.split("-").pop() return colors[colors.length - 1 - Number(index)] || colors[0] }, + setFusionCrosshairsToolLineColor(viewportId) { + let colors = [ + '#fb628b', + '#fb628b', + '#fb628b', + '#ffd10a', + '#b6d634', + ] + + if (viewportId === 'viewport-fusion-hidden-sag') { + return colors[colors.length - 1] + } else { + let index = viewportId.split("-").pop() + return colors[Number(index)] || colors[0] + } + }, getLengthToolTextLines(data, targetId) { const cachedVolumeStats = data.cachedStats[targetId] const { length, unit } = cachedVolumeStats @@ -2573,7 +2595,7 @@ export default { if (toolName === CrosshairsTool.toolName) { toolGroup.setToolDisabled(this.activeTool) this.setFusionMipJumpEnabled(true) - this.setFusionMipRotateEnabled(true) + // this.setFusionMipRotateEnabled(true) } else { toolGroup.setToolPassive(this.activeTool) } @@ -2583,7 +2605,7 @@ export default { if (this.activeTool === CrosshairsTool.toolName) { toolGroup.setToolDisabled(this.activeTool) this.setFusionMipJumpEnabled(true) - this.setFusionMipRotateEnabled(true) + // this.setFusionMipRotateEnabled(true) } else { toolGroup.setToolPassive(this.activeTool) } @@ -2608,7 +2630,7 @@ export default { // } } this.setFusionMipJumpEnabled(false) - this.setFusionMipRotateEnabled(false) + // this.setFusionMipRotateEnabled(false) } this.activeTool = toolName } @@ -2624,7 +2646,9 @@ export default { this.setFusionMipJumpEnabled(false) if (isMip) { if (toolGroup.hasTool(VolumeRotateTool.toolName)) { - toolGroup.setToolDisabled(VolumeRotateTool.toolName) + toolGroup.setToolActive(VolumeRotateTool.toolName, { + bindings: [{ mouseButton: MouseBindings.Wheel }] + }) } if (toolGroup.hasTool(StackScrollTool.toolName)) { toolGroup.setToolDisabled(StackScrollTool.toolName) diff --git a/src/views/trials/trials-panel/setting/attachment/components/attachmentForm.vue b/src/views/trials/trials-panel/setting/attachment/components/attachmentForm.vue index 40392b58..bbf65430 100644 --- a/src/views/trials/trials-panel/setting/attachment/components/attachmentForm.vue +++ b/src/views/trials/trials-panel/setting/attachment/components/attachmentForm.vue @@ -121,7 +121,7 @@ export default { this.loading = true var file = await this.fileToBlob(param.file) const res = await this.OSSclient.put( - `/${this.$route.query.trialId}/DocumentToSign/${param.file.name}${new Date().getTime()}`, + `/${this.$route.query.trialId}/DocumentToSign/${param.file.name}`, file ) this.fileList.push({ diff --git a/src/views/trials/trials-panel/setting/attachment/components/templateForm.vue b/src/views/trials/trials-panel/setting/attachment/components/templateForm.vue index 03ce252e..3e5b38b0 100644 --- a/src/views/trials/trials-panel/setting/attachment/components/templateForm.vue +++ b/src/views/trials/trials-panel/setting/attachment/components/templateForm.vue @@ -201,7 +201,7 @@ export default { this.loading = true var file = await this.fileToBlob(param.file) const trialId = this.$route.query.trialId - const res = await this.OSSclient.put(`/${trialId}/DocumentToSign/${param.file.name}${new Date().getTime()}`, file) + const res = await this.OSSclient.put(`/${trialId}/DocumentToSign/${param.file.name}`, file) this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url) }) this.form.Path = this.$getObjectName(res.url) this.form.Name = param.file.name diff --git a/src/views/trials/trials-panel/trial-summary/data-sync/components/StudyList.vue b/src/views/trials/trials-panel/trial-summary/data-sync/components/StudyList.vue index 0b914077..35768346 100644 --- a/src/views/trials/trials-panel/trial-summary/data-sync/components/StudyList.vue +++ b/src/views/trials/trials-panel/trial-summary/data-sync/components/StudyList.vue @@ -148,7 +148,7 @@ /> - + @@ -57,14 +86,15 @@ export default { .data-sync-tabs{ height: 100%; background-color: #fff; - .el-tabs__header { + > .el-tabs__header { height: 100%; } - .el-tabs__content { + > .el-tabs__content { height: 100%; + padding: 0px; overflow: auto; } - .el-tab-pane { + > .el-tabs__content > .el-tab-pane { height: 100%; } } @@ -92,4 +122,26 @@ export default { } } } - \ No newline at end of file +.detail-tabs { + height: 100%; + display: flex; + flex-direction: column; + min-height: 0; + .el-tabs__header { + flex: 0 0 auto; + margin: 0 0 8px; + } + .el-tabs__content { + flex: 1 1 auto; + min-height: 0; + display: flex; + flex-direction: column; + overflow: hidden; + } + .el-tab-pane { + flex: 1 1 auto; + min-height: 0; + height: 100%; + } +} +