fix(接口测试): 修复创建case时没有将api请求参数信息带过来的缺陷&修复case编辑完是未保存状态的缺陷&修改新建请求按钮样式
--bug=1037680 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037680 --bug=1037697 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037697 --bug=1038245 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001038245
This commit is contained in:
parent
46d6a93614
commit
cb4bad71d6
|
@ -240,6 +240,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
/** 按钮下拉框 **/
|
||||
.arco-btn-group {
|
||||
.arco-btn-primary:first-child {
|
||||
margin-right: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
/** 输入框,选择器,文本域 **/
|
||||
.arco-select {
|
||||
.arco-icon {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<a-dropdown-button
|
||||
v-if="hasLocalExec && !props.executeLoading"
|
||||
class="exec-btn"
|
||||
type="primary"
|
||||
@click="() => execute(isPriorityLocalExec ? 'localExec' : 'serverExec')"
|
||||
@select="execute"
|
||||
>
|
||||
|
@ -55,13 +55,3 @@
|
|||
hasLocalExec,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.exec-btn :deep(.arco-btn) {
|
||||
color: white !important;
|
||||
background-color: rgb(var(--primary-5)) !important;
|
||||
.btn-base-primary-hover();
|
||||
.btn-base-primary-active();
|
||||
.btn-base-primary-disabled();
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
:disabled="props.disabled"
|
||||
mode="button"
|
||||
:step="100"
|
||||
:precision="0"
|
||||
:min="0"
|
||||
class="w-[160px]"
|
||||
/>
|
||||
|
@ -30,6 +31,7 @@
|
|||
:disabled="props.disabled"
|
||||
mode="button"
|
||||
:step="100"
|
||||
:precision="0"
|
||||
:min="0"
|
||||
class="w-[160px]"
|
||||
/>
|
||||
|
|
|
@ -2,19 +2,32 @@
|
|||
<div class="flex h-full flex-col p-[12px_16px]">
|
||||
<div class="mb-[8px] flex items-center gap-[8px]">
|
||||
<a-input v-model:model-value="moduleKeyword" :placeholder="t('apiTestDebug.searchTip')" allow-clear />
|
||||
<a-dropdown @select="handleSelect">
|
||||
<a-button v-permission="['PROJECT_API_DEBUG:READ+ADD', 'PROJECT_API_DEBUG:READ+IMPORT']" type="primary">
|
||||
<a-dropdown-button
|
||||
v-if="hasAllPermission(['PROJECT_API_DEBUG:READ+ADD', 'PROJECT_API_DEBUG:READ+IMPORT'])"
|
||||
type="primary"
|
||||
@click="handleSelect('newApi')"
|
||||
>
|
||||
{{ t('apiTestDebug.newApi') }}
|
||||
</a-button>
|
||||
<template #icon>
|
||||
<icon-down />
|
||||
</template>
|
||||
<template #content>
|
||||
<a-doption v-permission="['PROJECT_API_DEBUG:READ+ADD']" value="newApi">
|
||||
{{ t('apiTestDebug.newApi') }}
|
||||
</a-doption>
|
||||
<a-doption v-permission="['PROJECT_API_DEBUG:READ+IMPORT']" value="import">
|
||||
<a-doption value="import" @click="handleSelect('import')">
|
||||
{{ t('apiTestDebug.importApi') }}
|
||||
</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-dropdown-button>
|
||||
<a-button
|
||||
v-else-if="
|
||||
!hasAnyPermission(['PROJECT_API_DEBUG:READ+ADD']) && hasAnyPermission(['PROJECT_API_DEBUG:READ+IMPORT'])
|
||||
"
|
||||
type="primary"
|
||||
>
|
||||
{{ t('apiTestDebug.importApi') }}
|
||||
</a-button>
|
||||
<a-button v-else v-permission="['PROJECT_API_DEBUG:READ+ADD']" type="primary">
|
||||
{{ t('apiTestDebug.newApi') }}
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="folder">
|
||||
<div class="folder-text">
|
||||
|
@ -159,7 +172,7 @@
|
|||
import useModal from '@/hooks/useModal';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import { characterLimit, mapTree } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@
|
|||
</MsButton>
|
||||
{{ t('apiTestManagement.or') }}
|
||||
<MsButton class="ml-[8px]" @click="emit('import')">
|
||||
{{ t('caseManagement.featureCase.importExcel') }}
|
||||
{{ t('common.import') }}
|
||||
</MsButton>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -190,7 +190,7 @@
|
|||
} else {
|
||||
await getApiDetail();
|
||||
}
|
||||
// 创建或者复制的时候,请求参数为接口定义的请求参数
|
||||
// 创建的时候,请求参数为接口定义的请求参数
|
||||
detailForm.value = {
|
||||
...cloneDeep(defaultDetail.value),
|
||||
...(apiDetailInfo.value.protocol === 'HTTP'
|
||||
|
@ -199,8 +199,11 @@
|
|||
body: apiDetailInfo.value?.body ?? apiDetailInfo.value.request.body,
|
||||
rest: apiDetailInfo.value.rest ?? apiDetailInfo.value.request.rest,
|
||||
query: apiDetailInfo.value.query ?? apiDetailInfo.value.request.query,
|
||||
authConfig: apiDetailInfo.value.authConfig ?? apiDetailInfo.value.request.authConfig,
|
||||
otherConfig: apiDetailInfo.value.otherConfig ?? apiDetailInfo.value.request.otherConfig,
|
||||
}
|
||||
: {}),
|
||||
children: apiDetailInfo.value.children ?? apiDetailInfo.value.request.children,
|
||||
url: apiDetailInfo.value.url ?? apiDetailInfo.value.request.url,
|
||||
};
|
||||
// 复制
|
||||
|
@ -268,16 +271,9 @@
|
|||
if (!isContinue) {
|
||||
handleSaveCaseCancel();
|
||||
}
|
||||
// 继续创建
|
||||
detailForm.value = {
|
||||
...cloneDeep(defaultDetail.value),
|
||||
id: `case-${Date.now()}`,
|
||||
headers: apiDetailInfo.value.headers ?? apiDetailInfo.value.request.headers,
|
||||
body: apiDetailInfo.value.body ?? apiDetailInfo.value.request.body,
|
||||
rest: apiDetailInfo.value.rest ?? apiDetailInfo.value.request.rest,
|
||||
query: apiDetailInfo.value.query ?? apiDetailInfo.value.request.query,
|
||||
url: apiDetailInfo.value.url ?? apiDetailInfo.value.request.url,
|
||||
};
|
||||
// 保存并继续创建都以当前页面内容为基础,不需要还原
|
||||
detailForm.value.id = `case-${Date.now()}`;
|
||||
detailForm.value.name = '';
|
||||
drawerLoading.value = false;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
} else {
|
||||
// 更新数据
|
||||
const index = apiTabs.value.findIndex((item) => item.id === id);
|
||||
apiTabs.value[index] = tabItemInfo;
|
||||
apiTabs.value[index] = cloneDeep(tabItemInfo);
|
||||
activeApiTab.value = tabItemInfo;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,28 +14,39 @@
|
|||
:placeholder="props.isModal ? t('apiTestManagement.moveSearchTip') : t('apiTestManagement.searchTip')"
|
||||
allow-clear
|
||||
/>
|
||||
<a-dropdown
|
||||
<template v-if="!props.readOnly && !props.trash">
|
||||
<a-dropdown-button
|
||||
v-if="
|
||||
!props.readOnly &&
|
||||
!props.trash &&
|
||||
hasAnyPermission(['PROJECT_API_DEFINITION:READ+ADD', 'PROJECT_API_DEFINITION:READ+IMPORT'])
|
||||
moduleProtocol === 'HTTP' &&
|
||||
hasAllPermission(['PROJECT_API_DEFINITION:READ+ADD', 'PROJECT_API_DEFINITION:READ+IMPORT'])
|
||||
"
|
||||
@select="handleSelect"
|
||||
type="primary"
|
||||
@click="handleSelect('newApi')"
|
||||
>
|
||||
<a-button type="primary">{{ t('apiTestManagement.newApi') }}</a-button>
|
||||
{{ t('apiTestManagement.newApi') }}
|
||||
<template #icon>
|
||||
<icon-down />
|
||||
</template>
|
||||
<template #content>
|
||||
<a-doption v-permission="['PROJECT_API_DEFINITION:READ+ADD']" value="newApi">{{
|
||||
t('apiTestManagement.newApi')
|
||||
}}</a-doption>
|
||||
<a-doption
|
||||
v-if="moduleProtocol === 'HTTP'"
|
||||
v-permission="['PROJECT_API_DEFINITION:READ+IMPORT']"
|
||||
value="import"
|
||||
>
|
||||
<a-doption value="import" @click="handleSelect('import')">
|
||||
{{ t('apiTestManagement.importApi') }}
|
||||
</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-dropdown-button>
|
||||
<a-button
|
||||
v-else-if="
|
||||
moduleProtocol === 'HTTP' &&
|
||||
!hasAnyPermission(['PROJECT_API_DEFINITION:READ+ADD']) &&
|
||||
hasAnyPermission(['PROJECT_API_DEFINITION:READ+IMPORT'])
|
||||
"
|
||||
type="primary"
|
||||
>
|
||||
{{ t('apiTestManagement.importApi') }}
|
||||
</a-button>
|
||||
<a-button v-else v-permission="['PROJECT_API_DEFINITION:READ+ADD']" type="primary">
|
||||
{{ t('apiTestManagement.newApi') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</div>
|
||||
<div class="folder" @click="setActiveFolder('all')">
|
||||
<div :class="allFolderClass">
|
||||
|
@ -205,7 +216,7 @@
|
|||
import useModal from '@/hooks/useModal';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
import { hasAllPermission, hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
|
|
Loading…
Reference in New Issue