feat(接口测试): 接口用例参数变更权限补充
This commit is contained in:
parent
4ac754fb5a
commit
545077d397
|
@ -12,7 +12,9 @@
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex w-full items-center justify-between">
|
<div class="flex w-full items-center justify-between">
|
||||||
<div>{{ t('case.apiAndCaseDiff') }}</div>
|
<div>{{ t('case.apiAndCaseDiff') }}</div>
|
||||||
|
|
||||||
<div class="flex items-center text-[14px]">
|
<div class="flex items-center text-[14px]">
|
||||||
|
<div v-if="hasAnyPermission(['PROJECT_API_DEFINITION_CASE:READ+UPDATE'])" class="flex items-center">
|
||||||
<div v-if="showSyncConfig" class="-mt-[2px] mr-[8px]"> {{ t('case.syncItem') }}</div>
|
<div v-if="showSyncConfig" class="-mt-[2px] mr-[8px]"> {{ t('case.syncItem') }}</div>
|
||||||
<a-checkbox-group v-if="showSyncConfig" v-model="checkType">
|
<a-checkbox-group v-if="showSyncConfig" v-model="checkType">
|
||||||
<a-checkbox v-for="item of checkList" :key="item.value" :value="item.value">
|
<a-checkbox v-for="item of checkList" :key="item.value" :value="item.value">
|
||||||
|
@ -38,16 +40,26 @@
|
||||||
<div class="ml-[8px]">{{ t('case.ignoreAllChange') }}</div>
|
<div class="ml-[8px]">{{ t('case.ignoreAllChange') }}</div>
|
||||||
<a-divider direction="vertical" :margin="8"></a-divider>
|
<a-divider direction="vertical" :margin="8"></a-divider>
|
||||||
<a-switch v-if="showSyncConfig" v-model:model-value="form.deleteRedundantParam" size="small" />
|
<a-switch v-if="showSyncConfig" v-model:model-value="form.deleteRedundantParam" size="small" />
|
||||||
<div v-if="showSyncConfig" class="ml-[8px] font-normal text-[var(--color-text-1)]">{{
|
<div v-if="showSyncConfig" class="ml-[8px] font-normal text-[var(--color-text-1)]">
|
||||||
t('case.deleteNotCorrespondValue')
|
{{ t('case.deleteNotCorrespondValue') }}
|
||||||
}}</div>
|
</div>
|
||||||
<a-divider v-if="showSyncConfig" direction="vertical" :margin="0" class="!ml-[8px]" />
|
<a-divider v-if="showSyncConfig" direction="vertical" :margin="0" class="!ml-[8px]" />
|
||||||
|
</div>
|
||||||
<a-button class="mx-[12px]" type="secondary" @click="cancel">{{ t('common.cancel') }}</a-button>
|
<a-button class="mx-[12px]" type="secondary" @click="cancel">{{ t('common.cancel') }}</a-button>
|
||||||
<a-button v-if="showSyncConfig" class="mr-[12px]" type="outline" @click="clearThisChangeHandler">
|
<a-button
|
||||||
|
v-if="showSyncConfig && hasAnyPermission(['PROJECT_API_DEFINITION_CASE:READ+UPDATE'])"
|
||||||
|
class="mr-[12px]"
|
||||||
|
type="outline"
|
||||||
|
@click="clearThisChangeHandler"
|
||||||
|
>
|
||||||
{{ t('case.ignoreThisChange') }}
|
{{ t('case.ignoreThisChange') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" :loading="syncLoading" :disabled="!checkType.length" @click="confirmSync">
|
<a-button type="primary" :loading="syncLoading" :disabled="!checkType.length" @click="confirmSync">
|
||||||
{{ showSyncConfig ? t('case.apiSyncChange') : t('common.confirm') }}
|
{{
|
||||||
|
showSyncConfig && hasAnyPermission(['PROJECT_API_DEFINITION_CASE:READ+UPDATE'])
|
||||||
|
? t('case.apiSyncChange')
|
||||||
|
: t('common.confirm')
|
||||||
|
}}
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -113,6 +125,7 @@
|
||||||
ignoreEveryTimeChange,
|
ignoreEveryTimeChange,
|
||||||
} from '@/api/modules/api-test/management';
|
} from '@/api/modules/api-test/management';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
|
import { hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
import { EnableKeyValueParam, ExecuteRequestCommonParam } from '@/models/apiTest/common';
|
import { EnableKeyValueParam, ExecuteRequestCommonParam } from '@/models/apiTest/common';
|
||||||
import type { diffSyncParams, syncItem } from '@/models/apiTest/management';
|
import type { diffSyncParams, syncItem } from '@/models/apiTest/management';
|
||||||
|
@ -326,7 +339,11 @@
|
||||||
|
|
||||||
// 同步
|
// 同步
|
||||||
async function confirmSync() {
|
async function confirmSync() {
|
||||||
if (!caseDetail.value.inconsistentWithApi || form.value.ignoreApiChange) {
|
if (
|
||||||
|
!caseDetail.value.inconsistentWithApi ||
|
||||||
|
form.value.ignoreApiChange ||
|
||||||
|
!hasAnyPermission(['PROJECT_API_DEFINITION_CASE:READ+UPDATE'])
|
||||||
|
) {
|
||||||
cancel();
|
cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,10 +148,9 @@
|
||||||
if (hasOperationPermission.value) {
|
if (hasOperationPermission.value) {
|
||||||
return 250;
|
return 250;
|
||||||
}
|
}
|
||||||
if (hasAnyPermission(['SYSTEM_ORGANIZATION_PROJECT:READ+RECOVER'])) {
|
if (hasAnyPermission(['SYSTEM_ORGANIZATION_PROJECT:READ'])) {
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
return 50;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const organizationColumns: MsTableColumn = [
|
const organizationColumns: MsTableColumn = [
|
||||||
|
|
Loading…
Reference in New Issue