From 6315fc2b23c045ee22073b909c1e38e14e4d37d6 Mon Sep 17 00:00:00 2001 From: wulibaibao <13366578180@163.com> Date: Wed, 20 Apr 2022 10:58:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E7=BC=96=E8=BE=91=E9=80=89=E6=8B=A9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E5=88=A0=E9=99=A4=E6=A1=86=E6=9E=B6title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/oneapi.json | 2 +- config/proxy.ts | 2 +- src/components/index.md | 33 +-------------- src/e2e/baseLayout.e2e.js | 2 +- src/manifest.json | 4 +- src/pages/Plan/CreatePage.tsx | 1 - .../components/ContentTable/Suite.table.tsx | 1 + .../components/ContentTable/Task.table.tsx | 1 + .../components/SelectModal/Task.select.tsx | 40 +++++++++++++------ src/pages/Task/components/AddTaskModal.tsx | 8 +--- src/pages/document.ejs | 18 ++------- 11 files changed, 43 insertions(+), 69 deletions(-) diff --git a/config/oneapi.json b/config/oneapi.json index c77d988..21829e0 100644 --- a/config/oneapi.json +++ b/config/oneapi.json @@ -1,7 +1,7 @@ { "openapi": "3.0.1", "info": { - "title": "Ant Design Pro", + "title": "TestLib", "version": "1.0.0" }, "servers": [ diff --git a/config/proxy.ts b/config/proxy.ts index 85e3c92..746110c 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -7,7 +7,7 @@ * https://pro.ant.design/docs/deploy */ -const ip = `30.225.24.43` +const ip = `30.225.24.82` const port = `8005` const devTargetUri = `http://${ip}:${port}`; diff --git a/src/components/index.md b/src/components/index.md index 408da93..17d97d1 100644 --- a/src/components/index.md +++ b/src/components/index.md @@ -69,21 +69,7 @@ export default () => { { console.log('input', value); }} @@ -117,22 +103,7 @@ import React from 'react'; import NoticeIcon from '@/components/NoticeIcon/NoticeIcon'; export default () => { - const list = [ - { - id: '000000001', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '你收到了 14 份新周报', - datetime: '2017-08-09', - type: 'notification', - }, - { - id: '000000002', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', - title: '你推荐的 曲妮妮 已通过第三轮面试', - datetime: '2017-08-08', - type: 'notification', - }, - ]; + const list = []; return ( { }); }); -describe('Ant Design Pro E2E test', () => { +describe('TestLib E2E test', () => { const testPage = (path) => async () => { await page.goto(`${BASE_URL}${path}`); await page.waitForSelector('footer', { diff --git a/src/manifest.json b/src/manifest.json index 839bc5b..6805366 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { - "name": "Ant Design Pro", - "short_name": "Ant Design Pro", + "name": "TestLib", + "short_name": "TestLib", "display": "standalone", "start_url": "./?utm_source=homescreen", "theme_color": "#002140", diff --git a/src/pages/Plan/CreatePage.tsx b/src/pages/Plan/CreatePage.tsx index 747431a..602fb86 100644 --- a/src/pages/Plan/CreatePage.tsx +++ b/src/pages/Plan/CreatePage.tsx @@ -24,7 +24,6 @@ const TestPlan: React.FC = (props) => { const { plan_id } = useParams() as any const { source, onOk } = props const [form] = Form.useForm() - console.log(props, plan_id) React.useEffect(() => { if (source && JSON.stringify(source) !== "{}") { diff --git a/src/pages/Plan/components/ContentTable/Suite.table.tsx b/src/pages/Plan/components/ContentTable/Suite.table.tsx index 87535e1..9a88e41 100644 --- a/src/pages/Plan/components/ContentTable/Suite.table.tsx +++ b/src/pages/Plan/components/ContentTable/Suite.table.tsx @@ -95,6 +95,7 @@ const TableList: React.FC = (props) => { columns={columns} dataSource={source || []} size="small" + rowKey={"id"} pagination={false} /> { diff --git a/src/pages/Plan/components/ContentTable/Task.table.tsx b/src/pages/Plan/components/ContentTable/Task.table.tsx index 3a74727..114f859 100644 --- a/src/pages/Plan/components/ContentTable/Task.table.tsx +++ b/src/pages/Plan/components/ContentTable/Task.table.tsx @@ -82,6 +82,7 @@ const TableList: React.FC = (props) => { diff --git a/src/pages/Plan/components/SelectModal/Task.select.tsx b/src/pages/Plan/components/SelectModal/Task.select.tsx index e4237b9..dfd35f1 100644 --- a/src/pages/Plan/components/SelectModal/Task.select.tsx +++ b/src/pages/Plan/components/SelectModal/Task.select.tsx @@ -1,7 +1,9 @@ import React from "react" -import { Modal, Form, Input, Space, Button, Checkbox, Spin } from "antd" +import { Modal, Space, Button, Checkbox, Spin, Typography, Divider } from "antd" import { useRequest } from "umi"; import { queryTaskList } from "@/pages/Task/services"; +import { PlusOutlined } from "@ant-design/icons" +import AddTaskModal from '@/pages/Task/components/AddTaskModal' type IProps = { onOk: (conf: any) => void; @@ -19,7 +21,9 @@ const ReactComponent: React.ForwardRefRenderFunction = (props, re const [loading, setLoading] = React.useState(false) const [selectedKeys, setSelectedKeys] = React.useState([]) - const { data: taskList, loading: taskLoading } = useRequest(queryTaskList, { initialData: [] }) + const addTaskModalRef = React.useRef<{ show: () => void }>(null) + + const { data: taskList, loading: taskLoading, refresh } = useRequest(queryTaskList, { initialData: [] }) React.useImperativeHandle(ref, () => ({ show(_: any) { @@ -44,7 +48,7 @@ const ReactComponent: React.ForwardRefRenderFunction = (props, re return ( @@ -55,16 +59,28 @@ const ReactComponent: React.ForwardRefRenderFunction = (props, re onCancel={handleCancel} > - - - { - taskList.map((i: any) => ( - {i.name} - )) - } - - + + + + { + taskList.map((i: any) => ( + {i.name} + )) + } + + + + + addTaskModalRef.current?.show()}> + + + 新建任务 + + + + + ) } diff --git a/src/pages/Task/components/AddTaskModal.tsx b/src/pages/Task/components/AddTaskModal.tsx index cd57753..e846fd2 100644 --- a/src/pages/Task/components/AddTaskModal.tsx +++ b/src/pages/Task/components/AddTaskModal.tsx @@ -2,12 +2,11 @@ import React from "react" import { Modal, Form, Input, Space, Button, Select, Radio, message } from "antd" import { useRequest, request } from "umi"; import { runMethodOptions } from "@/pages/Suite/utils" -import styled from "styled-components" import { createTask } from "../services"; import { CustomForm } from "@/components/CustomStyled"; type IProps = { - onOk: () => void; + onOk: (val?: any) => void; onCancel?: () => void; } @@ -38,14 +37,11 @@ const ReactComponent: React.ForwardRefRenderFunction = (props, re return [] }, [cases]) - console.log(plansOptions) - React.useImperativeHandle(ref, () => ({ show(_: any) { - console.log(_) - setSource(_) setVisible(true) if (_ && JSON.stringify(_) !== "{}") { + setSource(_) const { cases: caseIds } = _ form.setFieldsValue({ ..._, cases: caseIds.split(",").map((i: any) => +i) }) } diff --git a/src/pages/document.ejs b/src/pages/document.ejs index bfc9630..89cecec 100644 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -5,12 +5,11 @@ - Ant Design Pro + TestLib @@ -33,7 +32,7 @@ enable Javascript - in your browser to use Ant Design, Out-of-the-box mid-stage front/design solution! + in your browser to use TestLib, Out-of-the-box mid-stage front/design solution!
@@ -212,7 +211,6 @@ min-height: 420px; " > - logo
-
- - Ant Design -
-- Gitee From 7c868b02ebb572d838602adb754e3390b138b55c Mon Sep 17 00:00:00 2001 From: wulibaibao <13366578180@163.com> Date: Wed, 20 Apr 2022 11:04:20 +0800 Subject: [PATCH 2/3] feat: table ellipsis set --- src/pages/Plan/components/ContentTable/Suite.table.tsx | 1 + src/pages/Plan/components/ContentTable/Task.table.tsx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/pages/Plan/components/ContentTable/Suite.table.tsx b/src/pages/Plan/components/ContentTable/Suite.table.tsx index 9a88e41..fdf8187 100644 --- a/src/pages/Plan/components/ContentTable/Suite.table.tsx +++ b/src/pages/Plan/components/ContentTable/Suite.table.tsx @@ -38,6 +38,7 @@ const TableList: React.FC = (props) => { const columns: TableColumnType[] = [ { title: "用例名称", + ellipsis: true, dataIndex: "name", }, { diff --git a/src/pages/Plan/components/ContentTable/Task.table.tsx b/src/pages/Plan/components/ContentTable/Task.table.tsx index 114f859..ad40832 100644 --- a/src/pages/Plan/components/ContentTable/Task.table.tsx +++ b/src/pages/Plan/components/ContentTable/Task.table.tsx @@ -38,6 +38,7 @@ const TableList: React.FC = (props) => { const columns: TableColumnType[] = [ { title: "任务名称", + ellipsis: true, dataIndex: "name", }, { @@ -54,6 +55,10 @@ const TableList: React.FC = (props) => { { title: "备注", dataIndex: "desc", + ellipsis: true, + render(val: any) { + return val ?? "-" + } }, canSelect && { -- Gitee From bd4442478637ced7308b37817a038ed72af211c1 Mon Sep 17 00:00:00 2001 From: wulibaibao <13366578180@163.com> Date: Wed, 20 Apr 2022 11:26:30 +0800 Subject: [PATCH 3/3] feat: proxy ip change --- config/proxy.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/proxy.ts b/config/proxy.ts index 746110c..20fb82b 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -7,15 +7,12 @@ * https://pro.ant.design/docs/deploy */ -const ip = `30.225.24.82` -const port = `8005` -const devTargetUri = `http://${ip}:${port}`; export default { dev: { '/api/': { - target: devTargetUri, + target: "http://test_lib_dev_port.com:8005/", changeOrigin: true, pathRewrite: { '^': '' }, }, -- Gitee