|
|
|
@ -176,6 +176,7 @@ export default { |
|
|
|
callNumVisible: false, |
|
|
|
layerNum: 0, |
|
|
|
rackNum: 0, |
|
|
|
startShelf: 1, |
|
|
|
swiperActiveIndex: 0, |
|
|
|
cellIndex: null, |
|
|
|
columnIndex: null, |
|
|
|
@ -224,11 +225,27 @@ export default { |
|
|
|
return { width: `calc(${w})` } |
|
|
|
}, |
|
|
|
reversedRackNum() { |
|
|
|
console.log('startShelf', this.startShelf) |
|
|
|
console.log('booShelfGrid', this.booShelfGrid) |
|
|
|
const start = parseInt(this.startShelf) || 1 |
|
|
|
// 计算理论上的最后一个架号 |
|
|
|
const end = start + this.rackNum - 1 |
|
|
|
console.log('起始架号:', start, '总数量:', this.rackNum, '理论最后架号:', end) |
|
|
|
|
|
|
|
if (this.booShelfGrid && this.booShelfGrid.length > 0) { |
|
|
|
if (parseInt(this.booShelfGrid[0].gridShelf) === this.rackNum) { |
|
|
|
return Array.from({ length: this.rackNum }, (_, i) => this.rackNum - i).map(x => x.toString()) |
|
|
|
const firstGridShelf = parseInt(this.booShelfGrid[0].gridShelf) |
|
|
|
console.log('实际第一个架号:', firstGridShelf) |
|
|
|
|
|
|
|
if (firstGridShelf === end) { |
|
|
|
console.log('书架倒置:从', end, '递减到', start) |
|
|
|
return Array.from({ length: this.rackNum }, (_, i) => { |
|
|
|
return (end - i).toString() |
|
|
|
}) |
|
|
|
} else { |
|
|
|
return Array.from({ length: this.rackNum }, (_, i) => i + 1).map(x => x.toString()) |
|
|
|
console.log('书架正序:从', start, '递增到', end) |
|
|
|
return Array.from({ length: this.rackNum }, (_, i) => { |
|
|
|
return (start + i).toString() |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
return [] |
|
|
|
@ -279,6 +296,8 @@ export default { |
|
|
|
FetchBookShelfDetails({ 'shelfId': data.id }).then(res => { |
|
|
|
this.layerNum = res.shelfFloor |
|
|
|
this.rackNum = res.shelfShelf |
|
|
|
this.startShelf = res.startShelf |
|
|
|
// this.startShelf = 3 |
|
|
|
this.bookShelfDetails = res |
|
|
|
|
|
|
|
if (this.$route.query.tabIndex) { |
|
|
|
|