whyczyk
2021-11-01 d849610117b411385284b3fcf0e6bccd8acc1a03
流程图优化
1个文件已修改
112 ■■■■ 已修改文件
src/components/flowChart.vue 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/flowChart.vue
@@ -133,6 +133,48 @@
        }
    ]
]
const nodeMenuList = [
    [
        {
            label: '编辑',
            selected: (node, coordinate) => {
                this.drawerConf.open(drawerType.node, node)
            }
        }
    ],
    [
        {
            label: '删除',
            disable: false,
            hidden(node) {
                return node.meta.prop === 'start'
            },
            selected(node, coordinate) {
                node.remove()
            }
        }
    ],
]
const linkMenuList = [
    [
        {
            label: '编辑',
            disable: false,
            selected: (link, coordinate) => {
                this.drawerConf.open(drawerType.link, link)
            }
        }
    ],
    [
        {
            label: '删除',
            disable: false,
            selected: (link, coordinate) => {
                link.remove()
            }
        }
    ],
]
const taskStateMap = ['cc', 'approval', 'condition']
const actionTypeMap = ['派发', '分派', '转派', '平移']
export default {
@@ -200,48 +242,8 @@
            nodeList: [],
            linkList: [],
            graphMenuList: [],
            nodeMenuList: [
                [
                    {
                        label: '编辑',
                        selected: (node, coordinate) => {
                            this.drawerConf.open(drawerType.node, node)
                        }
                    }
                ],
                [
                    {
                        label: '删除',
                        disable: false,
                        hidden(node) {
                            return node.meta.prop === 'start'
                        },
                        selected(node, coordinate) {
                            node.remove()
                        }
                    }
                ],
            ],
            linkMenuList: [
                [
                    {
                        label: '编辑',
                        disable: false,
                        selected: (link, coordinate) => {
                            this.drawerConf.open(drawerType.link, link)
                        }
                    }
                ],
                [
                    {
                        label: '删除',
                        disable: false,
                        selected: (link, coordinate) => {
                            link.remove()
                        }
                    }
                ],
            ]
            nodeMenuList: [],
            linkMenuList: []
        }
    },
    created() {
@@ -250,8 +252,12 @@
        this.linkEditable = this.isEdit
        if (this.isEdit) {
            this.graphMenuList = graphMenuList
            this.nodeMenuList = nodeMenuList
            this.linkMenuList = linkMenuList
        } else {
            this.graphMenuList = []
            this.nodeMenuList = []
            this.linkMenuList = []
        }
        let resData = [{
@@ -283,6 +289,13 @@
            taskState: 0,//任务状态
            actionType: 1//动作类型
        }, {
            id: 5,//id
            parentId: 2,//父节点id  如果没有则为null
            title: "操作员",//标题
            desc: "赵某某",//具体信息
            taskState: 0,//任务状态
            actionType: 1//动作类型
        }, {
            id: 6,//id
            parentId: 2,//父节点id  如果没有则为null
            title: "蓄电池维护班组",//标题
@@ -290,8 +303,8 @@
            taskState: 1,//任务状态
            actionType: 2//动作类型
        }, {
            id: 55,//id
            parentId: 6,//父节点id  如果没有则为null
            id: 7,//id
            parentId: 2,//父节点id  如果没有则为null
            title: "操作员",//标题
            desc: "王某某",//具体信息
            taskState: 0,//任务状态
@@ -311,19 +324,12 @@
            taskState: 2,//任务状态
            actionType: 1//动作类型
        }, {
            id: 7,//id
            parentId: 2,//父节点id  如果没有则为null
            id: 10,//id
            parentId: 6,//父节点id  如果没有则为null
            title: "操作员",//标题
            desc: "王某某",//具体信息
            taskState: 0,//任务状态
            actionType: 3//动作类型
        }, {
            id: 5,//id
            parentId: 2,//父节点id  如果没有则为null
            title: "操作员",//标题
            desc: "赵某某",//具体信息
            taskState: 0,//任务状态
            actionType: 1//动作类型
        },]
        setTimeout(() => {
            const nodeList = [], linkList = []