Browse Source

bug修复

master
xuhuajiao 3 weeks ago
parent
commit
0aee4257e9
  1. 11
      src/api/inquiryMachine.js
  2. 2
      src/assets/styles/index.scss
  3. 22
      src/assets/styles/style.scss
  4. 81
      src/views/girdList.vue
  5. 47
      src/views/index.vue
  6. 12
      src/views/module/canvasPreview.vue
  7. 2
      src/views/module/search.vue
  8. 41
      src/views/regionsList.vue
  9. 102
      src/views/shelfList.vue

11
src/api/inquiryMachine.js

@ -81,6 +81,14 @@ export function FetchInitBookDetailsByGrids(params) {
})
}
// 根据书架和架位查看层架位
export function FetchShelfGridByShelfIdAndGridShelf(params) {
return request({
url: 'api/queryDeviceAPI/getShelfGridByShelfIdAndGridShelf' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 图书详情
export function FetchInitBookDetailsSearchInto(params) {
return request({
@ -126,5 +134,6 @@ export default {
FetchInitBookDetailsByGrids,
FetchInitHotBookList,
FetchInitHotShelfList,
FetchBookDetaisByBookRecNo
FetchBookDetaisByBookRecNo,
FetchShelfGridByShelfIdAndGridShelf
}

2
src/assets/styles/index.scss

@ -562,7 +562,7 @@
align-items: center;
color: #0C0E1E;
background-color: #fff;
margin-bottom: 20px;
// margin-bottom: 20px;
h4{
flex: 1;
}

22
src/assets/styles/style.scss

@ -178,3 +178,25 @@ ul{
}
}
}
.swiper-title{
font-size: 22px;
color: #545B65;
.swiper-wrapper{
margin: 10px 0;
border-bottom: 1px solid #EDEFF3;
}
}
.swiper-slide-title {
width: auto !important;
margin-right: 20px;
cursor: pointer;
.tab-name {
padding: 10px;
&.active {
padding-bottom: 10px;
color: #0348F3;
border-bottom: 3px solid #0348F3;
}
}
}

81
src/views/girdList.vue

@ -91,9 +91,31 @@
</div>
</div>
<ul class="change-layer">
<!-- <ul class="change-layer">
<li v-for="(item,index) in rackOptions" :key="index" :class="{ 'active': layerVal === index+1 }" @click="changeShelfGetGrid(parseInt(item.name))">{{ item.name }}</li>
</ul>
</ul> -->
<swiper
ref="swiperTitleLayer"
class="swiper-title layerShelf-swiper"
:options="swiperOptionTitlelayer"
:auto-update="true"
:auto-destroy="true"
>
<swiper-slide
v-for="(item,index) in rackOptions"
:key="index"
ref="swiperSlideItem"
class="swiper-slide-title"
>
<div
class="tab-name"
:class="{ active: layerVal === index+1 }"
@click="changeShelfGetGrid(parseInt(item.name))"
>
{{ item.name }}
</div>
</swiper-slide>
</swiper>
</div>
</div>
<BookDetails ref="bookDetailsRef" />
@ -105,14 +127,16 @@ import { FetchShelfGridByShelfIdAndGridShelf, FetchBillByShelfIdAndGridShelf, Fe
import { positionCrud } from './mixins/index.js'
import Search from './module/search'
import BookDetails from './module/bookDetails'
import { Swiper } from 'vue-awesome-swiper'
import { Swiper, swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
export default {
name: 'Index',
components: {
Search,
BookDetails
BookDetails,
swiper,
swiperSlide
},
mixins: [positionCrud],
data() {
@ -148,10 +172,19 @@ export default {
baseStockData: [],
shelfAllGridDataLoading: false,
billNoImg: null,
bigImg: ''
bigImg: '',
gridName: '',
getGridToward: 1,
swiperOptionTitlelayer: {
slidesPerView: 'auto',
freeMode: true
}
}
},
computed: {
swiperTitleLayer() {
return this.$refs.swiperTitleLayer.$el.swiper
},
cellStyle: function() {
const h = '76px'
const w = '100%/' + this.rackNum
@ -176,6 +209,7 @@ export default {
const dataScreenShelf = JSON.parse(localStorage.getItem('dataScreenShelf'))
this.floorName = dataScreenShelf.floorName
this.regionName = dataScreenShelf.regionName
this.gridName = dataScreenShelf.gridName
this.gridRow = dataScreenShelf.gridRow
this.gridShelf = dataScreenShelf.gridShelf
@ -339,13 +373,27 @@ export default {
hidePopover() {
this.popoverIndex = null
},
updateParts(gridName) {
const parts = gridName.match(/(\d+)区(\d+)排([A-Za-z])面(\d+)架(\d+)层/)
if (parts) {
this.getGridShelf = parts[4]
this.getGridFloor = parts[5]
const toward = parts[3]
if (toward === 'A') {
this.getGridToward = 1
} else if (toward === 'B') {
this.getGridToward = 2
}
}
},
changeShelfGetGrid(val) {
this.updateParts(this.gridName)
this.shelfAllGridDataLoading = true
this.layerVal = val
const params = {
'gridShelf': '0' + val,
'shelfId': this.bookShelfDetails.id,
'toward': this.bookShelfDetails.toward,
'toward': this.getGridToward,
'floorType': this.bookShelfDetails.floorType
}
FetchShelfGridByShelfIdAndGridShelf(params).then(res => {
@ -505,4 +553,25 @@ export default {
}
}
.layerShelf-swiper{
margin-top: 20px;
::v-deep .swiper-wrapper{
font-size: 20px;
border-bottom: none !important;
.swiper-slide-title {
width: auto !important;
margin-right: 20px;
cursor: pointer;
.tab-name {
padding: 5px 10px;
&.active {
background-color: #0348F3;
color: #fff;
border-radius: 6px;
border: 2px solid #0348F3;
}
}
}
}
}
</style>

47
src/views/index.vue

@ -6,10 +6,34 @@
<h4 class="filter-header">图书馆总览</h4>
</div>
<div class="home-wrap tab-content">
<ul class="tab-nav">
<swiper
ref="swiperTitle"
class="swiper-title"
:options="swiperOptionTitle"
:auto-update="true"
:auto-destroy="true"
>
<swiper-slide
v-for="(item,index) in floorOptions"
:key="index"
ref="swiperSlideItem"
class="swiper-slide-title"
>
<div
class="tab-name"
:class="{ active: index === tabIndex }"
@click="changeActiveTab(index)"
>
{{ item.floorName }}
</div>
</swiper-slide>
</swiper>
<!-- <ul class="tab-nav">
<li v-for="(item,index) in floorOptions" :key="index" :class="{ 'active-tab-nav': tabIndex == index }" @click="changeActiveTab(index)">{{ item.floorName }}<i /></li>
</ul>
</ul> -->
<CanvasPreview ref="previewRefs" v-loading="prewLoading" page-preview="floor" :current-mark-data="currentMarkData" :image-url="imageUrl" />
</div>
</div>
@ -32,11 +56,13 @@ import Search from './module/search'
import Ranking from './module/ranking'
import ShelfRanking from './module/shelfRanking'
import defaultImg from '@/assets/images/default-img-bg.jpg'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
export default {
name: 'Index',
components: {
Search, CanvasPreview, Ranking, ShelfRanking
Search, CanvasPreview, Ranking, ShelfRanking, swiper, swiperSlide
},
mixins: [positionCrud],
data() {
@ -49,14 +75,24 @@ export default {
imageRegionUrl: defaultImg,
currentMarkData: null,
allCoverData: [],
baseStockDataAllShelf: []
baseStockDataAllShelf: [],
swiperOptionTitle: {
slidesPerView: 'auto',
freeMode: true
}
}
},
computed: {
swiperTitle() {
return this.$refs.swiperTitle.$el.swiper
}
},
created() {
this.getFloorList()
},
mounted() {
},
beforeDestroy() {
},
methods: {
getFloorList() {
@ -77,6 +113,7 @@ export default {
}
this.allCoverData = []
this.tabIndex = index
this.swiperTitle.slideTo(index, 500, false)
const params = {
'floorId': this.floorOptions[index].id
}

12
src/views/module/canvasPreview.vue

@ -86,11 +86,11 @@ export default {
}
},
mounted() {
if (this.canvasPreview.lowerCanvasEl) {
this.canvasPreview.getCanvas().el.addEventListener('touchstart', this.handleTouchStart.bind(this))
this.canvasPreview.getCanvas().el.addEventListener('touchmove', this.handleTouchMove.bind(this))
this.canvasPreview.getCanvas().el.addEventListener('touchend', this.handleTouchEnd.bind(this))
}
// if (this.canvasPreview.lowerCanvasEl) {
// this.canvasPreview.getCanvas().el.addEventListener('touchstart', this.handleTouchStart.bind(this))
// this.canvasPreview.getCanvas().el.addEventListener('touchmove', this.handleTouchMove.bind(this))
// this.canvasPreview.getCanvas().el.addEventListener('touchend', this.handleTouchEnd.bind(this))
// }
},
beforeDestroy() {
// if (this.canvasPreview) {
@ -332,6 +332,6 @@ export default {
width: 100%;
background-color: #fff;
overflow: hidden;
margin-top: -30px;
// margin-top: -30px;
}
</style>

2
src/views/module/search.vue

@ -56,7 +56,7 @@ export default {
getHotSearch() {
const params = {
'fondsCode': this.libcode,
'size': 30
'size': 5
}
FetchFindHotSearch(params).then(res => {
this.keywordData = res.filter(item => {

41
src/views/regionsList.vue

@ -13,9 +13,31 @@
</div>
</div>
<div class="home-wrap tab-content">
<ul class="tab-nav">
<!-- <ul class="tab-nav">
<li v-for="(item,index) in regionOptions" :key="index" :class="{ 'active-tab-nav': tabIndex == index }" @click="changeActiveTab(index)">{{ item.regionName }}<i /></li>
</ul>
</ul> -->
<swiper
ref="swiperTitle"
class="swiper-title"
:options="swiperOptionTitle"
:auto-update="true"
:auto-destroy="true"
>
<swiper-slide
v-for="(item,index) in regionOptions"
:key="index"
ref="swiperSlideItem"
class="swiper-slide-title"
>
<div
class="tab-name"
:class="{ active: tabIndex == index }"
@click="changeActiveTab(index)"
>
{{ item.regionName }}
</div>
</swiper-slide>
</swiper>
<CanvasPreview ref="previewRefs" v-loading="prewLoading" page-preview="region" :current-mark-data="currentMarkData" :image-url="imageUrl" />
</div>
</div>
@ -28,11 +50,13 @@ import CanvasPreview from './module/canvasPreview'
import { positionCrud } from './mixins/index.js'
import Search from './module/search'
import defaultImg from '@/assets/images/default-img-bg.jpg'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
export default {
name: 'Index',
components: {
Search, CanvasPreview
Search, CanvasPreview, swiper, swiperSlide
},
mixins: [positionCrud],
data() {
@ -49,7 +73,16 @@ export default {
imageRegionUrl: defaultImg,
currentMarkData: null,
allCoverData: [],
baseStockDataAllShelf: []
baseStockDataAllShelf: [],
swiperOptionTitle: {
slidesPerView: 'auto',
freeMode: true
}
}
},
computed: {
swiperTitle() {
return this.$refs.swiperTitle.$el.swiper
}
},
created() {

102
src/views/shelfList.vue

@ -20,9 +20,31 @@
</div>
</div>
<div class="tab-content">
<ul class="tab-nav">
<!-- <ul class="tab-nav">
<li v-for="(item,index) in tabListData" :key="index" :class="{ 'active-tab-nav': tabIndex == index }" @click="changeActiveTab(index)">{{ item.name }}<i /></li>
</ul>
</ul> -->
<swiper
ref="swiperTitle"
class="swiper-title"
:options="swiperOptionTitle"
:auto-update="true"
:auto-destroy="true"
>
<swiper-slide
v-for="(item,index) in tabListData"
:key="index"
ref="swiperSlideItem"
class="swiper-slide-title"
>
<div
class="tab-name"
:class="{ active: tabIndex == index }"
@click="changeActiveTab(index)"
>
{{ item.name }}
</div>
</swiper-slide>
</swiper>
<div class="tag-info">
<!-- <p class="tag-sort">错序<i class="iconfont icon-zhuangtai2" /></p>
<p class="tag-place">错架<i class="iconfont icon-zhuangtai2" /></p> -->
@ -75,9 +97,31 @@
</el-popover>
</li>
</ul>
<ul class="change-layer">
<!-- <ul class="change-layer">
<li v-for="(item,index) in layerOptions" :key="index" :class="{ 'active': item.name === layerVal.name }" @click="changeShelfGetGrid(item)">{{ item.name }}</li>
</ul>
</ul> -->
<swiper
ref="swiperTitleLayer"
class="swiper-title layerShelf-swiper"
:options="swiperOptionTitlelayer"
:auto-update="true"
:auto-destroy="true"
>
<swiper-slide
v-for="(item,index) in layerOptions"
:key="index"
ref="swiperSlideItem"
class="swiper-slide-title"
>
<div
class="tab-name"
:class="{ active: item.name === layerVal.name }"
@click="changeShelfGetGrid(item)"
>
{{ item.name }}
</div>
</swiper-slide>
</swiper>
</div>
</div>
</div>
@ -87,11 +131,13 @@
import { FetchShelfListByRegionId, FetchShelfGridAllByShelfIdText, FetchBookShelfDetails, FetchInitStockInfo } from '@/api/inquiryMachine'
import { positionCrud } from './mixins/index.js'
import Search from './module/search'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
export default {
name: 'Index',
components: {
Search
Search, swiper, swiperSlide
},
mixins: [positionCrud],
data() {
@ -129,10 +175,24 @@ export default {
itemStockData: {},
touchStartTime: null,
touchStartPosition: null,
doubleClickTimeout: null
doubleClickTimeout: null,
swiperOptionTitle: {
slidesPerView: 'auto',
freeMode: true
},
swiperOptionTitlelayer: {
slidesPerView: 'auto',
freeMode: true
}
}
},
computed: {
swiperTitle() {
return this.$refs.swiperTitle.$el.swiper
},
swiperTitleLayer() {
return this.$refs.swiperTitleLayer.$el.swiper
},
cellStyle: function() {
const h = '76px'
const w = '118px'
@ -201,7 +261,12 @@ export default {
this.bookShelfDetails = res
if (this.$route.query.tabIndex) {
this.getInitShelfGridByShelfId(this.bookShelfDetails.id, this.$route.query.tabIndex + 1)
if (this.bookShelfDetails.rowType === 1) {
this.tabIndex = 0
this.getInitShelfGridByShelfId(this.bookShelfDetails.id, this.bookShelfDetails.toward)
} else {
this.getInitShelfGridByShelfId(this.bookShelfDetails.id, parseInt(this.$route.query.tabIndex) + 1)
}
} else {
this.getInitShelfGridByShelfId(this.bookShelfDetails.id, this.bookShelfDetails.toward)
}
@ -350,7 +415,9 @@ export default {
changeActiveTab(index) {
this.tabIndex = index
this.cellIndex = null
console.log('index', index)
this.getInitShelfGridByShelfId(this.layerVal.id, index + 1)
this.swiperTitle.slideTo(index, 500, false)
},
handleCellCurrent(item, index) {
this.cellIndex = index
@ -626,4 +693,25 @@ export default {
}
.layerShelf-swiper{
margin-top: 20px;
::v-deep .swiper-wrapper{
font-size: 20px;
border-bottom: none !important;
.swiper-slide-title {
width: auto !important;
margin-right: 20px;
cursor: pointer;
.tab-name {
padding: 5px 10px;
&.active {
background-color: #0348F3;
color: #fff;
border-radius: 6px;
border: 2px solid #0348F3;
}
}
}
}
}
</style>
Loading…
Cancel
Save