wangyanshen
2023-01-09 695c5a332e4bf10b6b93c9973e1634730b4a60df
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import FlowGraph from "../../../graph";
import Store from '@/store/index'
 
export function nodeOpt(id){
    let curCel = null;
    if (id) {
        const { graph } = FlowGraph
        const cell = graph.getCellById(id)
        if (!cell || !cell.isNode()) {
            return
        }
        curCel = cell
        Store.commit('flow/updatenodeStroke', cell.attr('body/stroke'))
        Store.commit('flow/updatenodeStrokeWidth', cell.attr('body/strokeWidth'))
        Store.commit('flow/updatenodeFill', cell.attr('body/fill'))
        Store.commit('flow/updatenodeFontSize', cell.attr('text/fontSize'))
        Store.commit('flow/updatenodeColor', cell.attr('text/fill'))
        Store.commit('flow/updateportId', '')
    }
    return curCel;
}