File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
web/packages/workflows/module/process Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -963,11 +963,43 @@ export default {
963
963
change (obj ) {
964
964
this .json = obj;
965
965
this .changeNum ++
966
- if (this .changeNum > 2 ) {
966
+ const change = this .checkChange (obj)
967
+ this .lastObj = JSON .parse (JSON .stringify (obj))
968
+ if (this .changeNum > 2 && change) {
967
969
this .heartBeat ();
968
970
this .jsonChange = true ;
969
971
}
970
972
},
973
+ checkChange (obj ) {
974
+ // 剔除单击节点选中导致的change
975
+ const helpFn = function (obj = {}) {
976
+ const temp = { nodes: [], edges: [] }
977
+ if (obj .nodes ) {
978
+ obj .nodes .forEach (item => {
979
+ const nodeItem = {}
980
+ Object .keys (item).forEach (k => {
981
+ if (k !== ' selected' ) {
982
+ nodeItem[k] = item[k]
983
+ }
984
+ })
985
+ temp .nodes .push (nodeItem)
986
+ })
987
+ }
988
+ if (obj .edges ) {
989
+ obj .edges .forEach (item => {
990
+ const link = {}
991
+ Object .keys (item).forEach (k => {
992
+ if (k !== ' selected' ) {
993
+ link[k] = item[k]
994
+ }
995
+ })
996
+ temp .edges .push (link)
997
+ })
998
+ }
999
+ return JSON .stringify (temp)
1000
+ }
1001
+ return helpFn (obj) !== helpFn (this .lastObj )
1002
+ },
971
1003
initNode (arg ) {
972
1004
if (this .clickCurrentNode .id === arg .id ) return ; // 多出点击时,避免数据初始化
973
1005
arg = this .bindNodeBasicInfo (arg);
You can’t perform that action at this time.
0 commit comments