dataplatform.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import { http } from '@/utils/http/axios';
  2. /**
  3. * @description: 获取用户访问记录接口参数
  4. */
  5. export interface UserAccessRecordQueryParams {
  6. /** 页码 */
  7. pageNumber: number;
  8. /** 页面大小 */
  9. pageSize: number;
  10. /** 查询员工姓名 */
  11. nickname?: string;
  12. /** 查询工号 */
  13. stuffNo?: string;
  14. /** 查询部门ID */
  15. deptId?: string;
  16. /** 设置排序字段 */
  17. sortKey?: string;
  18. /** 设置排序方式 */
  19. sortType?: string;
  20. }
  21. /**
  22. * @description: 用户访问记录列表数据
  23. */
  24. export interface UserAccessRecord {
  25. /** 系统分配id */
  26. userId: number;
  27. /** 登录账户名 */
  28. username: string;
  29. /** 工号 */
  30. stuffNo: string;
  31. /** 姓名 */
  32. nickname: string;
  33. deptId: number;
  34. deptName: string;
  35. statisticDay: number;
  36. statisticMonth: number;
  37. statisticAll: number;
  38. }
  39. /**
  40. * @description: 用户访问记录数据
  41. */
  42. export interface UserAccessRecordList {
  43. list: UserAccessRecord[];
  44. pageNumber: number;
  45. pageSize: number;
  46. total: number;
  47. }
  48. /**
  49. * @description: 获取用户访问记录
  50. */
  51. export const getUserAccessRecords = (params: UserAccessRecordQueryParams) => {
  52. return http.request<UserAccessRecordList>({
  53. url: '/userRecord/getList',
  54. method: 'get',
  55. params,
  56. });
  57. };
  58. /**
  59. * @description: 绘图时间段&员工&车间查询参数
  60. */
  61. export interface ChartQuery {
  62. /** 开始时间 */
  63. startTime?: string;
  64. /** 结束时间 */
  65. endTime?: string;
  66. /** 员工id */
  67. userId?: string;
  68. /** 车间id */
  69. workshopList?: number[];
  70. }
  71. /**
  72. * @description: 车间被访问次数数据
  73. */
  74. export interface WorkshopVisitedTimes {
  75. workshopId: number;
  76. workshopName: string;
  77. count: number;
  78. }
  79. /**
  80. * @description: 获取车间被访问次数数据
  81. */
  82. export const getWorkshopVisitedTimes = (params: ChartQuery) => {
  83. return http.request<WorkshopVisitedTimes[]>({
  84. url: '/userRecord/statisticByWorkshop',
  85. method: 'get',
  86. params,
  87. });
  88. };
  89. /**
  90. * @description: 相机被访问次数数据
  91. */
  92. export interface CameraVisitedTimes {
  93. cameraCode: string;
  94. cameraName: string;
  95. count: number;
  96. }
  97. export interface CameraVisitedTimeItem {
  98. workshopId: number;
  99. workshopCode: string;
  100. workshopName: string;
  101. cameraCounts: CameraVisitedTimes[];
  102. }
  103. /**
  104. * @description: 获取相机被访问次数数据
  105. */
  106. export const getCameraVisitedTimes = (body: ChartQuery) => {
  107. return http.request<CameraVisitedTimeItem[]>({
  108. url: '/userRecord/statisticByCamera',
  109. method: 'post',
  110. data: body,
  111. });
  112. };
  113. /**
  114. * @description: 获取员工访问车间次数数据
  115. */
  116. export const getUserVisitTimes = (params: ChartQuery) => {
  117. return http.request<WorkshopVisitedTimes[]>({
  118. url: '/userRecord/statisticByWorkshopPerUser',
  119. method: 'get',
  120. params,
  121. });
  122. };
  123. /**
  124. * @description: 员工日访问车间次数数据
  125. */
  126. export interface UserDailyVisitTimes {
  127. time: string[];
  128. data: { counts: number; workshopId: number; workshopName: string }[];
  129. }
  130. /**
  131. * @description: 获取员工日访问车间次数数据
  132. */
  133. export const getUserDailyVisitTimes = (body: ChartQuery) => {
  134. return http.request<UserDailyVisitTimes>({
  135. url: '/userRecord/statisticByWorkshopPerDay',
  136. method: 'post',
  137. data: body,
  138. });
  139. };