Demo:支持传入父节点和仅删除当前节点
This commit is contained in:
parent
2e4c6bc08e
commit
caedfb46a9
@ -1,8 +1,8 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont"; /* Project id 2479351 */
|
font-family: "iconfont"; /* Project id 2479351 */
|
||||||
src: url('iconfont.woff2?t=1695365666344') format('woff2'),
|
src: url('iconfont.woff2?t=1697073602349') format('woff2'),
|
||||||
url('iconfont.woff?t=1695365666344') format('woff'),
|
url('iconfont.woff?t=1697073602349') format('woff'),
|
||||||
url('iconfont.ttf?t=1695365666344') format('truetype');
|
url('iconfont.ttf?t=1697073602349') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@ -13,6 +13,10 @@
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icondodeparent:before {
|
||||||
|
content: "\e70f";
|
||||||
|
}
|
||||||
|
|
||||||
.icongongshi:before {
|
.icongongshi:before {
|
||||||
content: "\e617";
|
content: "\e617";
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -209,6 +209,11 @@ export const shortcutKeyList = [
|
|||||||
name: 'Insert sibling node',
|
name: 'Insert sibling node',
|
||||||
value: 'Enter'
|
value: 'Enter'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: 'icondodeparent',
|
||||||
|
name: 'Insert parent node',
|
||||||
|
value: 'Shift + Tab'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: 'iconshangyi',
|
icon: 'iconshangyi',
|
||||||
name: 'Move up node',
|
name: 'Move up node',
|
||||||
@ -234,6 +239,11 @@ export const shortcutKeyList = [
|
|||||||
name: 'Delete node',
|
name: 'Delete node',
|
||||||
value: 'Delete | Backspace'
|
value: 'Delete | Backspace'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: 'iconshanchu',
|
||||||
|
name: 'Delete current node',
|
||||||
|
value: 'Shift + Backspace'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: 'iconfuzhi',
|
icon: 'iconfuzhi',
|
||||||
name: 'Copy node',
|
name: 'Copy node',
|
||||||
|
|||||||
@ -276,6 +276,11 @@ export const shortcutKeyList = [
|
|||||||
name: '插入同级节点',
|
name: '插入同级节点',
|
||||||
value: 'Enter'
|
value: 'Enter'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: 'icondodeparent',
|
||||||
|
name: '插入父节点',
|
||||||
|
value: 'Shift + Tab'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: 'iconshangyi',
|
icon: 'iconshangyi',
|
||||||
name: '上移节点',
|
name: '上移节点',
|
||||||
@ -301,6 +306,11 @@ export const shortcutKeyList = [
|
|||||||
name: '删除节点',
|
name: '删除节点',
|
||||||
value: 'Delete | Backspace'
|
value: 'Delete | Backspace'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: 'iconshanchu',
|
||||||
|
name: '仅删除当前节点',
|
||||||
|
value: 'Shift + Backspace'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
icon: 'iconfuzhi',
|
icon: 'iconfuzhi',
|
||||||
name: '复制节点',
|
name: '复制节点',
|
||||||
|
|||||||
@ -59,10 +59,12 @@ export default {
|
|||||||
contextmenu: {
|
contextmenu: {
|
||||||
insertSiblingNode: 'Insert sibling node',
|
insertSiblingNode: 'Insert sibling node',
|
||||||
insertChildNode: 'Insert child node',
|
insertChildNode: 'Insert child node',
|
||||||
|
insertParentNode: 'Insert parent node',
|
||||||
insertSummary: 'Insert summary',
|
insertSummary: 'Insert summary',
|
||||||
moveUpNode: 'Move up node',
|
moveUpNode: 'Move up node',
|
||||||
moveDownNode: 'Move down node',
|
moveDownNode: 'Move down node',
|
||||||
deleteNode: 'Delete node',
|
deleteNode: 'Delete node',
|
||||||
|
deleteCurrentNode: 'Only del cur node',
|
||||||
copyNode: 'Copy node',
|
copyNode: 'Copy node',
|
||||||
cutNode: 'Cut node',
|
cutNode: 'Cut node',
|
||||||
pasteNode: 'Paste node',
|
pasteNode: 'Paste node',
|
||||||
|
|||||||
@ -59,10 +59,12 @@ export default {
|
|||||||
contextmenu: {
|
contextmenu: {
|
||||||
insertSiblingNode: '插入同级节点',
|
insertSiblingNode: '插入同级节点',
|
||||||
insertChildNode: '插入子级节点',
|
insertChildNode: '插入子级节点',
|
||||||
|
insertParentNode: '插入父节点',
|
||||||
insertSummary: '插入概要',
|
insertSummary: '插入概要',
|
||||||
moveUpNode: '上移节点',
|
moveUpNode: '上移节点',
|
||||||
moveDownNode: '下移节点',
|
moveDownNode: '下移节点',
|
||||||
deleteNode: '删除节点',
|
deleteNode: '删除节点',
|
||||||
|
deleteCurrentNode: '仅删除当前节点',
|
||||||
copyNode: '复制节点',
|
copyNode: '复制节点',
|
||||||
cutNode: '剪切节点',
|
cutNode: '剪切节点',
|
||||||
pasteNode: '粘贴节点',
|
pasteNode: '粘贴节点',
|
||||||
|
|||||||
@ -22,6 +22,14 @@
|
|||||||
{{ $t('contextmenu.insertChildNode') }}
|
{{ $t('contextmenu.insertChildNode') }}
|
||||||
<span class="desc">Tab</span>
|
<span class="desc">Tab</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="item"
|
||||||
|
@click="exec('INSERT_PARENT_NODE')"
|
||||||
|
:class="{ disabled: insertNodeBtnDisabled }"
|
||||||
|
>
|
||||||
|
{{ $t('contextmenu.insertParentNode') }}
|
||||||
|
<span class="desc">Shift + Tab</span>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="item"
|
class="item"
|
||||||
@click="exec('ADD_GENERALIZATION')"
|
@click="exec('ADD_GENERALIZATION')"
|
||||||
@ -50,6 +58,10 @@
|
|||||||
{{ $t('contextmenu.deleteNode') }}
|
{{ $t('contextmenu.deleteNode') }}
|
||||||
<span class="desc">Delete</span>
|
<span class="desc">Delete</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item danger" @click="exec('REMOVE_CURRENT_NODE')">
|
||||||
|
{{ $t('contextmenu.deleteCurrentNode') }}
|
||||||
|
<span class="desc">Shift + Backspace</span>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="item"
|
class="item"
|
||||||
@click="exec('COPY_NODE')"
|
@click="exec('COPY_NODE')"
|
||||||
@ -332,7 +344,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.listBox {
|
.listBox {
|
||||||
width: 200px;
|
width: 240px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0 4px 12px 0 hsla(0, 0%, 69%, 0.5);
|
box-shadow: 0 4px 12px 0 hsla(0, 0%, 69%, 0.5);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user