#
vincentlu
2025-04-18 a957c1c914f6890c8a6a8c477495809b065fcbcf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;