Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vue-flow-editor
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
2023-12-01 17:13:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5e8e98d2bbb09d6683cfbd6838b31bee0426af76
5e8e98d2
1 parent
365b468a
优化:根据节点不同类型,连接线颜色调整
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
2 deletions
doc/data.js
src/behavior/drag-edge.ts
src/shape/edge.ts
src/shape/edge1.ts
src/shape/index.ts
src/utils/styles.ts
doc/data.js
View file @
5e8e98d
/*
* @Date: 2023-10-27 09:29:48
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-1
1-23 17:55:22
* @LastEditTime: 2023-1
2-01 16:47:11
* @FilePath: /vue-flow-editor/doc/data.js
* @Description: 初始化结构,数据都是固定的
*/
...
...
src/behavior/drag-edge.ts
View file @
5e8e98d
...
...
@@ -131,11 +131,16 @@ export function dragEdge(G6, option: OptionType) {
if
(
this
.
origin
.
targetNode
)
{
const
addModel
=
{
class
:
'flow'
,
shape
:
"flow-polyline-round1"
,
source
:
this
.
origin
.
sourceNode
.
get
(
'id'
),
target
:
this
.
origin
.
targetNode
.
get
(
'id'
),
sourceAnchor
:
this
.
origin
.
sourceAnchor
,
targetAnchor
:
this
.
origin
.
targetAnchor
,
}
// TAG: 修改连接线颜色 开始出去的线和连接到抄送节点的颜色是灰色
if
(
this
.
origin
.
sourceNode
.
get
(
'id'
)
===
'start-node'
||
this
.
origin
.
targetNode
.
get
(
'model'
).
control
===
'cc'
)
{
addModel
.
shape
=
'flow-polyline-round'
}
if
(
this
.
graph
.
executeCommand
)
{
this
.
graph
.
executeCommand
(
'add'
,
{
type
:
'edge'
,
...
...
src/shape/edge.ts
View file @
5e8e98d
src/shape/edge1.ts
0 → 100644
View file @
5e8e98d
This diff is collapsed. Click to expand it.
src/shape/index.ts
View file @
5e8e98d
/*
* @Date: 2023-10-27 09:29:59
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-1
1-14 11:17:2
0
* @LastEditTime: 2023-1
2-01 17:11:3
0
* @FilePath: /vue-flow-editor/src/shape/index.ts
* @Description: 文件描述
*/
import
{
registerAnchor
}
from
"@/shape/anchor"
;
import
{
registerEdge
}
from
"@/shape/edge"
;
import
{
registerEdge1
}
from
"@/shape/edge1"
;
// TAG:新增一条彩色的连接线
// TAG: 自定义节点 - 引入节点
import
{
registerActivity
}
from
"@/shape/activity"
;
import
{
registerControl
}
from
"@/shape/control"
;
...
...
@@ -14,6 +15,7 @@ import {registerControl} from "@/shape/control";
export
function
registerShape
(
G6
)
{
registerAnchor
(
G6
)
registerEdge
(
G6
)
registerEdge1
(
G6
)
registerActivity
(
G6
)
registerControl
(
G6
)
}
...
...
src/utils/styles.ts
View file @
5e8e98d
...
...
@@ -83,6 +83,15 @@ export const GraphStyle = {
cursor
:
'pointer'
,
},
},
defaultEdge1
:
{
// TAG:新增彩色连接线
shape
:
'flow-polyline-round1'
,
style
:
{
stroke
:
'#CB7FE3'
,
lineWidth
:
1
,
lineAppendWidth
:
10
,
cursor
:
'pointer'
,
},
},
defaultNode
:
{
shape
:
'rect'
,
size
:
[
120
,
40
],
...
...
Please
register
or
login
to post a comment