首页流程图

This commit is contained in:
syruan 2025-10-14 23:01:29 +08:00
parent 874f797815
commit 3643e02c6f
5 changed files with 211 additions and 166 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -3,8 +3,8 @@
<el-form <el-form
:model="queryParams" :model="queryParams"
ref="queryFormRef" ref="queryFormRef"
inline :inline="false"
label-width="auto" label-width="100px"
size="small" size="small"
> >
<!-- 表单搜索 --> <!-- 表单搜索 -->
@ -21,7 +21,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="7">
<el-form-item label="申请时间" prop="createTime"> <el-form-item label="申请时间" prop="createTime">
<el-date-picker <el-date-picker
type="daterange" type="daterange"
@ -35,23 +35,11 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" style="float:right;"> <el-col :span="12" style="text-align:right;">
<el-form-item> <el-form-item style="white-space: nowrap;">
<el-button class="primary-lease" type="primary" @click="getEquipmentApplyList"> <el-button class="primary-lease" type="primary" @click="getEquipmentApplyList">查询</el-button>
查询 <el-button class="primary-lease" type="primary" @click="resetForm">重置</el-button>
</el-button> <el-button class="primary-lease" type="primary" @click="showDetails('1')">展开明细</el-button>
<el-button class="primary-lease" type="primary" @click="resetForm">
重置
</el-button>
<el-button
class="primary-lease"
type="primary"
@click="showDetails('1')"
>
展开明细
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -144,7 +144,7 @@
<el-form-item label="合同模板名称:" prop="contractName"> <el-form-item label="合同模板名称:" prop="contractName">
<el-input <el-input
autocomplete="off" autocomplete="off"
style="width: 850px" style="width: 350px"
maxlength="30" maxlength="30"
v-model="addAndEditForm.contractName" v-model="addAndEditForm.contractName"
clearable clearable

View File

@ -3,100 +3,15 @@
<h2 class="flowchart-title">装备管理系统流程图</h2> <h2 class="flowchart-title">装备管理系统流程图</h2>
<!-- 流程图主体 --> <!-- 流程图主体 -->
<div class="flowchart-wrapper"> <div class="flowchart-wrapper" ref="wrapper">
<!-- 所有连接线 (放在节点下层) -->
<div class="connections">
<!-- 装备录入 录入审核 -->
<line
:x1="140" :y1="140" :x2="140" :y2="200"
:class="{ active: activeNode === 'equipmentEntry' }"
/>
<!-- 录入审核 装备台账 -->
<line
:x1="200" :y1="230" :x2="230" :y2="230"
:class="{ active: activeNode === 'entryAudit' }"
/>
<!-- 装备台账 装备上架 -->
<line
:x1="300" :y1="260" :x2="300" :y2="320"
:class="{ active: activeNode === 'equipmentLedger' && activeLine === 'ledgerToShelf' }"
/>
<!-- 装备台账 自用出库 -->
<line
:x1="370" :y1="230" :x2="380" :y2="230"
:class="{ active: activeNode === 'equipmentLedger' && activeLine === 'ledgerToSelfOut' }"
/>
<!-- 自用出库 装备退库 -->
<line
:x1="440" :y1="380" :x2="440" :y2="440"
:class="{ active: activeNode === 'selfUseOut' }"
/>
<!-- 装备退库 装备维修 -->
<line
:x1="440" :y1="500" :x2="440" :y2="540"
:class="{ active: activeNode === 'equipmentReturn' }"
/>
<!-- 装备维修 装备退役 -->
<path
d="M440 600 H440 Q440 400 440 140"
:class="{ active: activeNode === 'equipmentRepair' && activeLine === 'repairToRetire' }"
/>
<!-- 装备上架 共享大厅 -->
<line
:x1="290" :y1="350" :x2="530" :y2="350"
:class="{ active: activeNode === 'equipmentShelf' && activeLine === 'shelfToRental' }"
/>
<!-- 装备上架 装备下架 -->
<path
d="M230 350 H200 V440 H140"
:class="{ active: activeNode === 'equipmentShelf' && activeLine === 'shelfToOffShelf' }"
/>
<!-- 共享大厅 共享出库 -->
<line
:x1="600" :y1="380" :x2="600" :y2="440"
:class="{ active: activeNode === 'rentalHall' }"
/>
<!-- 共享出库 共享退库 -->
<line
:x1="590" :y1="470" :x2="590" :y2="540"
:class="{ active: activeNode === 'shareOut' }"
/>
<!-- 共享退库 装备维修 -->
<line
:x1="590" :y1="570" :x2="440" :y2="570"
:class="{ active: activeNode === 'shareReturn' }"
/>
<!-- 装备维修 装备台账 -->
<path
d="M410 570 H370 V260 H300"
:class="{ active: activeNode === 'equipmentRepair' && activeLine === 'repairToLedger' }"
/>
<!-- 装备下架 装备退役 -->
<path
d="M140 470 V380 H180 Q250 200 380 110"
:class="{ active: activeNode === 'equipmentOffShelf' }"
/>
</div>
<!-- 所有节点 --> <!-- 所有节点 -->
<div class="nodes"> <div class="nodes">
<!-- 装备录入 --> <!-- 装备录入 -->
<div <div
class="node entry-node" class="node entry-node"
:style="{ left: '80px', top: '80px' }" :style="{ left: '40px', top: '60px' }"
ref="equipmentEntry"
@click="handleNodeClick('equipmentEntry')" @click="handleNodeClick('equipmentEntry')"
> >
装备录入 装备录入
@ -105,7 +20,8 @@
<!-- 装备退役 --> <!-- 装备退役 -->
<div <div
class="node retire-node" class="node retire-node"
:style="{ left: '380px', top: '80px' }" :style="{ left: '620px', top: '60px' }"
ref="equipmentRetire"
@click="handleNodeClick('equipmentRetire')" @click="handleNodeClick('equipmentRetire')"
> >
装备退役 装备退役
@ -114,7 +30,8 @@
<!-- 录入审核 --> <!-- 录入审核 -->
<div <div
class="node audit-node" class="node audit-node"
:style="{ left: '80px', top: '200px' }" :style="{ left: '40px', top: '200px' }"
ref="entryAudit"
@click="handleNodeClick('entryAudit')" @click="handleNodeClick('entryAudit')"
> >
录入审核 录入审核
@ -123,7 +40,8 @@
<!-- 装备台账 --> <!-- 装备台账 -->
<div <div
class="node ledger-node" class="node ledger-node"
:style="{ left: '230px', top: '200px' }" :style="{ left: '260px', top: '200px' }"
ref="equipmentLedger"
@click="handleNodeClick('equipmentLedger')" @click="handleNodeClick('equipmentLedger')"
> >
装备台账 装备台账
@ -132,7 +50,8 @@
<!-- 装备上架 --> <!-- 装备上架 -->
<div <div
class="node shelf-node" class="node shelf-node"
:style="{ left: '230px', top: '320px' }" :style="{ left: '260px', top: '340px' }"
ref="equipmentShelf"
@click="handleNodeClick('equipmentShelf')" @click="handleNodeClick('equipmentShelf')"
> >
装备上架 装备上架
@ -141,7 +60,8 @@
<!-- 自用出库 --> <!-- 自用出库 -->
<div <div
class="node self-out-node" class="node self-out-node"
:style="{ left: '380px', top: '320px' }" :style="{ left: '500px', top: '200px' }"
ref="selfUseOut"
@click="handleNodeClick('selfUseOut')" @click="handleNodeClick('selfUseOut')"
> >
自用出库 自用出库
@ -150,7 +70,8 @@
<!-- 装备退库 --> <!-- 装备退库 -->
<div <div
class="node return-node" class="node return-node"
:style="{ left: '380px', top: '440px' }" :style="{ left: '740px', top: '200px' }"
ref="equipmentReturn"
@click="handleNodeClick('equipmentReturn')" @click="handleNodeClick('equipmentReturn')"
> >
装备退库 装备退库
@ -159,7 +80,8 @@
<!-- 装备维修 --> <!-- 装备维修 -->
<div <div
class="node repair-node" class="node repair-node"
:style="{ left: '380px', top: '540px' }" :style="{ left: '980px', top: '200px' }"
ref="equipmentRepair"
@click="handleNodeClick('equipmentRepair')" @click="handleNodeClick('equipmentRepair')"
> >
装备维修 装备维修
@ -168,7 +90,8 @@
<!-- 共享大厅 --> <!-- 共享大厅 -->
<div <div
class="node rental-node" class="node rental-node"
:style="{ left: '530px', top: '320px' }" :style="{ left: '500px', top: '340px' }"
ref="rentalHall"
@click="handleNodeClick('rentalHall')" @click="handleNodeClick('rentalHall')"
> >
共享大厅 共享大厅
@ -177,7 +100,8 @@
<!-- 共享出库 --> <!-- 共享出库 -->
<div <div
class="node share-out-node" class="node share-out-node"
:style="{ left: '530px', top: '440px' }" :style="{ left: '740px', top: '340px' }"
ref="shareOut"
@click="handleNodeClick('shareOut')" @click="handleNodeClick('shareOut')"
> >
共享出库 共享出库
@ -186,7 +110,8 @@
<!-- 共享退库 --> <!-- 共享退库 -->
<div <div
class="node share-return-node" class="node share-return-node"
:style="{ left: '530px', top: '540px' }" :style="{ left: '980px', top: '340px' }"
ref="shareReturn"
@click="handleNodeClick('shareReturn')" @click="handleNodeClick('shareReturn')"
> >
共享退库 共享退库
@ -195,12 +120,30 @@
<!-- 装备下架 --> <!-- 装备下架 -->
<div <div
class="node off-shelf-node" class="node off-shelf-node"
:style="{ left: '80px', top: '440px' }" :style="{ left: '260px', top: '500px' }"
ref="equipmentOffShelf"
@click="handleNodeClick('equipmentOffShelf')" @click="handleNodeClick('equipmentOffShelf')"
> >
装备下架 装备下架
</div> </div>
</div> </div>
<!-- 连接线SVG 覆盖层 -->
<svg class="connections" xmlns="http://www.w3.org/2000/svg">
<polyline
v-for="conn in connections"
:key="conn.id"
:points="conn.points"
:class="{ active: activeLine === conn.id }"
marker-end="url(#arrow)"
/>
<!-- 箭头定义用于直线末端 -->
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" fill="#999" />
</marker>
</defs>
</svg>
</div> </div>
<!-- 节点信息面板 --> <!-- 节点信息面板 -->
@ -220,6 +163,24 @@ export default {
return { return {
activeNode: null, activeNode: null,
activeLine: null, activeLine: null,
connections: [],
// 线 from/to
lineDefs: [
{ id: 'entryToAudit', from: 'equipmentEntry', to: 'entryAudit' },
{ id: 'auditToLedger', from: 'entryAudit', to: 'equipmentLedger' },
{ id: 'ledgerToSelf', from: 'equipmentLedger', to: 'selfUseOut' },
{ id: 'selfToReturn', from: 'selfUseOut', to: 'equipmentReturn' },
{ id: 'returnToRepair', from: 'equipmentReturn', to: 'equipmentRepair' },
{ id: 'ledgerToShelf', from: 'equipmentLedger', to: 'equipmentShelf' },
{ id: 'shelfToRental', from: 'equipmentShelf', to: 'rentalHall' },
{ id: 'rentalToShareOut', from: 'rentalHall', to: 'shareOut' },
{ id: 'shareOutToShareReturn', from: 'shareOut', to: 'shareReturn' },
{ id: 'shareReturnToRepair', from: 'shareReturn', to: 'equipmentRepair' },
{ id: 'shelfToOff', from: 'equipmentShelf', to: 'equipmentOffShelf' },
// /退
{ id: 'repairToRetire', from: 'equipmentRepair', to: 'equipmentRetire' },
{ id: 'ledgerToRetire', from: 'equipmentLedger', to: 'equipmentRetire' }
],
nodeData: { nodeData: {
equipmentEntry: { equipmentEntry: {
name: '装备录入', name: '装备录入',
@ -296,6 +257,13 @@ export default {
} }
}; };
}, },
mounted() {
this.$nextTick(this.updateConnections);
window.addEventListener('resize', this.updateConnections, { passive: true });
},
beforeDestroy() {
window.removeEventListener('resize', this.updateConnections);
},
computed: { computed: {
nodeInfo() { nodeInfo() {
return this.nodeData[this.activeNode] || {}; return this.nodeData[this.activeNode] || {};
@ -315,6 +283,55 @@ export default {
} else if (nodeId === 'equipmentRepair') { } else if (nodeId === 'equipmentRepair') {
this.activeLine = 'repairToRetire'; this.activeLine = 'repairToRetire';
} }
},
updateConnections() {
const buildMetrics = (el) => {
if (!el) return null;
return {
left: el.offsetLeft,
top: el.offsetTop,
width: el.offsetWidth,
height: el.offsetHeight
};
};
const getEdgeAnchors = (rect) => {
const cx = rect.left + rect.width / 2;
const cy = rect.top + rect.height / 2;
return {
left: { x: rect.left, y: cy },
right: { x: rect.left + rect.width, y: cy },
top: { x: cx, y: rect.top },
bottom: { x: cx, y: rect.top + rect.height }
};
};
const conns = [];
this.lineDefs.forEach((ld) => {
const fromEl = this.$refs[ld.from];
const toEl = this.$refs[ld.to];
const f = buildMetrics(fromEl);
const t = buildMetrics(toEl);
if (!f || !t) return;
const fa = getEdgeAnchors(f);
const ta = getEdgeAnchors(t);
const dx = (t.left + t.width / 2) - (f.left + f.width / 2);
const dy = (t.top + t.height / 2) - (f.top + f.height / 2);
//
const hStart = dx >= 0 ? fa.right : fa.left;
const hEnd = dx >= 0 ? ta.left : ta.right;
const hLen = Math.abs(hEnd.x - hStart.x) + Math.abs(hEnd.y - hStart.y);
const hMidX = (hStart.x + hEnd.x) / 2;
const hPoints = `${hStart.x},${hStart.y} ${hMidX},${hStart.y} ${hMidX},${hEnd.y} ${hEnd.x},${hEnd.y}`;
//
const vStart = dy >= 0 ? fa.bottom : fa.top;
const vEnd = dy >= 0 ? ta.top : ta.bottom;
const vLen = Math.abs(vEnd.x - vStart.x) + Math.abs(vEnd.y - vStart.y);
const vMidY = (vStart.y + vEnd.y) / 2;
const vPoints = `${vStart.x},${vStart.y} ${vStart.x},${vMidY} ${vEnd.x},${vMidY} ${vEnd.x},${vEnd.y}`;
// L
const useH = hLen <= vLen;
conns.push({ id: ld.id, points: useH ? hPoints : vPoints });
});
this.connections = conns;
} }
} }
}; };
@ -338,7 +355,7 @@ export default {
.flowchart-wrapper { .flowchart-wrapper {
position: relative; position: relative;
width: 900px; width: 1200px;
height: 700px; height: 700px;
margin: 0 auto; margin: 0 auto;
background-color: white; background-color: white;
@ -357,14 +374,14 @@ export default {
pointer-events: none; pointer-events: none;
} }
line, path { line, path, polyline {
stroke: #999; stroke: #999;
stroke-width: 2px; stroke-width: 2px;
fill: none; fill: none;
transition: all 0.3s ease; transition: all 0.3s ease;
} }
line.active, path.active { line.active, path.active, polyline.active {
stroke: #ff4500; stroke: #ff4500;
stroke-width: 2.5px; stroke-width: 2.5px;
} }

View File

@ -226,7 +226,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="营业执照"> <el-form-item label="营业执照" style="display: none">
<el-upload <el-upload
class = "upload-demo" class = "upload-demo"
action="#" action="#"