refactor(项目设置): mock环境禁止修改
This commit is contained in:
parent
843a4c9186
commit
ac0e994a41
|
@ -1,6 +1,7 @@
|
|||
import { ExecuteConditionProcessor } from '../apiTest/common';
|
||||
|
||||
export interface EnvListItem {
|
||||
mock?: boolean;
|
||||
name: string;
|
||||
id: string;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<a-divider
|
||||
:margin="0"
|
||||
:class="{
|
||||
'!mb-[16px]': activeKey === 'pre' || activeKey === 'post' ? false : true,
|
||||
'!mb-[16px]': !(activeKey === 'pre' || activeKey === 'post'),
|
||||
}"
|
||||
/>
|
||||
<div class="content">
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
}}</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-between">
|
||||
<a-button type="outline" @click="handleAddHttp">{{ t('project.environmental.addHttp') }}</a-button>
|
||||
<a-button :disabled="store.currentEnvDetailInfo.mock" type="outline" @click="handleAddHttp">{{
|
||||
t('project.environmental.addHttp')
|
||||
}}</a-button>
|
||||
<div class="flex flex-row gap-[8px]">
|
||||
<a-input-number v-model:model-value="form.requestTimeout" class="w-[180px]">
|
||||
<template #prefix>
|
||||
|
@ -39,7 +41,7 @@
|
|||
</a-tooltip>
|
||||
</template>
|
||||
<template #operation="{ record }">
|
||||
<div class="flex flex-row flex-nowrap items-center">
|
||||
<div v-show="!store.currentEnvDetailInfo.mock" class="flex flex-row flex-nowrap items-center">
|
||||
<MsButton class="!mr-0" @click="handleCopy(record)">{{ t('common.copy') }}</MsButton>
|
||||
<a-divider class="h-[16px]" direction="vertical" />
|
||||
<MsButton class="!mr-0" @click="handleEdit(record)">{{ t('common.edit') }}</MsButton>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
/>
|
||||
</MsButton>
|
||||
<MsMoreAction
|
||||
:list="envMoreAction"
|
||||
:list="envMoreAction(element.mock || false)"
|
||||
@select="
|
||||
(value) => handleMoreAction(value, element.id, EnvAuthTypeEnum.ENVIRONMENT_PARAM)
|
||||
"
|
||||
|
@ -273,7 +273,8 @@
|
|||
});
|
||||
|
||||
// 默认环境MoreAction
|
||||
const envMoreAction: ActionsItem[] = [
|
||||
const envMoreAction = (isMock: boolean | undefined) => {
|
||||
return [
|
||||
{
|
||||
label: t('common.export'),
|
||||
eventTag: 'export',
|
||||
|
@ -285,8 +286,10 @@
|
|||
label: t('common.delete'),
|
||||
danger: true,
|
||||
eventTag: 'delete',
|
||||
disabled: isMock,
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 全局参数/环境 MoreAction
|
||||
const allMoreAction: ActionsItem[] = [
|
||||
|
|
Loading…
Reference in New Issue