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