Explorar o código

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

qinyan hai 1 ano
pai
achega
36e98e68a3

+ 7 - 0
src/controllers/queentreeController.ts

@@ -15,6 +15,13 @@ export class  TreeController {
         const payload = {}
         const ret:any = await bus.RequestWebView("selmatblack", {height: 600, width: 900, payload, url, alwaysOnTop:true,})
         console.log("selmat=>", ret);
+
+        if (ret.payload) {
+            ret.payload.uvMap = "uv";
+            ret.payload.classType = "pbr";
+            ret.payload.type = "meta";
+        }
+        
         return ret.payload;
     }
 

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

@@ -7,12 +7,12 @@ 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 { reactive } from "vue";
+import { defineComponent, reactive } from "vue";
 import { string } from "vue-types";
 import { useCompData } from ".";
-import { createUIComp } from "../../defines/createUIComp";
+import { View } from "../View";
 
-export const Component = createUIComp({
+export const Component = defineComponent({
   props: {
     compId: string(),
     value: string().def(""),
@@ -54,32 +54,43 @@ export const Component = createUIComp({
     };
 
     const state = reactive({
-      focus: false,
+      editing: false,
     });
 
+    let editorInstance: InlineEditor;
+
     return () => (
-      <div class={["w-1/1 h-1/1", state.focus && "drag-disable"]}>
+      <View
+        class={[state.editing && "drag-disable"]}
+        compId={props.compId}
+        onDblclick={() => {
+          if (store.isEditMode) {
+            state.editing = true;
+            editorInstance.disableReadOnlyMode("editor");
+            editorInstance.focus();
+          }
+        }}
+      >
         <ckeditor
           class={textStyle}
           editor={InlineEditor}
           onBlur={(e: any, editor: InlineEditor) => {
-            state.focus = false;
+            state.editing = false;
+            editor.enableReadOnlyMode("editor");
             if (comp) {
               comp.value = editor.getData();
             } else {
               emit("update:value", editor.getData());
             }
           }}
-          onFocus={() => (state.focus = true)}
           onReady={(editor: InlineEditor) => {
+            editorInstance = editor;
             editor.setData(comp?.value || props.value);
-            if (!store.isEditMode) {
-              editor.enableReadOnlyMode("editor");
-            }
+            editor.enableReadOnlyMode("editor");
           }}
           config={config}
         />
-      </div>
+      </View>
     );
   },
 });

+ 10 - 1
src/modules/resource/actions/material.ts

@@ -44,7 +44,16 @@ export const materialActions = ResourceModule.action({
   },
 
   async selectMaterial(record) {
-    const url = `${location.origin}/index.html#/create/${record._id}`;
+    const _params = new URLSearchParams(decodeURIComponent(location.search));
+    const host = _params.get("host")
+
+    if (location.host == "www.infish.cn") {
+      const url = `${location.origin}/projects/queenshow/index.html?host=${host}#/create/${record._id}`;
+      location.href = url;
+      return;
+    }
+
+    const url = `${location.origin}/index.html?host=${host}#/create/${record._id}`;
     location.href = url;
   },
 });

+ 1 - 0
src/pages/editor/index.ts

@@ -5,6 +5,7 @@ import CKEditor from "@ckeditor/ckeditor5-vue";
 import router from "./router";
 import { initResource } from "@/modules/resource";
 
+document.title = "推广编辑器"
 startApp(router, [initAuthDef, initRemSize, initResource], (app) => {
   app.use(CKEditor);
 });

+ 1 - 1
src/pages/website/CreateMat/components/LibraryModal.tsx

@@ -33,7 +33,7 @@ export default defineComponent({
 
     initQueentreeExplorer({
       config: {
-        showNodeToolbar: false,
+        showNodeToolbar: true,
         nodeListColumns: 6,
       },
     });

+ 1 - 0
src/pages/website/index.ts

@@ -3,4 +3,5 @@ import { initAuthDef } from "@/hooks/initAuthDef";
 import { initResource } from "@/modules/resource";
 import router from "./router";
 
+document.title = "推广编辑器"
 startApp(router, [initAuthDef, initResource]);