123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- import { http } from "@/common/service/service.js";
- import configService from "@/common/service/config.service.js";
- import buildURL from "@/common/luch-request/helpers/buildURL.js"
- const apiService = {
- /**
- * 登录
- */
- login(params) {
- return http.post("/sys/mLogin", params);
- },
- /**
- * 手机号码登录
- */
- phoneNoLogin(params) {
- return http.post("/sys/phoneLogin", params);
- },
- /**
- * 退出
- */
- logout(params) {
- return http.post("/sys/logout", params);
- },
- // 按系统查询设备分类信息
- getDeviceType(params) {
- return http.get(
- "/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem",
- params
- );
- },
- // 查询各类设备的列表表头信息
- getShowColum(params) {
- return http.get("/safety/ventanalyShowColum/show_colum", params);
- },
- // 按系统查询设备监测信息
- getDeviceMonitor(params) {
- return http.post("/monitor/device", params);
- },
- //查询分页列表信息 通过分类查询 各类设备在app上是否展示的字段
- getShowColumList(params) {
- // const urlParams = new URLSearchParams(params);
- // const url = "/safety/ventanalyShowColum/list?" + urlParams.toString();
- const url = buildURL("/safety/ventanalyShowColum/list", params)
- return http.get(url);
- },
- //设备控制
- controlDevice(params) {
- return http.put(
- "/ventanaly-device/safety/ventanalyMonitorData/devicecontrol",
- params
- );
- },
- //根据设备id 查询该设备关联的视频流url
- getCameraById(params) {
- // const urlParams = new URLSearchParams(params);
- // const url = "/safety/ventanalyCamera/list?" + urlParams.toString();
- const url = buildURL("/safety/ventanalyCamera/list", params)
- return http.get(url);
- },
- //如果上面这个接口返回code码 则使用这个接口获取url
- getCameraByCode(params) {
- // const urlParams = new URLSearchParams(params);
- // const url =
- // "/ventanaly-device/camera/queryByCameraCode?" + urlParams.toString();
- const url = buildURL("/ventanaly-device/camera/queryByCameraCode", params)
- return http.get(url);
- },
- //获取设备历史数据
- getDeviceHistory(params) {
- // const urlParams = new URLSearchParams(params);
- // const url =
- // "/ventanaly-device/safety/ventanalyMonitorData/listdays?" +
- // urlParams.toString();
- const url = buildURL("/ventanaly-device/safety/ventanalyMonitorData/listdays", params)
- return http.get(url);
- },
- //获取操作历史
- getOpreateHistory(params) {
- // const urlParams = new URLSearchParams(params);
- // const url =
- // "/ventanaly-device/safety/ventanalyDevicesetLog/list?" +
- // urlParams.toString();
- const url = buildURL("/ventanaly-device/safety/ventanalyDevicesetLog/list", params)
- return http.get(url);
- },
- //获取文件数据
- getFileInfo(params){
- return http.post(
- "/ventanaly-sharefile/fileServer/list",
- params
- );
- },
- //获取预警信息
- getWarnInfo(params){
- return http.get(
- "/safety/ventanalyAlarmLog/total",
- params
- );
- },
- /**
- * 获取文件访问路径
- * @param avatar
- * @param subStr
- * @returns {*}
- */
- getFileAccessHttpUrl(avatar, subStr) {
- if (!subStr) subStr = "http";
- if (avatar && avatar.startsWith(subStr)) {
- return avatar;
- } else {
- return configService.staticDomainURL + "/" + avatar;
- }
- },
- };
- export default apiService;
|