diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index a149ec3..6cbc18d 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -50,6 +50,7 @@ import filesStore from '@/stores/files.js'; import AllMapDataStore from '@/stores/allMapData.js'; import ConformanceStore from '@/stores/conformance.js'; import PageAdminStore from '@/stores/pageAdmin.js'; +import MapCompareStore from '@/stores/mapCompareStore'; import IconSearch from '@/components/icons/IconSearch.vue'; import IconSetting from '@/components/icons/IconSetting.vue'; import { saveFilter, savedSuccessfully, saveConformance } from '@/module/alertModal.js'; @@ -84,6 +85,7 @@ export default { }, data() { return { + mapCompareStore: MapCompareStore(), showNavbarBreadcrumb: false, navViewData: { @@ -92,7 +94,7 @@ export default { // 舉例:DISCOVER: ['MAP', 'CONFORMANCE', 'PERFORMANCE', 'DATA'] DISCOVER: ['MAP', 'CONFORMANCE', 'PERFORMANCE'], // 舉例:COMPARE: ['PROCESS MAP', 'DASHBOARD'] - COMPARE: ['PERFORMANCE'], + COMPARE: ['MAP', 'PERFORMANCE'], 'ACCOUNT MANAGEMENT': [], 'MY ACCOUNT': [], }, @@ -194,7 +196,16 @@ export default { } break; case 'COMPARE': - break + switch (navItemCandidate) { + case 'MAP': + this.$router.push({name: 'MapCompare', params: this.mapCompareStore.routeParam}); + break; + case 'PERFORMANCE': + this.$router.push({name: 'CompareDashboard', params: this.mapCompareStore.routeParam}); + break; + default: + break; + } }; }, /** diff --git a/src/router/index.ts b/src/router/index.ts index 8454be0..95f6ef6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -8,6 +8,7 @@ import Map from '@/views/Discover/Map/Map.vue'; import Conformance from '@/views/Discover/Conformance/index.vue'; import Performance from '@/views/Discover/Performance/index.vue'; import CompareDashboard from '@/views/Compare/Dashboard/Compare.vue'; +import MapCompare from '@/views/Compare/MapCompare.vue'; import AccountAdmin from '@/views/AccountManagement/AccountAdmin/AccountAdmin.vue'; import MyAccount from '@/views/AccountManagement/MyAccount.vue'; import MemberArea from '@/views/MemberArea/index.vue'; @@ -134,6 +135,10 @@ const routes = [ path: "/compare/dashboard/:primaryType/:primaryId/:secondaryType/:secondaryId", name: "CompareDashboard", component: CompareDashboard, + }, { + path: "/compare/map/:primaryType/:primaryId/:secondaryType/:secondaryId", + name: "MapCompare", + component: MapCompare, } ] }, diff --git a/src/stores/mapCompareStore.ts b/src/stores/mapCompareStore.ts new file mode 100644 index 0000000..d319239 --- /dev/null +++ b/src/stores/mapCompareStore.ts @@ -0,0 +1,35 @@ +import { defineStore } from 'pinia'; +import AllMapData from '@/stores/allMapData.js'; +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 default defineStore('useMapCompareStore', { + 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, + } + }, + }, +}); \ No newline at end of file diff --git a/src/views/Compare/Dashboard/Compare.vue b/src/views/Compare/Dashboard/Compare.vue index 9d8c625..cd8184e 100644 --- a/src/views/Compare/Dashboard/Compare.vue +++ b/src/views/Compare/Dashboard/Compare.vue @@ -317,7 +317,6 @@ export default { * @returns { [primeVueSetData, primeVueSetOption] } 這兩者為符合 primeVue 圖表格式的數據資料 */ getLineChart(chartData, content, yUnit) { - console.log('getLineChart' ); let datasetsPrimary; let datasetsSecondary; let minX = chartData.x_axis.min; @@ -358,7 +357,6 @@ export default { content, ticksOfXAxis, } }); -console.log("TODO:", datasetsPrimary, ) primeVueSetData = { labels: xLabelData, datasets: [ @@ -1289,7 +1287,6 @@ console.log("TODO:", datasetsPrimary, ) }; this.casesByTaskHeight = await this.getHorizontalBarHeight(this.compareDashboardData.freq.cases_by_task); // create chart - console.log('TODO:', this.compareDashboardData.time.avg_cycle_time.data[0].data); [this.avgCycleTimeData, this.avgCycleTimeOptions] = this.getLineChart( this.compareDashboardData.time.avg_cycle_time, this.contentData.avgCycleTime, 'date'); [this.avgCycleEfficiencyData, this.avgCycleEfficiencyOptions] = this.getBarChart( diff --git a/src/views/Compare/MapCompare.vue b/src/views/Compare/MapCompare.vue new file mode 100644 index 0000000..e5446d2 --- /dev/null +++ b/src/views/Compare/MapCompare.vue @@ -0,0 +1,541 @@ + + + + \ No newline at end of file diff --git a/src/views/Discover/Map/Map.vue b/src/views/Discover/Map/Map.vue index 529abc3..1888c7e 100644 --- a/src/views/Discover/Map/Map.vue +++ b/src/views/Discover/Map/Map.vue @@ -450,7 +450,6 @@ export default { }, }, async created() { - const mapPathStore = MapPathStore(); const routeParams = this.$route.params; const file = this.$route.meta.file; const isCheckPage = this.$route.name.includes('Check'); diff --git a/src/views/Files/Files.vue b/src/views/Files/Files.vue index 28910b0..e1a746b 100644 --- a/src/views/Files/Files.vue +++ b/src/views/Files/Files.vue @@ -222,6 +222,7 @@