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

View File

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

View File

@ -58,6 +58,20 @@
<template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }"> <template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }">
<caseLevel :case-level="filterContent.text" /> <caseLevel :case-level="filterContent.text" />
</template> </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 }"> <template #num="{ record }">
<a-tooltip :content="record.num"> <a-tooltip :content="record.num">
<a-button type="text" class="px-0 !text-[14px] !leading-[22px]" @click="review(record)"> <a-button type="text" class="px-0 !text-[14px] !leading-[22px]" @click="review(record)">
@ -88,6 +102,12 @@
allow-search allow-search
:multiple="true" :multiple="true"
:placeholder="t('project.messageManagement.receiverPlaceholder')" :placeholder="t('project.messageManagement.receiverPlaceholder')"
:fallback-option="
(val) => ({
label: reviewersOptions.find((e) => e.value === val)?.label || (val as string),
value: val,
})
"
@change="() => changeReviewer(record)" @change="() => changeReviewer(record)"
> >
</MsSelect> </MsSelect>
@ -104,10 +124,22 @@
</div> </div>
</template> </template>
<template #action="{ record }"> <template #action="{ record }">
<MsButton v-permission="['CASE_REVIEW:READ+REVIEW']" type="text" class="!mr-0" @click="review(record)"> <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') }} {{ t('caseManagement.caseReview.review') }}
</MsButton> </MsButton>
<a-divider direction="vertical" :margin="8"></a-divider> </a-tooltip>
<a-divider
v-permission.all="['CASE_REVIEW:READ+REVIEW', 'CASE_REVIEW:READ+RELEVANCE']"
direction="vertical"
:margin="8"
></a-divider>
<MsPopconfirm <MsPopconfirm
:title="t('caseManagement.caseReview.disassociateTip')" :title="t('caseManagement.caseReview.disassociateTip')"
:sub-title-tip="t('caseManagement.caseReview.disassociateTipContent')" :sub-title-tip="t('caseManagement.caseReview.disassociateTipContent')"
@ -420,25 +452,26 @@
sorter: true, sorter: true,
}, },
showTooltip: true, showTooltip: true,
width: 200, width: 150,
}, },
{ {
title: 'caseManagement.featureCase.tableColumnLevel', title: 'caseManagement.featureCase.tableColumnLevel',
slotName: 'caseLevel', slotName: 'caseLevel',
dataIndex: 'caseLevel', dataIndex: 'caseLevel',
showInTable: true, showInTable: true,
width: 200,
showDrag: true, showDrag: true,
filterConfig: { filterConfig: {
options: caseLevelList.value, options: caseLevelList.value,
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL, filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL,
}, },
width: 100,
}, },
{ {
title: 'caseManagement.caseReview.reviewer', title: 'caseManagement.caseReview.reviewer',
dataIndex: 'reviewNames', dataIndex: 'reviewNames',
slotName: 'reviewNames', slotName: 'reviewNames',
showInTable: true, showInTable: true,
titleSlotName: 'reviewerTitle',
width: 150, width: 150,
}, },
{ {
@ -517,6 +550,10 @@
], ],
}; };
function userIsReviewer(record: ReviewCaseItem) {
return record.reviewers.some((e) => e === userStore.id);
}
const modulesCount = computed(() => caseReviewStore.modulesCount); const modulesCount = computed(() => caseReviewStore.modulesCount);
async function getModuleCount() { async function getModuleCount() {
let params: TableQueryParams; let params: TableQueryParams;
@ -557,8 +594,12 @@
getModuleCount(); getModuleCount();
} }
const reviewerTitlePopupVisible = ref(true);
onBeforeMount(() => { onBeforeMount(() => {
searchCase(); searchCase();
setTimeout(() => {
reviewerTitlePopupVisible.value = false;
}, 5000);
}); });
/** /**
@ -759,7 +800,7 @@
slotName: 'caseLevel', slotName: 'caseLevel',
dataIndex: 'caseLevel', dataIndex: 'caseLevel',
showInTable: true, showInTable: true,
width: 200, width: 100,
showDrag: true, showDrag: true,
filterConfig: { filterConfig: {
options: cloneDeep(caseLevelFields.value.options), 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.', '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': 'caseManagement.caseReview.reviewFormTip':
'Add the review results of the operator, and multiple reviewers must pass the review by all reviewers', '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.reviewSuccess.widthAdmin':
'提交成功! 您不是当前项目指定的评审人,系统只会记录您的评审,不影响最终评审结果', '提交成功! 您不是当前项目指定的评审人,系统只会记录您的评审,不影响最终评审结果',
'caseManagement.caseReview.reviewFormTip': '添加操作人的评审结果,多人评审需所有评审人评审通过', 'caseManagement.caseReview.reviewFormTip': '添加操作人的评审结果,多人评审需所有评审人评审通过',
'caseManagement.caseReview.reviewerTip': '如需评审用例,需要将用户添加为评审人;仅评审人的评审结果生效',
'caseManagement.caseReview.reviewDisabledTip': '非评审人不可评审,更改后可评审',
}; };

View File

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

View File

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