This commit is contained in:
2020-12-22 15:21:11 +00:00
parent e0b70a49e3
commit 295cf4c0c4
4 changed files with 28 additions and 11 deletions

View File

@@ -305,8 +305,8 @@ export default {
vm.$router.push({
name: "home-reviews",
params: {
objectType: Number.parseInt(item.data.ayaType),
objectId: Number.parseInt(item.data.recordId),
objectType: Number.parseInt(item.data.ayaType, 10),
objectId: Number.parseInt(item.data.recordId, 10),
name: objName
}
});

View File

@@ -10,10 +10,13 @@ export default {
// called from App.vue
handleOpenObjectClick(vm, tid) {
//expects extra data (tid) to be one of { type: [AYATYPE], id: [RECORDID] }
//console.log("open-object-handler::handleOpenObjectClick, tid:", tid);
//NOTE: for new objects all edit pages assume record ID 0 means create rather than open
if (tid.type && tid.id != null) {
//if these come from route parameters they may well be strings
tid.type = Number.parseInt(tid.type, 10);
tid.id = Number.parseInt(tid.id, 10);
switch (tid.type) {
case ayatype.Memo:
vm.$router.push({

View File

@@ -5,8 +5,8 @@
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<v-form ref="form">
<div class="mb-6" v-if="obj.objectType">
<v-icon large>{{ iconForType }}</v-icon
><span class="text-h5"> {{ name }}</span>
<v-icon large @click="navToTarget()">{{ iconForType }}</v-icon
><span class="text-h5" @click="navToTarget()"> {{ name }}</span>
</div>
<v-row>
<v-col v-if="currentUserIsASupervisor" cols="12" sm="6" lg="4" xl="3">
@@ -346,7 +346,9 @@ export default {
},
iconForType() {
return window.$gz.util.iconForType(Number.parseInt(this.obj.objectType));
return window.$gz.util.iconForType(
Number.parseInt(this.obj.objectType, 10)
);
},
hasSupervisorRole: function() {
//mirrored from ReviewBiz.cs validation rule at server
@@ -367,6 +369,12 @@ export default {
}
},
methods: {
navToTarget: function() {
window.$gz.eventBus.$emit("openobject", {
type: this.obj.objectType,
id: this.obj.objectId
});
},
canSave: function() {
return this.formState.valid && this.formState.dirty;
},

View File

@@ -1,8 +1,8 @@
<template>
<div>
<div v-if="objectType" class="mb-6">
<v-icon large>{{ iconForType() }}</v-icon
><span class="text-h5"> {{ name }}</span>
<v-icon @click="navToTarget()" large>{{ iconForType() }}</v-icon
><span @click="navToTarget()" class="text-h5"> {{ name }}</span>
</div>
<gz-report-selector ref="reportSelector"></gz-report-selector>
<gz-extensions
@@ -44,13 +44,13 @@ export default {
{
fld: "metareviewobjectid",
filter: {
items: [{ op: "=", value: Number.parseInt(vm.objectId) }] //oddly still need this to turn it from a string even when it wasn't a string
items: [{ op: "=", value: Number.parseInt(vm.objectId, 10) }] //oddly still need this to turn it from a string even when it wasn't a string
}
},
{
fld: "AyaType",
filter: {
items: [{ op: "=", value: Number.parseInt(vm.objectType) }]
items: [{ op: "=", value: Number.parseInt(vm.objectType, 10) }]
}
}
]);
@@ -84,11 +84,17 @@ export default {
// }
// },
methods: {
navToTarget: function() {
window.$gz.eventBus.$emit("openobject", {
type: this.objectType,
id: this.objectId
});
},
handleSelected(selected) {
this.selectedItems = selected;
},
iconForType() {
return window.$gz.util.iconForType(Number.parseInt(this.objectType));
return window.$gz.util.iconForType(Number.parseInt(this.objectType, 10));
}
}
};