Compare commits

..

No commits in common. "c9ef6cd19fe0059ccab6499186d50492188e1afa" and "25ddd422a3588e0a6044c49246a6b1679cef43f8" have entirely different histories.

3 changed files with 13 additions and 62 deletions

View File

@ -108,7 +108,6 @@ 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,13 +70,6 @@
>
<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"
@ -219,8 +212,7 @@ import {
imageLoader,
metaData,
getRenderingEngine,
eventTarget,
utilities as csUtils
eventTarget
// getEnabledElementByIds
} from '@cornerstonejs/core'
@ -242,8 +234,7 @@ const {
ArrowAnnotateTool,
RectangleROITool,
PlanarFreehandROITool,
EraserTool,
LengthTool
EraserTool
// cursors
} = cornerstoneTools
const { MouseBindings, Events: toolsEvents } = csToolsEnums
@ -414,8 +405,6 @@ export default {
cornerstoneTools.addTool(RectangleROITool)
cornerstoneTools.addTool(PlanarFreehandROITool)
cornerstoneTools.addTool(EraserTool)
cornerstoneTools.addTool(LengthTool)
viewportIds.forEach((viewportId, i) => {
const toolGroupId = `canvas-${i}`
@ -436,14 +425,10 @@ 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 }]
})
@ -454,12 +439,10 @@ 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)
})
@ -819,17 +802,6 @@ 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,
@ -840,25 +812,9 @@ 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() {
@ -880,8 +836,7 @@ export default {
//
async customPrompt() {
try {
//
const { value } = await this.$prompt(this.$t('trials:noneDicom:message:msg1'))
const { value } = await this.$prompt('请输入标记名称')
return value
} catch {
return null

View File

@ -127,7 +127,6 @@
v-model="questionForm[question.Id]"
clearable
@change="(val) => { formItemNumberChange(val, question) }"
:disabled="readingTaskState >= 2"
>
<el-option
v-for="val in question.TypeValue.split('|')"
@ -140,9 +139,9 @@
v-else-if="question.DataSource !== 1"
v-model="questionForm[question.Id]"
type="number"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));"
@change="(val) => { formItemNumberChange(val, question) }"
:disabled="readingTaskState >= 2"
@input="limitInput($event, questionForm, question.Id)"
>
<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>
@ -151,8 +150,9 @@
v-else-if="question.DataSource === 1"
v-model="questionForm[question.Id]"
type="number"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
:disabled="question.DataSource === 1 || readingTaskState >= 2"
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));"
:disabled="question.DataSource === 1"
@input="limitInput($event, questionForm, question.Id)"
>
<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,8 +336,7 @@ export default {
})
}
}
let digitPlaces = Number(localStorage.getItem('digitPlaces'))
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
this.digitPlaces = localStorage.getItem('digitPlaces') ? parseInt(localStorage.getItem('digitPlaces')) : 0
},
methods: {
limitInput(value, a, b) {
@ -347,9 +346,6 @@ 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) {
@ -465,13 +461,14 @@ 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(this.digitPlaces)
return num.toFixed(digitPlaces)
}
},
formItemNumberChange(questionId, isTable) {