فهرست منبع

workflow仅仅disable 左侧按钮

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

+ 21 - 11
dashboard-v4/dashboard/src/components/task/TaskStatusButton.tsx

@@ -1,5 +1,6 @@
 import { DropdownButtonType } from "antd/lib/dropdown/dropdown-button";
 import {
+  Button,
   Dropdown,
   MenuProps,
   message,
@@ -200,21 +201,30 @@ const TaskStatusButton = ({
       cancelText="No"
     >
       <Dropdown.Button
-        disabled={task?.type === "workflow"}
         type={buttonType}
         trigger={["click"]}
         icon={<DownOutlined />}
         menu={menuProps}
-      >
-        {loading ? (
-          <LoadingOutlined />
-        ) : newStatus === "done" ? (
-          <CheckOutlined />
-        ) : (
-          <></>
-        )}
-        {buttonText}
-      </Dropdown.Button>
+        buttonsRender={([leftButton, rightButton]) => {
+          return [
+            <Button
+              disabled={task?.type === "workflow"}
+              icon={
+                loading ? (
+                  <LoadingOutlined />
+                ) : newStatus === "done" ? (
+                  <CheckOutlined />
+                ) : (
+                  <></>
+                )
+              }
+            >
+              {buttonText}
+            </Button>,
+            rightButton,
+          ];
+        }}
+      />
     </Popconfirm>
   ) : (
     <Dropdown placement="bottomLeft" menu={menuProps}>