所有传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) {
|
||||
|
||||
@@ -102,7 +102,7 @@ export default function AlarmCenterPage() {
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
const [todayData, setTodayData] = useState({});
|
||||
const [yesterdayData, setYesterdayData] = useState({});
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
|
||||
const [editModalVisible, setEditModalVisible] = useState(false);
|
||||
@@ -478,7 +478,7 @@ export default function AlarmCenterPage() {
|
||||
deviceName: currentAlarm.deviceName || '',
|
||||
deviceType: currentAlarm.deviceType,
|
||||
siteId: stationId,
|
||||
orgId: userInfo?.orgId || '',
|
||||
orgId: currentStation?.orgId || '',
|
||||
assigneeId: '',
|
||||
assigneeName: '',
|
||||
collaboratorIds: '',
|
||||
|
||||
@@ -58,7 +58,7 @@ const logs = [
|
||||
|
||||
export default function DeviceOverviewPage() {
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
|
||||
const [zoomedVideo, setZoomedVideo] = useState(null);
|
||||
const [mowerView, setMowerView] = useState('front');
|
||||
@@ -79,6 +79,7 @@ export default function DeviceOverviewPage() {
|
||||
const [editAliasInput, setEditAliasInput] = useState('');
|
||||
const [editLoading, setEditLoading] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
console.log('stationId', stationId, currentStation);
|
||||
|
||||
|
||||
// 获取数据
|
||||
@@ -88,7 +89,7 @@ export default function DeviceOverviewPage() {
|
||||
try {
|
||||
// 1. 同时发请求
|
||||
const [deviceRes, planeRes] = await Promise.all([
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId }),
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId }),
|
||||
getSiteUAVList(stationId),
|
||||
]);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ const { Text } = Typography;
|
||||
|
||||
export default function DeviceStatusPage() {
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const [persistentDroneData, setPersistentDroneData] = useState(null); // 持久化无人机数据
|
||||
const [persistentHostData, setPersistentHostData] = useState(null); // 持久化机场数据
|
||||
const [devices, setDevices] = useState([]);
|
||||
@@ -134,7 +134,7 @@ export default function DeviceStatusPage() {
|
||||
try {
|
||||
// 1. 同时发请求
|
||||
const [deviceRes, planeRes] = await Promise.all([
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId }),
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId }),
|
||||
getSiteUAVList(stationId),
|
||||
]);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ const { RangePicker } = DatePicker;
|
||||
|
||||
export default function RobotTaskPage() {
|
||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const [excuteStatus, setExcuteStatus] = useState("stop"); //"stop" "running" "pause"
|
||||
// 机器人实时位置
|
||||
const [robotRealtimePosition, setRobotRealtimePosition] = useState(null);
|
||||
@@ -334,7 +334,7 @@ export default function RobotTaskPage() {
|
||||
if (!stationId) return;
|
||||
|
||||
try {
|
||||
const deviceRes = await getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId });
|
||||
const deviceRes = await getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId });
|
||||
const devData = deviceRes?.code === 200 ? (deviceRes.rows || []) : [];
|
||||
setDevices(devData);
|
||||
} catch (err) {
|
||||
@@ -551,7 +551,7 @@ export default function RobotTaskPage() {
|
||||
deviceId: selectedRobotForExecute.serialNumber,
|
||||
routeId: selectedRouteForExecute.id,
|
||||
siteId: stationId,
|
||||
...(userInfo?.orgId ? { orgId: userInfo.orgId } : {}),
|
||||
...(currentStation?.orgId ? { orgId: currentStation.orgId } : {}),
|
||||
};
|
||||
|
||||
const res = await excuetRoute(params);
|
||||
@@ -591,7 +591,7 @@ export default function RobotTaskPage() {
|
||||
const params = {
|
||||
userId: userInfo?.userId,
|
||||
siteId: stationId,
|
||||
orgId: userInfo?.orgId,
|
||||
orgId: currentStation?.orgId,
|
||||
pageNum: 1,
|
||||
pageSize: 99999999
|
||||
};
|
||||
@@ -626,7 +626,7 @@ export default function RobotTaskPage() {
|
||||
try {
|
||||
const params = {
|
||||
siteId: stationId,
|
||||
orgId: userInfo?.orgId,
|
||||
orgId: currentStation?.orgId,
|
||||
pageNum: 1,
|
||||
pageSize: 99999999
|
||||
};
|
||||
@@ -1802,6 +1802,8 @@ const NewTaskModal = ({ isOpen, onClose, robots, selectedPathWork, handlGetTaskL
|
||||
excuteDayStartTime: '',
|
||||
excuteDayEndTime: '',
|
||||
});
|
||||
const { currentStation } = useSelector((state: RootState) => state.station);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedPathWork) {
|
||||
@@ -1875,7 +1877,7 @@ const NewTaskModal = ({ isOpen, onClose, robots, selectedPathWork, handlGetTaskL
|
||||
const finishTime = formData.excuteDayEndTime;
|
||||
const finalData = {
|
||||
deviceId: formData.device.serialNumber,
|
||||
orgId: userInfo.orgId,
|
||||
orgId: currentStation?.orgId,
|
||||
planName: formData.planName,
|
||||
routeId: formData.path.id,
|
||||
siteId: stationId,
|
||||
|
||||
@@ -174,7 +174,7 @@ export default function StationDashboard() {
|
||||
deviceType: 1, // 设备类型:电站
|
||||
siteId: currentStation.id || '',
|
||||
siteName: currentStation.siteName || '',
|
||||
orgId: userInfo?.orgId || '',
|
||||
orgId: currentStation?.orgId || '',
|
||||
assigneeId: '',
|
||||
assigneeName: '',
|
||||
collaboratorIds: '',
|
||||
|
||||
@@ -100,7 +100,7 @@ const WorkOrderPage = () => {
|
||||
console.log(userInfo, 434234);
|
||||
|
||||
const isShowDispatch = userInfo?.roleId !== 26; //普通用户
|
||||
const { stationId } = useSelector((state: RootState) => state.station);
|
||||
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||
const [deviceAll, setDevicesAll] = useState([]);
|
||||
|
||||
// 查询表单状态
|
||||
@@ -208,8 +208,8 @@ const WorkOrderPage = () => {
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 99999,
|
||||
orgId: userInfo?.orgId,
|
||||
siteId: userInfo?.siteId,
|
||||
orgId: currentStation?.orgId,
|
||||
siteId: stationId,
|
||||
};
|
||||
getUser(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
@@ -379,7 +379,7 @@ const WorkOrderPage = () => {
|
||||
try {
|
||||
// 1. 同时发请求
|
||||
const [deviceRes, planeRes] = await Promise.all([
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: userInfo.orgId }),
|
||||
getSiteDevice({ siteId: stationId, pageSize: 9999, pageNum: 1, orgId: currentStation?.orgId }),
|
||||
getSiteUAVList(stationId),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user