fix(项目管理): 环境前后置参数问题调整和修复

This commit is contained in:
xinxin.wu 2024-03-07 10:30:25 +08:00 committed by Craftsman
parent 407bee3d26
commit 93cd178388
4 changed files with 1274 additions and 2 deletions

View File

@ -150,6 +150,8 @@ export enum RequestConditionProcessor {
SQL = 'SQL', // SQL操作
TIME_WAITING = 'TIME_WAITING', // 等待时间
EXTRACT = 'EXTRACT', // 参数提取
SCENARIO_SCRIPT = 'ENV_SCENARIO_SCRIPT', // 场景脚本
REQUEST_SCRIPT = 'ENV_REQUEST_SCRIPT', // 请求脚本
}
// 接口请求-前后置条件-脚本处理器语言
export enum RequestConditionScriptLanguage {

View File

@ -1,7 +1,13 @@
<template>
<div class="condition-content">
<!-- 脚本操作 -->
<template v-if="condition.processorType === RequestConditionProcessor.SCRIPT">
<template
v-if="
condition.processorType === RequestConditionProcessor.SCRIPT ||
condition.processorType === RequestConditionProcessor.SCENARIO_SCRIPT ||
condition.processorType === RequestConditionProcessor.REQUEST_SCRIPT
"
>
<!-- 前后置请求开始 -->
<div v-if="props.showPrePostRequest" class="mt-4">
<a-radio-group v-model="condition.beforeStepScript" type="button" size="small" :default-value="true">

View File

@ -112,10 +112,17 @@
function addCondition(value: ConditionType) {
const id = new Date().getTime();
switch (value) {
//
case RequestConditionProcessor.SCRIPT:
let type = RequestConditionProcessor.SCRIPT;
if (props.showAssociatedScene) {
type = RequestConditionProcessor.SCENARIO_SCRIPT;
} else if (props.showPrePostRequest) {
type = RequestConditionProcessor.REQUEST_SCRIPT;
}
data.value.push({
id,
processorType: RequestConditionProcessor.SCRIPT,
processorType: type,
scriptName: t('apiTestDebug.preconditionScriptName'),
enableCommonScript: false,
associateScenarioResult: false,