Navigate to cell detail page on cell click
This commit is contained in:
parent
e5080eaaf6
commit
3bfcfff1eb
4 changed files with 13 additions and 10 deletions
|
|
@ -48,7 +48,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
component: Cell,
|
component: Cell,
|
||||||
name: "Cell",
|
name: ROUTE_NAMES.CELL_DETAIL,
|
||||||
path: "/_/cell/:cell",
|
path: "/_/cell/:cell",
|
||||||
props: true,
|
props: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
export const ROUTE_NAMES = {
|
export const ROUTE_NAMES = {
|
||||||
|
CELL_DETAIL: "cell-detail",
|
||||||
COMPLIANCE_ADDRESS: "compliance-address",
|
COMPLIANCE_ADDRESS: "compliance-address",
|
||||||
REVIEW_SITE: "review-site",
|
REVIEW_SITE: "review-site",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@ import { RouteLocationRaw } from "vue-router";
|
||||||
import { ROUTE_NAMES } from "@/route/name";
|
import { ROUTE_NAMES } from "@/route/name";
|
||||||
|
|
||||||
export function useRoutes() {
|
export function useRoutes() {
|
||||||
/*
|
const CellDetail = (cell: string): RouteLocationRaw => {
|
||||||
const RMOComplianceAddress = (publicID: string): RouteLocationRaw => {
|
|
||||||
return {
|
return {
|
||||||
name: ROUTE_NAMES.COMPLIANCE_ADDRESS,
|
name: ROUTE_NAMES.CELL_DETAIL,
|
||||||
...(publicID && { query: { publicID: publicID } })
|
params: {
|
||||||
}
|
cell: cell,
|
||||||
}
|
},
|
||||||
*/
|
};
|
||||||
|
};
|
||||||
const ReviewSite = (siteID: string): RouteLocationRaw => {
|
const ReviewSite = (siteID: string): RouteLocationRaw => {
|
||||||
return {
|
return {
|
||||||
name: ROUTE_NAMES.REVIEW_SITE,
|
name: ROUTE_NAMES.REVIEW_SITE,
|
||||||
|
|
@ -17,6 +17,7 @@ export function useRoutes() {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
CellDetail,
|
||||||
ReviewSite,
|
ReviewSite,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,7 @@ import Source from "@/map/Source.vue";
|
||||||
import { boundsDefault, boundsFromAPI } from "@/map/util";
|
import { boundsDefault, boundsFromAPI } from "@/map/util";
|
||||||
import { formatBigNumber, formatTimeRelative } from "@/format";
|
import { formatBigNumber, formatTimeRelative } from "@/format";
|
||||||
import { router } from "@/route/config";
|
import { router } from "@/route/config";
|
||||||
|
import { useRoutes } from "@/route/use";
|
||||||
import { useSessionStore } from "@/store/session";
|
import { useSessionStore } from "@/store/session";
|
||||||
import { useStoreServiceRequest } from "@/store/service_request";
|
import { useStoreServiceRequest } from "@/store/service_request";
|
||||||
import { useStoreSync } from "@/store/sync";
|
import { useStoreSync } from "@/store/sync";
|
||||||
|
|
@ -269,6 +270,7 @@ const dashboard = reactive({
|
||||||
recentRequests: [],
|
recentRequests: [],
|
||||||
});
|
});
|
||||||
const mapCursor = ref<string>("");
|
const mapCursor = ref<string>("");
|
||||||
|
const routes = useRoutes();
|
||||||
const storeServiceRequest = useStoreServiceRequest();
|
const storeServiceRequest = useStoreServiceRequest();
|
||||||
const storeSync = useStoreSync();
|
const storeSync = useStoreSync();
|
||||||
const session = useSessionStore();
|
const session = useSessionStore();
|
||||||
|
|
@ -278,11 +280,10 @@ onMounted(async () => {
|
||||||
console.log("syncs", syncs);
|
console.log("syncs", syncs);
|
||||||
});
|
});
|
||||||
function doClickMap(e: MouseEvent) {
|
function doClickMap(e: MouseEvent) {
|
||||||
//router.push("/_/cell/" + cell);
|
|
||||||
if (!e.features || e.features.length == 0) return;
|
if (!e.features || e.features.length == 0) return;
|
||||||
const feature = e.features[0];
|
const feature = e.features[0];
|
||||||
const properties = feature.properties;
|
const properties = feature.properties;
|
||||||
console.log("clicked", properties.cell);
|
router.push(routes.CellDetail(properties.cell));
|
||||||
}
|
}
|
||||||
function doLayerMouseEnter() {
|
function doLayerMouseEnter() {
|
||||||
mapCursor.value = "pointer";
|
mapCursor.value = "pointer";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue