From 15ff97a4cbe13bcf308b484d207324efd63c9eeb Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Tue, 20 Feb 2024 18:35:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9D=83=E9=99=90=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=B8=A5=E9=87=8Dbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ms-assertion/comp/ResponseHeaderTab.vue | 78 ++----------------- .../pure/ms-advance-filter/FilterForm.vue | 10 +-- .../pure/ms-advance-filter/index.ts | 6 ++ .../components/bugDetailTab.vue | 2 +- frontend/src/views/bug-management/edit.vue | 2 +- frontend/src/views/bug-management/index.vue | 2 +- .../userGroup/projectUserGroup.vue | 12 ++- .../project/components/userDrawer.vue | 14 +++- .../organization/project/orgProject.vue | 4 +- .../components/systemOrganization.vue | 22 +++--- .../components/systemProject.vue | 16 ++-- .../components/userDrawer.vue | 8 +- 12 files changed, 69 insertions(+), 107 deletions(-) diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue index af08a5843a..ee1df58943 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue @@ -7,14 +7,12 @@ - +
+ +
+
+ +
@@ -22,6 +20,8 @@ import { defineModel } from 'vue'; import { statusCodeOptions } from '@/components/pure/ms-advance-filter/index'; + import MsJsonPathPicker from '@/components/pure/ms-jsonpath-picker/index.vue'; + import MsXPathPicker from '@/components/pure/ms-jsonpath-picker/xpath.vue'; import paramsTable, { type ParamTableColumn } from '@/views/api-test/components/paramTable.vue'; import { useI18n } from '@/hooks/useI18n'; @@ -37,28 +37,6 @@ }>(); const { t } = useI18n(); - const defaultParamItem = { - responseHeader: '', - matchCondition: '', - matchValue: '', - enable: true, - }; - - const responseHeaderOption = [ - { label: 'Accept', value: 'accept' }, - { label: 'Accept-Encoding', value: 'acceptEncoding' }, - { label: 'Accept-Language', value: 'acceptLanguage' }, - { label: 'Cache-Control', value: 'cacheControl' }, - { label: 'Content-Type', value: 'contentType' }, - { label: 'Content-Length', value: 'contentLength' }, - { label: 'User-Agent', value: 'userAgent' }, - { label: 'Referer', value: 'referer' }, - { label: 'Cookie', value: 'cookie' }, - { label: 'Authorization', value: 'authorization' }, - { label: 'If-None-Match', value: 'ifNoneMatch' }, - { label: 'If-Modified-Since', value: 'ifModifiedSince' }, - ]; - const responseRadios = [ { label: 'ms.assertion.jsonPath', value: 'jsonPath' }, { label: 'ms.assertion.xpath', value: 'xPath' }, @@ -66,44 +44,4 @@ { label: 'ms.assertion.regular', value: 'regular' }, { label: 'ms.assertion.script', value: 'script' }, ]; - - const columns: ParamTableColumn[] = [ - { - title: 'ms.assertion.responseHeader', // 响应头 - dataIndex: 'responseHeader', - slotName: 'responseHeader', - showInTable: true, - showDrag: true, - options: responseHeaderOption, - }, - { - title: 'ms.assertion.matchCondition', // 匹配条件 - dataIndex: 'matchCondition', - slotName: 'matchCondition', - showInTable: true, - showDrag: true, - options: statusCodeOptions, - }, - { - title: 'ms.assertion.matchValue', // 匹配值 - dataIndex: 'matchValue', - slotName: 'matchValue', - showInTable: true, - showDrag: true, - }, - { - title: '', - columnTitle: 'common.operation', - slotName: 'operation', - width: 50, - showInTable: true, - showDrag: true, - }, - ]; - function handleParamTableChange(resultArr: any[], isInit?: boolean) { - innerParams.value = [...resultArr]; - if (!isInit) { - emit('change'); - } - } diff --git a/frontend/src/components/pure/ms-advance-filter/FilterForm.vue b/frontend/src/components/pure/ms-advance-filter/FilterForm.vue index 6f600bf01a..27baae4f90 100644 --- a/frontend/src/components/pure/ms-advance-filter/FilterForm.vue +++ b/frontend/src/components/pure/ms-advance-filter/FilterForm.vue @@ -76,7 +76,7 @@ class="hidden-item" > { - if (v === 'between') { + if (isMutipleOperator(v as string)) { formModel.list[idx].value = []; } else { formModel.list[idx].value = isMultipleSelect(dataIndex) ? [] : ''; diff --git a/frontend/src/components/pure/ms-advance-filter/index.ts b/frontend/src/components/pure/ms-advance-filter/index.ts index 51775d3929..cc9d91979d 100644 --- a/frontend/src/components/pure/ms-advance-filter/index.ts +++ b/frontend/src/components/pure/ms-advance-filter/index.ts @@ -132,3 +132,9 @@ export const CustomTypeMaps: Record = { type: 'TAGS_INPUT', }, }; + +export const MULTIPLE_OPERATOR_LIST = ['in', 'not_in', 'between']; + +export function isMutipleOperator(operator: string) { + return MULTIPLE_OPERATOR_LIST.includes(operator); +} diff --git a/frontend/src/views/bug-management/components/bugDetailTab.vue b/frontend/src/views/bug-management/components/bugDetailTab.vue index e81223e41a..55c31ce27b 100644 --- a/frontend/src/views/bug-management/components/bugDetailTab.vue +++ b/frontend/src/views/bug-management/components/bugDetailTab.vue @@ -419,7 +419,7 @@ id: item.field as string, name: item.title as string, type: item.sourceType as string, - value: item.value as string, + value: Array.isArray(item.value) ? JSON.stringify(item.value) : (item.value as string), }); }); } diff --git a/frontend/src/views/bug-management/edit.vue b/frontend/src/views/bug-management/edit.vue index aaa0f1cde6..6cb692e834 100644 --- a/frontend/src/views/bug-management/edit.vue +++ b/frontend/src/views/bug-management/edit.vue @@ -472,7 +472,7 @@ id: item.field as string, name: item.title as string, type: item.sourceType as string, - value: item.value as string, + value: Array.isArray(item.value) ? JSON.stringify(item.value) : (item.value as string), }); }); } diff --git a/frontend/src/views/bug-management/index.vue b/frontend/src/views/bug-management/index.vue index 9db26b506a..816981a39e 100644 --- a/frontend/src/views/bug-management/index.vue +++ b/frontend/src/views/bug-management/index.vue @@ -292,7 +292,7 @@ }, { title: 'bugManagement.creator', - dataIndex: 'createUser', + dataIndex: 'createUserName', width: 112, showTooltip: true, showDrag: true, diff --git a/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue b/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue index 0c6f33a12c..dad08b71ed 100644 --- a/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue +++ b/frontend/src/views/project-management/projectAndPermission/userGroup/projectUserGroup.vue @@ -22,13 +22,17 @@