|
@@ -54,7 +54,7 @@ import { defineAsyncComponent, nextTick, onMounted, reactive, Ref, ref, unref, w
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import LogicFlow from '@logicflow/core';
|
|
|
import { Control, DndPanel, Group, InsertNodeInPolyline, Menu, MiniMap, SelectionSelect, Snapshot } from '@logicflow/extension';
|
|
|
-import '@logicflow/core/dist/style/index.css';
|
|
|
+import "@logicflow/core/lib/style/index.css";
|
|
|
import '@logicflow/extension/lib/style/index.css';
|
|
|
import { SnakerFlowAdapter, SnakerFlowElement } from './snakerflow/index';
|
|
|
import { NodeTypeEnum } from './enums';
|
|
@@ -146,6 +146,13 @@ const init = async () => {
|
|
|
LogicFlow.use(SnakerFlowElement);
|
|
|
LogicFlow.use(SnakerFlowAdapter);
|
|
|
const defaultConfig: any = {};
|
|
|
+ const miniMapOptions: MiniMap.MiniMapOption = {
|
|
|
+ isShowHeader: true,
|
|
|
+ isShowCloseIcon: true,
|
|
|
+ headerTitle: '导航',
|
|
|
+ // leftPosition: 100,
|
|
|
+ // topPosition: 100,
|
|
|
+ };
|
|
|
lfInstance.value = new LogicFlow({
|
|
|
container: unref(lfElRef),
|
|
|
stopScrollGraph: true, // 进禁止鼠标滚动移动画布
|
|
@@ -157,6 +164,12 @@ const init = async () => {
|
|
|
},
|
|
|
...props.config,
|
|
|
...defaultConfig,
|
|
|
+ pluginsOptions: {
|
|
|
+ miniMap: {
|
|
|
+ ...miniMapOptions,
|
|
|
+ showEdge:true,
|
|
|
+ },
|
|
|
+ },
|
|
|
});
|
|
|
// 初始化操作
|
|
|
initOp();
|
|
@@ -166,7 +179,7 @@ const init = async () => {
|
|
|
};
|
|
|
// 初始化操作
|
|
|
const initOp = () => {
|
|
|
- const lf = unref(lfInstance);
|
|
|
+ const lf:any = unref(lfInstance);
|
|
|
if (!lf) return;
|
|
|
if (props.viewer) {
|
|
|
// 预览模式时
|
|
@@ -222,8 +235,7 @@ const initOp = () => {
|
|
|
// );
|
|
|
// },
|
|
|
onClick: (lf: any, ev: any) => {
|
|
|
- const position = lf.getPointByClient(ev.x, ev.y);
|
|
|
- lf.extension.miniMap.show(position.domOverlayPosition.x - 120, position.domOverlayPosition.y + 35);
|
|
|
+ lf.extension.miniMap.show();
|
|
|
},
|
|
|
});
|
|
|
// 控制面板-暂存
|
|
@@ -352,6 +364,7 @@ const closePage = () => {
|
|
|
};
|
|
|
// 暂存(保存为草稿)
|
|
|
const saveOnly = throttle((formEl: FormInstance | undefined) => {
|
|
|
+ // lfInstance.value?.getSnapshot(); // 下载为图片
|
|
|
const lf = unref(lfInstance);
|
|
|
if (!lf) return;
|
|
|
if (!formEl) return;
|