This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row v-if="formState.ready">
|
<v-row v-if="formState.ready">
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
<v-col>
|
<v-col cols="12" v-if="showSelector">
|
||||||
<v-dialog
|
<v-dialog
|
||||||
scrollable
|
scrollable
|
||||||
max-width="600px"
|
max-width="600px"
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<v-list-item
|
<v-list-item
|
||||||
v-for="item in availableItems()"
|
v-for="item in availableItems()"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@click="addItem(item.id)"
|
@click="addItem(item)"
|
||||||
>
|
>
|
||||||
<v-list-item-title>{{ item.title }}</v-list-item-title>
|
<v-list-item-title>{{ item.title }}</v-list-item-title>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
@@ -127,8 +127,15 @@ export default {
|
|||||||
dashMoveEnd: function(item) {
|
dashMoveEnd: function(item) {
|
||||||
console.log("home-dashboard:dashMoveEnd", item);
|
console.log("home-dashboard:dashMoveEnd", item);
|
||||||
},
|
},
|
||||||
dashRemove: function(item) {
|
dashRemove: function(id) {
|
||||||
console.log("home-dashboard:dashRemove", item);
|
let index = this.getEffectiveViewItemIndexById(id);
|
||||||
|
console.log(id);
|
||||||
|
console.log("remove effective index for item is ", index);
|
||||||
|
if (index == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.effectiveView.splice(index, 1);
|
||||||
|
//
|
||||||
},
|
},
|
||||||
dashRefresh: function(item) {
|
dashRefresh: function(item) {
|
||||||
console.log(
|
console.log(
|
||||||
@@ -136,8 +143,21 @@ export default {
|
|||||||
item
|
item
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
getEffectiveViewItemIndexById: function(id) {
|
||||||
|
return this.effectiveView.findIndex(z => z.id == id);
|
||||||
|
},
|
||||||
|
addItem: function(item) {
|
||||||
|
this.showSelector = false;
|
||||||
|
//add to effective view
|
||||||
|
this.effectiveView.push(item);
|
||||||
|
//save effective view as saved View
|
||||||
|
},
|
||||||
availableItems: function() {
|
availableItems: function() {
|
||||||
return DashRegistry.availableItems(); //minus effectiveView
|
let allItems = DashRegistry.availableItems();
|
||||||
|
let newItems = allItems.filter(
|
||||||
|
z => !this.effectiveView.find(m => m.id == z.id)
|
||||||
|
);
|
||||||
|
return newItems;
|
||||||
},
|
},
|
||||||
async getDataFromApi() {
|
async getDataFromApi() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user