Files
lucia-frontend/src/stores/mapCompareStore.ts
2026-03-06 18:57:58 +08:00

46 lines
1.7 KiB
TypeScript

// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// imacat.yang@dsp.im (imacat), 2023/9/23
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
/**
* @module stores/mapCompareStore Map comparison store for managing
* side-by-side process map comparison with insights data.
*/
import { defineStore } from 'pinia';
import { useAllMapDataStore } from '@/stores/allMapData';
import { INSIGHTS_FIELDS_AND_LABELS } from '@/constants/constants';
import ImgCapsuleGlow1 from '@/assets/capsule1-glow.svg';
import ImgCapsuleGlow2 from '@/assets/capsule2-glow.svg';
import ImgCapsuleGlow3 from '@/assets/capsule3-glow.svg';
import ImgCapsuleGlow4 from '@/assets/capsule4-glow.svg';
import ImgCapsule1 from '@/assets/capsule1.svg';
import ImgCapsule2 from '@/assets/capsule2.svg';
import ImgCapsule3 from '@/assets/capsule3.svg';
import ImgCapsule4 from '@/assets/capsule4.svg';
const ImgCapsulesGlow = [ImgCapsuleGlow1, ImgCapsuleGlow2, ImgCapsuleGlow3, ImgCapsuleGlow4];
const ImgCapsules = [ImgCapsule1, ImgCapsule2, ImgCapsule3, ImgCapsule4];
export const useMapCompareStore = defineStore('mapCompareStore', {
state: () => ({
routeParam: {
primaryType: '',
primaryId: '',
secondaryType: '',
secondaryId: '',
},
}),
actions: {
setCompareRouteParam(primaryType: string, primaryId: string, secondaryType: string, secondaryId: string) {
this.routeParam = {
primaryType: primaryType,
primaryId: primaryId,
secondaryType: secondaryType,
secondaryId: secondaryId,
}
},
},
});