|
@@ -6,22 +6,26 @@ import { defineUI } from "queenjs";
|
|
import { Container, Draggable } from "vue-dndrop";
|
|
import { Container, Draggable } from "vue-dndrop";
|
|
import CustomComps from "./CustomComps";
|
|
import CustomComps from "./CustomComps";
|
|
import { MySources } from "./MySources";
|
|
import { MySources } from "./MySources";
|
|
|
|
+import Frames from "./Frames";
|
|
|
|
|
|
export default defineUI({
|
|
export default defineUI({
|
|
setup() {
|
|
setup() {
|
|
const editor = useEditor();
|
|
const editor = useEditor();
|
|
- const { compUICtrl } = editor.controls;
|
|
|
|
|
|
+ const { compUICtrl, frameControl } = editor.controls;
|
|
|
|
|
|
const tabs = [
|
|
const tabs = [
|
|
- { label: "模块组件", value: "senior" },
|
|
|
|
|
|
+ { label: "模板", value: "frame" },
|
|
|
|
+ { label: "组件", value: "senior" },
|
|
{ label: "我的组件", value: "user" },
|
|
{ label: "我的组件", value: "user" },
|
|
{ label: "我的素材", value: "source" },
|
|
{ label: "我的素材", value: "source" },
|
|
];
|
|
];
|
|
|
|
|
|
const state = useReactive(() => ({
|
|
const state = useReactive(() => ({
|
|
- currTabType: "senior",
|
|
|
|
|
|
+ currTabType: "frame",
|
|
basicComps() {
|
|
basicComps() {
|
|
- return ["Text", "Image", "Video", "Web3D"].map(key => compUICtrl.state.components.get(key) as any);
|
|
|
|
|
|
+ return ["Text", "Image", "Video", "Web3D"].map(
|
|
|
|
+ (key) => compUICtrl.state.components.get(key) as any
|
|
|
|
+ );
|
|
},
|
|
},
|
|
currComps() {
|
|
currComps() {
|
|
return Array.from(compUICtrl.state.components.values()).filter(
|
|
return Array.from(compUICtrl.state.components.values()).filter(
|
|
@@ -82,13 +86,19 @@ export default defineUI({
|
|
);
|
|
);
|
|
})}
|
|
})}
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- {state.currTabType !== "source" ? (
|
|
|
|
|
|
+ {state.currTabType == "frame" && (
|
|
|
|
+ <Frames
|
|
|
|
+ class="flex-1 -mx-16px p-16px"
|
|
|
|
+ dataSource={frameControl.listCtrl.state.list}
|
|
|
|
+ />
|
|
|
|
+ )}
|
|
|
|
+ {(state.currTabType == "user" || state.currTabType == "senior") && (
|
|
<CustomComps
|
|
<CustomComps
|
|
class="flex-1 -mx-16px p-16px"
|
|
class="flex-1 -mx-16px p-16px"
|
|
components={state.currComps}
|
|
components={state.currComps}
|
|
/>
|
|
/>
|
|
- ) : (
|
|
|
|
|
|
+ )}
|
|
|
|
+ {state.currTabType == "source" && (
|
|
<MySources class="flex-1 -mx-16px p-16px" />
|
|
<MySources class="flex-1 -mx-16px p-16px" />
|
|
)}
|
|
)}
|
|
</div>
|
|
</div>
|