|
@@ -51,6 +51,14 @@
|
|
|
<el-button type="warning" plain icon="el-icon-upload2" size="mini" @click="handleUpload"
|
|
|
v-hasPermi="['system:manage:add']">导入</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="danger" plain icon="el-icon-circle-close" size="mini" @click="closePhone"
|
|
|
+ v-hasPermi="['system:manage:add']">关闭拨号盘</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="success" plain icon="el-icon-circle-check" size="mini" @click="openPhone"
|
|
|
+ v-hasPermi="['system:manage:add']">打开拨号盘</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -818,7 +826,8 @@ export default {
|
|
|
fenceList: [],
|
|
|
fenceName: null,
|
|
|
add_flag: true,
|
|
|
- checkedFence: null
|
|
|
+ checkedFence: null,
|
|
|
+ items: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -858,6 +867,64 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ async closePhone() {
|
|
|
+ let success = 0
|
|
|
+ if (this.items.length > 0) {
|
|
|
+ await Promise.allSettled(this.items.map(async item => {
|
|
|
+ let obj = {}
|
|
|
+ obj.facility_id = item.fid
|
|
|
+ obj.device_id_code = item.deviceId
|
|
|
+ obj.command = 'keybrd'
|
|
|
+ obj.param = { is_open: 0 }
|
|
|
+ await axios({
|
|
|
+ method: 'POST',
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ },
|
|
|
+ data: obj,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data && res.data.code == 200) {
|
|
|
+ success += 1
|
|
|
+ } else {
|
|
|
+ this.$modal.msgError(`${item.name}设置失败`)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }))
|
|
|
+ if (success == this.items.length) {
|
|
|
+ this.$modal.msgSuccess('关闭成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async openPhone() {
|
|
|
+ let success = 0
|
|
|
+ if (this.items.length > 0) {
|
|
|
+ await Promise.allSettled(this.items.map(async item => {
|
|
|
+ let obj = {}
|
|
|
+ obj.facility_id = item.fid
|
|
|
+ obj.device_id_code = item.deviceId
|
|
|
+ obj.command = 'keybrd'
|
|
|
+ obj.param = { is_open: 1 }
|
|
|
+ await axios({
|
|
|
+ method: 'POST',
|
|
|
+ url: 'http://43.138.30.29:4200/index.php/api/shouhuan/createcommand',
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ },
|
|
|
+ data: obj,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data && res.data.code == 200) {
|
|
|
+ success += 1
|
|
|
+ } else {
|
|
|
+ this.$modal.msgError(`${item.name}设置失败`)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }))
|
|
|
+ if (success == this.items.length) {
|
|
|
+ this.$modal.msgSuccess('关闭成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
subDeviceInterval() {
|
|
|
setDeviceInterval(this.deviceInterval).then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -1363,6 +1430,7 @@ export default {
|
|
|
addFence(this.fenceInfo).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$modal.msgSuccess('添加成功')
|
|
|
+ this.fence = {}
|
|
|
this.getFence()
|
|
|
}
|
|
|
})
|
|
@@ -1496,11 +1564,11 @@ export default {
|
|
|
if (this.fenceList.length < 3) {
|
|
|
this.fenceEdit = true
|
|
|
this.add_flag = true
|
|
|
- // this.fenceInfo.name = null
|
|
|
- // this.fenceInfo.start_time = null
|
|
|
- // this.fenceInfo.end_time = null
|
|
|
- // this.fenceInfo.type = null
|
|
|
- // this.fenceInfo.state = null
|
|
|
+ this.fenceInfo.name = null
|
|
|
+ this.fenceInfo.start_time = null
|
|
|
+ this.fenceInfo.end_time = null
|
|
|
+ this.fenceInfo.type = null
|
|
|
+ this.fenceInfo.state = null
|
|
|
if (this.fence) {
|
|
|
this.map.remove(this.fence)
|
|
|
this.fence = null
|
|
@@ -1580,6 +1648,7 @@ export default {
|
|
|
this.fenceEditor.close()
|
|
|
this.fenceEditor = null
|
|
|
}
|
|
|
+ this.fenceName = null
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -1593,7 +1662,7 @@ export default {
|
|
|
if (this.fenceEditor) {
|
|
|
this.fenceEditor.close()
|
|
|
}
|
|
|
- this.fenceInfo = item
|
|
|
+ this.fenceInfo = JSON.parse(JSON.stringify(item))
|
|
|
this.getFenceInfo(item.key, item.sid, item.gfid).then(res => {
|
|
|
if (res.data.results[0].shape.radius) {
|
|
|
this.fenceInfo.center = res.data.results[0].shape.center
|
|
@@ -1708,7 +1777,6 @@ export default {
|
|
|
res.rows.map(item => {
|
|
|
item.start_time = item.startTime
|
|
|
item.end_time = item.endTime
|
|
|
- item.type = 0
|
|
|
})
|
|
|
this.fenceList = res.rows
|
|
|
}
|
|
@@ -1722,6 +1790,13 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ beforeClose(done) {
|
|
|
+ this.map.destroy()
|
|
|
+ this.fenceName = null
|
|
|
+ this.fenceEdit = false
|
|
|
+ this.fenceInfo = {}
|
|
|
+ done()
|
|
|
+ },
|
|
|
searchUser() {
|
|
|
this.userForm.pageNum = 1
|
|
|
this.getUserList()
|
|
@@ -1834,11 +1909,6 @@ export default {
|
|
|
this.logTotal = res.total
|
|
|
})
|
|
|
},
|
|
|
- beforeClose(done) {
|
|
|
- this.map.destroy()
|
|
|
- this.fenceName = null
|
|
|
- done()
|
|
|
- },
|
|
|
/** 查询设备列列表 */
|
|
|
async getList() {
|
|
|
this.loading = true;
|
|
@@ -1902,6 +1972,7 @@ export default {
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
+ this.items = selection.map(item => item)
|
|
|
this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|