From 52448dcb32ae47d8e2f834cf1001f58f1ca3114b Mon Sep 17 00:00:00 2001 From: RubyLiu Date: Wed, 21 Feb 2024 19:04:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E8=AF=A6=E6=83=85=E5=A2=9E=E5=8A=A0=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/bug-management/index.ts | 5 + frontend/src/api/requrls/bug-management.ts | 3 + .../ms-assertion/comp/ResponseBodyTab.vue | 385 ++++++++++++++++++ .../ms-assertion/comp/ResponseHeaderTab.vue | 94 +++-- .../business/ms-assertion/index.vue | 2 + .../business/ms-assertion/locale/zh-CN.ts | 2 + .../pure/ms-advance-filter/index.ts | 12 +- .../pure/ms-advance-filter/index.vue | 4 +- .../views/api-test/components/paramTable.vue | 29 +- .../components/bug-detail-drawer.vue | 7 + .../components/bugHistoryTab.vue | 64 +++ .../src/views/bug-management/locale/zh-CN.ts | 19 +- 12 files changed, 567 insertions(+), 59 deletions(-) create mode 100644 frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue create mode 100644 frontend/src/views/bug-management/components/bugHistoryTab.vue diff --git a/frontend/src/api/modules/bug-management/index.ts b/frontend/src/api/modules/bug-management/index.ts index 5665b151d1..4a2a2380e3 100644 --- a/frontend/src/api/modules/bug-management/index.ts +++ b/frontend/src/api/modules/bug-management/index.ts @@ -211,3 +211,8 @@ export function batchAssociation(data: TableQueryParams) { export function cancelAssociation(id: string) { return MSR.get({ url: `${bugURL.getCancelDemandUrl}/${id}` }); } + +// 缺陷管理-变更历史-列表 +export function getChangeHistoryList(data: TableQueryParams) { + return MSR.post({ url: bugURL.getChangeHistoryListUrl, data }); +} diff --git a/frontend/src/api/requrls/bug-management.ts b/frontend/src/api/requrls/bug-management.ts index aa20b9d847..c06a82ee7a 100644 --- a/frontend/src/api/requrls/bug-management.ts +++ b/frontend/src/api/requrls/bug-management.ts @@ -64,3 +64,6 @@ export const getUnrelatedDemandListUrl = '/bug/case/un-relate/page'; export const getUnrelatedModuleTreeUrl = '/bug/case/un-relate/module/tree'; // 未关联的模块树 数量 export const getUnrelatedModuleTreeCountUrl = '/bug/case/un-relate/module/count'; + +// 缺陷管理-变更历史-列表 +export const getChangeHistoryListUrl = '/bug/history/page'; diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue new file mode 100644 index 0000000000..571e429317 --- /dev/null +++ b/frontend/src/components/business/ms-assertion/comp/ResponseBodyTab.vue @@ -0,0 +1,385 @@ + + + diff --git a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue index ee1df58943..e8cf598796 100644 --- a/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue +++ b/frontend/src/components/business/ms-assertion/comp/ResponseHeaderTab.vue @@ -1,18 +1,13 @@ @@ -20,28 +15,77 @@ 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'; - interface Param { [key: string]: any; } - const innerParams = defineModel('modelValue', { default: { type: 'jsonPath' } }); + const innerParams = defineModel('modelValue', { default: [] }); const emit = defineEmits<{ (e: 'change'): void; // 数据发生变化 }>(); - const { t } = useI18n(); - const responseRadios = [ - { label: 'ms.assertion.jsonPath', value: 'jsonPath' }, - { label: 'ms.assertion.xpath', value: 'xPath' }, - { label: 'ms.assertion.document', value: 'document' }, - { label: 'ms.assertion.regular', value: 'regular' }, - { label: 'ms.assertion.script', value: 'script' }, + 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 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/business/ms-assertion/index.vue b/frontend/src/components/business/ms-assertion/index.vue index fd27312f6b..90d2483249 100644 --- a/frontend/src/components/business/ms-assertion/index.vue +++ b/frontend/src/components/business/ms-assertion/index.vue @@ -61,6 +61,7 @@ v-model:statusCode="codeTabState.statusCode" /> + @@ -76,6 +77,7 @@ import MsIcon from '@/components/pure/ms-icon-font/index.vue'; import MsTableMoreAction from '@/components/pure/ms-table-more-action/index.vue'; import { ActionsItem } from '@/components/pure/ms-table-more-action/types'; + import ResponseBodyTab from './comp/ResponseBodyTab.vue'; import ResponseHeaderTab from './comp/ResponseHeaderTab.vue'; import ResponseTimeTab from './comp/ResponseTimeTab.vue'; import ScriptTab from './comp/ScriptTab.vue'; diff --git a/frontend/src/components/business/ms-assertion/locale/zh-CN.ts b/frontend/src/components/business/ms-assertion/locale/zh-CN.ts index 6c14471987..d494efe46d 100644 --- a/frontend/src/components/business/ms-assertion/locale/zh-CN.ts +++ b/frontend/src/components/business/ms-assertion/locale/zh-CN.ts @@ -14,4 +14,6 @@ export default { 'ms.assertion.document': '文档', 'ms.assertion.regular': '正则', 'ms.assertion.script': '脚本', + 'ms.assertion.expression': '表达式', + 'ms.assertion.responseContentType': '响应内容类型', }; diff --git a/frontend/src/components/pure/ms-advance-filter/index.ts b/frontend/src/components/pure/ms-advance-filter/index.ts index cc9d91979d..d83c071d12 100644 --- a/frontend/src/components/pure/ms-advance-filter/index.ts +++ b/frontend/src/components/pure/ms-advance-filter/index.ts @@ -1,8 +1,8 @@ export { default as FilterForm } from './FilterForm.vue'; export { default as MsAdvanceFilter } from './index.vue'; -const IN = { label: 'advanceFilter.operator.in', value: 'in' }; -const NOT_IN = { label: 'advanceFilter.operator.not_in', value: 'not_in' }; +// const IN = { label: 'advanceFilter.operator.in', value: 'in' }; +// const NOT_IN = { label: 'advanceFilter.operator.not_in', value: 'not_in' }; const LIKE = { label: 'advanceFilter.operator.like', value: 'like' }; const NOT_LIKE = { label: 'advanceFilter.operator.not_like', value: 'not_like' }; const GT = { label: 'advanceFilter.operator.gt', value: 'gt' }; @@ -14,18 +14,16 @@ const NOT_EQUAL = { label: 'advanceFilter.operator.notEqual', value: 'not_equal' const BETWEEN = { label: 'advanceFilter.operator.between', value: 'between' }; export const OPERATOR_MAP = { - string: [LIKE, NOT_LIKE, IN, NOT_IN, EQUAL, NOT_EQUAL], + string: [LIKE, NOT_LIKE, EQUAL, NOT_EQUAL], number: [GT, GE, LT, LE, EQUAL, NOT_EQUAL, BETWEEN], date: [GT, GE, LT, LE, EQUAL, NOT_EQUAL, BETWEEN], - array: [IN, NOT_IN], + array: [BETWEEN], }; export const timeSelectOptions = [GE, LE]; export const statusCodeOptions = [ { label: 'ms.assertion.noValidation', value: 'none' }, - IN, - NOT_IN, EQUAL, NOT_EQUAL, GT, @@ -133,7 +131,7 @@ export const CustomTypeMaps: Record = { }, }; -export const MULTIPLE_OPERATOR_LIST = ['in', 'not_in', 'between']; +export const MULTIPLE_OPERATOR_LIST = ['between']; export function isMutipleOperator(operator: string) { return MULTIPLE_OPERATOR_LIST.includes(operator); diff --git a/frontend/src/components/pure/ms-advance-filter/index.vue b/frontend/src/components/pure/ms-advance-filter/index.vue index cd4bae1d39..d4ff0de3a5 100644 --- a/frontend/src/components/pure/ms-advance-filter/index.vue +++ b/frontend/src/components/pure/ms-advance-filter/index.vue @@ -12,7 +12,7 @@ @search="emit('keywordSearch', innerKeyword, filterResult)" @clear="handleClear" > - - + --> diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue index 64d16df6ca..e7fd6b7864 100644 --- a/frontend/src/views/api-test/components/paramTable.vue +++ b/frontend/src/views/api-test/components/paramTable.vue @@ -206,6 +206,14 @@ - - +
+ +
+ + + + @@ -166,6 +172,7 @@ import MsDetailDrawer from '@/components/business/ms-detail-drawer/index.vue'; import BugCaseTab from './bugCaseTab.vue'; import BugDetailTab from './bugDetailTab.vue'; + import BugHistoryTab from './bugHistoryTab.vue'; import CommentTab from './commentTab.vue'; import { diff --git a/frontend/src/views/bug-management/components/bugHistoryTab.vue b/frontend/src/views/bug-management/components/bugHistoryTab.vue new file mode 100644 index 0000000000..7c600a6340 --- /dev/null +++ b/frontend/src/views/bug-management/components/bugHistoryTab.vue @@ -0,0 +1,64 @@ + + + diff --git a/frontend/src/views/bug-management/locale/zh-CN.ts b/frontend/src/views/bug-management/locale/zh-CN.ts index a177497bf2..8b109e8392 100644 --- a/frontend/src/views/bug-management/locale/zh-CN.ts +++ b/frontend/src/views/bug-management/locale/zh-CN.ts @@ -67,6 +67,7 @@ export default { tag: '标签', detail: '详情', case: '用例', + changeHistory: '变更历史', comment: '评论', shareTip: '分享链接已复制到剪贴板', deleteTitle: '确认删除 {name} 吗?', @@ -106,18 +107,12 @@ export default { deleteTime: '删除时间', deleteMan: '删除人', }, - severityO: { - fatal: '致命', - serious: '严重', - general: '一般', - reminder: '提醒', - }, - statusO: { - create: '新建', - processing: '处理中', - resolved: '已解决', - closed: '已关闭', - refused: '已拒绝', + history: { + changeNumber: '变更序号', + operationMan: '操作人', + updateTime: '更新时间', + restore: '恢复', + current: '当前', }, }, };