|
@@ -6,7 +6,7 @@ import { Button, Dropdown } from "ant-design-vue";
|
|
import { cloneDeep } from "lodash";
|
|
import { cloneDeep } from "lodash";
|
|
import Modal from "queenjs/adapter/vue/components/modal";
|
|
import Modal from "queenjs/adapter/vue/components/modal";
|
|
import { defineComponent, nextTick, provide, ref } from "vue";
|
|
import { defineComponent, nextTick, provide, ref } from "vue";
|
|
-import { any } from "vue-types";
|
|
|
|
|
|
+import { any, string } from "vue-types";
|
|
import { ShareBox } from "./ShareBox";
|
|
import { ShareBox } from "./ShareBox";
|
|
|
|
|
|
const NotFoundComp = () => <div>无效的组件</div>;
|
|
const NotFoundComp = () => <div>无效的组件</div>;
|
|
@@ -14,8 +14,10 @@ const NotFoundComp = () => <div>无效的组件</div>;
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
props: {
|
|
props: {
|
|
data: any(),
|
|
data: any(),
|
|
|
|
+ previewType: string<"tpl" | "edit">().def("edit"),
|
|
},
|
|
},
|
|
- setup(props) {
|
|
|
|
|
|
+ emits: ["click"],
|
|
|
|
+ setup(props, { emit }) {
|
|
const editor = initEditor();
|
|
const editor = initEditor();
|
|
const { store, helper, controls } = editor;
|
|
const { store, helper, controls } = editor;
|
|
const page = controls.pageCtrl;
|
|
const page = controls.pageCtrl;
|
|
@@ -93,7 +95,9 @@ export default defineComponent({
|
|
return (
|
|
return (
|
|
<>
|
|
<>
|
|
<div ref={compRef} style={pageStyles} class="overflow-hidden">
|
|
<div ref={compRef} style={pageStyles} class="overflow-hidden">
|
|
- <div class={["page", isShort && "swiper-wrapper relative "]}>
|
|
|
|
|
|
+ <div
|
|
|
|
+ class={["page select-none", isShort && "swiper-wrapper relative"]}
|
|
|
|
+ >
|
|
{controls.pageCtrl.streamCardIds.map((item) => {
|
|
{controls.pageCtrl.streamCardIds.map((item) => {
|
|
const c = helper.findComp(item) as DesignComp;
|
|
const c = helper.findComp(item) as DesignComp;
|
|
const Comp =
|
|
const Comp =
|
|
@@ -124,7 +128,9 @@ export default defineComponent({
|
|
};
|
|
};
|
|
|
|
|
|
return () => {
|
|
return () => {
|
|
- const { data } = props;
|
|
|
|
|
|
+ const { data, previewType } = props;
|
|
|
|
+
|
|
|
|
+ const isTpl = previewType == "tpl";
|
|
|
|
|
|
return (
|
|
return (
|
|
<div class="h-100vh flex flex-col bg-[#0B0B0B] overflow-hidden">
|
|
<div class="h-100vh flex flex-col bg-[#0B0B0B] overflow-hidden">
|
|
@@ -136,15 +142,28 @@ export default defineComponent({
|
|
<IconExit class="text-20px mr-5px" /> 退出预览
|
|
<IconExit class="text-20px mr-5px" /> 退出预览
|
|
</Button>
|
|
</Button>
|
|
<span class="text-14px select-none">{data.title}</span>
|
|
<span class="text-14px select-none">{data.title}</span>
|
|
- <Dropdown
|
|
|
|
- overlay={<ShareBox />}
|
|
|
|
- trigger="click"
|
|
|
|
- placement="bottomRight"
|
|
|
|
- >
|
|
|
|
- <Button class="text-dark-500 hover:text-dark-500" type="primary">
|
|
|
|
- 分享
|
|
|
|
|
|
+ {isTpl ? (
|
|
|
|
+ <Button
|
|
|
|
+ class="text-dark-500 hover:text-dark-500"
|
|
|
|
+ type="primary"
|
|
|
|
+ onClick={() => emit("click")}
|
|
|
|
+ >
|
|
|
|
+ 使用模板
|
|
</Button>
|
|
</Button>
|
|
- </Dropdown>
|
|
|
|
|
|
+ ) : (
|
|
|
|
+ <Dropdown
|
|
|
|
+ overlay={<ShareBox />}
|
|
|
|
+ trigger="click"
|
|
|
|
+ placement="bottomRight"
|
|
|
|
+ >
|
|
|
|
+ <Button
|
|
|
|
+ class="text-dark-500 hover:text-dark-500"
|
|
|
|
+ type="primary"
|
|
|
|
+ >
|
|
|
|
+ 分享
|
|
|
|
+ </Button>
|
|
|
|
+ </Dropdown>
|
|
|
|
+ )}
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
ref={pageRef}
|
|
ref={pageRef}
|