data.js 2.17 KB
/*
 * @Date: 2023-10-27 09:29:48
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2023-12-01 17:40:28
 * @FilePath: /vue-flow-editor/doc/data.js
 * @Description: 初始化结构,数据都是固定的
 */
import { v4 as uuidv4 } from 'uuid';

const flow_id = uuidv4();
const cc_id = uuidv4();

export const AppData = {
    nodes: [
        {
            id: 'start-node',
            x: 225,
            y: 100,
            text: '开始',
            desc: '',
            control: 'start',
            index: 1
        },
        {
            id: flow_id,
            x: 225,
            y: 210,
            text: '流程节点',
            desc: '',
            control: 'flow',
            index: 2
        },
        // {
        //     id: '1700459406515',
        //     x: -25,
        //     y: 260,
        //     text: '流程节点test',
        //     desc: '',
        //     control: 'flow',
        // },
        {
            id: cc_id,
            x: 465,
            y: 210,
            text: '抄送节点',
            desc: '',
            control: 'cc',
            index: 3
        },
        {
            id: 'end-node',
            x: 225,
            y: 335,
            text: '结束',
            desc: '',
            control: 'end',
            index: 4
        },
    ],
    edges: [
        {
            shape: 'flow-polyline-round',
            source: 'start-node',
            sourceAnchor: 2,
            target: flow_id,
            targetAnchor: 0,
        },
        {
            shape: 'flow-polyline-round',
            source: flow_id,
            sourceAnchor: 2,
            target: 'end-node',
            targetAnchor: 0,
        },
        {
            shape: 'flow-polyline-round',
            source: flow_id,
            sourceAnchor: 3,
            target: cc_id,
            targetAnchor: 1,
        },
        // {
        //     source : "start-node",
        //     sourceAnchor : 1,
        //     target : "1700459406515",
        //     targetAnchor : 0
        // },
        // {
        //     source : "1700459406515",
        //     sourceAnchor : 2,
        //     target : "end-node",
        //     targetAnchor : 1
        // }
    ],
}