增加预设点,接入萤石摄像
This commit is contained in:
		
							
								
								
									
										74
									
								
								src/api/other/devicePreset/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								src/api/other/devicePreset/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,74 @@ | ||||
| import request from '@/utils/request'; | ||||
| import { AxiosPromise } from 'axios'; | ||||
| import { DevicePresetVO, DevicePresetForm, DevicePresetQuery } from '@/api/other/devicePreset/types'; | ||||
|  | ||||
| /** | ||||
|  * 查询摄像头预置位列表 | ||||
|  * @param query | ||||
|  * @returns {*} | ||||
|  */ | ||||
|  | ||||
| export const listDevicePreset = (query?: DevicePresetQuery): AxiosPromise<DevicePresetVO[]> => { | ||||
|   return request({ | ||||
|     url: '/other/devicePreset/list', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 查询摄像头预置位详细 | ||||
|  * @param id | ||||
|  */ | ||||
| export const getDevicePreset = (id: string | number): AxiosPromise<DevicePresetVO> => { | ||||
|   return request({ | ||||
|     url: '/other/devicePreset/' + id, | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 新增摄像头预置位 | ||||
|  * @param data | ||||
|  */ | ||||
| export const addDevicePreset = (data: DevicePresetForm) => { | ||||
|   return request({ | ||||
|     url: '/other/devicePreset', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 修改摄像头预置位 | ||||
|  * @param data | ||||
|  */ | ||||
| export const updateDevicePreset = (data: DevicePresetForm) => { | ||||
|   return request({ | ||||
|     url: '/other/devicePreset', | ||||
|     method: 'put', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 删除摄像头预置位 | ||||
|  * @param id | ||||
|  */ | ||||
| export const delDevicePreset = (id: string | number | Array<string | number>) => { | ||||
|   return request({ | ||||
|     url: '/other/devicePreset/' + id, | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 调用摄像头预置位 | ||||
|  * @param data | ||||
|  */ | ||||
| export const callDevicePreset = (id: number | string) => { | ||||
|   return request({ | ||||
|     url: '/other/devicePreset/move/' + id, | ||||
|     method: 'put' | ||||
|   }); | ||||
| }; | ||||
							
								
								
									
										80
									
								
								src/api/other/devicePreset/types.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										80
									
								
								src/api/other/devicePreset/types.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,80 @@ | ||||
| export interface DevicePresetVO { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 设备序列号 | ||||
|    */ | ||||
|   deviceSerial: string; | ||||
|  | ||||
|   /** | ||||
|    * 通道号 | ||||
|    */ | ||||
|   channelNo: number; | ||||
|  | ||||
|   /** | ||||
|    * 预置点序号 | ||||
|    */ | ||||
|   index: number; | ||||
|  | ||||
|   /** | ||||
|    * 预置点 | ||||
|    */ | ||||
|   name: string; | ||||
| } | ||||
|  | ||||
| export interface DevicePresetForm extends BaseEntity { | ||||
|   /** | ||||
|    * 主键id | ||||
|    */ | ||||
|   id?: string | number; | ||||
|  | ||||
|   /** | ||||
|    * 设备序列号 | ||||
|    */ | ||||
|   deviceSerial?: string; | ||||
|  | ||||
|   /** | ||||
|    * 通道号 | ||||
|    */ | ||||
|   channelNo?: number | string; | ||||
|  | ||||
|   /** | ||||
|    * 预置点序号 | ||||
|    */ | ||||
|   index?: number; | ||||
|  | ||||
|   /** | ||||
|    * 预置点 | ||||
|    */ | ||||
|   name?: string; | ||||
| } | ||||
|  | ||||
| export interface DevicePresetQuery extends PageQuery { | ||||
|   /** | ||||
|    * 设备序列号 | ||||
|    */ | ||||
|   deviceSerial?: string; | ||||
|  | ||||
|   /** | ||||
|    * 通道号 | ||||
|    */ | ||||
|   channelNo?: number; | ||||
|  | ||||
|   /** | ||||
|    * 预置点序号 | ||||
|    */ | ||||
|   index?: number; | ||||
|  | ||||
|   /** | ||||
|    * 预置点 | ||||
|    */ | ||||
|   name?: string; | ||||
|  | ||||
|   /** | ||||
|    * 日期范围参数 | ||||
|    */ | ||||
|   params?: any; | ||||
| } | ||||
| @ -78,3 +78,14 @@ export const devicesLinkPro = (data: { id: string | number; projectId: string | | ||||
|     data | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * 获取 token | ||||
|  * @param id | ||||
|  */ | ||||
| export const getAccessToken = () => { | ||||
|   return request({ | ||||
|     url: '/other/ys7Device/get/token', | ||||
|     method: 'get' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user