切换主题
打开一键监控
打开一键监控示例
<script setup name="TurnMomentMonitoring">
import { ref } from 'vue'
import {ElMessage} from 'element-plus'
import { checkInstance, getInstanceFCC } from '../../use-fcc'
import { setLog } from '../../use-log'
import OpenMonitor from './openMonitor.vue'
const loading = ref(false)
const matrixInfo = ref({
LONGITUDE: '114.03168', // 经度
LATITUDE: '22.619469' // 维度
})
const openMonitor = async () => {
setLog({
name: '一键打开监控'
})
let result = await getInstanceFCC().monitorJudge(matrixInfo.value)
setLog({
name: '一键打开结果',
msg: result
})
if (result.status == 200) {
ElMessage({
message: '一键打开监控成功',
type: 'success'
})
} else {
ElMessage({
message: result.msg,
type: 'info'
})
}
}
</script>
<template>
<el-form>
<div> {{ '一键打开监控' }} </div>
<el-row>
<el-col :span="7">
<el-form-item label="经度">
<el-input v-model.number="matrixInfo.LONGITUDE" placeholder="经度"></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="维度">
<el-input v-model.number="matrixInfo.LATITUDE" placeholder="维度"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="primary" @click="openMonitor" v-loading="loading">一键打开监控</el-button>
</el-form-item>
</el-form>
</template>
<style scoped>
.el-col {
margin-right: 16px;
}
.change-monitor-wrap {
padding-top: 10px;
border-top: 1px dotted #ccc;
}
</style>使用方法
typescript
1. 如果选择的是单个监控,传入单个监控的经度和维度,在成功打开后可根据此监控的位置范围查找附近监控并选择打开。
2. 如果选择的是多个监控,传入所有监控的场所 id ,设备编码以及设备类型,在成功打开后可选择性的打开部分监控。
let params = {
LATITUDE: '22.532627788106137',
LONGITUDE: '113.95018090222166'
}
let result = await fcc.monitorJudge(params)
let params = {
siteIdList: ['5646', '3231'],
deviceIdList: ['123', '223'],
deviceType: '48'
}
let result = await fcc.monitorJudge(params)1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
入参说明
| 参数名 | 数据类型 | 选取原则 | 说明 |
|---|---|---|---|
| LONGITUDE | string | 必选 | 单个监控的经度 |
| LATITUDE | string | 必选 | 单个监控的纬度 |
| siteIdList | array | 必选 | 多个监控的场所 id 数组集合 |
| deviceIdList | array | 必选 | 多个监控的设备编码数组集合 |
| deviceType | string | 必选 | 多个监控需要打开的监控类型 |
出参说明
| 出参名称 | 数据类型 | 说明 |
|---|---|---|
| status | number | 调用其接口返回结果的状态码,其含义请参考融合通讯中台通用状态码。 |
| msg | string | 给开发者的文字提示信息 |
| data | object | 参会成员集合 |
