fix: 修改 topoLogy 图片选择后 无法删除的问题

This commit is contained in:
zhangyu
2023-03-29 16:41:16 +08:00
parent d7ae7cebd2
commit 97c4b3c155
3 changed files with 12 additions and 2 deletions

View File

@@ -407,9 +407,11 @@ export default {
obj[key] = findPen[key]
}
if (key === 'image') {
obj.imageId = pen[key]
obj.icon = ''
}
if (key === 'icon') {
obj.imageId = pen[key]
obj.image = ''
}
getTopology(this.meta2dId).setValue(obj) // 更新pen

View File

@@ -1233,6 +1233,11 @@ export default {
this.pen.image = ''
this.change('icon')
}
if (!image.id) {
this.pen.image = image.image
this.pen.icon = ''
this.change('image')
}
},
colorChange (val, key) {
this.pen.data.params[key] = val

View File

@@ -3,7 +3,7 @@
<div @click="changeSelectBoxShow(true)" style="position: relative">
<div class="image-input">
<span v-if="imageName">{{unit}} / {{imageName}}</span>
<i class="el-icon-circle-close" style="position: absolute;top: 10px;right: 10px;font-size: 14px" @click.stop="selectImageChange({image: '', id: ''})"/>
<i class="el-icon-circle-close" style="position: absolute;top: 10px;right: 10px;font-size: 14px" @click.stop="selectImageChange({image: '', id: ''}, true)"/>
</div>
</div>
<!-- <div class="image-select-box" v-if="selectBoxShow">-->
@@ -252,9 +252,12 @@ export default {
selectGroup (item) {
item.show = !item.show
},
selectImageChange (item) {
selectImageChange (item, isChange) {
this.selectImgId = item.id
this.selectImg = item
if (isChange) {
this.changImage()
}
},
changImage () {
this.unit = this.selectImg.unit