Skip to content
29 changes: 19 additions & 10 deletions app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { useDataStyleStore } from "@ogw_front/stores/data_style";
import { useGeodeStore } from "@ogw_front/stores/geode";
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
import { useInfraStore } from "@ogw_front/stores/infra";

Check warning on line 14 in app/pages/index.vue

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint-plugin-import(max-dependencies)

File has too many dependencies (14). Maximum allowed is 10.
import { useMenuStore } from "@ogw_front/stores/menu";
import { useViewerStore } from "@ogw_front/stores/viewer";

Expand Down Expand Up @@ -130,14 +130,14 @@
watch(
() => [viewerStore.status, geodeStore.status],
async ([viewerStatus, geodeStatus]) => {
console.log("Status viewer changed:", viewerStatus);

Check warning on line 133 in app/pages/index.vue

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
console.log("Status geode changed:", geodeStatus);

Check warning on line 134 in app/pages/index.vue

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.

console.log("Status", Status);

Check warning on line 136 in app/pages/index.vue

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
if (viewerStatus === Status.CONNECTED && geodeStatus === Status.CONNECTED) {
const start = Date.now();
await importWorkflow(dataList);
console.log("importWorkflow duration :", (Date.now() - start) / MS_TO_SECONDS, "s");

Check warning on line 140 in app/pages/index.vue

View workflow job for this annotation

GitHub Actions / test / oxlint

eslint(no-console)

Unexpected console statement.
hybridViewerStore.resetCamera();
}
},
Expand All @@ -151,20 +151,29 @@
containerHeight.value = height;
});

async function handleTreeMenu({ event, itemId, context_type, modelId }) {
async function handleTreeMenu({ event, itemId, context_type, modelId, modelComponentType }) {
const rect = cardContainer.value.getBoundingClientRect();
const x = event.clientX - rect.left;
const yUI = event.clientY - rect.top;

const meta_data =
context_type === "model_component"
? {
viewer_type: "model_component",
geode_object_type: "component",
modelId,
pickedComponentId: itemId,
}
: await dataStore.item(itemId);
let meta_data = undefined;
if (context_type === "model_component") {
meta_data = {
viewer_type: "model_component",
geode_object_type: "component",
modelId,
pickedComponentId: itemId,
};
} else if (context_type === "model_component_type") {
meta_data = {
viewer_type: "model_component_type",
geode_object_type: "type",
modelId,
modelComponentType,
};
} else {
meta_data = await dataStore.item(itemId);
}

menuStore.openMenu(
itemId,
Expand Down
Loading