diff --git a/config/config.ts b/config/config.ts index 9ee861b2021ee4a717f3f62f897070a15415cdb4..7cb80d44a14cbf43cffeeed5d5b544fc81592407 100644 --- a/config/config.ts +++ b/config/config.ts @@ -3,8 +3,7 @@ import { defineConfig } from 'umi'; import { join } from 'path'; import defaultSettings from './defaultSettings'; import proxy from './proxy'; -import routes from './routes' - +import routes from './routes'; const { REACT_APP_ENV, UMI_ENV } = process.env; const isDev = UMI_ENV === 'dev'; diff --git a/src/components/RightContent/index.tsx b/src/components/RightContent/index.tsx index 2f8ce2137d2a237594264087cd2ca9184a497f71..96032632096a969a2098b76a9ec7f156201c3ed4 100644 --- a/src/components/RightContent/index.tsx +++ b/src/components/RightContent/index.tsx @@ -44,7 +44,7 @@ const GlobalHeaderRight: React.FC = () => { {/* */} - + {/* */} ); }; diff --git a/src/pages/Plan/CreatePage.tsx b/src/pages/Plan/CreatePage.tsx index 0de599e4783019c66137440ba885c189c0ce6fa4..e7906d22462020cce07ed353a18535b019a2082a 100644 --- a/src/pages/Plan/CreatePage.tsx +++ b/src/pages/Plan/CreatePage.tsx @@ -68,7 +68,7 @@ const TestPlan: React.FC = (props) => { } return ( -
+
新建方案 diff --git a/src/pages/Plan/components/LeftList/index.tsx b/src/pages/Plan/components/LeftList/index.tsx index 70cf3028a80869c0cd1f71ffe82bc723b851897f..d0c78911a3f0ab8fc428c89001a3e6c6ea0a3421 100644 --- a/src/pages/Plan/components/LeftList/index.tsx +++ b/src/pages/Plan/components/LeftList/index.tsx @@ -41,7 +41,7 @@ const PlanLeftContent: React.FC = () => { } return ( -
+
= () => { - { - planList.length === 0 ? - : - - { - planList.map((plan: any) => ( - - history.push(`/plan/${plan.id}`)} - is_active={plan.id === +plan_id ? 1 : 0} +
+ { + planList.length === 0 ? + : + + { + planList.map((plan: any) => ( + -
- - - {plan.title} - - -
- - - -
- )) - } -
- } + history.push(`/plan/${plan.id}`)} + is_active={plan.id === +plan_id ? 1 : 0} + > +
+ + + {plan.title} + + +
+ +
+ + + )) + } + + } +
+
) } diff --git a/src/pages/Plan/components/RightContent/index.tsx b/src/pages/Plan/components/RightContent/index.tsx index 52256dac94779eb745e7818ca4077f6abd83178c..015af6b52c11ef2296ae4e65a0bb92c6f72922d5 100644 --- a/src/pages/Plan/components/RightContent/index.tsx +++ b/src/pages/Plan/components/RightContent/index.tsx @@ -101,7 +101,7 @@ const PlanRightContent: React.FC = () => {
) return ( - + diff --git a/src/pages/Plan/index.tsx b/src/pages/Plan/index.tsx index 02eb93971b3aecd3b84d00766fd7f655854b6416..4702e804d390fced26a1a778ae1013618ee829d1 100644 --- a/src/pages/Plan/index.tsx +++ b/src/pages/Plan/index.tsx @@ -45,12 +45,11 @@ const TestPlan: React.FC = (props) => { return ( - -
+ +
-
-
+
}> { route.name === "create" ? diff --git a/src/pages/Suite/components/Case/index.tsx b/src/pages/Suite/components/Case/index.tsx index 394957ed5388c85ea4667b0cae29b5beb65658e6..97758f72e29e837e94007c1c28c73c4d030acc7b 100644 --- a/src/pages/Suite/components/Case/index.tsx +++ b/src/pages/Suite/components/Case/index.tsx @@ -34,7 +34,7 @@ const priorityText = new Map([ const Case: React.FC = (props) => { const access = useAccess() - const { currentCase, refresh } = props + const { currentCase, refresh, height } = props const [editing, setEditing] = React.useState(false) const [rname, setRname] = React.useState(false) @@ -108,7 +108,7 @@ const Case: React.FC = (props) => { //width: 513, borderLeft: "1px solid rgba(0, 0, 0, 0.06)" return ( -
+
{currentCase?.gmt_created} diff --git a/src/pages/Suite/components/FilterForm/CaseFilter.tsx b/src/pages/Suite/components/FilterForm/CaseFilter.tsx index 9ed79e741e01f1bd7f9e9d273967eb6a43cf4d97..20b43cb9f57a20cc8559dd44c3d407491cb6208d 100644 --- a/src/pages/Suite/components/FilterForm/CaseFilter.tsx +++ b/src/pages/Suite/components/FilterForm/CaseFilter.tsx @@ -4,6 +4,7 @@ import { Input, Select, DatePicker } from "antd" import FilterForm from "." import { useCaseProvider } from "../../provider"; import styled from "styled-components" +import { useSize } from "ahooks"; const dateFormat = 'YYYY-MM-DD'; @@ -17,6 +18,7 @@ const FilterFormWrapper = styled.div` ` const CaseFilter: React.FC<{ [k: string]: any }> = (props) => { + const { onSizeChange } = props const { suites, labels } = useCaseProvider() const columns: any = [ @@ -61,14 +63,14 @@ const CaseFilter: React.FC<{ [k: string]: any }> = (props) => { { label: "设备类型", name: "device_type", - list: serviceTypeOptions, + list: serviceTypeOptions, mode: "multiple", }, { label: "设备架构", name: "device_arch", mode: "multiple", - list: deviceArchOptions, + list: deviceArchOptions, }, { label: "用例名称", @@ -94,8 +96,15 @@ const CaseFilter: React.FC<{ [k: string]: any }> = (props) => { { name: "labels", value: undefined }, ] + const filterRef = React.useRef(null) as any + const filterSize = useSize(filterRef) + + React.useEffect(() => { + onSizeChange && onSizeChange(filterSize) + }, [filterSize]) + return ( - + = (props) => { const deleteModalRef = React.useRef(null) as any + const ref = React.useRef(null) as any + const mTreeSize = useSize(ref) + React.useEffect(() => { return () => { handleRestInput() @@ -405,17 +409,17 @@ const LeftList: React.FC = (props) => { } -
+
handleActiveModule(undefined)} > 所有用例 -
+
= (props) => { return ( ` background-color: #ffffff; - height: calc(100% - 48px - 48px); + height: ${({ height }) => height}; .SplitPane { position: unset!important;} @@ -103,12 +103,14 @@ const RightContent: React.FC = (props) => { const [filter, setFilter] = React.useState(false) const [inp, setInp] = React.useState("") + const [filterSize, setFilterSize] = React.useState(null) const batchMoveRef = React.useRef(null) as any const batchDeleteRef = React.useRef(null) as any const createCaseRef = React.useRef(null) as any const exportCaseRef = React.useRef(null) as any const batchEditRef = React.useRef(null) as any + const wrapperRef = React.useRef(null) as any const [pageParams, setPageParams] = React.useState(defaultParams) @@ -200,140 +202,146 @@ const RightContent: React.FC = (props) => { getModalCase({ mod_id, ...params }, false) } - return ( -
-
- - - { - currentPath.length > 0 ? - currentPath.map((i: string, idx: any) => ( - - - {i} - - { - currentPath.length - 1 > idx && - - } - - )) : - 所有用例 - } - - ({cases.length}) - - - { - access.canTester() && - - - - - - } - + const wrapperSzie = useSize(wrapperRef) - + const filterHeight = filter && filterSize?.height ? filterSize.height : 0 + const wrapperHeight = wrapperSzie?.height ? wrapperSzie.height : 0 + const caseContentHeight = wrapperHeight - 48 * 2 - filterHeight - + const caseDomHeight = wrapperHeight - filterHeight - - { - access.canTester() && - <> - - - - - } - - - - setInp(target.value)} - onSearch={() => handleOkFilter({ key: inp })} - // onKeyUp={handleKeyup} - /> - setFilter(!filter)}> - - - 筛选 + return ( +
+ + + { + currentPath.length > 0 ? + currentPath.map((i: string, idx: any) => ( + + + {i} + { - filter ? - : - + currentPath.length - 1 > idx && + } - - - - - - + + )) : + 所有用例 + } + + ({cases.length}) + + { - filter && - <> - - - - // + access.canTester() && + + + + + } + - + - { - cases.length === 0 ? - : - - + + + { + access.canTester() && + <> +
+ 批量移动 + + + + + } +
+ + + setInp(target.value)} + onSearch={() => handleOkFilter({ key: inp })} + // onKeyUp={handleKeyup} + /> + setFilter(!filter)}> + + + 筛选 + { + filter ? + : + + } + + + + +
+ { + filter && + <> + + + + } + + { + cases.length === 0 ? + : + + + + + { + getModalCase(defaultParams) + }} + /> + + + } { loading && diff --git a/src/pages/Suite/index.tsx b/src/pages/Suite/index.tsx index cbd14bd676198b184d516df1e26b588e9f0e234d..aabd4678f78be42657ab10e5c6f5640f4730b8a8 100644 --- a/src/pages/Suite/index.tsx +++ b/src/pages/Suite/index.tsx @@ -46,11 +46,11 @@ const TableList: React.FC = (props) => { return ( -
-
+
+
-
+