Просмотр исходного кода

readonly 不显示 从模版创建任务 按钮

visuddhinanda 1 год назад
Родитель
Сommit
dc3c82c9ca
1 измененных файлов с 26 добавлено и 24 удалено
  1. 26 24
      dashboard-v4/dashboard/src/components/task/TaskList.tsx

+ 26 - 24
dashboard-v4/dashboard/src/components/task/TaskList.tsx

@@ -576,31 +576,33 @@ const TaskList = ({
               actionRef.current?.reload();
             }}
           />,
-          <WorkflowModal
-            tiger={<Button type="primary">从模版创建任务</Button>}
-            studioName={studioName}
-            onData={(data) => {
-              if (!projectId) {
-                return;
-              }
-              const url = "/v2/task-group";
-              const values: ITaskGroupInsertRequest = {
-                project_id: projectId,
-                data: data,
-              };
-              console.info("api request", url, values);
-              post<ITaskGroupInsertRequest, ITaskGroupResponse>(
-                url,
-                values
-              ).then((json) => {
-                console.info("api response", json);
-                if (json.ok) {
-                  message.success("ok");
-                  actionRef.current?.reload();
+          editable && (
+            <WorkflowModal
+              tiger={<Button type="primary">从模版创建任务</Button>}
+              studioName={studioName}
+              onData={(data) => {
+                if (!projectId) {
+                  return;
                 }
-              });
-            }}
-          />,
+                const url = "/v2/task-group";
+                const values: ITaskGroupInsertRequest = {
+                  project_id: projectId,
+                  data: data,
+                };
+                console.info("api request", url, values);
+                post<ITaskGroupInsertRequest, ITaskGroupResponse>(
+                  url,
+                  values
+                ).then((json) => {
+                  console.info("api response", json);
+                  if (json.ok) {
+                    message.success("ok");
+                    actionRef.current?.reload();
+                  }
+                });
+              }}
+            />
+          ),
         ]}
       />
       <TaskEditDrawer