|
@@ -35,7 +35,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="Mac" align="center" label="mac"> </el-table-column>
|
|
<el-table-column prop="Mac" align="center" label="mac"> </el-table-column>
|
|
|
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width='100px'>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<!-- <el-button
|
|
<!-- <el-button
|
|
class="xl_d_button"
|
|
class="xl_d_button"
|
|
@@ -93,7 +93,7 @@
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="mac" align="center" label="mac"> </el-table-column>
|
|
<el-table-column prop="mac" align="center" label="mac"> </el-table-column>
|
|
- <el-table-column label="操作" align="center">
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width='200px'>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
:disabled="buttonLinkFlag"
|
|
:disabled="buttonLinkFlag"
|
|
@@ -105,6 +105,18 @@
|
|
<span v-if="scope.row.connect">断开连接</span
|
|
<span v-if="scope.row.connect">断开连接</span
|
|
><span v-if="!scope.row.connect">连接</span></el-button
|
|
><span v-if="!scope.row.connect">连接</span></el-button
|
|
>
|
|
>
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ style='margin-top:10px'
|
|
|
|
+ v-show="scope.row.addFlag"
|
|
|
|
+ :disabled="buttonLinkFlag"
|
|
|
|
+ class="xl_d_button"
|
|
|
|
+ size="mini"
|
|
|
|
+ slot="reference"
|
|
|
|
+ @click="addEquiLine(scope.row)"
|
|
|
|
+ >
|
|
|
|
+ <span>添加至设备列表</span>
|
|
|
|
+ </el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -127,6 +139,12 @@
|
|
<el-dialog :visible.sync="centerDialogVisible" width="545px" center class="dig_equi">
|
|
<el-dialog :visible.sync="centerDialogVisible" width="545px" center class="dig_equi">
|
|
<div slot="title" class="title_di" style="width: 545px">
|
|
<div slot="title" class="title_di" style="width: 545px">
|
|
<img width="545px" src="../assets/manage/bg_di.png" />
|
|
<img width="545px" src="../assets/manage/bg_di.png" />
|
|
|
|
+ <img
|
|
|
|
+ class="equipment_bg"
|
|
|
|
+ width="85px"
|
|
|
|
+ height="85px"
|
|
|
|
+ src="../assets/manage/bg_title.png"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
<span class="min_equi">
|
|
<span class="min_equi">
|
|
<div class="equipment_class">
|
|
<div class="equipment_class">
|
|
@@ -239,6 +257,22 @@ export default {
|
|
//离开之后断开websocket连接
|
|
//离开之后断开websocket连接
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //新增设备
|
|
|
|
+ addEquiLine(val) {
|
|
|
|
+ let path = "v1/device/add";
|
|
|
|
+ let data = {
|
|
|
|
+ type: val.type,
|
|
|
|
+ mac: val.mac,
|
|
|
|
+ };
|
|
|
|
+ this.$http.postTmp(path, data, (res) => {
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ this.$message.success('添加成功');
|
|
|
|
+ this.queryEle();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.data.message);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//状态切换
|
|
//状态切换
|
|
linkJudge(index, val, flag) {
|
|
linkJudge(index, val, flag) {
|
|
if (flag) {
|
|
if (flag) {
|
|
@@ -279,8 +313,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
rssiFor(val) {
|
|
rssiFor(val) {
|
|
|
|
+ debugger;
|
|
if (val == 0) {
|
|
if (val == 0) {
|
|
return "";
|
|
return "";
|
|
|
|
+ }else{
|
|
|
|
+ return val.rssi
|
|
}
|
|
}
|
|
},
|
|
},
|
|
nameFormatter(val) {
|
|
nameFormatter(val) {
|
|
@@ -379,7 +416,7 @@ export default {
|
|
let that = this;
|
|
let that = this;
|
|
//数据接收
|
|
//数据接收
|
|
const redata = JSON.parse(e.data);
|
|
const redata = JSON.parse(e.data);
|
|
- // console.log(redata);
|
|
|
|
|
|
+ console.log(redata);
|
|
// if(redata.content == "设备连接成功"){
|
|
// if(redata.content == "设备连接成功"){
|
|
// console.log(redata);
|
|
// console.log(redata);
|
|
// }
|
|
// }
|
|
@@ -776,7 +813,23 @@ export default {
|
|
}
|
|
}
|
|
//将数组其他选项
|
|
//将数组其他选项
|
|
|
|
|
|
- this.mergeData = currentDeviceList;
|
|
|
|
|
|
+ //将此数组与设备列表数组进行比较
|
|
|
|
+ let finalData = [];
|
|
|
|
+ finalData = JSON.parse(JSON.stringify(currentDeviceList));
|
|
|
|
+
|
|
|
|
+ for (let p = 0; p < finalData.length; p++) {
|
|
|
|
+ finalData[p].addFlag = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (let p = 0; p < finalData.length; p++) {
|
|
|
|
+ for (let m = 0; m < this.tableData.length; m++) {
|
|
|
|
+ if (finalData[p].mac == this.tableData[m].Mac) {
|
|
|
|
+ finalData[p].addFlag = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(finalData)
|
|
|
|
+ this.mergeData = finalData;
|
|
},
|
|
},
|
|
changeList(obj) {
|
|
changeList(obj) {
|
|
// console.log(obj);
|
|
// console.log(obj);
|
|
@@ -1006,4 +1059,9 @@ export default {
|
|
font-weight: normal;
|
|
font-weight: normal;
|
|
font-size: 20px;
|
|
font-size: 20px;
|
|
}
|
|
}
|
|
|
|
+.equipment_bg {
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 10px;
|
|
|
|
+ top: -10px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|