From 463322427b5159b719b187ac47a6f9b862df77ad Mon Sep 17 00:00:00 2001 From: mmc <1556375442@qq.com> Date: Thu, 9 Jul 2026 09:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=94=A8=E6=88=B7=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=9C=BA=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/stationManage/index.ts | 12 +++++++++++- src/components/Layout.tsx | 12 ++++-------- src/components/SystemSetting/ErrorManagement.tsx | 14 +++++++------- src/components/SystemSetting/StationManage.tsx | 9 ++++----- src/pages/WorkOrder.tsx | 8 ++++---- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/api/stationManage/index.ts b/src/api/stationManage/index.ts index 7fb0be1..9f30f97 100644 --- a/src/api/stationManage/index.ts +++ b/src/api/stationManage/index.ts @@ -1,6 +1,7 @@ import request from '../request'; -//获取组织列表 +//根据用户获取场站 + export function getStationList(params) { return request({ url: '/system/site/list', @@ -10,6 +11,15 @@ export function getStationList(params) { }); } +//获取组织列表 +export function getStationByUserId() { + return request({ + url: '/system/site/selectByUserId', + method: 'get', + + }); +} + export function saveSite(data) { return request({ url: '/system/site/save', diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index e6c7d3f..211074c 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -17,7 +17,7 @@ import { RootState, useAppDispatch } from '../store'; import { logout } from '../store/userSlice'; import { setCurrentStation, clearStation } from '../store/stationSlice'; import { getMenuList } from '../api/mune'; -import { getStationList } from '../api/stationManage'; +import { getStationByUserId } from '../api/stationManage'; import envConfig from '../../env'; const { Header, Sider, Content } = Layout; @@ -38,14 +38,10 @@ export default function AppLayout() { const { currentStation, stationId } = useSelector((state: RootState) => state.station); const getStationData = () => { - const params = { - pageNum: 1, - pageSize: 9999, - orgId: userInfo?.orgId, - }; - getStationList(params).then(res => { + + getStationByUserId().then(res => { if (res.code === 200) { - const list = res.rows || []; + const list = res.data || []; setStationList(list); if (!currentStation && list.length > 0) { dispatch(setCurrentStation(list[0])); diff --git a/src/components/SystemSetting/ErrorManagement.tsx b/src/components/SystemSetting/ErrorManagement.tsx index 580d02e..ba74296 100644 --- a/src/components/SystemSetting/ErrorManagement.tsx +++ b/src/components/SystemSetting/ErrorManagement.tsx @@ -347,20 +347,20 @@ export default function ErrorManagement() { {/* 搜索区域完全不变 */}