Explorar o código

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

qinyan hai 1 ano
pai
achega
f1d442e47a

+ 7 - 3
src/modules/editor/components/CompUI/basicUI/Transfer/select.tsx

@@ -3,7 +3,7 @@ import { CompToolbars } from "@/modules/editor/objects/Toolbars";
 import { css } from "@linaria/core";
 import { defineComponent, onMounted, onUnmounted, ref, nextTick } from "vue";
 import { useEditor } from "../../../..";
-import { styles } from "dom7";
+
 
 export const SelectTransfer = defineComponent({
   setup() {
@@ -20,7 +20,10 @@ export const SelectTransfer = defineComponent({
         comp = selectCtrl.selected[0].comp;
         //@ts-ignore
         toolbarOpts = CompToolbars[comp.compKey] || toolbarOpts;
+      }  else {
+        toolbarOpts = CompToolbars.MultiSelector;
       }
+
       const w = selectCtrl.objContainer?.getBound();
       const isTextEdit = selectCtrl.selected.length == 1 && selectCtrl.selected[0].comp.compKey == "Text";
 
@@ -42,7 +45,7 @@ export const SelectTransfer = defineComponent({
               left: w?.x + "px",
             }}
           >
-            {comp &&
+            {
               toolbarOpts.map((item) => {
                 return item.getVisible.call(editor, comp) ? (
                   <item.component
@@ -51,7 +54,8 @@ export const SelectTransfer = defineComponent({
                     onClick={() => item.onClick.call(editor, comp)}
                   />
                 ) : null;
-              })}
+              })
+            }
           </div>
 
           <div

+ 3 - 0
src/modules/editor/controllers/SelectCtrl/index.ts

@@ -509,6 +509,9 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
       }
     }
     this.actions.selectObjs(outs);
+    if (outs.length < 1) {
+      this.actions.pickComp(this.store.currStreamCardId);
+    }
   }
   
   upgateGizmoStyle() {

+ 15 - 3
src/modules/editor/module/actions/edit.ts

@@ -19,8 +19,12 @@ export const editActions = EditorModule.action({
             this.actions.selectObjs([cardChilds.id])
         } else  {
           this.actions.selectObjs([])
+          if (id != "root") {
+             this.store.setCurrComp(this.store.currStreamCardId);
+          }
         }
     }
+
     if (this.store.currCompId == compId) {
       //this.controls.selectCtrl.upgateGizmoStyle();
       return;
@@ -105,9 +109,6 @@ export const editActions = EditorModule.action({
    async selectObjs(ids: string[]) {
      this.store.selected = ids;
      this.store.selectId = ids.length > 1 ? (Date.now() + "") : ""
-     if (ids.length < 1) {
-      this.actions.pickComp("root");
-     }
    },
 
   // 添加组件到画布
@@ -177,6 +178,17 @@ export const editActions = EditorModule.action({
     const parentComp = this.helper.findParentComp(compId);
     parentComp && this.store.setCurrComp(parentComp.id);
   },
+
+  // 删除组件
+  removeSelectComps() {
+    const selected = this.store.selected.slice(0);
+    this.actions.selectObjs([]);
+    let n = selected.length;
+    while( n--) {
+      this.actions.removeComp(selected[n]);
+    }
+  },
+
   // 删除组件
   removeComp(compId: string) {
     if (this.helper.isCompCanDelete(compId)) {

+ 5 - 2
src/modules/editor/objects/Toolbars/CompToolbars.ts

@@ -1,4 +1,4 @@
-import { ICompToolbars, toolbars } from "./default";
+import { ICompToolbars, toolbars, multiSelToolbar } from "./default";
 
 export const CompToolbars: ICompToolbars = {
   default: [
@@ -13,5 +13,8 @@ export const CompToolbars: ICompToolbars = {
   ],
   Group: [
     toolbars.cancelGroup,
-  ]
+  ],
+  MultiSelector: [
+    multiSelToolbar.delete,
+  ],
 };

+ 2 - 1
src/modules/editor/objects/Toolbars/TreeToolbars.ts

@@ -1,4 +1,4 @@
-import { ICompToolbars, toolbars } from "./default";
+import { ICompToolbars, toolbars, multiSelToolbar } from "./default";
 
 export const TreeToolbars: ICompToolbars = {
   default: [
@@ -10,4 +10,5 @@ export const TreeToolbars: ICompToolbars = {
     toolbars.delete,
   ],
   Page: [],
+  MultiSelector: [multiSelToolbar.delete]
 };

+ 44 - 0
src/modules/editor/objects/Toolbars/default.ts

@@ -33,6 +33,7 @@ class ToolbarItem {
 
 export type ICompToolbars = { [name in ICompKeys]?: ToolbarItem[] } & {
   default: ToolbarItem[];
+  MultiSelector: ToolbarItem[];
 };
 
 function createToolbars<T extends Record<string, ItemParams>>(obj: T) {
@@ -43,6 +44,49 @@ function createToolbars<T extends Record<string, ItemParams>>(obj: T) {
   return data as { [name in keyof T]: ToolbarItem };
 }
 
+export const multiSelToolbar = createToolbars({
+    // 删除
+  delete: {
+    component: TipIcons.Delete,
+    getVisible() {
+      return true;
+    },
+    onClick() {
+      this.actions.removeSelectComps();
+    },
+  },
+  // // 清除变换
+  // clearTransform: {
+  //   component: TipIcons.ClearTransform,
+  //   getVisible() {
+  //     return true;
+  //   },
+  //   onClick() {
+  //     //this.actions.clearCompTransform(comp);
+  //   },
+  // },
+  // // 定位图层上移
+  // layerUp: {
+  //   component: TipIcons.LayerUp,
+  //   getVisible() {
+  //     return true;
+  //   },
+  //   onClick() {
+  //     // this.actions.setCompLayer(comp, 1);
+  //   },
+  // },
+  // // 定位图层下移
+  // layerDown: {
+  //   component: TipIcons.LayerDown,
+  //   getVisible() {
+  //     return true;
+  //   },
+  //   onClick() {
+  //     // this.actions.setCompLayer(comp, -1);
+  //   },
+  // },
+})
+
 export const toolbars = createToolbars({
   // 显示/隐藏
   visible: {

+ 6 - 4
src/modules/resource/components/ResourceManager/Toolbar.tsx

@@ -3,6 +3,7 @@ import { defineComponent } from "vue";
 import { useResource } from "../..";
 import MaterialTemplateModal from "./MaterialTemplateModal";
 import { css, cx } from "@linaria/core";
+import { queenApi } from "queenjs";
 
 const materialType = [
   { name: "视频", key: "video" },
@@ -17,10 +18,11 @@ export default defineComponent({
     const { store } = resource;
 
     const showModal = (type: string) => {
-      resource.showModal(<MaterialTemplateModal type={type} />, {
-        title: `${type === "image" ? "图片" : "视频"}模板中心`,
-        width: "1000px",
-      });
+      // resource.showModal(<MaterialTemplateModal type={type} />, {
+      //   title: `${type === "image" ? "图片" : "视频"}模板中心`,
+      //   width: "1000px",
+      // });
+       queenApi.messageSuccess("努力开发中,尽请期待!")
     };
 
     return () => {

+ 3 - 1
src/pages/website/Material2/controller.tsx

@@ -1,6 +1,7 @@
 import SelectListItemModal from "./components/SelectListItemModal";
 import { MaterialController } from "../../../modules/resource/controllers/MaterialController";
 import PreviewModal from "../components/PreviewModal";
+import { queenApi } from "queenjs";
 
 export default function createController(resource:any, isSelectModel:boolean, selectType :string) {
     const {controls, actions} = resource;
@@ -53,7 +54,8 @@ export default function createController(resource:any, isSelectModel:boolean, se
         ctrl.getCurrControl().loadPage(1);
         return;
       }
-      showModal(name);
+      queenApi.messageSuccess("功能开发中, 敬请期待!")
+      //showModal(name);
     };
     ctrl.onItemClick = async function (name, record) {
       if (name == "delete") {

+ 2 - 2
src/pages/website/components/layout/LeftContent.tsx

@@ -63,8 +63,8 @@ export default defineUI({
             <Avatar size={76} src={userInfo.avatar} />
             <div class="ml-20px flex-1">
               <p class="mb-10px text-16px font-bold">{userInfo.name}</p>
-              <div class="text-12px text-gray">
-                {userInfo.desc || "这个人很懒,什么都没留下..."}
+              <div class="text-12px text-gray" style={{color:"#E88B00"}}>
+                { "免费版(限3个推广)" }
               </div>
             </div>
           </div>