|
@@ -22,9 +22,10 @@
|
|
|
<template v-for="(item,index) in cabinetList">
|
|
|
<el-tab-pane :label="item.alias" :key="index" :name="item.id">
|
|
|
<div>
|
|
|
+ <el-button type="primary" @click="onAddBox(item.id)">新增箱子</el-button>
|
|
|
<el-row justify="space-around" :gutter="10">
|
|
|
<template v-for="(v,k) in boxList[index]">
|
|
|
- <el-col :span="6" :key="k">
|
|
|
+ <el-col :span="6" :key="k" v-if="k <= currentPage * pageSize - 1 && k >= (currentPage - 1) * pageSize">
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span>
|
|
@@ -67,7 +68,7 @@
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</template>
|
|
|
- <el-col :span="6">
|
|
|
+ <!-- <el-col :span="6">
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span>新增箱子</span>
|
|
@@ -78,7 +79,10 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
+ </el-row>
|
|
|
+ <el-row style="margin-top:10px;" type="flex" justify="end">
|
|
|
+ <el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize" :current-page="currentPage" @current-change="onPageChange"></el-pagination>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
@@ -127,7 +131,7 @@ import {
|
|
|
addBox,
|
|
|
lockCabinet,
|
|
|
unLockCabinet,
|
|
|
- releaseAlarm
|
|
|
+ releaseAlarm,
|
|
|
} from "@/api";
|
|
|
import moment from "moment";
|
|
|
export default {
|
|
@@ -172,6 +176,9 @@ export default {
|
|
|
cabinetList: [],
|
|
|
boxList: [],
|
|
|
currentCabinetState: {},
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSize: 10
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -213,8 +220,11 @@ export default {
|
|
|
boxList({
|
|
|
cabinet_number: id,
|
|
|
}).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ console.log(323, res);
|
|
|
if (res && res.data.rows) {
|
|
|
+ _self.currentPage = 1;
|
|
|
+ _self.total = res.data.total;
|
|
|
+
|
|
|
let boxList = [..._self.boxList];
|
|
|
boxList[cabinetIndex] = res.data.rows;
|
|
|
_self.boxList = boxList;
|
|
@@ -248,9 +258,15 @@ export default {
|
|
|
let number = this.ruleForm.number;
|
|
|
let login_key = this.ruleForm.login_key;
|
|
|
let count = this.ruleForm.count;
|
|
|
-
|
|
|
- console.log(requrl,alias,number,login_key,count);
|
|
|
- addCabinet({url:requrl, alias:alias, number:number, login_key:login_key, count:count}).then((res) => {
|
|
|
+
|
|
|
+ console.log(requrl, alias, number, login_key, count);
|
|
|
+ addCabinet({
|
|
|
+ url: requrl,
|
|
|
+ alias: alias,
|
|
|
+ number: number,
|
|
|
+ login_key: login_key,
|
|
|
+ count: count,
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
if (res && res.msg == "ok") {
|
|
|
this.getCabinetList();
|
|
@@ -374,7 +390,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- } else if (command == 'unwarn') {
|
|
|
+ } else if (command == "unwarn") {
|
|
|
this.$confirm("确认解除当前报警?", "提示").then(() => {
|
|
|
releaseAlarm({
|
|
|
cabinet_number,
|
|
@@ -397,7 +413,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- } else if (command == 'reset') {
|
|
|
+ } else if (command == "reset") {
|
|
|
this.$confirm("确认重启当前柜体?", "提示").then(() => {
|
|
|
reboot({
|
|
|
cabinet_number,
|
|
@@ -452,6 +468,9 @@ export default {
|
|
|
console.log("取消");
|
|
|
});
|
|
|
},
|
|
|
+ onPageChange(page) {
|
|
|
+ this.currentPage = page;
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|