fix(功能用例): 修改缺陷管理&用例管理评论列表回复对象错误&筛选提示错误

This commit is contained in:
xinxin.wu 2024-04-22 19:11:52 +08:00 committed by Craftsman
parent ab359ae179
commit 2c486bafaf
12 changed files with 33 additions and 25 deletions

View File

@ -14,6 +14,7 @@
v-model:model-value="caseType" v-model:model-value="caseType"
class="ml-2 max-w-[100px]" class="ml-2 max-w-[100px]"
:placeholder="t('caseManagement.featureCase.PleaseSelect')" :placeholder="t('caseManagement.featureCase.PleaseSelect')"
@change="changeCaseTypeHandler"
> >
<a-option v-for="item of props?.moduleOptions" :key="item.value" :value="item.value"> <a-option v-for="item of props?.moduleOptions" :key="item.value" :value="item.value">
{{ t(item.label) }} {{ t(item.label) }}
@ -672,17 +673,14 @@
} }
); );
// function changeCaseTypeHandler(
watch( value: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[]
() => caseType.value, ) {
(val) => { caseType.value = value as keyof typeof CaseLinkEnum;
if (val) { emit('update:currentSelectCase', caseType.value);
emit('update:currentSelectCase', val);
initModules(); initModules();
searchCase(); searchCase();
} }
}
);
watch( watch(
() => innerProject.value, () => innerProject.value,

View File

@ -36,11 +36,12 @@ export default defineComponent({
}, },
setup(props, { emit }) { setup(props, { emit }) {
const { commentList, disabled, uploadImage, previewUrl } = toRefs(props); const { commentList, disabled, uploadImage, previewUrl } = toRefs(props);
const currentItem = reactive<{ id: string; commentType: CommentType; commentStatus: string }>({ const currentItem = reactive<{ id: string; commentType: CommentType; commentStatus: string; replyId: string }>({
id: '', id: '',
commentType: 'ADD', commentType: 'ADD',
// 控制回复编辑删除按钮的状态 // 控制回复编辑删除按钮的状态
commentStatus: 'normal', commentStatus: 'normal',
replyId: '', // 回复人
}); });
const expendedIds = ref<string[]>([]); // 展开的评论id const expendedIds = ref<string[]>([]); // 展开的评论id
// 被@的用户id // 被@的用户id
@ -75,7 +76,7 @@ export default defineComponent({
commentType: currentItem.commentType, commentType: currentItem.commentType,
fetchType: currentItem.commentType === 'EDIT' ? 'UPDATE' : 'ADD', fetchType: currentItem.commentType === 'EDIT' ? 'UPDATE' : 'ADD',
notifier: noticeUserIds.value.join(';'), notifier: noticeUserIds.value.join(';'),
replyUser: item.createUser, replyUser: currentItem.replyId || item.createUser,
parentId, parentId,
}; };
if (currentItem.commentType === 'EDIT') { if (currentItem.commentType === 'EDIT') {
@ -106,12 +107,14 @@ export default defineComponent({
}; };
const handleReply = (item: CommentItem) => { const handleReply = (item: CommentItem) => {
currentItem.replyId = '';
if (item.childComments && Array.isArray(item.childComments)) { if (item.childComments && Array.isArray(item.childComments)) {
// 点击的是父级评论的回复 // 点击的是父级评论的回复
currentItem.id = item.id; currentItem.id = item.id;
} else { } else {
// 子级评论 // 子级评论
currentItem.id = item.parentId || ''; currentItem.id = item.parentId || '';
currentItem.replyId = item.createUser;
} }
currentItem.commentType = 'REPLY'; currentItem.commentType = 'REPLY';
}; };

View File

@ -135,6 +135,7 @@
v-model:status-filters="createUserFilters" v-model:status-filters="createUserFilters"
:title="(columnConfig.title as string)" :title="(columnConfig.title as string)"
:list="memberOptions" :list="memberOptions"
label-key="label"
@search="loadApiList(false)" @search="loadApiList(false)"
> >
<template #item="{ item }"> <template #item="{ item }">

View File

@ -150,6 +150,7 @@
v-model:status-filters="createUserFilters" v-model:status-filters="createUserFilters"
:title="(columnConfig.title as string)" :title="(columnConfig.title as string)"
:list="memberOptions" :list="memberOptions"
label-key="label"
@search="loadCaseList" @search="loadCaseList"
> >
<template #item="{ item }"> <template #item="{ item }">

View File

@ -58,7 +58,7 @@
:extra-text="getExecuteStatusExtraText(step)" :extra-text="getExecuteStatusExtraText(step)"
size="small" size="small"
class="ml-[4px]" class="ml-[4px]"
/> />-{{ props.finalExecuteStatus }}
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View File

@ -52,7 +52,7 @@
<span type="text" class="one-line-text cursor-pointer px-0 text-[rgb(var(--primary-5))]">{{ record.num }}</span> <span type="text" class="one-line-text cursor-pointer px-0 text-[rgb(var(--primary-5))]">{{ record.num }}</span>
</template> </template>
<template #name="{ record }"> <template #name="{ record }">
<div type="text">{{ characterLimit(record.name) }}</div> <div class="one-line-text">{{ characterLimit(record.name) }}</div>
</template> </template>
<template #caseLevel="{ record }"> <template #caseLevel="{ record }">
<a-select <a-select
@ -136,6 +136,7 @@
v-model:status-filters="updateUserFilters" v-model:status-filters="updateUserFilters"
:title="(columnConfig.title as string)" :title="(columnConfig.title as string)"
:list="memberOptions" :list="memberOptions"
label-key="label"
@search="initData()" @search="initData()"
> >
<template #item="{ item }"> <template #item="{ item }">
@ -149,6 +150,7 @@
v-model:status-filters="createUserFilters" v-model:status-filters="createUserFilters"
:title="(columnConfig.title as string)" :title="(columnConfig.title as string)"
:list="memberOptions" :list="memberOptions"
label-key="label"
@search="initData()" @search="initData()"
> >
<template #item="{ item }"> <template #item="{ item }">
@ -241,7 +243,7 @@
> >
<template #tree-slot-title="node"> <template #tree-slot-title="node">
<a-tooltip :content="`${node.name}`" position="tl"> <a-tooltip :content="`${node.name}`" position="tl">
<div class="one-line-text w-[300px] text-[var(--color-text-1)]">{{ node.name }}</div> <div class="one-line-text text-[var(--color-text-1)]">{{ node.name }}</div>
</a-tooltip> </a-tooltip>
</template> </template>
</a-tree-select> </a-tree-select>
@ -567,7 +569,7 @@
'title': 'caseManagement.featureCase.tableColumnID', 'title': 'caseManagement.featureCase.tableColumnID',
'slotName': 'num', 'slotName': 'num',
'dataIndex': 'num', 'dataIndex': 'num',
'width': 200, 'width': 130,
'showInTable': true, 'showInTable': true,
'sortable': { 'sortable': {
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
@ -585,7 +587,7 @@
dataIndex: 'name', dataIndex: 'name',
showInTable: true, showInTable: true,
showTooltip: true, showTooltip: true,
width: 300, width: 180,
editType: hasAnyPermission(['FUNCTIONAL_CASE:READ+UPDATE']) ? ColumnEditTypeEnum.INPUT : undefined, editType: hasAnyPermission(['FUNCTIONAL_CASE:READ+UPDATE']) ? ColumnEditTypeEnum.INPUT : undefined,
sortable: { sortable: {
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
@ -601,7 +603,7 @@
dataIndex: 'caseLevel', dataIndex: 'caseLevel',
titleSlotName: 'caseLevelFilter', titleSlotName: 'caseLevelFilter',
showInTable: true, showInTable: true,
width: 200, width: 150,
showDrag: true, showDrag: true,
}, },
{ {
@ -610,7 +612,7 @@
slotName: 'reviewStatus', slotName: 'reviewStatus',
titleSlotName: 'reviewStatusFilter', titleSlotName: 'reviewStatusFilter',
showInTable: true, showInTable: true,
width: 200, width: 150,
showDrag: true, showDrag: true,
}, },
{ {
@ -619,7 +621,7 @@
slotName: 'lastExecuteResult', slotName: 'lastExecuteResult',
titleSlotName: 'executeResultFilter', titleSlotName: 'executeResultFilter',
showInTable: true, showInTable: true,
width: 200, width: 150,
showDrag: true, showDrag: true,
}, },
// { // {
@ -636,7 +638,7 @@
slotName: 'moduleId', slotName: 'moduleId',
dataIndex: 'moduleId', dataIndex: 'moduleId',
showInTable: true, showInTable: true,
width: 300, width: 200,
showDrag: true, showDrag: true,
}, },
{ {

View File

@ -384,7 +384,7 @@
caseTree.value = mapTree<ModuleTreeNode>(caseTree.value, (node) => { caseTree.value = mapTree<ModuleTreeNode>(caseTree.value, (node) => {
return { return {
...node, ...node,
hideMoreAction: props.isModal, hideMoreAction: node.id === 'root' || props.isModal,
count: obj?.[node.id] || 0, count: obj?.[node.id] || 0,
}; };
}); });

View File

@ -83,7 +83,7 @@
<span class="text-[var(--color-text-4)]"> ({{ recycleModulesCount[activeFolder] || 0 }})</span> <span class="text-[var(--color-text-4)]"> ({{ recycleModulesCount[activeFolder] || 0 }})</span>
</div> </div>
<template #content> <template #content>
<div class="text-[14px] font-medium text-[var(--color-text-1)]"> <div class="max-w-[400px] text-[14px] font-medium text-[var(--color-text-1)]">
{{ moduleNamePath }} {{ moduleNamePath }}
<span class="text-[var(--color-text-4)]">({{ recycleModulesCount[activeFolder] || 0 }})</span> <span class="text-[var(--color-text-4)]">({{ recycleModulesCount[activeFolder] || 0 }})</span>
</div> </div>

View File

@ -26,7 +26,7 @@
:mouse-enter-delay="300" :mouse-enter-delay="300"
:disabled="!item[props.labelKey || 'text']" :disabled="!item[props.labelKey || 'text']"
> >
<div class="one-line-text"> <div class="one-line-text max-w-[120px]">
<slot name="item" :item="item" :index="index"></slot> <slot name="item" :item="item" :index="index"></slot>
</div> </div>
</a-tooltip> </a-tooltip>

View File

@ -155,6 +155,7 @@
async function okHandler() { async function okHandler() {
if (validateKeyWord.value.trim() !== '' && validateKeyWord.value !== orgName.value) { if (validateKeyWord.value.trim() !== '' && validateKeyWord.value !== orgName.value) {
Message.success(t('system.orgTemplate.orgNameTip'));
return false; return false;
} }
try { try {

View File

@ -211,4 +211,5 @@ export default {
'system.orgTemplate.pleaseEnterAPITip': 'Please enter the field API', 'system.orgTemplate.pleaseEnterAPITip': 'Please enter the field API',
'system.orgTemplate.apiFieldNotEmpty': 'The field API cannot be empty', 'system.orgTemplate.apiFieldNotEmpty': 'The field API cannot be empty',
'system.orgTemplate.selectThirdPlatType': 'Please select the third party platform', 'system.orgTemplate.selectThirdPlatType': 'Please select the third party platform',
'system.orgTemplate.orgNameTip': 'The organization name is incorrect',
}; };

View File

@ -200,4 +200,5 @@ export default {
'system.orgTemplate.pleaseEnterAPITip': '请输入字段API', 'system.orgTemplate.pleaseEnterAPITip': '请输入字段API',
'system.orgTemplate.apiFieldNotEmpty': '字段 API 不能为空', 'system.orgTemplate.apiFieldNotEmpty': '字段 API 不能为空',
'system.orgTemplate.selectThirdPlatType': '请选择三方平台', 'system.orgTemplate.selectThirdPlatType': '请选择三方平台',
'system.orgTemplate.orgNameTip': '组织名称不正确',
}; };