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