|
@@ -2,25 +2,34 @@
|
|
|
<a-card>
|
|
|
<a-tabs :default-active-key="defaultActive" @change="handleClick">
|
|
|
<a-tab-pane v-for="(item, index) in positionsList" :tab="item.name" :key="index">
|
|
|
- <div style="position: relative;">
|
|
|
- <div class="point" v-for="store in storeList" :key="store.id" :style="computPosition(store.positionX, store.positionY)" />
|
|
|
+ <div style="position: relative;" v-show="visible">
|
|
|
+ <div class="point" v-for="store in storeList" :key="store.id" :style="computPosition(store.positionX, store.positionY)" @click="handleView(store)">
|
|
|
+ {{ store.name }}
|
|
|
+ </div>
|
|
|
<img v-if="item.opcImg" :src="item.opcImg" width="100%" alt="">
|
|
|
<a-empty v-else description="暂无底图,请上传" />
|
|
|
</div>
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
+ <StoreDetailMap ref="storeDetailMap" @ok="handleOk" />
|
|
|
+
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { querySbPosition } from '@/api/sb/position'
|
|
|
import { fetchStorePosition, fetchStoreStore } from '@/api/store/store'
|
|
|
+import StoreDetailMap from './modules/StoreDetailMap.vue'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ StoreDetailMap
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
positionsList: [],
|
|
|
defaultActive: 0,
|
|
|
- storeList: []
|
|
|
+ storeList: [],
|
|
|
+ visible: true
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -35,22 +44,34 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
computPosition (x, y) {
|
|
|
- const left = x + '%'
|
|
|
- const top = y + '%'
|
|
|
+ const left = `calc(${x}% - 35px)`
|
|
|
+ const top = `calc(${y}% - 85px)`
|
|
|
return {
|
|
|
left, top
|
|
|
}
|
|
|
},
|
|
|
handleClick (i) {
|
|
|
this.defaultActive = i
|
|
|
+ this.visible = true
|
|
|
+ this.$refs.storeDetailMap.handleCancel()
|
|
|
fetchStorePosition({ id: this.positionsList[i].id }).then(res => {
|
|
|
this.storeList = res.data
|
|
|
})
|
|
|
},
|
|
|
- handleClickImg (e) {
|
|
|
- console.log(e.offsetX, e.offsetY)
|
|
|
- console.log(e.target.width, e.target.height)
|
|
|
- // console.log(e.offsetX, e.offsetY)
|
|
|
+ handleView (store) {
|
|
|
+ if (!store.existPosition) {
|
|
|
+ this.$message.warning('该仓库不存在库位!')
|
|
|
+ } else if (!store.backGroundMap) {
|
|
|
+ this.$message.warning('该仓库未上传底图!')
|
|
|
+ } else {
|
|
|
+ fetchStoreStore({ id: store.id }).then(res => {
|
|
|
+ this.visible = false
|
|
|
+ this.$refs.storeDetailMap.base(res.data, store.backGroundMap)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleOk () {
|
|
|
+ this.visible = true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -59,9 +80,18 @@ export default {
|
|
|
<style lang="less" scoped>
|
|
|
.point {
|
|
|
position: absolute;
|
|
|
- width: 10px;
|
|
|
- height: 10px;
|
|
|
- background: red;
|
|
|
border-radius: 50%;
|
|
|
+ background: url(~@/assets/a/6.png) repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ // border: 2px solid #fff;
|
|
|
+ color: #fff;
|
|
|
+ height: 80px;
|
|
|
+ width: 70px;
|
|
|
+display: flex;
|
|
|
+justify-content: center;
|
|
|
+align-items: center;
|
|
|
+text-align: center;
|
|
|
+ font-size: 12px;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
</style>
|