|
@@ -1,8 +1,7 @@
|
|
|
import { useResource } from "@/modules/resource";
|
|
|
import { useQueditor } from "@queenjs-modules/queditor";
|
|
|
import { switchSceneProdComp } from "@queenjs-modules/queditor/module/controls/Queen3dCtrl/actions/geom";
|
|
|
-import { Pack, PackMat } from "@queenjs-modules/queditor/objects";
|
|
|
-import { IQueentree } from "@queenjs-modules/queentree";
|
|
|
+import { Pack } from "@queenjs-modules/queditor/objects";
|
|
|
import { AssetItemFile } from "@queenjs-modules/queentree-explorer/objects/fileSystem/assetFiles";
|
|
|
import { List } from "@queenjs/ui";
|
|
|
import { defineComponent } from "vue";
|
|
@@ -21,15 +20,11 @@ export default defineComponent({
|
|
|
<LibraryModal />,
|
|
|
{ width: "900px" }
|
|
|
);
|
|
|
-
|
|
|
const pack = await branchFolder.getAssetDetail();
|
|
|
- console.log("pack: ", pack);
|
|
|
const data = queditor.helper.getRelatedSourceByProduct(
|
|
|
pack.source as Pack["source"],
|
|
|
branchFolder.state.id
|
|
|
);
|
|
|
-
|
|
|
- console.error("data: ", data);
|
|
|
queditor.actions.insertMesh(data);
|
|
|
};
|
|
|
|
|
@@ -37,7 +32,7 @@ export default defineComponent({
|
|
|
const mat = await resource.treeController.selectOneMat();
|
|
|
if (!mat) return;
|
|
|
|
|
|
- console.log("vvv=>", mat);
|
|
|
+ clickMat(record);
|
|
|
const matConf = resource.store.matSlots.find(
|
|
|
(item) => item.id == record.id
|
|
|
);
|
|
@@ -49,18 +44,9 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
record.thumbnail = mat?.thumbnail?.url;
|
|
|
-
|
|
|
- // console.error("resource.store.matSlots: ", resource.store.matSlots);
|
|
|
-
|
|
|
const targetComp = getTargetProCom(record);
|
|
|
if (!targetComp || !mat) return;
|
|
|
queditor.actions.updatePackProductCompMat(targetComp, mat);
|
|
|
- switchComp(record.meshSlotName);
|
|
|
-
|
|
|
- // const targetMesh = store.treeData.find(
|
|
|
- // (m: any) => m.Id == record.meshSlotId
|
|
|
- // );
|
|
|
- // store.activeKey = { type: "comp", CompId: targetMesh.Id };
|
|
|
};
|
|
|
|
|
|
const getTargetProCom = (record: any) => {
|
|
@@ -81,21 +67,21 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const clickMesh = (item: any) => {
|
|
|
- resource.store.setActiveKey({
|
|
|
- type: "mesh",
|
|
|
- id: item.Id,
|
|
|
- });
|
|
|
+ resource.store.setActiveKey({ type: "mesh", id: item.Id });
|
|
|
switchComp(item.meshName);
|
|
|
};
|
|
|
|
|
|
const clickMat = (item: any) => {
|
|
|
switchComp(item.meshSlotName);
|
|
|
- resource.store.setActiveKey({
|
|
|
- type: "mat",
|
|
|
- id: item.id,
|
|
|
- });
|
|
|
+ resource.store.setActiveKey({ type: "mat", id: item.id });
|
|
|
};
|
|
|
|
|
|
+ // const mesh: any = resource.store.treeData.find(
|
|
|
+ // (d: any) => d.meshName == queditor.store.currActiveProdComp?.name
|
|
|
+ // );
|
|
|
+ // if (!mesh) return;
|
|
|
+ // clickMat(mesh.children[0]);
|
|
|
+
|
|
|
return () => {
|
|
|
const Meshlist = store.treeData || [];
|
|
|
|