| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- import { PaginationRequest, PaginationResponse } from '@/types/common/type';
- import { http } from '@/utils/http/axios';
- /**
- * @description: 获取用户访问记录接口参数
- */
- export interface UserAccessRecordQueryParams {
- /** 查询员工姓名 */
- nickname?: string;
- /** 查询工号 */
- staffNo?: string;
- /** 查询部门ID */
- deptId?: string;
- /** 设置排序字段 */
- sortKey?: string;
- /** 设置排序方式 */
- sortType?: string;
- }
- /**
- * @description: 用户访问记录列表数据
- */
- export interface UserAccessRecord {
- /** 系统分配id */
- userId: number;
- /** 登录账户名 */
- username: string;
- /** 工号 */
- staffNo: string;
- /** 姓名 */
- nickname: string;
- deptId: number;
- deptName: string;
- statisticDay: number;
- statisticMonth: number;
- statisticAll: number;
- }
- /**
- * @description: 用户访问记录数据
- */
- export interface UserAccessRecordList {
- list: UserAccessRecord[];
- pageNumber: number;
- pageSize: number;
- total: number;
- }
- /**
- * @description: 获取用户访问记录
- */
- export const getUserAccessRecords = (
- data: PaginationRequest & { queryParam: UserAccessRecordQueryParams },
- ) => {
- return http.request<PaginationResponse<UserAccessRecord>>({
- url: '/admin/userRecord/getList',
- method: 'post',
- data,
- });
- };
- /**
- * @description: 绘图时间段&员工&车间查询参数
- */
- export interface ChartQuery {
- /** 开始时间 */
- startTime?: string;
- /** 结束时间 */
- endTime?: string;
- /** 员工id */
- userId?: string;
- /** 车间id */
- workshopList?: number[];
- }
- /**
- * @description: 车间被访问次数数据
- */
- export interface WorkshopVisitedTimes {
- workshopId: number;
- workshopName: string;
- count: number;
- }
- /**
- * @description: 获取车间被访问次数数据
- */
- export const getWorkshopVisitedTimes = (params: ChartQuery) => {
- return http.request<WorkshopVisitedTimes[]>({
- url: '/admin/userRecord/statisticByWorkshop',
- method: 'get',
- params,
- });
- };
- /**
- * @description: 相机被访问次数数据
- */
- export interface CameraVisitedTimes {
- cameraCode: string;
- cameraName: string;
- count: number;
- }
- export interface CameraVisitedTimeItem {
- workshopId: number;
- workshopCode: string;
- workshopName: string;
- cameraCounts: CameraVisitedTimes[];
- }
- /**
- * @description: 获取相机被访问次数数据
- */
- export const getCameraVisitedTimes = (body: ChartQuery) => {
- return http.request<CameraVisitedTimeItem[]>({
- url: '/admin/userRecord/statisticByCamera',
- method: 'post',
- data: body,
- });
- };
- /**
- * @description: 获取员工访问车间次数数据
- */
- export const getUserVisitTimes = (params: ChartQuery) => {
- return http.request<WorkshopVisitedTimes[]>({
- url: '/admin/userRecord/statisticByWorkshopPerUser',
- method: 'get',
- params,
- });
- };
- /**
- * @description: 员工日访问车间次数数据
- */
- export interface UserDailyVisitTimes {
- time: string[];
- data: { counts: number; workshopId: number; workshopName: string }[];
- }
- /**
- * @description: 获取员工日访问车间次数数据
- */
- export const getUserDailyVisitTimes = (body: ChartQuery) => {
- return http.request<UserDailyVisitTimes>({
- url: '/admin/userRecord/statisticByWorkshopPerDay',
- method: 'post',
- data: body,
- });
- };
- /** 获取积分列表请求体 */
- export interface ScoreTableQueryBody {
- /** 页码 */
- pageNumber: number;
- /** 页面大小 */
- pageSize: number;
- /** 查询姓名 */
- nickname?: string;
- /** 查询工号 */
- staffNo?: string;
- /** 查询部门ID */
- deptId?: string;
- /** 设置排序字段 */
- order?: number;
- /**设置排序方式 */
- }
- /** 条件获取分页积分 */
- export const getScoreTable = (body: ScoreTableQueryBody) => {
- return http.request<ScoreTableRecord>({
- url: '/admin/scoreManagement/getScorePageByCondition',
- method: 'post',
- data: body,
- });
- };
- /** 用户访问记录列表数据 */
- export interface ScoreTableRecordList {
- staffNo: string;
- nickname: string;
- deptId: number;
- deptName: string;
- score: number;
- }
- /** 用户访问记录数据 */
- export interface ScoreTableRecord {
- records: ScoreTableRecordList[];
- pageNumber: number;
- pageSize: number;
- totalPage: number;
- totalRow: number;
- }
- /** 获取积分分段人数 */
- export const getScoreChartData = (deptIdList: number[]) => {
- return http.request<ScoreChartItem[]>({
- url: `/admin/scoreManagement/getNumOfSectionScore`,
- method: 'post',
- data: { deptIdList },
- });
- };
- /** 积分分段数据 */
- export interface ScoreChartItem {
- num: number;
- scoreSection: number[];
- }
|