This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-flex xs12 md12>
|
<v-flex xs12 md12>
|
||||||
<div>
|
<div v-if="this.formReady">
|
||||||
<v-toolbar flat>
|
<v-toolbar flat>
|
||||||
<v-toolbar-title>
|
<v-toolbar-title>
|
||||||
<v-icon large color="primary">fa-splotch</v-icon>
|
<v-icon large color="primary">fa-splotch</v-icon>
|
||||||
<span class="hidden-sm-and-down">{{ lt("WidgetList")}}</span>
|
<span class="hidden-sm-and-down">{{ this.$gzlocale.get("WidgetList")}}</span>
|
||||||
</v-toolbar-title>
|
</v-toolbar-title>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn icon @click="newItem()">
|
<v-btn icon @click="newItem()">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
:total-items="totalItems"
|
:total-items="totalItems"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:rows-per-page-items="rowsPerPageItems"
|
:rows-per-page-items="rowsPerPageItems"
|
||||||
:rows-per-page-text="lt('RowsPerPage')"
|
:rows-per-page-text="this.$gzlocale.get('RowsPerPage')"
|
||||||
class="elevation-1"
|
class="elevation-1"
|
||||||
>
|
>
|
||||||
<template slot="items" slot-scope="props">
|
<template slot="items" slot-scope="props">
|
||||||
@@ -52,29 +52,44 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* Xeslint-disable */
|
/* eslint-disable */
|
||||||
import localeText from "../api/locale";
|
// import localeText from "../api/locale";
|
||||||
import api from "../api/apiutil";
|
// import api from "../api/apiutil";
|
||||||
import WidgetEdit from "../components/inventorywidgetedit";
|
import WidgetEdit from "../components/inventorywidgetedit";
|
||||||
export default {
|
export default {
|
||||||
ltKeysRequired: [
|
created() {
|
||||||
"Widget",
|
var that = this;
|
||||||
"WidgetList",
|
this.$gzlocale
|
||||||
"WidgetName",
|
.fetch([
|
||||||
"WidgetSerial",
|
"Widget",
|
||||||
"WidgetDollarAmount",
|
"WidgetList",
|
||||||
"Active",
|
"WidgetName",
|
||||||
"WidgetRoles",
|
"WidgetSerial",
|
||||||
"WidgetStartDate",
|
"WidgetDollarAmount",
|
||||||
"WidgetEndDate",
|
"Active",
|
||||||
"WidgetNotes",
|
"WidgetRoles",
|
||||||
"RowsPerPage"
|
"WidgetStartDate",
|
||||||
],
|
"WidgetEndDate",
|
||||||
|
"WidgetNotes",
|
||||||
|
"RowsPerPage"
|
||||||
|
])
|
||||||
|
.then(() => {
|
||||||
|
that.$_.forEach(that.headers, function(header) {
|
||||||
|
header.text = that.$gzlocale.get(header.text);
|
||||||
|
});
|
||||||
|
//this.headers[0].text = this.$gzlocale.get("WidgetName");
|
||||||
|
})
|
||||||
|
.then(() => (this.formReady = true))
|
||||||
|
.catch(err => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
WidgetEdit
|
WidgetEdit
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
formReady: false,
|
||||||
dialogdata: {
|
dialogdata: {
|
||||||
showeditdialog: false,
|
showeditdialog: false,
|
||||||
recordId: 0
|
recordId: 0
|
||||||
@@ -88,15 +103,18 @@ export default {
|
|||||||
rowsPerPageText: "blah per blah",
|
rowsPerPageText: "blah per blah",
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
text: this.lt("WidgetName"),
|
text: "WidgetName",
|
||||||
value: "name"
|
value: "name"
|
||||||
},
|
},
|
||||||
{ text: this.lt("WidgetSerial"), value: "serial" },
|
{ text: "WidgetSerial", value: "serial" },
|
||||||
{ text: this.lt("WidgetDollarAmount"), value: "dollarAmount" },
|
{
|
||||||
{ text: this.lt("Active"), value: "active" },
|
text: "WidgetDollarAmount",
|
||||||
{ text: this.lt("WidgetRoles"), value: "roles" },
|
value: "dollarAmount"
|
||||||
{ text: this.lt("WidgetStartDate"), value: "startDate" },
|
},
|
||||||
{ text: this.lt("WidgetEndDate"), value: "endDate" }
|
{ text: "Active", value: "active" },
|
||||||
|
{ text: "WidgetRoles", value: "roles" },
|
||||||
|
{ text: "WidgetStartDate", value: "startDate" },
|
||||||
|
{ text: "WidgetEndDate", value: "endDate" }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -104,36 +122,11 @@ export default {
|
|||||||
pagination: {
|
pagination: {
|
||||||
handler() {
|
handler() {
|
||||||
this.getDataFromApi();
|
this.getDataFromApi();
|
||||||
/*
|
|
||||||
{
|
|
||||||
descending: false,
|
|
||||||
page: 1,
|
|
||||||
rowsPerPage: 5,
|
|
||||||
sortBy: "name",
|
|
||||||
totalItems: 0
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
/* Check rights here?
|
|
||||||
e.g.
|
|
||||||
if (
|
|
||||||
roles.hasRole(roles.AuthorizationRoles.OpsAdminFull) ||
|
|
||||||
roles.hasRole(roles.AuthorizationRoles.OpsAdminLimited)
|
|
||||||
) {
|
|
||||||
addNavItem(lt.get("Operations"), "cogs", "ops");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
this.rowsPerPageText = this.lt("RowsPerPage");
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
methods: {
|
methods: {
|
||||||
lt: function(key) {
|
|
||||||
return localeText.get(key);
|
|
||||||
},
|
|
||||||
newItem() {
|
newItem() {
|
||||||
this.dialogdata.recordId = -1;
|
this.dialogdata.recordId = -1;
|
||||||
this.dialogdata.showeditdialog = true;
|
this.dialogdata.showeditdialog = true;
|
||||||
@@ -157,8 +150,8 @@ export default {
|
|||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
//debugger;
|
//debugger;
|
||||||
var listUrl = "Widget/ListWidgets?" + api.buildQuery(listOptions);
|
var listUrl = "Widget/ListWidgets?" + this.$gzapi.buildQuery(listOptions);
|
||||||
api.get(listUrl).then(res => {
|
this.$gzapi.get(listUrl).then(res => {
|
||||||
// debugger;
|
// debugger;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.Items = res.data;
|
this.Items = res.data;
|
||||||
@@ -170,18 +163,12 @@ export default {
|
|||||||
name: "inventory-widget-edit",
|
name: "inventory-widget-edit",
|
||||||
params: { id: item.id }
|
params: { id: item.id }
|
||||||
});
|
});
|
||||||
//router.push({ name: 'user', params: { userId: '123' } })
|
|
||||||
// this.dialogdata.recordId = item.id;
|
|
||||||
// this.dialogdata.showeditdialog = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
//Example api response
|
//Example api response
|
||||||
// {
|
// {
|
||||||
// "data": [
|
// "data": [
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ import PartAssemblyTop from "../components/inventorypartassemblytop";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
//Cache all required lt keys
|
this.$gzlocale.fetch(["Inventory"]);
|
||||||
var ltKeysRequired = ["Inventory"].concat(WidgetList.ltKeysRequired);
|
|
||||||
this.$gzlocale.fetch(ltKeysRequired);
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
WidgetList,
|
WidgetList,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-layout row v-if="this.ready">
|
<v-layout row v-if="this.formReady">
|
||||||
<v-flex>
|
<v-flex>
|
||||||
<h1>{{ this.$gzlocale.get("Log")}}</h1>
|
<h1>{{ this.$gzlocale.get("Log")}}</h1>
|
||||||
<v-textarea v-model="logText" full-width readonly auto-grow></v-textarea>
|
<v-textarea v-model="logText" full-width readonly auto-grow></v-textarea>
|
||||||
@@ -19,13 +19,13 @@ export default {
|
|||||||
|
|
||||||
this.$gzlocale
|
this.$gzlocale
|
||||||
.fetch(["Log"])
|
.fetch(["Log"])
|
||||||
.then(() => (this.ready = true))
|
.then(() => (this.formReady = true))
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return { logText: "", ready: false };
|
return { logText: "", formReady: false };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -38,24 +38,12 @@
|
|||||||
</form>
|
</form>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<!-- <v-footer>
|
|
||||||
<v-layout>
|
|
||||||
<v-flex primary py-2 text-xs-center white--text xs12>
|
|
||||||
<div>
|
|
||||||
<a href="https://ayanova.com" target="_blank">
|
|
||||||
<span class="white--text caption">AyaNova ({{version}}) {{copyright}}</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</v-flex>
|
|
||||||
</v-layout>
|
|
||||||
</v-footer> -->
|
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* xeslint-disable */
|
/* xeslint-disable */
|
||||||
import auth from "../api/auth";
|
import auth from "../api/auth";
|
||||||
// import aboutInfo from "../api/aboutinfo";
|
|
||||||
export default {
|
export default {
|
||||||
name: "Login",
|
name: "Login",
|
||||||
data() {
|
data() {
|
||||||
@@ -82,14 +70,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
// copyright() {
|
|
||||||
// return aboutInfo.copyright;
|
|
||||||
// },
|
|
||||||
// version() {
|
|
||||||
// return aboutInfo.version;
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
beforeRouteEnter(to, from, next) {
|
beforeRouteEnter(to, from, next) {
|
||||||
next(() => {
|
next(() => {
|
||||||
auth.logout();
|
auth.logout();
|
||||||
|
|||||||
Reference in New Issue
Block a user