This commit is contained in:
@@ -324,23 +324,23 @@ export default {
|
||||
//this smells bad but it works
|
||||
vm.$root.$gz = window.$gz;
|
||||
|
||||
//Capture open object type and id if present
|
||||
//localhost:8080/login?type=2&id=22
|
||||
// //Capture open object type and id if present
|
||||
// //localhost:8080/login?type=2&id=22
|
||||
|
||||
if (window.location.search) {
|
||||
//https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
||||
var searchParams = new URLSearchParams(window.location.search);
|
||||
var openObject = {};
|
||||
//data should be format for open-object-handler
|
||||
// { type: [AYATYPE], id: [RECORDID] }
|
||||
if (searchParams.has("type")) {
|
||||
openObject.type = Number(searchParams.get("type"));
|
||||
if (searchParams.has("id")) {
|
||||
openObject.id = Number(searchParams.get("id"));
|
||||
}
|
||||
window.$gz.store.commit("setOpenObject", openObject);
|
||||
}
|
||||
}
|
||||
// if (window.location.search) {
|
||||
// //https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
||||
// var searchParams = new URLSearchParams(window.location.search);
|
||||
// var openObject = {};
|
||||
// //data should be format for open-object-handler
|
||||
// // { type: [AYATYPE], id: [RECORDID] }
|
||||
// if (searchParams.has("type")) {
|
||||
// openObject.type = Number(searchParams.get("type"));
|
||||
// if (searchParams.has("id")) {
|
||||
// openObject.id = Number(searchParams.get("id"));
|
||||
// }
|
||||
// window.$gz.store.commit("setOpenObject", openObject);
|
||||
// }
|
||||
// }
|
||||
|
||||
//redirect to login if not authenticated
|
||||
if (!vm.$store.state.authenticated) {
|
||||
|
||||
@@ -31,6 +31,8 @@ export default {
|
||||
//NOTE: for new objects all edit pages assume record ID 0 means create rather than open
|
||||
|
||||
if (tid.type && tid.id != null) {
|
||||
console.log("tid", tid);
|
||||
console.log("ayatype", ayatype);
|
||||
switch (tid.type) {
|
||||
case ayatype.Widget:
|
||||
vm.$router.push({
|
||||
|
||||
@@ -428,6 +428,12 @@ export default new Router({
|
||||
)
|
||||
},
|
||||
//**********************************GENERAL */
|
||||
{
|
||||
path: "/open/:ayatype/:recordid",
|
||||
name: "ay-open",
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "ay-common" */ "./views/ay-open.vue")
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
name: "ay-about",
|
||||
|
||||
22
ayanova/src/views/ay-open.vue
Normal file
22
ayanova/src/views/ay-open.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div>Opening...</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
//Capture open object type and id if present
|
||||
// path: "/open/:ayatype/:recordid",
|
||||
//vm.$route.params.ayatype
|
||||
//vm.$route.params.recordid
|
||||
//{ type: [AYATYPE], id: [RECORDID] }
|
||||
window.$gz.eventBus.$emit("openobject", {
|
||||
type: Number(this.$route.params.ayatype),
|
||||
id: Number(this.$route.params.recordid)
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user