fix(全局): bug修复
This commit is contained in:
parent
de8c3ca502
commit
cdbe4af91b
|
@ -124,7 +124,7 @@
|
||||||
}
|
}
|
||||||
const { height } = useWindowSize();
|
const { height } = useWindowSize();
|
||||||
appStore.innerHeight = height.value;
|
appStore.innerHeight = height.value;
|
||||||
await userStore.initLocalConfig(); // 获取本地执行配置
|
userStore.initLocalConfig(); // 获取本地执行配置
|
||||||
// @desc: TODO待优化主要是为了拿到初始化配置的项目模块方便接下来过滤菜单权限 解决刷新菜单空白问题
|
// @desc: TODO待优化主要是为了拿到初始化配置的项目模块方便接下来过滤菜单权限 解决刷新菜单空白问题
|
||||||
appStore.getProjectInfos();
|
appStore.getProjectInfos();
|
||||||
});
|
});
|
||||||
|
|
|
@ -343,8 +343,8 @@
|
||||||
|
|
||||||
// TODO: MessageResourceType
|
// TODO: MessageResourceType
|
||||||
const resourceTypeRouteMap: Record<string, string> = {
|
const resourceTypeRouteMap: Record<string, string> = {
|
||||||
[MessageResourceType.BUG_TASK]: BugManagementRouteEnum.BUG_MANAGEMENT_DETAIL,
|
[MessageResourceType.BUG_TASK]: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX,
|
||||||
[MessageResourceType.BUG_SYNC_TASK]: BugManagementRouteEnum.BUG_MANAGEMENT_DETAIL,
|
[MessageResourceType.BUG_SYNC_TASK]: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX,
|
||||||
[MessageResourceType.FUNCTIONAL_CASE_TASK]: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE_DETAIL,
|
[MessageResourceType.FUNCTIONAL_CASE_TASK]: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE_DETAIL,
|
||||||
[MessageResourceType.CASE_REVIEW_TASK]: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_DETAIL,
|
[MessageResourceType.CASE_REVIEW_TASK]: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_DETAIL,
|
||||||
[MessageResourceType.API_DEFINITION_TASK]: ApiTestRouteEnum.API_TEST_MANAGEMENT,
|
[MessageResourceType.API_DEFINITION_TASK]: ApiTestRouteEnum.API_TEST_MANAGEMENT,
|
||||||
|
|
|
@ -171,7 +171,9 @@
|
||||||
>
|
>
|
||||||
<div class="break-all text-[var(--color-text-3)]">{{ t('ms.paramsInput.preview') }}</div>
|
<div class="break-all text-[var(--color-text-3)]">{{ t('ms.paramsInput.preview') }}</div>
|
||||||
<a-spin :loading="previewLoading" class="flex flex-1 flex-wrap items-baseline gap-[8px]">
|
<a-spin :loading="previewLoading" class="flex flex-1 flex-wrap items-baseline gap-[8px]">
|
||||||
<div class="param-preview">{{ paramPreview }}</div>
|
<div v-show="paramPreview" class="ms-params-input-setting-trigger-content-scroll-preview">
|
||||||
|
{{ paramPreview }}
|
||||||
|
</div>
|
||||||
<MsButton type="text" @click="getMockValue">{{ t('ms.paramsInput.previewClick') }}</MsButton>
|
<MsButton type="text" @click="getMockValue">{{ t('ms.paramsInput.previewClick') }}</MsButton>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</div>
|
</div>
|
||||||
|
@ -557,15 +559,6 @@
|
||||||
}
|
}
|
||||||
const JMeterVarsOptions = genJMeterVarsOptions();
|
const JMeterVarsOptions = genJMeterVarsOptions();
|
||||||
|
|
||||||
function cancel() {
|
|
||||||
paramFormRef.value?.resetFields();
|
|
||||||
paramSettingType.value = 'mock';
|
|
||||||
paramSettingVisible.value = false;
|
|
||||||
currentParamsInputGroup.value = [];
|
|
||||||
currentParamsFuncInputGroup.value = [];
|
|
||||||
paramForm.value = { ...defaultParamForm };
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用 Mock类型变量和函数
|
* 应用 Mock类型变量和函数
|
||||||
*/
|
*/
|
||||||
|
@ -615,6 +608,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cancel() {
|
||||||
|
paramFormRef.value?.resetFields();
|
||||||
|
paramSettingType.value = 'mock';
|
||||||
|
paramSettingVisible.value = false;
|
||||||
|
currentParamsInputGroup.value = [];
|
||||||
|
currentParamsFuncInputGroup.value = [];
|
||||||
|
paramForm.value = { ...defaultParamForm };
|
||||||
|
paramPreview.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => popoverVisible.value,
|
() => popoverVisible.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
|
|
|
@ -112,11 +112,15 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMoreActionLength = () => {
|
const handleMoreActionLength = () => {
|
||||||
|
if (moreAction.value && moreAction.value.length === 0) {
|
||||||
|
moreActionLength.value = 0;
|
||||||
|
} else {
|
||||||
moreAction.value?.forEach((key) => {
|
moreAction.value?.forEach((key) => {
|
||||||
if (key.permission && hasAllPermission(key.permission as string[])) {
|
if (key.permission && hasAllPermission(key.permission as string[])) {
|
||||||
moreActionLength.value += 1;
|
moreActionLength.value += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const computedLastVisibleIndex = () => {
|
const computedLastVisibleIndex = () => {
|
||||||
|
|
|
@ -186,10 +186,14 @@ const useUserStore = defineStore('user', {
|
||||||
const res = await getLocalConfig();
|
const res = await getLocalConfig();
|
||||||
if (res) {
|
if (res) {
|
||||||
const apiLocalExec = res.find((e) => e.type === 'API');
|
const apiLocalExec = res.find((e) => e.type === 'API');
|
||||||
if (apiLocalExec) {
|
if (apiLocalExec && apiLocalExec.userUrl) {
|
||||||
this.hasLocalExec = true;
|
this.hasLocalExec = true;
|
||||||
this.isPriorityLocalExec = apiLocalExec.enable || false;
|
this.isPriorityLocalExec = apiLocalExec.enable || false;
|
||||||
this.localExecuteUrl = apiLocalExec.userUrl || '';
|
this.localExecuteUrl = apiLocalExec.userUrl || '';
|
||||||
|
} else {
|
||||||
|
this.hasLocalExec = false;
|
||||||
|
this.isPriorityLocalExec = false;
|
||||||
|
this.localExecuteUrl = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -167,6 +167,13 @@
|
||||||
|
|
||||||
const environmentId = ref(appStore.currentEnvConfig?.id);
|
const environmentId = ref(appStore.currentEnvConfig?.id);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => appStore.currentEnvConfig?.id,
|
||||||
|
(val) => {
|
||||||
|
environmentId.value = val;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const formRef = ref<FormInstance>();
|
const formRef = ref<FormInstance>();
|
||||||
const requestCompositionRef = ref<InstanceType<typeof requestComposition>>();
|
const requestCompositionRef = ref<InstanceType<typeof requestComposition>>();
|
||||||
const defaultCaseParams = inject<RequestParam>('defaultCaseParams');
|
const defaultCaseParams = inject<RequestParam>('defaultCaseParams');
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<a-input
|
<a-input
|
||||||
v-if="isShowEditStepNameInput"
|
v-if="isShowEditStepNameInput"
|
||||||
ref="stepNameInputRef"
|
ref="stepNameInputRef"
|
||||||
v-model:model-value="requestVModel.name"
|
v-model:model-value="requestVModel.stepName"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
:placeholder="t('apiScenario.pleaseInputStepName')"
|
:placeholder="t('apiScenario.pleaseInputStepName')"
|
||||||
:max-length="255"
|
:max-length="255"
|
||||||
|
@ -289,6 +289,7 @@
|
||||||
v-model:config="requestVModel.children[0].preProcessorConfig"
|
v-model:config="requestVModel.children[0].preProcessorConfig"
|
||||||
is-definition
|
is-definition
|
||||||
:disabled="!isEditableApi"
|
:disabled="!isEditableApi"
|
||||||
|
:tip-content="t('apiScenario.openGlobalPreConditionTip')"
|
||||||
@change="handleActiveDebugChange"
|
@change="handleActiveDebugChange"
|
||||||
/>
|
/>
|
||||||
<postcondition
|
<postcondition
|
||||||
|
@ -298,6 +299,7 @@
|
||||||
:layout="activeLayout"
|
:layout="activeLayout"
|
||||||
:disabled="!isEditableApi"
|
:disabled="!isEditableApi"
|
||||||
:second-box-height="secondBoxHeight"
|
:second-box-height="secondBoxHeight"
|
||||||
|
:tip-content="t('apiScenario.openGlobalPostConditionTip')"
|
||||||
is-definition
|
is-definition
|
||||||
@change="handleActiveDebugChange"
|
@change="handleActiveDebugChange"
|
||||||
/>
|
/>
|
||||||
|
@ -439,6 +441,7 @@
|
||||||
label: string;
|
label: string;
|
||||||
name: string;
|
name: string;
|
||||||
stepId: string | number; // 所属步骤 id
|
stepId: string | number; // 所属步骤 id
|
||||||
|
stepName: string; // 所属步骤名称
|
||||||
resourceId: string | number; // 引用、复制的资源 id
|
resourceId: string | number; // 引用、复制的资源 id
|
||||||
isNew: boolean;
|
isNew: boolean;
|
||||||
protocol: string;
|
protocol: string;
|
||||||
|
@ -500,6 +503,7 @@
|
||||||
name: '',
|
name: '',
|
||||||
type: 'api',
|
type: 'api',
|
||||||
stepId: '',
|
stepId: '',
|
||||||
|
stepName: '',
|
||||||
resourceId: '',
|
resourceId: '',
|
||||||
customizeRequest: true,
|
customizeRequest: true,
|
||||||
customizeRequestEnvEnable: false,
|
customizeRequestEnvEnable: false,
|
||||||
|
@ -576,9 +580,9 @@
|
||||||
_stepType.value.isQuoteApi ||
|
_stepType.value.isQuoteApi ||
|
||||||
props.step?.stepType === ScenarioStepType.CUSTOM_REQUEST
|
props.step?.stepType === ScenarioStepType.CUSTOM_REQUEST
|
||||||
) {
|
) {
|
||||||
return requestVModel.value.name || props.step?.name;
|
return requestVModel.value.stepName || requestVModel.value.name || props.step?.name;
|
||||||
}
|
}
|
||||||
return requestVModel.value.name || t('apiScenario.customApi');
|
return requestVModel.value.stepName || requestVModel.value.name || t('apiScenario.customApi');
|
||||||
});
|
});
|
||||||
// 是否显示环境域名前缀
|
// 是否显示环境域名前缀
|
||||||
const showEnvPrefix = computed(
|
const showEnvPrefix = computed(
|
||||||
|
@ -1066,7 +1070,7 @@
|
||||||
responseActiveTab: ResponseComposition.BODY,
|
responseActiveTab: ResponseComposition.BODY,
|
||||||
protocol: requestVModel.value.protocol,
|
protocol: requestVModel.value.protocol,
|
||||||
method: isHttpProtocol.value ? requestVModel.value.method : requestVModel.value.protocol,
|
method: isHttpProtocol.value ? requestVModel.value.method : requestVModel.value.protocol,
|
||||||
name: requestVModel.value.name,
|
name: requestVModel.value.stepName || requestVModel.value.name,
|
||||||
unSaved: requestVModel.value.unSaved,
|
unSaved: requestVModel.value.unSaved,
|
||||||
customizeRequest: requestVModel.value.customizeRequest,
|
customizeRequest: requestVModel.value.customizeRequest,
|
||||||
customizeRequestEnvEnable: requestVModel.value.customizeRequestEnvEnable,
|
customizeRequestEnvEnable: requestVModel.value.customizeRequestEnvEnable,
|
||||||
|
@ -1232,6 +1236,7 @@
|
||||||
unSaved: false,
|
unSaved: false,
|
||||||
isNew: false,
|
isNew: false,
|
||||||
label: res.name,
|
label: res.name,
|
||||||
|
stepName: props.step?.name || res.name,
|
||||||
...res.request,
|
...res.request,
|
||||||
...res,
|
...res,
|
||||||
response: cloneDeep(defaultResponse),
|
response: cloneDeep(defaultResponse),
|
||||||
|
@ -1316,6 +1321,7 @@
|
||||||
...defaultApiParams,
|
...defaultApiParams,
|
||||||
...props.request,
|
...props.request,
|
||||||
name: props.step?.name || props.request.name,
|
name: props.step?.name || props.request.name,
|
||||||
|
stepName: props.step?.name || props.request.name,
|
||||||
url: props.request.path, // 后台字段是 path
|
url: props.request.path, // 后台字段是 path
|
||||||
activeTab: contentTabList.value[0].value,
|
activeTab: contentTabList.value[0].value,
|
||||||
responseActiveTab: ResponseComposition.BODY,
|
responseActiveTab: ResponseComposition.BODY,
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
</div>
|
</div>
|
||||||
<stepType v-if="activeStep?.stepType" :step="activeStep" class="mr-[4px]" />
|
<stepType v-if="activeStep?.stepType" :step="activeStep" class="mr-[4px]" />
|
||||||
<a-input
|
<a-input
|
||||||
v-if="activeStep?.name"
|
|
||||||
v-show="isShowEditStepNameInput"
|
v-show="isShowEditStepNameInput"
|
||||||
ref="stepNameInputRef"
|
ref="stepNameInputRef"
|
||||||
v-model:model-value="activeStep.name"
|
v-model:model-value="requestVModel.stepName"
|
||||||
class="flex-1"
|
class="flex-1"
|
||||||
:placeholder="t('apiScenario.pleaseInputStepName')"
|
:placeholder="t('apiScenario.pleaseInputStepName')"
|
||||||
:max-length="255"
|
:max-length="255"
|
||||||
|
@ -367,6 +366,7 @@
|
||||||
const defaultApiParams: RequestParam = {
|
const defaultApiParams: RequestParam = {
|
||||||
label: '',
|
label: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
stepName: '',
|
||||||
type: 'api',
|
type: 'api',
|
||||||
stepId: '',
|
stepId: '',
|
||||||
resourceId: '',
|
resourceId: '',
|
||||||
|
@ -493,6 +493,9 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function updateStepName() {
|
function updateStepName() {
|
||||||
|
if (requestVModel.value.stepName === '') {
|
||||||
|
requestVModel.value.stepName = requestVModel.value.name;
|
||||||
|
}
|
||||||
isShowEditStepNameInput.value = false;
|
isShowEditStepNameInput.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -900,6 +903,7 @@
|
||||||
protocol: requestVModel.value.protocol,
|
protocol: requestVModel.value.protocol,
|
||||||
method: isHttpProtocol.value ? requestVModel.value.method : requestVModel.value.protocol,
|
method: isHttpProtocol.value ? requestVModel.value.method : requestVModel.value.protocol,
|
||||||
name: requestVModel.value.name,
|
name: requestVModel.value.name,
|
||||||
|
stepName: requestVModel.value.stepName,
|
||||||
customizeRequestEnvEnable: requestVModel.value.customizeRequestEnvEnable,
|
customizeRequestEnvEnable: requestVModel.value.customizeRequestEnvEnable,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -1056,6 +1060,7 @@
|
||||||
...res,
|
...res,
|
||||||
response: cloneDeep(defaultResponse),
|
response: cloneDeep(defaultResponse),
|
||||||
url: res.path,
|
url: res.path,
|
||||||
|
stepName: activeStep.value?.name || res.name,
|
||||||
name: res.name, // request里面还有个name但是是null
|
name: res.name, // request里面还有个name但是是null
|
||||||
resourceId: res.id,
|
resourceId: res.id,
|
||||||
stepId: activeStep.value?.uniqueId || '',
|
stepId: activeStep.value?.uniqueId || '',
|
||||||
|
@ -1104,6 +1109,7 @@
|
||||||
...props.request,
|
...props.request,
|
||||||
isNew: false,
|
isNew: false,
|
||||||
stepId: activeStep.value?.uniqueId || '',
|
stepId: activeStep.value?.uniqueId || '',
|
||||||
|
stepName: activeStep.value?.name || props.request?.name || '',
|
||||||
});
|
});
|
||||||
if (isQuote.value || isCopyNeedInit.value) {
|
if (isQuote.value || isCopyNeedInit.value) {
|
||||||
// 引用时,需要初始化引用的详情;复制只在第一次初始化的时候需要加载后台数据(request.request是复制请求时列表参数字段request会为 null,以此判断释放第一次初始化)
|
// 引用时,需要初始化引用的详情;复制只在第一次初始化的时候需要加载后台数据(request.request是复制请求时列表参数字段request会为 null,以此判断释放第一次初始化)
|
||||||
|
|
|
@ -1538,7 +1538,7 @@
|
||||||
handleCreateStep(
|
handleCreateStep(
|
||||||
{
|
{
|
||||||
stepType: ScenarioStepType.CUSTOM_REQUEST,
|
stepType: ScenarioStepType.CUSTOM_REQUEST,
|
||||||
name: request.name || t('apiScenario.customApi'),
|
name: request.stepName || request.name || t('apiScenario.customApi'),
|
||||||
config: {
|
config: {
|
||||||
protocol: request.protocol,
|
protocol: request.protocol,
|
||||||
method: request.method,
|
method: request.method,
|
||||||
|
@ -1601,7 +1601,7 @@
|
||||||
...activeStep.value.config,
|
...activeStep.value.config,
|
||||||
method: request.method,
|
method: request.method,
|
||||||
};
|
};
|
||||||
activeStep.value.name = request.name;
|
activeStep.value.name = request.stepName || request.name;
|
||||||
emit('updateResource', request.uploadFileIds, request.linkFileIds);
|
emit('updateResource', request.uploadFileIds, request.linkFileIds);
|
||||||
activeStep.value = undefined;
|
activeStep.value = undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue