Browse Source

reactor:更新包并且更新流程组件;

zhangchong 5 months ago
parent
commit
a3cb9530f5
3 changed files with 287 additions and 565 deletions
  1. 6 6
      package.json
  2. 17 4
      src/components/LogicFlow/index.vue
  3. 264 555
      yarn.lock

+ 6 - 6
package.json

@@ -18,8 +18,8 @@
 	"dependencies": {
 		"@amap/amap-jsapi-loader": "^1.0.1",
 		"@element-plus/icons-vue": "^2.0.10",
-		"@logicflow/core": "^1.1.31",
-		"@logicflow/extension": "^1.1.31",
+		"@logicflow/core": "^2.0.7",
+		"@logicflow/extension": "^2.0.11",
 		"@microsoft/signalr": "^7.0.0",
 		"@originjs/vite-plugin-commonjs": "^1.0.3",
 		"@vueuse/motion": "^2.0.0",
@@ -58,15 +58,15 @@
 		"@types/node": "^18.11.9",
 		"@types/nprogress": "^0.2.0",
 		"@types/qs": "^6.9.7",
-		"@typescript-eslint/eslint-plugin": "^5.44.0",
-		"@typescript-eslint/parser": "^5.44.0",
+		"@typescript-eslint/eslint-plugin": "^8.14.0",
+		"@typescript-eslint/parser": "^8.14.0",
 		"@vitejs/plugin-vue": "^4.4.0",
 		"@vitejs/plugin-vue-jsx": "^3.1.0",
 		"@vue/compiler-sfc": "^3.2.45",
 		"@vueuse/core": "^10.11.0",
 		"dotenv": "^16.0.3",
-		"eslint": "^8.28.0",
-		"eslint-plugin-vue": "^9.7.0",
+		"eslint": "^9.14.0",
+		"eslint-plugin-vue": "^9.31.0",
 		"prettier": "^2.8.0",
 		"sass": "^1.56.1",
 		"sass-loader": "^13.2.0",

+ 17 - 4
src/components/LogicFlow/index.vue

@@ -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;

File diff suppressed because it is too large
+ 264 - 555
yarn.lock


Some files were not shown because too many files changed in this diff