style: 调整功能用例页面样式新建&断言样式&接口管理新建

This commit is contained in:
xinxin.wu 2024-04-25 12:11:20 +08:00 committed by 刘瑞斌
parent 73ca28a9ba
commit 0e5c550b70
6 changed files with 43 additions and 18 deletions

View File

@ -456,13 +456,13 @@
title: 'ms.assertion.expression', title: 'ms.assertion.expression',
dataIndex: 'expression', dataIndex: 'expression',
slotName: 'expression', slotName: 'expression',
width: 300,
}, },
{ {
title: 'ms.assertion.matchCondition', title: 'ms.assertion.matchCondition',
dataIndex: 'condition', dataIndex: 'condition',
slotName: 'condition', slotName: 'condition',
options: statusCodeOptions, options: statusCodeOptions,
width: 150,
}, },
{ {
title: 'ms.assertion.matchValue', title: 'ms.assertion.matchValue',
@ -475,7 +475,7 @@
title: '', title: '',
slotName: 'operation', slotName: 'operation',
fixed: 'right', fixed: 'right',
width: 130, width: 80,
moreAction: [ moreAction: [
{ {
eventTag: 'copy', eventTag: 'copy',
@ -702,6 +702,7 @@
config: RegexExtract | JSONPathExtract | XPathExtract, config: RegexExtract | JSONPathExtract | XPathExtract,
matchResult: Record<string, any> matchResult: Record<string, any>
) { ) {
debugger;
condition.value.jsonPathAssertion.assertions = condition.value.jsonPathAssertion.assertions?.map((e: Param) => { condition.value.jsonPathAssertion.assertions = condition.value.jsonPathAssertion.assertions?.map((e: Param) => {
if (e.id === activeRecord.value.id) { if (e.id === activeRecord.value.id) {
return { return {

View File

@ -7,7 +7,7 @@
type="primary" type="primary"
@click="handleSelect('newApi')" @click="handleSelect('newApi')"
> >
{{ t('apiTestDebug.newApi') }} {{ t('common.newCreate') }}
<template #icon> <template #icon>
<icon-down /> <icon-down />
</template> </template>

View File

@ -23,7 +23,7 @@
type="primary" type="primary"
@click="handleSelect('newApi')" @click="handleSelect('newApi')"
> >
{{ t('apiTestManagement.newApi') }} {{ t('common.newCreate') }}
<template #icon> <template #icon>
<icon-down /> <icon-down />
</template> </template>

View File

@ -503,4 +503,7 @@
height: 100%; height: 100%;
height: 1000px; height: 1000px;
} }
:deep(.step-tree-node-title) {
width: 100%;
}
</style> </style>

View File

@ -15,7 +15,8 @@
emit('newScenario'); emit('newScenario');
} }
" "
>{{ t('apiScenario.createScenario') }}</a-button >
{{ t('common.newCreate') }}</a-button
> >
</div> </div>
<div class="folder" @click="setActiveFolder('all')"> <div class="folder" @click="setActiveFolder('all')">

View File

@ -11,19 +11,26 @@
allow-clear allow-clear
:max-length="255" :max-length="255"
/> />
<a-dropdown position="br"> <a-dropdown-button
<a-button class="ml-2" type="primary"> v-if="hasAllPermission(['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+IMPORT'])"
{{ t('common.newCreate') }} class="ml-2"
</a-button> type="primary"
<template #content> @click="handleSelect('newCase')"
<a-doption v-permission="['FUNCTIONAL_CASE:READ+ADD']" @click="caseDetail">{{ >
t('caseManagement.featureCase.creatingCase') {{ t('common.newCreate') }}
}}</a-doption> <template #icon>
<a-doption v-permission="['FUNCTIONAL_CASE:READ+IMPORT']" @click="importCase('Excel')">{{ <icon-down />
t('caseManagement.featureCase.importExcel')
}}</a-doption>
</template> </template>
</a-dropdown> <template #content>
<a-doption
v-permission="['FUNCTIONAL_CASE:READ+IMPORT']"
value="Excel"
@click="handleSelect('import', 'Excel')"
>
{{ t('caseManagement.featureCase.importExcel') }}
</a-doption>
</template>
</a-dropdown-button>
</div> </div>
<div class="case h-[38px]"> <div class="case h-[38px]">
@ -163,7 +170,7 @@
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import useFeatureCaseStore from '@/store/modules/case/featureCase'; import useFeatureCaseStore from '@/store/modules/case/featureCase';
import { hasAnyPermission } from '@/utils/permission'; import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
import type { CaseModuleQueryParams, CreateOrUpdateModule, ValidateInfo } from '@/models/caseManagement/featureCase'; import type { CaseModuleQueryParams, CreateOrUpdateModule, ValidateInfo } from '@/models/caseManagement/featureCase';
import { TableQueryParams } from '@/models/common'; import { TableQueryParams } from '@/models/common';
@ -408,6 +415,19 @@
} }
} }
function handleSelect(value: string | number | Record<string, any> | undefined, type?: 'Excel' | 'Xmind') {
switch (value) {
case 'newCase':
caseDetail();
break;
case 'import':
importCase(type as 'Excel' | 'Xmind');
break;
default:
break;
}
}
function dragUpdate() { function dragUpdate() {
caseTableRef.value.emitTableParams(); caseTableRef.value.emitTableParams();
} }