This commit is contained in:
James Cole
2019-09-06 16:29:52 +02:00
parent 377f31b910
commit a6164456e6
6 changed files with 68 additions and 47 deletions

View File

@@ -74,6 +74,12 @@
default: function () {
return [];
}
},
defaultAccountTypeFilters: {
type: Array,
default: function () {
return [];
}
}
},
@@ -84,7 +90,8 @@
trType: this.transactionType,
target: null,
inputDisabled: false,
allowedTypes: this.accountTypeFilters
allowedTypes: this.accountTypeFilters,
defaultAllowedTypes: this.defaultAccountTypeFilters
}
},
ready() {
@@ -94,6 +101,8 @@
this.target = this.$refs.input;
let types = this.allowedTypes.join(',');
this.name = this.accountName;
// console.log('Mounted Types:');
// console.log(this.allowedTypes);
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&search=";
this.triggerTransactionType();
},
@@ -104,6 +113,10 @@
},
accountTypeFilters() {
let types = this.accountTypeFilters.join(',');
if (0 === this.accountTypeFilters.length) {
types = this.defaultAccountTypeFilters.join(',');
// console.log('types was empty: ' + types);
}
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&search=";
}
},