This commit is contained in:
2026-01-18 16:03:27 +03:30
parent 4fe6e70525
commit ca22cced44
321 changed files with 10738 additions and 17770 deletions

View File

@@ -37,7 +37,6 @@ import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline";
import ResponsiveTable from "../../../../components/responsive-table/ResponsiveTable";
import { provinceCarsDashboardService } from "../../services/province-cars-dashboard";
import { checkPathStartsWith } from "../../../../utils/checkPathStartsWith";
export const ProvinceManageCars = () => {
const dispatch = useDispatch();
@@ -46,32 +45,18 @@ export const ProvinceManageCars = () => {
const { provinceCars } = useSelector((state) => state.provinceSlice);
// const userInfo = useSelector((state) => state.userSlice);
const userKey = useSelector((state) => state.userSlice.userProfile.key);
const selectedSubUser = useSelector(
(state) => state.userSlice.selectedSubUser
);
useEffect(() => {
dispatch(
provinceGetCars({
role_key: checkPathStartsWith("province")
? selectedSubUser?.key || ""
: "",
})
);
}, [selectedSubUser?.key]);
dispatch(provinceGetCars());
}, []);
const [dashboardData, setDashboardData] = useState([]);
useEffect(() => {
dispatch(
provinceCarsDashboardService({
role_key: checkPathStartsWith("province")
? selectedSubUser?.key || ""
: "",
})
).then((r) => {
dispatch(provinceCarsDashboardService()).then((r) => {
setDashboardData(r.payload.data);
});
}, [dispatch, provinceCars, selectedSubUser?.key]);
}, [dispatch, provinceCars]);
useEffect(() => {
const d = provinceCars?.map((item, i) => {
@@ -162,11 +147,7 @@ export const ProvinceManageCars = () => {
<a
href={`${
axios.defaults.baseURL
}car_province_excel/?key=${userKey}&role=${getRoleFromUrl()}${
checkPathStartsWith("province")
? `&role_key=${selectedSubUser?.key}`
: ""
}`}
}car_province_excel/?key=${userKey}&role=${getRoleFromUrl()}`}
rel="noreferrer"
>
<Button color="success">
@@ -175,7 +156,7 @@ export const ProvinceManageCars = () => {
</a>
</Tooltip>
<Card sx={{ width: "100%" }}>
<Grid container mt={2} mb={4} isDashboard xs={12}>
<Grid container mt={2} mb={4} isDashboard>
<ResponsiveTable
noPagination
isDashboard