Просмотр исходного кода

修复接口玛氏岗位失效调用

pm 3 месяцев назад
Родитель
Сommit
b2bb5d214c
3 измененных файлов с 8 добавлено и 40 удалено
  1. 0 32
      src/api/marsdept/index.ts
  2. 6 3
      src/api/spm/index.ts
  3. 2 5
      src/components/SegregationPointManagement.tsx

+ 0 - 32
src/api/marsdept/index.ts

@@ -1,32 +0,0 @@
-import axiosInstance from '../../utils/axios';
-
-// 岗位(MarsDept)VO 类型
-export interface MarsDeptVO {
-  id?: number;
-  workstationName: string;
-  parentId?: number;
-  children?: MarsDeptVO[];
-  [key: string]: any;
-}
-
-// 分页参数类型
-export interface PageParam {
-  pageNo?: number;
-  pageSize?: number;
-  [key: string]: any;
-}
-
-// 分页响应类型
-export interface PageResponse<T> {
-  list: T[];
-  total: number;
-}
-
-// 岗位(MarsDept)管理 API
-export const marsDeptApi = {
-  // 查询岗位列表
-  listMarsDept: (params?: PageParam): Promise<PageResponse<MarsDeptVO>> => {
-    return axiosInstance.get('/system/marsdept/list', { params });
-  },
-};
-

+ 6 - 3
src/api/spm/index.ts

@@ -53,12 +53,15 @@ export interface PageResponse<T> {
 export const segregationPointApi = {
   // 查询隔离点列表(分页)
   getIsIsolationPointPage: async (params?: PageParam): Promise<PageResponse<SegregationPointVO>> => {
+    // 从 params 中提取查询参数,排除分页参数 current 和 size
+    const { current, size, pageNo, pageSize, ...queryParams } = params || {};
+    
     const response = await request.get({ 
       url: '/iscs/isolation-point/getIsolationPointPage', 
       params: {
-        pageNo: params?.pageNo || params?.current || 1,
-        pageSize: params?.pageSize || params?.size || 10,
-        ...params,
+        pageNo: pageNo || current || 1,
+        pageSize: pageSize || size || 10,
+        ...queryParams,
       }
     });
     

+ 2 - 5
src/components/SegregationPointManagement.tsx

@@ -1,7 +1,6 @@
 import React, { useState, useEffect, useRef, useMemo } from 'react';
 import { Plus, Search, RefreshCw, Edit2, Trash2 } from 'lucide-react';
 import { segregationPointApi, SegregationPointVO, PageParam } from '../api/spm/index';
-import { marsDeptApi, MarsDeptVO } from '../api/marsdept/index';
 import { lotoStationApi, LotoStationVO } from '../api/lotoStation/index';
 import { technologyApi, TechnologyVO } from '../api/technology/index';
 import { toast } from 'sonner';
@@ -89,10 +88,8 @@ export default function SegregationPointManagement({ subMenu }: SegregationPoint
   useEffect(() => {
     const initData = async () => {
       try {
-        // 获取岗位数据
-        const deptRes = await marsDeptApi.listMarsDept({ pageNo: 1, pageSize: -1 });
-        const deptTreeData = handleTree(deptRes.list, 'id', 'parentId');
-        setDeptOptions(convertToTreeSelectData(deptTreeData, 'workstationName'));
+        // 获取岗位数据 - 接口已废弃,保留空数组
+        setDeptOptions([]);
 
         // 获取锁定站数据
         try {