File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -248,10 +248,16 @@ export default {
248248 const sliceUnitList = this .unitList .slice (0 , e .newIndex )
249249 const unitCount = sliceUnitList .reduce ((acc , cur ) => acc + cur .unitCount , 0 )
250250
251+ const u_numbering_direction = this ? .rackData ? .u_numbering_direction
251252 /**
252- * 拖拽后的起始U位 = 总U数 - 该设备以上的U数 - 该设备U数 + 1
253+ * 根据 u_numbering_direction (U位编号方向),计算拖拽后的起始U位
254+ * 从下往上: 拖拽后的起始U位 = 总U数 - 该设备以上的设备U数合计 - 该设备U数 + 1
255+ * 从上往下: 拖拽后的起始U位 = 该设备以上的设备U数合计 + 1
253256 */
254- const startUnit = this .countList .length - unitCount - this .draggableDevice .unitCount + 1
257+ let startUnit = this .countList .length - unitCount - this .draggableDevice .unitCount + 1
258+ if (u_numbering_direction === U_NUMBERING_DIRECTION .TOP_TO_BOTTOM ) {
259+ startUnit = unitCount + 1
260+ }
255261
256262 if (this ? .draggableDevice ? .id ) {
257263 this .$emit (' draggable' , {
You can’t perform that action at this time.
0 commit comments