From fdabab90524347c37602452ca46a53ee0d8be74e Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Tue, 12 Mar 2024 20:07:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D=E5=92=8C=E8=B0=83=E6=95=B4=E4=BA=A4?= =?UTF-8?q?=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/api-test/report.ts | 5 + .../project-management/envManagement.ts | 4 + frontend/src/api/requrls/api-test/report.ts | 3 + .../project-management/envManagement.ts | 2 + .../business/ms-assertion/index.vue | 1 - .../components/business/ms-select/index.tsx | 3 +- .../extensions/mention/MentionList.vue | 2 +- .../components/pure/ms-tags-input/index.vue | 2 +- .../api-test/components/batchAddKeyVal.vue | 3 +- .../api-test/components/condition/content.vue | 2 +- .../views/api-test/components/paramTable.vue | 77 ++++--- .../report/component/reportDetailDrawer.vue | 205 ++++++++++++++++++ .../api-test/report/component/reportList.vue | 26 +++ .../report/component/stepProgress.vue | 116 ++++++++++ .../src/views/api-test/report/locale/en-US.ts | 5 + .../src/views/api-test/report/locale/zh-CN.ts | 5 + .../environmental/components/EnvGroupBox.vue | 6 +- .../environmental/components/EnvParamBox.vue | 4 + .../components/allParams/index.vue | 16 +- .../components/common/TabSettingDrawer.vue | 18 +- .../components/envParams/HttpTab.vue | 28 ++- .../envParams/popUp/AddHttpDrawer.vue | 2 +- .../components/envParams/popUp/domain.vue | 173 +++++++++++++++ .../components/requestHeader/index.vue | 3 +- .../environmental/locale/en-US.ts | 7 +- .../environmental/locale/zh-CN.ts | 9 +- 26 files changed, 668 insertions(+), 59 deletions(-) create mode 100644 frontend/src/views/api-test/report/component/reportDetailDrawer.vue create mode 100644 frontend/src/views/api-test/report/component/stepProgress.vue create mode 100644 frontend/src/views/project-management/environmental/components/envParams/popUp/domain.vue diff --git a/frontend/src/api/modules/api-test/report.ts b/frontend/src/api/modules/api-test/report.ts index f84f090cf5..fcd12341af 100644 --- a/frontend/src/api/modules/api-test/report.ts +++ b/frontend/src/api/modules/api-test/report.ts @@ -36,4 +36,9 @@ export function reportBathDelete(moduleType: string, data: TableQueryParams) { return MSR.post({ url: reportUrl.ApiBatchDeleteUrl, data }); } +// 报告详情 +export function reportDetail(reportId: string) { + return MSR.get>({ url: `${reportUrl.ScenarioReportDetailUrl}/${reportId}` }); +} + export default {}; diff --git a/frontend/src/api/modules/project-management/envManagement.ts b/frontend/src/api/modules/project-management/envManagement.ts index 80b527736e..304f8d7d5b 100644 --- a/frontend/src/api/modules/project-management/envManagement.ts +++ b/frontend/src/api/modules/project-management/envManagement.ts @@ -88,6 +88,10 @@ export function groupDeleteEnv(data: EnvListItem) { export function groupProjectEnv(organizationId: string) { return MSR.get({ url: envURL.groupProjectEnvUrl + organizationId }); } +// 获取项目组的项目 +export function groupCategoryEnvList(projectId: string) { + return MSR.get({ url: `${envURL.getProjectEnvCategoryUrl}/${projectId}` }); +} /** 项目管理-环境-全局参数-更新or新增 */ export function updateOrAddGlobalParam(data: GlobalParams) { diff --git a/frontend/src/api/requrls/api-test/report.ts b/frontend/src/api/requrls/api-test/report.ts index 9252b051c1..7797fd0112 100644 --- a/frontend/src/api/requrls/api-test/report.ts +++ b/frontend/src/api/requrls/api-test/report.ts @@ -15,3 +15,6 @@ export const ApiReportRenameUrl = '/api/report/case/rename'; export const ApiDeleteUrl = '/api/report/case/delete'; // 批量删除接口用例报告 export const ApiBatchDeleteUrl = '/api/report/case/batch/delete'; + +// 场景报告拔高详情获取 +export const ScenarioReportDetailUrl = '/api/report/scenario/get'; diff --git a/frontend/src/api/requrls/project-management/envManagement.ts b/frontend/src/api/requrls/project-management/envManagement.ts index 10d12c6119..0515c7199d 100644 --- a/frontend/src/api/requrls/project-management/envManagement.ts +++ b/frontend/src/api/requrls/project-management/envManagement.ts @@ -24,3 +24,5 @@ export const addGlobalParamUrl = '/project/global/params/add'; export const importGlobalParamUrl = '/project/global/params/import'; export const detailGlobalParamUrl = '/project/global/params/get/'; export const exportGlobalParamUrl = '/project/global/params/export/'; +// 获取环境目录列表 +export const getProjectEnvCategoryUrl = '/project/environment/get-options'; diff --git a/frontend/src/components/business/ms-assertion/index.vue b/frontend/src/components/business/ms-assertion/index.vue index 222398e785..c5b06c7b9e 100644 --- a/frontend/src/components/business/ms-assertion/index.vue +++ b/frontend/src/components/business/ms-assertion/index.vue @@ -386,7 +386,6 @@ getCurrentItemState.value = assertions.value.find((item: any) => item.id === activeKey.value) || assertions.value[0] || {}; activeKey.value = getCurrentItemState.value.id; - console.log(getCurrentItemState.value, 'getCurrentItemState.value'); }); diff --git a/frontend/src/components/business/ms-select/index.tsx b/frontend/src/components/business/ms-select/index.tsx index 37d9d74dfc..1288ced735 100644 --- a/frontend/src/components/business/ms-select/index.tsx +++ b/frontend/src/components/business/ms-select/index.tsx @@ -372,9 +372,10 @@ export default defineComponent( } emit('update:modelValue', value); emit('change', value); + emit( 'changeObject', - remoteOriginOptions.value.filter((e) => value === e[props.valueKey || 'value']) + remoteOriginOptions.value.find((e) => value === e[props.valueKey || 'value']) ); } diff --git a/frontend/src/components/pure/ms-rich-text/extensions/mention/MentionList.vue b/frontend/src/components/pure/ms-rich-text/extensions/mention/MentionList.vue index a0e686124a..97212ce790 100644 --- a/frontend/src/components/pure/ms-rich-text/extensions/mention/MentionList.vue +++ b/frontend/src/components/pure/ms-rich-text/extensions/mention/MentionList.vue @@ -73,7 +73,7 @@ function selectItem(index: any) { const item = props.items[index]; if (item) { - props.command({ id: item.id, label: `${item.name}` } as any); + props.command({ id: item.id, label: `${item.name}`, style: 'color:blur' } as any); } } diff --git a/frontend/src/components/pure/ms-tags-input/index.vue b/frontend/src/components/pure/ms-tags-input/index.vue index 3883cae887..b0776154d4 100644 --- a/frontend/src/components/pure/ms-tags-input/index.vue +++ b/frontend/src/components/pure/ms-tags-input/index.vue @@ -77,7 +77,7 @@ const isError = computed( () => innerInputValue.value.length > props.maxLength || - innerModelValue.value.some((item) => item.toString().length > props.maxLength) + (innerModelValue.value || []).some((item) => item.toString().length > props.maxLength) ); watch( () => props.modelValue, diff --git a/frontend/src/views/api-test/components/batchAddKeyVal.vue b/frontend/src/views/api-test/components/batchAddKeyVal.vue index 76e095dc46..99a62593e9 100644 --- a/frontend/src/views/api-test/components/batchAddKeyVal.vue +++ b/frontend/src/views/api-test/components/batchAddKeyVal.vue @@ -18,7 +18,7 @@ size="16" /> @@ -53,6 +53,7 @@ params: Record[]; defaultParamItem?: Record; // 默认参数项 noParamType?: boolean; // 是否有参数类型 + addTypeText?: string; // 添加类型文案 }>(), { noParamType: false, diff --git a/frontend/src/views/api-test/components/condition/content.vue b/frontend/src/views/api-test/components/condition/content.vue index d4d6fbb530..8a740dd7db 100644 --- a/frontend/src/views/api-test/components/condition/content.vue +++ b/frontend/src/views/api-test/components/condition/content.vue @@ -138,7 +138,7 @@ {{ t('common.clear') }} + + diff --git a/frontend/src/views/api-test/report/component/reportList.vue b/frontend/src/views/api-test/report/component/reportList.vue index 52bd1a8dcd..c4c0fec4e5 100644 --- a/frontend/src/views/api-test/report/component/reportList.vue +++ b/frontend/src/views/api-test/report/component/reportList.vue @@ -24,6 +24,11 @@ v-on="propsEvent" @batch-action="handleTableBatch" > + + @@ -114,6 +127,7 @@ import type { BatchActionParams, BatchActionQueryParams, MsTableColumn } from '@/components/pure/ms-table/type'; import useTable from '@/components/pure/ms-table/useTable'; import MsTag from '@/components/pure/ms-tag/ms-tag.vue'; + import ReportDetailDrawer from './reportDetailDrawer.vue'; import ExecutionStatus from '@/views/api-test/report/component/reportStatus.vue'; import { reportBathDelete, reportDelete, reportList, reportRename } from '@/api/modules/api-test/report'; @@ -361,6 +375,18 @@ initData(); } + /** + * 报告详情 showReportDetail + */ + const activeDetailId = ref(''); + const activeReportIndex = ref(0); + const showDetailDrawer = ref(false); + function showReportDetail(id: string, rowIndex: number) { + showDetailDrawer.value = true; + activeDetailId.value = id; + activeReportIndex.value = rowIndex; + } + watch( () => props.moduleType, (val) => { diff --git a/frontend/src/views/api-test/report/component/stepProgress.vue b/frontend/src/views/api-test/report/component/stepProgress.vue new file mode 100644 index 0000000000..34a2326663 --- /dev/null +++ b/frontend/src/views/api-test/report/component/stepProgress.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/frontend/src/views/api-test/report/locale/en-US.ts b/frontend/src/views/api-test/report/locale/en-US.ts index 9404af6f14..7fd4d7a7f9 100644 --- a/frontend/src/views/api-test/report/locale/en-US.ts +++ b/frontend/src/views/api-test/report/locale/en-US.ts @@ -23,4 +23,9 @@ export default { 'report.trigger.interface': 'API', 'report.trigger.batch.execution': 'Batch', 'report.delete.tip': 'Are you sure you want to delete {count} selected reports?', + 'report.detail.successCount': 'pass', + 'report.detail.errorCount': 'Failure', + 'report.detail.fakeErrorCount': 'False alarm', + 'report.detail.pendingCount': 'Not executed', + 'report.detail.stepTotal': 'total', }; diff --git a/frontend/src/views/api-test/report/locale/zh-CN.ts b/frontend/src/views/api-test/report/locale/zh-CN.ts index a400ccce7d..830df55be2 100644 --- a/frontend/src/views/api-test/report/locale/zh-CN.ts +++ b/frontend/src/views/api-test/report/locale/zh-CN.ts @@ -23,4 +23,9 @@ export default { 'report.trigger.interface': 'API 执行', 'report.trigger.batch.execution': '批量执行', 'report.delete.tip': '确认删除已选中的 {count} 个报告吗?', + 'report.detail.successCount': '通过', + 'report.detail.errorCount': '失败', + 'report.detail.fakeErrorCount': '误报', + 'report.detail.pendingCount': '未执行', + 'report.detail.stepTotal': '总数', }; diff --git a/frontend/src/views/project-management/environmental/components/EnvGroupBox.vue b/frontend/src/views/project-management/environmental/components/EnvGroupBox.vue index 88533890b3..2c73da57a6 100644 --- a/frontend/src/views/project-management/environmental/components/EnvGroupBox.vue +++ b/frontend/src/views/project-management/environmental/components/EnvGroupBox.vue @@ -91,13 +91,15 @@ title: 'project.environmental.env', dataIndex: 'environmentId', slotName: 'environment', - width: 200, + width: 300, }, { title: 'project.environmental.host', dataIndex: 'host', slotName: 'host', - width: 200, + showTooltip: true, + isTag: true, + width: 456, }, { title: 'project.environmental.desc', diff --git a/frontend/src/views/project-management/environmental/components/EnvParamBox.vue b/frontend/src/views/project-management/environmental/components/EnvParamBox.vue index 21b46b353c..cca5e76ebb 100644 --- a/frontend/src/views/project-management/environmental/components/EnvParamBox.vue +++ b/frontend/src/views/project-management/environmental/components/EnvParamBox.vue @@ -94,11 +94,14 @@ import { getEnvPlugin, updateOrAddEnv } from '@/api/modules/project-management/envManagement'; import { useI18n } from '@/hooks/useI18n'; + import useLeaveUnSaveTip from '@/hooks/useLeaveUnSaveTip'; import { useAppStore } from '@/store'; import useProjectEnvStore from '@/store/modules/setting/useProjectEnvStore'; import { ContentTabItem, EnvPluginListItem } from '@/models/projectManagement/environmental'; + const { setState } = useLeaveUnSaveTip(); + setState(false); const emit = defineEmits<{ (e: 'ok'): void; (e: 'resetEnv'): void; @@ -200,6 +203,7 @@ loading.value = true; store.currentEnvDetailInfo.mock = true; await updateOrAddEnv({ fileList: [], request: store.currentEnvDetailInfo }); + setState(true); Message.success(t('common.saveSuccess')); emit('ok'); } catch (error) { diff --git a/frontend/src/views/project-management/environmental/components/allParams/index.vue b/frontend/src/views/project-management/environmental/components/allParams/index.vue index b63e6f94f9..063f6ca3f4 100644 --- a/frontend/src/views/project-management/environmental/components/allParams/index.vue +++ b/frontend/src/views/project-management/environmental/components/allParams/index.vue @@ -14,14 +14,19 @@ - + @@ -67,6 +72,7 @@ value: '', description: '', tags: [], + enable: true, }; const columns: ParamTableColumn[] = [ @@ -84,7 +90,7 @@ slotName: 'paramType', showInTable: true, showDrag: true, - hasRequired: true, + hasRequired: false, columnSelectorDisabled: true, typeOptions: [ { @@ -162,7 +168,9 @@ if (!searchValue.value) { innerParams.value = [...backupParams.value]; } else { - const result = backupParams.value.filter((item) => item.key.includes(searchValue.value)); + const result = backupParams.value.filter( + (item) => item.key.includes(searchValue.value) || item.tags.includes(searchValue.value) + ); innerParams.value = [...result]; } } diff --git a/frontend/src/views/project-management/environmental/components/common/TabSettingDrawer.vue b/frontend/src/views/project-management/environmental/components/common/TabSettingDrawer.vue index 344b49699e..665056494e 100644 --- a/frontend/src/views/project-management/environmental/components/common/TabSettingDrawer.vue +++ b/frontend/src/views/project-management/environmental/components/common/TabSettingDrawer.vue @@ -23,18 +23,26 @@ t('project.environmental.nonClose') }} -
-
- {{ t(element.label) }} + +
+
+ {{ t(element.label) }} +
+
- -
+
diff --git a/frontend/src/views/project-management/environmental/components/envParams/popUp/AddHttpDrawer.vue b/frontend/src/views/project-management/environmental/components/envParams/popUp/AddHttpDrawer.vue index 4f6fb43af3..ee938544a2 100644 --- a/frontend/src/views/project-management/environmental/components/envParams/popUp/AddHttpDrawer.vue +++ b/frontend/src/views/project-management/environmental/components/envParams/popUp/AddHttpDrawer.vue @@ -155,7 +155,7 @@ - + diff --git a/frontend/src/views/project-management/environmental/components/envParams/popUp/domain.vue b/frontend/src/views/project-management/environmental/components/envParams/popUp/domain.vue new file mode 100644 index 0000000000..9d1d0eeb70 --- /dev/null +++ b/frontend/src/views/project-management/environmental/components/envParams/popUp/domain.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/frontend/src/views/project-management/environmental/components/requestHeader/index.vue b/frontend/src/views/project-management/environmental/components/requestHeader/index.vue index eaac6852f9..70c7cc767c 100644 --- a/frontend/src/views/project-management/environmental/components/requestHeader/index.vue +++ b/frontend/src/views/project-management/environmental/components/requestHeader/index.vue @@ -1,7 +1,7 @@