权限基本完善
This commit is contained in:
@@ -50,7 +50,6 @@ export default function StationManage() {
|
||||
|
||||
// ====================== 获取组织列表(根据 userId 过滤) ======================
|
||||
const getOrgData = () => {
|
||||
console.log(userInfo, "userInfo")
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
@@ -65,13 +64,11 @@ export default function StationManage() {
|
||||
|
||||
// ====================== 获取场站列表(分页) ======================
|
||||
const getStationData = () => {
|
||||
|
||||
const params = {
|
||||
pageNum: pagination.pageNum,
|
||||
pageSize: pagination.pageSize,
|
||||
orgId: userInfo?.orgId, // 根据用户所属组织过滤场站
|
||||
orgId: userInfo?.orgId,
|
||||
};
|
||||
|
||||
getStationList(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
setStationList(res.rows || []);
|
||||
@@ -95,7 +92,7 @@ export default function StationManage() {
|
||||
// 初始化加载
|
||||
useEffect(() => {
|
||||
getStationData();
|
||||
getOrgData(); // 进入页面就加载组织
|
||||
getOrgData();
|
||||
}, [pagination.pageNum, pagination.pageSize]);
|
||||
|
||||
// ====================== 新增 / 编辑 场站 ======================
|
||||
@@ -234,10 +231,8 @@ export default function StationManage() {
|
||||
<div style={{ padding: '20px' }}>
|
||||
{contextHolder}
|
||||
|
||||
{/* 统一卡片样式 */}
|
||||
<Card title="场站管理" style={{ borderRadius: 8 }}>
|
||||
<div style={{ marginBottom: 16, display: 'flex', justifyContent: 'space-between' }}>
|
||||
<div></div>
|
||||
<Button type="primary" icon={<PlusOutlined />} onClick={handleAdd}>
|
||||
新增场站
|
||||
</Button>
|
||||
@@ -286,9 +281,10 @@ export default function StationManage() {
|
||||
<Form.Item name="orgId" label="所属组织" rules={[{ required: true }]}>
|
||||
<Select placeholder="请选择所属组织" allowClear>
|
||||
{orgList.map(item => (
|
||||
<Select.Option key={item.id} value={item.orgId}>
|
||||
// ✅ 这里修复了!原来是 item.orgId,现在是 item.id
|
||||
<Option key={item.id} value={item.id}>
|
||||
{item.orgName}
|
||||
</Select.Option>
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user