工作流程图、审核流程图前端实现

本文介绍如何利用d3和dagre-d3库在前端实现工作流程及审核流程图,通过引入这两个依赖,可以创建出清晰的流程图表。
摘要由CSDN通过智能技术生成

 要实现以上工作流程图,需要用到"d3": "5.16.0"、"dagre-d3": "0.6.4"两个依赖,直接上代码

<!--Created by lyn on 2021-09-09 15:50:16-->
<template>
  <div>
    <a-modal
        :visible="show"
        :title="title"
        @ok="closeModal"
        @cancel="closeModal"
        :closable="true"
        :centered="true"
        :maskClosable="false"
        :destroyOnClose="true"
        :width="flowWidth + 62"
    >
      <a-button slot="footer" @click="closeModal">关闭</a-button>
      <div v-show="loading" class="loading">
        <a-spin />
      </div>
      <!-- <div :style="{height: '400px',overflow: 'auto'}"> -->
        <svg v-show="!loading" :id="flowChartId" class="flowChart" style="cursor: move;" />
      <!-- </div> -->
    </a-modal>
    <a-modal
        :visible="nodeDetail.show"
        title="节点详情"
        @ok="nodeDetail.show = !nodeDetail.show"
        @cancel="nodeDetail.show = !nodeDetail.show"
        :closable="false"
        :maskClosable="false"
        :centered="true"
        :destroyOnClose="true"
        :width="548"
    >
        <a-button slot="footer" @click="nodeDetail.show = !nodeDetail.show">关闭</a-button>
        <ul class="detail-ul">
          <li v-for="item of nodeDetail.content" :key="item.key">
            <img :src="item.icon" />
            <div>
              <span class="label">{
  { item.label}}</span>
              <!-- <a style="color: #4676EF;" v-if="item.key === 'docDumber'" @click="goOrderPage(item.content)">{
  { item.content}}</a> -->
              <span v-if="item.key !== 'nodeStatus'">{
  { item.content}}</span>
              <span v-if="item.key === 'nodeStatus' && item.content === 0">未开始</span>
              <span v-if="item.key === 'nodeStatus' && item.content === 1" style="color:#F39000;font-weight: Bold;">执行中</span>
              <span v-if="item.key === 'nodeStatus' && item.content === 2" sty
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

麦兜_冰夕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值