fileApi.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. var fileUrl = "https://hsws.enstation.com/radar_war";
  2. // var fileUrl = "http://10.60.11.150:8085";
  3. var _header = {
  4. "Authorization": "Bearer " + getCookie("tzToken")
  5. };
  6. // 雷达同舟登录
  7. function setFileLogin(){
  8. $.ajax({
  9. url: fileUrl + "/login",
  10. type: "POST",
  11. dataType: "JSON",
  12. async: false,
  13. data:JSON.stringify({
  14. username: "n5cMa8laaQm+x24QXdu2+A==",
  15. password: "n/kedxFbY0pPAAbTPfIbZg==",
  16. code: null,
  17. uuid: "f53582934d844429a52be829a9291789"
  18. }),
  19. headers: {
  20. "Content-Type": "application/json"
  21. },
  22. success:function (json) {
  23. if(json.code == 200){
  24. delCookie("tzToken");
  25. setCookie("tzToken", json.token);
  26. }
  27. }
  28. })
  29. }
  30. function getUseDict(...args){
  31. var res = {};
  32. return (() => {
  33. args.forEach((d, index) => {
  34. res[d] = [];
  35. getAxios({
  36. url: fileUrl + "/system/dict/data/type/"+d,
  37. type:"GET"
  38. }, {}, _header).then(resp => {
  39. res[d] = resp.data.map(p => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass }))
  40. })
  41. })
  42. return res;
  43. })()
  44. }
  45. // 证书列表
  46. function getCertificateList(_data){
  47. let _opts = {
  48. url: fileUrl + "/tongzhou/certificate/certificate/list",
  49. type:"GET"
  50. };
  51. return getAxios(_opts, _data, _header)
  52. }
  53. // 证书单个详情
  54. function getCertificateDetail(_id){
  55. let _opts = {
  56. url: fileUrl + "/tongzhou/certificate/certificate/"+_id,
  57. type:"GET"
  58. };
  59. return getAxios(_opts, {}, _header)
  60. }
  61. // 证书单个删除
  62. function DelCertificate(_id){
  63. let _opts = {
  64. url: fileUrl + "/tongzhou/certificate/certificate/"+_id,
  65. type:"DELETE"
  66. };
  67. return getAxios(_opts, {}, _header)
  68. }
  69. // 证书编辑
  70. function updateCertificate(_data){
  71. let _opts = {
  72. url: fileUrl + '/tongzhou/certificate/certificate',
  73. type:"PUT"
  74. };
  75. _header['Content-Type'] = 'application/json;charset=utf-8';
  76. return postAxios(_opts, JSON.stringify(_data), _header);
  77. }
  78. // 证书新增
  79. function addCertificate(_data){
  80. let _opts = {
  81. url: fileUrl + '/tongzhou/certificate/certificate',
  82. type:"POST"
  83. };
  84. _header['Content-Type'] = 'application/json;charset=utf-8';
  85. return postAxios(_opts, JSON.stringify(_data), _header);
  86. }
  87. // 证书部门
  88. function getDeptList(){
  89. let _opts = {
  90. url: fileUrl + "/system/dept/treeselect",
  91. type:"GET"
  92. };
  93. return getAxios(_opts, {}, _header)
  94. }
  95. // 备件列表
  96. function getStorageList(_data){
  97. let _opts = {
  98. url: fileUrl + "/tongzhou/sparePart/sparePart/list",
  99. type:"GET"
  100. };
  101. return getAxios(_opts, _data, _header)
  102. }
  103. // 备件单个详情
  104. function getStorageDetail(_id){
  105. let _opts = {
  106. url: fileUrl + "/tongzhou/sparePart/sparePart/"+_id,
  107. type:"GET"
  108. };
  109. return getAxios(_opts, {}, _header)
  110. }
  111. // 备件编辑
  112. function updateStorage(_data){
  113. let _opts = {
  114. url: fileUrl + '/tongzhou/sparePart/sparePart',
  115. type:"PUT"
  116. };
  117. _header['Content-Type'] = 'application/json;charset=utf-8';
  118. return postAxios(_opts, JSON.stringify(_data), _header);
  119. }
  120. // 备件新增
  121. function addStorage(_data){
  122. let _opts = {
  123. url: fileUrl + '/tongzhou/sparePart/sparePart',
  124. type:"POST"
  125. };
  126. _header['Content-Type'] = 'application/json;charset=utf-8';
  127. return postAxios(_opts, JSON.stringify(_data), _header);
  128. }
  129. // 备件单个删除
  130. function DelStorage(_id){
  131. let _opts = {
  132. url: fileUrl + "/tongzhou/sparePart/sparePart/"+_id,
  133. type:"DELETE"
  134. };
  135. return getAxios(_opts, {}, _header)
  136. }
  137. // 备件出入库请求
  138. function setInOutOrder(_data){
  139. let _opts = {
  140. url: fileUrl + '/tongzhou/sparePartAccess/sparePartAccess',
  141. type:"POST"
  142. };
  143. _header['Content-Type'] = 'application/json;charset=utf-8';
  144. return postAxios(_opts, JSON.stringify(_data), _header);
  145. }
  146. // 备件出入库列表
  147. function getInOutList(_data){
  148. let _opts = {
  149. url: fileUrl + "/tongzhou/sparePartAccess/sparePartAccess/list",
  150. type:"GET"
  151. };
  152. return getAxios(_opts, _data, _header)
  153. }
  154. // 出入库单个记录详情
  155. function getInOutDetail(_id){
  156. let _opts = {
  157. url: fileUrl + "/tongzhou/sparePartAccess/sparePartAccess/"+_id,
  158. type:"GET"
  159. };
  160. return getAxios(_opts, {}, _header)
  161. }
  162. // 删除出入库单个记录
  163. function DelInOutDetail(_id){
  164. let _opts = {
  165. url: fileUrl + "/tongzhou/sparePartAccess/sparePartAccess/"+_id,
  166. type:"DELETE"
  167. };
  168. return getAxios(_opts, {}, _header)
  169. }
  170. // 维修记录表
  171. function getMaintenanceList(_data){
  172. let _opts = {
  173. url: fileUrl + "/tongzhou/MaintailRecord/MaintailRecord/list",
  174. type:"GET"
  175. };
  176. return getAxios(_opts, _data, _header)
  177. }
  178. // 单个维修记录
  179. function getMaintenanceDetail(id){
  180. let _opts = {
  181. url: fileUrl + "/tongzhou/MaintailRecord/MaintailRecord/"+id,
  182. type:"GET"
  183. };
  184. return getAxios(_opts, {}, _header)
  185. }
  186. // 新增维修记录
  187. function addMaintain(_data){
  188. let _opts = {
  189. url: fileUrl + '/tongzhou/MaintailRecord/MaintailRecord',
  190. type:"POST"
  191. };
  192. _header['Content-Type'] = 'application/json;charset=utf-8';
  193. return postAxios(_opts, JSON.stringify(_data), _header);
  194. }
  195. // 修改维修记录
  196. function updateMaintain(_data){
  197. let _opts = {
  198. url: fileUrl + '/tongzhou/MaintailRecord/MaintailRecord',
  199. type: "PUT"
  200. };
  201. _header['Content-Type'] = 'application/json;charset=utf-8';
  202. return postAxios(_opts, JSON.stringify(_data), _header);
  203. }
  204. // 删除单条维修记录
  205. function DelMaintenance(id){
  206. let _opts = {
  207. url: fileUrl + "/tongzhou/MaintailRecord/MaintailRecord/"+id,
  208. type:"DELETE"
  209. };
  210. return getAxios(_opts, {}, _header)
  211. }
  212. var comUrl = "https://www.enstation.com:8083/ruico/rueigao-admin"
  213. // 报警心跳
  214. function getHeartbeat(_data){
  215. let _opts = {
  216. url: fileUrl + "/facilityMonitor/facilityMonitor/list",
  217. type:"GET"
  218. };
  219. return getAxios(_opts, _data, _header)
  220. }
  221. // 获取心跳配置参数
  222. function getHeartbeatInfo(_data){
  223. let _opts = {
  224. url: fileUrl + "/facilityMonitor/facilityMonitor/getFacilityMonitorConfig",
  225. type:"GET"
  226. };
  227. return getAxios(_opts, {}, _header)
  228. }
  229. // 修改心跳配置参数
  230. function updateHeartbeatInfo(_data){
  231. let _opts = {
  232. url: fileUrl + '/facilityMonitor/facilityMonitor/updateFacilityMonitorConfig',
  233. type: "PUT"
  234. };
  235. _header['Content-Type'] = 'application/json;charset=utf-8';
  236. return postAxios(_opts, JSON.stringify(_data), _header);
  237. }