fix(用例管理): 修复增加需求未校验需求URL以及部分权限问题
--bug=1036101 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036101 --bug=1037142 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037142 --bug=1037145 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037145
This commit is contained in:
parent
435e1c193d
commit
dac0d93608
|
@ -76,7 +76,7 @@ public class FunctionalCaseDemandController {
|
||||||
|
|
||||||
@PostMapping("/third/list/page")
|
@PostMapping("/third/list/page")
|
||||||
@Operation(summary = "用例管理-功能用例-关联需求-获取三方需求列表")
|
@Operation(summary = "用例管理-功能用例-关联需求-获取三方需求列表")
|
||||||
@RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR)
|
@RequiresPermissions(value = {PermissionConstants.FUNCTIONAL_CASE_READ, PermissionConstants.FUNCTIONAL_CASE_READ_ADD, PermissionConstants.FUNCTIONAL_CASE_READ_UPDATE, PermissionConstants.FUNCTIONAL_CASE_READ_DELETE}, logical = Logical.OR)
|
||||||
public PluginPager<PlatformDemandDTO> pageDemand(@RequestBody @Validated FunctionalThirdDemandPageRequest request) {
|
public PluginPager<PlatformDemandDTO> pageDemand(@RequestBody @Validated FunctionalThirdDemandPageRequest request) {
|
||||||
return functionalCaseDemandService.pageDemand(request);
|
return functionalCaseDemandService.pageDemand(request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useModal from '@/hooks/useModal';
|
import useModal from '@/hooks/useModal';
|
||||||
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
import useFeatureCaseStore from '@/store/modules/case/featureCase';
|
||||||
|
import { hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||||
|
|
||||||
|
@ -119,6 +120,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getAllCommentList() {
|
async function getAllCommentList() {
|
||||||
|
if (hasAnyPermission(['FUNCTIONAL_CASE:READ+COMMENT'])) {
|
||||||
switch (activeComment.value) {
|
switch (activeComment.value) {
|
||||||
case 'caseComment':
|
case 'caseComment':
|
||||||
await initCommentList();
|
await initCommentList();
|
||||||
|
@ -135,6 +137,9 @@
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Message.error(t('common.noPermission'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加或者更新评论
|
// 添加或者更新评论
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<span> {{ characterLimit(title) }}</span>
|
<span> {{ characterLimit(title) }}</span>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="form">
|
<div class="form">
|
||||||
<a-form ref="demandFormRef" :model="modelForm" size="large" layout="vertical">
|
<a-form ref="demandFormRef" :model="modelForm" size="large" layout="vertical">
|
||||||
<a-form-item :label="t('caseManagement.featureCase.tableColumnID')" asterisk-position="end" field="demandId">
|
<a-form-item :label="t('caseManagement.featureCase.tableColumnID')" asterisk-position="end" field="demandId">
|
||||||
|
@ -33,7 +34,26 @@
|
||||||
:placeholder="t('caseManagement.featureCase.pleaseEnterTitle')"
|
:placeholder="t('caseManagement.featureCase.pleaseEnterTitle')"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label="t('caseManagement.featureCase.requirementUrl')" asterisk-position="end" field="demandUrl">
|
<a-form-item
|
||||||
|
:label="t('caseManagement.featureCase.requirementUrl')"
|
||||||
|
asterisk-position="end"
|
||||||
|
field="demandUrl"
|
||||||
|
:rules="[
|
||||||
|
{
|
||||||
|
validator(value, cb) {
|
||||||
|
if (value) {
|
||||||
|
if (regexUrl.test(value)) {
|
||||||
|
return cb();
|
||||||
|
} else {
|
||||||
|
return cb(t('caseManagement.featureCase.pleaseEnterCorrectURLFormat'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="modelForm.demandUrl"
|
v-model="modelForm.demandUrl"
|
||||||
:max-length="255"
|
:max-length="255"
|
||||||
|
@ -54,11 +74,11 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { FormInstance, Message, ValidatedError } from '@arco-design/web-vue';
|
import { FormInstance, ValidatedError } from '@arco-design/web-vue';
|
||||||
|
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import { characterLimit } from '@/utils';
|
import { characterLimit, regexUrl } from '@/utils';
|
||||||
|
|
||||||
import type { CreateOrUpdateDemand, DemandFormList, DemandItem } from '@/models/caseManagement/featureCase';
|
import type { CreateOrUpdateDemand, DemandFormList, DemandItem } from '@/models/caseManagement/featureCase';
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,20 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-4 flex items-center justify-between">
|
<div class="mb-4 flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<a-button v-if="platformInfo.platform_key" type="primary" @click="associatedDemand">
|
<a-button
|
||||||
|
v-if="platformInfo.platform_key"
|
||||||
|
v-permission="['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+UPDATE', 'FUNCTIONAL_CASE:READ+DELETE']"
|
||||||
|
type="primary"
|
||||||
|
@click="associatedDemand"
|
||||||
|
>
|
||||||
{{ t('caseManagement.featureCase.associatedDemand') }}</a-button
|
{{ t('caseManagement.featureCase.associatedDemand') }}</a-button
|
||||||
>
|
>
|
||||||
<a-button class="mx-3" type="outline" @click="addDemand">
|
<a-button
|
||||||
|
v-permission="['FUNCTIONAL_CASE:READ+ADD', 'FUNCTIONAL_CASE:READ+UPDATE', 'FUNCTIONAL_CASE:READ+DELETE']"
|
||||||
|
class="mx-3"
|
||||||
|
type="outline"
|
||||||
|
@click="addDemand"
|
||||||
|
>
|
||||||
{{ t('caseManagement.featureCase.addDemand') }}</a-button
|
{{ t('caseManagement.featureCase.addDemand') }}</a-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,10 +2,16 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-4 flex items-center justify-between">
|
<div class="mb-4 flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<a-button v-if="showType === 'preposition'" class="mr-3" type="primary" @click="addCase">
|
<a-button
|
||||||
|
v-if="showType === 'preposition'"
|
||||||
|
v-permission="['FUNCTIONAL_CASE:READ+UPDATE']"
|
||||||
|
class="mr-3"
|
||||||
|
type="primary"
|
||||||
|
@click="addCase"
|
||||||
|
>
|
||||||
{{ t('caseManagement.featureCase.addPresetCase') }}
|
{{ t('caseManagement.featureCase.addPresetCase') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-else type="primary" @click="addCase">
|
<a-button v-else v-permission="['FUNCTIONAL_CASE:READ+UPDATE']" type="primary" @click="addCase">
|
||||||
{{ t('caseManagement.featureCase.addPostCase') }}
|
{{ t('caseManagement.featureCase.addPostCase') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -156,6 +156,7 @@ export default {
|
||||||
'caseManagement.featureCase.pleaseEnterTitle': 'Please enter a requirement title',
|
'caseManagement.featureCase.pleaseEnterTitle': 'Please enter a requirement title',
|
||||||
'caseManagement.featureCase.requirementUrl': 'Demand url',
|
'caseManagement.featureCase.requirementUrl': 'Demand url',
|
||||||
'caseManagement.featureCase.pleaseEnterRequirementUrl': 'Please input requirements url',
|
'caseManagement.featureCase.pleaseEnterRequirementUrl': 'Please input requirements url',
|
||||||
|
'caseManagement.featureCase.pleaseEnterCorrectURLFormat': 'Please enter the correct URL format',
|
||||||
'caseManagement.featureCase.cancelAssociation': 'Cancel Association',
|
'caseManagement.featureCase.cancelAssociation': 'Cancel Association',
|
||||||
'caseManagement.featureCase.caseDetailTitle': '【{id}】{name}',
|
'caseManagement.featureCase.caseDetailTitle': '【{id}】{name}',
|
||||||
'caseManagement.featureCase.share': 'share',
|
'caseManagement.featureCase.share': 'share',
|
||||||
|
|
|
@ -155,6 +155,7 @@ export default {
|
||||||
'caseManagement.featureCase.pleaseEnterTitle': '请输入需求标题',
|
'caseManagement.featureCase.pleaseEnterTitle': '请输入需求标题',
|
||||||
'caseManagement.featureCase.requirementUrl': '需求地址',
|
'caseManagement.featureCase.requirementUrl': '需求地址',
|
||||||
'caseManagement.featureCase.pleaseEnterRequirementUrl': '请输入需求地址',
|
'caseManagement.featureCase.pleaseEnterRequirementUrl': '请输入需求地址',
|
||||||
|
'caseManagement.featureCase.pleaseEnterCorrectURLFormat': '请输入正确的URL格式',
|
||||||
'caseManagement.featureCase.cancelAssociation': '取消关联',
|
'caseManagement.featureCase.cancelAssociation': '取消关联',
|
||||||
'caseManagement.featureCase.caseDetailTitle': '【{id}】{name}',
|
'caseManagement.featureCase.caseDetailTitle': '【{id}】{name}',
|
||||||
'caseManagement.featureCase.share': '分享',
|
'caseManagement.featureCase.share': '分享',
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<MsIcon type="icon-icon_copy_outlined" class="mr-[8px]" />
|
<MsIcon type="icon-icon_copy_outlined" class="mr-[8px]" />
|
||||||
{{ t('common.copy') }}
|
{{ t('common.copy') }}
|
||||||
</MsButton>
|
</MsButton>
|
||||||
<MsButton type="button" status="default" :loading="followLoading" @click="toggleFollowReview">
|
<MsButton v-permission="['CASE_REVIEW:READ+UPDATE']" type="button" status="default" :loading="followLoading" @click="toggleFollowReview">
|
||||||
<MsIcon
|
<MsIcon
|
||||||
:type="reviewDetail.followFlag ? 'icon-icon_collect_filled' : 'icon-icon_collection_outlined'"
|
:type="reviewDetail.followFlag ? 'icon-icon_collect_filled' : 'icon-icon_collection_outlined'"
|
||||||
:class="`mr-[8px] ${reviewDetail.followFlag ? 'text-[rgb(var(--warning-6))]' : ''}`"
|
:class="`mr-[8px] ${reviewDetail.followFlag ? 'text-[rgb(var(--warning-6))]' : ''}`"
|
||||||
|
|
Loading…
Reference in New Issue