Browse Source

本架图书默认5层

master
z_yu 2 years ago
parent
commit
2ca0a44388
  1. 9
      src/views/bookRackList.vue

9
src/views/bookRackList.vue

@ -62,7 +62,6 @@ export default {
initSwiper() { initSwiper() {
this.$nextTick(() => { this.$nextTick(() => {
for (const key in this.bookList) { for (const key in this.bookList) {
console.log(key)
this.bookList[key].forEach((el, index) => { this.bookList[key].forEach((el, index) => {
new Swiper('.swiper' + index, { new Swiper('.swiper' + index, {
slidesPerView: 'auto', slidesPerView: 'auto',
@ -114,6 +113,14 @@ export default {
params.shelfNo = this.$route.query.rightShelfNo params.shelfNo = this.$route.query.rightShelfNo
} }
initBookshelfDetails(params).then((res) => { initBookshelfDetails(params).then((res) => {
console.log(this.listData)
if (res.shelfs.length === 0) {
res.shelfs.push('firstShelf', 'secondShelf', 'thirdShelf', 'fourthShelf', 'fivethShelf')
for (let index = 0; index < res.shelfs.length; index++) {
const shelfNo = res.shelfs[index]
res.shelfBook[shelfNo] = []
}
}
this.listData.splice(0, this.listData.length, ...res.shelfs) this.listData.splice(0, this.listData.length, ...res.shelfs)
for (let index = 0; index < res.shelfs.length; index++) { for (let index = 0; index < res.shelfs.length; index++) {
const shelfNo = res.shelfs[index] const shelfNo = res.shelfs[index]

Loading…
Cancel
Save