|
@ -1,8 +1,9 @@ |
|
|
<template> |
|
|
<template> |
|
|
|
|
|
|
|
|
<div class="treenode-org"> |
|
|
<div class="treenode-org"> |
|
|
<b v-if="v_tematku">v tematu</b> |
|
|
<!--b v-if="v_tematu">v tematu</b> |
|
|
<b v-if="visible">visible</b> |
|
|
<b v-if="visible">visible</b> |
|
|
|
|
|
Force visible: {{String(force_visible)}}--> |
|
|
<component :is='item.node.polymorphic_ctype.model' :item='item' :key='item.node.id'></component> |
|
|
<component :is='item.node.polymorphic_ctype.model' :item='item' :key='item.node.id'></component> |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,11 +25,44 @@ |
|
|
<b>Vložit před: </b> |
|
|
<b>Vložit před: </b> |
|
|
<addnewnode :types="item.children[0].appendable_siblings" :refnode="item.children[0].node" where="pred" /> |
|
|
<addnewnode :types="item.children[0].appendable_siblings" :refnode="item.children[0].node" where="pred" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div v-if="item.node.polymorphic_ctype.model==='temavcislenode'"> |
|
|
|
|
|
<!--Children: {{String(showChildren)}}--> |
|
|
|
|
|
<div v-for="(chld, index) in item.children" v-bind:key="chld.nazev" > |
|
|
|
|
|
<!--Hide: {{hideNode(chld)}}, v tematu: {{v_tematu}}, force_visible: {{force_visible}}--> |
|
|
|
|
|
<div v-if="!hideNode(chld)"> |
|
|
|
|
|
<div v-if="chld.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
|
|
|
<button v-on:click="showChildren=!showChildren"> Tady možná něco je </button> |
|
|
|
|
|
<TreeNode :item="chld" :v_tematu="true" |
|
|
|
|
|
:force_visible="showChildren"> |
|
|
|
|
|
</TreeNode> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else> |
|
|
|
|
|
<TreeNode :item="chld" :v_tematu="true" |
|
|
|
|
|
:force_visible="showChildren"> |
|
|
|
|
|
</TreeNode> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-if="chld.appendable_siblings.length > 0" class="mam-org-only" > |
|
|
|
|
|
<b v-if="index < (item.children.length - 1)">Vložit mezi: </b> |
|
|
|
|
|
<b v-else>Vložit za: </b> |
|
|
|
|
|
<addnewnode :types="chld.appendable_siblings" :refnode="chld.node" where="za" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<button v-on:click="showChildren=!showChildren"> Tady možná něco je </button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else> |
|
|
<div v-for="(chld, index) in item.children" v-bind:key="chld.nazev" > |
|
|
<div v-for="(chld, index) in item.children" v-bind:key="chld.nazev" > |
|
|
<TreeNode :item="chld" :v_tematku="item.node.polymorphic_ctype.model==='temavcislenode'||v_tematku" |
|
|
<div v-if="v_tematu && chld.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
:visible="!v_tematku||item.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
<div> Tady možná něco je </div> |
|
|
|
|
|
<TreeNode :item="chld" :v_tematu="v_tematu" |
|
|
|
|
|
:force_visible="force_visible"> |
|
|
|
|
|
</TreeNode> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else> |
|
|
|
|
|
<TreeNode :item="chld" :v_tematu="v_tematu" |
|
|
|
|
|
:force_visible="force_visible"> |
|
|
</TreeNode> |
|
|
</TreeNode> |
|
|
|
|
|
</div> |
|
|
<div v-if="chld.appendable_siblings.length > 0" class="mam-org-only" > |
|
|
<div v-if="chld.appendable_siblings.length > 0" class="mam-org-only" > |
|
|
<b v-if="index < (item.children.length - 1)">Vložit mezi: </b> |
|
|
<b v-if="index < (item.children.length - 1)">Vložit mezi: </b> |
|
|
<b v-else>Vložit za: </b> |
|
|
<b v-else>Vložit za: </b> |
|
@ -37,6 +71,8 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
@ -64,11 +100,25 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data: () => ({ |
|
|
data: () => ({ |
|
|
debugShow: false, |
|
|
debugShow: false, |
|
|
|
|
|
showChildren: false, |
|
|
}), |
|
|
}), |
|
|
|
|
|
computed: { |
|
|
|
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
item: Object, |
|
|
item: Object, |
|
|
visible: Boolean, |
|
|
force_visible: Boolean, |
|
|
v_tematku: Boolean |
|
|
v_tematu: Boolean |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
hideNode: function(chld){ |
|
|
|
|
|
if (this.showChildren || this.force_visible){ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
if (chld.node.polymorphic_ctype.model === 'ulohazadaninode'){ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|