fix: 修复缺陷管理等bug

This commit is contained in:
xinxin.wu 2024-04-16 22:55:20 +08:00 committed by 刘瑞斌
parent 3a2adf5889
commit ec3cc8b8c0
9 changed files with 85 additions and 40 deletions

View File

@ -1,4 +1,6 @@
export interface BatchModel { import type { TableQueryParams } from '@/models/common';
export interface BatchModel extends TableQueryParams {
id?: string; id?: string;
organizationId?: string; organizationId?: string;
memberIds?: string[]; memberIds?: string[];

View File

@ -108,14 +108,11 @@
} }
} }
watch( watchEffect(() => {
() => props.showType, if (props.showType === 'Storage') {
(val) => { initRepositories();
if (val === 'Storage') {
initRepositories();
}
} }
); });
/** /**
* 初始化模块文件数量 * 初始化模块文件数量

View File

@ -776,6 +776,10 @@
.left-bug-detail { .left-bug-detail {
height: 88%; height: 88%;
} }
.tab-pane-container {
@apply flex-1 overflow-y-auto px-4;
.ms-scroll-bar();
}
//:deep(.w-full .arco-form-item-label) { //:deep(.w-full .arco-form-item-label) {
// display: inline-block; // display: inline-block;
// width: 100%; // width: 100%;

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="pr-4"> <div class="pl-2 pt-4">
<a-scrollbar <a-scrollbar
:style="{ :style="{
overflow: 'auto', overflow: 'auto',

View File

@ -1,8 +1,5 @@
<template> <template>
<MsCard <MsCard
:special-height="10"
no-content-padding
divider-has-p-x
has-breadcrumb has-breadcrumb
:title="title" :title="title"
:loading="loading" :loading="loading"
@ -22,7 +19,7 @@
</template> </template>
<a-form ref="formRef" :model="form" layout="vertical"> <a-form ref="formRef" :model="form" layout="vertical">
<div class="flex flex-row"> <div class="flex flex-row">
<div class="left mt-[16px] min-w-[732px] grow pl-[24px]"> <div class="left mt-[16px] min-w-[732px] grow">
<!-- 平台默认模板不展示缺陷名称, 描述 --> <!-- 平台默认模板不展示缺陷名称, 描述 -->
<a-form-item <a-form-item
v-if="!isPlatformDefaultTemplate" v-if="!isPlatformDefaultTemplate"

View File

@ -851,18 +851,6 @@
checkSyncStatus(); checkSyncStatus();
}); });
onMounted(() => {
setLoadListParams({ projectId: projectId.value });
setCurrentPlatform();
setExportOptionData();
initFilterOptions();
fetchData();
if (route.query.id) {
//
handleShowDetail(route.query.id as string, 0);
}
});
let customColumns: MsTableColumn = []; let customColumns: MsTableColumn = [];
async function getColumnHeaders() { async function getColumnHeaders() {
try { try {
@ -883,6 +871,19 @@
await getColumnHeaders(); await getColumnHeaders();
await tableStore.initColumn(TableKeyEnum.BUG_MANAGEMENT, columns.concat(customColumns), 'drawer'); await tableStore.initColumn(TableKeyEnum.BUG_MANAGEMENT, columns.concat(customColumns), 'drawer');
onMounted(() => {
setLoadListParams({ projectId: projectId.value });
setCurrentPlatform();
setExportOptionData();
initFilterOptions();
fetchData();
if (route.query.id) {
//
handleShowDetail(route.query.id as string, 0);
}
});
onUnmounted(() => { onUnmounted(() => {
// //
pause(); pause();

View File

@ -369,20 +369,6 @@
return customFieldToColumns(res); return customFieldToColumns(res);
}; };
const customColumns = await getCustomFieldColumns();
customColumns.forEach((item) => {
if (item.title === '严重程度' || item.title === 'Bug Degree') {
item.showInTable = true;
item.titleSlotName = 'severityFilter';
item.slotName = 'severity';
} else {
item.showInTable = false;
}
});
await tableStore.initColumn(TableKeyEnum.BUG_MANAGEMENT_RECYCLE, columns.concat(customColumns), 'drawer');
const { propsRes, propsEvent, loadList, setKeyword, setLoadListParams, setProps } = useTable( const { propsRes, propsEvent, loadList, setKeyword, setLoadListParams, setProps } = useTable(
getRecycleList, getRecycleList,
{ {
@ -534,6 +520,28 @@
statusFilterOptions.value = res.statusOption; statusFilterOptions.value = res.statusOption;
} }
let customColumns: MsTableColumn = [];
async function getColumnHeaders() {
try {
customColumns = await getCustomFieldColumns();
customColumns.forEach((item) => {
if (item.title === '严重程度' || item.title === 'Bug Degree') {
item.showInTable = true;
item.titleSlotName = 'severityFilter';
item.slotName = 'severity';
} else {
item.showInTable = false;
}
});
} catch (error) {
console.log(error);
}
}
await getColumnHeaders();
await tableStore.initColumn(TableKeyEnum.BUG_MANAGEMENT_RECYCLE, columns.concat(customColumns), 'drawer');
onMounted(() => { onMounted(() => {
setLoadListParams({ projectId: projectId.value }); setLoadListParams({ projectId: projectId.value });
initFilterOptions(); initFilterOptions();

View File

@ -258,13 +258,29 @@
const batchVisible = ref<boolean>(false); const batchVisible = ref<boolean>(false);
const batchAction = ref(''); const batchAction = ref('');
const batchModalRef = ref(); const batchModalRef = ref();
const batchParams = ref<BatchActionQueryParams>({
selectedIds: [],
selectAll: false,
excludeIds: [],
currentSelectCount: 0,
});
// //
const addUserGroup = async (target: string[]) => { const addUserGroup = async (target: string[]) => {
const { selectedIds, excludeIds, selectAll } = batchParams.value;
const params = { const params = {
projectId: lastProjectId.value, projectId: lastProjectId.value,
userIds: selectData.value, userIds: selectData.value,
roleIds: target, roleIds: target,
selectAll: !!selectAll,
excludeIds: excludeIds || [],
selectIds: selectedIds || [],
keyword: props.keyword,
condition: {
keyword: props.keyword,
filter: propsRes.value.filter,
combine: batchParams.value.condition,
},
}; };
try { try {
await batchModalRef.value.batchRequestFun(addProjectUserGroup, params); await batchModalRef.value.batchRequestFun(addProjectUserGroup, params);
@ -277,6 +293,7 @@
// //
const handleTableBatch = (event: BatchActionParams, params: BatchActionQueryParams) => { const handleTableBatch = (event: BatchActionParams, params: BatchActionQueryParams) => {
batchParams.value = params;
selectData.value = params.selectedIds; selectData.value = params.selectedIds;
if (event.eventTag === 'batchActionRemove') { if (event.eventTag === 'batchActionRemove') {
batchRemoveHandler(); batchRemoveHandler();

View File

@ -147,6 +147,7 @@
import { characterLimit, formatPhoneNumber } from '@/utils'; import { characterLimit, formatPhoneNumber } from '@/utils';
import { hasAnyPermission } from '@/utils/permission'; import { hasAnyPermission } from '@/utils/permission';
import type { TableQueryParams } from '@/models/common';
import type { AddOrUpdateMemberModel, BatchAddProjectModel, LinkList, MemberItem } from '@/models/setting/member'; import type { AddOrUpdateMemberModel, BatchAddProjectModel, LinkList, MemberItem } from '@/models/setting/member';
import { TableKeyEnum } from '@/enums/tableEnum'; import { TableKeyEnum } from '@/enums/tableEnum';
@ -313,13 +314,30 @@
]; ];
const batchAction = ref(''); const batchAction = ref('');
const batchParams = ref<BatchActionQueryParams>({
selectedIds: [],
selectAll: false,
excludeIds: [],
currentSelectCount: 0,
});
// //
const addProjectOrAddUserGroup = async (target: string[], type: string) => { const addProjectOrAddUserGroup = async (target: string[], type: string) => {
const currentType = batchList.find((item) => item.type === type); const currentType = batchList.find((item) => item.type === type);
const params: BatchAddProjectModel = {
const { selectedIds, excludeIds, selectAll } = batchParams.value;
const params: TableQueryParams = {
organizationId: lastOrganizationId.value, organizationId: lastOrganizationId.value,
memberIds: selectedData.value, memberIds: selectedData.value,
selectAll: !!selectAll,
excludeIds: excludeIds || [],
selectIds: selectedIds || [],
keyword: keyword.value,
condition: {
keyword: keyword.value,
filter: propsRes.value.filter,
combine: batchParams.value.condition,
},
}; };
if (type === 'project') { if (type === 'project') {
params.projectIds = target; params.projectIds = target;
@ -334,6 +352,7 @@
// //
const handleTableBatch = (event: BatchActionParams, params: BatchActionQueryParams) => { const handleTableBatch = (event: BatchActionParams, params: BatchActionQueryParams) => {
showBatchModal.value = true; showBatchModal.value = true;
batchParams.value = params;
selectedData.value = params.selectedIds; selectedData.value = params.selectedIds;
if (event.eventTag) batchAction.value = event.eventTag; if (event.eventTag) batchAction.value = event.eventTag;
if (event.eventTag === 'batchAddProject') getData(getProjectList); if (event.eventTag === 'batchAddProject') getData(getProjectList);