فهرست منبع

Popconfirm 包裹button

visuddhinanda 11 ماه پیش
والد
کامیت
0db32f79df
1فایلهای تغییر یافته به همراه23 افزوده شده و 22 حذف شده
  1. 23 22
      dashboard-v4/dashboard/src/components/task/TaskStatusButton.tsx

+ 23 - 22
dashboard-v4/dashboard/src/components/task/TaskStatusButton.tsx

@@ -191,23 +191,24 @@ const TaskStatusButton = ({
     defaultMessage: "unknown",
     defaultMessage: "unknown",
   });
   });
   return type === "button" ? (
   return type === "button" ? (
-    <Popconfirm
-      title={intl.formatMessage(
-        { id: "message.task.status.change" },
-        { status: newStatus }
-      )}
-      onConfirm={confirm}
-      okText="Yes"
-      cancelText="No"
-    >
-      <Dropdown.Button
-        type={buttonType}
-        trigger={["click"]}
-        icon={<DownOutlined />}
-        menu={menuProps}
-        buttonsRender={([leftButton, rightButton]) => {
-          return [
+    <Dropdown.Button
+      type={buttonType}
+      trigger={["click"]}
+      icon={<DownOutlined />}
+      menu={menuProps}
+      buttonsRender={([leftButton, rightButton]) => {
+        return [
+          <Popconfirm
+            title={intl.formatMessage(
+              { id: "message.task.status.change" },
+              { status: newStatus }
+            )}
+            onConfirm={confirm}
+            okText="Yes"
+            cancelText="No"
+          >
             <Button
             <Button
+              type={buttonType}
               disabled={task?.type === "workflow"}
               disabled={task?.type === "workflow"}
               icon={
               icon={
                 loading ? (
                 loading ? (
@@ -220,12 +221,12 @@ const TaskStatusButton = ({
               }
               }
             >
             >
               {buttonText}
               {buttonText}
-            </Button>,
-            rightButton,
-          ];
-        }}
-      />
-    </Popconfirm>
+            </Button>
+          </Popconfirm>,
+          rightButton,
+        ];
+      }}
+    />
   ) : (
   ) : (
     <Dropdown placement="bottomLeft" menu={menuProps}>
     <Dropdown placement="bottomLeft" menu={menuProps}>
       <span>{loading ? <LoadingOutlined /> : <TaskStatus task={task} />}</span>
       <span>{loading ? <LoadingOutlined /> : <TaskStatus task={task} />}</span>