import React, { useState, useRef, useEffect, useMemo } from "react";
|
import { useTranslate } from "react-admin";
|
import {
|
Button,
|
} from '@mui/material';
|
import { handleRePositionAll } from "../http";
|
|
const RePositionBtn = ({ onClick }) => {
|
|
const handleToggle = () => {
|
let pass = true;
|
const pwd = prompt("please enter password:");
|
if (pwd === 'xltys1995') {
|
pass = true;
|
} else {
|
pass = false;
|
if (pwd) {
|
alert('Incorrect password');
|
}
|
}
|
if (pass) {
|
handleRePositionAll(null, (res) => {
|
console.log(res);
|
});
|
}
|
}
|
|
return (
|
<Button
|
variant="contained"
|
color="primary"
|
onClick={handleToggle}
|
sx={{ mr: 2 }}
|
>
|
重新定位
|
</Button>
|
);
|
}
|
|
export default RePositionBtn;
|