根据用户获取场站

This commit is contained in:
mmc
2026-07-09 09:50:46 +08:00
parent 1c229f32b0
commit 463322427b
5 changed files with 30 additions and 25 deletions

View File

@@ -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',

View File

@@ -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]));

View File

@@ -347,20 +347,20 @@ export default function ErrorManagement() {
{/* 搜索区域完全不变 */}
<Form form={searchForm} layout="inline" style={{ marginBottom: 0 }}>
<Form.Item name="errorCode" label="错误编码">
<Input placeholder="请输入错误编码" style={{ width: 150 }} allowClear size="small" />
<Input placeholder="请输入错误编码" style={{ width: 150 }} allowClear />
</Form.Item>
<Form.Item name="errorName" label="错误名称">
<Input placeholder="请输入错误名称" style={{ width: 150 }} allowClear size="small" />
<Input placeholder="请输入错误名称" style={{ width: 150 }} allowClear />
</Form.Item>
<Form.Item name="errorSource" label="错误来源">
<Select placeholder="请选择来源" style={{ width: 120 }} allowClear size="small">
<Select placeholder="请选择来源" style={{ width: 120 }} allowClear >
{errorSourceOptions.map(option => (
<Option key={option.value} value={option.value}>{option.label}</Option>
))}
</Select>
</Form.Item>
<Form.Item name="errorLevel" label="错误等级">
<Select placeholder="请选择等级" style={{ width: 120 }} allowClear size="small">
<Select placeholder="请选择等级" style={{ width: 120 }} allowClear >
{errorLevelOptions.map(option => (
<Option key={option.value} value={option.value}>{option.label}</Option>
))}
@@ -368,9 +368,9 @@ export default function ErrorManagement() {
</Form.Item>
<Form.Item>
<Space>
<Button type="primary" icon={<SearchOutlined />} onClick={handleSearch} size="small">查询</Button>
<Button icon={<ReloadOutlined />} onClick={handleReset} size="small">重置</Button>
<Button type="primary" icon={<PlusOutlined />} onClick={() => openModal('add')} size="small">新增</Button>
<Button type="primary" icon={<SearchOutlined />} onClick={handleSearch} >查询</Button>
<Button icon={<ReloadOutlined />} onClick={handleReset} >重置</Button>
<Button type="primary" icon={<PlusOutlined />} onClick={() => openModal('add')} >新增</Button>
</Space>
</Form.Item>
</Form>

View File

@@ -273,14 +273,13 @@ export default function StationManage() {
))}
</Select>
<Button onClick={handleReset}>重置</Button>
<Button type="primary" icon={<PlusOutlined />} onClick={handleAdd}>
新增场站
</Button>
</div>
)}
<div style={{ display: 'flex', justifyContent: 'end', marginBottom: 16 }}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleAdd}>
新增场站
</Button>
</div>
<Table
rowKey="id"

View File

@@ -613,13 +613,13 @@ const WorkOrderPage = () => {
{/* 右侧:详情 + AI + 告警 */}
<Col xs={24} xl={9}>
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '20px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>
<Text strong style={{ fontSize: 16, color: '#1D2129' }}>工单详情</Text>
<Text type="secondary" style={{ fontSize: 12 }}>工单编号: <span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
</div>
<div style={{ marginBottom: 24 }}>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
<div style={{ marginBottom: 8 }}>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 8, flexWrap: 'wrap', gap: 12 }}>
<span level={4} style={{ margin: 0, fontSize: 18, fontWeight: 800 }}>{currentDetail?.orderTitle || '暂无标题'}</span>
{currentDetail?.priorityLevel && (
<Tag style={{ color: priorityConfig[currentDetail.priorityLevel]?.color, background: priorityConfig[currentDetail.priorityLevel]?.bg, border: `1px solid ${priorityConfig[currentDetail.priorityLevel]?.color}`, borderRadius: 4, fontWeight: 600 }}>
@@ -653,7 +653,7 @@ const WorkOrderPage = () => {
</Row>
</div>
<div style={{ marginBottom: 32 }}>
<div style={{ marginBottom: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 10px', position: 'relative' }}>
<div style={{ position: 'absolute', top: 11, left: '15%', right: '15%', height: 2, background: '#f0f0f0', zIndex: 1 }}>
<div style={{ width: currentDetail?.orderStatus >= 3 ? '100%' : (currentDetail?.orderStatus === 2 ? '66%' : '33%'), height: '100%', background: '#00B42A' }}></div>