100011797 3 лет назад
Родитель
Сommit
32a34dce15
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/pages/link/Protocol/save/index.tsx

+ 4 - 0
src/pages/link/Protocol/save/index.tsx

@@ -20,6 +20,7 @@ interface Props {
 const Save = (props: Props) => {
   const [data, setData] = useState<ProtocolItem | undefined>(props.data);
   const { permission } = PermissionButton.usePermission('link/Protocol');
+  const [loading, setLoading] = useState(false);
   // const [count, setCount] = useState<number>(0);
 
   useEffect(() => {
@@ -245,9 +246,11 @@ const Save = (props: Props) => {
 
   const save = async () => {
     const value = await form.submit<ProtocolItem>();
+    setLoading(true);
     const response: any = props.data?.id
       ? await service.savePatch({ ...props.data, ...value })
       : await service.save({ ...props.data, ...value });
+    setLoading(false);
     if (response && response?.status === 200) {
       onlyMessage('操作成功');
       props.reload();
@@ -272,6 +275,7 @@ const Save = (props: Props) => {
         <Button
           type="primary"
           key={2}
+          loading={loading}
           onClick={() => {
             save();
           }}