Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b85853aa5e | |||
| 5386dba134 | |||
| 3f63c126ff | |||
| f1b816fd85 | |||
| 43a221de00 | |||
| 642c708c74 | |||
| aa8831ce54 | |||
| d73970117d | |||
| 9d462f69f6 | |||
| 9962b1a829 | |||
| 049128b90e | |||
| d77c79acbd | |||
| 1e300b4529 |
@@ -614,6 +614,18 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-show="title !== '复制'" :span="24">
|
||||
<el-form-item>
|
||||
<span slot="label">
|
||||
是否默认
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="form.IsDefaultChoice"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--分割线-->
|
||||
<el-col v-show="title !== '复制' && form.ConfigType == 'M'" :span="24">
|
||||
<el-divider content-position="left">其他信息</el-divider>
|
||||
@@ -1130,6 +1142,7 @@ export default {
|
||||
DescriptionCN: null,
|
||||
InterfaceName: null,
|
||||
IsEnable: true,
|
||||
IsDefaultChoice: true,
|
||||
ModuleTypeId: null,
|
||||
OptTypeId: null,
|
||||
ChildrenTypeId: null,
|
||||
|
||||
@@ -263,7 +263,7 @@ export default {
|
||||
series: '',
|
||||
ToolStateManager: null,
|
||||
renderedMeasured: [],
|
||||
measuredTools: ['Length', 'Bidirectional', 'ArrowAnnotate', 'RectangleRoi'],
|
||||
measuredTools: ['Length', 'Bidirectional', 'ArrowAnnotate', 'RectangleRoi', 'Probe'],
|
||||
measureData: [],
|
||||
selectedLesion: null,
|
||||
activeTool: 0, // 0:enable 1:passive 2:active
|
||||
@@ -607,7 +607,11 @@ export default {
|
||||
if ((i.LesionType === 0 || i.LesionType === 1 || i.LesionType === 7) && i.IsFirstChangeTask) {
|
||||
arr.push(i.OrderMarkName)
|
||||
}
|
||||
if (i.Id && this.readingTaskState >= 2) {
|
||||
arr.push(i.OrderMarkName)
|
||||
}
|
||||
})
|
||||
console.log(arr)
|
||||
return arr
|
||||
},
|
||||
getMergeMarks(measureDatas) {
|
||||
@@ -616,6 +620,9 @@ export default {
|
||||
if ((i.LesionType === 0) && i.SplitOrMergeType === 1) {
|
||||
arr.push(i.OrderMarkName)
|
||||
}
|
||||
if (i.Id && this.readingTaskState >= 2) {
|
||||
arr.push(i.OrderMarkName)
|
||||
}
|
||||
})
|
||||
return arr
|
||||
},
|
||||
@@ -692,7 +699,7 @@ export default {
|
||||
} else if (criterionType === 2) {
|
||||
this.disabledMarks = this.getMergeMarks(this.visitTaskList[idx].MeasureData)
|
||||
} else {
|
||||
this.disabledMarks = []
|
||||
this.disabledMarks = this.getDisabledMarks(this.visitTaskList[idx].MeasureData)
|
||||
}
|
||||
return true
|
||||
},
|
||||
@@ -901,6 +908,9 @@ export default {
|
||||
}
|
||||
} else if (this.activeTool === 1 && this.readingTaskState < 2) {
|
||||
cornerstoneTools.setToolPassiveForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
||||
} else if (this.readingTaskState >= 2 && this.isCurrentTask) {
|
||||
// setToolPassiveForElement
|
||||
cornerstoneTools.setToolEnabledForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
||||
} else {
|
||||
cornerstoneTools.setToolEnabledForElement(element, data.MeasureData.type, { mouseButtonMask: 1 })
|
||||
}
|
||||
@@ -919,6 +929,9 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
if (this.readingTaskState >= 2 && this.activeToolName && this.isCurrentTask) {
|
||||
cornerstoneTools.setToolActiveForElement(element, this.activeToolName, { mouseButtonMask: 1 })
|
||||
}
|
||||
},
|
||||
setMeasureDataVisible() {
|
||||
if (this.readingTaskState >= 2) return
|
||||
@@ -986,6 +999,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mouseClick(e) {
|
||||
if (this.readingTaskState >= 2) return
|
||||
const { element, currentPoints, image, viewport } = e.detail
|
||||
var imageId = image.imageId
|
||||
const imageInfo = this.getInstanceInfo(imageId)
|
||||
@@ -1073,7 +1087,8 @@ export default {
|
||||
} else if (criterionType === 2) {
|
||||
this.disabledMarks = this.getMergeMarks(this.visitTaskList[idx].MeasureData)
|
||||
} else {
|
||||
this.disabledMarks = []
|
||||
// this.disabledMarks = []
|
||||
this.disabledMarks = this.getDisabledMarks(this.visitTaskList[idx].MeasureData)
|
||||
}
|
||||
|
||||
this.maxVistNum = this.visitTaskList[this.visitTaskList.length - 1].VisitTaskNum
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
<dicom-canvas
|
||||
v-if="canvasW"
|
||||
:ref="`dicomCanvas${i-1}`"
|
||||
:style="{width:canvasW,height: canvasH}"
|
||||
:style="{width: fullScreenIndex === i-1 ? fullScreenWidth : canvasW,height: fullScreenIndex === i-1 ? fullScreenHeight : canvasH}"
|
||||
:canvas-index="i-1"
|
||||
:is-active="i-1===currentDicomCanvasIndex"
|
||||
:is-scroll-sync="isScrollSync"
|
||||
@@ -989,7 +989,10 @@ export default {
|
||||
signVisible: false,
|
||||
signCode: null,
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
tmpData: null
|
||||
tmpData: null,
|
||||
fullScreenIndex: -1,
|
||||
fullScreenWidth: window.innerWidth - 570 + 'px',
|
||||
fullScreenHeight: window.innerHeight - 130 + 'px'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1379,22 +1382,25 @@ export default {
|
||||
this.personalConfigDialog.visible = true
|
||||
},
|
||||
setCornerstoneStyle(i) {
|
||||
if (this.layoutCol === 1 && this.layoutRow === 1) {
|
||||
this.fullScreenIndex = -1
|
||||
return
|
||||
}
|
||||
if (this.cornerstoneStyle.position) {
|
||||
this.cornerstoneStyle = {}
|
||||
this.setCanvasStyle()
|
||||
this.fullScreenIndex = -1
|
||||
} else {
|
||||
this.cornerstoneStyle = {
|
||||
position: 'absolute',
|
||||
top: '72px',
|
||||
top: '67px',
|
||||
left: '0px',
|
||||
right: '350px',
|
||||
zIndex: 10
|
||||
zIndex: 10,
|
||||
}
|
||||
this.canvasW = window.innerWidth - 570 + 'px'
|
||||
this.canvasH = window.innerHeight - 130 + 'px'
|
||||
this.fullScreenIndex = this.currentDicomCanvasIndex
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].reloadCanvas()
|
||||
for (var i = 0; i < this.maxCanvas; i++) {
|
||||
this.$refs[`dicomCanvas${i}`][0].reloadCanvas()
|
||||
}
|
||||
@@ -1941,6 +1947,7 @@ export default {
|
||||
},
|
||||
// 切换布局
|
||||
changeLayout(name) {
|
||||
this.fullScreenIndex = -1
|
||||
if (this.activeTool) {
|
||||
if (this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].isCurrentTask && this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].readingTaskState < 2) {
|
||||
this.$nextTick(() => {
|
||||
@@ -2043,14 +2050,17 @@ export default {
|
||||
if (i === -1) return
|
||||
var isCurrentTask = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].isCurrentTask
|
||||
var readingTaskState = this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].readingTaskState
|
||||
if (!isCurrentTask || readingTaskState >= 2) {
|
||||
if (!isCurrentTask) {
|
||||
this.measuredTools[i].isDisabled = true
|
||||
e.target.style.cursor = 'not-allowed'
|
||||
if (this.activeTool) {
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setToolEnabled(toolName)
|
||||
this.activeTool = ''
|
||||
}
|
||||
} else {
|
||||
} else if (isCurrentTask && readingTaskState >= 2) {
|
||||
this.measuredTools[i].isDisabled = false
|
||||
e.target.style.cursor = 'pointer'
|
||||
} else if (isCurrentTask && readingTaskState < 2) {
|
||||
// var obj = this.$refs['measurementList'].isCanActiveTool(toolName, true)
|
||||
var obj = this.$refs['measurementList'].isCanActiveTool(toolName, true)
|
||||
this.measuredTools[i].disabledReason = obj.reason
|
||||
@@ -2087,7 +2097,7 @@ export default {
|
||||
var toolObj = this.measuredTools.find(i => i.toolName === toolName)
|
||||
if (!toolObj || toolObj.isDisabled) return
|
||||
var dicomSeries = this.canvasObj[this.currentDicomCanvasIndex]
|
||||
if (dicomSeries.isCurrentTask && isMeasuredTool && dicomSeries.readingTaskState < 2) {
|
||||
if (dicomSeries.isCurrentTask && isMeasuredTool) {
|
||||
if (this.activeTool) {
|
||||
this.measuredTools.forEach(item => {
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].setToolPassive(item.toolName)
|
||||
@@ -2248,13 +2258,14 @@ export default {
|
||||
this.customWwc.visible = false
|
||||
},
|
||||
toggleInvert() {
|
||||
if (this.activeTool === 'reversecolor') {
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].resetWwwc()
|
||||
this.activeTool = ''
|
||||
} else {
|
||||
this.activeTool = 'reversecolor'
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleInvert()
|
||||
}
|
||||
// if (this.activeTool === 'reversecolor') {
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].resetWwwc()
|
||||
// this.activeTool = ''
|
||||
// } else {
|
||||
// this.activeTool = 'reversecolor'
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleInvert()
|
||||
// }
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleInvert()
|
||||
},
|
||||
setImageIndexSync() {
|
||||
this.isScrollSync = !this.isScrollSync
|
||||
|
||||
@@ -556,7 +556,7 @@
|
||||
<dicom-canvas
|
||||
v-if="canvasW"
|
||||
:ref="`dicomCanvas${i - 1}`"
|
||||
:style="{ width: canvasW, height: canvasH }"
|
||||
:style="{width: fullScreenIndex === i-1 ? fullScreenWidth : canvasW,height: fullScreenIndex === i-1 ? fullScreenHeight : canvasH}"
|
||||
:canvas-index="i - 1"
|
||||
:is-active="i - 1 === currentDicomCanvasIndex"
|
||||
:is-scroll-sync="isScrollSync"
|
||||
@@ -895,6 +895,9 @@ export default {
|
||||
uploadTrialCriterion: {},
|
||||
uploadStatus: 'upload',
|
||||
taskId: '',
|
||||
fullScreenIndex: -1,
|
||||
fullScreenWidth: window.innerWidth - 570 + 'px',
|
||||
fullScreenHeight: window.innerHeight - 128 + 'px'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1314,22 +1317,25 @@ export default {
|
||||
this.personalConfigDialog.visible = true
|
||||
},
|
||||
setCornerstoneStyle(i) {
|
||||
if (this.layoutCol === 1 && this.layoutRow === 1) {
|
||||
this.fullScreenIndex = -1
|
||||
return
|
||||
}
|
||||
if (this.cornerstoneStyle.position) {
|
||||
this.cornerstoneStyle = {}
|
||||
this.setCanvasStyle()
|
||||
this.fullScreenIndex = -1
|
||||
} else {
|
||||
this.cornerstoneStyle = {
|
||||
position: 'absolute',
|
||||
top: '72px',
|
||||
top: '70px',
|
||||
left: '205px',
|
||||
right: '350px',
|
||||
zIndex: 10,
|
||||
}
|
||||
this.canvasW = window.innerWidth - 570 + 'px'
|
||||
this.canvasH = window.innerHeight - 130 + 'px'
|
||||
this.fullScreenIndex = this.currentDicomCanvasIndex
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].reloadCanvas()
|
||||
for (var i = 0; i < this.maxCanvas; i++) {
|
||||
this.$refs[`dicomCanvas${i}`][0].reloadCanvas()
|
||||
}
|
||||
@@ -1928,6 +1934,7 @@ export default {
|
||||
},
|
||||
// 切换布局
|
||||
changeLayout(name) {
|
||||
this.fullScreenIndex = -1
|
||||
if (this.activeTool) {
|
||||
if (
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0]
|
||||
@@ -2301,15 +2308,16 @@ export default {
|
||||
this.customWwc.visible = false
|
||||
},
|
||||
toggleInvert() {
|
||||
if (this.activeTool === 'reversecolor') {
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].resetWwwc()
|
||||
this.activeTool = ''
|
||||
} else {
|
||||
this.activeTool = 'reversecolor'
|
||||
this.$refs[
|
||||
`dicomCanvas${this.currentDicomCanvasIndex}`
|
||||
][0].toggleInvert()
|
||||
}
|
||||
// if (this.activeTool === 'reversecolor') {
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].resetWwwc()
|
||||
// this.activeTool = ''
|
||||
// } else {
|
||||
// this.activeTool = 'reversecolor'
|
||||
// this.$refs[
|
||||
// `dicomCanvas${this.currentDicomCanvasIndex}`
|
||||
// ][0].toggleInvert()
|
||||
// }
|
||||
this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].toggleInvert()
|
||||
},
|
||||
setImageIndexSync() {
|
||||
this.isScrollSync = !this.isScrollSync
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div v-loading="loading" :element-loading-text="loadingText" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)" class="read-page-container">
|
||||
<div
|
||||
v-loading="loading"
|
||||
:element-loading-text="loadingText"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)"
|
||||
class="read-page-container"
|
||||
>
|
||||
<!-- 检查列表 -->
|
||||
<div class="left-panel">
|
||||
<div class="task-container">
|
||||
@@ -200,7 +205,7 @@
|
||||
<svg-icon v-else icon-class="fitToImage" class="svg-icon" />
|
||||
</div>
|
||||
<!--融合-->
|
||||
<div class="tool-item" :title="$t('trials:lugano:button:fusion')" @click.prevent="openFusion" v-if="readingTool === 2">
|
||||
<div v-if="readingTool === 2" class="tool-item" :title="$t('trials:lugano:button:fusion')" @click.prevent="openFusion">
|
||||
<svg-icon icon-class="fusion" class="svg-icon" />
|
||||
</div>
|
||||
<div
|
||||
@@ -279,9 +284,9 @@
|
||||
<div
|
||||
v-if="criterionType === 0"
|
||||
:title="$t('trials:reading:button:more')"
|
||||
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '']"
|
||||
@click.stop="showPanel($event)"
|
||||
@mouseleave="toolMouseout"
|
||||
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '']"
|
||||
>
|
||||
<div class="dropdown">
|
||||
<div
|
||||
@@ -292,10 +297,10 @@
|
||||
<i class="el-icon-arrow-down" style="color:#fff;" />
|
||||
</div>
|
||||
<div class="dropdown-content">
|
||||
<ul style="width:100px;" v-if="readingTaskState < 2">
|
||||
<ul v-if="readingTaskState < 2" style="width:100px;">
|
||||
<li v-for="i in customizeStandards" :key="i.toolName" style="text-align:left;">
|
||||
<a href="#" @click.prevent="setMoreToolActive(i.toolName)">
|
||||
<svg-icon :icon-class="i.icon" class="svg-icon" style="margin-right: 5px;"/>
|
||||
<svg-icon :icon-class="i.icon" class="svg-icon" style="margin-right: 5px;" />
|
||||
{{ $t(i.i18nKey) }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -304,9 +309,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 伪彩 -->
|
||||
<template v-if="readingTool === 2">
|
||||
<colorMap v-show="isFusion" ref="colorMap" @setColorMap="setColorMap" @voiChange="voiChange" />
|
||||
</template>
|
||||
<template v-if="readingTool === 2">
|
||||
<colorMap v-show="isFusion" ref="colorMap" @setColorMap="setColorMap" @voiChange="voiChange" />
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -338,7 +343,7 @@
|
||||
<div class="content-wrapper">
|
||||
<!-- viewports -->
|
||||
<div class="viewports-wrapper">
|
||||
<div ref="container" class="grid-container" >
|
||||
<div ref="container" class="grid-container">
|
||||
<div :class="[ 'viewports-box', isFusion ? 'viewports-box-down' : '' ]" :style="gridStyle">
|
||||
<div
|
||||
v-for="(v, index) in cellsMax"
|
||||
@@ -362,7 +367,7 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="[ 'viewports-box', !isFusion ? 'viewports-box-down' : '' ]" v-if="readingTool === 2" :style="gridStyle">
|
||||
<div v-if="readingTool === 2" :class="[ 'viewports-box', !isFusion ? 'viewports-box-down' : '' ]" :style="gridStyle">
|
||||
<div
|
||||
v-for="(v, index) in cellsMax"
|
||||
v-show="index < cells.length"
|
||||
@@ -432,6 +437,7 @@
|
||||
:visit-info="s"
|
||||
@resetAnnotations="resetAnnotations"
|
||||
@setReadingTaskState="setReadingTaskState"
|
||||
@viewCustomAnnotationSeries="viewCustomAnnotationSeries"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -522,9 +528,13 @@
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="fusionVisible" :close-on-click-modal="false" :title="$t('trials:lugano:button:record')"
|
||||
width="850px" >
|
||||
<FusionForm v-if="fusionVisible" :activeTaskIndex="activeTaskIndex" :taskList="visitTaskList" @close="closeFusion" @fusion="handleFusion" />
|
||||
<el-dialog
|
||||
:visible.sync="fusionVisible"
|
||||
:close-on-click-modal="false"
|
||||
:title="$t('trials:lugano:button:record')"
|
||||
width="850px"
|
||||
>
|
||||
<FusionForm v-if="fusionVisible" :active-task-index="activeTaskIndex" :task-list="visitTaskList" @close="closeFusion" @fusion="handleFusion" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -590,11 +600,11 @@ const {
|
||||
synchronizers
|
||||
// cursors
|
||||
} = cornerstoneTools
|
||||
const { createCameraPositionSynchronizer, createVOISynchronizer } = synchronizers;
|
||||
const { createCameraPositionSynchronizer, createVOISynchronizer } = synchronizers
|
||||
const newStyles = {
|
||||
global: {
|
||||
color: 'rgb(255, 0, 0)',
|
||||
colorHighlighted: 'rgb(255, 0, 0)',
|
||||
colorHighlighted: 'rgb(0, 255, 0)',
|
||||
colorSelected: 'rgb(255, 0, 0)',
|
||||
colorLocked: 'rgb(255, 0, 0)',
|
||||
lineWidth: '1',
|
||||
@@ -604,7 +614,7 @@ const newStyles = {
|
||||
textBoxFontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif',
|
||||
textBoxFontSize: '14px',
|
||||
textBoxColor: 'rgb(255, 0, 0)',
|
||||
textBoxColorHighlighted: 'rgb(255, 0, 0)',
|
||||
textBoxColorHighlighted: 'rgb(0, 255, 0)',
|
||||
textBoxColorSelected: 'rgb(255, 0, 0)',
|
||||
textBoxColorLocked: 'rgb(255, 0, 0)',
|
||||
textBoxBackground: '',
|
||||
@@ -618,12 +628,6 @@ annotation.config.style.setDefaultToolStyles(newStyles)
|
||||
const { MouseBindings, Events: toolsEvents } = csToolsEnums
|
||||
export default {
|
||||
name: 'ReadPage',
|
||||
props: {
|
||||
readingTool: {
|
||||
type: Number,
|
||||
default: 2
|
||||
}
|
||||
},
|
||||
components: {
|
||||
StudyList,
|
||||
Viewport,
|
||||
@@ -640,6 +644,12 @@ export default {
|
||||
FusionForm,
|
||||
colorMap
|
||||
},
|
||||
props: {
|
||||
readingTool: {
|
||||
type: Number,
|
||||
default: 2
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@@ -709,7 +719,7 @@ export default {
|
||||
studyList: [],
|
||||
volumeData: {},
|
||||
fusionSerieId: {},
|
||||
loadingText: null,
|
||||
loadingText: null
|
||||
// resetAnnotation: false , // 是否初始化标记 (融合时使用)
|
||||
}
|
||||
},
|
||||
@@ -793,7 +803,7 @@ export default {
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
if (this.criterionType === 0) {
|
||||
this.tools = getCustomizeStandardsTools(this.taskInfo.ReadingToolList)
|
||||
let toolNames = this.tools.map(i=>i.toolName)
|
||||
const toolNames = this.tools.map(i => i.toolName)
|
||||
this.customizeStandards = config.customizeStandards.filter(item => !toolNames.includes(item.toolName))
|
||||
} else {
|
||||
this.tools = getTools(this.criterionType)
|
||||
@@ -1062,13 +1072,13 @@ export default {
|
||||
}
|
||||
]
|
||||
let viewportIds = ['viewport-0', 'viewport-1', 'viewport-2', 'viewport-3']
|
||||
let fusionViewportIds = ["viewport-fusion-0", "viewport-fusion-1", "viewport-fusion-2", "viewport-fusion-3"]
|
||||
if(this.readingTool === 2){
|
||||
const fusionViewportIds = ['viewport-fusion-0', 'viewport-fusion-1', 'viewport-fusion-2', 'viewport-fusion-3']
|
||||
if (this.readingTool === 2) {
|
||||
const fusionElement1 = this.$refs['viewport-fusion-0'][0].$el
|
||||
const fusionElement2 = this.$refs['viewport-fusion-1'][0].$el
|
||||
const fusionElement3 = this.$refs['viewport-fusion-2'][0].$el
|
||||
const fusionElement4 = this.$refs['viewport-fusion-3'][0].$el
|
||||
let arr = [
|
||||
const arr = [
|
||||
{
|
||||
viewportId: 'viewport-fusion-0',
|
||||
type: ViewportType.ORTHOGRAPHIC,
|
||||
@@ -1104,7 +1114,7 @@ export default {
|
||||
}
|
||||
}
|
||||
]
|
||||
viewportInputArray = [ ...viewportInputArray, ...arr ]
|
||||
viewportInputArray = [...viewportInputArray, ...arr]
|
||||
viewportIds = viewportIds.concat(fusionViewportIds)
|
||||
}
|
||||
renderingEngine.setViewports(viewportInputArray)
|
||||
@@ -1170,28 +1180,28 @@ export default {
|
||||
toolGroup.addTool(CircleROITool.toolName, {
|
||||
getTextLines: this.getCircleROIToolTextLines
|
||||
})
|
||||
if(toolGroupId === 'viewport-fusion-3'){
|
||||
toolGroup.addTool(VolumeRotateTool.toolName);
|
||||
if (toolGroupId === 'viewport-fusion-3') {
|
||||
toolGroup.addTool(VolumeRotateTool.toolName)
|
||||
toolGroup.setToolActive(VolumeRotateTool.toolName, {
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: MouseBindings.Wheel, // mouse wheel
|
||||
},
|
||||
],
|
||||
});
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: MouseBindings.Wheel // mouse wheel
|
||||
}
|
||||
]
|
||||
})
|
||||
toolGroup.addTool(MIPJumpToClickTool.toolName, {
|
||||
targetViewportIds: fusionViewportIds,
|
||||
});
|
||||
targetViewportIds: fusionViewportIds
|
||||
})
|
||||
|
||||
// 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(MIPJumpToClickTool.toolName, {
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: MouseBindings.Primary, // Left Click
|
||||
},
|
||||
],
|
||||
});
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: MouseBindings.Primary // Left Click
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
toolGroup.setToolActive(StackScrollTool.toolName, {
|
||||
bindings: [{ mouseButton: MouseBindings.Wheel }]
|
||||
@@ -1229,7 +1239,7 @@ export default {
|
||||
|
||||
eventTarget.addEventListener('cornerstoneimageloadprogress', this.imageLoadProgress)
|
||||
console.log(Events, toolsEvents)
|
||||
if ( this.readingTool === 2 ) {
|
||||
if (this.readingTool === 2) {
|
||||
this.setUpSynchronizers()
|
||||
}
|
||||
},
|
||||
@@ -1327,6 +1337,11 @@ export default {
|
||||
toolsEvents.ANNOTATION_REMOVED,
|
||||
this.criterionType === 0 ? this.customAnnotationRemovedListener : this.annotationRemovedListener
|
||||
)
|
||||
eventTarget.addEventListener(
|
||||
toolsEvents.ANNOTATION_SELECTION_CHANGE,
|
||||
this.criterionType === 0 ? this.customAnnotationSelectionChangeListener : this.annotationSelectionChangeListener
|
||||
)
|
||||
|
||||
// eventTarget.addEventListener(
|
||||
// toolsEvents.ANNOTATION_ADDED,
|
||||
// this.annotationAddedListener
|
||||
@@ -1426,6 +1441,7 @@ export default {
|
||||
annotation.data.text = markName
|
||||
}
|
||||
this.saveCustomAnnotation(annotation)
|
||||
this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1468,15 +1484,33 @@ export default {
|
||||
const series = this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].series
|
||||
if (series && series.TaskInfo.VisitTaskId && series.TaskInfo.VisitTaskId === this.taskInfo.VisitTaskId) {
|
||||
this.saveCustomAnnotation(annotation)
|
||||
this.$refs[`ecrf_${series.TaskInfo.VisitTaskId}`][0].updateAnnotationToQuestion(annotation)
|
||||
}
|
||||
this.setToolsPassive()
|
||||
},
|
||||
async customAnnotationRemovedListener(e) {
|
||||
const { annotation } = e.detail
|
||||
try{
|
||||
try {
|
||||
// if ( this.resetAnnotation && this.isFusion ) return false
|
||||
if (!annotation) return false
|
||||
if (this.readingTaskState === 2) throw 'annotation Not allowed to operate'
|
||||
if (this.readingTaskState === 2) {
|
||||
const errorMsg = { message: 'annotation Not allowed to operate' }
|
||||
throw errorMsg
|
||||
}
|
||||
const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName)
|
||||
if (i === -1) {
|
||||
// 临时标记
|
||||
return
|
||||
}
|
||||
if (annotation.visitTaskId === this.taskInfo.VisitTaskId) {
|
||||
const isBound = this.$refs[`ecrf_${annotation.visitTaskId}`][0].verifyAnnotationIsBound(annotation)
|
||||
if (isBound) {
|
||||
this.$alert('该标记已与问题进行绑定,不允许删除!')
|
||||
const errorMsg = { message: 'annotation Not allowed to operate' }
|
||||
throw errorMsg
|
||||
}
|
||||
}
|
||||
|
||||
if (annotation.visitTaskId === this.taskInfo.VisitTaskId && annotation.seriesId) {
|
||||
if (this.activeTool === 'Eraser') {
|
||||
await this.$confirm(
|
||||
@@ -1499,9 +1533,10 @@ export default {
|
||||
viewport.render()
|
||||
}
|
||||
} else {
|
||||
throw 'annotation Not allowed to operate'
|
||||
const errorMsg = { message: 'annotation Not allowed to operate' }
|
||||
throw errorMsg
|
||||
}
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
cornerstoneTools.annotation.state.addAnnotation(annotation)
|
||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||
for (let i = 0; i < this.cells.length; i++) {
|
||||
@@ -1521,6 +1556,20 @@ export default {
|
||||
viewport.render()
|
||||
}
|
||||
},
|
||||
customAnnotationSelectionChangeListener(e) {
|
||||
if (this.readingTaskState === 2) return
|
||||
const { detail } = e
|
||||
const annotations = cornerstoneTools.annotation.state.getAllAnnotations()
|
||||
const i = annotations.findIndex(i => i.annotationUID === detail.selection[0])
|
||||
if (i > -1) {
|
||||
if (annotations[i].visitTaskId !== this.taskInfo.VisitTaskId) {
|
||||
return
|
||||
} else {
|
||||
this.$refs[`ecrf_${this.taskInfo.VisitTaskId}`][0].bindAnnotationToQuestion(annotations[i])
|
||||
}
|
||||
}
|
||||
},
|
||||
annotationSelectionChangeListener(e) {},
|
||||
async getAnnotations(visitTaskId) {
|
||||
if (this.readingTaskState === 2) return
|
||||
const taskIdx = this.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId)
|
||||
@@ -1872,8 +1921,10 @@ export default {
|
||||
const type = parseInt(value)
|
||||
// 1:默认值;2:垂直翻转;3:水平翻转;4:左转90度;5:右转90度;
|
||||
if (type === 1) {
|
||||
viewport.resetCamera()
|
||||
viewport.resetProperties()
|
||||
// viewport.resetCamera()
|
||||
// viewport.resetProperties()
|
||||
// viewport.render()
|
||||
viewport.setViewPresentation({ rotation: 0 })
|
||||
viewport.render()
|
||||
} else if (type === 2) {
|
||||
const { flipVertical } = viewport.getCamera()
|
||||
@@ -2035,8 +2086,8 @@ export default {
|
||||
const renderingEngine = getRenderingEngine(renderingEngineId)
|
||||
const viewport = renderingEngine.getViewport(`${this.viewportKey}-${this.activeViewportIndex}`)
|
||||
const { invert } = viewport.getProperties()
|
||||
if ( this.isFusion ) {
|
||||
viewport.setProperties({ invert: !invert }, this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].volumeId )
|
||||
if (this.isFusion) {
|
||||
viewport.setProperties({ invert: !invert }, this.$refs[`${this.viewportKey}-${this.activeViewportIndex}`][0].volumeId)
|
||||
}
|
||||
viewport.setProperties({ invert: !invert })
|
||||
viewport.render()
|
||||
@@ -2180,18 +2231,18 @@ export default {
|
||||
toggleFullScreen(e, index) {
|
||||
this.fullScreenIndex = this.fullScreenIndex === index ? null : index
|
||||
this.activeViewportIndex = index
|
||||
if ( this.isFusion ) {
|
||||
let viewportIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`]
|
||||
viewportIds.forEach(id=>{
|
||||
let index = this.$refs[id][0].series.SliceIndex
|
||||
if (this.isFusion) {
|
||||
const viewportIds = [`${this.viewportKey}-0`, `${this.viewportKey}-1`, `${this.viewportKey}-2`]
|
||||
viewportIds.forEach(id => {
|
||||
const index = this.$refs[id][0].series.SliceIndex
|
||||
this.$refs[id][0].setFullScreen(index)
|
||||
})
|
||||
}
|
||||
},
|
||||
async toggleTask(taskInfo, taskIndex) {
|
||||
if(this.isFusion){
|
||||
let confirm = await this.$confirm(this.$t('trials:reading:confirm:changeStack'))
|
||||
if(!confirm) return false
|
||||
if (this.isFusion) {
|
||||
const confirm = await this.$confirm(this.$t('trials:reading:confirm:changeStack'))
|
||||
if (!confirm) return false
|
||||
this.isFusion = false
|
||||
this.fullScreenIndex = null
|
||||
this.setToolsPassive()
|
||||
@@ -2261,9 +2312,9 @@ export default {
|
||||
this.setToolsPassive()
|
||||
},
|
||||
async activeSeries(obj) {
|
||||
if(this.isFusion){
|
||||
let confirm = await this.$confirm(this.$t('trials:reading:confirm:changeStack'))
|
||||
if(!confirm) return false
|
||||
if (this.isFusion) {
|
||||
const confirm = await this.$confirm(this.$t('trials:reading:confirm:changeStack'))
|
||||
if (!confirm) return false
|
||||
this.isFusion = false
|
||||
this.setToolsPassive()
|
||||
this.rows = 1
|
||||
@@ -2419,6 +2470,17 @@ export default {
|
||||
}
|
||||
return obj
|
||||
},
|
||||
viewCustomAnnotationSeries(obj) {
|
||||
const i = this.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||
if (i === -1) return
|
||||
const studyList = this.visitTaskList[i].StudyList
|
||||
const series = this.getMarkedSeries(studyList, obj.annotation)
|
||||
if (series) {
|
||||
this.$refs[`${this.viewportKey}-${this.cells.length - 1}`][0].setSeriesInfo(series, true)
|
||||
this.activeViewportIndex = i
|
||||
this.$refs[series.TaskInfo.VisitTaskId][0].setSeriesActive(series.StudyIndex, series.SeriesIndex)
|
||||
}
|
||||
},
|
||||
async getScreenshots(measureData, callback) {
|
||||
if (measureData) {
|
||||
await this.imageLocation(measureData)
|
||||
@@ -2644,7 +2706,7 @@ export default {
|
||||
}
|
||||
},
|
||||
showPanel(e, toolName) {
|
||||
if(toolName === 'layout' && this.isFusion) return false
|
||||
if (toolName === 'layout' && this.isFusion) return false
|
||||
e.currentTarget.firstChild.lastChild.style.display = 'block'
|
||||
},
|
||||
toolMouseout(e) {
|
||||
@@ -2661,67 +2723,67 @@ export default {
|
||||
},
|
||||
// 融合视口相机同步
|
||||
setUpSynchronizers() {
|
||||
let axialCameraPositionSynchronizer = createCameraPositionSynchronizer(
|
||||
const axialCameraPositionSynchronizer = createCameraPositionSynchronizer(
|
||||
'AXIAL_CAMERA_SYNCHRONIZER_ID'
|
||||
);
|
||||
let ctVoiSynchronizer = createVOISynchronizer('CT_VOI_SYNCHRONIZER_ID', {
|
||||
)
|
||||
const ctVoiSynchronizer = createVOISynchronizer('CT_VOI_SYNCHRONIZER_ID', {
|
||||
syncInvertState: false,
|
||||
syncColormap: false,
|
||||
});
|
||||
let ptVoiSynchronizer = createVOISynchronizer('PT_VOI_SYNCHRONIZER_ID', {
|
||||
syncColormap: false
|
||||
})
|
||||
const ptVoiSynchronizer = createVOISynchronizer('PT_VOI_SYNCHRONIZER_ID', {
|
||||
syncInvertState: false,
|
||||
syncColormap: false,
|
||||
});
|
||||
let fusionVoiSynchronizer = createVOISynchronizer('FUSION_VOI_SYNCHRONIZER_ID', {
|
||||
syncColormap: false
|
||||
})
|
||||
const fusionVoiSynchronizer = createVOISynchronizer('FUSION_VOI_SYNCHRONIZER_ID', {
|
||||
syncInvertState: false,
|
||||
syncColormap: false,
|
||||
syncColormap: false
|
||||
});
|
||||
[
|
||||
`viewport-fusion-0`,
|
||||
`viewport-fusion-1`,
|
||||
`viewport-fusion-2`,
|
||||
`viewport-fusion-2`
|
||||
].forEach((viewportId) => {
|
||||
axialCameraPositionSynchronizer.add({
|
||||
renderingEngineId: this.renderingEngineId,
|
||||
viewportId,
|
||||
});
|
||||
viewportId
|
||||
})
|
||||
});
|
||||
[
|
||||
`viewport-fusion-0`,
|
||||
`viewport-fusion-0`
|
||||
].forEach((viewportId) => {
|
||||
ctVoiSynchronizer.add({
|
||||
renderingEngineId: this.renderingEngineId,
|
||||
viewportId,
|
||||
});
|
||||
viewportId
|
||||
})
|
||||
});
|
||||
[
|
||||
`viewport-fusion-3`,
|
||||
`viewport-fusion-1`,
|
||||
`viewport-fusion-1`
|
||||
].forEach((viewportId) => {
|
||||
ptVoiSynchronizer.add({
|
||||
renderingEngineId: this.renderingEngineId,
|
||||
viewportId,
|
||||
});
|
||||
viewportId
|
||||
})
|
||||
});
|
||||
[
|
||||
`viewport-fusion-2`,
|
||||
`viewport-fusion-2`
|
||||
].forEach((viewportId) => {
|
||||
fusionVoiSynchronizer.add({
|
||||
renderingEngineId,
|
||||
viewportId,
|
||||
});
|
||||
viewportId
|
||||
})
|
||||
ctVoiSynchronizer.addTarget({
|
||||
renderingEngineId,
|
||||
viewportId,
|
||||
});
|
||||
viewportId
|
||||
})
|
||||
ptVoiSynchronizer.addTarget({
|
||||
renderingEngineId,
|
||||
viewportId,
|
||||
});
|
||||
});
|
||||
viewportId
|
||||
})
|
||||
})
|
||||
},
|
||||
setColorMap(rgbPresetName) {
|
||||
let fusionViewportIds = [`viewport-fusion-1`, `viewport-fusion-2`, `viewport-fusion-3`]
|
||||
const fusionViewportIds = [`viewport-fusion-1`, `viewport-fusion-2`, `viewport-fusion-3`]
|
||||
fusionViewportIds.forEach(id => {
|
||||
this.$refs[id][0].setPreset(rgbPresetName)
|
||||
this.$refs[id][0].renderColorBar(rgbPresetName)
|
||||
@@ -2729,25 +2791,25 @@ export default {
|
||||
})
|
||||
},
|
||||
voiChange(v) {
|
||||
let fusionViewportIds = [`viewport-fusion-1`, `viewport-fusion-2`, `viewport-fusion-3`]
|
||||
const fusionViewportIds = [`viewport-fusion-1`, `viewport-fusion-2`, `viewport-fusion-3`]
|
||||
fusionViewportIds.forEach(id => {
|
||||
this.$refs[id][0].voiChange(v)
|
||||
})
|
||||
},
|
||||
async handleFusion(data) {
|
||||
try{
|
||||
try {
|
||||
this.fusionVisible = false
|
||||
this.isFusion = true
|
||||
this.rows = 2;
|
||||
this.rows = 2
|
||||
this.cols = 2
|
||||
let { ct, pt } = data
|
||||
const { ct, pt } = data
|
||||
this.loading = true
|
||||
this.loadingText = this.$t('trials:lugano:message:loadVolumes')
|
||||
// this.resetAnnotation = true
|
||||
// console.log(cornerstoneTools.annotation.state.getAllAnnotations(),'cornerstoneTools.annotation.state')
|
||||
// cornerstoneTools.annotation.state.removeAllAnnotations()
|
||||
this.renderedTaskIds = []
|
||||
if ( this.verifyFusionData(ct, pt) ) {
|
||||
if (this.verifyFusionData(ct, pt)) {
|
||||
this.loading = false
|
||||
this.loadingText = null
|
||||
this.$refs[`viewport-0`][0].setSeriesInfo(ct)
|
||||
@@ -2757,10 +2819,10 @@ export default {
|
||||
// this.resetAnnotation = false
|
||||
return true
|
||||
}
|
||||
if (!this.fusionSerieId.ct || this.fusionSerieId.ct !== ct.SeriesInstanceUid ) {
|
||||
if (!this.fusionSerieId.ct || this.fusionSerieId.ct !== ct.SeriesInstanceUid) {
|
||||
this.fusionSerieId.ct = ct.SeriesInstanceUid
|
||||
}
|
||||
if (!this.fusionSerieId.pt || this.fusionSerieId.pt !== pt.SeriesInstanceUid ) {
|
||||
if (!this.fusionSerieId.pt || this.fusionSerieId.pt !== pt.SeriesInstanceUid) {
|
||||
this.fusionSerieId.pt = pt.SeriesInstanceUid
|
||||
}
|
||||
await this.getVolume(pt)
|
||||
@@ -2768,22 +2830,22 @@ export default {
|
||||
await this.getVolume(pt, true)
|
||||
this.loading = false
|
||||
this.loadingText = null
|
||||
let ctData = {
|
||||
const ctData = {
|
||||
data: ct,
|
||||
volumeId: this.volumeData[ct.SeriesInstanceUid].volumeId,
|
||||
volumeId: this.volumeData[ct.SeriesInstanceUid].volumeId
|
||||
}
|
||||
let ptData = {
|
||||
const ptData = {
|
||||
data: pt,
|
||||
volumeId: this.volumeData[pt.SeriesInstanceUid].volumeId,
|
||||
volume: this.volumeData[pt.SeriesInstanceUid].volume,
|
||||
volume: this.volumeData[pt.SeriesInstanceUid].volume
|
||||
}
|
||||
let fusionData = {
|
||||
const fusionData = {
|
||||
ct,
|
||||
data: pt,
|
||||
volumeId: this.volumeData[pt.SeriesInstanceUid].volumeId,
|
||||
ctVolumeId: this.volumeData[ct.SeriesInstanceUid].volumeId,
|
||||
ptVolumeId: this.volumeData[pt.SeriesInstanceUid].volumeId,
|
||||
fusionVolumeId: this.volumeData[`fusion_${pt.SeriesInstanceUid}`].volumeId,
|
||||
fusionVolumeId: this.volumeData[`fusion_${pt.SeriesInstanceUid}`].volumeId
|
||||
}
|
||||
this.$refs[`viewport-0`][0].setSeriesInfo(ct)
|
||||
this.$refs[`viewport-1`][0].setSeriesInfo(pt)
|
||||
@@ -2791,36 +2853,36 @@ export default {
|
||||
this.$refs[`viewport-3`][0].setSeriesInfo(pt)
|
||||
|
||||
this.$refs[`viewport-fusion-0`][0].setSeriesInfo(ctData)
|
||||
this.$refs[`viewport-fusion-1`][0].setSeriesInfo(ptData, { colorMap: true})
|
||||
this.$refs[`viewport-fusion-1`][0].setSeriesInfo(ptData, { colorMap: true })
|
||||
this.$refs[`viewport-fusion-2`][0].setSeriesInfo(fusionData, { isFusion: true, colorMap: true })
|
||||
this.$refs[`viewport-fusion-3`][0].setSeriesInfo(ptData, { isMip: true, colorMap: true })
|
||||
// this.resetAnnotation = false
|
||||
this.$nextTick(() => {
|
||||
this.$refs[`colorMap`].init()
|
||||
})
|
||||
}catch(err){
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
this.loadingText = null
|
||||
}
|
||||
},
|
||||
verifyFusionData(ct, pt) {
|
||||
if (this.fusionSerieId.ct === ct.SeriesInstanceUid && this.fusionSerieId.pt === pt.SeriesInstanceUid && cache.getVolume(this.volumeData[ct.SeriesInstanceUid].volumeId) && cache.getVolume(this.volumeData[pt.SeriesInstanceUid].volumeId) && cache.getVolume(this.volumeData[`fusion_${pt.SeriesInstanceUid}`].volumeId) ) {
|
||||
if (this.fusionSerieId.ct === ct.SeriesInstanceUid && this.fusionSerieId.pt === pt.SeriesInstanceUid && cache.getVolume(this.volumeData[ct.SeriesInstanceUid].volumeId) && cache.getVolume(this.volumeData[pt.SeriesInstanceUid].volumeId) && cache.getVolume(this.volumeData[`fusion_${pt.SeriesInstanceUid}`].volumeId)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
async getVolume(serie, isFusion = false ) {
|
||||
async getVolume(serie, isFusion = false) {
|
||||
return new Promise(async res => {
|
||||
let volumeId = null, volume = null
|
||||
let key = isFusion ? `fusion_${serie.SeriesInstanceUid}` : serie.SeriesInstanceUid
|
||||
if(!this.volumeData[key] || !cache.getVolume(this.volumeData[key].volumeId)) {
|
||||
if ( serie.Modality === 'PT' && !isFusion ) {
|
||||
let volumeId = null; let volume = null
|
||||
const key = isFusion ? `fusion_${serie.SeriesInstanceUid}` : serie.SeriesInstanceUid
|
||||
if (!this.volumeData[key] || !cache.getVolume(this.volumeData[key].volumeId)) {
|
||||
if (serie.Modality === 'PT' && !isFusion) {
|
||||
serie.ImageIds.forEach(async id => {
|
||||
const imageLoadObject = cache.getImage(id);
|
||||
const imageLoadObject = cache.getImage(id)
|
||||
if (imageLoadObject) {
|
||||
await new Promise(res => {
|
||||
cache.removeImageLoadObject(id, {force:true}); // 从缓存中删除
|
||||
cache.removeImageLoadObject(id, { force: true }) // 从缓存中删除
|
||||
res()
|
||||
})
|
||||
}
|
||||
@@ -2846,11 +2908,11 @@ export default {
|
||||
this.$refs.colorMap.upperRangeChange(upper)
|
||||
},
|
||||
openFusion() {
|
||||
this.fusionVisible = true
|
||||
this.fusionVisible = true
|
||||
},
|
||||
closeFusion() {
|
||||
this.fusionVisible = false
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
+1157
File diff suppressed because it is too large
Load Diff
+153
-7
@@ -32,9 +32,13 @@
|
||||
:reading-task-state="readingTaskState"
|
||||
:criterion-id="criterionId"
|
||||
:calculation-list="calculationList"
|
||||
:question-mark-info-list="questionMarkInfoList"
|
||||
:questions-mark-status="questionsMarkStatus"
|
||||
:is-baseline="isBaseLineTask"
|
||||
@resetFormItemData="resetFormItemData"
|
||||
@setFormItemData="setFormItemData"
|
||||
@getQuestions="getQuestions"
|
||||
@operateImageMarker="operateImageMarker"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -74,10 +78,10 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { getCustomTableQuestionAnswer, changeDicomReadingQuestionAnswer, submitVisitTaskQuestionsInDto, getQuestionCalculateRelation } from '@/api/trials'
|
||||
import { getCustomTableQuestionAnswer, changeDicomReadingQuestionAnswer, submitVisitTaskQuestionsInDto, getQuestionCalculateRelation, saveTaskQuestion } from '@/api/trials'
|
||||
import { setSkipReadingCache, resetReadingTask } from '@/api/reading'
|
||||
import const_ from '@/const/sign-code'
|
||||
import QuestionFormItem from '@/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem'
|
||||
import QuestionFormItem from './QuestionFormItem'
|
||||
import SignForm from '@/views/trials/components/newSignForm'
|
||||
export default {
|
||||
name: 'EcrfList',
|
||||
@@ -93,7 +97,7 @@ export default {
|
||||
readingTaskState: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -112,7 +116,13 @@ export default {
|
||||
calculationList: [],
|
||||
taskInfo: null,
|
||||
isBaseLineTask: false,
|
||||
rerender: true
|
||||
rerender: true,
|
||||
questionMarkInfoList: [],
|
||||
operateStateEnum: null, // 1:标记;2:查看;3:更改;4:移除;5:保存
|
||||
operateQuestionId: '',
|
||||
operateRowId: '',
|
||||
questionsMarkStatus: {}, // 1:未保存;2:已保存
|
||||
digitPlaces: 2
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -121,6 +131,8 @@ export default {
|
||||
this.taskInfo = JSON.parse(localStorage.getItem('taskInfo'))
|
||||
this.isBaseLineTask = this.taskInfo.IsBaseLine
|
||||
this.criterionType = this.taskInfo.CriterionType
|
||||
const digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
this.getQuestionCalculateRelation()
|
||||
this.getQuestions()
|
||||
},
|
||||
@@ -153,6 +165,16 @@ export default {
|
||||
}
|
||||
})
|
||||
this.questions = res.Result.SinglePage
|
||||
this.questionsMarkStatus = {}
|
||||
this.questionMarkInfoList = res.OtherInfo.QuestionMarkInfoList.map(i => {
|
||||
if (i.QuestionId && i.MeasureData) {
|
||||
this.$set(this.questionsMarkStatus, i.QuestionId, 2)
|
||||
}
|
||||
if (typeof i.MeasureData === 'string' && i.MeasureData) {
|
||||
i.MeasureData = JSON.parse(i.MeasureData)
|
||||
}
|
||||
return i
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -325,6 +347,130 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
verifyAnnotationIsBound(annotation) {
|
||||
const i = this.questionMarkInfoList.findIndex(i => i.MeasureData && i.MeasureData.annotationUID === annotation.annotationUID)
|
||||
return i > -1
|
||||
},
|
||||
async operateImageMarker(obj) {
|
||||
this.operateStateEnum = obj.operateStateEnum
|
||||
this.operateQuestionId = obj.question.Id
|
||||
if (obj.operateStateEnum === 1) {
|
||||
// 添加标记
|
||||
|
||||
} else if (obj.operateStateEnum === 2) {
|
||||
// 查看标记
|
||||
const i = this.questionMarkInfoList.findIndex(i => i.QuestionId === obj.question.Id)
|
||||
if (i > -1) {
|
||||
const annotation = this.questionMarkInfoList[i].MeasureData
|
||||
this.$emit('viewCustomAnnotationSeries', { visitTaskId: this.visitTaskId, annotation })
|
||||
}
|
||||
} else if (obj.operateStateEnum === 3) {
|
||||
// 更改标记
|
||||
// this.$set(this.questionsMarkStatus, obj.question.Id, 1)
|
||||
} else if (obj.operateStateEnum === 4) {
|
||||
// 移除标记
|
||||
this.$set(this.questionForm, obj.question.Id, '')
|
||||
const i = this.questionMarkInfoList.findIndex(i => i.QuestionId === obj.question.Id)
|
||||
if (i > -1) {
|
||||
this.questionMarkInfoList.splice(i, 1)
|
||||
}
|
||||
this.$set(this.questionsMarkStatus, obj.question.Id, 0)
|
||||
} else if (obj.operateStateEnum === 5) {
|
||||
// 保存标记
|
||||
this.loading = true
|
||||
try {
|
||||
const answers = []
|
||||
answers.push({ id: obj.question.Id, answer: this.questionForm[obj.question.Id] })
|
||||
const markInfo = []
|
||||
const i = this.questionMarkInfoList.findIndex(i => i.QuestionId === this.operateQuestionId)
|
||||
if (i > -1) {
|
||||
const obj = Object.assign({}, this.questionMarkInfoList[i])
|
||||
obj.MeasureData = obj.MeasureData ? JSON.stringify(obj.MeasureData) : ''
|
||||
markInfo.push(obj)
|
||||
}
|
||||
const params = {
|
||||
visitTaskId: this.visitTaskId,
|
||||
answers: answers,
|
||||
questionMarkInfoList: markInfo
|
||||
}
|
||||
await saveTaskQuestion(-10, params)
|
||||
|
||||
this.$set(this.questionsMarkStatus, obj.question.Id, 2)
|
||||
this.loading = false
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
},
|
||||
async bindAnnotationToQuestion(annotation) {
|
||||
try {
|
||||
if (!(this.operateStateEnum === 1 || this.operateStateEnum === 3)) return
|
||||
if (!this.operateQuestionId) return
|
||||
if (this.operateStateEnum === 3) {
|
||||
if (!annotation.data.label) {
|
||||
this.$alert('该标记不能与问题绑定!')
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('是否确认更改?', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
})
|
||||
if (confirm !== 'confirm') return
|
||||
}
|
||||
console.log('bindAnnotationToQuestion', annotation)
|
||||
|
||||
const i = this.questionMarkInfoList.findIndex(i => i.QuestionId === this.operateQuestionId)
|
||||
if (i === -1) {
|
||||
const markInfo = {
|
||||
QuestionId: this.operateQuestionId,
|
||||
InstanceId: annotation.instanceId,
|
||||
SeriesId: annotation.seriesId,
|
||||
StudyId: annotation.studyId,
|
||||
MarkTool: annotation.metadata.toolName,
|
||||
PicturePath: '',
|
||||
NumberOfFrames: annotation.numberOfFrames,
|
||||
MeasureData: annotation
|
||||
}
|
||||
this.questionMarkInfoList.push(markInfo)
|
||||
} else {
|
||||
this.questionMarkInfoList[i].InstanceId = annotation.instanceId
|
||||
this.questionMarkInfoList[i].SeriesId = annotation.seriesId
|
||||
this.questionMarkInfoList[i].StudyId = annotation.studyId
|
||||
this.questionMarkInfoList[i].MarkTool = annotation.metadata.toolName
|
||||
this.questionMarkInfoList[i].PicturePath = ''
|
||||
this.questionMarkInfoList[i].NumberOfFrames = annotation.numberOfFrames
|
||||
this.questionMarkInfoList[i].MeasureData = annotation
|
||||
}
|
||||
this.setAnswerToQuestion(annotation, this.operateQuestionId)
|
||||
this.$set(this.questionsMarkStatus, this.operateQuestionId, 1)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
updateAnnotationToQuestion(annotation) {
|
||||
console.log('updateAnnotationToQuestion', annotation)
|
||||
const i = this.questionMarkInfoList.findIndex(i => i.MeasureData && i.MeasureData.annotationUID === annotation.annotationUID)
|
||||
if (i === -1) return
|
||||
this.questionMarkInfoList[i].measureData = annotation
|
||||
this.setAnswerToQuestion(annotation, this.questionMarkInfoList[i].QuestionId)
|
||||
this.$set(this.questionsMarkStatus, this.questionMarkInfoList[i].QuestionId, 1)
|
||||
},
|
||||
setAnswerToQuestion(annotation, questionId) {
|
||||
if (!questionId || !annotation) return
|
||||
const referencedImageId = annotation.metadata.referencedImageId
|
||||
if (annotation.metadata.toolName === 'Length') {
|
||||
let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
|
||||
length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
|
||||
this.$set(this.questionForm, questionId, length)
|
||||
} else if (annotation.metadata.toolName === 'Bidirectional') {
|
||||
// let length = annotation.data.cachedStats[`imageId:${referencedImageId}`].length
|
||||
// length = length ? parseFloat(length).toFixed(this.digitPlaces) : length
|
||||
let short = annotation.data.cachedStats[`imageId:${referencedImageId}`].width
|
||||
short = short ? parseFloat(short).toFixed(this.digitPlaces) : short
|
||||
this.$set(this.questionForm, questionId, short)
|
||||
}
|
||||
},
|
||||
async resetForm() {
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:dicomReading:message:confirmReset1'),
|
||||
@@ -343,7 +489,7 @@ export default {
|
||||
await this.getQuestionCalculateRelation()
|
||||
await this.getQuestions()
|
||||
this.$emit('resetAnnotations', this.visitTaskId)
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.rerender = true
|
||||
})
|
||||
}
|
||||
@@ -352,7 +498,7 @@ export default {
|
||||
loading.close()
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -433,6 +579,6 @@ export default {
|
||||
// .ecrf-list-container{
|
||||
// min-height:400px;
|
||||
// color: #ddd;
|
||||
|
||||
|
||||
// }
|
||||
</style>
|
||||
|
||||
+576
@@ -0,0 +1,576 @@
|
||||
<template>
|
||||
<div class="criterion-form-item">
|
||||
<el-form-item
|
||||
v-if="(question.ShowQuestion===1 && !!~question.ParentTriggerValueList.indexOf(questionForm[question.ParentId])) || question.ShowQuestion===0"
|
||||
:label="`${question.QuestionName}`"
|
||||
:prop="question.Id"
|
||||
:rules="[
|
||||
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type!=='group' && question.Type!=='summary',
|
||||
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']},
|
||||
]"
|
||||
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
|
||||
>
|
||||
<!-- 输入框 -->
|
||||
<el-input
|
||||
v-if="question.Type==='input'"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
/>
|
||||
<!-- 多行文本输入框 -->
|
||||
<el-input
|
||||
v-if="question.Type==='textarea'"
|
||||
v-model="questionForm[question.Id]"
|
||||
type="textarea"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
/>
|
||||
<!-- 下拉框 -->
|
||||
<el-select
|
||||
v-if="question.Type==='select'"
|
||||
v-model="questionForm[question.Id]"
|
||||
clearable
|
||||
:disabled="(question.TableQuestionType === 2 || question.QuestionGenre === 2) || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
@change="((val)=>{formItemChange(val, question)})"
|
||||
>
|
||||
<template v-if="question.TableQuestionType === 1">
|
||||
<el-option
|
||||
v-for="item in organList"
|
||||
:key="item.Id"
|
||||
:label="item[question.DataTableColumn]"
|
||||
:value="item[question.DataTableColumn]"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
|
||||
<el-option
|
||||
v-for="item of $d[question.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
|
||||
<el-option
|
||||
v-for="item of $d[question.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
:value="val"
|
||||
/>
|
||||
</template>
|
||||
|
||||
</el-select>
|
||||
<!-- 单选 -->
|
||||
<el-radio-group
|
||||
v-if="question.Type==='radio'"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
@change="((val)=>{formItemChange(val, question)})"
|
||||
>
|
||||
<el-radio
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
>
|
||||
{{ val }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- 复选框 -->
|
||||
<el-checkbox-group
|
||||
v-if="question.Type==='checkbox'"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
v-model="questionForm[question.Id]"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
>
|
||||
{{ val }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<!-- 自动分类 -->
|
||||
<el-input
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
||||
v-model="questionForm[question.Id]"
|
||||
/>
|
||||
<el-select
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 2"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType"
|
||||
@change="(val) => { formItemChange(val, question) }"
|
||||
>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val.trim()"
|
||||
:value="val.trim()"
|
||||
/>
|
||||
</el-select>
|
||||
<el-radio-group
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType"
|
||||
@change="(val) => { formItemChange(val, question) }"
|
||||
>
|
||||
<el-radio
|
||||
v-for="item of question.TypeValue.split('|')"
|
||||
:key="item.trim()"
|
||||
:label="item.trim()"
|
||||
>
|
||||
{{ item.trim() }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- 自动计算 -->
|
||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||
<el-input
|
||||
v-if="question.Type==='calculation'"
|
||||
v-model="questionForm[question.Id]"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')"
|
||||
disabled
|
||||
/>
|
||||
<!-- 自增 -->
|
||||
<el-input
|
||||
v-if="question.Type==='increment'"
|
||||
v-model="questionForm[question.Id]"
|
||||
disabled
|
||||
/>
|
||||
<!-- 数值 -->
|
||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||
<el-input
|
||||
type="number"
|
||||
v-if="question.Type === 'number' && question.DataSource !== 1"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
@change="((val)=>{formItemNumberChange(val, question)})"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
v-model="questionForm[question.Id]"
|
||||
>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
</el-input>
|
||||
<el-input
|
||||
type="number"
|
||||
v-if="question.Type === 'number' && question.DataSource === 1"
|
||||
:disabled="question.DataSource === 1"
|
||||
@blur="handleCalculationBlur(calculationValue)"
|
||||
v-model="calculationValue"
|
||||
>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
</el-input>
|
||||
<!-- 上传图像 -->
|
||||
<el-upload
|
||||
v-if="question.Type==='upload'"
|
||||
action
|
||||
:accept="question.FileType"
|
||||
:limit="question.ImageCount === 0 ? 100 : question.ImageCount"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:http-request="uploadScreenshot"
|
||||
list-type="picture-card"
|
||||
:on-remove="handleRemove"
|
||||
:file-list="fileList"
|
||||
:class="{disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount}"
|
||||
>
|
||||
<i slot="default" class="el-icon-plus" />
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<viewer
|
||||
:ref="file.url"
|
||||
:images="[imageUrl]"
|
||||
style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
"
|
||||
>
|
||||
<img
|
||||
class="el-upload-list__item-thumbnail"
|
||||
:src="OSSclientConfig.basePath + file.url"
|
||||
crossOrigin="anonymous"
|
||||
alt=""
|
||||
style="max-width: 100%; max-height: 100%"
|
||||
/>
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span
|
||||
class="el-upload-list__item-preview"
|
||||
@click="handlePictureCardPreview(file)"
|
||||
>
|
||||
<i class="el-icon-zoom-in" />
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-if="readingTaskState < 2"
|
||||
class="el-upload-list__item-delete"
|
||||
@click="handleRemove(file)"
|
||||
>
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</viewer>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-dialog
|
||||
v-if="question.Type==='upload'"
|
||||
append-to-body
|
||||
:visible.sync="imgVisible"
|
||||
width="600px"
|
||||
>
|
||||
<el-image :src="imageUrl" width="100%">
|
||||
<div slot="placeholder" class="image-slot">
|
||||
{{$t('trials:readingUnit:qsList:message:loading')}}<span class="dot">...</span>
|
||||
</div>
|
||||
</el-image>
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'QuestionTableFormItem',
|
||||
props: {
|
||||
isBaseline: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
questionForm: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
question: {
|
||||
type: Object,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
criterionId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
calculationList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
readingTaskState: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
visitTaskId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'add'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
calculationValue: {
|
||||
get() {
|
||||
return this.questionForm[this.question.Id]
|
||||
},
|
||||
set() {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addOrEdit: { visible: false, title: '' },
|
||||
fileList: [],
|
||||
accept: '.png,.jpg,.jpeg',
|
||||
imgVisible: false,
|
||||
imageUrl: '',
|
||||
urls: [],
|
||||
organList: [],
|
||||
QuestionsList: [],
|
||||
QuestionsForm: {},
|
||||
digitPlaces: 2
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
questionForm: {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler(v, oldv) {
|
||||
// try {
|
||||
// if (!v[this.question.Id] || !oldv[this.question.Id]) return
|
||||
// } catch (e) {
|
||||
// }
|
||||
// this.formItemNumberChange(this.question.Id, false)
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
if (this.question.Type === 'upload') {
|
||||
if (this.questionForm[this.question.Id]) {
|
||||
this.urls = this.questionForm[this.question.Id].split('|')
|
||||
this.fileList = []
|
||||
this.urls.map(url => {
|
||||
this.fileList.push({ name: '', url: `${url}` })
|
||||
})
|
||||
}
|
||||
}
|
||||
if (this.type === 'edit') return
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
},
|
||||
openAddTableCol(row) {
|
||||
this.addOrEdit.visible = true
|
||||
this.addOrEdit.title = row.QuestionName + this.$t('trials:readingUnit:qsList:title:tableQs')
|
||||
this.QuestionsList = row.TableQuestions.Questions
|
||||
this.AnswersList = row.TableQuestions.Answers
|
||||
this.QuestionsForm = {}
|
||||
},
|
||||
formItemChange(v, question) {
|
||||
if (question.Childrens && question.Childrens.length > 0) {
|
||||
this.resetChild(question.Childrens)
|
||||
}
|
||||
if (question.TableQuestionType === 1 && question.RelationQuestions.length > 0) {
|
||||
var index = this.organList.findIndex(item => item[question.DataTableColumn] === v)
|
||||
if (index < 0) return
|
||||
var selected = this.organList[index]
|
||||
this.question.RelationQuestions.map(qs => {
|
||||
var val = selected[qs.DataTableColumn]
|
||||
// if (typeof val === 'boolean') {
|
||||
// // val = String(val)
|
||||
// }
|
||||
this.$emit('setFormItemData', { key: qs.Id, val: val, question: qs })
|
||||
})
|
||||
} else {
|
||||
this.$emit('setFormItemData', { key: question.Id, val: v, question: question })
|
||||
}
|
||||
},
|
||||
handleBlur(value, a, b) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
},
|
||||
handleCalculationBlur(v) {
|
||||
this.calculationValue = parseFloat(v).toFixed(this.digitPlaces)
|
||||
},
|
||||
limitInput(value, q) {
|
||||
if (value.indexOf('.') > -1) {
|
||||
if (value.split('.')[1].length >= this.digitPlaces) {
|
||||
this.$set(this.questionForm, q.Id, parseFloat(value).toFixed(this.digitPlaces))
|
||||
}
|
||||
} else {
|
||||
}
|
||||
},
|
||||
logic(rules, num = 0) {
|
||||
try {
|
||||
if (rules.CalculateQuestionList.length === 0) {
|
||||
return false
|
||||
}
|
||||
let dataArr = []
|
||||
var count = 0
|
||||
var maxList = [], minList = []
|
||||
rules.CalculateQuestionList.forEach((o, i) => {
|
||||
if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) {
|
||||
if (i !== 0) {
|
||||
switch (rules.CustomCalculateMark) {
|
||||
case 7:
|
||||
count += parseFloat(this.questionForm[o.TableQuestionId])
|
||||
if (i === rules.CalculateQuestionList.length - 1) {
|
||||
num = count / rules.CalculateQuestionList.length
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
maxList.push(this.questionForm[o.TableQuestionId])
|
||||
if (i === rules.CalculateQuestionList.length - 1) {
|
||||
num = Math.max(...maxList)
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
minList.push(this.questionForm[o.TableQuestionId])
|
||||
if (i === rules.CalculateQuestionList.length - 1) {
|
||||
num = Math.min(...minList)
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
maxList.push(this.questionForm[o.TableQuestionId])
|
||||
minList.push(this.questionForm[o.TableQuestionId])
|
||||
count = parseFloat(this.questionForm[o.TableQuestionId])
|
||||
num = parseFloat(this.questionForm[o.TableQuestionId])
|
||||
dataArr.push(num)
|
||||
}
|
||||
} else {
|
||||
if (i !== 0) {
|
||||
switch (rules.CustomCalculateMark) {
|
||||
case 1:
|
||||
num += parseFloat(this.questionForm[o.TableQuestionId])
|
||||
break;
|
||||
case 2:
|
||||
num -= parseFloat(this.questionForm[o.TableQuestionId])
|
||||
break;
|
||||
case 3:
|
||||
num *= parseFloat(this.questionForm[o.TableQuestionId])
|
||||
break;
|
||||
case 4:
|
||||
if (parseFloat(this.questionForm[o.TableQuestionId]) === 0) {
|
||||
num = 0
|
||||
} else {
|
||||
num /= parseFloat(this.questionForm[o.TableQuestionId])
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
|
||||
return acc + (typeof curr === "number" ? curr : 0);
|
||||
}, 0) / dataArr.length;
|
||||
break;
|
||||
case 11:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = Math.max(...dataArr);
|
||||
break;
|
||||
case 12:
|
||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||
}
|
||||
num = Math.min(...dataArr);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
num = parseFloat(this.questionForm[o.TableQuestionId])
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
if (rules.ValueType === 2) {
|
||||
num = num * 100
|
||||
}
|
||||
return num.toFixed(this.digitPlaces)
|
||||
},
|
||||
formItemNumberChange(v, question) {
|
||||
this.$emit('formItemTableNumberChange', v, question)
|
||||
// this.$emit('formItemTableNumberChange', v, question)
|
||||
},
|
||||
resetChild(obj) {
|
||||
obj.forEach(i => {
|
||||
this.$emit('resetFormItemData', i.Id)
|
||||
if (i.Childrens && i.Childrens.length > 0) {
|
||||
this.resetChild(i.Childrens)
|
||||
}
|
||||
})
|
||||
},
|
||||
resetFormItemData(v) {
|
||||
this.$emit('resetFormItemData', v)
|
||||
},
|
||||
setFormItemData(obj) {
|
||||
this.$emit('setFormItemData', obj)
|
||||
},
|
||||
async uploadScreenshot(param) {
|
||||
if (!this.visitTaskId) return
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.el-dialog'),
|
||||
fullscreen: false,
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading'
|
||||
})
|
||||
var trialId = this.$route.query.trialId
|
||||
var subjectId = this.$route.query.trialId
|
||||
var file = await this.fileToBlob(param.file)
|
||||
const res = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${param.file.name}`, file)
|
||||
this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)})
|
||||
this.urls.push(this.$getObjectName(res.url))
|
||||
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||
loading.close()
|
||||
},
|
||||
handleBeforeUpload(file) {
|
||||
// 检测文件类型是否符合要求
|
||||
if (this.checkFileSuffix(file.name)) {
|
||||
// this.fileList = []
|
||||
return true
|
||||
} else {
|
||||
let msg = this.$t(
|
||||
"trials:readingUnit:qsList:message:imageFormat"
|
||||
).replace("xxx", this.question.FileType)
|
||||
this.$alert(msg)
|
||||
return false
|
||||
}
|
||||
},
|
||||
checkFileSuffix(fileName) {
|
||||
var index = fileName.lastIndexOf('.')
|
||||
var suffix = fileName.substring(index + 1, fileName.length)
|
||||
if (this.question.FileType.toLocaleLowerCase().search(suffix.toLocaleLowerCase()) === -1) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
},
|
||||
// 预览图片
|
||||
handlePictureCardPreview(file) {
|
||||
var suffix = file.url.substring(file.url.lastIndexOf(".")+1)
|
||||
suffix = suffix ? suffix.toLowerCase() : ''
|
||||
if (suffix === 'doc' || suffix === 'docx' || suffix === 'pdf'){
|
||||
window.open(this.OSSclientConfig.basePath + file.url,'_blank')
|
||||
}else{
|
||||
this.imageUrl = this.OSSclientConfig.basePath + file.url
|
||||
// this.imgVisible = true
|
||||
this.$refs[file.url].$viewer.show()
|
||||
}
|
||||
|
||||
},
|
||||
// 删除图片
|
||||
handleRemove(file, fileList) {
|
||||
this.imageUrl = ''
|
||||
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
|
||||
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
|
||||
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '', question: this.question })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.my_dialog{
|
||||
.criterion-form-item{
|
||||
::v-deep .el-form-item__content{
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
.criterion-form-item{
|
||||
.el-form-item{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
::v-deep .el-form-item__content{
|
||||
width: 500px;
|
||||
}
|
||||
.el-input{
|
||||
width:100%;
|
||||
}
|
||||
.mb{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.disabled{
|
||||
::v-deep .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.uploadWrapper{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -45,7 +45,7 @@
|
||||
<el-input
|
||||
v-model="scope.row.CDISCCode"
|
||||
size="mini"
|
||||
:disabled="scope.row.HasChildren || scope.row.IsTableQuestion"
|
||||
:disabled="scope.row.HasChildren || (scope.row.IsTableQuestion && exportInfo.CriterionType !== 0)"
|
||||
v-show="!scope.row.IsGroup || !scope.row.HasChildren"
|
||||
>
|
||||
</el-input>
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
exportInfo: []
|
||||
exportInfo: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -152,7 +152,8 @@ export default {
|
||||
} else if ((this.exportInfo.CriterionGroup === 0 || this.exportInfo.CriterionType === 0 ) && item.Code === 1 && (row.HasChildren || row.IsTableQuestion)) {
|
||||
// 自定义或非肿瘤阅片标准阅片结果表(1)不能配置表格问题
|
||||
return true
|
||||
} else if (item.Code === 8 && (row.HasChildren || row.IsTableQuestion)) {
|
||||
} else if (item.Code === 8 && (row.HasChildren || (row.IsTableQuestion && this.exportInfo.CriterionType !== 0))) {
|
||||
// else if (item.Code === 8 && (row.HasChildren || row.IsTableQuestion))
|
||||
// CDISC导出不能配置表格问题
|
||||
return true
|
||||
} else if (item.Code === 2 && row.HasChildren) {
|
||||
|
||||
@@ -738,7 +738,7 @@ export default {
|
||||
},
|
||||
handleIsDeletedChanged(val) {
|
||||
if (val) {
|
||||
this.statusForm.joinTime = ''
|
||||
// this.statusForm.joinTime = ''
|
||||
} else {
|
||||
this.statusForm.removeTime = ''
|
||||
}
|
||||
|
||||
@@ -727,6 +727,19 @@
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 影像标记 -->
|
||||
<el-form-item
|
||||
v-if="form.Type === 'number' && !isFromSystem"
|
||||
:label="$t('trials:readingUnit:qsList:title:imageMarkEnum')"
|
||||
prop="ImageMarkEnum"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="form.ImageMarkEnum"
|
||||
:disabled="form.IsRequired === 0"
|
||||
>
|
||||
<el-radio v-for="item of $d.ImageMark" :key="item.id" :label="item.value" :disabled="form.IsRequired === 2 && item.value === 1">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 最大上传个数 -->
|
||||
<el-form-item
|
||||
v-if="form.Type === 'upload'"
|
||||
@@ -1071,7 +1084,8 @@ export default {
|
||||
ExportResult: [],
|
||||
ClassifyType: null,
|
||||
ClassifyEditType: null,
|
||||
ClassifyShowType: null
|
||||
ClassifyShowType: null,
|
||||
ImageMarkEnum: 0
|
||||
// IsEnable: true
|
||||
},
|
||||
rules: {
|
||||
@@ -1456,6 +1470,12 @@ export default {
|
||||
form.RelevanceId = ''
|
||||
form.RelevanceValueList = []
|
||||
}
|
||||
if (val === 0 && form.Type === 'number' && !this.isFromSystem) {
|
||||
form.ImageMarkEnum = 1
|
||||
}
|
||||
if (val === 2 && form.Type === 'number' && !this.isFromSystem) {
|
||||
form.ImageMarkEnum = 0
|
||||
}
|
||||
},
|
||||
parentQuestionChange(val, form) {
|
||||
console.log(val)
|
||||
@@ -1550,6 +1570,7 @@ export default {
|
||||
form.ExportResult = []
|
||||
form.ClassifyType = null
|
||||
form.ClassifyShowType = null
|
||||
form.ImageMarkEnum = 0
|
||||
},
|
||||
getLesionType() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -429,6 +429,22 @@
|
||||
<i class="el-icon-info" />{{ [1, 2, 3, 4].includes(form.CustomCalculateMark) ? $t('trials:readingUnit:qsList:message:msg1') : $t('trials:readingUnit:qsList:message:msg2') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 影像标记 -->
|
||||
<el-form-item
|
||||
v-if="form.Type === 'number' && !isFromSystem"
|
||||
:label="$t('trials:readingUnit:qsList:title:imageMarkEnum')"
|
||||
prop="ImageMarkEnum"
|
||||
:rules="[
|
||||
{ required: true, message: this.$t('common:ruleMessage:select')}
|
||||
]"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="form.ImageMarkEnum"
|
||||
:disabled="form.IsRequired === 0"
|
||||
>
|
||||
<el-radio v-for="item of $d.ImageMark" :key="item.id" :label="item.value" :disabled="form.IsRequired === 2 && item.value === 1">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="(form.Type === 'select' || form.Type === 'radio' || form.Type === 'input') && isFromSystem"
|
||||
:label="$t('trials:readingUnit:label:QuestionGenre')"
|
||||
@@ -896,6 +912,7 @@ export default {
|
||||
ClassifyType: null,
|
||||
ClassifyEditType: null,
|
||||
ClassifyShowType: null,
|
||||
ImageMarkEnum: 0
|
||||
// IsEnable: true
|
||||
},
|
||||
rules: {
|
||||
@@ -1263,6 +1280,12 @@ export default {
|
||||
form.RelevanceId = ''
|
||||
form.RelevanceValueList = []
|
||||
}
|
||||
if (val === 0 && form.Type === 'number' && !this.isFromSystem) {
|
||||
form.ImageMarkEnum = 1
|
||||
}
|
||||
if (val === 2 && form.Type === 'number' && !this.isFromSystem) {
|
||||
form.ImageMarkEnum = 0
|
||||
}
|
||||
},
|
||||
async parentQuestionChange(val, form) {
|
||||
if (val) {
|
||||
@@ -1372,6 +1395,7 @@ export default {
|
||||
form.ImageCount = 0
|
||||
form.ClassifyType = null
|
||||
form.ClassifyShowType = null
|
||||
form.ImageMarkEnum = 0
|
||||
},
|
||||
close() {
|
||||
this.$emit('close')
|
||||
|
||||
Reference in New Issue
Block a user