Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
logic-flow2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-03-17 11:23:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
04436ba9b973ebb34bc3dc9ffb13df5e9b6c163b
04436ba9
1 parent
f2337f79
fix
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
.nvmrc
package.json
src/views/api/graphModel.vue
.nvmrc
deleted
100644 → 0
View file @
f2337f7
v18.13
package.json
View file @
04436ba
...
...
@@ -3,9 +3,6 @@
"private"
:
true
,
"version"
:
"0.0.0"
,
"type"
:
"module"
,
"engines"
:
{
"node"
:
"18.13.x"
},
"scripts"
:
{
"dev"
:
"vite"
,
"build"
:
"vite build"
,
...
...
src/views/api/graphModel.vue
View file @
04436ba
...
...
@@ -34,6 +34,14 @@ onMounted(() => {
console.log("文本更新为:", data.text);
});
// 添加节点移动规则
lf.graphModel.addNodeMoveRules((nodeModel, x, y) => {
if (nodeModel.properties.disabled) {
return false; // 禁止移动
}
return true; // 允许移动
});
// 渲染初始数据
lf.render({
nodes: [
...
...
@@ -50,6 +58,26 @@ onMounted(() => {
x: 200,
y: 200,
text: "点击编辑文本"
},
{
id: "node11",
type: "rect",
x: 300,
y: 300,
text: "可移动节点",
properties: {
disabled: false
}
},
{
id: "node21",
type: "custom-rect",
x: 400,
y: 400,
text: "禁止移动节点",
properties: {
disabled: true
}
}
]
});
...
...
Please
register
or
login
to post a comment