分割重命名时默认值填入
continuous-integration/drone/push Build is failing Details

main
wangxiaoshuang 2026-04-02 14:07:58 +08:00
parent 9da9515930
commit 8db641db16
1 changed files with 12 additions and 3 deletions

View File

@ -26,7 +26,8 @@
</div>
<div :class="['tool-item', activeTool === 'CircularEraser' && segmentList.length > 0 ? 'tool-item-active' : '']"
:style="{ cursor: segmentList.length <= 0 || (curSegment && curSegment.lock) ? 'not-allowed' : 'pointer' }"
:title="$t('trials:Segmentations:tools:Eraser')" @click.prevent="setToolActive('CircularEraser')">
:title="$t('trials:Segmentations:tools:Eraser')"
@click.prevent="setToolActive('CircularEraser')">
<svg-icon icon-class="clear" class="svg-icon" />
</div>
<!-- <div :class="['tool-item']">
@ -870,7 +871,14 @@ export default {
if (passive) this.$emit('setToolsPassive')
},
async rename(key, item) {
let name = await this.customPrompt()
let value = null
if (key === 'segmentGroup') {
let group = this.segmentList.find(i => i.segmentationId === this.segmentationId)
value = group.name
} else {
value = item.SegmentLabel
}
let name = await this.customPrompt(value)
if (!name) return false
if (key === 'segmentGroup') {
let group = this.segmentList.find(i => i.segmentationId === this.segmentationId)
@ -881,7 +889,7 @@ export default {
this.addOrUpdateSegment({ name: item.SegmentLabel, color: item.color, segmentIndex: item.segmentIndex, segmentationId: item.segmentationId, segmentJson: JSON.stringify({ stats: item.stats, bidirectional: item.bidirectional }), id: item.id })
}
},
async customPrompt() {
async customPrompt(name) {
try {
const that = this
//
@ -893,6 +901,7 @@ export default {
showCancelButton: true,
closeOnClickModal: false,
closeOnPressEscape: false,
inputValue: name,
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
// const value = instance.inputValue