|
|
|
|
@ -22,7 +22,8 @@
|
|
|
|
|
</a-layout-content>
|
|
|
|
|
</a-layout>
|
|
|
|
|
<a-layout-footer>
|
|
|
|
|
<a-tabs default-active-key="1" tab-position="bottom" @change="value => select.row = value" v-if="total.row > nums.row">
|
|
|
|
|
<!-- <a-tabs default-active-key="1" tab-position="bottom" @change="value => select.row = value" v-if="total.row > nums.row"> -->
|
|
|
|
|
<a-tabs default-active-key="1" tab-position="bottom" @onchange="changeTab" @change="value => select.row = value" v-if="total.row > nums.row">
|
|
|
|
|
<a-tab-pane
|
|
|
|
|
v-for="index in latticeRow"
|
|
|
|
|
:key="index"
|
|
|
|
|
@ -86,7 +87,9 @@ export default {
|
|
|
|
|
return parseInt(this.total.column / this.nums.column) + (this.total.column % this.nums.column > 0 ? 1 : 0);
|
|
|
|
|
},
|
|
|
|
|
random() {
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
|
|
row: this.getRandomRow(this.select.row),
|
|
|
|
|
column: this.getRandomColumn(this.select.column),
|
|
|
|
|
}
|
|
|
|
|
@ -117,6 +120,9 @@ export default {
|
|
|
|
|
destroyed() {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
changeTab(){
|
|
|
|
|
console.log("latticeRow"+this.latticeRow)
|
|
|
|
|
},
|
|
|
|
|
// 获取行或列的范围字符串
|
|
|
|
|
getRandom(index, lattice, num, total) {
|
|
|
|
|
if(index !== lattice) {
|
|
|
|
|
@ -166,36 +172,41 @@ export default {
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
async getStatus() {
|
|
|
|
|
console.log( "column"+this.latticeColumn)
|
|
|
|
|
console.log( "row"+this.latticeRow)
|
|
|
|
|
// for(let i = 1 ; i++; i < this.latticeRow) {
|
|
|
|
|
// let rowColumn = this.getRandomRow(i);
|
|
|
|
|
// this.status.row[i] = this.fragmentStatus('row', i);
|
|
|
|
|
// let r = this.getRandomRow(i);
|
|
|
|
|
// console.log(r)
|
|
|
|
|
// //this.status.row[i] = this.fragmentStatus('row', i);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// for(let i = 1 ; i++; i < this.latticeColumn) {
|
|
|
|
|
// let rowColumn = this.getRandomColumn(i);
|
|
|
|
|
// this.status.column[i] = this.fragmentStatus('column', i);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
for(let row = 1; row <= this.total.row; row++) {
|
|
|
|
|
for(let column = 1; column <= this.total.column; column++) {
|
|
|
|
|
let status = (this.stockInfo[`${row}-${column}`] || {}).status || 0;
|
|
|
|
|
if(status < 2) {
|
|
|
|
|
// 当前是在第几段
|
|
|
|
|
let latticeRow = parseInt(row / this.nums.row) + (row % this.nums.row > 0 ? 1 : 0);
|
|
|
|
|
let latticeColumn = parseInt(column / this.nums.column) + (column % this.nums.column > 0 ? 1 : 0);
|
|
|
|
|
if(status === 1) {
|
|
|
|
|
console.log('第几段', latticeRow, latticeColumn);
|
|
|
|
|
console.log(row, column,status);
|
|
|
|
|
this.$set(this.status.row, latticeRow, status);
|
|
|
|
|
this.$set(this.status.column, latticeColumn, status);
|
|
|
|
|
}else {
|
|
|
|
|
if(!this.status.row[latticeRow]) this.$set(this.status.row, latticeRow, status);
|
|
|
|
|
if(!this.status.column[latticeColumn]) this.$set(this.status.column, latticeColumn, status);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.status);
|
|
|
|
|
// for(let row = 1; row <= this.total.row; row++) {
|
|
|
|
|
|
|
|
|
|
// for(let column = 1; column <= this.total.column; column++) {
|
|
|
|
|
|
|
|
|
|
// let status = (this.stockInfo[`${row}-${column}`] || {}).status || 0;
|
|
|
|
|
// if(status < 2) {
|
|
|
|
|
// // 当前是在第几段
|
|
|
|
|
// let latticeRow = parseInt(row / this.nums.row) + (row % this.nums.row > 0 ? 1 : 0);
|
|
|
|
|
// let latticeColumn = parseInt(column / this.nums.column) + (column % this.nums.column > 0 ? 1 : 0);
|
|
|
|
|
// if(status === 1) {
|
|
|
|
|
// console.log('第几段', latticeRow, latticeColumn);
|
|
|
|
|
// console.log(row, column,status);
|
|
|
|
|
// this.$set(this.status.row, latticeRow, status);
|
|
|
|
|
// this.$set(this.status.column, latticeColumn, status);
|
|
|
|
|
// }else {
|
|
|
|
|
// if(!this.status.row[latticeRow]) this.$set(this.status.row, latticeRow, status);
|
|
|
|
|
// if(!this.status.column[latticeColumn]) this.$set(this.status.column, latticeColumn, status);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// console.log(this.status);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|