@whcecw/maotu 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +72 -0
- package/dist/favicon.svg +34 -0
- package/dist/imgs/change-attr.png +0 -0
- package/dist/imgs/edit-load.png +0 -0
- package/dist/imgs/edit.png +0 -0
- package/dist/imgs/event-callback.png +0 -0
- package/dist/imgs/set-node-attr.gif +0 -0
- package/dist/maotu.es.js +39711 -0
- package/dist/maotu.umd.js +1168 -0
- package/dist/src/components/custom-components/card-vue/index.vue.d.ts +32 -0
- package/dist/src/components/custom-components/jijia-vue/index.vue.d.ts +50 -0
- package/dist/src/components/custom-components/kv-vue/index.vue.d.ts +86 -0
- package/dist/src/components/custom-components/now-time-vue/index.vue.d.ts +41 -0
- package/dist/src/components/custom-components/panche-vue/index.vue.d.ts +59 -0
- package/dist/src/components/custom-components/recttext-vue/index.vue.d.ts +77 -0
- package/dist/src/components/custom-components/rotor-vue/index.vue.d.ts +50 -0
- package/dist/src/components/custom-components/sys-button-vue/index.vue.d.ts +35 -0
- package/dist/src/components/custom-components/text-vue/index.vue.d.ts +50 -0
- package/dist/src/components/custom-components/topcover-vue/index.vue.d.ts +59 -0
- package/dist/src/components/mt-dzr/components/render-item.vue.d.ts +9 -0
- package/dist/src/components/mt-dzr/components/resize-handle.vue.d.ts +49 -0
- package/dist/src/components/mt-dzr/components/rotate-handle.vue.d.ts +34 -0
- package/dist/src/components/mt-dzr/composables/mouse.d.ts +0 -0
- package/dist/src/components/mt-dzr/index.d.ts +3 -0
- package/dist/src/components/mt-dzr/index.vue.d.ts +123 -0
- package/dist/src/components/mt-dzr/store/index.d.ts +3 -0
- package/dist/src/components/mt-dzr/store/types.d.ts +13 -0
- package/dist/src/components/mt-dzr/types.d.ts +31 -0
- package/dist/src/components/mt-dzr/utils/index.d.ts +84 -0
- package/dist/src/components/mt-dzr/utils/types.d.ts +1 -0
- package/dist/src/components/mt-edit/ace-edit.d.ts +1 -0
- package/dist/src/components/mt-edit/components/canvas-ruler/index.vue.d.ts +37 -0
- package/dist/src/components/mt-edit/components/context-menu/index.vue.d.ts +29 -0
- package/dist/src/components/mt-edit/components/custom-svg-render/index.vue.d.ts +2 -0
- package/dist/src/components/mt-edit/components/done-tree/index.vue.d.ts +31 -0
- package/dist/src/components/mt-edit/components/drag-canvas/index.vue.d.ts +40 -0
- package/dist/src/components/mt-edit/components/draw-line-render/index.vue.d.ts +44 -0
- package/dist/src/components/mt-edit/components/export-json/index.vue.d.ts +26 -0
- package/dist/src/components/mt-edit/components/group-render/index.vue.d.ts +27 -0
- package/dist/src/components/mt-edit/components/import-json/index.vue.d.ts +4 -0
- package/dist/src/components/mt-edit/components/layout/header-panel/index.vue.d.ts +92 -0
- package/dist/src/components/mt-edit/components/layout/left-aside/index.vue.d.ts +30 -0
- package/dist/src/components/mt-edit/components/layout/main-panel/index.vue.d.ts +39 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/index.vue.d.ts +11 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/json-edit.vue.d.ts +18 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/page-setting.vue.d.ts +31 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-animate-setting/common-animate.vue.d.ts +18 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-animate-setting/index.vue.d.ts +28 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-event-setting/index.vue.d.ts +35 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-event-setting/input-target-value.vue.d.ts +28 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-props-setting.vue.d.ts +24 -0
- package/dist/src/components/mt-edit/components/layout/right-aside/select-item-setting.vue.d.ts +31 -0
- package/dist/src/components/mt-edit/components/line-render/index.vue.d.ts +44 -0
- package/dist/src/components/mt-edit/components/pattern-grid/index.vue.d.ts +32 -0
- package/dist/src/components/mt-edit/components/render-core/index.vue.d.ts +78 -0
- package/dist/src/components/mt-edit/components/render-core/types.d.ts +9 -0
- package/dist/src/components/mt-edit/components/render-item/index.vue.d.ts +47 -0
- package/dist/src/components/mt-edit/components/selected-area/index.vue.d.ts +40 -0
- package/dist/src/components/mt-edit/components/selected-area/types.d.ts +6 -0
- package/dist/src/components/mt-edit/components/svg-analysis/index.vue.d.ts +22 -0
- package/dist/src/components/mt-edit/components/svg-render/index.vue.d.ts +28 -0
- package/dist/src/components/mt-edit/components/types.d.ts +13 -0
- package/dist/src/components/mt-edit/composables/index.d.ts +11 -0
- package/dist/src/components/mt-edit/composables/sys-line.d.ts +18 -0
- package/dist/src/components/mt-edit/composables/thumbnail.d.ts +1 -0
- package/dist/src/components/mt-edit/index.d.ts +3 -0
- package/dist/src/components/mt-edit/index.vue.d.ts +65 -0
- package/dist/src/components/mt-edit/store/cache.d.ts +3 -0
- package/dist/src/components/mt-edit/store/config.d.ts +3 -0
- package/dist/src/components/mt-edit/store/context-menu.d.ts +3 -0
- package/dist/src/components/mt-edit/store/global.d.ts +3 -0
- package/dist/src/components/mt-edit/store/left-aside.d.ts +3 -0
- package/dist/src/components/mt-edit/store/types.d.ts +238 -0
- package/dist/src/components/mt-edit/utils/index.d.ts +206 -0
- package/dist/src/components/mt-preview/index.d.ts +3 -0
- package/dist/src/components/mt-preview/index.vue.d.ts +51 -0
- package/dist/src/export.d.ts +6 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/router/index.d.ts +11 -0
- package/dist/style.css +7 -0
- package/dist/svgs/demo.svg +21 -0
- package/dist/svgs/my-button.svg +1 -0
- package/dist/svgs/my-input.svg +5 -0
- package/dist/svgs/pie-charts.svg +1 -0
- package/dist/svgs/rotor.svg +4 -0
- package/dist/svgs/rotor1.svg +10 -0
- package/package.json +71 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { IExportJson } from './components/types';
|
|
2
|
+
|
|
3
|
+
type MtEditProps = {
|
|
4
|
+
useThumbnail?: boolean;
|
|
5
|
+
sopId?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MtEditProps>, {
|
|
8
|
+
useThumbnail: boolean;
|
|
9
|
+
}>>, {
|
|
10
|
+
setImportJson: (exportJson: IExportJson) => boolean;
|
|
11
|
+
save: () => IExportJson;
|
|
12
|
+
lockCanvas: () => void;
|
|
13
|
+
unlockCanvas: () => void;
|
|
14
|
+
toggleLock: () => void;
|
|
15
|
+
getAllElementIds: () => string[];
|
|
16
|
+
saveSopSnapshot: (sopId?: string | undefined) => void;
|
|
17
|
+
applySopSnapshot: (sopId: string) => boolean;
|
|
18
|
+
hasSopSnapshot: (sopId: string) => boolean;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
onPreviewClick: (...args: any[]) => void;
|
|
21
|
+
onReturnClick: (...args: any[]) => void;
|
|
22
|
+
onSaveClick: (...args: any[]) => void;
|
|
23
|
+
onThumbnailClick: (...args: any[]) => void;
|
|
24
|
+
onCanvasBgClick: (...args: any[]) => void;
|
|
25
|
+
onFullscreenToggle: (...args: any[]) => void;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MtEditProps>, {
|
|
27
|
+
useThumbnail: boolean;
|
|
28
|
+
}>>> & Readonly<{
|
|
29
|
+
onOnPreviewClick?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
onOnReturnClick?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
onOnSaveClick?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
onOnThumbnailClick?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
onOnCanvasBgClick?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
onOnFullscreenToggle?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
useThumbnail: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
38
|
+
bottomPanel?(_: {}): any;
|
|
39
|
+
deviceBind?(_: {
|
|
40
|
+
item: any;
|
|
41
|
+
}): any;
|
|
42
|
+
}>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
45
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
47
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
48
|
+
} : {
|
|
49
|
+
type: import('vue').PropType<T[K]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type __VLS_WithDefaults<P, D> = {
|
|
54
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
55
|
+
default: D[K];
|
|
56
|
+
}> : P[K];
|
|
57
|
+
};
|
|
58
|
+
type __VLS_Prettify<T> = {
|
|
59
|
+
[K in keyof T]: T[K];
|
|
60
|
+
} & {};
|
|
61
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
export type ILeftAsideConfig = Map<string, ILeftAsideConfigItem[]>;
|
|
2
|
+
export type ILeftAsideConfigItemPublicPropsType = 'input' | 'color' | 'select' | 'switch' | 'number' | 'jsonEdit' | 'textArea';
|
|
3
|
+
export type ILeftAsideConfigItemPublicProps = Record<string, {
|
|
4
|
+
title: string;
|
|
5
|
+
type: ILeftAsideConfigItemPublicPropsType;
|
|
6
|
+
val: any;
|
|
7
|
+
options?: any;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type ILeftAsideConfigItemPublicType = 'svg' | 'vue' | 'img' | 'custom-svg';
|
|
11
|
+
export type ILeftAsideConfigItemPrivateType = 'group' | 'sys-line';
|
|
12
|
+
export interface ILeftAsideConfigItemPublic {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
type: ILeftAsideConfigItemPublicType | ILeftAsideConfigItemPrivateType;
|
|
16
|
+
thumbnail: string;
|
|
17
|
+
svg?: string;
|
|
18
|
+
props: ILeftAsideConfigItemPublicProps;
|
|
19
|
+
}
|
|
20
|
+
export interface ILeftAsideConfigItemPrivateSymbol {
|
|
21
|
+
symbol_id: string;
|
|
22
|
+
symbol_str: string;
|
|
23
|
+
width: string;
|
|
24
|
+
height: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ICommonAnimations {
|
|
27
|
+
val: string;
|
|
28
|
+
delay: string;
|
|
29
|
+
speed: string;
|
|
30
|
+
repeat: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ILeftAsideConfigItemPrivate {
|
|
33
|
+
symbol?: ILeftAsideConfigItemPrivateSymbol;
|
|
34
|
+
common_animations: ICommonAnimations;
|
|
35
|
+
}
|
|
36
|
+
export type ILeftAsideConfigItem = ILeftAsideConfigItemPublic & ILeftAsideConfigItemPrivate;
|
|
37
|
+
export type GlobalStoreIntention = 'none' | 'create' | 'beginMulSelect' | 'adsorbStart' | 'adsorbEnd' | 'beginDragCanvas' | 'runDragCanvas' | 'endDragCanvas' | 'showContextMenu' | 'drawSysLineStart';
|
|
38
|
+
export interface IGlobalStoreCreateItemInfo {
|
|
39
|
+
config_key: string;
|
|
40
|
+
item_id: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IGlobalStoreCanvasCfg {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
scale: number;
|
|
46
|
+
color: string;
|
|
47
|
+
img: string;
|
|
48
|
+
guide: boolean;
|
|
49
|
+
adsorp: boolean;
|
|
50
|
+
adsorp_diff: number;
|
|
51
|
+
transform_origin: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
drag_offset: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface IGlobalStoreGridCfg {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
align: boolean;
|
|
63
|
+
size: number;
|
|
64
|
+
}
|
|
65
|
+
export type DoneJsonEventListType = 'click' | 'dblclick' | 'mouseover' | 'mouseout';
|
|
66
|
+
export type DoneJsonEventListAction = 'changeAttr' | 'customCode';
|
|
67
|
+
export interface IDoneJsonActionChangeAttr {
|
|
68
|
+
id: string;
|
|
69
|
+
target_id: string;
|
|
70
|
+
target_attr: string | undefined;
|
|
71
|
+
target_value: any;
|
|
72
|
+
}
|
|
73
|
+
export interface IDoneJsonEventList {
|
|
74
|
+
id: string;
|
|
75
|
+
type: DoneJsonEventListType;
|
|
76
|
+
action: DoneJsonEventListAction;
|
|
77
|
+
change_attr: IDoneJsonActionChangeAttr[];
|
|
78
|
+
custom_code: string;
|
|
79
|
+
trigger_rule: {
|
|
80
|
+
trigger_id?: string;
|
|
81
|
+
trigger_attr?: string;
|
|
82
|
+
operator?: string;
|
|
83
|
+
value?: any;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export interface IDoneJson {
|
|
87
|
+
id: string;
|
|
88
|
+
title: string;
|
|
89
|
+
type: ILeftAsideConfigItemPublicType | ILeftAsideConfigItemPrivateType;
|
|
90
|
+
symbol?: ILeftAsideConfigItemPrivateSymbol;
|
|
91
|
+
binfo: IDoneJsonBinfo;
|
|
92
|
+
props: ILeftAsideConfigItemPublicProps;
|
|
93
|
+
resize: boolean;
|
|
94
|
+
rotate: boolean;
|
|
95
|
+
lock: boolean;
|
|
96
|
+
active: boolean;
|
|
97
|
+
hide: boolean;
|
|
98
|
+
common_animations: ICommonAnimations;
|
|
99
|
+
use_proportional_scaling?: boolean;
|
|
100
|
+
children?: IDoneJson[];
|
|
101
|
+
tag?: string;
|
|
102
|
+
thumbnail?: string;
|
|
103
|
+
events: IDoneJsonEventList[];
|
|
104
|
+
sopId?: string;
|
|
105
|
+
isDelete?: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface IDoneJsonBinfo {
|
|
108
|
+
left: number;
|
|
109
|
+
top: number;
|
|
110
|
+
width: number;
|
|
111
|
+
height: number;
|
|
112
|
+
angle: number;
|
|
113
|
+
}
|
|
114
|
+
export interface ISopSnapshotItem {
|
|
115
|
+
id: string;
|
|
116
|
+
title: string;
|
|
117
|
+
type: ILeftAsideConfigItemPublicType | ILeftAsideConfigItemPrivateType;
|
|
118
|
+
symbol?: ILeftAsideConfigItemPrivateSymbol;
|
|
119
|
+
binfo: IDoneJsonBinfo;
|
|
120
|
+
props: ILeftAsideConfigItemPublicProps;
|
|
121
|
+
resize: boolean;
|
|
122
|
+
rotate: boolean;
|
|
123
|
+
lock: boolean;
|
|
124
|
+
active: boolean;
|
|
125
|
+
hide: boolean;
|
|
126
|
+
common_animations: ICommonAnimations;
|
|
127
|
+
use_proportional_scaling?: boolean;
|
|
128
|
+
children?: ISopSnapshotItem[];
|
|
129
|
+
tag?: string;
|
|
130
|
+
thumbnail?: string;
|
|
131
|
+
events: IDoneJsonEventList[];
|
|
132
|
+
sopId?: string;
|
|
133
|
+
isDelete?: boolean;
|
|
134
|
+
}
|
|
135
|
+
export interface ISopSnapshot {
|
|
136
|
+
[sopId: string]: ISopSnapshotItem[];
|
|
137
|
+
}
|
|
138
|
+
export interface CacheBoundingBox {
|
|
139
|
+
id: string;
|
|
140
|
+
type: ILeftAsideConfigItemPublicType | ILeftAsideConfigItemPrivateType;
|
|
141
|
+
left: number;
|
|
142
|
+
top: number;
|
|
143
|
+
width: number;
|
|
144
|
+
height: number;
|
|
145
|
+
bottom: number;
|
|
146
|
+
right: number;
|
|
147
|
+
}
|
|
148
|
+
export type AdsorbPointType = 'tc' | 'bc' | 'lc' | 'rc';
|
|
149
|
+
export interface IContextMenuInfo {
|
|
150
|
+
title: string;
|
|
151
|
+
hot_key: string;
|
|
152
|
+
enable: boolean;
|
|
153
|
+
}
|
|
154
|
+
export type ContextMenuInfoType = 'copy' | 'paste' | 'delete' | 'group' | 'ungroup' | 'selectAll' | 'moveTop' | 'moveUp' | 'moveDown' | 'moveBottom';
|
|
155
|
+
export interface IContextMenuDetail {
|
|
156
|
+
left: number;
|
|
157
|
+
top: number;
|
|
158
|
+
info: {
|
|
159
|
+
[key in ContextMenuInfoType]: IContextMenuInfo;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export interface IRealTimeData {
|
|
163
|
+
show: boolean;
|
|
164
|
+
text: string;
|
|
165
|
+
}
|
|
166
|
+
export interface IGlobalStore {
|
|
167
|
+
intention: GlobalStoreIntention;
|
|
168
|
+
create_item_info: IGlobalStoreCreateItemInfo | null;
|
|
169
|
+
done_json: IDoneJson[];
|
|
170
|
+
selected_items_id: string[];
|
|
171
|
+
canvasCfg: IGlobalStoreCanvasCfg;
|
|
172
|
+
gridCfg: IGlobalStoreGridCfg;
|
|
173
|
+
guideCfg: {
|
|
174
|
+
x: {
|
|
175
|
+
display: boolean;
|
|
176
|
+
top: number;
|
|
177
|
+
};
|
|
178
|
+
y: {
|
|
179
|
+
display: boolean;
|
|
180
|
+
left: number;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
lock: boolean;
|
|
184
|
+
real_time_data: IRealTimeData;
|
|
185
|
+
adsorp_diff: {
|
|
186
|
+
x: number;
|
|
187
|
+
y: number;
|
|
188
|
+
};
|
|
189
|
+
sopSnapshot: ISopSnapshot;
|
|
190
|
+
setIntention: (val: GlobalStoreIntention) => void;
|
|
191
|
+
setCreateItemInfo: (val: IGlobalStoreCreateItemInfo | null) => void;
|
|
192
|
+
setGlobalStoreDoneJson: (val: IDoneJson[]) => void;
|
|
193
|
+
cancelAllSelect: () => void;
|
|
194
|
+
refreshSelectedItemsId: () => void;
|
|
195
|
+
deleteSelectedItems: () => void;
|
|
196
|
+
softDeleteSelectedItems: () => void;
|
|
197
|
+
restoreItems: (itemIds: string[]) => void;
|
|
198
|
+
setSingleSelect: (id: string) => void;
|
|
199
|
+
setSelectItems: (ids: string[]) => void;
|
|
200
|
+
setRealTimeData: (val: IRealTimeData) => void;
|
|
201
|
+
}
|
|
202
|
+
export interface ILeftAside {
|
|
203
|
+
config: ILeftAsideConfig;
|
|
204
|
+
registerConfig: (title: string, config: ILeftAsideConfigItemPublic[]) => void;
|
|
205
|
+
}
|
|
206
|
+
export interface ICache {
|
|
207
|
+
boundingBox: CacheBoundingBox[];
|
|
208
|
+
setBoundingBox: (val: CacheBoundingBox[]) => void;
|
|
209
|
+
adsorbPoint: {
|
|
210
|
+
type: AdsorbPointType;
|
|
211
|
+
x: number;
|
|
212
|
+
y: number;
|
|
213
|
+
id: string;
|
|
214
|
+
}[];
|
|
215
|
+
setAdsorbPoint: (val: {
|
|
216
|
+
type: AdsorbPointType;
|
|
217
|
+
x: number;
|
|
218
|
+
y: number;
|
|
219
|
+
id: string;
|
|
220
|
+
}[]) => void;
|
|
221
|
+
copy: IDoneJson[];
|
|
222
|
+
setCopy: (val: IDoneJson[]) => void;
|
|
223
|
+
history: IDoneJson[][];
|
|
224
|
+
historyIndex: number;
|
|
225
|
+
addHistory: (done_json: IDoneJson[]) => void;
|
|
226
|
+
}
|
|
227
|
+
export interface IConfig {
|
|
228
|
+
sysComponent: ILeftAsideConfigItem[];
|
|
229
|
+
lineRenderOffset: number;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* 右键菜单
|
|
233
|
+
*/
|
|
234
|
+
export interface IContextMenu {
|
|
235
|
+
menuInfo: IContextMenuDetail;
|
|
236
|
+
setMenuInfo: (val: IContextMenuDetail) => void;
|
|
237
|
+
setDisplayItem: (val: ContextMenuInfoType[]) => void;
|
|
238
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { MoveItemBoundingInfo } from '../components/render-core/types';
|
|
2
|
+
import { CacheBoundingBox, IDoneJson, IDoneJsonBinfo, ILeftAsideConfigItemPublicProps } from '../store/types';
|
|
3
|
+
|
|
4
|
+
export declare const createGroupInfo: (selected_items: IDoneJson[], canvas_dom: HTMLElement, scale_ratio: number, sopId?: string) => IDoneJson;
|
|
5
|
+
/**
|
|
6
|
+
* 取消组合
|
|
7
|
+
* @param elements 元素列表
|
|
8
|
+
* @param editorRect 画布react信息
|
|
9
|
+
* @returns 拆分后的列表
|
|
10
|
+
*/
|
|
11
|
+
export declare const cancelGroup: (selected_item: IDoneJson, canvas_dom: HTMLElement, scale_ratio: number, grid_align_size: number) => {
|
|
12
|
+
active: boolean;
|
|
13
|
+
binfo: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
left: number;
|
|
17
|
+
top: number;
|
|
18
|
+
angle: number;
|
|
19
|
+
};
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
type: import('../store/types').ILeftAsideConfigItemPublicType | import('../store/types').ILeftAsideConfigItemPrivateType;
|
|
23
|
+
symbol?: import('../store/types').ILeftAsideConfigItemPrivateSymbol | undefined;
|
|
24
|
+
props: ILeftAsideConfigItemPublicProps;
|
|
25
|
+
resize: boolean;
|
|
26
|
+
rotate: boolean;
|
|
27
|
+
lock: boolean;
|
|
28
|
+
hide: boolean;
|
|
29
|
+
common_animations: import('../store/types').ICommonAnimations;
|
|
30
|
+
use_proportional_scaling?: boolean | undefined;
|
|
31
|
+
children?: IDoneJson[] | undefined;
|
|
32
|
+
tag?: string | undefined;
|
|
33
|
+
thumbnail?: string | undefined;
|
|
34
|
+
events: import('../store/types').IDoneJsonEventList[];
|
|
35
|
+
sopId?: string | undefined;
|
|
36
|
+
isDelete?: boolean | undefined;
|
|
37
|
+
}[];
|
|
38
|
+
export declare const svgToSymbol: (svgStr: string, id: string) => {
|
|
39
|
+
symbol_str: string;
|
|
40
|
+
width: string;
|
|
41
|
+
height: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const symbolGenSvg: (symbol_id: string, symbol_str: string, width: string, height: string, props_str: string) => string;
|
|
44
|
+
export declare const svgToImgSrc: (svgStr: string) => string;
|
|
45
|
+
/**
|
|
46
|
+
* 生成dom可用的属性字符串
|
|
47
|
+
* @param props
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
export declare const genDomPropstr: (props: ILeftAsideConfigItemPublicProps) => string;
|
|
51
|
+
/**
|
|
52
|
+
* 生成随机字符串
|
|
53
|
+
* @param len 生成个数
|
|
54
|
+
*/
|
|
55
|
+
export declare const randomString: (len?: number) => string;
|
|
56
|
+
/**
|
|
57
|
+
* 获取当前点击坐标 根据pc端和移动端获取
|
|
58
|
+
* @param e
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
export declare function getRealityXY(e: DragEvent | TouchEvent | MouseEvent, canvas_dom_rect: DOMRect | undefined): {
|
|
62
|
+
realityX: number;
|
|
63
|
+
realityY: number;
|
|
64
|
+
};
|
|
65
|
+
export declare const blobToBase64: (file: Blob) => Promise<unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* 根据坐标对齐到网格
|
|
68
|
+
* @param position 当前坐标
|
|
69
|
+
* @param grid 网格大小
|
|
70
|
+
* @returns 对应网格的坐标
|
|
71
|
+
*/
|
|
72
|
+
export declare const alignToGrid: (position: number, grid?: number) => number;
|
|
73
|
+
/**
|
|
74
|
+
* json对象深拷贝
|
|
75
|
+
* @param object
|
|
76
|
+
* @param default_val
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
export declare const objectDeepClone: <T>(object: object, default_val?: any) => T;
|
|
80
|
+
export declare const prosToVBind: (item: ILeftAsideConfigItemPublicProps) => {};
|
|
81
|
+
/**
|
|
82
|
+
* 计算y轴参考线属性和需要吸附的偏移距离
|
|
83
|
+
* @param cacheStore_boundingBox
|
|
84
|
+
* @param adsorp_diff
|
|
85
|
+
* @param move_item_bounding_info
|
|
86
|
+
*/
|
|
87
|
+
export declare const calculateGuideY: (cacheStore_boundingBox: CacheBoundingBox[], adsorp_diff: number, move_item_bounding_info: MoveItemBoundingInfo[], canvas_bounding_info: DOMRect, scale: number) => {
|
|
88
|
+
y_info: {
|
|
89
|
+
display: boolean;
|
|
90
|
+
left: number;
|
|
91
|
+
};
|
|
92
|
+
move_x: number;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* 计算x轴参考线属性和需要吸附的偏移距离
|
|
96
|
+
* @param cacheStore_boundingBox
|
|
97
|
+
* @param adsorp_diff
|
|
98
|
+
* @param move_item_bounding_info
|
|
99
|
+
*/
|
|
100
|
+
export declare const calculateGuideX: (cacheStore_boundingBox: CacheBoundingBox[], adsorp_diff: number, move_item_bounding_info: MoveItemBoundingInfo[], canvas_bounding_info: DOMRect, scale: number) => {
|
|
101
|
+
x_info: {
|
|
102
|
+
display: boolean;
|
|
103
|
+
top: number;
|
|
104
|
+
};
|
|
105
|
+
move_y: number;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* 坐标数组转换成path路径
|
|
109
|
+
* @param position_arr
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
export declare const positionArrarToPath: (position_arr: {
|
|
113
|
+
x: number;
|
|
114
|
+
y: number;
|
|
115
|
+
}[], offset_x?: number, offset_y?: number) => string;
|
|
116
|
+
/**
|
|
117
|
+
* 取两点之间坐标
|
|
118
|
+
* @param x1
|
|
119
|
+
* @param y1
|
|
120
|
+
* @param x2
|
|
121
|
+
* @param y2
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
export declare const getCenterXY: (x1: number, y1: number, x2: number, y2: number) => {
|
|
125
|
+
x: number;
|
|
126
|
+
y: number;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* 计算旋转之后的坐标
|
|
130
|
+
* @param x 旋转之前x坐标
|
|
131
|
+
* @param y 旋转之前y坐标
|
|
132
|
+
* @param centerX 旋转中心x坐标
|
|
133
|
+
* @param centerY 旋转中心y坐标
|
|
134
|
+
* @param angleRad 旋转角度
|
|
135
|
+
* @returns 旋转之后的xy坐标
|
|
136
|
+
*/
|
|
137
|
+
export declare const rotatePoint: (x: number, y: number, centerX: number, centerY: number, angleRad: number) => {
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
};
|
|
141
|
+
export declare const getRectCoordinate: (item: IDoneJsonBinfo) => {
|
|
142
|
+
topLeft: {
|
|
143
|
+
x: number;
|
|
144
|
+
y: number;
|
|
145
|
+
};
|
|
146
|
+
topRight: {
|
|
147
|
+
x: number;
|
|
148
|
+
y: number;
|
|
149
|
+
};
|
|
150
|
+
bottomLeft: {
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
};
|
|
154
|
+
bottomRight: {
|
|
155
|
+
x: number;
|
|
156
|
+
y: number;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
export declare const getRectCenterCoordinate: (topLeft: {
|
|
160
|
+
x: any;
|
|
161
|
+
y: any;
|
|
162
|
+
}, topRight: {
|
|
163
|
+
x: any;
|
|
164
|
+
y: any;
|
|
165
|
+
}, bottomLeft: {
|
|
166
|
+
x: any;
|
|
167
|
+
y: any;
|
|
168
|
+
}, bottomRight: {
|
|
169
|
+
x: any;
|
|
170
|
+
y: any;
|
|
171
|
+
}) => {
|
|
172
|
+
topCenter: {
|
|
173
|
+
x: number;
|
|
174
|
+
y: number;
|
|
175
|
+
};
|
|
176
|
+
bottomCenter: {
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
};
|
|
180
|
+
leftCenter: {
|
|
181
|
+
x: number;
|
|
182
|
+
y: number;
|
|
183
|
+
};
|
|
184
|
+
rightCenter: {
|
|
185
|
+
x: number;
|
|
186
|
+
y: number;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
export declare const handleAlign: (type: 'left' | 'horizontally' | 'right' | 'top' | 'vertically' | 'bottom' | 'horizontal-distribution' | 'vertical-distribution', selected_done_json: IDoneJson[], canvasDom: HTMLElement, scale: number, global_done_json: IDoneJson[]) => IDoneJson[];
|
|
190
|
+
/**
|
|
191
|
+
* 设置图形属性
|
|
192
|
+
* @param id
|
|
193
|
+
* @param key
|
|
194
|
+
* @param val
|
|
195
|
+
* @param json_arr
|
|
196
|
+
* @returns
|
|
197
|
+
*/
|
|
198
|
+
export declare const setItemAttr: (id: string, key: string, val: any, json_arr: IDoneJson[]) => Promise<unknown>;
|
|
199
|
+
export declare const getItemAttr: (id: string, key: string, json_arr: IDoneJson[]) => any;
|
|
200
|
+
export declare const previewCompareVal: (val1: any, operator: '>' | '<' | '=' | '!=', val2: any) => boolean;
|
|
201
|
+
/**
|
|
202
|
+
* 将事件转换成v-on
|
|
203
|
+
* @param item
|
|
204
|
+
* @returns
|
|
205
|
+
*/
|
|
206
|
+
export declare const eventToVOn: (item: IDoneJson) => {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IExportJson } from '../mt-edit/components/types';
|
|
2
|
+
|
|
3
|
+
type MtPreviewProps = {
|
|
4
|
+
exportJson?: IExportJson;
|
|
5
|
+
canZoom?: boolean;
|
|
6
|
+
canDrag?: boolean;
|
|
7
|
+
showPopover?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MtPreviewProps>, {
|
|
10
|
+
canDrag: boolean;
|
|
11
|
+
canZoom: boolean;
|
|
12
|
+
showPopover: boolean;
|
|
13
|
+
}>>, {
|
|
14
|
+
setItemAttrByID: (id: string, key: string, val: any) => Promise<unknown>;
|
|
15
|
+
setImportJson: (exportJson: IExportJson) => boolean;
|
|
16
|
+
setItemAttrs: (info: {
|
|
17
|
+
id: string;
|
|
18
|
+
key: string;
|
|
19
|
+
val: any;
|
|
20
|
+
}[]) => void;
|
|
21
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
onEventCallBack: (...args: any[]) => void;
|
|
23
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MtPreviewProps>, {
|
|
24
|
+
canDrag: boolean;
|
|
25
|
+
canZoom: boolean;
|
|
26
|
+
showPopover: boolean;
|
|
27
|
+
}>>> & Readonly<{
|
|
28
|
+
onOnEventCallBack?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
showPopover: boolean;
|
|
31
|
+
canZoom: boolean;
|
|
32
|
+
canDrag: boolean;
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
36
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
37
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
38
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
39
|
+
} : {
|
|
40
|
+
type: import('vue').PropType<T[K]>;
|
|
41
|
+
required: true;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type __VLS_WithDefaults<P, D> = {
|
|
45
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
46
|
+
default: D[K];
|
|
47
|
+
}> : P[K];
|
|
48
|
+
};
|
|
49
|
+
type __VLS_Prettify<T> = {
|
|
50
|
+
[K in keyof T]: T[K];
|
|
51
|
+
} & {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as MtDzr } from './components/mt-dzr';
|
|
2
|
+
import { default as MtEdit } from './components/mt-edit';
|
|
3
|
+
import { default as MtPreview } from './components/mt-preview';
|
|
4
|
+
import { leftAsideStore } from './components/mt-edit/store/left-aside';
|
|
5
|
+
|
|
6
|
+
export { MtDzr, MtEdit, MtPreview, leftAsideStore };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const constantRoutes: ({
|
|
2
|
+
path: string;
|
|
3
|
+
component: () => Promise<typeof import("../views/edit/index.vue")>;
|
|
4
|
+
name?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
component: () => Promise<typeof import("../views/edit/index.vue")>;
|
|
9
|
+
})[];
|
|
10
|
+
declare const router: import('vue-router').Router;
|
|
11
|
+
export default router;
|