|
@@ -1,50 +1,41 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <div style="display:flex;margin:6px;flex-wrap: wrap;overflow: hidden;">
|
|
|
|
|
- <el-tag size="mini" type="info" style="margin:4px" class="animate__animated animate__fadeInDown animate__faster" @close="close(item)" closable v-for="(item,index) in selectionList" :key="index">{{item.name}}</el-tag>
|
|
|
|
|
- </div>
|
|
|
|
|
- <avue-crud :option="option" :table-loading="loading" :data="data" :page="page" :permission="permissionList"
|
|
|
|
|
- :before-open="beforeOpen" v-model="form" ref="crud"
|
|
|
|
|
- @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
|
|
|
|
|
- @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
|
|
|
|
|
- <template slot="menuLeft">
|
|
|
|
|
- <el-button @click="pushFace" size="mini" type="primary" v-if="$isNotEmpty(selectionList)">确认下发</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template slot="deviceStatus" slot-scope="{row}">
|
|
|
|
|
- <el-tag v-if="row.deviceStatus === 0" type="danger">离线</el-tag>
|
|
|
|
|
- <el-tag v-if="row.deviceStatus === 1" type="success">在线</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </avue-crud>
|
|
|
|
|
|
|
+ <el-dialog title="请选择要下发的设备" :visible.sync="deviceShow" :destroy-on-close="true" center :append-to-body="true" :modal-append-to-body="true" width="55%">
|
|
|
|
|
+ <div style="display:flex;margin:6px;flex-wrap: wrap;overflow: hidden;">
|
|
|
|
|
+ <el-tag size="mini" type="info" style="margin:4px" class="animate__animated animate__fadeInDown animate__faster" @close="close(item)" closable v-for="(item,index) in selectionList" :key="index">{{item.name}}</el-tag>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page="page" :permission="permissionList"
|
|
|
|
|
+ :before-open="beforeOpen" v-model="form" ref="crud"
|
|
|
|
|
+ @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
|
|
|
|
|
+ @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange">
|
|
|
|
|
+ <template slot="menuLeft">
|
|
|
|
|
+ <el-button @click="deleteFace" size="mini" type="danger" v-if="$isNotEmpty(selectionList)">确认下发</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template slot="deviceStatus" slot-scope="{row}">
|
|
|
|
|
+ <el-tag v-if="row.deviceStatus === 0" type="danger">离线</el-tag>
|
|
|
|
|
+ <el-tag v-if="row.deviceStatus === 1" type="success">在线</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </avue-crud>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import {
|
|
import {
|
|
|
getList,
|
|
getList,
|
|
|
- getDetail,
|
|
|
|
|
- add,
|
|
|
|
|
- update,
|
|
|
|
|
- remove,
|
|
|
|
|
- remoteOpenDoor
|
|
|
|
|
- } from "@/api/device/doordevice.js";
|
|
|
|
|
|
|
+ deleteFace
|
|
|
|
|
+ } from "@/api/estate/useraccesspermissions.js";
|
|
|
import {
|
|
import {
|
|
|
mapGetters
|
|
mapGetters
|
|
|
} from "vuex";
|
|
} from "vuex";
|
|
|
- import customAvueMap from "@/components/residential/customAvueMap.vue"
|
|
|
|
|
- import editPolygonMap from "@/components/residential/editPolygonMap.vue";
|
|
|
|
|
- import SelectDialogResidential from "@/components/select-dialog/select-dialog-residential";
|
|
|
|
|
- import {deepClone} from "@/util/util.js"
|
|
|
|
|
|
|
+ import {deepClone} from "@/util/util.js";
|
|
|
export default {
|
|
export default {
|
|
|
- components: {
|
|
|
|
|
- SelectDialogResidential,
|
|
|
|
|
- customAvueMap,
|
|
|
|
|
- editPolygonMap
|
|
|
|
|
- },
|
|
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- mapVisible: false,
|
|
|
|
|
|
|
+ deviceShow:false,
|
|
|
form: {},
|
|
form: {},
|
|
|
query: {},
|
|
query: {},
|
|
|
|
|
+ userData:{},
|
|
|
loading: true,
|
|
loading: true,
|
|
|
page: {
|
|
page: {
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -176,101 +167,37 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
watch: {
|
|
|
- 'form.mapSelect': {
|
|
|
|
|
- handler: function(value) {
|
|
|
|
|
- if (!value) {
|
|
|
|
|
- return
|
|
|
|
|
- } else {
|
|
|
|
|
- this.form.longitude = this.form.mapSelect.longitude;
|
|
|
|
|
- this.form.latitude = this.form.mapSelect.latitude;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- pushFace(){
|
|
|
|
|
- let deviceIds=this.selectionList.map(item=>item.id)
|
|
|
|
|
- this.$emit("pushFace",deviceIds)
|
|
|
|
|
- },
|
|
|
|
|
- openDoor(row) {
|
|
|
|
|
- remoteOpenDoor(row.id, true).then(res => {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: "操作成功!"
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- selectCallback(row) {
|
|
|
|
|
- this.form.latitude = row.latitude;
|
|
|
|
|
- this.form.longitude = row.longitude;
|
|
|
|
|
- this.form.address = row.address;
|
|
|
|
|
- this.form.residentialId = row.id;
|
|
|
|
|
- this.form.residentialName = row.name;
|
|
|
|
|
- },
|
|
|
|
|
- rowSave(row, done, loading) {
|
|
|
|
|
- add(row).then(() => {
|
|
|
|
|
- this.onLoad(this.page);
|
|
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: "操作成功!"
|
|
|
|
|
- });
|
|
|
|
|
- done();
|
|
|
|
|
- }, error => {
|
|
|
|
|
- loading();
|
|
|
|
|
- window.console.log(error);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- rowUpdate(row, index, done, loading) {
|
|
|
|
|
- update(row).then(() => {
|
|
|
|
|
- this.onLoad(this.page);
|
|
|
|
|
|
|
+ deleteFace(){
|
|
|
|
|
+ let deviceIdList=this.selectionList.map(item=>item.id);
|
|
|
|
|
+ let params ={
|
|
|
|
|
+ deviceIds: deviceIdList.join(","),
|
|
|
|
|
+ userId: this.userData.id,
|
|
|
|
|
+ userType: this.userData.userType
|
|
|
|
|
+ };
|
|
|
|
|
+ deleteFace(params).then(res =>{
|
|
|
|
|
+ this.deviceShow = false;
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: "success",
|
|
type: "success",
|
|
|
message: "操作成功!"
|
|
message: "操作成功!"
|
|
|
});
|
|
});
|
|
|
- done();
|
|
|
|
|
- }, error => {
|
|
|
|
|
- loading();
|
|
|
|
|
- console.log(error);
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- rowDel(row) {
|
|
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- return remove(row.id);
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.onLoad(this.page);
|
|
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: "操作成功!"
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- handleDelete() {
|
|
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ showDialog(data){
|
|
|
|
|
+ if (data.imgError===true) {
|
|
|
|
|
+ this.$message.error('下发失败,人脸照片加载错误')
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
|
- type: "warning"
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- return remove(this.ids);
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.onLoad(this.page);
|
|
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: "操作成功!"
|
|
|
|
|
- });
|
|
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ let page = {
|
|
|
|
|
+ pageSize: this.size,
|
|
|
|
|
+ currentPage: this.current,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.fetchList(page, {"userId": data.id});
|
|
|
|
|
+
|
|
|
|
|
+ this.userData=data;
|
|
|
|
|
+ this.deviceShow=true;
|
|
|
},
|
|
},
|
|
|
beforeOpen(done, type) {
|
|
beforeOpen(done, type) {
|
|
|
if (["edit", "view"].includes(type)) {
|
|
if (["edit", "view"].includes(type)) {
|