123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import { useEditor } from "@/modules/editor";
- import { Button } from "ant-design-vue";
- import { defineUI, queenApi } from "queenjs";
- import { TipIcons } from "../../TipIcons";
- import PreviewDesignModal from "./PreviewDesignModal";
- import PublishDesignModal from "./PublishDesignModal";
- export default defineUI({
- setup() {
- const editor = useEditor();
- const { store, actions, controls } = editor;
- function showPreviewModal() {
- controls.screenCtrl.saveScreenPage();
- const rootPage = controls.pageCtrl.rootPage;
- rootPage.value.pageMode = controls.screenCtrl.state.screen.pageMode;
- rootPage.value.pageSizeType =
- controls.screenCtrl.state.screen.pageSizeType;
- queenApi.dialog(
- <PreviewDesignModal data={controls.pageCtrl.designData} />,
- {
- fullscreen: true,
- closable: false,
- }
- );
- }
- function showPublishModal() {
- controls.screenCtrl.saveScreenPage();
- const rootPage = controls.pageCtrl.rootPage;
- rootPage.value.pageMode = controls.screenCtrl.state.screen.pageMode;
- rootPage.value.pageSizeType =
- controls.screenCtrl.state.screen.pageSizeType;
- queenApi.dialog(
- <PublishDesignModal data={controls.pageCtrl.designData} />,
- {
- fullscreen: true,
- title: "作品信息",
- }
- );
- }
- return () => (
- <aside class="space-x-16px flex items-center">
- <TipIcons.Preview
- class="text-20px text-light-50 bg-dark-50 p-6px transform rotate-90 rounded cursor-pointer transition hover:(!bg-dark-100)"
- onClick={showPreviewModal}
- />
- {/* {store.isEditPage && (
- <Dropdown
- overlay={<ShareBox />}
- trigger="click"
- placement="bottomRight"
- >
- <Button
- type="default"
- class="text-12px bg-dark-50 hover:(bg-dark-100 border-transparent text-light-50)"
- >
- 分享
- </Button>
- </Dropdown>
- )} */}
- <Button
- class="text-12px text-dark-500 hover:text-dark-500"
- type="primary"
- onClick={() => actions.saveDesign()}
- >
- 保存
- </Button>
- <Button
- type="text"
- class="text-12px bg-dark-50 hover:(bg-dark-100 text-light-50) focus:(bg-dark-100)"
- onClick={() => showPublishModal()}
- >
- 发布
- </Button>
- </aside>
- );
- },
- });
|