非dicom阅片ecrf更改

uat
caiyiling 2025-03-17 11:23:24 +08:00
parent 2fd6e1893b
commit 00cc5d5d27
3 changed files with 62 additions and 13 deletions

View File

@ -108,6 +108,7 @@ export default {
const res = await getNextTask(params)
this.taskInfo = res.Result
localStorage.setItem('taskInfo', JSON.stringify(res.Result))
localStorage.setItem('digitPlaces', JSON.stringify(res.Result.DigitPlaces))
this.loading = false
this.$nextTick(() => {
if (this.taskInfo.IsExistsClinicalData && this.taskInfo.IsNeedReadClinicalData && !this.taskInfo.IsReadClinicalData) {

View File

@ -70,6 +70,13 @@
>
<svg-icon icon-class="clear" class="svg-icon" />
</div>
<!-- <div
:class="['tool-item', readingTaskState === 2 ? 'tool-disabled' : '', activeTool === 'Length' ? 'tool-item-active' : '']"
:title="$t('trials:dicom-show:length')"
@click.prevent="setAnnotateToolActive('Length')"
>
<svg-icon icon-class="length" class="svg-icon" />
</div> -->
<!-- 截图 -->
<!-- <div
class="tool-item"
@ -212,7 +219,8 @@ import {
imageLoader,
metaData,
getRenderingEngine,
eventTarget
eventTarget,
utilities as csUtils
// getEnabledElementByIds
} from '@cornerstonejs/core'
@ -234,7 +242,8 @@ const {
ArrowAnnotateTool,
RectangleROITool,
PlanarFreehandROITool,
EraserTool
EraserTool,
LengthTool
// cursors
} = cornerstoneTools
const { MouseBindings, Events: toolsEvents } = csToolsEnums
@ -405,6 +414,8 @@ export default {
cornerstoneTools.addTool(RectangleROITool)
cornerstoneTools.addTool(PlanarFreehandROITool)
cornerstoneTools.addTool(EraserTool)
cornerstoneTools.addTool(LengthTool)
viewportIds.forEach((viewportId, i) => {
const toolGroupId = `canvas-${i}`
@ -425,10 +436,14 @@ export default {
})
toolGroup.addTool(RectangleROITool.toolName)
toolGroup.addTool(PlanarFreehandROITool.toolName, {
allowOpenContours: false
// cachedStats: false
allowOpenContours: false,
cachedStats: false
})
toolGroup.addTool(EraserTool.toolName)
toolGroup.addTool(LengthTool.toolName, {
getTextLines: this.getLengthToolTextLines
})
toolGroup.setToolActive(StackScrollTool.toolName, {
bindings: [{ mouseButton: MouseBindings.Wheel }]
})
@ -439,10 +454,12 @@ export default {
toolGroup.setToolPassive(ArrowAnnotateTool.toolName)
toolGroup.setToolPassive(RectangleROITool.toolName)
toolGroup.setToolPassive(PlanarFreehandROITool.toolName)
toolGroup.setToolPassive(LengthTool.toolName)
} else {
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
toolGroup.setToolEnabled(RectangleROITool.toolName)
toolGroup.setToolEnabled(PlanarFreehandROITool.toolName)
toolGroup.setToolEnabled(LengthTool.toolName)
}
toolGroup.setToolPassive(EraserTool.toolName)
})
@ -802,6 +819,17 @@ export default {
const fileList = this.viewportInfos[i].fileList
const fileIndex = fileList.findIndex(f => f.Path === path)
if (fileIndex === -1) return
if (annotation.metadata.toolName === 'Length') {
const { value } = await this.$prompt('请录入录入物理长度mm')
annotation.data.handles.scale = value
if (!value) {
//
cornerstoneTools.annotation.state.addAnnotation(annotation.annotationUID)
const renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(`canvas-${this.activeCanvasIndex}`)
viewport.render()
}
}
const params = {
id: '',
visitTaskId: this.viewportInfos[i].taskInfo.VisitTaskId,
@ -812,9 +840,25 @@ export default {
}
const res = await addNoneDicomMark(params)
annotation.annotationId = res.Result
//
// this.$message.success(this.$t('common:message:savedSuccessfully'))
},
getLengthToolTextLines(data, targetId) {
const cachedVolumeStats = data.cachedStats[targetId]
const { length, unit } = cachedVolumeStats
if (length === undefined || length === null || isNaN(length)) {
return
}
if (data.handles.scale === undefined || data.handles.scale === null || isNaN(data.handles.scale)) {
return
}
const textLines = []
textLines.push(`${csUtils.roundNumber(length)} ${unit}`)
textLines.push(`${csUtils.roundNumber(data.handles.scale)} mm`)
return textLines;
},
debounce(callback, delay) {
let timerId
return function() {
@ -836,7 +880,8 @@ export default {
//
async customPrompt() {
try {
const { value } = await this.$prompt('请输入标记名称')
//
const { value } = await this.$prompt(this.$t('trials:noneDicom:message:msg1'))
return value
} catch {
return null

View File

@ -127,6 +127,7 @@
v-model="questionForm[question.Id]"
clearable
@change="(val) => { formItemNumberChange(val, question) }"
:disabled="readingTaskState >= 2"
>
<el-option
v-for="val in question.TypeValue.split('|')"
@ -139,9 +140,9 @@
v-else-if="question.DataSource !== 1"
v-model="questionForm[question.Id]"
type="number"
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
@change="(val) => { formItemNumberChange(val, question) }"
@input="limitInput($event, questionForm, question.Id)"
:disabled="readingTaskState >= 2"
>
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}</template>
<template v-else-if="question.ValueType === 2" slot="append">%</template>
@ -150,9 +151,8 @@
v-else-if="question.DataSource === 1"
v-model="questionForm[question.Id]"
type="number"
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));"
:disabled="question.DataSource === 1"
@input="limitInput($event, questionForm, question.Id)"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
:disabled="question.DataSource === 1 || readingTaskState >= 2"
>
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}</template>
<template v-else-if="question.ValueType === 2" slot="append">%</template>
@ -336,7 +336,8 @@ export default {
})
}
}
this.digitPlaces = localStorage.getItem('digitPlaces') ? parseInt(localStorage.getItem('digitPlaces')) : 0
let digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
},
methods: {
limitInput(value, a, b) {
@ -346,6 +347,9 @@ export default {
}
}
},
handleBlur(value, a, b) {
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
},
logic(rules, num = 0) {
try {
if (rules.CalculateQuestionList.length === 0) {
@ -461,14 +465,13 @@ export default {
} catch (e) {
console.log(e)
}
var digitPlaces = parseInt(localStorage.getItem('digitPlaces'))
if (rules.ValueType === 2) {
num = num * 100
}
if (rules.CustomCalculateMark === 13 || rules.CustomCalculateMark === 14) {
return num
} else {
return num.toFixed(digitPlaces)
return num.toFixed(this.digitPlaces)
}
},
formItemNumberChange(questionId, isTable) {