common.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. import HttpAxios from '@/utils/axios'
  2. const base = import.meta.env.VITE_API_HOST
  3. const baseUrl = `${base}/main_new_version.php`
  4. /**
  5. * 获取表格定制列功能数据
  6. */
  7. export const getTableSettingColumns = (params: any, config: any) => {
  8. return HttpAxios.get(`${baseUrl}`, params, config)
  9. }
  10. /**
  11. * 保存表格定制列数据
  12. */
  13. export const saveTableSettingColumns = (params: any, config: any) => {
  14. return HttpAxios.post(
  15. `${baseUrl}`,
  16. {
  17. action: 'ajax',
  18. operate: 'save_setting_display',
  19. model_name: 'Booking_Search',
  20. ...params
  21. },
  22. config
  23. )
  24. }
  25. /**
  26. * 修改密码
  27. */
  28. export const changePwdByLogin = (params: any, config: any) => {
  29. return HttpAxios.post(
  30. `${baseUrl}`,
  31. {
  32. action: 'password',
  33. ...params
  34. },
  35. config
  36. )
  37. }
  38. /**
  39. * 获取菜单列表
  40. */
  41. export const getMenuList = (params: any, config: any) => {
  42. return HttpAxios.get(
  43. `${baseUrl}`,
  44. {
  45. action: 'main',
  46. ...params
  47. },
  48. config
  49. )
  50. }
  51. /**
  52. * 获取日志列
  53. */
  54. export const getOperationTableColumns = (params: any, config: any) => {
  55. return HttpAxios.get(
  56. `${baseUrl}`,
  57. {
  58. action: 'opreation_log'
  59. },
  60. config
  61. )
  62. }
  63. /**
  64. * 查询日志
  65. */
  66. export const SearchOperationLog = (params: any, config: any) => {
  67. return HttpAxios.post(
  68. `${baseUrl}`,
  69. {
  70. action: 'opreation_log',
  71. operate: 'search',
  72. ...params
  73. },
  74. config
  75. )
  76. }
  77. /**
  78. * 日志表格下载
  79. */
  80. export const OperationLogDownload = (params: any, config: any) => {
  81. return HttpAxios.post(
  82. `${baseUrl}`,
  83. {
  84. action: 'opreation_log',
  85. operate: 'excel',
  86. ...params
  87. },
  88. config
  89. )
  90. }
  91. /**
  92. * 获取首页数据
  93. */
  94. export const GetDashboardData = (params: any, config: any) => {
  95. return HttpAxios.post(
  96. `${baseUrl}`,
  97. {
  98. action: 'main_welcome',
  99. ...params
  100. },
  101. config
  102. )
  103. }
  104. /**
  105. * 获取ETD to ETA (Days)
  106. */
  107. export const GetETDEcharts = (params: any, config: any) => {
  108. return HttpAxios.get(
  109. `${baseUrl}`,
  110. {
  111. action: 'main_report_etd',
  112. r_type: 'r1',
  113. ...params
  114. },
  115. config
  116. )
  117. }
  118. /**
  119. * 获取KPI Echarts
  120. */
  121. export const GetKPIEcharts = (params: any, config: any) => {
  122. return HttpAxios.get(
  123. `${baseUrl}`,
  124. {
  125. action: 'main_report_kpi',
  126. ...params
  127. },
  128. config
  129. )
  130. }
  131. /**
  132. * 获取Pending Echarts
  133. */
  134. export const GetPendingEcharts = (params: any, config: any) => {
  135. return HttpAxios.get(
  136. `${baseUrl}`,
  137. {
  138. action: 'main_report',
  139. ...params
  140. },
  141. config
  142. )
  143. }
  144. /**
  145. * 获取ContainerCount Echarts
  146. */
  147. export const GetContainerCountEcharts = (params: any, config: any) => {
  148. return HttpAxios.get(
  149. `${baseUrl}`,
  150. {
  151. action: 'main_report_container_bar',
  152. r_type: 'r2',
  153. ...params
  154. },
  155. config
  156. )
  157. }
  158. /**
  159. * 获取CO2 Emission
  160. */
  161. export const GetCo2EmissionEcharts = (params: any, config: any) => {
  162. return HttpAxios.get(
  163. `${baseUrl}`,
  164. {
  165. action: 'main_report_co2e_bar',
  166. r_type: 'co2e_orgin',
  167. ...params
  168. },
  169. config
  170. )
  171. }
  172. /**
  173. * 获取CO2 Destination
  174. */
  175. export const GetCo2DestinationEcharts = (params: any, config: any) => {
  176. return HttpAxios.get(
  177. `${baseUrl}`,
  178. {
  179. action: 'main_report_co2e_bar',
  180. r_type: 'co2e_destination',
  181. ...params
  182. },
  183. config
  184. )
  185. }
  186. /**
  187. * Top10 Origin/Destination
  188. */
  189. export const GetTop10ODEcharts = (params: any, config: any) => {
  190. return HttpAxios.get(
  191. `${baseUrl}`,
  192. {
  193. action: 'main_report_top10_bar',
  194. r_type: 'top',
  195. ...params
  196. },
  197. config
  198. )
  199. }
  200. /**
  201. * Save Layout
  202. */
  203. export const SaveLayout = (params: any, config: any) => {
  204. return HttpAxios.post(
  205. `${baseUrl}`,
  206. {
  207. action: 'save_layout',
  208. ...params
  209. },
  210. config
  211. )
  212. }
  213. /**
  214. * 评分提交
  215. */
  216. export const scoringgrade = (params: any, config: any) => {
  217. return HttpAxios.post(
  218. `${baseUrl}`,
  219. {
  220. action: 'tools',
  221. operate: 'mark_save',
  222. ...params
  223. },
  224. config
  225. )
  226. }
  227. /**
  228. * 获取首页筛选条件
  229. */
  230. export const getDashboardFilters = (config: any) => {
  231. return HttpAxios.get(
  232. `${baseUrl}`,
  233. {
  234. action: 'main_filter',
  235. },
  236. config
  237. )
  238. }