|
|
@@ -5,7 +5,7 @@
|
|
|
:modal-append-to-body="false"
|
|
|
append-to-body
|
|
|
:modal="true"
|
|
|
- style="text-align:left;"
|
|
|
+ style="text-align: left"
|
|
|
@close="closeDialog"
|
|
|
:close-on-click-modal="false"
|
|
|
width="970px"
|
|
|
@@ -22,66 +22,126 @@
|
|
|
plain
|
|
|
icon="el-icon-remove"
|
|
|
@click="handleRemoveAll"
|
|
|
- >解绑所有设备</el-button>
|
|
|
+ >解绑所有设备</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
plain
|
|
|
icon="el-icon-refresh"
|
|
|
@click="handleUpdateIsWrite"
|
|
|
- >更新图片状态</el-button>
|
|
|
+ >更新图片状态</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
plain
|
|
|
icon="el-icon-refresh"
|
|
|
- :disabled="multipleSelection.length==0"
|
|
|
+ :disabled="multipleSelection.length == 0"
|
|
|
@click="dataSync"
|
|
|
- >数据同步</el-button>
|
|
|
+ >数据同步</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ @click="handleReLoad"
|
|
|
+ >刷新</el-button
|
|
|
+ >
|
|
|
</el-row>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
- style="min-height:400px;"
|
|
|
+ style="min-height: 400px"
|
|
|
v-loading="loading"
|
|
|
stripe
|
|
|
@sort-change="sortChange"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column prop="deviceInfo.aliasName" label="设备名称" width="220"></el-table-column>
|
|
|
- <el-table-column prop="personInfo.name" label="人员名称" width="120"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="deviceInfo.aliasName"
|
|
|
+ label="设备名称"
|
|
|
+ width="220"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="personInfo.name"
|
|
|
+ label="人员名称"
|
|
|
+ width="120"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column prop="deviceInfo.isOnline" label="运行状态" width="80">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<div
|
|
|
v-if="row.deviceInfo.isOnline"
|
|
|
- style="border-radius: 30px;background-color:#67C23A;width:20px;height:20px;"
|
|
|
+ style="
|
|
|
+ border-radius: 30px;
|
|
|
+ background-color: #67c23a;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ "
|
|
|
></div>
|
|
|
<div
|
|
|
v-if="!row.deviceInfo.isOnline"
|
|
|
- style="border-radius: 30px;background-color:#F56C6C;width:20px;height:20px;"
|
|
|
+ style="
|
|
|
+ border-radius: 30px;
|
|
|
+ background-color: #f56c6c;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ "
|
|
|
></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="isBound" label="照片是否存在" width="120">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<div
|
|
|
v-if="!row.deviceInfo.isOnline"
|
|
|
- style="border-radius: 30px;background-color:#767676;width:20px;height:20px;"
|
|
|
+ style="
|
|
|
+ border-radius: 30px;
|
|
|
+ background-color: #767676;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ "
|
|
|
></div>
|
|
|
<div
|
|
|
v-if="row.deviceInfo.isOnline && row.isBound"
|
|
|
- style="border-radius: 30px;background-color:#67C23A;width:20px;height:20px;"
|
|
|
+ style="
|
|
|
+ border-radius: 30px;
|
|
|
+ background-color: #67c23a;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ "
|
|
|
></div>
|
|
|
<div
|
|
|
- v-if="row.deviceInfo.isOnline &&!row.isBound"
|
|
|
- style="border-radius: 30px;background-color:#F56C6C;width:20px;height:20px;"
|
|
|
+ v-if="row.deviceInfo.isOnline && !row.isBound"
|
|
|
+ style="
|
|
|
+ border-radius: 30px;
|
|
|
+ background-color: #f56c6c;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ "
|
|
|
></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="createTime" label="关联时间" width="150"></el-table-column>
|
|
|
+ <el-table-column prop="remoteOpen" label="远程开门" width="80">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-switch
|
|
|
+ v-model="row.remoteOpen"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ @change="changeRemote(row)"
|
|
|
+ :disabled="row.isDefault"
|
|
|
+ ></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="createTime"
|
|
|
+ label="关联时间"
|
|
|
+ width="150"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <el-button size="mini" type="danger" @click="handleDelete(row)">解除关联</el-button>
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-button size="mini" type="danger" @click="handleDelete(row)"
|
|
|
+ >解除关联</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -110,14 +170,14 @@ import NProgress from "nprogress"; // progress bar
|
|
|
import "nprogress/nprogress.css"; // progress bar style
|
|
|
|
|
|
export default {
|
|
|
- props: ["personId","delFlag"],
|
|
|
+ props: ["personId", "delFlag"],
|
|
|
data() {
|
|
|
var self = this;
|
|
|
|
|
|
return {
|
|
|
queryModel: {
|
|
|
deviceId: "",
|
|
|
- personId: ""
|
|
|
+ personId: "",
|
|
|
},
|
|
|
loading: false,
|
|
|
tableData: [],
|
|
|
@@ -131,7 +191,7 @@ export default {
|
|
|
multipleSelection: [],
|
|
|
showModal: false,
|
|
|
modalTitle: "",
|
|
|
- showDialog: true
|
|
|
+ showDialog: true,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -151,7 +211,7 @@ export default {
|
|
|
|
|
|
formData.append("deviceId", self.queryModel.deviceId);
|
|
|
formData.append("personId", self.personId);
|
|
|
- if(self.delFlag == null){
|
|
|
+ if (self.delFlag == null) {
|
|
|
self.delFlag = false;
|
|
|
}
|
|
|
formData.append("delFlag", self.delFlag);
|
|
|
@@ -166,7 +226,7 @@ export default {
|
|
|
|
|
|
personDeviceRelationApi
|
|
|
.pageList(formData)
|
|
|
- .then(function(response) {
|
|
|
+ .then(function (response) {
|
|
|
self.loading = false;
|
|
|
|
|
|
var jsonData = response.data.data;
|
|
|
@@ -175,7 +235,7 @@ export default {
|
|
|
self.totalPages = jsonData.totalPages;
|
|
|
self.totalElements = jsonData.recordsTotal;
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
+ .catch((error) => {
|
|
|
self.loading = false;
|
|
|
// self.$message.error(error + "");
|
|
|
});
|
|
|
@@ -201,12 +261,12 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
- distinguishCancelAndClose: true
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
})
|
|
|
.then(() => {
|
|
|
self.loading = true;
|
|
|
|
|
|
- personDeviceRelationApi.remove(record.id).then(function(response) {
|
|
|
+ personDeviceRelationApi.remove(record.id).then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
self.loading = false;
|
|
|
if (jsonData.result) {
|
|
|
@@ -216,12 +276,12 @@ export default {
|
|
|
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "解绑成功!"
|
|
|
+ message: "解绑成功!",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
+ .catch((error) => {
|
|
|
self.loading = false;
|
|
|
// self.$message.error(error + "");
|
|
|
});
|
|
|
@@ -233,7 +293,7 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
- distinguishCancelAndClose: true
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
})
|
|
|
.then(() => {
|
|
|
self.loading = true;
|
|
|
@@ -242,7 +302,7 @@ export default {
|
|
|
|
|
|
personDeviceRelationApi
|
|
|
.unbindDevice(formData)
|
|
|
- .then(function(response) {
|
|
|
+ .then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
self.loading = false;
|
|
|
if (jsonData.result) {
|
|
|
@@ -250,17 +310,17 @@ export default {
|
|
|
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "解绑成功!"
|
|
|
+ message: "解绑成功!",
|
|
|
});
|
|
|
} else {
|
|
|
self.$message({
|
|
|
type: "warning",
|
|
|
- message: jsonData.message
|
|
|
+ message: jsonData.message,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
+ .catch((error) => {
|
|
|
self.loading = false;
|
|
|
// self.$message.error(error + "");
|
|
|
});
|
|
|
@@ -280,14 +340,14 @@ export default {
|
|
|
formData.append("personId", self.personId);
|
|
|
personDeviceRelationApi
|
|
|
.updatePersonIsWrite(formData)
|
|
|
- .then(function(response) {
|
|
|
+ .then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
self.loading = false;
|
|
|
if (jsonData.result) {
|
|
|
self.changePage(self.pageIndex);
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "更新成功!"
|
|
|
+ message: "更新成功!",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -295,14 +355,14 @@ export default {
|
|
|
dataSync() {
|
|
|
//批量同步人脸
|
|
|
var self = this;
|
|
|
- var deviceIdList = this.multipleSelection.map(record => {
|
|
|
+ var deviceIdList = this.multipleSelection.map((record) => {
|
|
|
return record.deviceId;
|
|
|
});
|
|
|
|
|
|
this.$confirm("是否确认同步选中项?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
.then(() => {
|
|
|
self.loading = true;
|
|
|
@@ -312,7 +372,7 @@ export default {
|
|
|
|
|
|
personDeviceRelationApi
|
|
|
.devicesPersonSync(formData)
|
|
|
- .then(function(response) {
|
|
|
+ .then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
self.loading = false;
|
|
|
if (jsonData.result) {
|
|
|
@@ -320,7 +380,7 @@ export default {
|
|
|
self.changePage(self.pageIndex);
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "同步成功!"
|
|
|
+ message: "同步成功!",
|
|
|
});
|
|
|
} else {
|
|
|
if (jsonData.message != null) {
|
|
|
@@ -332,14 +392,14 @@ export default {
|
|
|
message:
|
|
|
"错误" +
|
|
|
`,<a href="${jsonData.message}" target="_blank">点击下载错误报表</a> `,
|
|
|
- duration: 30000
|
|
|
+ duration: 30000,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
self.$message({
|
|
|
type: "warning",
|
|
|
- message: jsonData.message
|
|
|
+ message: jsonData.message,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -347,14 +407,21 @@ export default {
|
|
|
.catch(() => {
|
|
|
self.loading = false;
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ changeRemote(row) {
|
|
|
+ personDeviceRelationApi.update(row);
|
|
|
+ },
|
|
|
+ handleReLoad() {
|
|
|
+ var self = this;
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+ },
|
|
|
},
|
|
|
- mounted: function() {
|
|
|
+ mounted: function () {
|
|
|
this.changePage(1);
|
|
|
},
|
|
|
components: {
|
|
|
- "personDeviceRelation-detail": PersonDeviceRelationDetail
|
|
|
- }
|
|
|
+ "personDeviceRelation-detail": PersonDeviceRelationDetail,
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|