非dicom阅片ecrf更改
parent
2fd6e1893b
commit
00cc5d5d27
|
@ -108,6 +108,7 @@ export default {
|
||||||
const res = await getNextTask(params)
|
const res = await getNextTask(params)
|
||||||
this.taskInfo = res.Result
|
this.taskInfo = res.Result
|
||||||
localStorage.setItem('taskInfo', JSON.stringify(res.Result))
|
localStorage.setItem('taskInfo', JSON.stringify(res.Result))
|
||||||
|
localStorage.setItem('digitPlaces', JSON.stringify(res.Result.DigitPlaces))
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.taskInfo.IsExistsClinicalData && this.taskInfo.IsNeedReadClinicalData && !this.taskInfo.IsReadClinicalData) {
|
if (this.taskInfo.IsExistsClinicalData && this.taskInfo.IsNeedReadClinicalData && !this.taskInfo.IsReadClinicalData) {
|
||||||
|
|
|
@ -70,6 +70,13 @@
|
||||||
>
|
>
|
||||||
<svg-icon icon-class="clear" class="svg-icon" />
|
<svg-icon icon-class="clear" class="svg-icon" />
|
||||||
</div>
|
</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
|
<!-- <div
|
||||||
class="tool-item"
|
class="tool-item"
|
||||||
|
@ -212,7 +219,8 @@ import {
|
||||||
imageLoader,
|
imageLoader,
|
||||||
metaData,
|
metaData,
|
||||||
getRenderingEngine,
|
getRenderingEngine,
|
||||||
eventTarget
|
eventTarget,
|
||||||
|
utilities as csUtils
|
||||||
// getEnabledElementByIds
|
// getEnabledElementByIds
|
||||||
} from '@cornerstonejs/core'
|
} from '@cornerstonejs/core'
|
||||||
|
|
||||||
|
@ -234,7 +242,8 @@ const {
|
||||||
ArrowAnnotateTool,
|
ArrowAnnotateTool,
|
||||||
RectangleROITool,
|
RectangleROITool,
|
||||||
PlanarFreehandROITool,
|
PlanarFreehandROITool,
|
||||||
EraserTool
|
EraserTool,
|
||||||
|
LengthTool
|
||||||
// cursors
|
// cursors
|
||||||
} = cornerstoneTools
|
} = cornerstoneTools
|
||||||
const { MouseBindings, Events: toolsEvents } = csToolsEnums
|
const { MouseBindings, Events: toolsEvents } = csToolsEnums
|
||||||
|
@ -405,6 +414,8 @@ export default {
|
||||||
cornerstoneTools.addTool(RectangleROITool)
|
cornerstoneTools.addTool(RectangleROITool)
|
||||||
cornerstoneTools.addTool(PlanarFreehandROITool)
|
cornerstoneTools.addTool(PlanarFreehandROITool)
|
||||||
cornerstoneTools.addTool(EraserTool)
|
cornerstoneTools.addTool(EraserTool)
|
||||||
|
cornerstoneTools.addTool(LengthTool)
|
||||||
|
|
||||||
|
|
||||||
viewportIds.forEach((viewportId, i) => {
|
viewportIds.forEach((viewportId, i) => {
|
||||||
const toolGroupId = `canvas-${i}`
|
const toolGroupId = `canvas-${i}`
|
||||||
|
@ -425,10 +436,14 @@ export default {
|
||||||
})
|
})
|
||||||
toolGroup.addTool(RectangleROITool.toolName)
|
toolGroup.addTool(RectangleROITool.toolName)
|
||||||
toolGroup.addTool(PlanarFreehandROITool.toolName, {
|
toolGroup.addTool(PlanarFreehandROITool.toolName, {
|
||||||
allowOpenContours: false
|
allowOpenContours: false,
|
||||||
// cachedStats: false
|
cachedStats: false
|
||||||
})
|
})
|
||||||
toolGroup.addTool(EraserTool.toolName)
|
toolGroup.addTool(EraserTool.toolName)
|
||||||
|
toolGroup.addTool(LengthTool.toolName, {
|
||||||
|
getTextLines: this.getLengthToolTextLines
|
||||||
|
})
|
||||||
|
|
||||||
toolGroup.setToolActive(StackScrollTool.toolName, {
|
toolGroup.setToolActive(StackScrollTool.toolName, {
|
||||||
bindings: [{ mouseButton: MouseBindings.Wheel }]
|
bindings: [{ mouseButton: MouseBindings.Wheel }]
|
||||||
})
|
})
|
||||||
|
@ -439,10 +454,12 @@ export default {
|
||||||
toolGroup.setToolPassive(ArrowAnnotateTool.toolName)
|
toolGroup.setToolPassive(ArrowAnnotateTool.toolName)
|
||||||
toolGroup.setToolPassive(RectangleROITool.toolName)
|
toolGroup.setToolPassive(RectangleROITool.toolName)
|
||||||
toolGroup.setToolPassive(PlanarFreehandROITool.toolName)
|
toolGroup.setToolPassive(PlanarFreehandROITool.toolName)
|
||||||
|
toolGroup.setToolPassive(LengthTool.toolName)
|
||||||
} else {
|
} else {
|
||||||
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
|
toolGroup.setToolEnabled(ArrowAnnotateTool.toolName)
|
||||||
toolGroup.setToolEnabled(RectangleROITool.toolName)
|
toolGroup.setToolEnabled(RectangleROITool.toolName)
|
||||||
toolGroup.setToolEnabled(PlanarFreehandROITool.toolName)
|
toolGroup.setToolEnabled(PlanarFreehandROITool.toolName)
|
||||||
|
toolGroup.setToolEnabled(LengthTool.toolName)
|
||||||
}
|
}
|
||||||
toolGroup.setToolPassive(EraserTool.toolName)
|
toolGroup.setToolPassive(EraserTool.toolName)
|
||||||
})
|
})
|
||||||
|
@ -802,6 +819,17 @@ export default {
|
||||||
const fileList = this.viewportInfos[i].fileList
|
const fileList = this.viewportInfos[i].fileList
|
||||||
const fileIndex = fileList.findIndex(f => f.Path === path)
|
const fileIndex = fileList.findIndex(f => f.Path === path)
|
||||||
if (fileIndex === -1) return
|
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 = {
|
const params = {
|
||||||
id: '',
|
id: '',
|
||||||
visitTaskId: this.viewportInfos[i].taskInfo.VisitTaskId,
|
visitTaskId: this.viewportInfos[i].taskInfo.VisitTaskId,
|
||||||
|
@ -812,9 +840,25 @@ export default {
|
||||||
}
|
}
|
||||||
const res = await addNoneDicomMark(params)
|
const res = await addNoneDicomMark(params)
|
||||||
annotation.annotationId = res.Result
|
annotation.annotationId = res.Result
|
||||||
|
|
||||||
// 保存成功
|
// 保存成功
|
||||||
// this.$message.success(this.$t('common:message:savedSuccessfully'))
|
// 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) {
|
debounce(callback, delay) {
|
||||||
let timerId
|
let timerId
|
||||||
return function() {
|
return function() {
|
||||||
|
@ -836,7 +880,8 @@ export default {
|
||||||
// 箭头工具输入标记名称自定义弹窗
|
// 箭头工具输入标记名称自定义弹窗
|
||||||
async customPrompt() {
|
async customPrompt() {
|
||||||
try {
|
try {
|
||||||
const { value } = await this.$prompt('请输入标记名称')
|
// 请输入标记名称
|
||||||
|
const { value } = await this.$prompt(this.$t('trials:noneDicom:message:msg1'))
|
||||||
return value
|
return value
|
||||||
} catch {
|
} catch {
|
||||||
return null
|
return null
|
||||||
|
|
|
@ -127,6 +127,7 @@
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
clearable
|
clearable
|
||||||
@change="(val) => { formItemNumberChange(val, question) }"
|
@change="(val) => { formItemNumberChange(val, question) }"
|
||||||
|
:disabled="readingTaskState >= 2"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="val in question.TypeValue.split('|')"
|
v-for="val in question.TypeValue.split('|')"
|
||||||
|
@ -139,9 +140,9 @@
|
||||||
v-else-if="question.DataSource !== 1"
|
v-else-if="question.DataSource !== 1"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
type="number"
|
type="number"
|
||||||
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));"
|
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||||
@change="(val) => { formItemNumberChange(val, question) }"
|
@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-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>
|
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
||||||
|
@ -150,9 +151,8 @@
|
||||||
v-else-if="question.DataSource === 1"
|
v-else-if="question.DataSource === 1"
|
||||||
v-model="questionForm[question.Id]"
|
v-model="questionForm[question.Id]"
|
||||||
type="number"
|
type="number"
|
||||||
onblur="value=parseFloat(value).toFixed(parseInt(localStorage.getItem('digitPlaces')));"
|
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||||
:disabled="question.DataSource === 1"
|
:disabled="question.DataSource === 1 || 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-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>
|
<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: {
|
methods: {
|
||||||
limitInput(value, a, b) {
|
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) {
|
logic(rules, num = 0) {
|
||||||
try {
|
try {
|
||||||
if (rules.CalculateQuestionList.length === 0) {
|
if (rules.CalculateQuestionList.length === 0) {
|
||||||
|
@ -461,14 +465,13 @@ export default {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
var digitPlaces = parseInt(localStorage.getItem('digitPlaces'))
|
|
||||||
if (rules.ValueType === 2) {
|
if (rules.ValueType === 2) {
|
||||||
num = num * 100
|
num = num * 100
|
||||||
}
|
}
|
||||||
if (rules.CustomCalculateMark === 13 || rules.CustomCalculateMark === 14) {
|
if (rules.CustomCalculateMark === 13 || rules.CustomCalculateMark === 14) {
|
||||||
return num
|
return num
|
||||||
} else {
|
} else {
|
||||||
return num.toFixed(digitPlaces)
|
return num.toFixed(this.digitPlaces)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formItemNumberChange(questionId, isTable) {
|
formItemNumberChange(questionId, isTable) {
|
||||||
|
|
Loading…
Reference in New Issue