根据用户获取场站
This commit is contained in:
@@ -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]));
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user