From df51bb4c4e081a00cd4876a352a7f7226fc372dc Mon Sep 17 00:00:00 2001 From: wulibaibao <13366578180@163.com> Date: Mon, 1 Apr 2024 10:58:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=A8ws=20job=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E9=A1=B9=E7=9B=AE=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dashboard/Project/components/JobTable.tsx | 241 ++++++++++-------- 1 file changed, 130 insertions(+), 111 deletions(-) diff --git a/src/pages/WorkSpace/Dashboard/Project/components/JobTable.tsx b/src/pages/WorkSpace/Dashboard/Project/components/JobTable.tsx index a1f8c999..ff4e7c18 100644 --- a/src/pages/WorkSpace/Dashboard/Project/components/JobTable.tsx +++ b/src/pages/WorkSpace/Dashboard/Project/components/JobTable.tsx @@ -1,24 +1,24 @@ -import React, { useState, useRef, useEffect } from 'react' -import { JobListStateTag } from '@/pages/WorkSpace/TestResult/Details/components/index' -import lodash from 'lodash' +import React, { useState, useRef, useEffect } from 'react'; +import { JobListStateTag } from '@/pages/WorkSpace/TestResult/Details/components/index'; +import lodash from 'lodash'; import CommonPagination from '@/components/CommonPagination'; -import { deleteJobTest } from '@/pages/WorkSpace/TestResult/services' -import { message, Space, Typography, Tooltip, Popconfirm, Row, Spin, Button } from 'antd' -import ViewReports from './ViewReports' -import { queryTestResultList } from '@/pages/WorkSpace/TestResult/services' -import styled from 'styled-components' -import { useParams, Access, useAccess, useIntl, FormattedMessage, getLocale } from 'umi' -import RerunModal from '@/pages/WorkSpace/TestResult/Details/components/ReRunModal' -import styles from './index.less' +import { deleteJobTest } from '@/pages/WorkSpace/TestResult/services'; +import { message, Space, Typography, Tooltip, Popconfirm, Row, Spin, Button } from 'antd'; +import ViewReports from './ViewReports'; +import { queryTestResultList } from '@/pages/WorkSpace/TestResult/services'; +import styled from 'styled-components'; +import { useParams, Access, useAccess, useIntl, FormattedMessage, getLocale } from 'umi'; +import RerunModal from '@/pages/WorkSpace/TestResult/Details/components/ReRunModal'; +import styles from './index.less'; import { requestCodeMessage, AccessTootip } from '@/utils/utils'; import { ResizeHooksTable } from '@/utils/table.hooks'; import { ColumnEllipsisText } from '@/components/ColumnComponents'; import ChangeJobProjectDrawer from './ChangeJobProjectDrawer'; const TableBody = styled(Row)` - width : 100%; + width: 100%; // max-height: calc( 100% - 65px - 72px ); -` +`; const ColumnCircleText = styled.span` display: inline-block; @@ -30,93 +30,90 @@ const ColumnCircleText = styled.span` text-align: center; color: #ffffff; line-height: 18px; - cursor: pointer; -` + cursor: pointer; +`; const JobTable: React.FC = () => { - const { formatMessage } = useIntl() - const enLocale = getLocale() === 'en-US' + const { formatMessage } = useIntl(); + const enLocale = getLocale() === 'en-US'; - const { ws_id, project_id }: any = useParams() - const DEFAULT_TABLE_PARAMS = { page_num: 1, page_size: 10, ws_id, project_id } + const { ws_id, project_id }: any = useParams(); + const DEFAULT_TABLE_PARAMS = { page_num: 1, page_size: 10, ws_id, project_id }; - const [pageParams, setPageParams] = useState(DEFAULT_TABLE_PARAMS) - const changeJobProjectDrawer = useRef() as any + const [pageParams, setPageParams] = useState(DEFAULT_TABLE_PARAMS); + const changeJobProjectDrawer = useRef() as any; const [jobs, setJobs] = useState({ data: [], total: 0, - }) + }); const access = useAccess(); - const [loading, setLoading] = useState(true) - const [selectedRows, setSelectedRows] = useState([]) + const [loading, setLoading] = useState(true); + const [selectedRows, setSelectedRows] = useState([]); useEffect(() => { - getProjectJobs() - }, []) + getProjectJobs(); + }, []); - const rerunModal: any = useRef() + const rerunModal: any = useRef(); const getProjectJobs = async (params: any = DEFAULT_TABLE_PARAMS) => { - setLoading(true) - const { code, msg, ...data } = await queryTestResultList(params) - if (code !== 200) return requestCodeMessage(code, msg) + setLoading(true); + const { code, msg, ...data } = await queryTestResultList(params); + if (code !== 200) return requestCodeMessage(code, msg); // console.log(data) - setJobs(data) - setPageParams(params) - setLoading(false) - } + setJobs(data); + setPageParams(params); + setLoading(false); + }; const handleDelete = async (_: any) => { - const { code, msg } = await deleteJobTest({ job_id: _.id }) + const { code, msg } = await deleteJobTest({ job_id: _.id }); if (code !== 200) { - requestCodeMessage(code, msg) - return + requestCodeMessage(code, msg); + return; } - const { page_num, page_size } = pageParams - await getProjectJobs({ ws_id, project_id, page_num, page_size }) - message.success(formatMessage({ id: 'operation.success' })) - } + const { page_num, page_size } = pageParams; + await getProjectJobs({ ws_id, project_id, page_num, page_size }); + message.success(formatMessage({ id: 'operation.success' })); + }; - const handleTestReRun = (_: any) => rerunModal.current.show(_) + const handleTestReRun = (_: any) => rerunModal.current.show(_); const columns: any = [ { title: , dataIndex: 'id', fixed: 'left', - className: "dashboard_job_list_hover_name", + className: 'dashboard_job_list_hover_name', width: 80, render: (_: any) => ( - + {_} - ) + ), }, { title: , dataIndex: 'name', width: 200, ellipsis: { - showTitle: false + showTitle: false, }, - className: "dashboard_job_list_hover_name", + className: 'dashboard_job_list_hover_name', render: (_: any, row: any) => ( - + {_} - ) + ), }, { title: , width: 120, dataIndex: 'state', - render: (_: any, row: any) => + render: (_: any, row: any) => , }, { title: , //'测试类型', @@ -128,40 +125,46 @@ const JobTable: React.FC = () => { dataIndex: 'test_result', width: 160, render: (_: any) => { - const result = JSON.parse(_) + const result = JSON.parse(_); if (lodash.isNull(result)) { return ( - - - - - - + - + - + - - ) + ); } else { return ( - {result.total} - {result.pass} - {result.fail} + + {result.total} + + + {result.pass} + + + {result.fail} + - ) + ); } - } + }, }, { title: , //'所属项目', width: 120, dataIndex: 'project_name', ellipsis: { - showTitle: false + showTitle: false, }, - render: (_: any) => _ && {_} + render: (_: any) => _ && {_}, }, { title: , //'创建人', width: 80, ellipsis: true, - dataIndex: 'creator_name' + dataIndex: 'creator_name', }, { title: , //'开始时间', @@ -173,13 +176,13 @@ const JobTable: React.FC = () => { title: , //'完成时间', width: 180, ellipsis: true, - dataIndex: 'end_time' + dataIndex: 'end_time', }, { title: , width: enLocale ? 220 : 160, fixed: 'right', - key: "operation", + key: 'operation', render: (_: any) => { return ( @@ -188,15 +191,25 @@ const JobTable: React.FC = () => { accessible={access.WsMemberOperateSelf(_.creator)} fallback={ - {_.created_from === 'offline' ? - - : + {_.created_from === 'offline' ? ( + + + + ) : ( AccessTootip()}> - + + + - } + )} AccessTootip()}> - + @@ -205,15 +218,21 @@ const JobTable: React.FC = () => { > {/** case.离线任务上传后,不能重跑。 */} - {_.created_from === 'offline' ? - - - : + {_.created_from === 'offline' ? ( + + + + ) : ( handleTestReRun(_)}> - - + + + - } + )} } onConfirm={() => handleDelete(_)} @@ -226,42 +245,42 @@ const JobTable: React.FC = () => { - - ) - } - } - ] + ); + }, + }, + ]; const handleChangeProjectOk = () => { - message.success('操作成功!') - const page_num = Math.ceil((jobs?.total - selectedRows?.length) / pageParams.page_size) || 1 - const params = { ...pageParams, page_num } + message.success('操作成功!'); + const page_num = + Math.ceil((jobs?.total - selectedRows?.length) / pageParams.page_size) || 1; + const params = { ...pageParams, page_num }; - if (page_num < pageParams.page_num) - getProjectJobs(params) - else - getProjectJobs(pageParams) - setSelectedRows([]) - } + if (page_num < pageParams.page_num) getProjectJobs(params); + else getProjectJobs(pageParams); + setSelectedRows([]); + }; return ( - + + + { rowSelection={{ selectedRowKeys: selectedRows.map((i: any) => i.id), onChange: (rowkeys: any, selectedRows: any) => { - setSelectedRows(selectedRows) - } + setSelectedRows(selectedRows); + }, }} /> getProjectJobs({ ws_id, project_id, page_num, page_size }) + onPageChange={(page_num, page_size) => + getProjectJobs({ ws_id, project_id, page_num, page_size }) } /> @@ -291,7 +310,7 @@ const JobTable: React.FC = () => { - ) -} + ); +}; -export default JobTable \ No newline at end of file +export default JobTable; -- Gitee From 02c3bd9ca18c91b2db76b3af81f78a8e64f86fe0 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Mon, 15 Apr 2024 09:47:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=90=8C=E6=AD=A5=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9F=A5=E8=AF=A2=E5=85=B6=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/RefenerceDetail/index.tsx | 23 ++++-- .../BasicTest/components/AddSuiteTest.tsx | 4 +- .../BasicTest/components/DeleteTips.tsx | 24 ++++-- .../BasicTest/components/SynchronizeModal.tsx | 73 +++++++++++++++++ .../SystemConf/TestSuite/BasicTest/index.tsx | 68 ++++++++++------ .../SystemConf/TestSuite/BasicTest/style.less | 4 +- .../components/ConfList/index.tsx | 4 +- .../components/MetricEditDrawer/index.tsx | 0 .../MetricTable/DeleteMetricPopover.less | 0 .../MetricTable/DeleteMetricPopover.tsx | 0 .../components/MetricTable/index.tsx | 0 .../components}/FuncOrPerfConfList/index.less | 0 .../components}/FuncOrPerfConfList/index.tsx | 12 ++- .../SuiteList/AddSuiteDrawer/index.tsx | 6 +- .../components/SuiteList/index.tsx | 58 ++++++++++---- src/pages/SystemConf/TestSuite/index.tsx | 80 ++++++++++--------- 16 files changed, 247 insertions(+), 109 deletions(-) create mode 100644 src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx rename src/pages/SystemConf/TestSuite/BusinessTest/{ => BusinessList/components}/FuncOrPerfConfList/components/MetricEditDrawer/index.tsx (100%) rename src/pages/SystemConf/TestSuite/BusinessTest/{ => BusinessList/components}/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.less (100%) rename src/pages/SystemConf/TestSuite/BusinessTest/{ => BusinessList/components}/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.tsx (100%) rename src/pages/SystemConf/TestSuite/BusinessTest/{ => BusinessList/components}/FuncOrPerfConfList/components/MetricTable/index.tsx (100%) rename src/pages/SystemConf/TestSuite/BusinessTest/{ => BusinessList/components}/FuncOrPerfConfList/index.less (100%) rename src/pages/SystemConf/TestSuite/BusinessTest/{ => BusinessList/components}/FuncOrPerfConfList/index.tsx (98%) diff --git a/src/pages/RefenerceDetail/index.tsx b/src/pages/RefenerceDetail/index.tsx index cfb165ab..44c24475 100644 --- a/src/pages/RefenerceDetail/index.tsx +++ b/src/pages/RefenerceDetail/index.tsx @@ -47,7 +47,7 @@ const Wapper = styled.div` const { Panel } = Collapse; const Refenerce = (props: any) => { const { type: $type } = useParams() as any - const { query: { pk } } = useLocation() as any + const { query: { pk, case_id_list, visible_range } } = useLocation() as any const [JobTotal, setJobTotal] = useState(0) const [JobData, setJobData] = useState([]) const [TempTotal, setTempTotal] = useState(0) @@ -82,24 +82,35 @@ const Refenerce = (props: any) => { return false }, [JobTotal]) - const init = async () => { + const initData = async () => { const { data } = await queryFormDate({ pk }) if (!data) return setSource(data) } - const queryListData = async () => { + const getListData = async () => { const { id } = source setLoading(true) const JobObj: any = { flag: 'job', ...params } const TempObj: any = { flag: 'template', ...tempParams } - if ($type === 'suite') { + // 同步操作参数 + if (case_id_list) { + JobObj.case_id_list = case_id_list + TempObj.case_id_list = case_id_list + } else if ($type === 'suite') { JobObj.suite_id = id TempObj.suite_id = id } else { JobObj.case_id_list = id TempObj.case_id_list = id } + + // 编辑操作传 visible_range; + // 同步、删除操作不传 visible_range; + if (visible_range) { + JobObj.visible_range = visible_range + TempObj.visible_range = visible_range + } const { total, data, code, msg } = await queryConfirm(JobObj) if (code !== 200) { requestCodeMessage(code, msg) @@ -121,12 +132,12 @@ const Refenerce = (props: any) => { React.useEffect(() => { if (!source) return - queryListData() + getListData() }, [source, params, tempParams]) useEffect(() => { if (!pk) return - init() + initData() }, [pk]) const JobColumns = [ diff --git a/src/pages/SystemConf/TestSuite/BasicTest/components/AddSuiteTest.tsx b/src/pages/SystemConf/TestSuite/BasicTest/components/AddSuiteTest.tsx index 462c9e8b..920157ed 100644 --- a/src/pages/SystemConf/TestSuite/BasicTest/components/AddSuiteTest.tsx +++ b/src/pages/SystemConf/TestSuite/BasicTest/components/AddSuiteTest.tsx @@ -14,7 +14,7 @@ import DeleteTips from './DeleteTips'; /** * @module 系统级 - * @description 新增、编辑suite级 + * @description 新增、编辑suite */ export default forwardRef( ({ onOk, wsList }: any, ref: any) => { @@ -110,7 +110,7 @@ export default forwardRef( if (s !== t) { setDisable(true) const { code } = await queryConfirm({ flag: 'pass', suite_id: dataSource.id, visible_range: s }) - if (code === 200) return delTip.current?.show({ ...dataSource, path: 'visible_range', visible_range: s }) + if (code === 200) return delTip.current?.show({ ...dataSource, path: 'visible_range', visible_range: s, optionType: 'edit' }) } } handleEditOK(val) diff --git a/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx b/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx index d5c3d4ad..08420ba9 100644 --- a/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx +++ b/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx @@ -34,11 +34,19 @@ const DeleteTip: React.ForwardRefRenderFunction = (props, ref) => const handleOpenRef = async () => { if (!setting) return - const { name, id } = setting - const pk = await saveRefenerceData({ name, id }) + const pk = await saveRefenerceData(setting) if (pk) window.open(`${basePath || "/refenerce/suite/"}?pk=${pk}`) } + const openRef = async () => { + if (!setting) return + const pk = await saveRefenerceData(setting) + // 编辑操作传 visible_range; + // 同步、删除操作不传 visible_range; + const { visible_range, optionType } = setting + if (pk) window.open(`${basePath || "/refenerce/suite/"}?pk=${pk}${optionType === 'edit'? `&visible_range=${visible_range}`: '' }`) + } + return ( = (props, ref) => open={visible} onCancel={hanldeCancel} footer={[ - , + // , @@ -69,7 +77,7 @@ const DeleteTip: React.ForwardRefRenderFunction = (props, ref) => diff --git a/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx b/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx new file mode 100644 index 00000000..d3fefdf8 --- /dev/null +++ b/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx @@ -0,0 +1,73 @@ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import React from "react" +import { Modal, Button, Typography, Space } from "antd" +import { FormattedMessage, useIntl } from "umi" +import { ExclamationCircleOutlined } from "@ant-design/icons" +import { saveRefenerceData } from "@/utils/utils" + +const SynchronizeModal = (props: any, ref: any) => { + const { formatMessage } = useIntl() + const [visible, setVisible] = React.useState(false) + const [setting, setSetting] = React.useState() + + React.useImperativeHandle(ref, () => ({ + show(_: any) { + _ && setSetting(_) + setVisible(true) + } + })) + + const handleOk = () => { + props?.onOk(setting) + setVisible(false) + setSetting(null) + } + + const handleCancel = () => { + setVisible(false) + setSetting(null) + } + + const handleOpenRef = async () => { + if (!setting) return + const { name, id, delete_temp_case_id_list } = setting + const pk = await saveRefenerceData({ name, id }) + if (pk) window.open(`${props.basePath || "/refenerce/suite/"}?pk=${pk}&case_id_list=${delete_temp_case_id_list?.join()}`) + } + + return ( + } + centered={true} + open={visible} + onCancel={handleCancel} + footer={[ + // , + + ]} + width={600} + > + + + + + {setting?.msg || formatMessage({ id: 'TestSuite.suite.delete.warning' }, { data: setting?.name })} + + + + + + + + + ) +} + +export default React.forwardRef(SynchronizeModal) \ No newline at end of file diff --git a/src/pages/SystemConf/TestSuite/BasicTest/index.tsx b/src/pages/SystemConf/TestSuite/BasicTest/index.tsx index efd4563c..775c849b 100644 --- a/src/pages/SystemConf/TestSuite/BasicTest/index.tsx +++ b/src/pages/SystemConf/TestSuite/BasicTest/index.tsx @@ -23,7 +23,7 @@ import ConfEditDrawer from './components/CaseTable/ConfEditDrawer' import lodash from 'lodash' import { queryConfirm } from '@/pages/WorkSpace/JobTypeManage/services'; import { useSuiteProvider } from '../hooks'; - +import SynchronizeModal from './components/SynchronizeModal'; import DeleteTips from "./components/DeleteTips" import DeleteDefault from "./components/DeleteDefault" import MetricBatchDelete from './components/MetricTable/MetricBatchDelete'; @@ -49,7 +49,6 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props const [pageParams, setPageParams] = useState(DEFAULT_PAGE_PARAMS) const [loading, setLoading] = useState(true) - const [sync, setSync] = useState(false) const [expandKey, setExpandKey] = useState([]) const [selectedRowKeys, setSelectedRowKeys] = useState([]) const [selectedRow, setSelectedRow] = useState([]) @@ -65,6 +64,7 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props { id: 0, name: formatMessage({ id: 'operation.no' }) }, ] + const synchronizeRef: any = useRef(null) const confDrawer: any = useRef(null) const suiteEditDrawer: any = useRef(null) const deleteTipsRef = React.useRef(null) @@ -130,8 +130,8 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props for (let i = 0; i < arr.length; i++) newArr.push(Number.parseInt(arr[i])) row.domain_list_str = newArr domainList.forEach((item: any) => { if (item.name == row.domain) row.domain = item.id }) - - suiteEditDrawer.current.show('edit', row) // 编辑Test Suite + // 编辑Test Suite + suiteEditDrawer.current.show('edit', row) } const onDesSubmit = async ({ doc, id }: any) => { @@ -151,9 +151,14 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props const deleteOuter = async (row: any) => { const { code } = await queryConfirm({ flag: 'pass', suite_id: row.id }) - if (code === 200) - return deleteTipsRef.current?.show(row) - defaultDeleteRef.current?.show(row) + // 判断是否有引用 + if (code === 200) { + // 有引用 + deleteTipsRef.current?.show(row) + } else { + // 无引用 + defaultDeleteRef.current?.show(row) + } } const remOuter = async (row: any) => { @@ -168,20 +173,39 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props getList() } - const synchro = async (row: any) => { - setSync(true) + // 同步判断弹窗: 201有引用 + const onSynchronize = async (row: any) => { + props.setSynchronizeLoading(true) const hide = message.loading({ content: formatMessage({ id: 'operation.synchronizing' }), duration: 0 }) - const { code, msg } = await syncSuite(row.id) - setSync(false) + const { code, data, msg } = await syncSuite(row.id).catch(()=> props.setSynchronizeLoading(false)) + props.setSynchronizeLoading(false) hide() - if (code !== 200) { - message.warning(`${formatMessage({ id: 'request.synchronize.failed' })},${msg}`) - return + // 判断无引用 + if (code === 200) { + message.success(formatMessage({ id: 'request.synchronize.success' })) + getList() + setAsyncTime(new Date().getTime()) + } else { + // 201 有引用 + const { id, name } = row + synchronizeRef.current?.show({ id, name, ...data }) } - message.success(formatMessage({ id: 'request.synchronize.success' })) - getList() - setAsyncTime(new Date().getTime()) } + + // const synchro = async (row: any) => { + // setSync(true) + // const hide = message.loading({ content: formatMessage({ id: 'operation.synchronizing' }), duration: 0 }) + // const { code, msg } = await syncSuite(row.id) + // setSync(false) + // hide() + // if (code !== 200) { + // message.warning(`${formatMessage({ id: 'request.synchronize.failed' })},${msg}`) + // return + // } + // message.success(formatMessage({ id: 'request.synchronize.success' })) + // getList() + // setAsyncTime(new Date().getTime()) + // } const wsMap = React.useMemo(() => { return (wsList || []).reduce((pre: any, cur: any) => { @@ -394,7 +418,7 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props fixed: 'right', render: (_, row) => ( - synchro(row)}> + onSynchronize(row)}> editOuter(row)}> @@ -533,12 +557,8 @@ const SuiteManagement: React.ForwardRefRenderFunction = (props } - {/* 同步遮罩 */} - + {/* 同步 */} + {}}/> { const type = deleteState.action - - let newData: any = [] - selectedRow.map((item: any) => newData.push(item.name)) let pk if (type == 'multiple') { + let newData: any = selectedRow.map((item: any) => item.name) pk = await saveRefenerceData({ name: newData.join(','), id: selectedRowKeys.join(',') }) // window.open(`/refenerce/conf/?name=${newData.join(',')}&id=${selectedRowKeys.join(',')}`) } else { diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricEditDrawer/index.tsx b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricEditDrawer/index.tsx similarity index 100% rename from src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricEditDrawer/index.tsx rename to src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricEditDrawer/index.tsx diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.less b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.less similarity index 100% rename from src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.less rename to src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.less diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.tsx b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.tsx similarity index 100% rename from src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.tsx rename to src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricTable/DeleteMetricPopover.tsx diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricTable/index.tsx b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricTable/index.tsx similarity index 100% rename from src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/components/MetricTable/index.tsx rename to src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/components/MetricTable/index.tsx diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/index.less b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/index.less similarity index 100% rename from src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/index.less rename to src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/index.less diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/index.tsx b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/index.tsx similarity index 98% rename from src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/index.tsx rename to src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/index.tsx index 8f584c6a..df40ff88 100644 --- a/src/pages/SystemConf/TestSuite/BusinessTest/FuncOrPerfConfList/index.tsx +++ b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/FuncOrPerfConfList/index.tsx @@ -172,11 +172,9 @@ export default forwardRef(({ id, type: test_type, domainList }: any, ref: any) = } const handleDetail = async () => { - let newData: any = [] - selectedRow.foreach((item: any) => newData.push(item.name)) - let pk if (!deleteObj.id) { + let newData: any = selectedRow.map((item: any) => item.name) pk = await saveRefenerceData({ name: newData.join(','), id: selectedRowKeys.join(',') }) } else { const { name, id } = deleteObj @@ -360,13 +358,13 @@ export default forwardRef(({ id, type: test_type, domainList }: any, ref: any) = {/** 编辑说明 */} - {/** 200表示删除有引用;*/} + {/** 200表示有引用,不能直接删除;*/} } footer={[ - , + // , diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/AddSuiteDrawer/index.tsx b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/AddSuiteDrawer/index.tsx index 1f9cd5c1..845846fb 100644 --- a/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/AddSuiteDrawer/index.tsx +++ b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/AddSuiteDrawer/index.tsx @@ -88,17 +88,17 @@ export default forwardRef((props: any, ref: any) => { setPadding(true) form.validateFields().then(async (values) => { const { business_id, id } = editData; + const domain_list_str = values.domain_list_str.join() if (id) { - const { code, msg } = await editSuite(id, { ...values, domain_list_str: values.domain_list_str.join() }) + const { code, msg } = await editSuite(id, { ...values, domain_list_str }) defaultOption(code, msg, 'edit') } else { - const { code, msg } = await addSuite2({ business_id, ...values, domain_list_str: values.domain_list_str.join() }) + const { code, msg } = await addSuite2({ business_id, ...values, domain_list_str }) defaultOption(code, msg, 'add') } setPadding(false) }).catch((err) => { setPadding(false) - // console.log(err) // 单独校验业务名称 err?.errorFields?.forEach((item: any)=> { if (item.name[0] === 'name') { diff --git a/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/index.tsx b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/index.tsx index 1064fc3b..7b87b654 100644 --- a/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/index.tsx +++ b/src/pages/SystemConf/TestSuite/BusinessTest/BusinessList/components/SuiteList/index.tsx @@ -7,8 +7,9 @@ import CommonTable from '@/components/Public/CommonTable'; import { test_type_enum, runList, saveRefenerceData } from '@/utils/utils' import ConfList from '../ConfList'; import AddSuiteDrawer from './AddSuiteDrawer'; -import FuncOrPerfConfList from '../../../FuncOrPerfConfList'; +import FuncOrPerfConfList from '../FuncOrPerfConfList'; import { querySuiteList, getDomain, syncSuite, delSuite, queryDelSuiteAll, deleteBusinessSuiteAll } from '../../../../service'; +import SynchronizeModal from '../../../../BasicTest/components/SynchronizeModal'; import { queryConfirm } from '@/pages/WorkSpace/JobTypeManage/services'; import styles from './index.less'; import { ColumnEllipsisText } from '@/components/ColumnComponents'; @@ -35,6 +36,7 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest const [deleteState, setDeleteState] = useState({ visible: false, result: '', action: '' }) // action:单个/批量删除 const [deleteRow, setDeleteRow] = useState({}) const [deleteLoading, setDeleteLoading] = useState(false) + const synchronizeRef: any = useRef(null) // 1.请求列表数据 const getTableData = async (query: any) => { @@ -90,6 +92,7 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest setLoading(false) } } + // 4.单个删除 const getDelSuite = async () => { setDeleteLoading(true) @@ -154,22 +157,42 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest if (type === 'multiple') { const pk = await saveRefenerceData({ name: newData.join(','), id: selectedRowKeys.join(',') }) - // window.open(`/refenerce/conf/?name=${newData.join(',')}&id=${selectedRowKeys.join(',')}`) window.open(`/refenerce/conf/?pk=${pk}`) } else if (type === 'single') { const { name, id } = deleteRow const pk = await saveRefenerceData({ name, id }) - // window.open(`/refenerce/suite/?name=${deleteRow.name}&id=${deleteRow.id}`) window.open(`/refenerce/suite/?pk=${pk}`) } } + // 7.同步弹窗: 201有引用 + const onSynchronize = async (row: any) => { + const hide = message.loading({ content: formatMessage({ id: 'operation.synchronizing' }), duration: 0 }) + const res = await syncSuite(row.id) || {} + hide() + // 判断 200无引用 + if (res.code === 200) { + message.success(formatMessage({ id: 'request.synchronize.success' })) + getTableData({ page_num: data.page_num, page_size: data.page_size }) + // case2.刷新已展开的conf列表 + if (expandKeys.includes(row.id)) { + caseTable.current?.refresh({ refreshId: row.id }) + } else { + const ids = expandKeys.concat([row.id]) + setExpandKeys(ids) + } + } else { + // 判断 201有引用 + const { id, name } = row + synchronizeRef.current?.show({ id, name, ...res.data }) + } + } // 打开对话框 - const onOk = (data: any, record: any, action: any) => { + const onOk = (res: any, record: any, action: any) => { // 删除查询:200表示有引用,201表示可以直接删除 - if (data.code === 200) { + if (res.code === 200) { setDeleteState({ visible: true, result: 200, action }) - } else if (data.code === 201) { + } else if (res.code === 201) { setDeleteState({ visible: true, result: 201, action }) } setDeleteRow(record) @@ -243,9 +266,9 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest // 单个删除前查询 const queryDeleteSingle = async ({ record = {} }: any) => { try { - const data = await queryConfirm({ flag: 'pass', suite_id: record.id }) || {} - if (data.code) { - onOk(data, record, 'single') + const res = await queryConfirm({ flag: 'pass', suite_id: record.id }) || {} + if (res.code) { + onOk(res, record, 'single') } } catch (e) { console.log(e) @@ -254,9 +277,9 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest // 批量删除前查询 const queryDeleteAll = async () => { try { - const data = await queryDelSuiteAll({ flag: 'pass', suite_id_list: selectedRowKeys.join() }) || {} - if (data.code) { - onOk(data, {}, 'multiple') + const res = await queryDelSuiteAll({ flag: 'pass', suite_id_list: selectedRowKeys.join() }) || {} + if (res.code) { + onOk(res, {}, 'multiple') } } catch (e) { console.log(e) @@ -356,10 +379,10 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest render: (text: any, record: any) => { return ( - {(record.test_type === 'business') ? ( + {record.test_type === 'business' ? (    ) : ( - getSyncSuite(record.id)}> + onSynchronize(record)}> )} handelAddOrEdit({ type: 'edit', record })}> queryDeleteSingle({ record })}> @@ -427,10 +450,13 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest expanded ? ( onExpand(record, e)} />) : ( onExpand(record, e)} />) }} - // scrollType={1250} scroll={{ x: 1250 }} paginationBottom={true} /> + + {/* 同步弹窗 */} + {}}/> + } centered={true} okText={} @@ -473,7 +499,7 @@ export default forwardRef(({ business_id, rowSelectionCallback = () => { }, rest )} - + ) diff --git a/src/pages/SystemConf/TestSuite/index.tsx b/src/pages/SystemConf/TestSuite/index.tsx index e275adf0..c6ce2309 100644 --- a/src/pages/SystemConf/TestSuite/index.tsx +++ b/src/pages/SystemConf/TestSuite/index.tsx @@ -1,7 +1,7 @@ -import React, { useMemo, useRef } from 'react' +import React, { useState, useMemo, useRef } from 'react' import { TabCard } from '@/components/UpgradeUI' -import { Tabs, Button } from 'antd' +import { Tabs, Button, Spin } from 'antd' import { history, useLocation, useIntl, FormattedMessage } from 'umi' import BasicTest from './BasicTest' @@ -14,9 +14,10 @@ import { runList } from '@/utils/utils'; const TestSuite: React.FC = () => { const { formatMessage } = useIntl() const { query }: any = useLocation() - + const [synchronizeLoading, setSynchronizeLoading] = useState(false) + const testType = useMemo(() => { - return !query.test_type ? 'functional' : query.test_type + return query.test_type || 'functional' }, [query]) const domainList = useDomain() @@ -47,40 +48,43 @@ const TestSuite: React.FC = () => { ] }} > - - } key="functional" /> - } key="performance" /> - {!BUILD_APP_ENV ? } key="business" /> : null} - } key="domainconf" /> - - } - extra={ - - } - > - { - (testType !== 'business' && testType !== 'domainconf') && - - } - { - testType === 'business' && - - } - { - testType === 'domainconf' && - - } - + + + } key="functional" /> + } key="performance" /> + {!BUILD_APP_ENV ? } key="business" /> : null} + } key="domainconf" /> + + } + extra={ + + } + > + { + ['functional', 'performance'].includes(testType) && + + } + { + testType === 'business' && + + } + { + testType === 'domainconf' && + + } + + ) } -- Gitee From fa0823fe6856c802e5dc00d80cd9f610c395fee9 Mon Sep 17 00:00:00 2001 From: tianweiweiliang <875658254@qq.com> Date: Thu, 18 Apr 2024 17:45:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/RefenerceDetail/index.tsx | 14 +++++++------- .../TestSuite/BasicTest/components/DeleteTips.tsx | 11 +---------- .../BasicTest/components/SynchronizeModal.tsx | 3 ++- src/pages/SystemConf/TestSuite/locales/en-US.ts | 10 +++++----- src/pages/SystemConf/TestSuite/locales/zh-CN.ts | 10 +++++----- .../WorkspaceManagement/locales/en-US.ts | 2 +- .../BaselineManage/components/IntrRow.tsx | 2 +- .../WorkSpace/BaselineManage/locales/en-US.ts | 2 +- .../WorkSpace/BaselineManage/locales/zh-CN.ts | 2 +- src/utils/utils.ts | 2 +- 10 files changed, 25 insertions(+), 33 deletions(-) diff --git a/src/pages/RefenerceDetail/index.tsx b/src/pages/RefenerceDetail/index.tsx index 44c24475..240de358 100644 --- a/src/pages/RefenerceDetail/index.tsx +++ b/src/pages/RefenerceDetail/index.tsx @@ -47,7 +47,7 @@ const Wapper = styled.div` const { Panel } = Collapse; const Refenerce = (props: any) => { const { type: $type } = useParams() as any - const { query: { pk, case_id_list, visible_range } } = useLocation() as any + const { query: { pk, case_id_list } } = useLocation() as any const [JobTotal, setJobTotal] = useState(0) const [JobData, setJobData] = useState([]) const [TempTotal, setTempTotal] = useState(0) @@ -82,14 +82,14 @@ const Refenerce = (props: any) => { return false }, [JobTotal]) - const initData = async () => { + const init = async () => { const { data } = await queryFormDate({ pk }) if (!data) return setSource(data) } - const getListData = async () => { - const { id } = source + const queryListData = async () => { + const { id, visible_range, optionType } = source setLoading(true) const JobObj: any = { flag: 'job', ...params } const TempObj: any = { flag: 'template', ...tempParams } @@ -107,7 +107,7 @@ const Refenerce = (props: any) => { // 编辑操作传 visible_range; // 同步、删除操作不传 visible_range; - if (visible_range) { + if (optionType === "edit") { JobObj.visible_range = visible_range TempObj.visible_range = visible_range } @@ -132,12 +132,12 @@ const Refenerce = (props: any) => { React.useEffect(() => { if (!source) return - getListData() + queryListData() }, [source, params, tempParams]) useEffect(() => { if (!pk) return - initData() + init() }, [pk]) const JobColumns = [ diff --git a/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx b/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx index 08420ba9..caa2f54a 100644 --- a/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx +++ b/src/pages/SystemConf/TestSuite/BasicTest/components/DeleteTips.tsx @@ -38,15 +38,6 @@ const DeleteTip: React.ForwardRefRenderFunction = (props, ref) => if (pk) window.open(`${basePath || "/refenerce/suite/"}?pk=${pk}`) } - const openRef = async () => { - if (!setting) return - const pk = await saveRefenerceData(setting) - // 编辑操作传 visible_range; - // 同步、删除操作不传 visible_range; - const { visible_range, optionType } = setting - if (pk) window.open(`${basePath || "/refenerce/suite/"}?pk=${pk}${optionType === 'edit'? `&visible_range=${visible_range}`: '' }`) - } - return ( = (props, ref) => diff --git a/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx b/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx index d3fefdf8..d0ae110d 100644 --- a/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx +++ b/src/pages/SystemConf/TestSuite/BasicTest/components/SynchronizeModal.tsx @@ -31,8 +31,9 @@ const SynchronizeModal = (props: any, ref: any) => { const handleOpenRef = async () => { if (!setting) return const { name, id, delete_temp_case_id_list } = setting + const case_id_list = delete_temp_case_id_list?.join() const pk = await saveRefenerceData({ name, id }) - if (pk) window.open(`${props.basePath || "/refenerce/suite/"}?pk=${pk}&case_id_list=${delete_temp_case_id_list?.join()}`) + if (pk) window.open(`${props.basePath || "/refenerce/suite/"}?pk=${pk}${case_id_list? `&case_id_list=${case_id_list}`: ''}`) } return ( diff --git a/src/pages/SystemConf/TestSuite/locales/en-US.ts b/src/pages/SystemConf/TestSuite/locales/en-US.ts index 220aa649..c4821455 100644 --- a/src/pages/SystemConf/TestSuite/locales/en-US.ts +++ b/src/pages/SystemConf/TestSuite/locales/en-US.ts @@ -48,8 +48,8 @@ export default { 'TestSuite.please.enter.remarks': 'Enter Remark', 'TestSuite.gmt_created': 'Creation Time', 'TestSuite.gmt_modified': 'Modified Time', - 'TestSuite.suite.delete.warning': 'This Suite({data}) has been referenced by Worksapce,Deleting this Suite will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', - 'TestSuite.have.suite.delete.warning': 'This Suite has been referenced by Worksapce,Deleting this Suite will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', + 'TestSuite.suite.delete.warning': 'This Suite({data}) has been referenced by Workspace,Deleting this Suite will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', + 'TestSuite.have.suite.delete.warning': 'This Suite has been referenced by Workspace,Deleting this Suite will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', 'TestSuite.suite.delete.range': 'Remove the Suite impact areas: running jobs, test templates, and comparison reports', 'view.reference.details': 'View Reference Details', 'TestSuite.data.format.error': 'Variable data format error', @@ -63,10 +63,10 @@ export default { 'TestSuite.is_certified.ps': 'Only certificated case is synchronized to Testfarm', 'TestSuite.please.enter.desc': 'Enter Test Suite instructions', 'TestSuite.description.details': 'Instructions Details', - 'TestSuite.conf.delete.warning': 'This conf has been referenced by Worksapce,Deleting this conf will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', + 'TestSuite.conf.delete.warning': 'This conf has been referenced by Workspace,Deleting this conf will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', 'TestSuite.conf.delete.range': 'Remove the conf impact areas: running jobs, test templates, and comparison reports', - 'TestSuite.conf.name.delete.warning': 'This conf({data}) has been referenced by Worksapce,Deleting this conf will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', - 'TestSuite.have.conf.delete.warning': 'This conf has been referenced by Worksapce,Deleting this conf will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', + 'TestSuite.conf.name.delete.warning': 'This conf({data}) has been referenced by Workspace,Deleting this conf will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', + 'TestSuite.have.conf.delete.warning': 'This conf has been referenced by Workspace,Deleting this conf will affect the Test Suite management list in theWorkspace, as well as the jobs, templates, and plans that apply this Suite,Delete with caution!!', 'TestSuite.conf.edit': 'Edit Test Conf', 'TestSuite.conf.metric': 'Metric', diff --git a/src/pages/SystemConf/TestSuite/locales/zh-CN.ts b/src/pages/SystemConf/TestSuite/locales/zh-CN.ts index fbcd1bd2..b489a6b2 100644 --- a/src/pages/SystemConf/TestSuite/locales/zh-CN.ts +++ b/src/pages/SystemConf/TestSuite/locales/zh-CN.ts @@ -48,8 +48,8 @@ export default { 'TestSuite.please.enter.remarks': '请输入备注信息', 'TestSuite.gmt_created': '创建时间', 'TestSuite.gmt_modified': '修改时间', - 'TestSuite.suite.delete.warning': '该Suite({data})已被Worksapce引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', - 'TestSuite.have.suite.delete.warning': '有Suite已被Worksapce引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', + 'TestSuite.suite.delete.warning': '该Suite({data})已被Workspace引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', + 'TestSuite.have.suite.delete.warning': '有Suite已被Workspace引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', 'TestSuite.suite.delete.range': '删除suite影响范围:运行中的job、测试模板、对比分析报告', 'view.reference.details': '查看引用详情', 'TestSuite.data.format.error': '变量数据格式错误', @@ -63,10 +63,10 @@ export default { 'TestSuite.is_certified.ps': '只有认证过得用例才能同步到Testfarm', 'TestSuite.please.enter.desc': '请输入Test Suite说明', 'TestSuite.description.details': '说明详情', - 'TestSuite.conf.delete.warning': 'conf已被Worksapce引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', + 'TestSuite.conf.delete.warning': 'conf已被Workspace引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', 'TestSuite.conf.delete.range': '删除conf影响范围:运行中的job、测试模板、对比分析报告', - 'TestSuite.conf.name.delete.warning': '该Conf({data})已被Worksapce引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', - 'TestSuite.have.conf.delete.warning': '有Conf已被Worksapce引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', + 'TestSuite.conf.name.delete.warning': '该Conf({data})已被Workspace引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', + 'TestSuite.have.conf.delete.warning': '有Conf已被Workspace引用,删除后将影响以下Workspace的Test Suite管理列表,以及应用该Suite的Job、模板、计划,请谨慎删除!!', 'TestSuite.conf.edit': '编辑Test Conf', 'TestSuite.conf.metric': '指标', diff --git a/src/pages/SystemConf/WorkspaceManagement/locales/en-US.ts b/src/pages/SystemConf/WorkspaceManagement/locales/en-US.ts index 1910625b..fa0165c3 100644 --- a/src/pages/SystemConf/WorkspaceManagement/locales/en-US.ts +++ b/src/pages/SystemConf/WorkspaceManagement/locales/en-US.ts @@ -11,7 +11,7 @@ export default { 'workspace.number': 'Number of Member', 'workspace.is_public': 'Permission', // Public 'workspace.home.recommended': 'Home Page Recommendation', - 'workspace.recommended1': 'It will be displayed on the home page in the Recommended Worksapce module if choose "Yes" ', + 'workspace.recommended1': 'It will be displayed on the home page in the Recommended Workspace module if choose "Yes" ', 'workspace.recommended2': 'Drag up and down to adjust the display order. The home page displays the table in the same order', 'workspace.configure.up.recommended': 'A max of {numb} recommended workspaces can be configured', diff --git a/src/pages/WorkSpace/BaselineManage/components/IntrRow.tsx b/src/pages/WorkSpace/BaselineManage/components/IntrRow.tsx index e5b4fd8d..1c26fee4 100644 --- a/src/pages/WorkSpace/BaselineManage/components/IntrRow.tsx +++ b/src/pages/WorkSpace/BaselineManage/components/IntrRow.tsx @@ -41,7 +41,7 @@ const IntroRow: React.FC = (props) => { { formatMessage({ - id: "pages.worksapce.baseline.metric.expand.title", + id: "pages.Workspace.baseline.metric.expand.title", defaultMessage: "环境信息" }) } diff --git a/src/pages/WorkSpace/BaselineManage/locales/en-US.ts b/src/pages/WorkSpace/BaselineManage/locales/en-US.ts index a384d105..01a2e3f8 100644 --- a/src/pages/WorkSpace/BaselineManage/locales/en-US.ts +++ b/src/pages/WorkSpace/BaselineManage/locales/en-US.ts @@ -74,5 +74,5 @@ export default { 'pages.workspace.baseline.metric.table.view': 'View Info', 'pages.workspace.baseline.metric.table.expand': 'Collapse Info', - 'pages.worksapce.baseline.metric.expand.title': "Environment Info" + 'pages.Workspace.baseline.metric.expand.title': "Environment Info" } \ No newline at end of file diff --git a/src/pages/WorkSpace/BaselineManage/locales/zh-CN.ts b/src/pages/WorkSpace/BaselineManage/locales/zh-CN.ts index f5e5f7f9..7225f10d 100644 --- a/src/pages/WorkSpace/BaselineManage/locales/zh-CN.ts +++ b/src/pages/WorkSpace/BaselineManage/locales/zh-CN.ts @@ -79,5 +79,5 @@ export default { 'pages.workspace.baseline.metric.table.view': '查看信息', 'pages.workspace.baseline.metric.table.expand': '收起信息', - 'pages.worksapce.baseline.metric.expand.title': "环境信息" + 'pages.Workspace.baseline.metric.expand.title': "环境信息" }; \ No newline at end of file diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 3b408900..f9e988d1 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -483,7 +483,7 @@ export const requestCodeMessage = (code: number, msg: string) => { // export const role_type_enum = [ - { key: 'ws_member', name: 'worksapce成员' }, + { key: 'ws_member', name: 'workspace成员' }, { key: 'ws_tester', name: '测试人员' }, { key: 'ws_test_admin', name: '测试管理员' }, { key: 'sys_admin', name: '系统管理员' }, -- Gitee