qinyan 1 year ago
parent
commit
88779e667a

+ 1 - 1
src/hooks/initAuthDef.ts

@@ -9,7 +9,7 @@ export function initAuthDef() {
       },
       key: "queentreesku3d",
       loginPath: "/login",
-      loginJumpPath: "/workbench",
+      loginJumpPath: "/",
       logoutJumpPath: "/login",
 
       needCompanyLogin: false,

+ 65 - 56
src/modules/editor/components/CompUI/basicUI/Transfer/index.tsx

@@ -1,14 +1,13 @@
+import { IconRotate } from "@/assets/icons";
 import { CompToolbars } from "@/modules/editor/objects/Toolbars";
 import { css } from "@linaria/core";
 import { defineComponent, onMounted, onUnmounted } from "vue";
 import { useEditor } from "../../../..";
-import { IconMove, IconRotate } from "@/assets/icons";
-import { parseTransform } from "@/modules/editor/objects/DesignTemp/creates/createCompStyle";
 
 export const Transfer = defineComponent({
   setup() {
     const editor = useEditor();
-    const { store, controls, helper } = editor;
+    const { controls, helper } = editor;
     const { transferCtrl } = controls;
     const { transferStyle } = transferCtrl;
 
@@ -23,7 +22,7 @@ export const Transfer = defineComponent({
 
     onUnmounted(() => {
       transferCtrl.destroy();
-      console.log("transferCtrl.destroy========================")
+      // console.log("transferCtrl.destroy========================");
     });
 
     return () => {
@@ -34,74 +33,84 @@ export const Transfer = defineComponent({
       // const showTransfer =
       //   store.isEditComp || store.pageCompIds.includes(comp.id);
       const showTransfer = true;
-      const styleTransform = parseTransform(transferStyle.transform);
 
       return (
         transferStyle.width && (
           <div
-            class="transfer absolute"
+            class="absolute transfer"
             style={{
               top: transferStyle.top,
               left: transferStyle.left,
               width: transferStyle.width,
-              transform: styleTransform,
-              transformOrigin: "left",
+              transform: `translateX(${transferStyle.transform.translateX}) translateY(${transferStyle.transform.translateY})`,
             }}
           >
+            {showTransfer && (
+              <div class={toolbarStyle}>
+                {toolbarOpts.map((item) => {
+                  return item.getVisible.call(editor, comp) ? (
+                    <item.component
+                      class="p-4px"
+                      value={item.getValue?.(comp)}
+                      onClick={() => item.onClick.call(editor, comp)}
+                    />
+                  ) : null;
+                })}
+              </div>
+            )}
             <div
-              class={borderStyle}
               style={{
-                width: transferStyle.width,
-                height: transferStyle.height,
+                transform: `rotate(${transferStyle.transform.rotate})`,
+                transformOrigin: `center ${
+                  parseInt(transferStyle.height.split("px")[0]) / 2
+                }px`,
               }}
-            />
+            >
+              <div
+                class={borderStyle}
+                style={{
+                  width: transferStyle.width,
+                  height: transferStyle.height,
+                }}
+              />
+
+              {showTransfer && (
+                <>
+                  <div
+                    class={resizeStyle}
+                    style={{ marginBottom: "-" + transferStyle.height }}
+                    onMousedown={(e) =>
+                      transferCtrl.mousedown(
+                        e,
+                        comp.compKey === "Image" ? "resizeXY" : "scale"
+                      )
+                    }
+                  />
 
-            {showTransfer && (
-              <>
-                <div
-                  class={resizeStyle}
-                  style={{ marginBottom: "-" + transferStyle.height }}
-                  onMousedown={(e) =>
-                    transferCtrl.mousedown(
-                      e,
-                      comp.compKey === "Image" ? "resizeXY" : "scale"
-                    )
-                  }
-                />
-                <div class={toolbarStyle}>
-                  {toolbarOpts.map((item) => {
-                    return item.getVisible.call(editor, comp) ? (
-                      <item.component
-                        class="p-4px"
-                        value={item.getValue?.(comp)}
-                        onClick={() => item.onClick.call(editor, comp)}
-                      />
-                    ) : null;
-                  })}
-                </div>
-                <div
-                  class={transformBtnsStyle}
-                  style={{ marginBottom: "-" + transferStyle.height }}
-                >
                   <div
-                    class={transBtnStyle}
-                    onMousedown={(e) => transferCtrl.mousedown(e, "rotate")}
+                    class={transformBtnsStyle}
+                    style={{ marginBottom: "-" + transferStyle.height }}
                   >
-                    <IconRotate />
+                    <div
+                      class={transBtnStyle}
+                      onMousedown={(e) => transferCtrl.mousedown(e, "rotate")}
+                    >
+                      <IconRotate />
+                    </div>
                   </div>
-                </div>
-                <div
-                  class={resizeHeightBtnCls}
-                  style={{ top: transferStyle.height }}
-                  onMousedown={(e) => transferCtrl.mousedown(e, "resizeY")}
-                />
-                <div
-                  class={resizeWidthBtnCls}
-                  style={{ top: parseInt(transferStyle.height) / 2 + "px" }}
-                  onMousedown={(e) => transferCtrl.mousedown(e, "resizeX")}
-                />
-              </>
-            )}
+                  <div
+                    class={resizeHeightBtnCls}
+                    style={{ top: transferStyle.height }}
+                    onMousedown={(e) => transferCtrl.mousedown(e, "resizeY")}
+                  />
+                  <div
+                    class={resizeWidthBtnCls}
+                    style={{ top: parseInt(transferStyle.height) / 2 + "px" }}
+                    onMousedown={(e) => transferCtrl.mousedown(e, "resizeX")}
+                  />
+                </>
+              )}
+            </div>
           </div>
         )
       );
@@ -170,7 +179,7 @@ const toolbarStyle = css`
   position: absolute;
   top: 0;
   left: 50%;
-  transform: translate(-50%, -40px);
+  transform: translate(-50%, -60px);
   z-index: 999;
 `;
 

+ 3 - 6
src/modules/editor/components/CompUI/basicUI/Transfer/streamCard.tsx

@@ -1,9 +1,8 @@
+import { IconResizeY } from "@/assets/icons";
+import { TransferCtrl } from "@/modules/editor/controllers/TransferCtrl";
 import { css } from "@linaria/core";
 import { defineComponent, onMounted, onUnmounted } from "vue";
 import { useEditor } from "../../../..";
-import { IconMove, IconClear, IconAdd, IconResizeY } from "@/assets/icons";
-import { TransferCtrl } from "@/modules/editor/controllers/TransferCtrl";
-import { parseTransform } from "@/modules/editor/objects/DesignTemp/creates/createCompStyle";
 
 export const StreamCardTransfer = defineComponent({
   setup() {
@@ -28,8 +27,6 @@ export const StreamCardTransfer = defineComponent({
     return () => {
       const transferStyle = streamCardTransferCtrl.transferStyle;
 
-      const styleTransform = parseTransform(transferStyle.transform);
-
       return (
         transferStyle.width && (
           <div
@@ -38,7 +35,7 @@ export const StreamCardTransfer = defineComponent({
               top: transferStyle.top,
               left: transferStyle.left,
               width: transferStyle.width,
-              transform: styleTransform,
+              transform: `translateX(${transferStyle.transform.translateX}) translateY(${transferStyle.transform.translateY})`,
             }}
           >
             <div

+ 1 - 1
src/modules/editor/components/CompUI/customUI/Texts/Text1/component.tsx

@@ -42,7 +42,7 @@ export const Component = createUIComp({
               compId={d.label}
               class={
                 value.showBackground
-                  ? "text relative z-1 py-0.08rem px-0.1rem text-white"
+                  ? "text relative z-0 py-0.08rem px-0.1rem text-white"
                   : "text-secondary"
               }
               style={{

+ 6 - 6
src/modules/editor/components/Viewport/Content/index.tsx

@@ -88,14 +88,14 @@ export default defineUI({
                       >
                         {children}
                       </Container>
+                      {store.currStreamCardId && <StreamCardTransfer key={store.currStreamCardId + streamCardIndex} />}
+
                       {store.currCompId &&
                        store.currStreamCardId &&
-                        store.currCompId !== "root" &&
-                        !store.textEditingState &&
-                        store.currCompId !== store.currStreamCardId && 
-                        !state.draging && <Transfer key={store.currCompId + streamCardIndex} />}
-
-                      {store.currStreamCardId && <StreamCardTransfer key={store.currStreamCardId + streamCardIndex} />}
+                       store.currCompId !== "root" &&
+                       !store.textEditingState &&
+                       store.currCompId !== store.currStreamCardId && 
+                       !state.draging && <Transfer key={store.currCompId + streamCardIndex} />}
                     </>
                   );
                 },