getApiRes.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. import axios from 'axios';
  2. import global from '../Global.js'
  3. // 基础方法进行封装
  4. function getApiBasic(url, postdata) {
  5. return axios.post(url, postdata).then(function (data) {
  6. let json = data.data;
  7. return json
  8. }, function (response) {
  9. console.info(response);
  10. })
  11. }
  12. // 调用的api改写成方法
  13. export function worldDetail(postdata) {
  14. let url = headapi + 'worldDetail';
  15. return getApiBasic(url, postdata);
  16. }
  17. // 测试用接口
  18. export function editbasicinfo(postdata) {
  19. let url = headapi + 'editbasicinfo';
  20. return getApiBasic(url, postdata);
  21. }
  22. export function modPwd(postdata) {
  23. let url = headapi + 'modPwd';
  24. return getApiBasic(url, postdata);
  25. }
  26. export function getLoftInfo(postdata) {
  27. let url = headapi + 'getLoftInfo';
  28. return getApiBasic(url, postdata);
  29. }
  30. export function wifiSingle(postdata) {
  31. let url = headapi + 'wifiSingle';
  32. return getApiBasic(url, postdata);
  33. }
  34. export function Scan(postdata) {
  35. let url = headapi + 'Scan';
  36. return getApiBasic(url, postdata);
  37. }
  38. export function Watching(postdata) {
  39. // let url = headapi + 'Watching';
  40. // return getApiBasic(url,postdata);
  41. let item = [];
  42. let t = 0;
  43. for (var i = 0; i < 9; i++) {
  44. t = i + 1;
  45. item.push({
  46. 'time': "@date",
  47. 'checkRs': "Signal设备03@integer(301,600)检测完成,206会议室安全",
  48. })
  49. }
  50. let res = {
  51. Rs: item,
  52. Code: 0,
  53. Memo: '登陆成功'
  54. };
  55. return res;
  56. }
  57. // 真实接口
  58. // 用户登录
  59. export function SignIn(postdata) {
  60. let url = headapi + 'v1/Auth/SignIn';
  61. return getApiBasic(url, postdata);
  62. }
  63. // 获取验证图片
  64. export function GenVerifyPic(postdata) {
  65. let url = headapi + 'v1/Auth/GenVerifyPic';
  66. return getApiBasic(url, postdata);
  67. }
  68. // 用户退出
  69. export function SignOut(postdata) {
  70. let url = headapi + 'v1/Auth/SignOut';
  71. return getApiBasic(url, postdata);
  72. }
  73. // 获取首页左侧组织结构信息
  74. export function GetRegionAndDectorSelect(postdata) {
  75. let url = headapi + 'v1/Auth/GetRegionAndDectorSelect';
  76. return getApiBasic(url, postdata);
  77. }
  78. // 获取统计数量集合
  79. export function GetStaticinfo(postdata) {
  80. // 获取统计数量集合,包括获取设备总数,在线设备,离线设备,禁用设备,当日报警数量,可疑事件总数
  81. let url = headapi + 'v1/Company/GetStaticinfo';
  82. return getApiBasic(url, postdata);
  83. }
  84. // 区域检出实时记录
  85. export function RegionDetInfolist(postdata) {
  86. // 最小区域检出实时记录
  87. let url = headapi + 'v1/Company/RegionDetInfolist';
  88. return getApiBasic(url, postdata);
  89. }
  90. // 单个设备检测实时记录
  91. export function SingleDetInfolist(postdata) {
  92. // 单个设备检测实时记录
  93. let url = headapi + 'v1/Company/SingleDetInfolist';
  94. return getApiBasic(url, postdata);
  95. }
  96. // Wifi柱状图信息传入探测器Id
  97. export function DetectorWifixyInfolist(postdata) {
  98. // Wifi柱状图信息
  99. let url = headapi + 'v1/Detector/DetectorWifixyInfolist';
  100. return getApiBasic(url, postdata);
  101. }
  102. // Wifi柱状图信息传入区域Id
  103. export function RegionWifixyInfolist(postdata) {
  104. // Wifi柱状图信息
  105. let url = headapi + 'v1/Detector/RegionWifixyInfolist';
  106. return getApiBasic(url, postdata);
  107. }
  108. // 0-6G折线图信息传入设备Id
  109. export function Detector06GInfolist(postdata) {
  110. // 6G折线图信息传入设备Id
  111. let url = headapi + 'v1/Detector/Detector06GInfolist';
  112. return getApiBasic(url, postdata);
  113. }
  114. // 添加区域
  115. export function RegionAdd(postdata) {
  116. // 添加区域 第一级区域填0
  117. let url = headapi + 'v1/Company/RegionAdd';
  118. return getApiBasic(url, postdata);
  119. }
  120. // 修改区域信息
  121. export function RegionEdit(postdata) {
  122. // 修改区域 第一级区域填0
  123. let url = headapi + 'v1/Company/RegionEdit';
  124. return getApiBasic(url, postdata);
  125. }
  126. // 修改区域状态
  127. export function RegionStatusEdit(postdata) {
  128. // 修改内部区域状态设置为 9删除
  129. let url = headapi + 'v1/Company/RegionStatusEdit';
  130. return getApiBasic(url, postdata);
  131. }
  132. // 区域图片上传
  133. export function RegionPictureUpload(postdata) {
  134. // 上传区域图片
  135. let url = headapi + 'v1/Company/RegionPictureUpload';
  136. return getApiBasic(url, postdata);
  137. }
  138. // 查询信号 Wifi记录
  139. export function LogWifiDetectedQueryByDetector(postdata) {
  140. // 查询检测设备的Wifi信号记录
  141. let url = headapi + 'v1/Detector/LogWifiDetectedQueryByDetector';
  142. return getApiBasic(url, postdata);
  143. }
  144. // 查询手机信号记录
  145. export function LogPhoneDetectedQueryByDetector(postdata) {
  146. // 查询手机信号记录
  147. let url = headapi + 'v1/Detector/LogPhoneDetectedQueryByDetector';
  148. return getApiBasic(url, postdata);
  149. }
  150. // 获取单个区域信息
  151. export function GetRegiononeinfo(postdata) {
  152. // 获取单个区域信息
  153. let url = headapi + 'v1/Company/GetRegiononeinfo';
  154. return getApiBasic(url, postdata);
  155. }
  156. // 区域平面图用到的单条区域信息
  157. export function GetRegionplaneinfo(postdata) {
  158. // 区域平面图用到的单条区域信息
  159. let url = headapi + 'v1/Company/GetRegionplaneinfo';
  160. return getApiBasic(url, postdata);
  161. }
  162. // 获取企业内部区域选择框信息
  163. export function GetRegionSelect(postdata) {
  164. // 根据企业id获取企业内部区域选择框信息 default:1
  165. let url = headapi + 'v1/Auth/GetRegionSelect';
  166. return getApiBasic(url, postdata);
  167. }
  168. // Detector part
  169. // 查询检测设备信息
  170. export function DetectorQuery(postdata) {
  171. // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
  172. let url = headapi + 'v1/Detector/DetectorQuery';
  173. return getApiBasic(url, postdata);
  174. }
  175. // 添加检测设备
  176. export function DetectorAdd(postdata) {
  177. // 添加检测设备
  178. let url = headapi + 'v1/Detector/DetectorAdd';
  179. return getApiBasic(url, postdata);
  180. }
  181. // 修改检测设备信息
  182. export function DetectorEdit(postdata) {
  183. // 添加检测设备
  184. let url = headapi + 'v1/Detector/DetectorEdit';
  185. return getApiBasic(url, postdata);
  186. }
  187. // 修改检测设备状态
  188. export function DetectorEditStatus(postdata) {
  189. // 修改检测设备状态 //新状态0禁用1启用2已离线9删除
  190. let url = headapi + 'v1/Detector/DetectorEditStatus';
  191. return getApiBasic(url, postdata);
  192. }
  193. // 通过RegionId下载区域图片
  194. export function RegionPictureGetByRegionId(postdata) {
  195. // 通过RegionId下载区域图片
  196. let url = headapi + 'v1/Company/RegionPictureGetByRegionId';
  197. return getApiBasic(url, postdata);
  198. }
  199. // 获取下级区域选择框信息
  200. export function GetChildRegionSelect(postdata) {
  201. // 获取下级区域选择框信息
  202. let url = headapi + 'v1/Auth/GetChildRegionSelect';
  203. return getApiBasic(url, postdata);
  204. }
  205. // 修改密码
  206. export function PassEdit(postdata) {
  207. // 修改密码
  208. let url = headapi + 'v1/Auth/PassEdit';
  209. return getApiBasic(url, postdata);
  210. }
  211. // 获取最新固件版本
  212. export function GetLastVerionFirmwareinfo(postdata) {
  213. // 获取最新固件版本
  214. let url = headapi + 'v1/AdminSettings/GetLastVerionFirmwareinfo';
  215. return getApiBasic(url, postdata);
  216. }
  217. // 添加固件
  218. export function FirmwareAdd(postdata) {
  219. // 添加固件
  220. let url = headapi + 'v1/AdminSettings/FirmwareAdd';
  221. return getApiBasic(url, postdata);
  222. }
  223. // 查询所有信号记录,包含手机信号和Wifi信号
  224. export function LogFullDetectedQueryByDetector(postdata) {
  225. // 查询所有信号记录,包含手机信号和Wifi信号
  226. let url = headapi + 'v1/Detector/LogFullDetectedQueryByDetector';
  227. return getApiBasic(url, postdata);
  228. }
  229. // 获取二维码信息列表
  230. export function GetQrcodeList(postdata) {
  231. // 获取二维码信息列表
  232. let url = headapi + 'v1/Detector/GetQrcodeList';
  233. return getApiBasic(url, postdata);
  234. }
  235. // 添加二维码
  236. export function QrCodeAdd(postdata) {
  237. // 添加二维码
  238. let url = headapi + 'v1/Detector/QrCodeAdd';
  239. return getApiBasic(url, postdata);
  240. }
  241. // 修改二维码
  242. export function QrCodeEdit(postdata) {
  243. // 修改二维码
  244. let url = headapi + 'v1/Detector/QrCodeEdit';
  245. return getApiBasic(url, postdata);
  246. }
  247. // 修改二维码状态
  248. export function QrcodeEditStatus(postdata) {
  249. // 修改二维码状态
  250. let url = headapi + 'v1/Detector/QrcodeEditStatus';
  251. return getApiBasic(url, postdata);
  252. }
  253. // 某二维码下实时探测情况
  254. export function DeviceInfoByQrCodeId(postdata) {
  255. // 某二维码下实时探测情况
  256. let url = headapi + 'v1/Detector/DeviceInfoByQrCodeId';
  257. return getApiBasic(url, postdata);
  258. }
  259. // 通过Key下载二维码对应图片
  260. export function QrcodePictureGet(postdata) {
  261. // 通过Key下载二维码对应图片
  262. let url = headapi + 'v1/Detector/QrcodePictureGet';
  263. return getApiBasic(url, postdata);
  264. }
  265. // 获取检测设备坐标
  266. export function GetDetectorCoords(postdata) {
  267. // 获取检测设备坐标
  268. let url = headapi + 'v1/Detector/GetDetectorCoords';
  269. return getApiBasic(url, postdata);
  270. }
  271. // 获取全部区域选择框信息
  272. export function GeFullRegionSelect(postdata) {
  273. // 获取检测设备坐标
  274. let url = headapi + 'v1/Auth/GeFullRegionSelect';
  275. return getApiBasic(url, postdata);
  276. }
  277. // 区域检测实时记录合并
  278. export function RegionDetDetaillist(postdata) {
  279. let url = headapi + 'v1/Company/RegionDetDetaillist';
  280. return getApiBasic(url, postdata);
  281. }
  282. // 单个设备检测实时记录合并
  283. export function SingleDetDetaillist(postdata) {
  284. let url = headapi + 'v1/Company/SingleDetDetaillist';
  285. return getApiBasic(url, postdata);
  286. }
  287. // 0-6G折线图信息传入区域Id
  288. export function Region06GInfolist(postdata) {
  289. let url = headapi + 'v1/Detector/Region06GInfolist';
  290. return getApiBasic(url, postdata);
  291. }