|
@@ -49,12 +49,13 @@ export default {
|
|
|
details: [
|
|
|
{
|
|
|
name: '发起人',
|
|
|
- id: '1',
|
|
|
+ id: String(+new Date()),
|
|
|
type: 1,
|
|
|
sortNum: 1,
|
|
|
y: 100,
|
|
|
x: 500,
|
|
|
children: [],
|
|
|
+ parentIds: [],
|
|
|
},
|
|
|
],
|
|
|
}
|
|
@@ -190,6 +191,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
val.source.__vue__.detail.children.push(val.target.__vue__.detail.id)
|
|
|
+ val.target.__vue__.detail.parentIds.push(val.source.__vue__.detail.id)
|
|
|
})
|
|
|
// 删除连接
|
|
|
this.instance.bind(EVENT_CONNECTION_DBL_CLICK, (conn) => {
|
|
@@ -200,6 +202,10 @@ export default {
|
|
|
conn.source.__vue__.detail.children.indexOf(conn.target.__vue__.detail.id),
|
|
|
1
|
|
|
)
|
|
|
+ conn.target.__vue__.detail.parentIds.splice(
|
|
|
+ conn.target.__vue__.detail.parentIds.indexOf(conn.source.__vue__.detail.id),
|
|
|
+ 1
|
|
|
+ )
|
|
|
that.instance.deleteConnection(conn)
|
|
|
},
|
|
|
})
|
|
@@ -229,6 +235,7 @@ export default {
|
|
|
titleColumnCode: '',
|
|
|
handleNameId: '',
|
|
|
sortNum: record.sortNum++,
|
|
|
+ parentIds: [record.id],
|
|
|
}
|
|
|
if (record.children.length > 0) {
|
|
|
const children = this.details
|
|
@@ -278,6 +285,7 @@ export default {
|
|
|
this.instance.unmanage(document.getElementById(record.id))
|
|
|
this.details = this.details.filter((item) => {
|
|
|
item.children = item.children.filter((child) => child !== record.id)
|
|
|
+ item.parentIds = item.parentIds.filter((child) => child !== record.id)
|
|
|
return item.id !== record.id
|
|
|
})
|
|
|
},
|
|
@@ -313,7 +321,7 @@ export default {
|
|
|
this.details = [
|
|
|
{
|
|
|
name: '发起人',
|
|
|
- id: '1',
|
|
|
+ id: String(+new Date()),
|
|
|
type: 1,
|
|
|
sortNum: 1,
|
|
|
y: 100,
|