diff --git a/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue b/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue index c1dcba614373f5284040bb6c9b28e42e77aa19a9..4fec854dfb56c0ba3914c3e7885f809e2c33a46c 100644 --- a/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue +++ b/src/components/input/pharma-input-fields/PhExtServiceTreeview.vue @@ -14,6 +14,8 @@ <v-flex xs6> <v-layout row wrap fill-height> <v-flex xs6> + <v-btn @click="alert($refs.treeview.items)">view</v-btn> + <v-btn @click="myget($refs.treeview.items)">find</v-btn> <v-btn @click="$refs.treeview.updateAll(true)">Open next level</v-btn> <v-btn @click="$refs.treeview.updateAll(false)">Close all</v-btn> </v-flex> @@ -44,6 +46,7 @@ ></v-checkbox> </div> </template> + <template v-slot:prepend="{ item}"> <span v-if="!item.children"></span> </template> @@ -62,9 +65,9 @@ :key="i" label close - @input="selectedItems=[]" + @input="selectedItems.splice(i,1);deselect(data, $refs.treeview)" > - <span>{{ data.text }}</span> + <span>{{ data.text }}{{data.selected}}</span> </v-chip> </v-card-text> </v-flex> @@ -182,6 +185,15 @@ export default { } }, methods: { + myget: function(tree) { + console.log("in myget", tree); + var lol = _.findIndex(tree, ["text", "Modeling"]); + console.log("in myget", lol); + }, + + alert: function(a) { + console.log("alert", a); + }, select: function(item) { if (item.selected) { //push it to selected items but first check if it's there first @@ -199,6 +211,20 @@ export default { } } }, + deselect: function(item, tree) { + //push it to selected items but first check if it's there first + console.log("in deselect", item, tree.items); + + if (this.selectedItems.indexOf(item) > -1) { + //item has been selected; + var index = this.selectedItems.indexOf(item); + console.log("in deselect2", this.selectedItems); + this.selectedItems.splice(index, 1); + console.log("in deselect3", this.selectedItems); + } else { + //console.log("item ", item); + } + }, init: function(e) { //console.log("in console", e); e = []; diff --git a/src/utils/json-ld.js b/src/utils/json-ld.js index 9d885efe50ccbea82715c44d32b2e4a4c868883b..fe3238b2bacaa508ba5329eb593e7d1d052c6bc9 100644 --- a/src/utils/json-ld.js +++ b/src/utils/json-ld.js @@ -1937,17 +1937,6 @@ export default { delete f.value[k]["@hierarchicalAncestors"]; } - /* if (f.value[k]["@type"]) { - //this is to keep track of voc (which field) - //console.log("type here", f.value[k]["@type"], f); - if (f.component === "selection") { - //console.log("selection"); - } else { - //we do this only for the ones where component in not "selection", - f.value[k]["@type"] = f.subjectType; - } - }*/ - //overwrite the "skos:Concept" of @type returned by the extnsion service to keep track of field structure console.log("lala", f.value[k]["@type"], f.type); f.value[k]["@type"] = f.type; console.log("lala2", f.value[k]["@type"]);