From f4faffe16839de737c4127f56187b256c7f18e86 Mon Sep 17 00:00:00 2001 From: baiqi Date: Mon, 25 Nov 2024 18:12:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(bug):=20=E6=8E=A5=E5=8F=A3=E6=B5=8B?= =?UTF-8?q?=E8=AF=95&=E5=B7=A5=E4=BD=9C=E5=8F=B0=20bug=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/ms-project-select/index.vue | 10 +++++++++- .../response/result/assertionTable.vue | 19 ++++++++++--------- .../testPlan/components/scheduledModal.vue | 2 +- .../src/views/workbench/myCreated/index.vue | 10 ++++++++-- .../src/views/workbench/myFollowed/index.vue | 10 ++++++++-- frontend/src/views/workbench/myToDo/index.vue | 10 ++++++++-- 6 files changed, 44 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/business/ms-project-select/index.vue b/frontend/src/components/business/ms-project-select/index.vue index 27c316f735..bf2d4760ad 100644 --- a/frontend/src/components/business/ms-project-select/index.vue +++ b/frontend/src/components/business/ms-project-select/index.vue @@ -58,7 +58,7 @@ }); } - onBeforeMount(async () => { + async function init() { if (!project.value) { project.value = appStore.currentProjectId; } @@ -74,6 +74,14 @@ // eslint-disable-next-line no-console console.log(error); } + } + + onBeforeMount(() => { + init(); + }); + + defineExpose({ + init, }); diff --git a/frontend/src/views/api-test/components/requestComposition/response/result/assertionTable.vue b/frontend/src/views/api-test/components/requestComposition/response/result/assertionTable.vue index fbdfe7aa7f..e23087f2f6 100644 --- a/frontend/src/views/api-test/components/requestComposition/response/result/assertionTable.vue +++ b/frontend/src/views/api-test/components/requestComposition/response/result/assertionTable.vue @@ -132,35 +132,36 @@ ]; const tableData = ref(props.requestResult?.responseResult.assertions || []); - const isTableFiltered = ref(false); + const tableFilters = ref([]); function handleFilterChange(dataIndex: string, value: string[] | (string | number | boolean)[] | undefined) { if (value && value.length > 0) { - isTableFiltered.value = true; + tableFilters.value = value; tableData.value = props.requestResult?.responseResult.assertions.filter((item) => { return (value as boolean[]).includes(item.pass); }) || []; } else { - isTableFiltered.value = false; tableData.value = props.requestResult?.responseResult.assertions || []; + tableFilters.value = []; } } function handleSortChange(sorter: { [key: string]: string }) { if (Object.keys(sorter).length > 0) { const dataIndex = Object.keys(sorter)[0] as keyof ResponseAssertionTableItem; - const copyArray = isTableFiltered.value - ? [...tableData.value] - : [...(props.requestResult?.responseResult.assertions || [])]; + const copyArray = + tableFilters.value.length > 0 + ? [...tableData.value] + : [...(props.requestResult?.responseResult.assertions || [])]; tableData.value = copyArray.sort((a, b) => { const sortResult = a[dataIndex] > b[dataIndex] ? -1 : 1; return sorter[dataIndex] === 'asc' ? sortResult : -sortResult; }); + } else if (tableFilters.value.length > 0) { + handleFilterChange('pass', tableFilters.value); } else { - tableData.value = isTableFiltered.value - ? [...tableData.value] - : props.requestResult?.responseResult.assertions || []; + tableData.value = props.requestResult?.responseResult.assertions || []; } } diff --git a/frontend/src/views/test-plan/testPlan/components/scheduledModal.vue b/frontend/src/views/test-plan/testPlan/components/scheduledModal.vue index 83b4982685..08eadefcfe 100644 --- a/frontend/src/views/test-plan/testPlan/components/scheduledModal.vue +++ b/frontend/src/views/test-plan/testPlan/components/scheduledModal.vue @@ -140,7 +140,7 @@ const initForm: CreateTask = { resourceId: '', cron: '', - enable: false, + enable: true, runConfig: { runMode: 'SERIAL' }, }; diff --git a/frontend/src/views/workbench/myCreated/index.vue b/frontend/src/views/workbench/myCreated/index.vue index cdc74d87a3..1a21c2e91a 100644 --- a/frontend/src/views/workbench/myCreated/index.vue +++ b/frontend/src/views/workbench/myCreated/index.vue @@ -5,10 +5,11 @@ class="sticky top-0 z-[999] mb-[-16px] flex items-center justify-end gap-[12px] bg-[var(--color-bg-3)] pb-[16px]" >