This commit is contained in:
2019-07-19 19:41:58 +00:00
parent 177f08f49d
commit 7bbe2bd315
22 changed files with 191 additions and 192 deletions

View File

@@ -18,9 +18,7 @@
<v-toolbar flat>
<v-toolbar-title>
<v-icon large color="primary">fa-splotch</v-icon>
<span class="hidden-sm-and-down">{{
this.$gzlocale.get("WidgetList")
}}</span>
<span class="hidden-sm-and-down">{{ lt("WidgetList") }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn v-if="this.rights.change" icon @click="newItem()">
@@ -45,7 +43,7 @@
:total-items="totalItems"
:loading="loading"
:rows-per-page-items="rowsPerPageItems"
:rows-per-page-text="this.$gzlocale.get('RowsPerPage')"
:rows-per-page-text="lt('RowsPerPage')"
class="elevation-1"
select-all
>
@@ -93,7 +91,7 @@ export default {
beforeCreate() {
var that = this;
this.$gzlocale
window.$gz.locale
.fetch([
"Widget",
"WidgetList",
@@ -108,8 +106,10 @@ export default {
"RowsPerPage"
])
.then(() => {
that.$_.forEach(that.headers, function setHeaderLocalizedText(header) {
header.text = that.$gzlocale.get(header.text);
window.$gz._.forEach(that.headers, function setHeaderLocalizedText(
header
) {
header.text = window.$gz.locale.get(header.text);
});
})
.then(() => {
@@ -194,6 +194,12 @@ export default {
}
},
methods: {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
},
ltFormat() {
return window.$gz.locale.format();
},
newItem() {
this.$router.push({
name: "inventory-widget-edit",
@@ -247,8 +253,9 @@ export default {
}
this.loading = true;
var listUrl = "Widget/ListWidgets?" + this.$gzapi.buildQuery(listOptions);
this.$gzapi.get(listUrl).then(res => {
var listUrl =
"Widget/ListWidgets?" + window.$gz.api.buildQuery(listOptions);
window.$gz.api.get(listUrl).then(res => {
that.loading = false;
that.Items = res.data;
that.totalItems = res.paging.count;