| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import { Ref, ref } from "vue";
- import { StoreData } from "@/core/store/store";
- import { PaperKey } from "../components/slide/actions";
- import { overviewId, params, tabulationId } from "../env";
- import { DrawItem } from "@/core/components";
- import { IRect } from "konva/lib/types";
- import { ShapeType } from "@/index";
- export {
- tableCoverKey,
- tableCoverScaleKey,
- tableTableKey,
- tableTitleKey,
- tableCompassKey,
- mapImageKey,
- tableCoverWidth,
- tableCoverHeight,
- } from "../constant";
- export type TabCover = {
- url: string;
- width: number;
- height: number;
- proportion: {
- scale: number;
- unit: string;
- };
- syncItems?: (DrawItem<ShapeType> & { rect: IRect; desc: string })[];
- };
- export const overviewData = ref() as Ref<{
- title?: string;
- cover?: string;
- store: StoreData;
- viewport: number[] | null;
- }>;
- export const refreshOverviewData = () => {
- return window.platform.getOverviewData(overviewId.value).then((data: any) => {
- overviewData.value = data;
- });
- };
- export const tabulationData = ref() as Ref<{
- store: StoreData;
- cover: TabCover | null;
- title?: string;
- paperKey: PaperKey;
- isAutoGen: boolean;
- viewport: number[] | null;
- mapUrl: string | null;
- high?: number;
- width?: number;
- }>;
- export const refreshTabulationData = () => {
- return window.platform
- .getTabulationData(tabulationId.value)
- .then((data: any) => {
- tabulationData.value = data
- });
- };
- export const sysError = ref<{ code: number }>();
- window.platform.bus.on("requestError", (val: any) => {
- sysError.value = val;
- });
|