|
@ -1,16 +1,19 @@ |
|
|
<template> |
|
|
<template> |
|
|
|
|
|
|
|
|
<div :class="editorMode ? 'treenode-org' : 'treenode'"> |
|
|
<div :class="editorMode ? 'treenode-org' : 'treenode'"> |
|
|
<!--b v-if="v_tematu">v tematu</b> |
|
|
<!--b v-if="tema">v tematu</b> |
|
|
<b v-if="visible">visible</b> |
|
|
<b v-if="visible">visible</b> |
|
|
Force visible: {{String(force_visible)}}--> |
|
|
Force visible: {{String(force_visible)}}--> |
|
|
<component :is='item.node.polymorphic_ctype.model' :item='item' :key='item.node.id' |
|
|
<component :is='item.node.polymorphic_ctype.model' :item='item' :key='item.node.id' |
|
|
|
|
|
:tema="temaOut" |
|
|
:editorMode="editorMode" |
|
|
:editorMode="editorMode" |
|
|
:debugMode="debugMode"></component> |
|
|
:debugMode="debugMode"></component> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<button v-if="debugMode" v-on:click="debugShow = !debugShow" class="nodebug">Ladící data</button> <!-- bude tu nějaký if na class="nodebug", v debug módu bude tlačítko vidět, jinak ne --> |
|
|
<button v-if="debugMode" v-on:click="debugShow = !debugShow" class="nodebug">Ladící data</button> <!-- bude tu nějaký if na class="nodebug", v debug módu bude tlačítko vidět, jinak ne --> |
|
|
<div v-if="debugShow"> |
|
|
<div v-if="debugShow"> |
|
|
|
|
|
<pre>Tema: {{ tema }}</pre> |
|
|
|
|
|
<pre>TemaOut: {{ temaOut }}</pre> |
|
|
<pre>{{ item.node.polymorphic_ctype.model }}</pre> |
|
|
<pre>{{ item.node.polymorphic_ctype.model }}</pre> |
|
|
<pre>{{ item }}</pre> |
|
|
<pre>{{ item }}</pre> |
|
|
</div> |
|
|
</div> |
|
@ -18,31 +21,31 @@ |
|
|
<div v-if="item.children.length === 0"> |
|
|
<div v-if="item.children.length === 0"> |
|
|
<div v-if="item.appendable_children.length > 0 && editorMode"> |
|
|
<div v-if="item.appendable_children.length > 0 && editorMode"> |
|
|
<b>Vložit jako syna: </b> |
|
|
<b>Vložit jako syna: </b> |
|
|
<addnewnode :types="item.appendable_children" :refnode="item.node" where="syn" /> |
|
|
<addnewnode :types="item.appendable_children" :refnode="item.node" :tema="temaOut" where="syn" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-else :class="editorMode ? 'children-org' : 'children'"> <!-- bude tu nějaký if na class="children" --> |
|
|
<div v-else :class="editorMode ? 'children-org' : 'children'"> <!-- bude tu nějaký if na class="children" --> |
|
|
<div v-if="item.children.length > 0 && item.children[0].appendable_siblings.length > 0 && editorMode"> |
|
|
<div v-if="item.children.length > 0 && item.children[0].appendable_siblings.length > 0 && editorMode"> |
|
|
<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" :tema="temaOut" where="pred" /> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="item.node.polymorphic_ctype.model==='temavcislenode'"> |
|
|
<div v-if="item.node.polymorphic_ctype.model==='temavcislenode'"> |
|
|
<!--Children: {{String(showChildren)}}--> |
|
|
<!--Children: {{String(showChildren)}}--> |
|
|
<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" > |
|
|
<!--Hide: {{hideNode(chld)}}, v tematu: {{v_tematu}}, force_visible: {{force_visible}}--> |
|
|
<!--Hide: {{hideNode(chld)}}, v tematu: {{tema}}, force_visible: {{force_visible}}--> |
|
|
<div v-if="!hideNode(chld)"> |
|
|
<div v-if="!hideNode(chld)"> |
|
|
<div v-if="chld.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
<div v-if="chld.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
<button v-if="showChildren" v-on:click="showChildren=!showChildren"> Schovat </button> |
|
|
<button v-if="showChildren" v-on:click="showChildren=!showChildren"> Schovat </button> |
|
|
<button v-else v-on:click="showChildren=!showChildren"> Rozbalit </button> |
|
|
<button v-else v-on:click="showChildren=!showChildren"> Rozbalit </button> |
|
|
<TreeNode :item="chld" :v_tematu="true" |
|
|
<TreeNode :item="chld" :tema="temaOut" |
|
|
:force_visible="showChildren" |
|
|
:force_visible="showChildren" |
|
|
:editorMode="editorMode" |
|
|
:editorMode="editorMode" |
|
|
:debugMode="debugMode"> |
|
|
:debugMode="debugMode"> |
|
|
</TreeNode> |
|
|
</TreeNode> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else> |
|
|
<div v-else> |
|
|
<TreeNode :item="chld" :v_tematu="true" |
|
|
<TreeNode :item="chld" :tema="temaOut" |
|
|
:force_visible="showChildren" |
|
|
:force_visible="showChildren" |
|
|
:editorMode="editorMode" |
|
|
:editorMode="editorMode" |
|
|
:debugMode="debugMode"> |
|
|
:debugMode="debugMode"> |
|
@ -51,7 +54,7 @@ |
|
|
<div v-if="chld.appendable_siblings.length > 0 && editorMode" > |
|
|
<div v-if="chld.appendable_siblings.length > 0 && editorMode" > |
|
|
<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> |
|
|
<addnewnode :types="chld.appendable_siblings" :refnode="chld.node" where="za" /> |
|
|
<addnewnode :types="chld.appendable_siblings" :refnode="chld.node" :tema="temaOut" where="za" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -60,16 +63,16 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div v-else> |
|
|
<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" > |
|
|
<div v-if="v_tematu && chld.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
<div v-if="tema !== null && chld.node.polymorphic_ctype.model==='ulohazadaninode'"> |
|
|
<div> Tady možná něco je </div> |
|
|
<div> Tady možná něco je </div> |
|
|
<TreeNode :item="chld" :v_tematu="v_tematu" |
|
|
<TreeNode :item="chld" :tema="temaOut" |
|
|
:force_visible="force_visible" |
|
|
:force_visible="force_visible" |
|
|
:editorMode="editorMode" |
|
|
:editorMode="editorMode" |
|
|
:debugMode="debugMode"> |
|
|
:debugMode="debugMode"> |
|
|
</TreeNode> |
|
|
</TreeNode> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else> |
|
|
<div v-else> |
|
|
<TreeNode :item="chld" :v_tematu="v_tematu" |
|
|
<TreeNode :item="chld" :tema="temaOut" |
|
|
:force_visible="force_visible" |
|
|
:force_visible="force_visible" |
|
|
:editorMode="editorMode" |
|
|
:editorMode="editorMode" |
|
|
:debugMode="debugMode"> |
|
|
:debugMode="debugMode"> |
|
@ -78,7 +81,7 @@ |
|
|
<div v-if="chld.appendable_siblings.length > 0 && editorMode" > |
|
|
<div v-if="chld.appendable_siblings.length > 0 && editorMode" > |
|
|
<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> |
|
|
<addnewnode :types="chld.appendable_siblings" :refnode="chld.node" where="za" /> |
|
|
<addnewnode :types="chld.appendable_siblings" :refnode="chld.node" :tema="temaOut" where="za" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -112,14 +115,15 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data: () => ({ |
|
|
data: () => ({ |
|
|
debugShow: false, |
|
|
debugShow: false, |
|
|
showChildren: false |
|
|
showChildren: false, |
|
|
|
|
|
temaOut: null, |
|
|
}), |
|
|
}), |
|
|
computed: { |
|
|
computed: { |
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
item: Object, |
|
|
item: Object, |
|
|
force_visible: Boolean, |
|
|
force_visible: Boolean, |
|
|
v_tematu: Boolean, |
|
|
tema: Object, |
|
|
editorMode: Boolean, |
|
|
editorMode: Boolean, |
|
|
debugMode: Boolean, |
|
|
debugMode: Boolean, |
|
|
}, |
|
|
}, |
|
@ -132,7 +136,17 @@ export default { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
return true; |
|
|
return true; |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
mounted: function(){ |
|
|
|
|
|
if (this.item.node.polymorphic_ctype.model === 'temavcislenode'){ |
|
|
|
|
|
this.temaOut = this.item.node.tema; |
|
|
|
|
|
console.log(this.temaOut); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.temaOut = this.tema; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|