审批进度

当前位置:   article > 正文

vue2自定义流程图组件(vue+css3+html)_vue 自定义流程图插件

vue 自定义流程图插件

来由:项目用的是iview组件库进行开发的,但是它的时间轴组件无法满足项目复杂需求,所有特意自定义这个新的流程图组件
注意:所有图标来自阿里云iconfont图标库

效果图:
在这里插入图片描述

  1. 页面
<!-- 自定义流程图 -->
<div class="new-approval-map">
    <h2 class="map-title">审批进度</h2>
    <div class="map-node">
        <div class="map-left-line">
            <span title="宫本武藏" class="line-name">{{'宫本武'.substring(0,2)}}</span>
            <span class="line-complete-icon"><i class="icon2_ icon2_gou complete-icon"></i></span>
            <!-- <i class="icon2_ icon2_shenpiguanli line-icon"></i> -->
        </div>
        <div class="map-right-content">
            <div class="item-cell">
                <div class="item-label">
                    <span class="label-name">发起申请</span>
                    <span class="label-time">2021-4-30 13:54:44</span>
                </div>
                <div class="item-node">
                    <span title="李四撒大苏" :class="['node-name', 'active']">李四撒大苏</span>
                    <span class="is-complete-icon"><i class="icon2_ icon2_gou complete-icon"></i></span>
                    <span :class="['node-status']"></span>
                </div>
                <div class="item-status-content">送到佛山东方红石佛店还是山大佛还是</div>
            </div>
        </div>
    </div>
    <div class="map-node">
        <div class="map-left-line">
            <!-- <span title="后羿" class="line-name">后羿</span> -->
            <i class="icon2_ icon2_workflow-center line-icon"></i>
            <span class="line-complete-icon"><i class="icon2_ icon2_gou complete-icon"></i></span>
        </div>
        <div class="map-right-content">
            <div class="item-cell">
                <div class="item-label">
                    <span class="label-name">审批人</span>
                    <span class="label-time">2021-4-30 13:54:44</span>
                </div>
                <div class="item-node">
                    <span :class="['node-name', 'active']">李四</span>
                    <span class="is-complete-icon"><i class="icon2_ icon2_gou complete-icon"></i></span>
                    <span :class="['node-status','agree']">已审批</span>
                </div>
                <div class="item-status-content">送到佛山东方红石佛店还是山大佛还是</div>
            </div>
        </div>
    </div>
    <div class="map-node">
        <div :class="['map-left-line', 'send']">
            <!-- <span title="后羿" class="line-name">后羿</span> -->
            <i class="icon2_ icon2_faqishenpi line-icon"></i>
        </div>
        <div class="map-right-content">
            <div class="item-cell">
                <div class="item-label">
                    <span class="label-name">抄送人</span>
                    <span class="label-time">2021-4-30 13:54:44</span>
                </div>
                <div class="item-node">
                    <span :class="['node-name', 'active']">李四</span>
                    <span :class="['node-status','pend']">待审批</span>
                </div>
                <div class="item-status-content">送到佛山东方红石佛店还是山大佛还是</div>
            </div>
        </div>
    </div>
</div>
  • 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
  1. css代码(less文件)
.new-approval-map{
    .map-title{
        font-size: 16px;
        font-weight: bold;
        color: #333;
        margin-bottom: 20px;
    }
    .map-node{
         display: flex;
         position: relative;
         .map-left-line{
             width: 40px;
             height: 40px;
             border-radius: 50%;
             background-color: #2d8cf0;
             font-size: 8px;
             color: #fff;
             text-align: center;
             line-height: 40px;
             // overflow: hidden;
             // position: relative;
             .line-name{
                 font-size: 12px;
             }
             .line-icon{
                 font-size: 22px;
             }
             .line-complete-icon{
                 display: block;
                 width: 16px;
                 height: 16px;
                 border-radius: 50%;
                 text-align: center;
                 line-height: 16px;
                 background-color: #3fba73;
                 position: absolute;
                 left: 25px;
                 top: 25px;
                 .complete-icon{
                     color: #fff;
                 }
             }
             &.send{
                background-color: #FFBA02; 
             }
             // 自定义流程虚线
             &::before{
                 content: '';
                 display: block;
                 width: 2px;
                 height: 100%;
                 background-color: #CDCDCD;
                 z-index: -1;
                 position: absolute;
                 left: 18px;
                 top: 0px;
             }
         }
         &:last-child{
             .map-left-line{
                 &::before{
                     display: none;
                 }
             }
         }
         .map-right-content{
             position: relative;
             width: 100%;
             margin: 12px 0 0 17px;
             .item-cell{
                 position: relative;
                 top: -22px;
                 left: 10px;
                 background-color: #fff;
                 border-radius: 6px;
                 padding: 12px 16px;
                 box-shadow: 1px 1px 4px #93c1f3;
                 .item-label{
                     line-height: 1;
                     display: flex;
                     justify-content: space-between;
                     .label-name{
                         font-size: 15px;
                         font-weight: bold;
                         color: #333;
                     }
                     .label-time{
                         font-size: 13px;
                         font-weight: bold;
                         color: #B9B9B9;
                         .label-status{
                             padding: 0 10px;
                         }
                     }
                 }
                 .item-node{
                     display: flex;
                     align-items: center;
                     margin: 10px 0;
                     .node-name{
                         width: 30px;
                         height: 30px;
                         border-radius: 50%;
                         background-color: #2d8cf0;
                         font-size: 8px;
                         color: #fff;
                         text-align: center;
                         line-height: 30px;
                         overflow: hidden;
                         position: relative;
                     }
                     .is-complete-icon{
                         display: block;
                         width: 16px;
                         height: 16px;
                         border-radius: 50%;
                         text-align: center;
                         line-height: 16px;
                         background-color: #3fba73;
                         position: absolute;
                         left: 35px;
                         top: 55px;
                         .complete-icon{
                             color: #fff;
                         }
                     }
                     .node-status{
                         color: #666;
                         padding-left: 10px;
                         &.agree{
                             // 同意样式
                             color: #3fba73;
                         }
                         &.reject{
                             // 拒绝样式
                             color: #E76060;
                         }
                         &.pend{
                             // 待审批样式
                             color: #fa795e;
                         }
                         &.recall{
                             // 撤回
                             color: orange;
                         }
                         &.send{
                             // chaoso
                             color: #2d8cf0;
                         }
                     }
                 }
                 .item-status-content{
                     line-height: 1.5;
                 }
                 &::before{
                     content: '';
                     width: 0;
                     height: 0;
                     border-top: 10px solid transparent;
                     border-right: 12px solid #edf6ff;
                     border-bottom: 11px solid transparent;
                     position: absolute;
                     left: -13px;
                     top: 20px;
                 }
             }
         }
     }
 }
  • 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
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/816652
推荐阅读
相关标签