Demo:新增删除节点图片前的二次提示

This commit is contained in:
街角小林 2024-09-09 18:04:56 +08:00
parent ef526fe302
commit 9b7305de1e
3 changed files with 23 additions and 2 deletions

View File

@ -306,7 +306,8 @@ export default {
yes: 'Yes',
no: 'No',
exportError: 'Export failed',
dragTip: 'Release here to import the file'
dragTip: 'Release here to import the file',
deleteNodeImgTip: 'Are you sure to delete the node image?'
},
mouseAction: {
tip1:

View File

@ -300,7 +300,8 @@ export default {
yes: '是',
no: '否',
exportError: '导出失败',
dragTip: '在此释放以导入该文件'
dragTip: '在此释放以导入该文件',
deleteNodeImgTip: '是否确认删除该节点图片?'
},
mouseAction: {
tip1: '当前:左键拖动画布,右键框选节点',

View File

@ -421,6 +421,25 @@ export default {
},
expandBtnNumHandler: num => {
return num >= 100 ? '…' : num
},
beforeDeleteNodeImg: node => {
return new Promise(resolve => {
this.$confirm(
this.$t('edit.deleteNodeImgTip'),
this.$t('edit.tip'),
{
confirmButtonText: this.$t('edit.yes'),
cancelButtonText: this.$t('edit.no'),
type: 'warning'
}
)
.then(() => {
resolve(false)
})
.catch(() => {
resolve(true)
})
})
}
// createNodePrefixContent: (node) => {
// const el = document.createElement('div')