div+css+svg实现多条件嵌套oa审批流程图效果代码
代码语言:html
所属分类:图表
代码描述:div+css+svg实现多条件嵌套oa审批流程图效果代码
代码标签: div css svg 多条件 嵌套 oa 审批 流程图
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" /> <style> :root { --fan-icon-badge-bgcolor: red; --fan-icon-badge-top: 0; --fan-icon-badge-right: 0; --fan-icon-badge-bottom: auto; --fan-icon-badge-left: auto; --fan-icon-badge-fontsize: 12px; --fan-icon-dot-width: 5px } .fan-icon-wraper { display: inline-block; position: relative; vertical-align: middle } .fan-icon-wraper:after { position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 9; content: "" } .fan-icon-wraper svg { display: block } :root { --fan-dialog-background-color: #fff; --fan-dialog-button-active-color: orange; --fan-loading-spinner-size: 20px; --fan-color-primary: #409eff } .placeholder { color: #bbb } /*! * WARNING:Don't edit this file by hand! Edit origin scss files in `./UI_dev/project` */ body { background: #f8f9fb } .approvalFlow { margin-top: 160px; margin-bottom: 80px; display: flex } .approvalFlow .approvalFlow-content { flex: 1 } .approvalFlow .node-container { display: inline-flex; flex-direction: column; width: 100%; align-items: center } .approvalFlow .node-box { position: relative; display: flex; flex-direction: column; background: #fff; width: 240px; min-height: 92px; box-sizing: border-box; cursor: pointer; z-index: 10 } .approvalFlow .line-end-arrow { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 4px; border-style: solid; border-width: 8px 5px 4px; border-color: #dbdbdb transparent transparent } .approvalFlow .node-box .title { position: relative; display: flex; align-items: center; height: 36px; border-radius: 4px 4px 0 0; font-family: PingFangSC-Medium; font-size: 14px; padding: 0 14px } .approvalFlow .node-box .title:after { content: ""; position: absolute; display: inline-block; height: 4px; width: 100%; top: 0; left: 0; background-color: red; border-radius: 2px 2px 0 0 } .approvalFlow .node-box .content { display: flex; align-items: center; flex-grow: 1; padding: 16px 14px } .approvalFlow .node-box .content-text { font-family: PingFangSC-Regular; flex: 1; font-size: 14px; color: #141414; word-break: break-all; line-height: 1.8 } .approvalFlow .content-text-default { color: #b3b3b3 } .approvalFlow .node-box .node-title-name { display: inline-block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; max-width: 76% } .approvalFlow .node-box .node-title-priority { text-align: right; font-size: 14px; color: #88939f; flex-shrink: 0 } .approvalFlow .node-box:hover .node-title-priority { display: none } .approvalFlow .node-box .node-title-operate { display: none; flex: 1; flex-direction: row-reverse } .approvalFlow .node-box .node-title-copy { margin-right: 10px; cursor: pointer } .approvalFlow .node-box .node-title-edit { display: none; cursor: pointer } .approvalFlow .content-box:hover .node-title-edit,.approvalFlow .node-box:hover .node-title-edit { display: inline-block } .col-box:last-child .content-box { cursor: context-menu } .col-box:last-child:hover .node-title-edit { display: none } .approvalFlow .node-box:hover .node-title-operate { display: inline-flex; margin-top: 2px } .approvalFlow .node-conditionbox { z-index: 10 } .approvalFlow .node-conditionbox .node-box { display: inline-flex; flex-direction: column; box-shadow: 0 1px 8px 0 rgba(0,0,0,.1); border-radius: 4px; margin-top: 50px; margin-right: 50px; margin-left: 50px } .approvalFlow .node-conditionbox .node-box:hover { box-shadow: 0 1px 8px 0 #88939f } .approvalFlow .node-conditionbox .title { background: #eef4fb; color: #88939f } .approvalFlow .node-conditionbox .title:after { background-color: #88939f } .approvalFlow .bottom-left-cover-line,.approvalFlow .bottom-right-cover-line,.approvalFlow .top-left-cover-line,.approvalFlow .top-right-cover-line { height: 3px; width: 50%; background-color: #f8f9fb; position: absolute; z-index: 2 } .approvalFlow .top-left-cover-line { top: -3px; left: -1px } .approvalFlow .bottom-left-cover-line { bottom: -3px; left: -1px } .approvalFlow .top-right-cover-line { top: -2px; right: -1px } .approvalFlow .bottom-right-cover-line { bottom: -2px; right: -1px } .approvalFlow .node-creator,.approvalFlow .node-end { border-radius: 4px } .approvalFlow .node-creator { box-shadow: 0 1px 8px 0 rgba(0,0,0,.1) } .approvalFlow .node-creator:before { display: none } .approvalFlow .node-creator:hover { box-shadow: 0 1px 8px 0 #4a94ff } .approvalFlow .node-creator .title { background: #e9f2ff; color: #4a94ff } .approvalFlow .node-creator .title:after { background: #4a94ff } .approvalFlow .node-end { display: flex; align-items: center; justify-content: center; width: 240px; min-height: 56px; height: 56px; box-shadow: 0 1px 8px 0 rgba(0,0,0,.1); cursor: default; font-size: 15px } .approvalFlow .add-branch { width: 84px; height: 34px; background-color: #fff; position: absolute; left: 50%; transform: translateX(-50%); top: -19px; border-radius: 4px; box-shadow: 0 1px 8px 0 rgba(0,0,0,.1); font-size: 14px; color: #4a94ff; text-align: center; line-height: 34px; z-index: 21; font-family: PingFangSC-Medium; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none } .approvalFlow .add-branch:hover { box-shadow: 0 1px 8px 0 rgba(0,0,0,.2) } .approvalFlow .col-box { display: inline-flex; align-items: center; flex-direction: column; position: relative; padding: 0 20px; background-color: #f8f9fb } .approvalFlow .col-box:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 0; margin: auto; width: 2px; height: 100%; background-color: #dbdbdb } .approvalFlow .branch-box { display: flex; position: relative } .approvalFlow .branch-box { min-height: 180px; margin-top: 15px; border-top: 2px solid #dbdbdb; border-bottom: 2px solid #dbdbdb } .approvalFlow .add-node-btn-box { width: 240px; display: inline-flex; flex-shrink: 0; position: relative } .approvalFlow .add-node-btn-box:before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; margin: auto; width: 2px; height: 100%; background-color: #dbdbdb } .approvalFlow .add-node-btn { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; width: 240px; padding: 35px 0; display: flex; justify-content: center; flex-shrink: 0; flex-grow: 1 } .approvalFlow .add-node-btn .btn { position: relative; outline: 0; width: 30px; height: 30px; background-color: #a0b5c8; border-radius: 50%; line-height: 30px; cursor: pointer } .approvalFlow .add-node-btn .btn:hover { background-color: #8599aa } .approvalFlow .add-node-btn .btn-icon:before { content: ""; position: absolute; display: inline-block; width: 2px; height: 16px; left: 14px; top: 7px; background-color: #fff } .approvalFlow .add-node-btn .btn-icon:after { content: ""; position: absolute; display: inline-block; height: 2px; width: 16px; top: 14px; left: 7px; background-color: #fff } .choose-node-box { transition: all .5s; position: absolute; top: 20px; left: 150px; text-align: left; background-color: #fff; width: 200px; border-radius: 12px; box-shadow: 0 0 10px #ccc; z-index: 99; color: #333; overflow: hidden } .choose-node-box .l-item { cursor: pointer; display: block; line-height: 42px; margin: 7px 20px; font-size: 14px } .choose-node-box .l-item .fan-icon-wraper { margin-right: 5px } .approvalFlow .node-start:hover { box-shadow: 0 1px 8px 0 #ffc6c6 } .approvalFlow .node-start .title { background-color: #f7e9e9; color: red } .approvalFlow .node-start .title:after { background: red } .approvalFlow .node-approver:hover { box-shadow: 0 1px 8px 0 #3d91eb } .approvalFlow .node-approver .title { background-color: #e2f0ff; color: #3d91eb } .approvalFlow .node-approver .title:after { background: #3d91eb } .approvalFlow .node-condition:hover { box-shadow: 0 1px 8px 0 #a5a5a4 } .approvalFlow .node-condition .title { background-color: #f1f1f1; color: #a5a5a4 } .approvalFlow .node-condition .title:after { background: #a5a5a4 } .box-relative { position: relative } :root { --fan-black: #000; --fan-animation-duration-base: 0.3s; --fan-animation-duration-fast: 0.2s; --fan-animation-timing-function-enter: ease-out; --fan-animation-timing-function-leave: ease-in } :root { --fan-popup-background-color: #fff } .fan-popup-right { position: fixed; top: 0; bottom: 0; width: 50%; background-color: var(--fan-popup-background-color); overflow-y: auto } .fan-popup-right { right: 0; z-index: 200 } .fan-mask-popup { position: fixed; top: 0; left: 0; bottom: 0; right: 0; background-color: rgba(0,0,0,.7); z-index: 199 } :root { --fan-toast-background-color: rgba(0,0,0,0.7); --fan-toast-button-active-color: orange; --fan-toast-spinner-size: 50px; --fan-loading-color-primary: #fff } .topnav{ line-height: 90px } .topnav .enter{ display: inline-block; width: 100px; height: 40px; line-height: 40px; text-align: center; color: #333; border: 1px solid #d8d8d8; cursor: pointer; margin: 0 10px; background: #00a0ed; color: #fff; border-color: #00a0ed } </style> </head> <body> <div id="app" > <div id="nav"> <div class="pagebox" > <div class="topnav" ><span class="enter" >提交</span></div> <div class="approvalFlow" > <div class="approvalFlow-content" style="transform: scale(1); transform-origin: 496.5px 0px 0px;"> <div class="node-container"> <div class="node-box node-creator node-start"> <!----> <div class="line-end-arrow "></div> <div class="title"><span class="node-title-name">申请人</span><span class="node-title-operate" style="flex-grow: 1;"><!----></span></div> <div class="content"> <div class="content-text"><span class="placeholder">请选择</span></div><i class="ww_commonImg"> <div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(204, 204, 204);"><path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 000 42.752L652.736 512 340.864 831.872a30.592 30.592 0 000 42.752 29.12 29.12 0 0041.728 0L714.24 534.336a32 32 0 000-44.672L382.592 149.376a29.12 29.12 0 00-41.728 0z"></path></svg><!----><!----></div> </i></div> </div> <div class="add-node-btn-box " style="position: relative;"> <div class="add-node-btn"> <div class="btn"><span class="btn-icon"></span></div> </div> </div> </div> <!----> <!----> <div class="node-container"> <div class="branch-box" style="position: relative;"> <div class="add-branch">添加条件</div> <!----> <!----> <!----> <div class="col-box "> <div class="top-left-cover-line"></div> <div class="bottom-left-cover-line"></div> <div class="node-container"> <div class="node-conditionbox"> <div class="node-box node-condition box-relative"> <!----> <div class="content-box"> <!----> <div class="line-end-arrow "></div> <div class="title"><span class="node-title-name copybtn" data-clipboard-target=".name-input-clip">条件1</span> <div class="fan-icon-wraper node-title-edit"><svg width="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" style="width: 15px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M153.6 902.656a32.256 32.256 0 0 1 0-64h716.8a32.256 32.256 0 0 1 0 64zM743.936 151.04l72.192 72.192a51.2 51.2 0 0 1 0 72.192L358.4 751.616a51.2 51.2 0 0 1-36.352 14.848h-95.232a25.6 25.6 0 0 1-25.6-25.6v-97.792a51.2 51.2 0 0 1 14.848-36.352l455.68-455.68a51.2 51.2 0 0 1 72.192 0z m-478.72 497.152v54.272h54.272l442.88-442.88-54.272-54.784z"></path></svg> <!----> <!----> </div><span class="node-title-operate" style="flex-grow: 1;"><span class="node-title-delete"><div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 00-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1045.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0045.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 10-45.12-45.184z"></path></svg><!----><!----></div></span> <span class="node-title-copy"> <div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M128 320v576h576V320H128zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32zM960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32zM256 672h320v64H256v-64zm0-192h320v64H256v-64z"></path></svg> <!----> <!----> </div> </span> </span><span class="node-title-priority" style="flex-grow: 1;">优先级1</span></div> <div class="content"> <div class="content-text"> <div class="content-text-default">请设置条件</div> </div><i><div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(204, 204, 204);"><path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 000 42.752L652.736 512 340.864 831.872a30.592 30.592 0 000 42.752 29.12 29.12 0 0041.728 0L714.24 534.336a32 32 0 000-44.672L382.592 149.376a29.12 29.12 0 00-41.728 0z"></path></svg><!----><!----></div></i></div> </div> <!----> </div> </div> <div class="add-node-btn-box " style="position: relative;"> <div class="add-node-btn"> <div class="btn"><span class="btn-icon"></span></div> </div> </div> </div> <div class="node-container"> <div class="node-box node-creator node-approver"> <!----> <div class="line-end-arrow "></div> <div class="title"><span class="node-title-name copybtn" data-clipboard-target=".name-input-clip">审批人</span> <!----> <div class="fan-icon-wraper node-title-edit"><svg width="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" style="width: 15px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M153.6 902.656a32.256 32.256 0 0 1 0-64h716.8a32.256 32.256 0 0 1 0 64zM743.936 151.04l72.192 72.192a51.2 51.2 0 0 1 0 72.192L358.4 751.616a51.2 51.2 0 0 1-36.352 14.848h-95.232a25.6 25.6 0 0 1-25.6-25.6v-97.792a51.2 51.2 0 0 1 14.848-36.352l455.68-455.68a51.2 51.2 0 0 1 72.192 0z m-478.72 497.152v54.272h54.272l442.88-442.88-54.272-54.784z"></path></svg> <!----> <!----> </div><span class="node-title-operate" style="flex-grow: 1;"><span class="node-title-delete"><div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 00-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1045.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0045.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 10-45.12-45.184z"></path></svg><!----><!----></div></span></span> </div> <div class="content"> <div class="content-text"><span class="placeholder">请选择</span></div><i class="ww_commonImg"> <div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(204, 204, 204);"><path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 000 42.752L652.736 512 340.864 831.872a30.592 30.592 0 000 42.752 29.12 29.12 0 0041.728 0L714.24 534.336a32 32 0 000-44.672L382.592 149.376a29.12 29.12 0 00-41.728 0z"></path></svg><!----><!----></div> </i></div> </div> <div class="add-node-btn-box " style="position: relative;"> <div class="add-node-btn"> <div class="btn"><span class="btn-icon"></span></div> </div> </div> </div> <!----> <div class="node-container"> <div class="node-box node-creator node-approver"> <!----> <div class="line-end-arrow "></div> <div class="title"><span class="node-title-name copybtn" data-clipboard-target=".name-input-clip">审批人</span> <!----> <div class="fan-icon-wraper node-title-edit"><svg width="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" style="width: 15px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M153.6 902.656a32.256 32.256 0 0 1 0-64h716.8a32.256 32.256 0 0 1 0 64zM743.936 151.04l72.192 72.192a51.2 51.2 0 0 1 0 72.192L358.4 751.616a51.2 51.2 0 0 1-36.352 14.848h-95.232a25.6 25.6 0 0 1-25.6-25.6v-97.792a51.2 51.2 0 0 1 14.848-36.352l455.68-455.68a51.2 51.2 0 0 1 72.192 0z m-478.72 497.152v54.272h54.272l442.88-442.88-54.272-54.784z"></path></svg> <!----> <!----> </div><span class="node-title-operate" style="flex-grow: 1;"><span class="node-title-delete"><div class="fan-icon-wraper"><svg width="20" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" style="width: 20px; color: rgb(153, 153, 153);"><path fill="currentColor" d="M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 00-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1045.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0045.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 10-45.12-45.184z"></path></svg><!----><!----></div></span></span> </div> <div class="content"> <div class="content-text"><span class="placeholder">请选择</span></div><i class.........完整代码请登录后点击上方下载按钮下载查看
网友评论0