diff --git a/config/oneapi.json b/config/oneapi.json index c77d988b333c2e7d10fe72249da431129d163360..21829e062bf65b5bbbb68742b514976b69e441c5 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 85e3c92d5e0d923e2b0a0b0d82f752edae340112..20fb82b94eace1b8f43fcf280d82165ad2899c0c 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -7,15 +7,12 @@ * https://pro.ant.design/docs/deploy */ -const ip = `30.225.24.43` -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: { '^': '' }, }, diff --git a/src/components/index.md b/src/components/index.md index 408da93ada107ccf602c171dd369d73d3974ca64..17d97d183172db1a233afdcbf3a2a70653334802 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 839bc5b5e4a561676fca44a61674d3990b5acd48..68053660a8b773a36214bc70470eea1fd3275fe9 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 747431a643916d100f2c3306eeefd9ed27e5ef97..602fb869ba86d5a092cb90db3442fb80817fc64b 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 87535e1b3a66723605aac7c1f5d06b4f70a50aaf..fdf8187c04836e7e3dcfc6e3f7ac2b754a64e17e 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", }, { @@ -95,6 +96,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 3a747273b4324bf69ca1d88468541c169b47ae91..ad4083206782e2fee2b8554831cef1cc05709660 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 && { @@ -82,6 +87,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 e4237b9e259c0aaea5a21fb753568adeccab2c34..dfd35f1e9f8ebe2031be1efe278cd253c94720fe 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 cd57753257e000cacd466bd25668e07dda591a83..e846fd2e1863f882b434c5c0a7ded5b6c16ded34 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 bfc96300b768f1c2aab9541e806c807c87a8d5ae..89cecec8e7564e174de4dfc7c5d3cae6bc47fc45 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 -