Преглед на файлове

Merge branch 'dev' of http://124.70.149.18:10880/lianghj/queenshow into dev

liwei преди 1 година
родител
ревизия
da2c5606e2

+ 1 - 1
package.json

@@ -61,7 +61,7 @@
     "proto.gl": "^1.0.0",
     "qrcode": "^1.5.3",
     "queen3d": "^0.0.80",
-    "queenjs": "^1.0.0-beta.75",
+    "queenjs": "^1.0.0-beta.76",
     "rimraf": "^3.0.2",
     "scp2": "^0.5.0",
     "swiper": "^8.4.4",

+ 6 - 6
src/modules/editor/components/CompUI/basicUI/Text/component.tsx

@@ -7,7 +7,7 @@ import { FontColor, FontFamily, FontSize } from "@ckeditor/ckeditor5-font";
 import { Link } from "@ckeditor/ckeditor5-link";
 import { Paragraph } from "@ckeditor/ckeditor5-paragraph";
 import { css } from "@linaria/core";
-import { defineComponent, watchEffect } from "vue";
+import { defineComponent, watch, watchEffect } from "vue";
 import { string } from "vue-types";
 import { useCompData } from ".";
 import { View } from "../View";
@@ -54,11 +54,11 @@ export const Component = defineComponent({
 
     let editorInstance: InlineEditor;
 
-    watchEffect(() => {
-      if (!store.textEditingState) {
-        editorInstance?.setData(comp.value);
-      }
-    });
+    // watchEffect(() => {
+    //   if (!store.textEditingState) {
+    //     editorInstance?.setData(comp.value);
+    //   }
+    // });
 
     return () => (
       <View

+ 28 - 4
src/modules/editor/components/CompUI/basicUI/Video/component.tsx

@@ -3,6 +3,8 @@ import { string } from "vue-types";
 import { useCompData } from ".";
 import { View } from "../View";
 import { useEditor } from "@/modules/editor";
+import { IconPicture } from "@queenjs/icons";
+import { css } from "@linaria/core";
 
 export const Component = defineComponent({
   props: {
@@ -25,18 +27,40 @@ export const Component = defineComponent({
       if (value.controls) options.controls = true;
 
       return (
-        <View
-          compId={props.compId}
-          onDblclick={store.isEditMode ? changeVal : undefined}
-        >
+        <View class={rootCls} compId={props.compId}>
           <video
             class="w-full object-cover"
             src={value.url}
             style={{ aspectRatio: value.ratio }}
             {...options}
           />
+          {store.isEditMode && (
+            <IconPicture class={btnCls} onClick={changeVal} />
+          )}
         </View>
       );
     };
   },
 });
+
+const btnCls = css`
+  display: none;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  padding: 0.4rem;
+  font-size: 0.75rem;
+  color: #666;
+  border-radius: 50%;
+  background-color: rgba(255, 255, 255, 0.7);
+  transform: translate(-50%, -50%);
+  @apply shadow;
+`;
+
+const rootCls = css`
+  &:hover {
+    .${btnCls} {
+      display: block;
+    }
+  }
+`;

+ 5 - 0
src/modules/editor/components/CompUI/basicUI/Video/index.ts

@@ -19,6 +19,11 @@ export const { createComp, useCompData } = createCompHooks({
 });
 
 export const Form = createAttrsForm([
+  {
+    label: "视频地址",
+    dataIndex: "value.url",
+    component: "Input",
+  },
   {
     label: "视频比例",
     dataIndex: "value.ratio",

+ 5 - 6
src/modules/editor/objects/DesignTemp/index.ts

@@ -1,4 +1,3 @@
-import { mapValuesDeep } from "@/utils";
 import { DesignComp } from "./DesignComp";
 import { dataTransform } from "./versions/0.0.1";
 
@@ -19,13 +18,13 @@ export class DesignTemp {
     Object.entries(this.compMap).forEach(([key, value]) => {
       this.compMap[key] = new DesignComp(value);
     });
+
     // 初始化DesignComp的pid
     Object.values(this.compMap).forEach((comp) => {
-      const childIds = mapValuesDeep(
-        comp.children,
-        (v) => typeof v === "string",
-        (v: string) => v
-      );
+      if (comp.children.default) {
+        // comp.children.default = Array.from(new Set(comp.children.default));
+      }
+      const childIds = comp.getChildIds();
       childIds.forEach((cid) => {
         const childComp = this.compMap[cid];
         Object.defineProperty(childComp, "pid", { value: comp.id });

+ 4 - 4
yarn.lock

@@ -7123,10 +7123,10 @@ queen3d@^0.0.80:
   resolved "http://124.70.149.18:4873/queen3d/-/queen3d-0.0.80.tgz#11d4c60f233fc54d810e8f912b79495e4acfb95e"
   integrity sha512-GaBzki+vcjC4JDN4olh/UI3oW6BRc1qbk1+pwUlbBN0oC+ilKNn9C64tLSEio0zWZikEtGb6A9jrUXntX1no4A==
 
-queenjs@^1.0.0-beta.75:
-  version "1.0.0-beta.75"
-  resolved "http://124.70.149.18:4873/queenjs/-/queenjs-1.0.0-beta.75.tgz#24a3ca1cecf4c6bdefde359d1e00dfd8ab108c5f"
-  integrity sha512-sdfFHIZ4v4y3utrfmc2iegkZlXVhhrwvfovf1Z9lNhZ+08jy0H/TA8sv1KEKkWKQGZpgyk9Ytu6XvGhUACMz4g==
+queenjs@^1.0.0-beta.76:
+  version "1.0.0-beta.76"
+  resolved "http://124.70.149.18:4873/queenjs/-/queenjs-1.0.0-beta.76.tgz#66cde144de8fa2399445ef2aa2bc0f7465b1e4e8"
+  integrity sha512-csaeJ2NKX5KxoTpVYxIRJbZoiwlgyewLosZ3B2YvyvcoX+4RAwHyEM+IY/6hk855fclI3BFSTEfSwZbLcqAxDw==
   dependencies:
     axios "^0.27.2"
     eventemitter3 "^4.0.7"