fix(项目管理): Mock环境禁止编辑

--bug=1037449 --user=宋昌昌 环境管理-mock环境不支持编辑和删除 https://www.tapd.cn/55049933/s/1482052
This commit is contained in:
song-cc-rock 2024-03-27 17:05:42 +08:00 committed by Craftsman
parent e5f660eb71
commit 76f342fd97
3 changed files with 5 additions and 4 deletions

View File

@ -12,7 +12,6 @@
<a-input <a-input
v-model="form.name" v-model="form.name"
:max-length="255" :max-length="255"
class="w-[732px]"
:placeholder="t('project.environmental.envNamePlaceholder')" :placeholder="t('project.environmental.envNamePlaceholder')"
@blur="store.currentEnvDetailInfo.name = form.name" @blur="store.currentEnvDetailInfo.name = form.name"
/> />

View File

@ -7,8 +7,8 @@
</div> </div>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<a-button <a-button
v-if="!store.currentEnvDetailInfo.mock"
v-permission="['PROJECT_ENVIRONMENT:READ+UPDATE']" v-permission="['PROJECT_ENVIRONMENT:READ+UPDATE']"
:disabled="store.currentEnvDetailInfo.mock"
type="outline" type="outline"
@click="handleAddHttp" @click="handleAddHttp"
>{{ t('project.environmental.addHttp') }}</a-button >{{ t('project.environmental.addHttp') }}</a-button
@ -50,7 +50,9 @@
t('common.copy') t('common.copy')
}}</MsButton> }}</MsButton>
<a-divider class="h-[16px]" direction="vertical" /> <a-divider class="h-[16px]" direction="vertical" />
<MsButton class="!mr-0" :disabled="isDisabled" @click="handleEdit(record)">{{ t('common.edit') }}</MsButton> <MsButton class="!mr-0" :disabled="isDisabled || store.currentEnvDetailInfo.mock" @click="handleEdit(record)">{{
t('common.edit')
}}</MsButton>
<a-divider class="h-[16px]" direction="vertical" /> <a-divider class="h-[16px]" direction="vertical" />
<MsTableMoreAction <MsTableMoreAction
v-permission="['PROJECT_ENVIRONMENT:READ+UPDATE']" v-permission="['PROJECT_ENVIRONMENT:READ+UPDATE']"
@ -92,7 +94,6 @@
import type { ModuleTreeNode } from '@/models/common'; import type { ModuleTreeNode } from '@/models/common';
import type { CommonParams } from '@/models/projectManagement/environmental'; import type { CommonParams } from '@/models/projectManagement/environmental';
import { HttpForm } from '@/models/projectManagement/environmental'; import { HttpForm } from '@/models/projectManagement/environmental';
import { TableKeyEnum } from '@/enums/tableEnum';
const appStore = useAppStore(); const appStore = useAppStore();
const { t } = useI18n(); const { t } = useI18n();

View File

@ -323,6 +323,7 @@
{ {
label: t('common.rename'), label: t('common.rename'),
eventTag: 'rename', eventTag: 'rename',
disabled: isMock,
permission: ['PROJECT_ENVIRONMENT:READ+UPDATE'], permission: ['PROJECT_ENVIRONMENT:READ+UPDATE'],
}, },
{ {