根据用户获取场站
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import request from '../request';
|
import request from '../request';
|
||||||
|
|
||||||
//获取组织列表
|
//根据用户获取场站
|
||||||
|
|
||||||
export function getStationList(params) {
|
export function getStationList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/site/list',
|
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) {
|
export function saveSite(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/site/save',
|
url: '/system/site/save',
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { RootState, useAppDispatch } from '../store';
|
|||||||
import { logout } from '../store/userSlice';
|
import { logout } from '../store/userSlice';
|
||||||
import { setCurrentStation, clearStation } from '../store/stationSlice';
|
import { setCurrentStation, clearStation } from '../store/stationSlice';
|
||||||
import { getMenuList } from '../api/mune';
|
import { getMenuList } from '../api/mune';
|
||||||
import { getStationList } from '../api/stationManage';
|
import { getStationByUserId } from '../api/stationManage';
|
||||||
import envConfig from '../../env';
|
import envConfig from '../../env';
|
||||||
|
|
||||||
const { Header, Sider, Content } = Layout;
|
const { Header, Sider, Content } = Layout;
|
||||||
@@ -38,14 +38,10 @@ export default function AppLayout() {
|
|||||||
const { currentStation, stationId } = useSelector((state: RootState) => state.station);
|
const { currentStation, stationId } = useSelector((state: RootState) => state.station);
|
||||||
|
|
||||||
const getStationData = () => {
|
const getStationData = () => {
|
||||||
const params = {
|
|
||||||
pageNum: 1,
|
getStationByUserId().then(res => {
|
||||||
pageSize: 9999,
|
|
||||||
orgId: userInfo?.orgId,
|
|
||||||
};
|
|
||||||
getStationList(params).then(res => {
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
const list = res.rows || [];
|
const list = res.data || [];
|
||||||
setStationList(list);
|
setStationList(list);
|
||||||
if (!currentStation && list.length > 0) {
|
if (!currentStation && list.length > 0) {
|
||||||
dispatch(setCurrentStation(list[0]));
|
dispatch(setCurrentStation(list[0]));
|
||||||
|
|||||||
@@ -347,20 +347,20 @@ export default function ErrorManagement() {
|
|||||||
{/* 搜索区域完全不变 */}
|
{/* 搜索区域完全不变 */}
|
||||||
<Form form={searchForm} layout="inline" style={{ marginBottom: 0 }}>
|
<Form form={searchForm} layout="inline" style={{ marginBottom: 0 }}>
|
||||||
<Form.Item name="errorCode" label="错误编码">
|
<Form.Item name="errorCode" label="错误编码">
|
||||||
<Input placeholder="请输入错误编码" style={{ width: 150 }} allowClear size="small" />
|
<Input placeholder="请输入错误编码" style={{ width: 150 }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="errorName" label="错误名称">
|
<Form.Item name="errorName" label="错误名称">
|
||||||
<Input placeholder="请输入错误名称" style={{ width: 150 }} allowClear size="small" />
|
<Input placeholder="请输入错误名称" style={{ width: 150 }} allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="errorSource" label="错误来源">
|
<Form.Item name="errorSource" label="错误来源">
|
||||||
<Select placeholder="请选择来源" style={{ width: 120 }} allowClear size="small">
|
<Select placeholder="请选择来源" style={{ width: 120 }} allowClear >
|
||||||
{errorSourceOptions.map(option => (
|
{errorSourceOptions.map(option => (
|
||||||
<Option key={option.value} value={option.value}>{option.label}</Option>
|
<Option key={option.value} value={option.value}>{option.label}</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="errorLevel" label="错误等级">
|
<Form.Item name="errorLevel" label="错误等级">
|
||||||
<Select placeholder="请选择等级" style={{ width: 120 }} allowClear size="small">
|
<Select placeholder="请选择等级" style={{ width: 120 }} allowClear >
|
||||||
{errorLevelOptions.map(option => (
|
{errorLevelOptions.map(option => (
|
||||||
<Option key={option.value} value={option.value}>{option.label}</Option>
|
<Option key={option.value} value={option.value}>{option.label}</Option>
|
||||||
))}
|
))}
|
||||||
@@ -368,9 +368,9 @@ export default function ErrorManagement() {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="primary" icon={<SearchOutlined />} onClick={handleSearch} size="small">查询</Button>
|
<Button type="primary" icon={<SearchOutlined />} onClick={handleSearch} >查询</Button>
|
||||||
<Button icon={<ReloadOutlined />} onClick={handleReset} size="small">重置</Button>
|
<Button icon={<ReloadOutlined />} onClick={handleReset} >重置</Button>
|
||||||
<Button type="primary" icon={<PlusOutlined />} onClick={() => openModal('add')} size="small">新增</Button>
|
<Button type="primary" icon={<PlusOutlined />} onClick={() => openModal('add')} >新增</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -273,14 +273,13 @@ export default function StationManage() {
|
|||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
<Button onClick={handleReset}>重置</Button>
|
<Button onClick={handleReset}>重置</Button>
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'end', marginBottom: 16 }}>
|
|
||||||
<Button type="primary" icon={<PlusOutlined />} onClick={handleAdd}>
|
<Button type="primary" icon={<PlusOutlined />} onClick={handleAdd}>
|
||||||
新增场站
|
新增场站
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Table
|
<Table
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
|
|||||||
@@ -613,13 +613,13 @@ const WorkOrderPage = () => {
|
|||||||
{/* 右侧:详情 + AI + 告警 */}
|
{/* 右侧:详情 + AI + 告警 */}
|
||||||
<Col xs={24} xl={9}>
|
<Col xs={24} xl={9}>
|
||||||
<Card bordered={false} style={cardStyle} bodyStyle={{ padding: '20px' }}>
|
<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 strong style={{ fontSize: 16, color: '#1D2129' }}>工单详情</Text>
|
||||||
<Text type="secondary" style={{ fontSize: 12 }}>工单编号: <span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
|
<Text type="secondary" style={{ fontSize: 12 }}>工单编号: <span style={{ color: '#4E5969', fontWeight: 600 }}>{currentDetail?.orderNo || '--'}</span></Text>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ marginBottom: 24 }}>
|
<div style={{ marginBottom: 8 }}>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', marginBottom: 16, flexWrap: 'wrap', gap: 12 }}>
|
<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>
|
<span level={4} style={{ margin: 0, fontSize: 18, fontWeight: 800 }}>{currentDetail?.orderTitle || '暂无标题'}</span>
|
||||||
{currentDetail?.priorityLevel && (
|
{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 }}>
|
<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>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ marginBottom: 32 }}>
|
<div style={{ marginBottom: 8 }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 10px', position: 'relative' }}>
|
<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={{ 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>
|
<div style={{ width: currentDetail?.orderStatus >= 3 ? '100%' : (currentDetail?.orderStatus === 2 ? '66%' : '33%'), height: '100%', background: '#00B42A' }}></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user