Ben Lin
2024-08-05 16257dd099d9811fb5caf78047ffc2425c401e0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<template>
  <PageWrapper title="工艺流程图" content="根据生产工艺设计工艺流程" contentFullHeight fixedHeight>
    <FlowChart :data="demoData" />
  </PageWrapper>
</template>
 
<script lang="ts">
  import { FlowChart } from '/@/components/FlowChart';
  import { PageWrapper } from '/@/components/Page';
 
  export default {
    components: { FlowChart, PageWrapper },
    setup() {
      let demoData = {
        nodes: [
          {
            id: '5d82e943-477f-4313-aaff-a736d8caba74',
            type: 'rect',
            x: 340,
            y: 120,
            properties: {},
            text: {
              x: 340,
              y: 120,
              value: '测试工序',
            },
          },
          {
            id: '6e0c6714-69a7-4160-8bda-61f4e6d285dd',
            type: 'rect',
            x: 560,
            y: 120,
            properties: {},
            text: {
              x: 560,
              y: 120,
              value: '上料工序',
            },
          },
          {
            id: '80b2ee17-5a0e-4586-ba28-6ba59fcc0f59',
            type: 'rect',
            x: 340,
            y: 280,
            properties: {
              isReturn: true,
            },
            text: {
              x: 340,
              y: 280,
              value: '维修工序',
            },
          },
        ],
        edges: [
          {
            id: 'Flow_0p4u47c',
            type: 'bpmn:sequenceFlow',
            sourceNodeId: '5d82e943-477f-4313-aaff-a736d8caba74',
            targetNodeId: '6e0c6714-69a7-4160-8bda-61f4e6d285dd',
            startPoint: {
              x: 390,
              y: 120,
            },
            endPoint: {
              x: 510,
              y: 120,
            },
            properties: {},
            pointsList: [
              {
                x: 390,
                y: 120,
              },
              {
                x: 510,
                y: 120,
              },
            ],
          },
          {
            id: 'Flow_09tu4cm',
            type: 'bpmn:sequenceFlow',
            sourceNodeId: '5d82e943-477f-4313-aaff-a736d8caba74',
            targetNodeId: '80b2ee17-5a0e-4586-ba28-6ba59fcc0f59',
            startPoint: {
              x: 340,
              y: 160,
            },
            endPoint: {
              x: 340,
              y: 240,
            },
            properties: {},
            pointsList: [
              {
                x: 340,
                y: 160,
              },
              {
                x: 340,
                y: 240,
              },
            ],
          },
          {
            id: '22226ec4-9960-497d-93cb-6226a3f29b3d',
            type: 'custom-edge',
            sourceNodeId: '80b2ee17-5a0e-4586-ba28-6ba59fcc0f59',
            targetNodeId: '5d82e943-477f-4313-aaff-a736d8caba74',
            startPoint: {
              x: 351,
              y: 240,
            },
            endPoint: {
              x: 351,
              y: 160,
            },
            properties: {},
            pointsList: [
              {
                x: 351,
                y: 240,
              },
              {
                x: 351,
                y: 160,
              },
            ],
          },
        ],
      };
      return {
        demoData,
      };
    },
  };
</script>