@abi-software/mapintegratedvuer 1.16.1 → 1.16.3-simulation.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{ContentMixin-C3-OeGQ0.js → ContentMixin-CXBghkG4.js} +224 -455
  2. package/dist/{style-DobzTuWc.js → DynamicMarkerMixin-C077TWyL.js} +1 -1
  3. package/dist/Flatmap-CKWEbXwI.js +103454 -0
  4. package/dist/{Iframe-BDztAIUe.js → Iframe-CImGKtGq.js} +2 -2
  5. package/dist/{MultiFlatmap-CxvFZqgX.js → MultiFlatmap-jLxHqKwa.js} +15 -15
  6. package/dist/{Plot-D3Ff5rKZ.js → Plot-CZP1T3yL.js} +2 -2
  7. package/dist/{Scaffold-BYvsIJcy.js → Scaffold-Z2Jv6mwD.js} +79 -53
  8. package/dist/Simulation-OtmfB6BF.js +72 -0
  9. package/dist/{index-CGSECPAp.js → index-Bym6cokq.js} +19683 -20023
  10. package/dist/mapintegratedvuer.js +1 -1
  11. package/dist/mapintegratedvuer.umd.cjs +4271 -231
  12. package/dist/style.css +1 -1
  13. package/package.json +9 -4
  14. package/src/App.vue +290 -260
  15. package/src/assets/styles.scss +1 -1
  16. package/src/components/ContentBar.vue +0 -1
  17. package/src/components/ContentVuer.vue +0 -2
  18. package/src/components/ContextCard.vue +0 -1
  19. package/src/components/DummyRouteComponent.vue +1 -0
  20. package/src/components/EventBus.ts +13 -0
  21. package/src/components/FloatingWindow.vue +125 -0
  22. package/src/components/MapContent.vue +1 -3
  23. package/src/components/PlotComponent.vue +56 -0
  24. package/src/components/SplitFlow.vue +470 -439
  25. package/src/components/scripts/utilities.js +1 -1
  26. package/src/components/viewers/Flatmap.vue +136 -84
  27. package/src/components/viewers/MultiFlatmap.vue +1 -1
  28. package/src/components/viewers/Simulation.vue +65 -15
  29. package/src/components.d.ts +3 -0
  30. package/src/main.js +9 -3
  31. package/src/mixins/ContentMixin.js +419 -390
  32. package/src/services/mapping.js +69 -0
  33. package/src/stores/entries.js +1 -1
  34. package/src/stores/mapping.js +29 -0
  35. package/src/stores/settings.js +0 -4
  36. package/src/stores/simulationPlotStore.js +104 -0
  37. package/src/stores/splitFlow.js +427 -362
  38. package/src/types/simulation.js +18 -0
  39. package/dist/Flatmap-BbTHRVGX.js +0 -202
  40. package/dist/Simulation-By8hjqPs.js +0 -28
  41. package/src/components/EventBus.js +0 -3
@@ -6,7 +6,7 @@ const initialDefaultState = () => {
6
6
  {
7
7
  resource: defaultSpecies,
8
8
  type: "MultiFlatmap",
9
- mode: "main",
9
+ // mode: "main",
10
10
  id: 1,
11
11
  state: undefined,
12
12
  label: "",
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div class="viewer-container">
2
+ <div class="viewer-container" ref="container">
3
+ <resize-sensor @resize="calculateOffset()"> </resize-sensor>
3
4
  <FlatmapVuer
4
5
  :state="entry.state"
5
6
  :entry="entry.resource"
@@ -42,6 +43,7 @@
42
43
  @mapmanager-loaded="onMapmanagerLoaded"
43
44
  :showPathwayFilter="false"
44
45
  @trackEvent="trackEvent"
46
+ @open-simulation="onSimulationOpen"
45
47
  />
46
48
 
47
49
  <HelpModeDialog
@@ -52,83 +54,118 @@
52
54
  @show-next="onHelpModeShowNext"
53
55
  @finish-help-mode="onFinishHelpMode"
54
56
  />
57
+
58
+ <FloatingWindow
59
+ v-for="win in plotWindows"
60
+ :key="win.id"
61
+ :windowData="win"
62
+ :offsetX="left"
63
+ :offsetY="top"
64
+ @closeWindow="handleClosePlotWindow"
65
+ @mouseDown="bringToFront"
66
+ >
67
+ <PlotComponent :data="win.data" />
68
+ </FloatingWindow>
55
69
  </div>
56
70
  </template>
57
71
 
58
72
  <script>
59
- /* eslint-disable no-alert, no-console */
60
- import Tagging from '../../services/tagging.js';
61
- import EventBus from "../EventBus";
62
- import ContentMixin from "../../mixins/ContentMixin";
63
- import DynamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
73
+ import { ref } from 'vue'
74
+ import { useMouseInElement } from '@vueuse/core'
64
75
 
65
- import { FlatmapVuer } from "@abi-software/flatmapvuer";
66
- import "@abi-software/flatmapvuer/dist/style.css";
76
+ /* eslint-disable no-alert, no-console */
77
+ import Tagging from '../../services/tagging.js'
78
+ import EventBus from '../EventBus'
79
+ import ContentMixin from '../../mixins/ContentMixin'
80
+ import DynamicMarkerMixin from '../../mixins/DynamicMarkerMixin'
81
+ import ResizeSensor from '../ResizeSensor.vue'
82
+ import { FlatmapVuer } from '@abi-software/flatmapvuer'
83
+ import '@abi-software/flatmapvuer/dist/style.css'
67
84
  import { HelpModeDialog } from '@abi-software/map-utilities'
68
85
  import '@abi-software/map-utilities/dist/style.css'
86
+ import { useSimulationPlotStore } from '../../stores/simulationPlotStore'
87
+
88
+ import PlotComponent from '../PlotComponent.vue'
89
+ import FloatingWindow from '../FloatingWindow.vue'
90
+ import { useMappingStore } from '../../stores/mapping'
91
+
92
+ const BASE_Z_INDEX = 100
69
93
 
70
94
  export default {
71
- name: "Flatmap",
72
- mixins: [ ContentMixin, DynamicMarkerMixin ],
95
+ name: 'Flatmap',
96
+ mixins: [ContentMixin, DynamicMarkerMixin],
73
97
  components: {
74
98
  FlatmapVuer,
75
99
  HelpModeDialog,
100
+ ResizeSensor,
101
+ },
102
+ setup() {
103
+ // const flatmap = ref(null)
104
+ const container = ref(null)
105
+ const simulationPlotStore = useSimulationPlotStore()
106
+ const mappingStore = useMappingStore()
107
+ mappingStore.initializeMapping()
108
+ const { elementX, elementY } = useMouseInElement(container)
109
+ return { container, elementX, elementY, mappingStore, simulationPlotStore }
76
110
  },
77
111
  data: function () {
78
112
  return {
79
113
  flatmapReady: false,
80
114
  displayMinimap: false,
115
+ zStack: [],
116
+ left: 0,
117
+ top: 0,
81
118
  }
82
119
  },
83
120
  methods: {
84
121
  getState: function () {
85
- return this.$refs.flatmap.getState();
122
+ return this.$refs.flatmap.getState()
86
123
  },
87
124
  /**
88
125
  * Perform a local search on this contentvuer
89
126
  * This is similar to directly clicking onthe map
90
127
  */
91
128
  search: function (term) {
92
- return this.$refs.flatmap.searchAndShowResult(term, true, true);
129
+ return this.$refs.flatmap.searchAndShowResult(term, true, true)
93
130
  },
94
131
  getFlatmapImp() {
95
- return this.$refs.flatmap?.mapImp;
132
+ return this.$refs.flatmap?.mapImp
96
133
  },
97
134
  contextRestored(flatmap) {
98
- this.flatmapReadyForMarkerUpdates(flatmap);
99
- this.updateViewerSettings();
135
+ this.flatmapReadyForMarkerUpdates(flatmap)
136
+ this.updateViewerSettings()
100
137
  },
101
138
  flatmapReadyCall: function (flatmap) {
102
- this.flatmapReady = true;
103
- const mapImp = this.getFlatmapImp();
139
+ this.flatmapReady = true
140
+ const mapImp = this.getFlatmapImp()
104
141
  if (mapImp?.mapMetadata?.name) {
105
- this.updateEntryLabel(mapImp?.mapMetadata?.name);
106
- this.updateEntryTitle(mapImp?.mapMetadata?.name);
142
+ this.updateEntryLabel(mapImp?.mapMetadata?.name)
143
+ this.updateEntryTitle(mapImp?.mapMetadata?.name)
107
144
  }
108
- let provClone = {id: this.entry.id, prov: mapImp.mapMetadata}; //create clone of provenance and add id
109
- EventBus.emit("mapImpProv", provClone); // send clone to context card
110
- this.$emit("flatmap-provenance-ready", provClone);
111
- this.flatmapReadyForMarkerUpdates(flatmap);
112
- this.updateViewerSettings();
145
+ let provClone = { id: this.entry.id, prov: mapImp.mapMetadata } //create clone of provenance and add id
146
+ EventBus.emit('mapImpProv', provClone) // send clone to context card
147
+ this.$emit('flatmap-provenance-ready', provClone)
148
+ this.flatmapReadyForMarkerUpdates(flatmap)
149
+ this.updateViewerSettings()
113
150
  // Wait for flatmap's connectivity to load before emitting mapLoaded
114
151
  this.loadConnectivityExplorerConfig(flatmap).then(() => {
115
- EventBus.emit("mapLoaded", flatmap);
116
- });
152
+ EventBus.emit('mapLoaded', flatmap)
153
+ })
117
154
  },
118
155
  onPathwaySelectionChanged: function (data) {
119
- const { label, property, checked, selectionsTitle } = data;
156
+ const { label, property, checked, selectionsTitle } = data
120
157
  // GA Tagging
121
158
  // Event tracking for maps' pathway selection change
122
159
  Tagging.sendEvent({
123
- 'event': 'interaction_event',
124
- 'event_name': 'portal_maps_pathway_change',
125
- 'category': label + ' [' + property + '] ' + checked,
126
- 'location': selectionsTitle
127
- });
160
+ event: 'interaction_event',
161
+ event_name: 'portal_maps_pathway_change',
162
+ category: label + ' [' + property + '] ' + checked,
163
+ location: selectionsTitle,
164
+ })
128
165
  },
129
- onSidebarAnnotationClose: function() {
166
+ onSidebarAnnotationClose: function () {
130
167
  if (this.flatmapReady) {
131
- const currentFlatmap = this.$refs.flatmap;
168
+ const currentFlatmap = this.$refs.flatmap
132
169
  if (currentFlatmap) {
133
170
  this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
134
171
  }
@@ -139,117 +176,132 @@ export default {
139
176
  */
140
177
  searchSuggestions: function (term, suggestions) {
141
178
  if (term && this.$refs.flatmap.mapImp) {
142
- const results = this.$refs.flatmap.mapImp.search(term);
143
- const featureIds = results.__featureIds || results.featureIds;
144
- featureIds.forEach(id => {
145
- const annotation = this.$refs.flatmap.mapImp.annotation(id);
146
- if (annotation && annotation.label)
147
- suggestions.push(annotation.label);
148
- });
179
+ const results = this.$refs.flatmap.mapImp.search(term)
180
+ const featureIds = results.__featureIds || results.featureIds
181
+ featureIds.forEach((id) => {
182
+ const annotation = this.$refs.flatmap.mapImp.annotation(id)
183
+ if (annotation && annotation.label) suggestions.push(annotation.label)
184
+ })
149
185
  }
150
186
  },
151
187
  showConnectivity: function (payload) {
152
188
  if (this?.alive) {
153
- const { featureIds, offset } = payload;
154
- const currentFlatmap = this.$refs.flatmap;
189
+ const { featureIds, offset } = payload
190
+ const currentFlatmap = this.$refs.flatmap
155
191
  if (currentFlatmap) {
156
192
  currentFlatmap.moveMap(featureIds, {
157
193
  offsetX: offset ? -150 : 0,
158
194
  zoom: 4,
159
- });
195
+ })
160
196
  }
161
197
  }
162
198
  },
163
199
  showConnectivityTooltips: function (payload) {
164
200
  if (this?.alive && this.flatmapReady) {
165
- const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
166
- flatmap.showConnectivityTooltips(payload);
201
+ const flatmap = this.$refs.multiflatmap.getCurrentFlatmap()
202
+ flatmap.showConnectivityTooltips(payload)
167
203
  }
168
204
  },
169
205
  showConnectivitiesByReference: function (payload) {
170
206
  if (this?.alive) {
171
- const currentFlatmap = this.$refs.flatmap;
207
+ const currentFlatmap = this.$refs.flatmap
172
208
  if (currentFlatmap) {
173
- currentFlatmap.showConnectivitiesByReference(payload);
209
+ currentFlatmap.showConnectivitiesByReference(payload)
174
210
  }
175
211
  }
176
212
  },
177
213
  changeConnectivitySource: function (payload, ongoingSource) {
178
214
  if (this?.alive && this.flatmapReady) {
179
- const flatmap = this.$refs.flatmap;
180
- const flatmapUUID = flatmap.mapImp.mapMetadata.uuid;
215
+ const flatmap = this.$refs.flatmap
216
+ const flatmapUUID = flatmap.mapImp.mapMetadata.uuid
181
217
  if (!ongoingSource.includes(flatmapUUID)) {
182
- ongoingSource.push(flatmapUUID);
183
- flatmap.changeConnectivitySource(payload);
218
+ ongoingSource.push(flatmapUUID)
219
+ flatmap.changeConnectivitySource(payload)
184
220
  }
185
221
  }
186
222
  },
187
- zoomToFeatures: function(info, forceSelect) {
188
- let name = info.name;
189
- const flatmap = this.$refs.flatmap.mapImp;
223
+ zoomToFeatures: function (info, forceSelect) {
224
+ let name = info.name
225
+ const flatmap = this.$refs.flatmap.mapImp
190
226
  if (name) {
191
- const results = flatmap.search(name);
227
+ const results = flatmap.search(name)
192
228
  if (results.featureIds.length) {
193
- let externalId = flatmap.modelForFeature(results.featureIds[0]);
229
+ let externalId = flatmap.modelForFeature(results.featureIds[0])
194
230
  if (externalId) {
195
231
  if (forceSelect) {
196
- flatmap.selectFeatures(externalId);
232
+ flatmap.selectFeatures(externalId)
197
233
  }
198
- flatmap.zoomToFeatures(externalId);
199
- } else flatmap.clearSearchResults();
234
+ flatmap.zoomToFeatures(externalId)
235
+ } else flatmap.clearSearchResults()
200
236
  }
201
237
  } else {
202
- flatmap.clearSearchResults();
238
+ flatmap.clearSearchResults()
203
239
  }
204
240
  },
205
241
  changeViewingMode: function (modeName) {
206
- this.$refs.flatmap.changeViewingMode(modeName);
242
+ this.$refs.flatmap.changeViewingMode(modeName)
207
243
  },
208
244
  updateViewerSettings: function () {
209
- const {
210
- backgroundDisplay,
211
- viewingMode,
212
- flightPathDisplay,
213
- organsDisplay,
214
- outlinesDisplay,
215
- connectionType,
216
- } = this.settingsStore.globalSettings;
245
+ const { backgroundDisplay, viewingMode, flightPathDisplay, organsDisplay, outlinesDisplay, connectionType } =
246
+ this.settingsStore.globalSettings
217
247
 
218
- const currentFlatmap = this.$refs.flatmap;
248
+ const currentFlatmap = this.$refs.flatmap
219
249
 
220
- currentFlatmap.changeViewingMode(viewingMode);
221
- currentFlatmap.setFlightPath3D(flightPathDisplay);
222
- currentFlatmap.setColour(organsDisplay);
223
- currentFlatmap.setOutlines(outlinesDisplay);
224
- currentFlatmap.backgroundChangeCallback(backgroundDisplay);
225
- currentFlatmap.setConnectionType(connectionType);
250
+ currentFlatmap.changeViewingMode(viewingMode)
251
+ currentFlatmap.setFlightPath3D(flightPathDisplay)
252
+ currentFlatmap.setColour(organsDisplay)
253
+ currentFlatmap.setOutlines(outlinesDisplay)
254
+ currentFlatmap.backgroundChangeCallback(backgroundDisplay)
255
+ currentFlatmap.setConnectionType(connectionType)
226
256
  },
227
257
  setVisibilityFilter: function (payload) {
228
258
  if (this?.alive) {
229
- const currentFlatmap = this.$refs.flatmap;
259
+ const currentFlatmap = this.$refs.flatmap
230
260
  if (currentFlatmap) {
231
- currentFlatmap.setVisibilityFilter(payload);
261
+ currentFlatmap.setVisibilityFilter(payload)
232
262
  }
233
263
  }
234
264
  },
235
265
  getKnowledgeTooltip: async function (payload) {
236
266
  if (this?.alive) {
237
- const currentFlatmap = this.$refs.flatmap;
267
+ const currentFlatmap = this.$refs.flatmap
238
268
  if (currentFlatmap) {
239
269
  // This is for expanding connectivity card
240
270
  // The length of payload.data should always be 1
241
- const data = payload.data[0];
242
- currentFlatmap.searchAndShowResult(data.id, true, false);
271
+ const data = payload.data[0]
272
+ currentFlatmap.searchAndShowResult(data.id, true, false)
243
273
  }
244
274
  }
245
275
  },
276
+ onSimulationOpen: function (simulation) {
277
+ EventBus.emit('simulation-open-clicked', {...simulation, requesterEntryId: this.entry.id})
278
+ },
279
+ handleClosePlotWindow: function (windowId) {
280
+ this.simulationPlotStore.removeWindow(windowId)
281
+ },
282
+ bringToFront: function (windowId) {
283
+ this.simulationPlotStore.bringToFront(windowId, this.calculateOffset())
284
+ },
285
+ calculateOffset: function () {
286
+ const element = this.$refs.container
287
+ if (!element) return
288
+ const rect = element.getBoundingClientRect()
289
+ this.top = rect.top
290
+ this.left = rect.left
291
+ },
292
+ onResize: function () {
293
+ this.calculateOffset()
294
+ },
246
295
  },
247
296
  computed: {
248
297
  facetSpecies() {
249
- return this.settingsStore.facets.species;
298
+ return this.settingsStore.facets.species
299
+ },
300
+ plotWindows() {
301
+ return this.simulationPlotStore.windows.filter((win) => win.ownerId === this.entry.id)
250
302
  },
251
303
  },
252
- };
304
+ }
253
305
  </script>
254
306
 
255
307
  <!-- Add "scoped" attribute to limit CSS to this component only -->
@@ -70,7 +70,7 @@ import DyncamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
70
70
  import YellowStar from "../../icons/yellowstar";
71
71
 
72
72
  import { MultiFlatmapVuer } from "@abi-software/flatmapvuer";
73
- import "@abi-software/flatmapvuer/dist/style.css";
73
+ // import "@abi-software/flatmapvuer/dist/style.css";
74
74
  import { HelpModeDialog } from '@abi-software/map-utilities'
75
75
  import '@abi-software/map-utilities/dist/style.css'
76
76
 
@@ -1,29 +1,79 @@
1
1
  <template>
2
- <SimulationVuer
3
- :apiLocation="apiLocation"
4
- :id="id"
5
- ref="simulation"
6
- />
2
+ <SimulationVuer :apiLocation="apiLocation" :id="id" ref="simulation" @data-notification="handleDataNotification" />
7
3
  </template>
8
4
 
9
5
  <script>
10
6
  /* eslint-disable no-alert, no-console */
11
- import ContentMixin from "../../mixins/ContentMixin";
12
- import { SimulationVuer } from "@abi-software/simulationvuer";
13
- import "@abi-software/simulationvuer/dist/style.css";
7
+ import EventBus from '../EventBus'
8
+ import ContentMixin from '../../mixins/ContentMixin'
9
+ import { SimulationVuer } from '@abi-software/simulationvuer'
10
+ import '@abi-software/simulationvuer/dist/style.css'
14
11
 
15
12
  export default {
16
- name: "Simulation",
17
- mixins: [ ContentMixin ],
13
+ name: 'Simulation',
14
+ mixins: [ContentMixin],
18
15
  components: {
19
16
  SimulationVuer,
20
17
  },
21
18
  computed: {
22
- id: function() {
19
+ id: function () {
23
20
  //resource field is only available for simulation omex file and it will run locally.
24
21
  //discoverId field is used for simulations running on O2SPARC.
25
- return this.entry.resource ? this.entry.resource: this.entry.discoverId;
26
- }
27
- }
28
- };
22
+ return this.entry.resource ? this.entry.resource : this.entry.discoverId
23
+ },
24
+ },
25
+ methods: {
26
+ handleDataNotification: function (update) {
27
+ EventBus.emit('simulation-response', update)
28
+ },
29
+ handleDataRequest(payload) {
30
+ this.processRequest(payload);
31
+ },
32
+ handleWindowClosed(payload) {
33
+ this.$refs.simulation?.removeDataSubscription(payload.id);
34
+ },
35
+ processRequest: function (req) {
36
+ // strict check against the literal type
37
+ if (req.id !== 'nz.ac.auckland.simulation-data-request') return
38
+
39
+ const requestMajorVersion = parseInt(req.version.split('.')[0])
40
+ if (requestMajorVersion !== 0) {
41
+ console.warn('Unsupported simulation request version:', req.version)
42
+ return
43
+ }
44
+
45
+ if (req.payload.protocol?.resource !== this.id) {
46
+ return
47
+ }
48
+
49
+ this.$refs.simulation?.addDataSubscription({
50
+ id: req.id,
51
+ version: req.version,
52
+ payload: {
53
+ windowId: req.payload.windowId,
54
+ ownerId: req.payload.ownerId,
55
+ component: req.payload.component,
56
+ variable: req.payload.variable,
57
+ withVOI: true,
58
+ },
59
+ })
60
+ },
61
+ },
62
+ mounted: function () {
63
+ EventBus.on('simulation-data-request', this.handleDataRequest)
64
+ EventBus.on('plot-window-closed', this.handleWindowClosed)
65
+ EventBus.emit('simulation-ready', {
66
+ resourceId: this.id,
67
+ ready: true,
68
+ })
69
+ },
70
+ beforeUnmount: function () {
71
+ EventBus.emit('simulation-ready', {
72
+ resourceId: this.id,
73
+ ready: false,
74
+ })
75
+ EventBus.off('simulation-data-request', this.handleDataRequest)
76
+ EventBus.off('plot-window-closed', this.handleWindowClosed)
77
+ },
78
+ }
29
79
  </script>
@@ -14,6 +14,7 @@ declare module 'vue' {
14
14
  CustomSplitter: typeof import('./components/CustomSplitter.vue')['default']
15
15
  DatasetHeader: typeof import('./components/DatasetHeader.vue')['default']
16
16
  DialogToolbarContent: typeof import('./components/DialogToolbarContent.vue')['default']
17
+ DummyRouteComponent: typeof import('./components/DummyRouteComponent.vue')['default']
17
18
  ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
18
19
  ElButton: typeof import('element-plus/es')['ElButton']
19
20
  ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
@@ -43,10 +44,12 @@ declare module 'vue' {
43
44
  ElSelect: typeof import('element-plus/es')['ElSelect']
44
45
  Flatmap: typeof import('./components/viewers/Flatmap.vue')['default']
45
46
  FlatmapContextCard: typeof import('./components/FlatmapContextCard.vue')['default']
47
+ FloatingWindow: typeof import('./components/FloatingWindow.vue')['default']
46
48
  Iframe: typeof import('./components/viewers/Iframe.vue')['default']
47
49
  MapContent: typeof import('./components/MapContent.vue')['default']
48
50
  MultiFlatmap: typeof import('./components/viewers/MultiFlatmap.vue')['default']
49
51
  Plot: typeof import('./components/viewers/Plot.vue')['default']
52
+ PlotComponent: typeof import('./components/PlotComponent.vue')['default']
50
53
  ResizeSensor: typeof import('./components/ResizeSensor.vue')['default']
51
54
  RouterLink: typeof import('vue-router')['RouterLink']
52
55
  RouterView: typeof import('vue-router')['RouterView']
package/src/main.js CHANGED
@@ -1,12 +1,16 @@
1
-
2
1
  import { createApp } from 'vue'
3
2
  import { createPinia } from 'pinia'
4
3
  import * as VueRouter from 'vue-router'
5
4
  import App from './App.vue'
5
+
6
+ import ElementPlus from 'element-plus'
7
+ import 'element-plus/dist/index.css'
8
+
6
9
  import { useMainStore } from './stores/index'
10
+ import DummyRouteComponent from './components/DummyRouteComponent.vue'
7
11
 
8
12
  const routes = [
9
- { path: '/' },
13
+ { path: '/', component: DummyRouteComponent },
10
14
  ]
11
15
 
12
16
  const router = VueRouter.createRouter({
@@ -21,6 +25,8 @@ const app = createApp(App)
21
25
  app.use(pinia)
22
26
  app.use(router)
23
27
 
28
+ app.use(ElementPlus)
29
+
24
30
  const mainStore = useMainStore()
25
31
  const token = document.cookie
26
32
  .split("; ")
@@ -29,4 +35,4 @@ if (mainStore && token) {
29
35
  mainStore.setUserToken(token.split("=")[1])
30
36
  }
31
37
 
32
- app.mount('#app')
38
+ app.mount('#app')