• vue 复杂的流程图实现--antv/g6


    可以先看下对应的文档:G6 Demos - AntV

     npm install --save @antv/g6

    实现如图:

    1. <script>
    2. import G6 from "@antv/g6";
    3. export default {
    4. data() {
    5. return {
    6. registerEdgeLine: null,
    7. graph: null,
    8. registerEdgeNode: null,
    9. };
    10. },
    11. mounted() {
    12. this.init2();
    13. this.init();
    14. },
    15. methods: {
    16. init2() {},
    17. init() {
    18. const width = document.getElementById("mountNode").clientWidth;
    19. const spacing = width / 20;
    20. const anchorPoints = [
    21. [0.4, 0],
    22. [0.6, 0],
    23. [0.4, 1],
    24. [0.6, 1],
    25. ];
    26. //生产水线
    27. G6.registerEdge("line-production-arrow", {
    28. draw(cfg, group) {
    29. var startPoint = cfg.startPoint,
    30. endPoint = cfg.endPoint;
    31. var keyShape = group.addShape("path", {
    32. attrs: {
    33. path: [
    34. ["M", startPoint.x, startPoint.y],
    35. ["L", endPoint.x, startPoint.y],
    36. ["L", endPoint.x, endPoint.y],
    37. ],
    38. stroke: "#03b329",
    39. lineWidth: 1,
    40. startArrow: false,
    41. endArrow: true,
    42. className: "edge-shape",
    43. },
    44. });
    45. return keyShape;
    46. },
    47. });
    48. //循环水出水线
    49. G6.registerEdge("line-circulate-arrow", {
    50. draw(cfg, group) {
    51. var startPoint = cfg.startPoint,
    52. endPoint = cfg.endPoint;
    53. var keyShape = group.addShape("path", {
    54. attrs: {
    55. path: [
    56. ["M", startPoint.x, startPoint.y],
    57. ["L", startPoint.x, startPoint.y - 120],
    58. ["L", endPoint.x, endPoint.y - 120],
    59. ["L", endPoint.x, endPoint.y],
    60. ],
    61. stroke: "#FFC100",
    62. lineWidth: 1,
    63. startArrow: false,
    64. endArrow: true,
    65. className: "edge-shape",
    66. },
    67. });
    68. return keyShape;
    69. },
    70. });
    71. //循环水进水线
    72. G6.registerEdge("line-circulate-in-arrow", {
    73. draw(cfg, group) {
    74. var startPoint = cfg.startPoint,
    75. endPoint = cfg.endPoint;
    76. var keyShape = group.addShape("path", {
    77. attrs: {
    78. path: [
    79. ["M", startPoint.x, startPoint.y],
    80. ["L", startPoint.x, startPoint.y + 120],
    81. ["L", endPoint.x, endPoint.y + 120],
    82. ["L", endPoint.x, endPoint.y],
    83. ],
    84. stroke: "#FFC100",
    85. lineWidth: 1,
    86. startArrow: false,
    87. endArrow: true,
    88. className: "edge-shape",
    89. },
    90. });
    91. return keyShape;
    92. },
    93. });
    94. //脱盐水站出水线
    95. G6.registerEdge("line-desalination-arrow", {
    96. draw(cfg, group) {
    97. var startPoint = cfg.startPoint,
    98. endPoint = cfg.endPoint;
    99. var keyShape = group.addShape("path", {
    100. attrs: {
    101. path: [
    102. ["M", startPoint.x, startPoint.y],
    103. ["L", startPoint.x, startPoint.y - 40],
    104. ["L", endPoint.x, endPoint.y - 40],
    105. ["L", endPoint.x, endPoint.y],
    106. ],
    107. stroke: "#2BFF96",
    108. lineWidth: 1,
    109. startArrow: false,
    110. endArrow: true,
    111. className: "edge-shape",
    112. },
    113. });
    114. return keyShape;
    115. },
    116. });
    117. //污水站出水线
    118. G6.registerEdge("line-sewage-arrow", {
    119. draw(cfg, group) {
    120. var startPoint = cfg.startPoint,
    121. endPoint = cfg.endPoint;
    122. var keyShape = group.addShape("path", {
    123. attrs: {
    124. path: [
    125. ["M", startPoint.x, startPoint.y],
    126. ["L", startPoint.x, startPoint.y - 80],
    127. ["L", endPoint.x, endPoint.y - 80],
    128. ["L", endPoint.x, endPoint.y],
    129. ],
    130. stroke: "#8a63f5",
    131. lineWidth: 1,
    132. startArrow: false,
    133. endArrow: true,
    134. className: "edge-shape",
    135. },
    136. });
    137. return keyShape;
    138. },
    139. });
    140. //污水站进水线
    141. G6.registerEdge("line-sewage-in-arrow", {
    142. draw(cfg, group) {
    143. var startPoint = cfg.startPoint,
    144. endPoint = cfg.endPoint;
    145. var keyShape = group.addShape("path", {
    146. attrs: {
    147. path: [
    148. ["M", startPoint.x, startPoint.y],
    149. ["L", startPoint.x, startPoint.y + 80],
    150. ["L", endPoint.x, endPoint.y + 80],
    151. ["L", endPoint.x, endPoint.y],
    152. ],
    153. stroke: "#f37907",
    154. lineWidth: 1,
    155. startArrow: false,
    156. endArrow: true,
    157. className: "edge-shape",
    158. },
    159. });
    160. return keyShape;
    161. },
    162. });
    163. //消耗水线
    164. G6.registerEdge("line-consume-arrow", {
    165. draw(cfg, group) {
    166. var startPoint = cfg.startPoint,
    167. endPoint = cfg.endPoint;
    168. var keyShape = group.addShape("path", {
    169. attrs: {
    170. path: [
    171. ["M", startPoint.x, startPoint.y],
    172. ["L", startPoint.x, startPoint.y + 40],
    173. ["L", endPoint.x, endPoint.y],
    174. ],
    175. stroke: "#f30474",
    176. lineWidth: 1,
    177. startArrow: false,
    178. endArrow: true,
    179. className: "edge-shape",
    180. },
    181. });
    182. return keyShape;
    183. },
    184. });
    185. //外排污水水线
    186. G6.registerEdge("line-sewageConsume-arrow", {
    187. draw(cfg, group) {
    188. var startPoint = cfg.startPoint,
    189. endPoint = cfg.endPoint;
    190. var keyShape = group.addShape("path", {
    191. attrs: {
    192. path: [
    193. ["M", startPoint.x, startPoint.y],
    194. ["L", startPoint.x, startPoint.y + 80],
    195. ["L", endPoint.x, endPoint.y],
    196. ],
    197. stroke: "#f36f04",
    198. lineWidth: 1,
    199. startArrow: false,
    200. endArrow: true,
    201. className: "edge-shape",
    202. },
    203. });
    204. return keyShape;
    205. },
    206. });
    207. G6.registerNode(
    208. "rectNode",
    209. {
    210. drawShape(cfg, group) {
    211. var keyShape = group.addShape("rect", {
    212. attrs: {
    213. width: 35,
    214. height: 250,
    215. x: 0,
    216. y: 0,
    217. radius: 4,
    218. lineWidth: 1,
    219. stroke: "#409eff",
    220. fill: "#0158CF",
    221. },
    222. });
    223. group.addShape("text", {
    224. attrs: {
    225. y: cfg.top || 160,
    226. x: 12,
    227. text: cfg.text,
    228. fill: "#fff",
    229. lineHeight: 20,
    230. },
    231. });
    232. return keyShape;
    233. },
    234. },
    235. "rect"
    236. );
    237. G6.registerNode(
    238. "textNode",
    239. {
    240. drawShape(cfg, group) {
    241. var keyShape = group.addShape("rect", {
    242. attrs: {
    243. width: 50,
    244. height: 30,
    245. x: 0,
    246. y: 0,
    247. radius: 4,
    248. lineWidth: 1,
    249. stroke: "transparent",
    250. fill: "transparent",
    251. },
    252. });
    253. group.addShape("text", {
    254. attrs: {
    255. y: cfg.textY || 25,
    256. x: cfg.textX || 15,
    257. text: cfg.text,
    258. fill: cfg.color || "#03b329",
    259. lineHeight: 20,
    260. },
    261. });
    262. return keyShape;
    263. },
    264. },
    265. "rect"
    266. );
    267. let data = {
    268. nodes: [
    269. {
    270. id: "productionWater",
    271. x: (3 / 4) * spacing,
    272. y: 80,
    273. type: "textNode",
    274. text: "生产水",
    275. anchorPoints: [[0, 1]],
    276. },
    277. {
    278. id: "1",
    279. x: (1 / 2) * spacing,
    280. y: 150,
    281. type: "rectNode",
    282. text: "水\n循\n环\n系\n统",
    283. anchorPoints: anchorPoints,
    284. },
    285. {
    286. id: "2",
    287. x: 2 * spacing,
    288. y: 150,
    289. text: "脱\n盐\n水\n站",
    290. type: "rectNode",
    291. anchorPoints: anchorPoints,
    292. },
    293. {
    294. id: "3",
    295. x: 3 * spacing,
    296. y: 150,
    297. text: "冷\n凝\n鼓\n风",
    298. type: "rectNode",
    299. anchorPoints: anchorPoints,
    300. },
    301. {
    302. id: "4",
    303. x: 4 * spacing,
    304. y: 150,
    305. text: "脱\n硫\n单\n元",
    306. type: "rectNode",
    307. anchorPoints: anchorPoints,
    308. },
    309. {
    310. id: "5",
    311. x: 5 * spacing,
    312. y: 150,
    313. text: "硫\n铵\n单\n元",
    314. type: "rectNode",
    315. anchorPoints: anchorPoints,
    316. },
    317. {
    318. id: "6",
    319. x: 6 * spacing,
    320. y: 150,
    321. text: "粗\n苯\n蒸\n馏\n单\n元",
    322. type: "rectNode",
    323. anchorPoints: anchorPoints,
    324. },
    325. {
    326. id: "7",
    327. x: 7 * spacing,
    328. y: 150,
    329. text: "终\n冷\n洗\n苯\n单\n元",
    330. type: "rectNode",
    331. anchorPoints: anchorPoints,
    332. },
    333. {
    334. id: "8",
    335. x: 8 * spacing,
    336. y: 150,
    337. text: "制\n酸\n单\n元",
    338. type: "rectNode",
    339. anchorPoints: anchorPoints,
    340. },
    341. {
    342. id: "9",
    343. x: 9 * spacing,
    344. y: 150,
    345. text: "蒸\n氨\n单\n元",
    346. type: "rectNode",
    347. anchorPoints: anchorPoints,
    348. },
    349. {
    350. id: "10",
    351. x: 10 * spacing,
    352. y: 150,
    353. text: "油\n库\n单\n元",
    354. type: "rectNode",
    355. anchorPoints: anchorPoints,
    356. },
    357. {
    358. id: "11",
    359. x: 11 * spacing,
    360. y: 150,
    361. text: "汽\n化\n单\n元",
    362. type: "rectNode",
    363. anchorPoints: anchorPoints,
    364. },
    365. {
    366. id: "12",
    367. x: 12 * spacing,
    368. y: 150,
    369. text: "备\n煤\n系\n统\n焦\n处\n理\n系\n统",
    370. top: 200,
    371. type: "rectNode",
    372. anchorPoints: anchorPoints,
    373. },
    374. {
    375. id: "13",
    376. x: 13 * spacing,
    377. y: 150,
    378. text: "炼\n焦\n设\n施",
    379. type: "rectNode",
    380. anchorPoints: anchorPoints,
    381. },
    382. {
    383. id: "14",
    384. x: 14 * spacing,
    385. y: 150,
    386. text: "除\n尘\n设\n施",
    387. type: "rectNode",
    388. anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
    389. },
    390. {
    391. id: "15",
    392. x: 15 * spacing,
    393. y: 150,
    394. text: "热\n力\n设\n施",
    395. type: "rectNode",
    396. anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
    397. },
    398. {
    399. id: "16",
    400. x: 16 * spacing,
    401. y: 150,
    402. text: "干\n熄\n焦\n系\n统",
    403. type: "rectNode",
    404. anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
    405. },
    406. {
    407. id: "17",
    408. x: 17 * spacing,
    409. y: 150,
    410. text: "汽\n轮\n发\n电\n站",
    411. type: "rectNode",
    412. anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
    413. },
    414. {
    415. id: "18",
    416. x: 18.5 * spacing,
    417. y: 150,
    418. text: "污\n水\n处\n理\n站",
    419. type: "rectNode",
    420. anchorPoints: [
    421. [0.5, 0],
    422. [0.4, 1],
    423. [0.6, 1],
    424. ],
    425. },
    426. {
    427. id: "consumeWater",
    428. x: 19.5 * spacing,
    429. y: 410,
    430. type: "textNode",
    431. text: "耗水",
    432. textX: -45,
    433. color: "#f30474",
    434. anchorPoints: [[0, 1]],
    435. },
    436. {
    437. id: "sewageConsumeWater",
    438. x: 19.5 * spacing,
    439. y: 450,
    440. type: "textNode",
    441. text: "外排废水",
    442. textX: -45,
    443. textY: 20,
    444. color: "#f36f04",
    445. anchorPoints: [[0, 1]],
    446. },
    447. ],
    448. edges: [
    449. {
    450. source: "productionWater",
    451. target: "2",
    452. type: "line-production-arrow",
    453. sourceAnchor: 0,
    454. targetAnchor: 0,
    455. },
    456. {
    457. source: "1",
    458. target: "3",
    459. type: "line-circulate-arrow",
    460. sourceAnchor: 0,
    461. targetAnchor: 0,
    462. },
    463. {
    464. source: "1",
    465. target: "4",
    466. type: "line-circulate-arrow",
    467. sourceAnchor: 0,
    468. targetAnchor: 0,
    469. },
    470. {
    471. source: "1",
    472. target: "5",
    473. type: "line-circulate-arrow",
    474. sourceAnchor: 0,
    475. targetAnchor: 0,
    476. },
    477. {
    478. source: "1",
    479. target: "6",
    480. type: "line-circulate-arrow",
    481. sourceAnchor: 0,
    482. targetAnchor: 0,
    483. },
    484. {
    485. source: "1",
    486. target: "7",
    487. type: "line-circulate-arrow",
    488. sourceAnchor: 0,
    489. targetAnchor: 0,
    490. },
    491. {
    492. source: "1",
    493. target: "8",
    494. type: "line-circulate-arrow",
    495. sourceAnchor: 0,
    496. targetAnchor: 0,
    497. },
    498. {
    499. source: "1",
    500. target: "9",
    501. type: "line-circulate-arrow",
    502. sourceAnchor: 0,
    503. targetAnchor: 0,
    504. },
    505. {
    506. source: "1",
    507. target: "10",
    508. type: "line-circulate-arrow",
    509. sourceAnchor: 0,
    510. targetAnchor: 0,
    511. },
    512. {
    513. source: "1",
    514. target: "11",
    515. type: "line-circulate-arrow",
    516. sourceAnchor: 0,
    517. targetAnchor: 0,
    518. },
    519. {
    520. source: "1",
    521. target: "12",
    522. type: "line-circulate-arrow",
    523. sourceAnchor: 0,
    524. targetAnchor: 0,
    525. },
    526. {
    527. source: "1",
    528. target: "13",
    529. type: "line-circulate-arrow",
    530. sourceAnchor: 0,
    531. targetAnchor: 0,
    532. },
    533. {
    534. source: "1",
    535. target: "14",
    536. type: "line-circulate-arrow",
    537. sourceAnchor: 0,
    538. targetAnchor: 0,
    539. },
    540. {
    541. source: "1",
    542. target: "15",
    543. type: "line-circulate-arrow",
    544. sourceAnchor: 0,
    545. targetAnchor: 0,
    546. },
    547. {
    548. source: "1",
    549. target: "16",
    550. type: "line-circulate-arrow",
    551. sourceAnchor: 0,
    552. targetAnchor: 0,
    553. },
    554. {
    555. source: "1",
    556. target: "17",
    557. type: "line-circulate-arrow",
    558. sourceAnchor: 0,
    559. targetAnchor: 0,
    560. },
    561. {
    562. source: "17",
    563. target: "1",
    564. type: "line-circulate-in-arrow",
    565. sourceAnchor: 2,
    566. targetAnchor: 2,
    567. },
    568. {
    569. source: "17",
    570. target: "1",
    571. type: "line-circulate-in-arrow",
    572. sourceAnchor: 2,
    573. targetAnchor: 2,
    574. },
    575. {
    576. source: "16",
    577. target: "1",
    578. type: "line-circulate-in-arrow",
    579. sourceAnchor: 2,
    580. targetAnchor: 2,
    581. },
    582. {
    583. source: "15",
    584. target: "1",
    585. type: "line-circulate-in-arrow",
    586. sourceAnchor: 2,
    587. targetAnchor: 2,
    588. },
    589. {
    590. source: "14",
    591. target: "1",
    592. type: "line-circulate-in-arrow",
    593. sourceAnchor: 2,
    594. targetAnchor: 2,
    595. },
    596. {
    597. source: "13",
    598. target: "1",
    599. type: "line-circulate-in-arrow",
    600. sourceAnchor: 2,
    601. targetAnchor: 2,
    602. },
    603. {
    604. source: "12",
    605. target: "1",
    606. type: "line-circulate-in-arrow",
    607. sourceAnchor: 2,
    608. targetAnchor: 2,
    609. },
    610. {
    611. source: "11",
    612. target: "1",
    613. type: "line-circulate-in-arrow",
    614. sourceAnchor: 2,
    615. targetAnchor: 2,
    616. },
    617. {
    618. source: "10",
    619. target: "1",
    620. type: "line-circulate-in-arrow",
    621. sourceAnchor: 2,
    622. targetAnchor: 2,
    623. },
    624. {
    625. source: "9",
    626. target: "1",
    627. type: "line-circulate-in-arrow",
    628. sourceAnchor: 2,
    629. targetAnchor: 2,
    630. },
    631. {
    632. source: "8",
    633. target: "1",
    634. type: "line-circulate-in-arrow",
    635. sourceAnchor: 2,
    636. targetAnchor: 2,
    637. },
    638. {
    639. source: "7",
    640. target: "1",
    641. type: "line-circulate-in-arrow",
    642. sourceAnchor: 2,
    643. targetAnchor: 2,
    644. },
    645. {
    646. source: "6",
    647. target: "1",
    648. type: "line-circulate-in-arrow",
    649. sourceAnchor: 2,
    650. targetAnchor: 2,
    651. },
    652. {
    653. source: "5",
    654. target: "1",
    655. type: "line-circulate-in-arrow",
    656. sourceAnchor: 2,
    657. targetAnchor: 2,
    658. },
    659. {
    660. source: "4",
    661. target: "1",
    662. type: "line-circulate-in-arrow",
    663. sourceAnchor: 2,
    664. targetAnchor: 2,
    665. },
    666. {
    667. source: "3",
    668. target: "1",
    669. type: "line-circulate-in-arrow",
    670. sourceAnchor: 2,
    671. targetAnchor: 2,
    672. },
    673. {
    674. source: "2",
    675. target: "3",
    676. type: "line-desalination-arrow",
    677. sourceAnchor: 1,
    678. targetAnchor: 1,
    679. },
    680. {
    681. source: "2",
    682. target: "4",
    683. type: "line-desalination-arrow",
    684. sourceAnchor: 1,
    685. targetAnchor: 1,
    686. },
    687. {
    688. source: "2",
    689. target: "5",
    690. type: "line-desalination-arrow",
    691. sourceAnchor: 1,
    692. targetAnchor: 1,
    693. },
    694. {
    695. source: "2",
    696. target: "6",
    697. type: "line-desalination-arrow",
    698. sourceAnchor: 1,
    699. targetAnchor: 1,
    700. },
    701. {
    702. source: "2",
    703. target: "7",
    704. type: "line-desalination-arrow",
    705. sourceAnchor: 1,
    706. targetAnchor: 1,
    707. },
    708. {
    709. source: "2",
    710. target: "8",
    711. type: "line-desalination-arrow",
    712. sourceAnchor: 1,
    713. targetAnchor: 1,
    714. },
    715. {
    716. source: "2",
    717. target: "9",
    718. type: "line-desalination-arrow",
    719. sourceAnchor: 1,
    720. targetAnchor: 1,
    721. },
    722. {
    723. source: "2",
    724. target: "10",
    725. type: "line-desalination-arrow",
    726. sourceAnchor: 1,
    727. targetAnchor: 1,
    728. },
    729. {
    730. source: "2",
    731. target: "11",
    732. type: "line-desalination-arrow",
    733. sourceAnchor: 1,
    734. targetAnchor: 1,
    735. },
    736. {
    737. source: "2",
    738. target: "12",
    739. type: "line-desalination-arrow",
    740. sourceAnchor: 1,
    741. targetAnchor: 1,
    742. },
    743. {
    744. source: "2",
    745. target: "13",
    746. type: "line-desalination-arrow",
    747. sourceAnchor: 1,
    748. targetAnchor: 1,
    749. },
    750. {
    751. source: "2",
    752. target: "14",
    753. type: "line-desalination-arrow",
    754. sourceAnchor: 1,
    755. targetAnchor: 1,
    756. },
    757. {
    758. source: "2",
    759. target: "15",
    760. type: "line-desalination-arrow",
    761. sourceAnchor: 1,
    762. targetAnchor: 1,
    763. },
    764. {
    765. source: "2",
    766. target: "16",
    767. type: "line-desalination-arrow",
    768. sourceAnchor: 1,
    769. targetAnchor: 1,
    770. },
    771. {
    772. source: "2",
    773. target: "17",
    774. type: "line-desalination-arrow",
    775. sourceAnchor: 1,
    776. targetAnchor: 1,
    777. },
    778. {
    779. source: "18",
    780. target: "17",
    781. type: "line-sewage-arrow",
    782. sourceAnchor: 0,
    783. targetAnchor: 4,
    784. },
    785. {
    786. source: "18",
    787. target: "16",
    788. type: "line-sewage-arrow",
    789. sourceAnchor: 0,
    790. targetAnchor: 4,
    791. },
    792. {
    793. source: "18",
    794. target: "15",
    795. type: "line-sewage-arrow",
    796. sourceAnchor: 0,
    797. targetAnchor: 4,
    798. },
    799. {
    800. source: "18",
    801. target: "14",
    802. type: "line-sewage-arrow",
    803. sourceAnchor: 0,
    804. targetAnchor: 4,
    805. },
    806. {
    807. source: "2",
    808. target: "18",
    809. type: "line-sewage-in-arrow",
    810. sourceAnchor: 3,
    811. targetAnchor: 1,
    812. },
    813. {
    814. source: "17",
    815. target: "18",
    816. type: "line-sewage-in-arrow",
    817. sourceAnchor: 5,
    818. targetAnchor: 1,
    819. },
    820. {
    821. source: "16",
    822. target: "18",
    823. type: "line-sewage-in-arrow",
    824. sourceAnchor: 5,
    825. targetAnchor: 1,
    826. },
    827. {
    828. source: "15",
    829. target: "18",
    830. type: "line-sewage-in-arrow",
    831. sourceAnchor: 5,
    832. targetAnchor: 1,
    833. },
    834. {
    835. source: "14",
    836. target: "18",
    837. type: "line-sewage-in-arrow",
    838. sourceAnchor: 5,
    839. targetAnchor: 1,
    840. },
    841. {
    842. source: "1",
    843. target: "consumeWater",
    844. type: "line-consume-arrow",
    845. sourceAnchor: 3,
    846. targetAnchor: 0,
    847. },
    848. {
    849. source: "3",
    850. target: "consumeWater",
    851. type: "line-consume-arrow",
    852. sourceAnchor: 3,
    853. targetAnchor: 0,
    854. },
    855. {
    856. source: "4",
    857. target: "consumeWater",
    858. type: "line-consume-arrow",
    859. sourceAnchor: 3,
    860. targetAnchor: 0,
    861. },
    862. {
    863. source: "5",
    864. target: "consumeWater",
    865. type: "line-consume-arrow",
    866. sourceAnchor: 3,
    867. targetAnchor: 0,
    868. },
    869. {
    870. source: "6",
    871. target: "consumeWater",
    872. type: "line-consume-arrow",
    873. sourceAnchor: 3,
    874. targetAnchor: 0,
    875. },
    876. {
    877. source: "7",
    878. target: "consumeWater",
    879. type: "line-consume-arrow",
    880. sourceAnchor: 3,
    881. targetAnchor: 0,
    882. },
    883. {
    884. source: "8",
    885. target: "consumeWater",
    886. type: "line-consume-arrow",
    887. sourceAnchor: 3,
    888. targetAnchor: 0,
    889. },
    890. {
    891. source: "9",
    892. target: "consumeWater",
    893. type: "line-consume-arrow",
    894. sourceAnchor: 3,
    895. targetAnchor: 0,
    896. },
    897. {
    898. source: "10",
    899. target: "consumeWater",
    900. type: "line-consume-arrow",
    901. sourceAnchor: 3,
    902. targetAnchor: 0,
    903. },
    904. {
    905. source: "11",
    906. target: "consumeWater",
    907. type: "line-consume-arrow",
    908. sourceAnchor: 3,
    909. targetAnchor: 0,
    910. },
    911. {
    912. source: "12",
    913. target: "consumeWater",
    914. type: "line-consume-arrow",
    915. sourceAnchor: 3,
    916. targetAnchor: 0,
    917. },
    918. {
    919. source: "13",
    920. target: "consumeWater",
    921. type: "line-consume-arrow",
    922. sourceAnchor: 3,
    923. targetAnchor: 0,
    924. },
    925. {
    926. source: "14",
    927. target: "consumeWater",
    928. type: "line-consume-arrow",
    929. sourceAnchor: 3,
    930. targetAnchor: 0,
    931. },
    932. {
    933. source: "15",
    934. target: "consumeWater",
    935. type: "line-consume-arrow",
    936. sourceAnchor: 3,
    937. targetAnchor: 0,
    938. },
    939. {
    940. source: "16",
    941. target: "consumeWater",
    942. type: "line-consume-arrow",
    943. sourceAnchor: 3,
    944. targetAnchor: 0,
    945. },
    946. {
    947. source: "17",
    948. target: "consumeWater",
    949. type: "line-consume-arrow",
    950. sourceAnchor: 3,
    951. targetAnchor: 0,
    952. },
    953. {
    954. source: "18",
    955. target: "sewageConsumeWater",
    956. type: "line-sewageConsume-arrow",
    957. sourceAnchor: 2,
    958. targetAnchor: 0,
    959. },
    960. ],
    961. };
    962. this.graph = new G6.Graph({
    963. container: "mountNode",
    964. width: width,
    965. height: 620,
    966. });
    967. this.graph.data(data);
    968. this.graph.render();
    969. },
    970. },
    971. };
    972. script>
    973. <style lang="scss" scoped>
    974. .drawflow {
    975. height: 100%;
    976. width: 100%;
    977. #mountNode {
    978. width: 100%;
    979. height: 100%;
    980. }
    981. }
    982. style>

     

  • 相关阅读:
    详解 ClickHouse 的语法优化规则
    Nvm管理NodeJs版本
    【LeetCode】1282. 用户分组
    化妆品展示网页设计作业 静态HTML化妆品网站 DW美妆网站模板下载 大学生简单网页作品代码 个人网页制作 学生个人网页设计作业
    计算机毕业设计Java自动化办公系统(源码+系统+mysql数据库+lw文档)
    数据库与缓存数据一致性解决方案
    preview_220624,Day08_DM层建设实战,
    VO、DTO
    2022年mvnrepository跳过人机验证
    Flow-vue源码中的应用
  • 原文地址:https://blog.csdn.net/killerdoubie/article/details/134060901