所有传orgId的地方修改
This commit is contained in:
@@ -41,7 +41,7 @@ const AlarmModelManagement: React.FC = () => {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [modalVisible, setModalVisible] = useState(false);
|
const [modalVisible, setModalVisible] = useState(false);
|
||||||
const [editingItem, setEditingItem] = useState(null);
|
const [editingItem, setEditingItem] = useState(null);
|
||||||
const { stationId } = useSelector((state: RootState) => state.station);
|
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||||
const { modal } = App.useApp();
|
const { modal } = App.useApp();
|
||||||
|
|
||||||
// 批量多选
|
// 批量多选
|
||||||
@@ -188,7 +188,7 @@ const AlarmModelManagement: React.FC = () => {
|
|||||||
modelId: values.modelId,
|
modelId: values.modelId,
|
||||||
autoGenerateOrder: values.autoGenerateOrder ?? false,
|
autoGenerateOrder: values.autoGenerateOrder ?? false,
|
||||||
sourceType: values.sourceType ?? 1,
|
sourceType: values.sourceType ?? 1,
|
||||||
orgId: userInfo?.orgId || '',
|
orgId: currentStation?.orgId || '',
|
||||||
};
|
};
|
||||||
const res = await saveAlarmOrderConfigApi(submitParams);
|
const res = await saveAlarmOrderConfigApi(submitParams);
|
||||||
if (res.code === 200 && res.data === true) {
|
if (res.code === 200 && res.data === true) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export default function DeviceManagementPage() {
|
|||||||
|
|
||||||
// 无人机相关状态
|
// 无人机相关状态
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
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 [droneList, setDroneList] = useState([]);
|
||||||
const [bindModalVisible, setBindModalVisible] = useState(false);
|
const [bindModalVisible, setBindModalVisible] = useState(false);
|
||||||
const [bindForm] = Form.useForm();
|
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)),
|
rightBackwardGain: Math.max(0.1, Math.min(1, values.rightBackwardGain >= 10 ? values.rightBackwardGain / 10 : values.rightBackwardGain)),
|
||||||
deviceId: currentParamDevice.serialNumber,
|
deviceId: currentParamDevice.serialNumber,
|
||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
orgId: userInfo.orgId,
|
orgId: currentStation?.orgId,
|
||||||
runSpeed: values.runSpeed,
|
runSpeed: values.runSpeed,
|
||||||
id: paramData?.id,
|
id: paramData?.id,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const AntdCard = Card as any;
|
|||||||
|
|
||||||
export default function ErrorManagement() {
|
export default function ErrorManagement() {
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
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 { modal } = App.useApp();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [searchForm] = Form.useForm();
|
const [searchForm] = Form.useForm();
|
||||||
@@ -60,7 +60,7 @@ export default function ErrorManagement() {
|
|||||||
errorName: '',
|
errorName: '',
|
||||||
errorSource: '',
|
errorSource: '',
|
||||||
errorLevel: '',
|
errorLevel: '',
|
||||||
orgId: userInfo?.orgId || '',
|
orgId: currentStation?.orgId || '',
|
||||||
siteId: stationId || '',
|
siteId: stationId || '',
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ export default function ErrorManagement() {
|
|||||||
// 新增校验规则字段
|
// 新增校验规则字段
|
||||||
field: values.field,
|
field: values.field,
|
||||||
compareType: values.compareType,
|
compareType: values.compareType,
|
||||||
orgId: userInfo?.orgId || '',
|
orgId: currentStation?.orgId || '',
|
||||||
siteId: stationId || '',
|
siteId: stationId || '',
|
||||||
|
|
||||||
// 区间/普通值统一拼接逗号字符串传给 compareValues
|
// 区间/普通值统一拼接逗号字符串传给 compareValues
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export default function UserRolePage() {
|
|||||||
const [rolesOption, setRolesOption] = useState([]);
|
const [rolesOption, setRolesOption] = useState([]);
|
||||||
const [selectedUserIds, setSelectedUserIds] = useState<number[]>([]);
|
const [selectedUserIds, setSelectedUserIds] = useState<number[]>([]);
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
const { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
|
const { currentStation, stationId } = useSelector((state: RootState) => state.station);
|
||||||
const [orgList, setOrgList] = useState([]);
|
const [orgList, setOrgList] = useState([]);
|
||||||
const [siteList, setSiteList] = useState([]);
|
const [siteList, setSiteList] = useState([]);
|
||||||
// 全局缓存:所有场站(用于表格展示)
|
// 全局缓存:所有场站(用于表格展示)
|
||||||
@@ -127,8 +128,8 @@ export default function UserRolePage() {
|
|||||||
const params = {
|
const params = {
|
||||||
pageNum: userPagination.pageNum,
|
pageNum: userPagination.pageNum,
|
||||||
pageSize: userPagination.pageSize,
|
pageSize: userPagination.pageSize,
|
||||||
orgId: userInfo?.orgId,
|
orgId: currentStation?.orgId,
|
||||||
siteId: userInfo?.siteId,
|
siteId: stationId,
|
||||||
};
|
};
|
||||||
getUser(params).then(res => {
|
getUser(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -164,7 +165,7 @@ export default function UserRolePage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getUserData();
|
getUserData();
|
||||||
getRoleForSelect();
|
getRoleForSelect();
|
||||||
}, [userPagination.pageNum, userPagination.pageSize]);
|
}, [userPagination.pageNum, userPagination.pageSize, stationId]);
|
||||||
|
|
||||||
// ====================== 角色操作 ======================
|
// ====================== 角色操作 ======================
|
||||||
const handleAddRole = () => {
|
const handleAddRole = () => {
|
||||||
@@ -274,8 +275,8 @@ export default function UserRolePage() {
|
|||||||
setSiteList([]);
|
setSiteList([]);
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
|
|
||||||
const defaultOrgId = userInfo?.orgId ?? '';
|
const defaultOrgId = currentStation?.orgId ?? '';
|
||||||
const defaultSiteId = userInfo?.siteId ?? '';
|
const defaultSiteId = stationId ?? '';
|
||||||
|
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
orgId: defaultOrgId,
|
orgId: defaultOrgId,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const WorkOrderModelManagement: React.FC = () => {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [modalVisible, setModalVisible] = useState(false);
|
const [modalVisible, setModalVisible] = useState(false);
|
||||||
const [editingItem, setEditingItem] = useState<any>(null);
|
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 { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
|
|
||||||
const { modal } = App.useApp();
|
const { modal } = App.useApp();
|
||||||
@@ -68,7 +68,7 @@ const WorkOrderModelManagement: React.FC = () => {
|
|||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
pageSize: 9999,
|
pageSize: 9999,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
orgId: userInfo?.orgId
|
orgId: currentStation?.orgId
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取无人机列表
|
// 获取无人机列表
|
||||||
@@ -262,7 +262,7 @@ const WorkOrderModelManagement: React.FC = () => {
|
|||||||
// 根据设备类型设置对应的路径字段
|
// 根据设备类型设置对应的路径字段
|
||||||
routeId: selectedDeviceType === 'robot' ? values.routeId : undefined,
|
routeId: selectedDeviceType === 'robot' ? values.routeId : undefined,
|
||||||
waylineId: selectedDeviceType === 'uav' ? values.waylineId : undefined,
|
waylineId: selectedDeviceType === 'uav' ? values.waylineId : undefined,
|
||||||
orgId: userInfo?.orgId || '',
|
orgId: currentStation?.orgId || '',
|
||||||
|
|
||||||
};
|
};
|
||||||
if (editingItem) {
|
if (editingItem) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export default function AlarmCenterPage() {
|
|||||||
const [messageApi, contextHolder] = message.useMessage();
|
const [messageApi, contextHolder] = message.useMessage();
|
||||||
const [todayData, setTodayData] = useState({});
|
const [todayData, setTodayData] = useState({});
|
||||||
const [yesterdayData, setYesterdayData] = 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 { userInfo } = useSelector((state: RootState) => state.user);
|
||||||
|
|
||||||
const [editModalVisible, setEditModalVisible] = useState(false);
|
const [editModalVisible, setEditModalVisible] = useState(false);
|
||||||
@@ -478,7 +478,7 @@ export default function AlarmCenterPage() {
|
|||||||
deviceName: currentAlarm.deviceName || '',
|
deviceName: currentAlarm.deviceName || '',
|
||||||
deviceType: currentAlarm.deviceType,
|
deviceType: currentAlarm.deviceType,
|
||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
orgId: userInfo?.orgId || '',
|
orgId: currentStation?.orgId || '',
|
||||||
assigneeId: '',
|
assigneeId: '',
|
||||||
assigneeName: '',
|
assigneeName: '',
|
||||||
collaboratorIds: '',
|
collaboratorIds: '',
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const logs = [
|
|||||||
|
|
||||||
export default function DeviceOverviewPage() {
|
export default function DeviceOverviewPage() {
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
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 [zoomedVideo, setZoomedVideo] = useState(null);
|
||||||
const [mowerView, setMowerView] = useState('front');
|
const [mowerView, setMowerView] = useState('front');
|
||||||
@@ -79,6 +79,7 @@ export default function DeviceOverviewPage() {
|
|||||||
const [editAliasInput, setEditAliasInput] = useState('');
|
const [editAliasInput, setEditAliasInput] = useState('');
|
||||||
const [editLoading, setEditLoading] = useState(false);
|
const [editLoading, setEditLoading] = useState(false);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
console.log('stationId', stationId, currentStation);
|
||||||
|
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
@@ -88,7 +89,7 @@ export default function DeviceOverviewPage() {
|
|||||||
try {
|
try {
|
||||||
// 1. 同时发请求
|
// 1. 同时发请求
|
||||||
const [deviceRes, planeRes] = await Promise.all([
|
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),
|
getSiteUAVList(stationId),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ const { Text } = Typography;
|
|||||||
|
|
||||||
export default function DeviceStatusPage() {
|
export default function DeviceStatusPage() {
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
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 [persistentDroneData, setPersistentDroneData] = useState(null); // 持久化无人机数据
|
||||||
const [persistentHostData, setPersistentHostData] = useState(null); // 持久化机场数据
|
const [persistentHostData, setPersistentHostData] = useState(null); // 持久化机场数据
|
||||||
const [devices, setDevices] = useState([]);
|
const [devices, setDevices] = useState([]);
|
||||||
@@ -134,7 +134,7 @@ export default function DeviceStatusPage() {
|
|||||||
try {
|
try {
|
||||||
// 1. 同时发请求
|
// 1. 同时发请求
|
||||||
const [deviceRes, planeRes] = await Promise.all([
|
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),
|
getSiteUAVList(stationId),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const { RangePicker } = DatePicker;
|
|||||||
|
|
||||||
export default function RobotTaskPage() {
|
export default function RobotTaskPage() {
|
||||||
const { userInfo } = useSelector((state: RootState) => state.user);
|
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 [excuteStatus, setExcuteStatus] = useState("stop"); //"stop" "running" "pause"
|
||||||
// 机器人实时位置
|
// 机器人实时位置
|
||||||
const [robotRealtimePosition, setRobotRealtimePosition] = useState(null);
|
const [robotRealtimePosition, setRobotRealtimePosition] = useState(null);
|
||||||
@@ -334,7 +334,7 @@ export default function RobotTaskPage() {
|
|||||||
if (!stationId) return;
|
if (!stationId) return;
|
||||||
|
|
||||||
try {
|
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 || []) : [];
|
const devData = deviceRes?.code === 200 ? (deviceRes.rows || []) : [];
|
||||||
setDevices(devData);
|
setDevices(devData);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -551,7 +551,7 @@ export default function RobotTaskPage() {
|
|||||||
deviceId: selectedRobotForExecute.serialNumber,
|
deviceId: selectedRobotForExecute.serialNumber,
|
||||||
routeId: selectedRouteForExecute.id,
|
routeId: selectedRouteForExecute.id,
|
||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
...(userInfo?.orgId ? { orgId: userInfo.orgId } : {}),
|
...(currentStation?.orgId ? { orgId: currentStation.orgId } : {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await excuetRoute(params);
|
const res = await excuetRoute(params);
|
||||||
@@ -591,7 +591,7 @@ export default function RobotTaskPage() {
|
|||||||
const params = {
|
const params = {
|
||||||
userId: userInfo?.userId,
|
userId: userInfo?.userId,
|
||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
orgId: userInfo?.orgId,
|
orgId: currentStation?.orgId,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 99999999
|
pageSize: 99999999
|
||||||
};
|
};
|
||||||
@@ -626,7 +626,7 @@ export default function RobotTaskPage() {
|
|||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
orgId: userInfo?.orgId,
|
orgId: currentStation?.orgId,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 99999999
|
pageSize: 99999999
|
||||||
};
|
};
|
||||||
@@ -1802,6 +1802,8 @@ const NewTaskModal = ({ isOpen, onClose, robots, selectedPathWork, handlGetTaskL
|
|||||||
excuteDayStartTime: '',
|
excuteDayStartTime: '',
|
||||||
excuteDayEndTime: '',
|
excuteDayEndTime: '',
|
||||||
});
|
});
|
||||||
|
const { currentStation } = useSelector((state: RootState) => state.station);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedPathWork) {
|
if (selectedPathWork) {
|
||||||
@@ -1875,7 +1877,7 @@ const NewTaskModal = ({ isOpen, onClose, robots, selectedPathWork, handlGetTaskL
|
|||||||
const finishTime = formData.excuteDayEndTime;
|
const finishTime = formData.excuteDayEndTime;
|
||||||
const finalData = {
|
const finalData = {
|
||||||
deviceId: formData.device.serialNumber,
|
deviceId: formData.device.serialNumber,
|
||||||
orgId: userInfo.orgId,
|
orgId: currentStation?.orgId,
|
||||||
planName: formData.planName,
|
planName: formData.planName,
|
||||||
routeId: formData.path.id,
|
routeId: formData.path.id,
|
||||||
siteId: stationId,
|
siteId: stationId,
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export default function StationDashboard() {
|
|||||||
deviceType: 1, // 设备类型:电站
|
deviceType: 1, // 设备类型:电站
|
||||||
siteId: currentStation.id || '',
|
siteId: currentStation.id || '',
|
||||||
siteName: currentStation.siteName || '',
|
siteName: currentStation.siteName || '',
|
||||||
orgId: userInfo?.orgId || '',
|
orgId: currentStation?.orgId || '',
|
||||||
assigneeId: '',
|
assigneeId: '',
|
||||||
assigneeName: '',
|
assigneeName: '',
|
||||||
collaboratorIds: '',
|
collaboratorIds: '',
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const WorkOrderPage = () => {
|
|||||||
console.log(userInfo, 434234);
|
console.log(userInfo, 434234);
|
||||||
|
|
||||||
const isShowDispatch = userInfo?.roleId !== 26; //普通用户
|
const isShowDispatch = userInfo?.roleId !== 26; //普通用户
|
||||||
const { stationId } = useSelector((state: RootState) => state.station);
|
const { stationId, currentStation } = useSelector((state: RootState) => state.station);
|
||||||
const [deviceAll, setDevicesAll] = useState([]);
|
const [deviceAll, setDevicesAll] = useState([]);
|
||||||
|
|
||||||
// 查询表单状态
|
// 查询表单状态
|
||||||
@@ -208,8 +208,8 @@ const WorkOrderPage = () => {
|
|||||||
const params = {
|
const params = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 99999,
|
pageSize: 99999,
|
||||||
orgId: userInfo?.orgId,
|
orgId: currentStation?.orgId,
|
||||||
siteId: userInfo?.siteId,
|
siteId: stationId,
|
||||||
};
|
};
|
||||||
getUser(params).then(res => {
|
getUser(params).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
@@ -379,7 +379,7 @@ const WorkOrderPage = () => {
|
|||||||
try {
|
try {
|
||||||
// 1. 同时发请求
|
// 1. 同时发请求
|
||||||
const [deviceRes, planeRes] = await Promise.all([
|
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),
|
getSiteUAVList(stationId),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user