-
-
-
-
- {currnetModule ? `${currnetModule.name}` : `所有用例`}
-
- ({currnetModule ? currnetModule.count : cases.length})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- setInp(target.value)}
- onSearch={() => handleOkFilter({key: inp})}
- />
- setFilter(!filter)}>
+
+ const currnetModule = React.useMemo(() => {
+ if (mod_id) {
+ const idx = modules.findIndex((i: any) => i.id === +mod_id)
+ return modules[idx]
+ }
+ return null
+ }, [mod_id, modules])
+
+ return (
+
+
+
+
+
+ {currnetModule ? `${currnetModule.name}` : `所有用例`}
+
+ ({currnetModule ? currnetModule.count : cases.length})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setInp(target.value)}
+ onSearch={() => handleOkFilter({ key: inp })}
+ />
+ setFilter(!filter)}>
筛选
- {
- filter ?
- :
-
- }
+ {
+ filter ?
+ :
+
+ }
-
-
-
- {
- filter &&
-
- }
-
-
-
- {
- cases.length === 0 ?
- :
-
-
- getModalCase(defaultParams)}
- />
-
- }
-
-
- {
- loading &&
-
-
+
+
+
+ {
+ filter &&
+
+ }
+
+
+
+ {
+ cases.length === 0 ?
+
:
+
+
+ getModalCase(defaultParams)}
+ />
+
+ }
+
+
+ {
+ loading &&
+
+
+
+ }
+
+
+
+
+
+
- }
-
-
-
-
-
-
-
- )
+ )
}
export default RightContent
diff --git a/src/pages/Suite/index.tsx b/src/pages/Suite/index.tsx
index 8befece7c63e9d4c30283d66b296b7732c639391..b1da65b87d8fcc63db0186b2722a4431ea89d015 100644
--- a/src/pages/Suite/index.tsx
+++ b/src/pages/Suite/index.tsx
@@ -4,7 +4,7 @@ import LeftList from "./components/LeftList"
import RightContent from "./components/RightContent"
import { Provider as CaseProvider } from "./provider"
-import { queryModuleCase } from "@/pages/Suite/services"
+import { queryModules } from "@/pages/Suite/services"
type IProps = {
[k: string]: any;
@@ -21,7 +21,7 @@ const TableList: React.FC
= (props) => {
}, initialState)
const refreshModules = async () => {
- const { data, code, count } = await queryModuleCase(0)
+ const { data, code, count } = await queryModules(0)
if (code !== 200) return dispath({ type: "update", payload: { modules: [], caseCount: 0 } })
dispath({ type: "update", payload: { modules: data, caseCount: count } })
}
diff --git a/src/pages/Suite/services.ts b/src/pages/Suite/services.ts
index c8f6066bb0d8aa04acb38b61c1aafa95be209b7c..5311ca5e6427d37ceeaf1505a3f689c887f6480e 100644
--- a/src/pages/Suite/services.ts
+++ b/src/pages/Suite/services.ts
@@ -57,7 +57,7 @@ export const createModule = async (data: IModule) => {
}
//获得某一模块写的所有子模块
-export const queryModuleCase = async (node_id: any) => {
+export const queryModules = async (node_id: any) => {
return request(`/api/case/module/${node_id}`)
}
diff --git a/src/pages/Task/components/AddTaskModal.tsx b/src/pages/Task/components/AddTaskModal.tsx
index 073b0063f7c6d6e71d0cccd2d4790277c0454f8b..ea8040c21241ebf374dfb47ca034f1a4ca2ea1f5 100644
--- a/src/pages/Task/components/AddTaskModal.tsx
+++ b/src/pages/Task/components/AddTaskModal.tsx
@@ -5,12 +5,8 @@ import { request } from "umi";
import { runMethodOptions } from "@/pages/Suite/utils"
import styled from "styled-components"
import { createTask } from "../services";
+import { CustomForm } from "@/components/CustomStyled";
-const CustomForm = styled(Form)`
- .ant-form-item {
- margin-bottom: 12px;
- }
-`
type IProps = {
onOk: () => void;
onCancel?: () => void;