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

这篇具有很好参考价值的文章主要介绍了vue 复杂的流程图实现--antv/g6。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

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

 npm install --save @antv/g6

实现如图:
vue 复杂的流程图实现--antv/g6,css,vue,流程图,vue.js

<template>
  <div class="drawflow">
    <div id="mountNode"></div>
  </div>
</template>
<script>
import G6 from "@antv/g6";
export default {
  data() {
    return {
      registerEdgeLine: null,
      graph: null,
      registerEdgeNode: null,
    };
  },
  mounted() {
    this.init2();
    this.init();
  },
  methods: {
    init2() {},
    init() {
      const width = document.getElementById("mountNode").clientWidth;
      const spacing = width / 20;
      const anchorPoints = [
        [0.4, 0],
        [0.6, 0],
        [0.4, 1],
        [0.6, 1],
      ];
      //生产水线
      G6.registerEdge("line-production-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", endPoint.x, startPoint.y],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#03b329",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });
      //循环水出水线
      G6.registerEdge("line-circulate-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y - 120],
                ["L", endPoint.x, endPoint.y - 120],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#FFC100",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });
      //循环水进水线
      G6.registerEdge("line-circulate-in-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y + 120],
                ["L", endPoint.x, endPoint.y + 120],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#FFC100",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });
      //脱盐水站出水线
      G6.registerEdge("line-desalination-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y - 40],
                ["L", endPoint.x, endPoint.y - 40],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#2BFF96",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });

      //污水站出水线
      G6.registerEdge("line-sewage-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y - 80],
                ["L", endPoint.x, endPoint.y - 80],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#8a63f5",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });
      //污水站进水线
      G6.registerEdge("line-sewage-in-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y + 80],
                ["L", endPoint.x, endPoint.y + 80],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#f37907",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });
      //消耗水线
      G6.registerEdge("line-consume-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y + 40],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#f30474",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });
      //外排污水水线
      G6.registerEdge("line-sewageConsume-arrow", {
        draw(cfg, group) {
          var startPoint = cfg.startPoint,
            endPoint = cfg.endPoint;
          var keyShape = group.addShape("path", {
            attrs: {
              path: [
                ["M", startPoint.x, startPoint.y],
                ["L", startPoint.x, startPoint.y + 80],
                ["L", endPoint.x, endPoint.y],
              ],
              stroke: "#f36f04",
              lineWidth: 1,
              startArrow: false,
              endArrow: true,
              className: "edge-shape",
            },
          });
          return keyShape;
        },
      });

      G6.registerNode(
        "rectNode",
        {
          drawShape(cfg, group) {
            var keyShape = group.addShape("rect", {
              attrs: {
                width: 35,
                height: 250,
                x: 0,
                y: 0,
                radius: 4,
                lineWidth: 1,
                stroke: "#409eff",
                fill: "#0158CF",
              },
            });
            group.addShape("text", {
              attrs: {
                y: cfg.top || 160,
                x: 12,
                text: cfg.text,
                fill: "#fff",
                lineHeight: 20,
              },
            });

            return keyShape;
          },
        },
        "rect"
      );
      G6.registerNode(
        "textNode",
        {
          drawShape(cfg, group) {
            var keyShape = group.addShape("rect", {
              attrs: {
                width: 50,
                height: 30,
                x: 0,
                y: 0,
                radius: 4,
                lineWidth: 1,
                stroke: "transparent",
                fill: "transparent",
              },
            });
            group.addShape("text", {
              attrs: {
                y: cfg.textY || 25,
                x: cfg.textX || 15,
                text: cfg.text,
                fill: cfg.color || "#03b329",
                lineHeight: 20,
              },
            });

            return keyShape;
          },
        },
        "rect"
      );
      let data = {
        nodes: [
          {
            id: "productionWater",
            x: (3 / 4) * spacing,
            y: 80,
            type: "textNode",
            text: "生产水",
            anchorPoints: [[0, 1]],
          },
          {
            id: "1",
            x: (1 / 2) * spacing,
            y: 150,
            type: "rectNode",
            text: "水\n循\n环\n系\n统",
            anchorPoints: anchorPoints,
          },
          {
            id: "2",
            x: 2 * spacing,
            y: 150,
            text: "脱\n盐\n水\n站",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "3",
            x: 3 * spacing,
            y: 150,
            text: "冷\n凝\n鼓\n风",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "4",
            x: 4 * spacing,
            y: 150,
            text: "脱\n硫\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "5",
            x: 5 * spacing,
            y: 150,
            text: "硫\n铵\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "6",
            x: 6 * spacing,
            y: 150,
            text: "粗\n苯\n蒸\n馏\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "7",
            x: 7 * spacing,
            y: 150,
            text: "终\n冷\n洗\n苯\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "8",
            x: 8 * spacing,
            y: 150,
            text: "制\n酸\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "9",
            x: 9 * spacing,
            y: 150,
            text: "蒸\n氨\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "10",
            x: 10 * spacing,
            y: 150,
            text: "油\n库\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "11",
            x: 11 * spacing,
            y: 150,
            text: "汽\n化\n单\n元",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "12",
            x: 12 * spacing,
            y: 150,
            text: "备\n煤\n系\n统\n焦\n处\n理\n系\n统",
            top: 200,
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "13",
            x: 13 * spacing,
            y: 150,
            text: "炼\n焦\n设\n施",
            type: "rectNode",
            anchorPoints: anchorPoints,
          },
          {
            id: "14",
            x: 14 * spacing,
            y: 150,
            text: "除\n尘\n设\n施",
            type: "rectNode",
            anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
          },
          {
            id: "15",
            x: 15 * spacing,
            y: 150,
            text: "热\n力\n设\n施",
            type: "rectNode",
            anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
          },
          {
            id: "16",
            x: 16 * spacing,
            y: 150,
            text: "干\n熄\n焦\n系\n统",
            type: "rectNode",
            anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
          },
          {
            id: "17",
            x: 17 * spacing,
            y: 150,
            text: "汽\n轮\n发\n电\n站",
            type: "rectNode",
            anchorPoints: [...anchorPoints, [0.8, 0], [0.8, 1]],
          },
          {
            id: "18",
            x: 18.5 * spacing,
            y: 150,
            text: "污\n水\n处\n理\n站",
            type: "rectNode",
            anchorPoints: [
              [0.5, 0],
              [0.4, 1],
              [0.6, 1],
            ],
          },
          {
            id: "consumeWater",
            x: 19.5 * spacing,
            y: 410,
            type: "textNode",
            text: "耗水",
            textX: -45,
            color: "#f30474",
            anchorPoints: [[0, 1]],
          },
          {
            id: "sewageConsumeWater",
            x: 19.5 * spacing,
            y: 450,
            type: "textNode",
            text: "外排废水",
            textX: -45,
            textY: 20,
            color: "#f36f04",
            anchorPoints: [[0, 1]],
          },
        ],
        edges: [
          {
            source: "productionWater",
            target: "2",
            type: "line-production-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "3",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "4",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "5",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "6",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "7",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "8",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "9",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "10",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "11",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "12",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "13",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "14",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "15",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "16",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "1",
            target: "17",
            type: "line-circulate-arrow",
            sourceAnchor: 0,
            targetAnchor: 0,
          },
          {
            source: "17",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "17",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "16",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "15",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "14",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "13",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "12",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "11",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "10",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "9",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "8",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "7",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "6",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "5",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "4",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "3",
            target: "1",
            type: "line-circulate-in-arrow",
            sourceAnchor: 2,
            targetAnchor: 2,
          },
          {
            source: "2",
            target: "3",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "4",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "5",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "6",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "7",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "8",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "9",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "10",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "11",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "12",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "13",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "14",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "15",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "16",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "2",
            target: "17",
            type: "line-desalination-arrow",
            sourceAnchor: 1,
            targetAnchor: 1,
          },
          {
            source: "18",
            target: "17",
            type: "line-sewage-arrow",
            sourceAnchor: 0,
            targetAnchor: 4,
          },
          {
            source: "18",
            target: "16",
            type: "line-sewage-arrow",
            sourceAnchor: 0,
            targetAnchor: 4,
          },
          {
            source: "18",
            target: "15",
            type: "line-sewage-arrow",
            sourceAnchor: 0,
            targetAnchor: 4,
          },
          {
            source: "18",
            target: "14",
            type: "line-sewage-arrow",
            sourceAnchor: 0,
            targetAnchor: 4,
          },
          {
            source: "2",
            target: "18",
            type: "line-sewage-in-arrow",
            sourceAnchor: 3,
            targetAnchor: 1,
          },
          {
            source: "17",
            target: "18",
            type: "line-sewage-in-arrow",
            sourceAnchor: 5,
            targetAnchor: 1,
          },
          {
            source: "16",
            target: "18",
            type: "line-sewage-in-arrow",
            sourceAnchor: 5,
            targetAnchor: 1,
          },
          {
            source: "15",
            target: "18",
            type: "line-sewage-in-arrow",
            sourceAnchor: 5,
            targetAnchor: 1,
          },
          {
            source: "14",
            target: "18",
            type: "line-sewage-in-arrow",
            sourceAnchor: 5,
            targetAnchor: 1,
          },
          {
            source: "1",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "3",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "4",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "5",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "6",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "7",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "8",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "9",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "10",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "11",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "12",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "13",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "14",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "15",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "16",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
          {
            source: "17",
            target: "consumeWater",
            type: "line-consume-arrow",
            sourceAnchor: 3,
            targetAnchor: 0,
          },
           {
            source: "18",
            target: "sewageConsumeWater",
            type: "line-sewageConsume-arrow",
            sourceAnchor: 2,
            targetAnchor: 0,
          },
        ],
      };

      this.graph = new G6.Graph({
        container: "mountNode",
        width: width,
        height: 620,
      });
      this.graph.data(data);
      this.graph.render();
    },
  },
};
</script>
<style lang="scss" scoped>
.drawflow {
  height: 100%;
  width: 100%;
  #mountNode {
    width: 100%;
    height: 100%;
  }
}
</style>

 文章来源地址https://www.toymoban.com/news/detail-713345.html

到了这里,关于vue 复杂的流程图实现--antv/g6的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 「AntV」X6图编辑器的应用——流程图实现

    在线预览 源码 阮一峰:SVG图像入门 SVGtutorial 因为antv/x6是基于SVG的图编辑器,所以SVG的知识有必要了解下的 简介 可缩放矢量图形【基于图形】 全称:Scalable Vector Graphics 定义基于矢量的图形 基于XML语法 放大缩小不会失真 属于万维网标准 可以插入DOM,通过JavaScript和CSS来操作

    2024年02月09日
    浏览(57)
  • 基于G6的弓字形流程图

    现在有个需求是 类似于步骤条、流程图 ,但是节点比较多。 搜了很多类似组件,还是有各种问题。 一开始用的是 element-ui 自带的步骤条组件(下图所示),但是节点过多,宽度不够的时候,换行就是直接从新一行开始接上,但是这样节点一多就不美观,不够直观。 后面尝

    2024年02月16日
    浏览(56)
  • 流程图实现,基于vue2实现的流程图

    flex布局 + 伪元素实现竖直的连接线+组件递归 2.1基础的(未截全,大致长这样)  2.2带有收缩功能的,可以展开和收缩并显示数量     4.项目源码地址 GitHub - yft-code/flow: 流程图 纯css实现流程图

    2024年02月16日
    浏览(48)
  • Vue实现流程图,借鉴vue-tree-color 实现流程框架技术

    实现组织架构图(vue-org-tree) 如果向使用原来的依赖可以使用这个人的,因为我也是根据这个博客大佬仿照Vue-org-tree实现的方案 对此有几点不惑,问了大佬,大佬也没有回复我 className 貌似不起作用,看了文章底部,她也意识到这个问题,但是没有给出详细的解决方案 node.js中

    2024年02月06日
    浏览(49)
  • vue + gojs 实现拖拽流程图(实战项目)

    最近一段时间在研究go.js,它是一款前端开发画流程图的一个插件,也是一个难点,要说为什么是难点,首先,它是依赖画布canvas知识开发。其次,要依赖于内部API开发需求,开发项目实战需求的时候就要花费大量的时间去熟悉go.js的API,然后才能进行开发。话不多说,我就先

    2023年04月24日
    浏览(44)
  • G6框架Dagre流程图第三个自左向右的 Dagre 上对齐改造,对齐结点和边添加样式,并添加修改节点和展示结点详细信息交互

    ​​ 标题修改具体项 设置结点的样式 设置边的样式 添加修改结点名称功能 添加展示结点详细信息功能 参考链接 基本图形:https://g6.antv.vision/zh/examples/net/dagreFlow#lrDagreUL 展示结点详细信息功能:https://g6.antv.vision/zh/examples/tool/tooltip#tooltipClick 修改结点名称功能:https://g6.ant

    2024年02月10日
    浏览(59)
  • 如何自己实现一个丝滑的流程图绘制工具(一)vue如何使用

    背景 项目需求突然叫我实现一个类似processOn一样的在线流程图绘制工具。 这可难倒我了,立马去做调研,在github上找了很多个开源的流程图绘制工具, 对比下来我还是选择了 bpmn-js 原因: 1、他的流程图是涉及到业务的,比如开始事件、结束事件等 2、扩展性很强(这个扩展

    2024年02月11日
    浏览(53)
  • vue使用jsplumb 流程图

    安装jsPlumb库:在Vue项目中使用npm或yarn安装jsPlumb库。 npm install jsplumb 创建一个Vue组件:创建一个Vue组件来容纳jsPlumb的功能和呈现。 效果图:  初始化jsPlumb一定要在mounted函数里面,要执行在dom渲染完成的时候 一定要设置绑定的容器,不然连线的容器外加入任何其他布局元素

    2024年02月12日
    浏览(39)
  • 在vue3中使用pinia完整流程图文

    使用vite创建好一个vue3项目,开发语言选择ts 使用 npm i pinia -s 安装最新版本的pinia 这里我的版本安装的是 2.1.4 1.在main中注册pinia 2.在store中创建index.ts和store-name.ts文件 index.ts内容如下: store-name.ts内容如下: app.vue文件的内容如下: 页面输出如下内容则一次简单的pinia的调用完

    2024年02月10日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包