所有传orgId的地方修改
This commit is contained in:
@@ -41,7 +41,7 @@ const AlarmModelManagement: React.FC = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [editingItem, setEditingItem] = useState(null);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const { modal } = App.useApp();
|
||||
|
||||
// 批量多选
|
||||
@@ -188,7 +188,7 @@ const AlarmModelManagement: React.FC = () => {
|
||||
modelId: values.modelId,
|
||||
autoGenerateOrder: values.autoGenerateOrder ?? false,
|
||||
sourceType: values.sourceType ?? 1,
|
||||
orgId: userInfo?.orgId || '',
|
||||
orgId: currentStation?.orgId || '',
|
||||
};
|
||||
const res = await saveAlarmOrderConfigApi(submitParams);
|
||||
if (res.code === 200 && res.data === true) {
|
||||
|
||||
@@ -74,7 +74,7 @@ export default function DeviceManagementPage() {
|
||||
|
||||
// 无人机相关状态
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const [droneList, setDroneList] = useState([]);
|
||||
const [bindModalVisible, setBindModalVisible] = useState(false);
|
||||
const [bindForm] = Form.useForm();
|
||||
@@ -225,7 +225,7 @@ export default function DeviceManagementPage() {
|
||||
rightBackwardGain: Math.max(0.1, Math.min(1, values.rightBackwardGain >= 10 ? values.rightBackwardGain / 10 : values.rightBackwardGain)),
|
||||
deviceId: currentParamDevice.serialNumber,
|
||||
siteId: stationId,
|
||||
orgId: userInfo.orgId,
|
||||
orgId: currentStation?.orgId,
|
||||
runSpeed: values.runSpeed,
|
||||
id: paramData?.id,
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ const AntdCard = Card as any;
|
||||
|
||||
export default function ErrorManagement() {
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const { modal } = App.useApp();
|
||||
const [form] = Form.useForm();
|
||||
const [searchForm] = Form.useForm();
|
||||
@@ -60,7 +60,7 @@ export default function ErrorManagement() {
|
||||
errorName: '',
|
||||
errorSource: '',
|
||||
errorLevel: '',
|
||||
orgId: userInfo?.orgId || '',
|
||||
orgId: currentStation?.orgId || '',
|
||||
siteId: stationId || '',
|
||||
});
|
||||
|
||||
@@ -144,7 +144,7 @@ export default function ErrorManagement() {
|
||||
// 新增校验规则字段
|
||||
field: values.field,
|
||||
compareType: values.compareType,
|
||||
orgId: userInfo?.orgId || '',
|
||||
orgId: currentStation?.orgId || '',
|
||||
siteId: stationId || '',
|
||||
|
||||
// 区间/普通值统一拼接逗号字符串传给 compareValues
|
||||
|
||||
@@ -44,6 +44,7 @@ export default function UserRolePage() {
|
||||
const [rolesOption, setRolesOption] = useState([]);
|
||||
const [selectedUserIds, setSelectedUserIds] = useState<number[]>([]);
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { currentStation, stationId } = useSelector((state: RootState) => state.station);
|
||||
const [orgList, setOrgList] = useState([]);
|
||||
const [siteList, setSiteList] = useState([]);
|
||||
// 全局缓存:所有场站(用于表格展示)
|
||||
@@ -127,8 +128,8 @@ export default function UserRolePage() {
|
||||
const params = {
|
||||
pageNum: userPagination.pageNum,
|
||||
pageSize: userPagination.pageSize,
|
||||
orgId: userInfo?.orgId,
|
||||
siteId: userInfo?.siteId,
|
||||
orgId: currentStation?.orgId,
|
||||
siteId: stationId,
|
||||
};
|
||||
getUser(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
@@ -164,7 +165,7 @@ export default function UserRolePage() {
|
||||
useEffect(() => {
|
||||
getUserData();
|
||||
getRoleForSelect();
|
||||
}, [userPagination.pageNum, userPagination.pageSize]);
|
||||
}, [userPagination.pageNum, userPagination.pageSize, stationId]);
|
||||
|
||||
// ====================== 角色操作 ======================
|
||||
const handleAddRole = () => {
|
||||
@@ -274,8 +275,8 @@ export default function UserRolePage() {
|
||||
setSiteList([]);
|
||||
form.resetFields();
|
||||
|
||||
const defaultOrgId = userInfo?.orgId ?? '';
|
||||
const defaultSiteId = userInfo?.siteId ?? '';
|
||||
const defaultOrgId = currentStation?.orgId ?? '';
|
||||
const defaultSiteId = stationId ?? '';
|
||||
|
||||
form.setFieldsValue({
|
||||
orgId: defaultOrgId,
|
||||
|
||||
@@ -44,7 +44,7 @@ const WorkOrderModelManagement: React.FC = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [editingItem, setEditingItem] = useState<any>(null);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
|
||||
const { modal } = App.useApp();
|
||||
@@ -68,7 +68,7 @@ const WorkOrderModelManagement: React.FC = () => {
|
||||
siteId: stationId,
|
||||
pageSize: 9999,
|
||||
pageNum: 1,
|
||||
orgId: userInfo?.orgId
|
||||
orgId: currentStation?.orgId
|
||||
});
|
||||
|
||||
// 获取无人机列表
|
||||
@@ -262,7 +262,7 @@ const WorkOrderModelManagement: React.FC = () => {
|
||||
// 根据设备类型设置对应的路径字段
|
||||
routeId: selectedDeviceType === 'robot' ? values.routeId : undefined,
|
||||
waylineId: selectedDeviceType === 'uav' ? values.waylineId : undefined,
|
||||
orgId: userInfo?.orgId || '',
|
||||
orgId: currentStation?.orgId || '',
|
||||
|
||||
};
|
||||
if (editingItem) {
|
||||
|
||||
Reference in New Issue
Block a user