qinyan 11 months ago
parent
commit
b0faed6c09
3 changed files with 15 additions and 16 deletions
  1. 1 1
      package.json
  2. 10 11
      src/comm/controllers/appMsgQueen5Ctrl.ts
  3. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -35,7 +35,7 @@
     "@queenjs-modules/queentree": "^0.0.10",
     "@queenjs-modules/queentree-explorer": "^0.0.6",
     "@queenjs-modules/queentree-explorer-viewer": "^0.0.3",
-    "@queenjs/assets": "^0.0.20",
+    "@queenjs/assets": "^0.0.22",
     "@queenjs/components": "^0.0.23",
     "@queenjs/controllers": "^0.0.8",
     "@queenjs/icons": "^0.0.20",

+ 10 - 11
src/comm/controllers/appMsgQueen5Ctrl.ts

@@ -70,18 +70,17 @@ export class AppMsgQueen5Controller extends AppMsgRecvController {
       return true;
     });
 
-    // this.addWebpackuriListener(
-    //   "添加3D组件",
-    //   async (url: string, name: string, thumbnail: string) => {
-    //     console.log("url", url, name, thumbnail);
+    this.addListener("webpackuri", "添加3D组件", async (data: any) => {
+      const { thumbnail, link } = data.payload;
+      // console.log("推送 url", link, thumbnail);
+
+      await this.editor.actions.clickCompToDesign("Web3D", (comp) => {
+        comp.value.url = link;
+        comp.value.poster = thumbnail;
+      });
+      return true;
+    });
 
-    //     await this.editor.actions.clickCompToDesign("Web3D", (comp) => {
-    //       comp.value.url = url;
-    //       comp.value.poster = thumbnail;
-    //     });
-    //     return true;
-    //   }
-    // );
     this.emitChange();
   }
 }

+ 4 - 4
yarn.lock

@@ -1796,10 +1796,10 @@
   resolved "http://124.70.149.18:4873/@queenjs-modules%2fqueentree/-/queentree-0.0.10.tgz"
   integrity sha512-P4cIjXKgcvd8h3vVs4f1rGLNf3/Kd5G+qGiZN+idkLjiu22HU6SNmOVLUwV6PuKg+9sTPRn7FKamSHuFxXWX5g==
 
-"@queenjs/assets@^0.0.20":
-  version "0.0.20"
-  resolved "http://124.70.149.18:4873/@queenjs%2fassets/-/assets-0.0.20.tgz#5319c4077d8bced42af0cd679c515ddca9f11d07"
-  integrity sha512-ddZIsTSCUBerC0xDeYsb0j0REu0Y4Bw8zc/IMz1MBCHVQF4y+gnwPhXWo3+S8Y0PnLr0yNCi8F47Mit8sBj4KQ==
+"@queenjs/assets@^0.0.22":
+  version "0.0.22"
+  resolved "http://124.70.149.18:4873/@queenjs%2fassets/-/assets-0.0.22.tgz#32fe79422b50d9d6b328b5824ed2fcbcffdcf2ee"
+  integrity sha512-dnzz13ks5XiUsWLfqHHhdFAtVjasL3YZaeGPgcAM7mJGkByXMjA0rVE5uB0eTZeGyOurewRI16hNLx59RXw0UQ==
 
 "@queenjs/components@^0.0.23":
   version "0.0.23"