diff --git a/src/api/index.js b/src/api/index.js index 5527d0f7..8dc2055e 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,102 +1,114 @@ -import axios from 'axios' -import qs from 'qs' +import axios from 'axios'; +import qs from 'qs'; if (process.env.NODE_ENV === 'development') { - axios.defaults.baseURL = '/' + axios.defaults.baseURL = '/'; } else if (process.env.NODE_ENV === 'production') { - axios.defaults.baseURL = '/' + axios.defaults.baseURL = '/'; } //获取视频数据接口 -export const getGetShipjk = (params) => { +export const getGetShipjk = params => { return axios.get('api/GetShipjk', { params - }) + }); }; //获取全局设置 -export const getQuanjszData = (params) => { +export const getQuanjszData = params => { return axios.get('api/GetQuanjsz', { params - }) + }); }; // -export const postAddShipjk = (data) => { +export const postAddShipjk = data => { // return axios.post('api/AddShipjk', { // F_VC_SHIPJKMC:data.F_VC_SHIPJKMC, // F_VC_LEIX:data.F_VC_LEIX, // // data: formData, // }) - return axios.post('api/AddShipjk', data) + return axios.post('api/AddShipjk', data); }; //分析应用按钮 -export const getApplication = (params) => { +export const getApplication = params => { return axios.get('api/SyncVideo', { params - }) + }); }; //停止算法程序接口 -export const getStopAlgorithm = (params) => { +export const getStopAlgorithm = params => { return axios.get('api/StopAlgorithm', { params - }) + }); }; //分析-删除视频源接口 //172.16.1.26:5000/api/DeleteShipjk?F_VC_ID=9df02f1a113640c498e74a74c93aca77 -export const getDeleteShipjk = (params) => { +export const getDeleteShipjk = params => { return axios.get('api/DeleteShipjk', { params - }) + }); }; //视频分析预览 // 分析配置接口 -export const getFeixpz = (params) => { +export const getFeixpz = params => { return axios.get('api/GetFeixpz', { params - }) + }); }; // 设置相机位置接口 -export const setCameraPosition = (data) => { - return axios.post('api/SetCameraPosition', - data,{headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}) +export const setCameraPosition = data => { + return axios.post('api/SetCameraPosition', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); }; // 设置车牌识别接口 -export const setLicensePlate = (data) => { - return axios.post('api/SetLicensePlate', - data,{headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}) +export const setLicensePlate = data => { + return axios.post('api/SetLicensePlate', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); }; // 设置停车状态 -export const setParkingStatus = (data) => { - return axios.post('api/SetParkingStatus', - data,{headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}) +export const setParkingStatus = data => { + return axios.post('api/SetParkingStatus', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); }; -export const setFeixzbzh = (params) => { - return axios.post('api/SetFeixzbzh', - params,{headers: { 'Content-Type': 'application/json' }}) +export const setFeixzbzh = params => { + return axios.post('api/SetFeixzbzh', params, { headers: { 'Content-Type': 'application/json' } }); }; - //根据组件id获取单个组件信息 -export const getComponentData = (params) => { +export const getComponentData = params => { return axios.get('api/GetMonqjkzjcsDetails', { params - }) + }); }; //获取所有断面数据-用于组件OD类型数据 -export const getSectionalData = (params) => { +export const getSectionalData = params => { return axios.get('api/GetSection', { params - }) + }); }; // -export const setQuanjsz = (params) => { - return axios.post('api/SetQuanjsz', - params,{headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}) +export const setQuanjsz = params => { + return axios.post('api/SetQuanjsz', params, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); }; //获取数据看板图形数据 -export const getComponentSection = (params) => { +export const getComponentSection = params => { return axios.get('api/GetComponentSection', { params - }) + }); }; +// 根据视频id获取离线视频的分析状态接口 +export const getVideoStatus = videoId => { + return axios.get(`api/GetVideoStatus?VideoId=${videoId}`); +}; +// 启动交通分析接口(离线视频使用) +export const startTrafficAnalysis = videoId => { + return axios.get(`api/StartTrafficAnalysis?VideoId=${videoId}`); +}; + +// 启动视频分析接口(离线视频使用) +export const startVideoAnalysis = videoId => { + return axios.get(`api/StartVideoAnalysis?VideoId=${videoId}`); +}; + +// 根据视频id获取离线视频的分析状态接口 +export const getAnalysisData = videoId => { + return axios.get(`api/GetAnalysisData?VideoId=${videoId}`); +};