共享大厅
@@ -177,7 +100,8 @@
共享出库
@@ -186,7 +110,8 @@
共享退库
@@ -195,12 +120,30 @@
装备下架
+
+
+
@@ -220,6 +163,24 @@ export default {
return {
activeNode: 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: {
equipmentEntry: {
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: {
nodeInfo() {
return this.nodeData[this.activeNode] || {};
@@ -315,6 +283,55 @@ export default {
} else if (nodeId === 'equipmentRepair') {
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 {
position: relative;
- width: 900px;
+ width: 1200px;
height: 700px;
margin: 0 auto;
background-color: white;
@@ -357,14 +374,14 @@ export default {
pointer-events: none;
}
-line, path {
+line, path, polyline {
stroke: #999;
stroke-width: 2px;
fill: none;
transition: all 0.3s ease;
}
-line.active, path.active {
+line.active, path.active, polyline.active {
stroke: #ff4500;
stroke-width: 2.5px;
}
diff --git a/src/views/material/ma/supplier/index.vue b/src/views/material/ma/supplier/index.vue
index 0795e508..b712331b 100644
--- a/src/views/material/ma/supplier/index.vue
+++ b/src/views/material/ma/supplier/index.vue
@@ -64,7 +64,7 @@
v-hasPermi="['machinery:type:add']"
>新增
-
+
导出
-
+
-
+
@@ -128,7 +128,7 @@
-
+
-
+
@@ -160,7 +160,7 @@
-
+
@@ -180,7 +180,7 @@
/>
-
+
@@ -201,8 +201,8 @@
/>
-
-
+
+
@@ -210,7 +210,7 @@
-
+
@@ -223,10 +223,10 @@
show-word-limit
>
-
+
-
-
+
+
-
+
-
+