This commit is contained in:
@@ -137,16 +137,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
<!-- :color="appBar.isMain ? 'primary' : 'secondary'" -->
|
<!-- :color="appBar.isMain ? 'primary' : 'secondary'" style="width: 300px" -->
|
||||||
<v-app-bar v-if="isAuthenticated" :color="appBar.color" dark fixed app>
|
<v-app-bar v-if="isAuthenticated" :color="appBar.color" dark fixed app>
|
||||||
<v-app-bar-nav-icon
|
<v-app-bar-nav-icon
|
||||||
@click.stop="drawer = !drawer"
|
@click.stop="drawer = !drawer"
|
||||||
data-cy="navicon"
|
data-cy="navicon"
|
||||||
></v-app-bar-nav-icon>
|
></v-app-bar-nav-icon>
|
||||||
<v-toolbar-title style="width: 300px" class="ml-0 pl-4">
|
<v-toolbar-title class="ml-n5 ml-sm-0 pl-sm-4">
|
||||||
<v-icon>{{ appBar.icon }}</v-icon
|
<v-icon>{{ appBar.icon }}</v-icon>
|
||||||
>
|
<span
|
||||||
<span v-if="appBar.title">{{ $ay.t(appBar.title) }}</span>
|
v-if="appBar.title"
|
||||||
|
class="text-subtitle-2 ml-2 text-sm-h6 ml-sm-4"
|
||||||
|
>{{ appBar.title }}</span
|
||||||
|
>
|
||||||
</v-toolbar-title>
|
</v-toolbar-title>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn text icon to="/home-notifications" data-cy="notification">
|
<v-btn text icon to="/home-notifications" data-cy="notification">
|
||||||
@@ -383,6 +386,22 @@ export default {
|
|||||||
source: { type: String, default: null }
|
source: { type: String, default: null }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
titleDisplay() {
|
||||||
|
//Allow for extra info in title
|
||||||
|
if (this.appBar.title == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.appBar.title.includes(":")) {
|
||||||
|
const t = this.appBar.title.split(":");
|
||||||
|
// if (this.$vuetify.breakpoint.smAndUp) {
|
||||||
|
// return this.$ay.t(t[0]) + " " + t[1];
|
||||||
|
// } else {
|
||||||
|
return t[1] + " " + this.$ay.t(t[0]);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
return this.$ay.t(this.appBar.title);
|
||||||
|
},
|
||||||
afterLeave() {
|
afterLeave() {
|
||||||
this.$root.$emit("triggerScroll");
|
this.$root.$emit("triggerScroll");
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
/* xxxeslint-disable */
|
/* xxxeslint-disable */
|
||||||
|
|
||||||
|
import { VMain } from "vuetify/lib";
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
// Menu utils and handlers
|
// Menu utils and handlers
|
||||||
//
|
//
|
||||||
@@ -44,7 +46,8 @@ export default {
|
|||||||
|
|
||||||
vm.appBar.isMain = ctx.isMain;
|
vm.appBar.isMain = ctx.isMain;
|
||||||
vm.appBar.icon = ctx.icon;
|
vm.appBar.icon = ctx.icon;
|
||||||
vm.appBar.title = ctx.title;
|
|
||||||
|
vm.appBar.title = ""; //this prevents fou[translated]c
|
||||||
vm.appBar.readOnly = ctx.readOnly;
|
vm.appBar.readOnly = ctx.readOnly;
|
||||||
|
|
||||||
if (ctx.readOnly === true) {
|
if (ctx.readOnly === true) {
|
||||||
@@ -52,20 +55,30 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
vm.appBar.color = ctx.isMain ? "primary" : "secondary";
|
vm.appBar.color = ctx.isMain ? "primary" : "secondary";
|
||||||
}
|
}
|
||||||
let recordName = "";
|
|
||||||
|
|
||||||
|
//ctx.title if set is a Translation key
|
||||||
|
//ctx.formData.recordName is the object name or serial number or whatever identifies it uniquely
|
||||||
|
let recordName = "";
|
||||||
if (ctx && ctx.formData && ctx.formData.recordName) {
|
if (ctx && ctx.formData && ctx.formData.recordName) {
|
||||||
recordName = ctx.formData.recordName;
|
recordName = ctx.formData.recordName;
|
||||||
}
|
}
|
||||||
let hasRecordName = recordName != "";
|
let hasRecordName = recordName != "";
|
||||||
if (ctx.title) {
|
if (ctx.title) {
|
||||||
|
//it has a title translation key
|
||||||
if (hasRecordName) {
|
if (hasRecordName) {
|
||||||
|
//recordname takes all precedence in AppBar in order to conserve space (narrow view etc)
|
||||||
|
//also it just looks cleaner, the icon is already there to indicate where the user is at
|
||||||
|
//vm.appBar.title = `${ctx.title}:${recordName}`;
|
||||||
|
vm.appBar.title = recordName;
|
||||||
document.title = `${recordName} - ${vm.$ay.t(ctx.title)} AyaNova `;
|
document.title = `${recordName} - ${vm.$ay.t(ctx.title)} AyaNova `;
|
||||||
} else {
|
} else {
|
||||||
|
vm.appBar.title = ctx.title;
|
||||||
document.title = `${vm.$ay.t(ctx.title)} ${recordName}`;
|
document.title = `${vm.$ay.t(ctx.title)} ${recordName}`;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasRecordName) {
|
if (hasRecordName) {
|
||||||
|
//not title but has record name
|
||||||
|
vm.appBar.title = recordName;
|
||||||
document.title = `${recordName} AyaNova`;
|
document.title = `${recordName} AyaNova`;
|
||||||
} else {
|
} else {
|
||||||
document.title = "AyaNova";
|
document.title = "AyaNova";
|
||||||
|
|||||||
@@ -1,32 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3" v-if="value.serial != 0">
|
<v-col
|
||||||
<template v-if="canEditSerial">
|
cols="12"
|
||||||
<v-text-field
|
sm="6"
|
||||||
v-model="value.serial"
|
lg="4"
|
||||||
:readonly="formState.readOnly"
|
xl="3"
|
||||||
:label="$ay.t('WorkOrderSerialNumber')"
|
v-if="value.serial != 0 && canEditSerial"
|
||||||
ref="serial"
|
>
|
||||||
data-cy="serial"
|
<v-text-field
|
||||||
:rules="[
|
v-model="value.serial"
|
||||||
form().integerValid(this, 'serial'),
|
:readonly="formState.readOnly"
|
||||||
form().required(this, 'serial')
|
:label="$ay.t('WorkOrderSerialNumber')"
|
||||||
]"
|
ref="serial"
|
||||||
:error-messages="form().serverErrors(this, 'serial')"
|
data-cy="serial"
|
||||||
@input="fieldValueChanged('serial')"
|
:rules="[
|
||||||
></v-text-field>
|
form().integerValid(this, 'serial'),
|
||||||
</template>
|
form().required(this, 'serial')
|
||||||
<template v-else>
|
]"
|
||||||
<div>
|
:error-messages="form().serverErrors(this, 'serial')"
|
||||||
<span class="text-caption">
|
@input="fieldValueChanged('serial')"
|
||||||
{{ $ay.t("WorkOrderSerialNumber") }}</span
|
></v-text-field>
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="text-h5">{{ value.serial }}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
<gz-pick-list
|
<gz-pick-list
|
||||||
|
|||||||
@@ -1687,7 +1687,7 @@ function generateMenu(vm) {
|
|||||||
ayaType: window.$gz.type.PurchaseOrder,
|
ayaType: window.$gz.type.PurchaseOrder,
|
||||||
recordId: vm.$route.params.recordid,
|
recordId: vm.$route.params.recordid,
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
recordName: vm.obj.serial
|
recordName: vm.obj.serial.toString()
|
||||||
},
|
},
|
||||||
menuItems: []
|
menuItems: []
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -371,7 +371,12 @@ export default {
|
|||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
//debugger;
|
|
||||||
|
window.$gz.eventBus.$emit("menu-change", {
|
||||||
|
isMain: true,
|
||||||
|
icon: "",
|
||||||
|
title: null
|
||||||
|
});
|
||||||
|
|
||||||
//reset password redirects here with preset creds
|
//reset password redirects here with preset creds
|
||||||
//this will help the user identify it and hopefully remember it
|
//this will help the user identify it and hopefully remember it
|
||||||
@@ -384,11 +389,6 @@ export default {
|
|||||||
vm.mediumLogoUrl = window.$gz.api.logoUrl("medium");
|
vm.mediumLogoUrl = window.$gz.api.logoUrl("medium");
|
||||||
vm.largeLogoUrl = window.$gz.api.logoUrl("large");
|
vm.largeLogoUrl = window.$gz.api.logoUrl("large");
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", {
|
|
||||||
isMain: true,
|
|
||||||
icon: "",
|
|
||||||
title: ""
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
let res = await window.$gz.api.get("notify/hello");
|
let res = await window.$gz.api.get("notify/hello");
|
||||||
if (res.data != null) {
|
if (res.data != null) {
|
||||||
@@ -533,6 +533,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async login() {
|
async login() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
|
|
||||||
if (vm.input.username != "" && vm.input.password != "") {
|
if (vm.input.username != "" && vm.input.password != "") {
|
||||||
vm.errorBadCreds = false;
|
vm.errorBadCreds = false;
|
||||||
vm.loggedInWithKnownPassword =
|
vm.loggedInWithKnownPassword =
|
||||||
|
|||||||
@@ -979,7 +979,7 @@ function generateMenu(vm) {
|
|||||||
ayaType: window.$gz.type.WorkOrder,
|
ayaType: window.$gz.type.WorkOrder,
|
||||||
recordId: vm.$route.params.recordid,
|
recordId: vm.$route.params.recordid,
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
recordName: vm.obj.serial
|
recordName: vm.obj.serial.toString()
|
||||||
},
|
},
|
||||||
menuItems: []
|
menuItems: []
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user