|
@@ -1,14 +1,13 @@
|
|
|
+import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
|
|
|
import { TreeToolbars } from "@/modules/editor/objects/Toolbars";
|
|
|
import { css } from "@linaria/core";
|
|
|
import { Image } from "@queenjs/ui";
|
|
|
import { useReactive } from "@queenjs/use";
|
|
|
-import { Tree, TreeProps } from "ant-design-vue";
|
|
|
+import { Tree } from "ant-design-vue";
|
|
|
import { defineComponent, nextTick, watch } from "vue";
|
|
|
-import { string, bool } from "vue-types";
|
|
|
+import { string } from "vue-types";
|
|
|
import { useEditor } from "../../../..";
|
|
|
import { DesignComp } from "../../../../objects/DesignTemp/DesignComp";
|
|
|
-import { TreeDataItem } from "ant-design-vue/lib/tree";
|
|
|
-import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
|
|
|
|
|
|
type TreeItem = {
|
|
|
key: string;
|
|
@@ -19,7 +18,17 @@ type TreeItem = {
|
|
|
|
|
|
export const CompTree = defineComponent({
|
|
|
setup() {
|
|
|
- const { store, actions, helper, controls } = useEditor();
|
|
|
+ const { controls } = useEditor();
|
|
|
+ return () => {
|
|
|
+ const key = controls.pageCtrl.designData.title;
|
|
|
+ return <CompTreeMain key={key} />;
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
+export const CompTreeMain = defineComponent({
|
|
|
+ setup() {
|
|
|
+ const { store, helper, controls } = useEditor();
|
|
|
const { compUICtrl } = controls;
|
|
|
|
|
|
const state = useReactive(() => ({
|
|
@@ -37,6 +46,7 @@ export const CompTree = defineComponent({
|
|
|
return {
|
|
|
key: comp.id,
|
|
|
title:
|
|
|
+ comp.layout.cusName ||
|
|
|
comp.title ||
|
|
|
compUICtrl.state.components.get(comp.compKey)?.name ||
|
|
|
"未命名",
|
|
@@ -62,6 +72,7 @@ export const CompTree = defineComponent({
|
|
|
});
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
const onDrop = (info: any) => {
|
|
|
const dragNode = info.dragNode; //被拖拽
|
|
|
const dropNode = info.node; //拖拽落下
|
|
@@ -140,6 +151,7 @@ export const CompTree = defineComponent({
|
|
|
helper.extendStreamCard(parentComp.id);
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
const sortCompInCard = (
|
|
|
parentComp: DesignComp,
|
|
|
index: number,
|
|
@@ -232,7 +244,7 @@ const CompNode = defineComponent({
|
|
|
return (
|
|
|
<div class={[nodeStyle, "flex"]}>
|
|
|
<Image src={thumbnail} size={240} />
|
|
|
- <span class="flex-1 w-0 text-12px whitespace-nowrap overflow-hidden overflow-ellipsis pr-6px">
|
|
|
+ <span class="flex-1 w-0 text-12px whitespace-nowrap overflow-hidden overflow-ellipsis pr-6px leading-normal">
|
|
|
{title}
|
|
|
</span>
|
|
|
<span class="actions space-x-2px whitespace-nowrap transition">
|