创建分割分组时,分组和分割分段的名称可以设置默认值、部分分割问题解决

uat_us
wangxiaoshuang 2026-04-15 14:22:50 +08:00
parent eac6b25b9e
commit b6b918efbf
7 changed files with 252 additions and 105 deletions

View File

@ -195,31 +195,31 @@ export default {
this.initViewport() this.initViewport()
}) })
DicomEvent.$on('createSegmentationRepresentation', (segmentationId) => { DicomEvent.$on('createSegmentationRepresentation', (segmentationId) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
createSegmentationRepresentation(this.viewportId, segmentationId) createSegmentationRepresentation(this.viewportId, segmentationId)
}) })
DicomEvent.$on('viewSegmentation', (obj) => { DicomEvent.$on('viewSegmentation', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
viewSegmentation(obj, this.viewportId) viewSegmentation(obj, this.viewportId)
}) })
DicomEvent.$on('viewSegment', (obj) => { DicomEvent.$on('viewSegment', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
viewSegment(obj, this.viewportId) viewSegment(obj, this.viewportId)
}) })
DicomEvent.$on('jumpBidirectional', (obj) => { DicomEvent.$on('jumpBidirectional', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
jumpBidirectional(obj, this.viewportId, this.volumeId) jumpBidirectional(obj, this.viewportId, this.volumeId)
}) })
DicomEvent.$on('viewBidirectional', (obj) => { DicomEvent.$on('viewBidirectional', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
viewBidirectional(obj, this.viewportId) viewBidirectional(obj, this.viewportId)
}) })
DicomEvent.$on('changeColor', (obj) => { DicomEvent.$on('changeColor', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
changeColor(obj, this.viewportId) changeColor(obj, this.viewportId)
}) })
DicomEvent.$on('resetViewport', () => { DicomEvent.$on('resetViewport', () => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
resetViewport(this.viewportId) resetViewport(this.viewportId)
}) })
DicomEvent.$on('renderSegmentation', async (viewportId) => { DicomEvent.$on('renderSegmentation', async (viewportId) => {

View File

@ -366,9 +366,9 @@
<el-tab-pane :label="$t('trials:reading:dicom3D:tabs:segment')" name="segment"> <el-tab-pane :label="$t('trials:reading:dicom3D:tabs:segment')" name="segment">
<Segmentations ref="Segmentations" :visitInfo="taskInfo" :isMPR="isMPR" <Segmentations ref="Segmentations" :visitInfo="taskInfo" :isMPR="isMPR"
:volumeToolGroupId="volumeToolGroupId" :viewportKey="viewportKey" :global-loading.sync="loading" :volumeToolGroupId="volumeToolGroupId" :viewportKey="viewportKey" :global-loading.sync="loading"
:loadingText.sync="loadingText" :rendering-engine-id="renderingEngineId" :trialCriterion="trialCriterion" :loadingText.sync="loadingText"
:SegmentConfig="SegmentConfig" :segId.sync="segId" :segIndex.sync="segIndex" :rendering-engine-id="renderingEngineId" :SegmentConfig="SegmentConfig" :segId.sync="segId"
:curSegSeries.sync="curSegSeries" :activeViewportIndex="activeViewportIndex" :segIndex.sync="segIndex" :curSegSeries.sync="curSegSeries" :activeViewportIndex="activeViewportIndex"
:activeTool.sync="activeTool" :actionConfiguration="actionConfiguration" :activeTool.sync="activeTool" :actionConfiguration="actionConfiguration"
:histogramVisible="histogramVisible" @setToolsPassive="setToolsPassive" :histogramVisible="histogramVisible" @setToolsPassive="setToolsPassive"
@resetQuestion="resetQuestion" /> @resetQuestion="resetQuestion" />
@ -2030,6 +2030,7 @@ export default {
const errorMsg = { message: 'annotation Not allowed to operate' } const errorMsg = { message: 'annotation Not allowed to operate' }
throw errorMsg throw errorMsg
} }
if (this.activeTool === 'CircularEraser') return false
const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName) const i = this.tools.findIndex(i => i.toolName === annotation.metadata.toolName)
if (i === -1) { if (i === -1) {
if (annotation.metadata.toolName === SegmentBidirectionalTool.toolName) { if (annotation.metadata.toolName === SegmentBidirectionalTool.toolName) {

View File

@ -113,11 +113,14 @@ export default {
if (find) { if (find) {
this.form.studyId = this.series.StudyId this.form.studyId = this.series.StudyId
this.handleChange(null, 'study') this.handleChange(null, 'study')
if (find.SeriesArr && find.SeriesArr.length > 0) {
let findSeries = find.SeriesArr.some(item => item.Id === this.form.seriesId) let findSeries = find.SeriesArr.some(item => item.Id === this.form.seriesId)
if (findSeries) { if (findSeries) {
this.form.seriesId = this.series.Id this.form.seriesId = this.series.Id
this.handleChange(null, 'series') this.handleChange(null, 'series')
} }
}
} }

View File

@ -323,6 +323,12 @@ export default {
return {} return {}
} }
}, },
trialCriterion: {
type: Object,
default: () => {
return {}
}
},
segId: { segId: {
type: String, type: String,
default: '' default: ''
@ -686,11 +692,30 @@ export default {
// this.selectSegment(segment, s ? false : true) // this.selectSegment(segment, s ? false : true)
// this.readingSegmentByConfig() // this.readingSegmentByConfig()
}, },
getSegmentationName(num = 1) {
let defaultSegmentationName = this.trialCriterion.DefaultSegmentName.SegmentationName
let name = defaultSegmentationName
let has = this.segmentList.find(item => item.name === name)
if (has) {
name = defaultSegmentationName + num
has = this.segmentList.find(item => item.name === name)
num++
if (has) name = this.getSegmentationName(num)
}
return name
},
getSegmentName(arr, num = 1) {
let defaultSegmentName = arr[0].SegmentLabel
let name = defaultSegmentName + num
let has = arr.find(item => item.SegmentLabel === name)
num++
if (has) name = this.getSegmentName(arr, num)
return name
},
async addSegmentGroup() { async addSegmentGroup() {
let viewportIds = this.viewportIds
// let segmentationId = this.$guid(); // let segmentationId = this.$guid();
let obj = { let obj = {
name: this.$t('trials:reading:Segmentations:name:SegmentGroup') + (this.segmentList.length + 1), name: this.getSegmentationName(),
view: true, view: true,
segmentationId: null, segmentationId: null,
isSaved: false, isSaved: false,
@ -698,11 +723,14 @@ export default {
} }
let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name }) let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name })
obj.segmentationId = segmentationId obj.segmentationId = segmentationId
await this.createSegmentation(obj.segmentationId)
this.createSegmentationRepresentation(obj.segmentationId)
this.trialCriterion.DefaultSegmentName.SegmentNameList.forEach(async (SegmentName, index) => {
let o = { let o = {
segmentIndex: 1, segmentIndex: index + 1,
segmentationId, segmentationId,
SegmentLabel: 'Segment 1', SegmentLabel: SegmentName,
color: this.colors[0], color: this.colors[index],
stats: null, stats: null,
bidirectional: null, bidirectional: null,
bidirectionalView: true, bidirectionalView: true,
@ -711,34 +739,36 @@ export default {
} }
let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId }) let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId })
o.id = id o.id = id
obj.segments.push(o); obj.segments.splice(index, 0, o);
this.changeColor(this.colors[index], { segmentationId: obj.segmentationId, segmentIndex: index + 1, color: this.colors[index] })
})
this.segmentList.push(obj); this.segmentList.push(obj);
this.segmentationId = obj.segmentationId; this.segmentationId = obj.segmentationId;
await this.createSegmentation(obj.segmentationId)
this.createSegmentationRepresentation(obj.segmentationId)
this.segmentIndex = 1 this.segmentIndex = 1
this.changeColor(this.colors[0], { segmentationId: obj.segmentationId, segmentIndex: 1, color: this.colors[0] }) // segmentation.segmentIndex.setActiveSegmentIndex(this.segmentationId, 1);
// viewportIds.forEach(id => { // viewportIds.forEach(id => {
// segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, 1, this.hex2Rgb(this.colors[0])) // segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, 1, this.hex2Rgb(this.colors[0]))
// }) // })
this.selectSegmentGroup() // this.selectSegmentGroup()
}, },
async addSegment() { async addSegment() {
let viewportIds = this.viewportIds;
if (this.segmentList.length <= 0) { if (this.segmentList.length <= 0) {
let obj = { let obj = {
name: this.$t('trials:reading:Segmentations:name:SegmentGroup') + 1, name: this.getSegmentationName(),
view: true, view: true,
isSaved: false, isSaved: false,
segments: [] segments: []
} }
let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name }) let segmentationId = await this.addOrUpdateSegmentation({ name: obj.name })
obj.segmentationId = segmentationId obj.segmentationId = segmentationId
await this.createSegmentation(segmentationId)
this.createSegmentationRepresentation(segmentationId)
this.trialCriterion.DefaultSegmentName.SegmentNameList.forEach(async (SegmentName, index) => {
let o = { let o = {
segmentIndex: 1, segmentIndex: index + 1,
segmentationId, segmentationId,
SegmentLabel: 'Segment 1', SegmentLabel: SegmentName,
color: this.colors[0], color: this.colors[index],
stats: null, stats: null,
bidirectional: null, bidirectional: null,
bidirectionalView: true, bidirectionalView: true,
@ -747,14 +777,14 @@ export default {
} }
let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId }) let id = await this.addOrUpdateSegment({ name: o.SegmentLabel, color: o.color, segmentIndex: o.segmentIndex, segmentationId: o.segmentationId })
o.id = id o.id = id
obj.segments.push(o); obj.segments.splice(index, 0, o);
this.changeColor(this.colors[index], { segmentationId: obj.segmentationId, segmentIndex: index + 1, color: this.colors[index] })
})
this.segmentList.push(obj); this.segmentList.push(obj);
this.segmentationId = this.segmentList[0].segmentationId; this.segmentationId = segmentationId;
await this.createSegmentation(this.segmentationId)
this.createSegmentationRepresentation(this.segmentationId)
this.segmentIndex = 1 this.segmentIndex = 1
segmentation.segmentIndex.setActiveSegmentIndex(this.segmentList[0].segmentationId, 1); // segmentation.segmentIndex.setActiveSegmentIndex(this.segmentList[0].segmentationId, 1);
this.changeColor(this.colors[0], { segmentationId: this.segmentList[0].segmentationId, segmentIndex: 1, color: this.colors[0] }) // this.changeColor(this.colors[0], { segmentationId: this.segmentList[0].segmentationId, segmentIndex: 1, color: this.colors[0] })
// viewportIds.forEach(id => { // viewportIds.forEach(id => {
// segmentation.config.color.setSegmentIndexColor(id, this.segmentList[0].segmentationId, 1, this.hex2Rgb(this.colors[0])) // segmentation.config.color.setSegmentIndexColor(id, this.segmentList[0].segmentationId, 1, this.hex2Rgb(this.colors[0]))
// }) // })
@ -767,7 +797,7 @@ export default {
let obj = { let obj = {
segmentIndex: segmentIndex, segmentIndex: segmentIndex,
segmentationId: this.segmentationId, segmentationId: this.segmentationId,
SegmentLabel: `Segment ${segmentIndex}`, SegmentLabel: this.getSegmentName(item.segments),
color: item.segments.length >= this.colors.length ? this.colors[0] : this.colors[item.segments.length], color: item.segments.length >= this.colors.length ? this.colors[0] : this.colors[item.segments.length],
stats: null, stats: null,
bidirectional: null, bidirectional: null,
@ -784,7 +814,7 @@ export default {
obj.id = id obj.id = id
item.segments.push(obj) item.segments.push(obj)
this.segmentIndex = obj.segmentIndex this.segmentIndex = obj.segmentIndex
segmentation.segmentIndex.setActiveSegmentIndex(obj.segmentationId, obj.segmentIndex); // segmentation.segmentIndex.setActiveSegmentIndex(obj.segmentationId, obj.segmentIndex);
this.changeColor(obj.color, { segmentationId: obj.segmentationId, segmentIndex: obj.segmentIndex, color: obj.color }) this.changeColor(obj.color, { segmentationId: obj.segmentationId, segmentIndex: obj.segmentIndex, color: obj.color })
// viewportIds.forEach(id => { // viewportIds.forEach(id => {
// segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, obj.segmentIndex, this.hex2Rgb(obj.color)) // segmentation.config.color.setSegmentIndexColor(id, obj.segmentationId, obj.segmentIndex, this.hex2Rgb(obj.color))
@ -1457,7 +1487,6 @@ export default {
list.forEach(item => { list.forEach(item => {
this.createSegmentConfiguration(item.segmentIndex, item.segmentationId); this.createSegmentConfiguration(item.segmentIndex, item.segmentationId);
}) })
const renderingEngine = getRenderingEngine(this.renderingEngineId) const renderingEngine = getRenderingEngine(this.renderingEngineId)
const viewportId = `${this.viewportKey}-${this.activeViewportIndex}` const viewportId = `${this.viewportKey}-${this.activeViewportIndex}`
const viewport = renderingEngine.getViewport(viewportId); const viewport = renderingEngine.getViewport(viewportId);
@ -1530,7 +1559,7 @@ export default {
answer = segment.stats && segment.stats[imageToolAttribute] ? Number((segment.stats[imageToolAttribute]).value).toFixed(this.digitPlaces) : '' answer = segment.stats && segment.stats[imageToolAttribute] ? Number((segment.stats[imageToolAttribute]).value).toFixed(this.digitPlaces) : ''
} }
let o = { let o = {
Answer: answer, Answer: answer === '-Infinity' ? null : answer,
QuestionId: item.QuestionId, QuestionId: item.QuestionId,
RowId: item.RowId, RowId: item.RowId,
SegmentId: item.SegmentId, SegmentId: item.SegmentId,
@ -1599,12 +1628,6 @@ export default {
segments: [] segments: []
} }
this.segmentList.push(obj) this.segmentList.push(obj)
// if (item.SEGUrl) {
// await this.readSegmentation(obj)
// } else {
// await this.createSegmentation(obj.segmentationId)
// // this.createSegmentationRepresentation(obj.segmentationId)
// }
} }
if (!this.segmentationId) { if (!this.segmentationId) {
this.segmentationId = obj.segmentationId this.segmentationId = obj.segmentationId
@ -1627,38 +1650,13 @@ export default {
id: s.Id id: s.Id
} }
obj.segments.push(o) obj.segments.push(o)
// this.selectSegment(o, false)
// this.changeColor(s.ColorRgb, o)
// this.lockSegment(o, true)
} }
if (!this.segmentIndex) { if (!this.segmentIndex) {
this.segmentIndex = s.SegmentNumber this.segmentIndex = s.SegmentNumber
} }
}) })
// this.$nextTick(() => {
// if (SEGMENT) {
// // console.log(SEGMENT, 'SEGMENT')
// return this.getBidirectional(obj.segments, SEGMENT)
// }
// this.getBidirectional(obj.segments, null, false)
// })
} }
// if (this.segmentationId && this.segmentIndex && this.segmentList && this.segmentList.length > 0) {
// let o = this.segmentList.find(item => item.segmentationId === this.segmentationId)
// if (o) {
// let s = o.segments.find(item => item.segmentIndex === this.segmentIndex)
// this.selectSegmentGroup(s)
// } else {
// this.segmentationId = this.segmentList[0].segmentationId
// this.segmentIndex = this.segmentationId ? this.segmentList[0].segments[0].segmentIndex : null
// if (this.segmentationId && this.segmentIndex) {
// this.selectSegmentGroup(this.segmentList[0].segments[0])
// }
// }
// }
this.isloaded = false this.isloaded = false
// this.loading = true
// this.readingSegmentByConfig()
} }
} catch (err) { } catch (err) {
// this.loading = false // this.loading = false

View File

@ -213,31 +213,31 @@ export default {
this.initViewport() this.initViewport()
}) })
DicomEvent.$on('createSegmentationRepresentation', (segmentationId) => { DicomEvent.$on('createSegmentationRepresentation', (segmentationId) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
createSegmentationRepresentation(this.viewportId, segmentationId) createSegmentationRepresentation(this.viewportId, segmentationId)
}) })
DicomEvent.$on('viewSegmentation', (obj) => { DicomEvent.$on('viewSegmentation', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
viewSegmentation(obj, this.viewportId) viewSegmentation(obj, this.viewportId)
}) })
DicomEvent.$on('viewSegment', (obj) => { DicomEvent.$on('viewSegment', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
viewSegment(obj, this.viewportId) viewSegment(obj, this.viewportId)
}) })
DicomEvent.$on('jumpBidirectional', (obj) => { DicomEvent.$on('jumpBidirectional', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
jumpBidirectional(obj, this.viewportId, this.volumeId) jumpBidirectional(obj, this.viewportId, this.volumeId)
}) })
DicomEvent.$on('viewBidirectional', (obj) => { DicomEvent.$on('viewBidirectional', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
viewBidirectional(obj, this.viewportId) viewBidirectional(obj, this.viewportId)
}) })
DicomEvent.$on('changeColor', (obj) => { DicomEvent.$on('changeColor', (obj) => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
changeColor(obj, this.viewportId) changeColor(obj, this.viewportId)
}) })
DicomEvent.$on('resetViewport', () => { DicomEvent.$on('resetViewport', () => {
if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.VisitTaskId !== this.series.VisitTaskId) return false if (this.curSegSeries.Id !== this.series.Id || this.curSegSeries.TaskInfo.VisitTaskId !== this.series.TaskInfo.VisitTaskId) return false
resetViewport(this.viewportId) resetViewport(this.viewportId)
}) })
DicomEvent.$on('renderSegmentation', async (viewportId) => { DicomEvent.$on('renderSegmentation', async (viewportId) => {

View File

@ -333,6 +333,7 @@ function viewBidirectional(arr, viewportId) {
resetViewport(viewportId) resetViewport(viewportId)
} }
function resetViewport(viewportId) { function resetViewport(viewportId) {
console.log('resetViewport')
let renderingEngine = getRenderingEngine(renderingEngineId) let renderingEngine = getRenderingEngine(renderingEngineId)
const viewport = renderingEngine.getViewport(viewportId) const viewport = renderingEngine.getViewport(viewportId)
viewport.render() viewport.render()

View File

@ -52,6 +52,22 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<!-- 分割组名 -->
<el-form-item v-if="CriterionType === 0 && form.ReadingVersionEnum === 1 && form.ReadingTool === 3"
:label="$t('trials:readingUnit:readingRules:title:segmentations')" prop="DefaultSegmentName.SegmentationName">
<el-input v-model="form.DefaultSegmentName.SegmentationName" :disabled="isConfirm ||
!hasPermi(['trials:trials-panel:setting:reading-unit:edit'])" style="width: 80%">
</el-input>
</el-form-item>
<!-- 分割片段 -->
<el-form-item v-if="CriterionType === 0 && form.ReadingVersionEnum === 1 && form.ReadingTool === 3"
:label="$t('trials:readingUnit:readingRules:title:segment')" prop="DefaultSegmentName.SegmentNameList">
<el-input v-model="form.SegmentNameListStr" style="width: 80%" disabled>
</el-input>
<el-button :disabled="isConfirm ||
!hasPermi(['trials:trials-panel:setting:reading-unit:edit'])
" icon="el-icon-plus" circle @click="segmentVisible = true" />
</el-form-item>
<!--检查类型筛选--> <!--检查类型筛选-->
<el-form-item :label="$t('trials:processCfg:form:IsImageFilter')" prop="IsImageFilter"> <el-form-item :label="$t('trials:processCfg:form:IsImageFilter')" prop="IsImageFilter">
<el-radio-group v-model="form.IsImageFilter" @input="IsImageFilterChange" :disabled="isConfirm || <el-radio-group v-model="form.IsImageFilter" @input="IsImageFilterChange" :disabled="isConfirm ||
@ -392,6 +408,34 @@
</el-dialog> </el-dialog>
<attachmentPreview :visible.sync="perview_visible" :isView="true" :isExternal="true" :ExternalList="ExternalList" <attachmentPreview :visible.sync="perview_visible" :isView="true" :isExternal="true" :ExternalList="ExternalList"
v-if="perview_visible" /> v-if="perview_visible" />
<!-- 分割段编辑 -->
<el-dialog v-if="segmentVisible" :visible.sync="segmentVisible" :close-on-click-modal="false" width="600px"
:title="$t('trials:trialCfg:dialogTitle:addSegment')" custom-class="base-dialog-wrapper">
<div class="base-dialog-body">
<el-button @click.stop="addSegment" style="margin-bottom: 5px;" type="primary" size="small">{{
$t('common:button:new') }}</el-button>
<el-table :data="SegmentNameList" border style="width: 100%" size="small">
<el-table-column prop="name" :label="$t('trials:trialCfg:table:segmentName')" show-overflow-tooltip />
<el-table-column :label="$t('common:action:action')" align="left" fixed="right">
<template slot-scope="scope">
<el-button circle icon="el-icon-top" :title="$t('dictionary:template:keyDocList:button:up')"
@click.stop="sortSegment(scope, 'up')" :disabled="scope.$index === 0" />
<el-button circle icon="el-icon-bottom" :title="$t('dictionary:template:keyDocList:button:down')"
@click.stop="sortSegment(scope, 'down')" :disabled="scope.$index === SegmentNameList.length - 1" />
<el-button circle icon="el-icon-edit-outline" :title="$t('dictionary:template:keyDocList:button:update')"
@click.stop="updateSegment(scope)" />
<el-button circle icon="el-icon-delete" :title="$t('dictionary:template:keyDocList:button:del')"
@click.stop="delSegment(scope)" />
</template>
</el-table-column>
</el-table>
</div>
<!-- <div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
<el-button size="small" type="primary" :loading="btnLoading" @click="handleConfirmConfigData">
{{ $t('trials:trialCfg:button:confirmCfg') }}
</el-button>
</div> -->
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -420,6 +464,7 @@ export default {
}, },
data() { data() {
return { return {
segmentVisible: false,
perview_visible: false, perview_visible: false,
ExternalList: [], ExternalList: [],
keyDocVisible: false, keyDocVisible: false,
@ -432,6 +477,11 @@ export default {
ReadingVersionEnum: null, ReadingVersionEnum: null,
ReadingToolList: [], ReadingToolList: [],
SegmentToolList: [], SegmentToolList: [],
DefaultSegmentName: {
SegmentationName: null,
SegmentNameList: []
},
SegmentNameListStr: null,
ReadingTaskViewEnum: null, ReadingTaskViewEnum: null,
IsImageLabeled: null, IsImageLabeled: null,
IsReadingShowSubjectInfo: null, IsReadingShowSubjectInfo: null,
@ -596,6 +646,21 @@ export default {
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],
'DefaultSegmentName.SegmentationName': [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: ['blur', 'change'],
},
],
'DefaultSegmentName.SegmentNameList': [
{
required: true,
type: 'array',
message: this.$t('common:ruleMessage:select'),
trigger: ['blur', 'change'],
},
],
CriterionModalitys: [ CriterionModalitys: [
{ {
required: true, required: true,
@ -642,6 +707,16 @@ export default {
isUSA() { isUSA() {
return process.env.NODE_ENV === 'usa' return process.env.NODE_ENV === 'usa'
}, },
SegmentNameList() {
let arr = []
this.form.DefaultSegmentName.SegmentNameList.forEach(item => {
let obj = {
name: item
}
arr.push(obj)
})
return arr
}
}, },
watch: { watch: {
CriterionModalitys: { CriterionModalitys: {
@ -652,6 +727,74 @@ export default {
}, },
}, },
methods: { methods: {
sortSegment(row, key) {
let index = row.$index
let name = row.row.name
this.form.DefaultSegmentName.SegmentNameList.splice(index, 1)
if (key === 'up') {
this.form.DefaultSegmentName.SegmentNameList.splice(index - 1, 0, name)
} else {
this.form.DefaultSegmentName.SegmentNameList.splice(index + 1, 0, name)
}
},
async updateSegment(row) {
let name = await this.customPrompt(row.row.name)
if (!name) return false
let index = row.$index
this.form.DefaultSegmentName.SegmentNameList.splice(index, 1, name)
this.form.SegmentNameListStr = this.form.DefaultSegmentName.SegmentNameList.join(",")
},
delSegment(row) {
console.log(row)
let index = row.$index
this.form.DefaultSegmentName.SegmentNameList.splice(index, 1)
this.form.SegmentNameListStr = this.form.DefaultSegmentName.SegmentNameList.join(",")
},
async addSegment() {
let name = await this.customPrompt()
if (!name) return false
this.form.DefaultSegmentName.SegmentNameList.push(name)
this.form.SegmentNameListStr = this.form.DefaultSegmentName.SegmentNameList.join(",")
},
async customPrompt(name = null) {
try {
const that = this
//
let message = !name ? this.$t('trials:reading:Segmentations:message:add') : this.$t('trials:reading:Segmentations:message:upate')
const { value } = await this.$prompt(message, '', {
showClose: false,
cancelButtonText: this.$t('common:button:cancel'),
confirmButtonText: this.$t('common:button:save'),
showCancelButton: true,
closeOnClickModal: false,
closeOnPressEscape: false,
inputValue: name,
inputValidator: (value) => {
if (!value) {
return that.$t("trials:reading:Segmentations:message:notName")
} else if (that.form.DefaultSegmentName.SegmentNameList.includes(value)) {
return that.$t("trials:reading:Segmentations:message:nameIsHas")
} else {
return true
}
},
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
// const value = instance.inputValue
done()
} else {
done()
}
}
})
return value
} catch (err) {
console.log(err)
return null
}
},
async viewManual() { async viewManual() {
try { try {
if (this.form.KeyFileList.length <= 0) return this.$message.warning(this.$t("trials:researchRecord:ImageManual:message:noImageManual")) if (this.form.KeyFileList.length <= 0) return this.$message.warning(this.$t("trials:researchRecord:ImageManual:message:noImageManual"))
@ -814,6 +957,7 @@ export default {
if (this.form.ReadingTool === 3) { if (this.form.ReadingTool === 3) {
this.segmentTools = [...config.customizeStandardsSegmentDicom] this.segmentTools = [...config.customizeStandardsSegmentDicom]
} }
this.form.SegmentNameListStr = res.Result.DefaultSegmentName.SegmentNameList.join(",")
} }
this.CriterionModalitys = this.form.CriterionModalitys this.CriterionModalitys = this.form.CriterionModalitys
? this.form.CriterionModalitys.split('|') ? this.form.CriterionModalitys.split('|')