feat(用例评审): 评审人列提示&评审按钮提示

This commit is contained in:
baiqi 2024-07-10 17:56:08 +08:00 committed by 刘瑞斌
parent dbbc60c6a5
commit 8e38599b2b
7 changed files with 66 additions and 11 deletions

View File

@ -460,7 +460,7 @@ export default defineComponent(
placeholder={t(props.placeholder || '')}
allow-clear={allowClear.value}
allow-search={props.allowSearch}
filter-option={true}
filter-option={false}
loading={loading.value}
multiple={props.multiple}
max-tag-count={maxTagCount.value}
@ -472,6 +472,7 @@ export default defineComponent(
disabled={props.disabled}
size={props.size}
onChange={handleChange}
onBlur={emit('blur')}
onSearch={handleSearch}
onPopupVisibleChange={(val: boolean) => {
popupVisible.value = val;
@ -558,6 +559,7 @@ export default defineComponent(
'remove',
'change',
'changeObject',
'blur',
],
}
);

View File

@ -406,7 +406,7 @@
@change="handleSettingFormChange"
/>
</a-form-item>
<a-form-item :label="t('ms.json.schema.regex')">
<a-form-item v-if="activeRecord.type === 'string'" :label="t('ms.json.schema.regex')">
<a-input
v-model:model-value="activeRecord.regex"
:placeholder="t('ms.json.schema.regexPlaceholder', { reg: '/<title(.*?)</title>' })"

View File

@ -58,6 +58,20 @@
<template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }">
<caseLevel :case-level="filterContent.text" />
</template>
<template #reviewerTitle="{ columnConfig }">
<div class="flex items-center gap-[4px]">
<div class="text-[var(--color-text-3)]">{{ t(columnConfig.title as string) }}</div>
<a-tooltip
v-model:popupVisible="reviewerTitlePopupVisible"
:content="t('caseManagement.caseReview.reviewerTip')"
>
<icon-question-circle
class="text-[var(--color-text-brand)] hover:text-[rgb(var(--primary-5))]"
size="16"
/>
</a-tooltip>
</div>
</template>
<template #num="{ record }">
<a-tooltip :content="record.num">
<a-button type="text" class="px-0 !text-[14px] !leading-[22px]" @click="review(record)">
@ -88,6 +102,12 @@
allow-search
:multiple="true"
:placeholder="t('project.messageManagement.receiverPlaceholder')"
:fallback-option="
(val) => ({
label: reviewersOptions.find((e) => e.value === val)?.label || (val as string),
value: val,
})
"
@change="() => changeReviewer(record)"
>
</MsSelect>
@ -104,10 +124,22 @@
</div>
</template>
<template #action="{ record }">
<MsButton v-permission="['CASE_REVIEW:READ+REVIEW']" type="text" class="!mr-0" @click="review(record)">
{{ t('caseManagement.caseReview.review') }}
</MsButton>
<a-divider direction="vertical" :margin="8"></a-divider>
<a-tooltip :content="t('caseManagement.caseReview.reviewDisabledTip')" :disabled="userIsReviewer(record)">
<MsButton
v-permission="['CASE_REVIEW:READ+REVIEW']"
:disabled="!userIsReviewer(record)"
type="text"
class="!mr-0"
@click="review(record)"
>
{{ t('caseManagement.caseReview.review') }}
</MsButton>
</a-tooltip>
<a-divider
v-permission.all="['CASE_REVIEW:READ+REVIEW', 'CASE_REVIEW:READ+RELEVANCE']"
direction="vertical"
:margin="8"
></a-divider>
<MsPopconfirm
:title="t('caseManagement.caseReview.disassociateTip')"
:sub-title-tip="t('caseManagement.caseReview.disassociateTipContent')"
@ -420,25 +452,26 @@
sorter: true,
},
showTooltip: true,
width: 200,
width: 150,
},
{
title: 'caseManagement.featureCase.tableColumnLevel',
slotName: 'caseLevel',
dataIndex: 'caseLevel',
showInTable: true,
width: 200,
showDrag: true,
filterConfig: {
options: caseLevelList.value,
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL,
},
width: 100,
},
{
title: 'caseManagement.caseReview.reviewer',
dataIndex: 'reviewNames',
slotName: 'reviewNames',
showInTable: true,
titleSlotName: 'reviewerTitle',
width: 150,
},
{
@ -517,6 +550,10 @@
],
};
function userIsReviewer(record: ReviewCaseItem) {
return record.reviewers.some((e) => e === userStore.id);
}
const modulesCount = computed(() => caseReviewStore.modulesCount);
async function getModuleCount() {
let params: TableQueryParams;
@ -557,8 +594,12 @@
getModuleCount();
}
const reviewerTitlePopupVisible = ref(true);
onBeforeMount(() => {
searchCase();
setTimeout(() => {
reviewerTitlePopupVisible.value = false;
}, 5000);
});
/**
@ -759,7 +800,7 @@
slotName: 'caseLevel',
dataIndex: 'caseLevel',
showInTable: true,
width: 200,
width: 100,
showDrag: true,
filterConfig: {
options: cloneDeep(caseLevelFields.value.options),

View File

@ -138,4 +138,7 @@ export default {
'Submitted successfully! You are not the designated reviewer for the current project. The system will only record your review and will not affect the final review result.',
'caseManagement.caseReview.reviewFormTip':
'Add the review results of the operator, and multiple reviewers must pass the review by all reviewers',
'caseManagement.caseReview.reviewerTip':
"If you need to review use cases, you need to add the user as a reviewer; only the reviewer's review results take effect.",
'caseManagement.caseReview.reviewDisabledTip': 'Non-reviewers cannot review, but can review after modification',
};

View File

@ -136,4 +136,6 @@ export default {
'caseManagement.caseReview.reviewSuccess.widthAdmin':
'提交成功! 您不是当前项目指定的评审人,系统只会记录您的评审,不影响最终评审结果',
'caseManagement.caseReview.reviewFormTip': '添加操作人的评审结果,多人评审需所有评审人评审通过',
'caseManagement.caseReview.reviewerTip': '如需评审用例,需要将用户添加为评审人;仅评审人的评审结果生效',
'caseManagement.caseReview.reviewDisabledTip': '非评审人不可评审,更改后可评审',
};

View File

@ -17,7 +17,11 @@
</div>
<ms-base-table v-bind="propsRes" no-disable v-on="propsEvent">
<template #name="{ record }">
<a-button type="text" class="w-full overflow-hidden px-0" @click="openAuthDetail(record.id)">
<a-button
type="text"
class="max-w-full justify-start overflow-hidden px-0"
@click="openAuthDetail(record.id)"
>
<div class="one-line-text">
{{ record.name }}
</div>
@ -790,6 +794,7 @@
Message.success(t('system.config.auth.deleteSuccess'));
loadList();
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
}
},
@ -1022,6 +1027,7 @@
typeof res.configuration === 'string' ? JSON.parse(res.configuration || '{}') : res.configuration,
};
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
drawerLoading.value = false;
@ -1196,6 +1202,7 @@
}
loadList();
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
} finally {
drawerLoading.value = false;

View File

@ -21,7 +21,7 @@
<a-button
type="text"
class="px-0"
:class="record.id === '100001100001' ? '' : 'w-full justify-start'"
:class="record.id === '100001100001' ? '' : 'max-w-full justify-start'"
@click="showPoolDetail(record.id)"
>
<div class="one-line-text">