Browse Source

3d库房-密集架

master
xuhuajiao 3 years ago
parent
commit
675cceb882
  1. 19
      public/webA/index.js
  2. 4
      public/webC/index.js
  3. 20
      public/webTotal/index.js
  4. BIN
      src/assets/images/panel-y.png
  5. 247
      src/views/storeManage/warehouse3D/deseCabinet/data.json
  6. 265
      src/views/storeManage/warehouse3D/deseCabinet/index.vue

19
public/webA/index.js

@ -889,12 +889,19 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
scene.getMeshByName("档案架02_primitive4").material = scene.getMaterialByName("09.004"); scene.getMeshByName("档案架02_primitive4").material = scene.getMaterialByName("09.004");
scene.getMeshByName("档案架01_primitive3").material = scene.getMaterialByName("10.004"); scene.getMeshByName("档案架01_primitive3").material = scene.getMaterialByName("10.004");
scene.getTransformNodeByName("档案柜01").setEnabled(false);
scene.getTransformNodeByName("档案柜02").setEnabled(false);
var v1 = scene.getMeshByName("钢轨01");
v1.position = new BABYLON.Vector3(v1.position.x,60.0,v1.position.z);
v1.scaling = new BABYLON.Vector3(1,0.9,1);
// 还原到10列,注释掉下面代码
// scene.getTransformNodeByName("档案柜01").setEnabled(false);
// scene.getTransformNodeByName("档案柜02").setEnabled(false);
// var v1 = scene.getMeshByName("钢轨01");
// v1.position = new BABYLON.Vector3(v1.position.x,60.0,v1.position.z);
// v1.scaling = new BABYLON.Vector3(1,0.9,1);
var v2 = scene.getTransformNodeByName("后门01");
v2.setParent( scene.getTransformNodeByName("档案柜03"),true);
v2.position = new BABYLON.Vector3(v2.position.x,-122.479,v2.position.z);
// player_balloon_js1.isVisible = false;
// player_balloon_js2.isVisible = false;
// 给vue页面传值,加载完成之后 // 给vue页面传值,加载完成之后
parent.getIframeLoading("false") parent.getIframeLoading("false")

4
public/webC/index.js

@ -488,6 +488,10 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
plane.rotation = new BABYLON.Vector3((90 * Math.PI) / 180, 0, 0); plane.rotation = new BABYLON.Vector3((90 * Math.PI) / 180, 0, 0);
plane.scaling = new BABYLON.Vector3(1.2, 0.8, 1); plane.scaling = new BABYLON.Vector3(1.2, 0.8, 1);
// 墙体添加透明度
scene.getMaterialByName("cover_label.001").alpha = 0.7;
scene.getMaterialByName("cover_label.001").transparencyMode=2; //ALPHABLEND
// 给vue页面传值,加载完成之后 // 给vue页面传值,加载完成之后
parent.getIframeLoading("false") parent.getIframeLoading("false")
}; };

20
public/webTotal/index.js

@ -497,12 +497,20 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() {
scene.getMeshByName("档案架09_primitive4").material = scene.getMaterialByName("02.002"); scene.getMeshByName("档案架09_primitive4").material = scene.getMaterialByName("02.002");
scene.getMeshByName("档案架10_primitive3").material = scene.getMaterialByName("01.002"); scene.getMeshByName("档案架10_primitive3").material = scene.getMaterialByName("01.002");
scene.getTransformNodeByName("档案柜01").setEnabled(false);
scene.getTransformNodeByName("档案柜02").setEnabled(false);
var v1 = scene.getMeshByName("钢轨01");
v1.position = new BABYLON.Vector3(v1.position.x,60.0,v1.position.z);
v1.scaling = new BABYLON.Vector3(1,0.9,1);
// 还原到10列,注释掉下面代码
// scene.getTransformNodeByName("档案柜01").setEnabled(false);
// scene.getTransformNodeByName("档案柜02").setEnabled(false);
// var v1 = scene.getMeshByName("钢轨01");
// v1.position = new BABYLON.Vector3(v1.position.x,60.0,v1.position.z);
// v1.scaling = new BABYLON.Vector3(1,0.9,1);
var v2 = scene.getTransformNodeByName("后门01");
v2.setParent( scene.getTransformNodeByName("档案柜03"),true);
v2.position = new BABYLON.Vector3(v2.position.x,-122.479,v2.position.z);
// 墙体添加透明度
scene.getMaterialByName("cover_label.010").alpha = 0.7;
scene.getMaterialByName("cover_label.010").transparencyMode=2; //ALPHABLEND
}; };

BIN
src/assets/images/panel-y.png

Before

Width: 165  |  Height: 710  |  Size: 24 KiB

After

Width: 165  |  Height: 710  |  Size: 24 KiB

247
src/views/storeManage/warehouse3D/deseCabinet/data.json

@ -1,247 +0,0 @@
{
"totalData": 36,
"leftData":[
{
"outNum": 1,
"inNum": 2
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 10
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 30,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
}
],
"rightData":[
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 1,
"inNum": 2
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 15,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
},
{
"outNum": 0,
"inNum": 0
}
]
}

265
src/views/storeManage/warehouse3D/deseCabinet/index.vue

@ -9,39 +9,52 @@
<el-button type="primary" class="return-btn" @click="backWarehouse">3D</el-button> <el-button type="primary" class="return-btn" @click="backWarehouse">3D</el-button>
</div> </div>
</div> </div>
<div v-if="deviceData" style="color: #fff;margin-bottom: 10px;">
{{ '节total:'+ deviceData.partNo }}
{{ '层total:'+ deviceData.rowNo }}
</div>
<div class="cabinet-main"> <div class="cabinet-main">
<ul v-if="deviceData" class="cabinet-row">
<!-- width: calc(100%/4 - 10px);height: calc(100%/5 - 10px); -->
<li v-for="(item,index) in left" :key="index" class="cabinet-cell" :style="cellStyle">
<div v-if="item.row_No === 5" style="font-size:12px">
<!-- <span>{{ 'index=' + (index+1) + '/借出=' + item.borrow+ '/在库=' + ( item.total - item.borrow) + '/节' + item.part_No + '/层' + item.row_No }}</span> -->
<span>{{ 'index=' + (index+1)%deviceData.rowNo + '/' + item.part_No + '节' + item.row_No + '层' }}</span>
<!-- 无库房当前列数据时 - 左边 -->
<div v-if="deviceData" class="cabinet-num row-left-num">
<span v-for="(item,index) in rowNum" :key="index" :style="heightStyle"><i>{{ item }}</i></span>
</div> </div>
<!-- 部分借出 -->
<!-- <div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="out-part">
<span>{{ 'index=' + index + '/部分借出=' + item.borrow + '/节' + item.part_No + '/层' + item.row_No }}</span>
<div v-if="deviceData" class="cabinet-num part-left-num">
<span v-for="(item,index) in partLeftNum" :key="index" :style="widhtStyle">{{ item }}</span>
</div>
<ul v-if="sortLeft.length === 0" class="cabinet-row">
<li v-for="(item,i) in totalPartRowNum" :key="i" class="cabinet-cell" :style="cellStyle" />
</ul>
<ul v-else class="cabinet-row">
<li v-for="(item,index) in sortLeft" :key="index" class="cabinet-cell" :style="cellStyle">
<!-- <div v-if="item.borrow === 0 && item.total === 0" style="font-size:12px">
{{ item.part_No + '节' + item.row_No + '层' }}
</div> --> </div> -->
<!-- 部分借出 -->
<div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="out-part">
<span>{{ item.borrow }}</span>
</div>
<!-- 部分在库 --> <!-- 部分在库 -->
<!-- <div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="in-part">
<span>{{ 'index=' + index + '/部分在库=' + ( item.total - item.borrow) + '/节' + item.part_No + '/层' + item.row_No }}</span>
</div> -->
<div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="in-part">
<span>{{ item.total - item.borrow }}</span>
</div>
<!-- 全部借出 --> <!-- 全部借出 -->
<!-- <div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="out-all">
<span>{{ 'index=' + index + '/全部借出=' + item.borrow + '/节' + item.part_No + '/层' + item.row_No }}</span>
</div> -->
<div v-if="item.borrow !== 0 && item.total - item.borrow === 0" class="out-all">
<span>{{ item.borrow }}</span>
</div>
<!-- 全部在库 --> <!-- 全部在库 -->
<!-- <div v-if="item.borrow === 0 && item.total - item.borrow == 0" class="in-all">
<span>{{ 'index=' + index + '/全部在库=' + ( item.total - item.borrow) + '/节' + item.part_No + '/层' + item.row_No }}</span>
</div> -->
<div v-if="item.borrow === 0 && item.total - item.borrow !== 0" class="in-all">
<span>{{ item.total - item.borrow }}</span>
</div>
</li> </li>
</ul> </ul>
<div :class="['cabinet-panel', isFixed ? 'fixed-panel' : '']" /> <div :class="['cabinet-panel', isFixed ? 'fixed-panel' : '']" />
<ul class="cabinet-row">
<li v-for="(item,index) in right" :key="index" class="cabinet-cell">
<!-- 无库房当前列数据时 - 右边 -->
<ul v-if="sortLeft.length === 0" class="cabinet-row right-cabinet">
<ul v-for="(item,i) in totalPartRowNum" :key="i" class="cabinet-cell" :style="cellStyle" />
</ul>
<ul v-else class="cabinet-row right-cabinet">
<li v-for="(item,index) in sortRight" :key="index" class="cabinet-cell" :style="cellStyle">
<!-- <div v-if="item.borrow === 0 && item.total === 0" style="font-size:12px">
{{ item.part_No + '节' + item.row_No + '层' }}
</div> -->
<!-- 部分借出 --> <!-- 部分借出 -->
<div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="out-part"> <div v-if="item.borrow !== 0 && item.total - item.borrow !== 0" class="out-part">
<span>{{ item.borrow }}</span> <span>{{ item.borrow }}</span>
@ -60,6 +73,12 @@
</div> </div>
</li> </li>
</ul> </ul>
<div v-if="deviceData" class="cabinet-num row-right-num">
<span v-for="(item,index) in rowNum" :key="index" :style="heightStyle"><i>{{ item }}</i></span>
</div>
<div v-if="deviceData" class="cabinet-num part-right-num">
<span v-for="(item,index) in partRightNum" :key="index" :style="widhtStyle">{{ item }}</span>
</div>
</div> </div>
<div class="cabinet-bottom"> <div class="cabinet-bottom">
<el-button type="primary" :disabled="isFixed">开架</el-button> <el-button type="primary" :disabled="isFixed">开架</el-button>
@ -73,7 +92,6 @@
<script> <script>
import { FetchGetArchivesNum } from '@/api/archivesManage/statistics' import { FetchGetArchivesNum } from '@/api/archivesManage/statistics'
import { getDeviceList, FetchInBorrowByQuCol } from '@/api/storeManage/deviceManage/device' import { getDeviceList, FetchInBorrowByQuCol } from '@/api/storeManage/deviceManage/device'
import data from './data.json'
export default { export default {
name: 'DeseCabinet', name: 'DeseCabinet',
data() { data() {
@ -84,20 +102,44 @@ export default {
deviceData: null, // data deviceData: null, // data
cabinetNum: null, // num cabinetNum: null, // num
isFixed: false, // isFixed: false, //
totalPartRowNum: null,
archivesNum: null, // archivesNum: null, //
left: [], // left: [], //
right: [] //
sortLeft: [], // left-data
right: [], //
sortRight: [], // right-data
isColumDirection: false, // true false
rowNum: [], //
partLeftNum: [], //
partRightNum: [] //
} }
}, },
computed: { computed: {
cellStyle: function() { cellStyle: function() {
let h
if (this.cabinetNum > 8) {
h = '100%/' + (this.deviceData.rowNo - 1)
} else {
h = '100%/' + this.deviceData.rowNo
}
const w = '100%/' + this.deviceData.partNo const w = '100%/' + this.deviceData.partNo
const h = '100%/' + this.deviceData.rowNo
return { width: `calc(${w} - 10px )`, height: `calc(${h} - 10px)` } return { width: `calc(${w} - 10px )`, height: `calc(${h} - 10px)` }
},
heightStyle: function() {
let h
if (this.cabinetNum > 8) {
h = '100%/' + (this.deviceData.rowNo - 1)
} else {
h = '100%/' + this.deviceData.rowNo
}
return { height: `calc(${h})` }
},
widhtStyle: function() {
const w = '100%/' + this.deviceData.partNo
return { width: `calc(${w} - 10px)` }
} }
}, },
created() { created() {
this.getData()
this.handleArchivesNum() this.handleArchivesNum()
this.getDeviceListAll() this.getDeviceListAll()
}, },
@ -110,18 +152,13 @@ export default {
} }
}, },
methods: { methods: {
// getDeviceList
getData() {
this.total = data.totalData
// this.left = data.leftData
// this.right = data.rightData
},
// //
handleArchivesNum() { handleArchivesNum() {
FetchGetArchivesNum().then(data => { FetchGetArchivesNum().then(data => {
this.archivesNum = data this.archivesNum = data
}) })
}, },
//
getDeviceListAll() { getDeviceListAll() {
const params = { const params = {
page: 0, page: 0,
@ -133,11 +170,30 @@ export default {
data.content.map(item => { data.content.map(item => {
if (item.deviceTypeId.name === '密集架') { if (item.deviceTypeId.name === '密集架') {
this.deviceData = item this.deviceData = item
this.totalPartRowNum = item.partNo * item.rowNo
let rowNo
if (this.cabinetNum > 8) {
rowNo = item.rowNo - 1
} else {
rowNo = item.rowNo
}
for (let i = 0; i < rowNo; i++) {
this.rowNum.push(i + 1)
}
for (let i = 0; i < item.partNo; i++) {
this.partLeftNum.push(i + 1)
this.partRightNum.push(i + 1)
}
this.partLeftNum.reverse()
if (!this.isColumDirection) {
this.rowNum.reverse()
}
this.getInBorrowByQuCol() this.getInBorrowByQuCol()
} }
}) })
}) })
}, },
// /
async getInBorrowByQuCol() { async getInBorrowByQuCol() {
const params = { const params = {
deviceId: this.deviceData.id, deviceId: this.deviceData.id,
@ -145,7 +201,6 @@ export default {
colNo: this.cabinetNum colNo: this.cabinetNum
} }
FetchInBorrowByQuCol(params).then(data => { FetchInBorrowByQuCol(params).then(data => {
console.log(data)
data.forEach(item => { data.forEach(item => {
if (item.direction === '左') { if (item.direction === '左') {
this.left.push(item) this.left.push(item)
@ -154,30 +209,60 @@ export default {
this.right.push(item) this.right.push(item)
} }
}) })
// console.log('left', this.left)
// console.log('right', this.right)
// this.left = this.sortList(this.left, 5)
// console.log(this.left)
this.setReorderData(this.left, this.sortLeft, false)
this.setReorderData(this.right, this.sortRight, true)
}) })
}, },
sortList(list, rows) {
const sortedList = []
let rowIndex = 0
for (var i = 0; i < rows; i++) {
sortedList[i] = []
// left- right-
setReorderData(data, sortData, order) {
let key
if (this.isColumDirection) {
key = 0
} else {
key = this.deviceData.rowNo + 1
}
const arr = []
for (let i = 0; i < this.deviceData.rowNo; i++) {
arr[i] = []
if (this.isColumDirection) {
key++
} else {
key--
}
data.forEach(item => {
if (item.row_No === key) {
arr[i].push(item)
}
if (this.isColumDirection) {
if (key === this.deviceData.rowNo + 1) {
key = 0
}
} else {
if (key === 0) {
key = this.deviceData.rowNo
} }
list.forEach(item => {
sortedList[rowIndex++].push(item)
if ((rowIndex + 1) === rows) {
rowIndex = 0
} }
}) })
return sortedList
this.arrSortByKey(arr[i], 'part_No', order)
}
// data
arr.forEach(item => {
item.forEach(i => {
sortData.push(i)
})
})
},
//
arrSortByKey(array, property, order) {
return array.sort(function(a, b) {
const value1 = a[property]
const value2 = b[property]
if (order) { //
return value1 - value2
} else { //
return value2 - value1
}
})
}, },
// 3D // 3D
backWarehouse() { backWarehouse() {
@ -236,20 +321,86 @@ export default {
background-color: #339CFF; background-color: #339CFF;
} }
.cabinet-main{ .cabinet-main{
position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: calc(100vw - 344px); width: calc(100vw - 344px);
height: calc(100vh - 322px); height: calc(100vh - 322px);
padding-bottom: 30px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
} }
.cabinet-num{
position: absolute;
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
border-radius: 20px;
background-color: #113D72;
span{
position: relative;
display: block;
font-size: 14px;
color: #fff;
text-align: center;
i{
display: block;
font-style: normal;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
.row-left-num{
width: 20px;
height: calc(100vh - 352px);
left: 0;
top: 0;
span{
width: 20px;
}
}
.row-right-num{
width: 20px;
height: calc(100vh - 352px);
right: 0;
top: 0;
span{
width: 20px;
}
}
.part-left-num{
width: calc(100vw/2 - 280px);
height: 20px;
left: 30px;
bottom: 0;
span{
height: 20px;
}
}
.part-right-num{
width: calc(100vw/2 - 280px);
height: 20px;
right: 30px;
bottom: 0;
span{
height: 20px;
}
}
.cabinet-row{ .cabinet-row{
display: flex; display: flex;
flex: 1; flex: 1;
flex-wrap: wrap; flex-wrap: wrap;
color: #fff; color: #fff;
text-align: center; text-align: center;
margin-left: -10px;
margin-left: 20px;
margin-bottom: -10px;
.cabinet-cell{ .cabinet-cell{
margin: 0 0 10px 10px; margin: 0 0 10px 10px;
font-size: 20px; font-size: 20px;
@ -288,6 +439,10 @@ export default {
background-color: #1AAE93; background-color: #1AAE93;
} }
} }
.right-cabinet{
margin-left: 0;
margin-right: 30px;
}
.cabinet-panel{ .cabinet-panel{
width: 140px; width: 140px;
margin-left: 10px; margin-left: 10px;

Loading…
Cancel
Save