fix(功能用例): 修改功能用例关联三方需求缺少id
This commit is contained in:
parent
9372b82e98
commit
2ee6833b96
|
@ -239,7 +239,6 @@ export function getThirdDemandList(data: TableQueryParams) {
|
||||||
|
|
||||||
// 上传文件并关联用例
|
// 上传文件并关联用例
|
||||||
export function uploadOrAssociationFile(data: Record<string, any>) {
|
export function uploadOrAssociationFile(data: Record<string, any>) {
|
||||||
debugger;
|
|
||||||
return MSR.uploadFile({ url: UploadOrAssociationFileUrl }, { request: data.request, fileList: data.file });
|
return MSR.uploadFile({ url: UploadOrAssociationFileUrl }, { request: data.request, fileList: data.file });
|
||||||
}
|
}
|
||||||
// 转存文件
|
// 转存文件
|
||||||
|
|
|
@ -320,6 +320,17 @@ export default function useTableProps<T>(
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const collectIds = (data, rowKey: string, selectedKeys: Set<string>) => {
|
||||||
|
data.forEach((item: any) => {
|
||||||
|
if (item[rowKey] && !selectedKeys.has(item[rowKey])) {
|
||||||
|
selectedKeys.add(item[rowKey]);
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
collectIds(item.children, rowKey, selectedKeys);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return selectedKeys;
|
||||||
|
};
|
||||||
|
|
||||||
// 获取表格请求参数
|
// 获取表格请求参数
|
||||||
const getTableQueryParams = () => {
|
const getTableQueryParams = () => {
|
||||||
|
@ -398,12 +409,7 @@ export default function useTableProps<T>(
|
||||||
resetSelector();
|
resetSelector();
|
||||||
} else {
|
} else {
|
||||||
resetSelector(false);
|
resetSelector(false);
|
||||||
data.forEach((item: Record<string, any>) => {
|
propsRes.value.selectedKeys = collectIds(data, rowKey, selectedKeys);
|
||||||
if (item[rowKey] && !selectedKeys.has(item[rowKey])) {
|
|
||||||
selectedKeys.add(item[rowKey]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
propsRes.value.selectedKeys = selectedKeys;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,7 @@ export interface DemandItem {
|
||||||
createUser: string;
|
createUser: string;
|
||||||
updateUser: string;
|
updateUser: string;
|
||||||
children: DemandItem[]; // 平台下对应的需求
|
children: DemandItem[]; // 平台下对应的需求
|
||||||
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平台需求列表
|
// 平台需求列表
|
||||||
|
|
|
@ -103,7 +103,6 @@
|
||||||
|
|
||||||
// 添加或者更新评论
|
// 添加或者更新评论
|
||||||
async function handleUpdateOrAdd(item: CommentParams, cb: (result: boolean) => void) {
|
async function handleUpdateOrAdd(item: CommentParams, cb: (result: boolean) => void) {
|
||||||
debugger;
|
|
||||||
try {
|
try {
|
||||||
if (item.id) {
|
if (item.id) {
|
||||||
await updateCommentList(item);
|
await updateCommentList(item);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
<template #operation="{ record }">
|
<template #operation="{ record }">
|
||||||
<MsButton v-if="record.demandPlatform !== pageConfig.platformName" @click="emit('update', record)">
|
<MsButton v-if="record.demandPlatform !== pageConfig.platformName" @click="emit('cancel', record)">
|
||||||
{{ t('caseManagement.featureCase.cancelAssociation') }}
|
{{ t('caseManagement.featureCase.cancelAssociation') }}
|
||||||
</MsButton>
|
</MsButton>
|
||||||
<MsButton v-if="record.demandPlatform === pageConfig.platformName" @click="emit('update', record)">
|
<MsButton v-if="record.demandPlatform === pageConfig.platformName" @click="emit('update', record)">
|
||||||
|
@ -65,6 +65,7 @@
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update', record: DemandItem): void;
|
(e: 'update', record: DemandItem): void;
|
||||||
(e: 'create'): void;
|
(e: 'create'): void;
|
||||||
|
(e: 'cancel', record: DemandItem): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const columns: MsTableColumn = [
|
const columns: MsTableColumn = [
|
||||||
|
@ -94,7 +95,7 @@
|
||||||
slotName: 'operation',
|
slotName: 'operation',
|
||||||
dataIndex: 'operation',
|
dataIndex: 'operation',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 300,
|
width: 100,
|
||||||
showInTable: true,
|
showInTable: true,
|
||||||
showDrag: false,
|
showDrag: false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
:fun-params="{ caseId: props.caseId, keyword, projectId: currentProjectId }"
|
:fun-params="{ caseId: props.caseId, keyword, projectId: currentProjectId }"
|
||||||
@update="updateDemand"
|
@update="updateDemand"
|
||||||
@create="addDemand"
|
@create="addDemand"
|
||||||
|
@cancel="cancelLink"
|
||||||
></AssociatedDemandTable>
|
></AssociatedDemandTable>
|
||||||
<AddDemandModal
|
<AddDemandModal
|
||||||
ref="demandModalRef"
|
ref="demandModalRef"
|
||||||
|
@ -89,7 +90,12 @@
|
||||||
import AddDemandModal from './addDemandModal.vue';
|
import AddDemandModal from './addDemandModal.vue';
|
||||||
import AssociatedDemandTable from './associatedDemandTable.vue';
|
import AssociatedDemandTable from './associatedDemandTable.vue';
|
||||||
|
|
||||||
import { addDemandRequest, getThirdDemandList, updateDemandReq } from '@/api/modules/case-management/featureCase';
|
import {
|
||||||
|
addDemandRequest,
|
||||||
|
cancelAssociationDemand,
|
||||||
|
getThirdDemandList,
|
||||||
|
updateDemandReq,
|
||||||
|
} from '@/api/modules/case-management/featureCase';
|
||||||
import { getCaseRelatedInfo } from '@/api/modules/project-management/menuManagement';
|
import { getCaseRelatedInfo } from '@/api/modules/project-management/menuManagement';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
|
@ -182,8 +188,22 @@
|
||||||
const drawerLoading = ref<boolean>(false);
|
const drawerLoading = ref<boolean>(false);
|
||||||
|
|
||||||
const tableSelected = computed(() => {
|
const tableSelected = computed(() => {
|
||||||
const selectIds = [...propsRes.value.selectedKeys];
|
const selectedIds = [...propsRes.value.selectedKeys];
|
||||||
return propsRes.value.data.filter((item: any) => selectIds.indexOf(item.demandId) > -1);
|
const filteredData: DemandItem[] = [];
|
||||||
|
|
||||||
|
function filterData(data: DemandItem[]) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const item: DemandItem = data[i];
|
||||||
|
if (selectedIds.includes(item.demandId)) {
|
||||||
|
filteredData.push(item);
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
filterData(item.children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filterData(propsRes.value.data);
|
||||||
|
return filteredData;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 关联需求
|
// 关联需求
|
||||||
|
@ -278,6 +298,16 @@
|
||||||
function handleDrawerCancel() {
|
function handleDrawerCancel() {
|
||||||
linkDemandDrawer.value = false;
|
linkDemandDrawer.value = false;
|
||||||
}
|
}
|
||||||
|
// 取消关联
|
||||||
|
async function cancelLink(record: DemandItem) {
|
||||||
|
try {
|
||||||
|
await cancelAssociationDemand(record.id);
|
||||||
|
Message.success(t('caseManagement.featureCase.cancelLinkSuccess'));
|
||||||
|
demandRef.value.initData();
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => linkDemandDrawer.value,
|
() => linkDemandDrawer.value,
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
|
|
||||||
import type { CreateOrUpdateDemand } from '@/models/caseManagement/featureCase';
|
import type { CreateOrUpdateDemand, DemandItem } from '@/models/caseManagement/featureCase';
|
||||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -120,8 +120,22 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableSelected = computed(() => {
|
const tableSelected = computed(() => {
|
||||||
const selectIds = [...propsRes.value.selectedKeys];
|
const selectedIds = [...propsRes.value.selectedKeys];
|
||||||
return propsRes.value.data.filter((item: any) => selectIds.indexOf(item.demandId) > -1);
|
const filteredData: DemandItem[] = [];
|
||||||
|
|
||||||
|
function filterData(data: DemandItem[]) {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
const item: DemandItem = data[i];
|
||||||
|
if (selectedIds.includes(item.demandId)) {
|
||||||
|
filteredData.push(item);
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
filterData(item.children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filterData(propsRes.value.data);
|
||||||
|
return filteredData;
|
||||||
});
|
});
|
||||||
|
|
||||||
const platformInfo = ref<Record<string, any>>({});
|
const platformInfo = ref<Record<string, any>>({});
|
||||||
|
|
|
@ -89,6 +89,7 @@ export default {
|
||||||
'caseManagement.featureCase.storage': 'storage',
|
'caseManagement.featureCase.storage': 'storage',
|
||||||
'caseManagement.featureCase.download': 'download',
|
'caseManagement.featureCase.download': 'download',
|
||||||
'caseManagement.featureCase.cancelLink': 'Cancel link',
|
'caseManagement.featureCase.cancelLink': 'Cancel link',
|
||||||
|
'caseManagement.featureCase.cancelLinkSuccess': 'Cancel link Successfully',
|
||||||
'caseManagement.featureCase.SelectExportRange': 'Select export range',
|
'caseManagement.featureCase.SelectExportRange': 'Select export range',
|
||||||
'caseManagement.featureCase.clear': 'Clear',
|
'caseManagement.featureCase.clear': 'Clear',
|
||||||
'caseManagement.featureCase.baseField': 'Base Field',
|
'caseManagement.featureCase.baseField': 'Base Field',
|
||||||
|
@ -176,7 +177,6 @@ export default {
|
||||||
'caseManagement.featureCase.changeNumber': 'Change sequence',
|
'caseManagement.featureCase.changeNumber': 'Change sequence',
|
||||||
'caseManagement.featureCase.changeType': 'type',
|
'caseManagement.featureCase.changeType': 'type',
|
||||||
'caseManagement.featureCase.operator': 'operator',
|
'caseManagement.featureCase.operator': 'operator',
|
||||||
'caseManagement.featureCase.cancelLinkSuccess': 'Cancel association successfully',
|
|
||||||
'caseManagement.featureCase.preview': 'Preview',
|
'caseManagement.featureCase.preview': 'Preview',
|
||||||
'caseManagement.featureCase.defectList': 'Defect list',
|
'caseManagement.featureCase.defectList': 'Defect list',
|
||||||
'caseManagement.featureCase.addPresetCase': 'Add preset use case',
|
'caseManagement.featureCase.addPresetCase': 'Add preset use case',
|
||||||
|
|
|
@ -88,6 +88,7 @@ export default {
|
||||||
'caseManagement.featureCase.storage': '转存',
|
'caseManagement.featureCase.storage': '转存',
|
||||||
'caseManagement.featureCase.download': '下载',
|
'caseManagement.featureCase.download': '下载',
|
||||||
'caseManagement.featureCase.cancelLink': '取消关联',
|
'caseManagement.featureCase.cancelLink': '取消关联',
|
||||||
|
'caseManagement.featureCase.cancelLinkSuccess': '取消关联成功',
|
||||||
'caseManagement.featureCase.SelectExportRange': '选择导出范围',
|
'caseManagement.featureCase.SelectExportRange': '选择导出范围',
|
||||||
'caseManagement.featureCase.clear': '清空',
|
'caseManagement.featureCase.clear': '清空',
|
||||||
'caseManagement.featureCase.baseField': '基础字段',
|
'caseManagement.featureCase.baseField': '基础字段',
|
||||||
|
@ -174,7 +175,6 @@ export default {
|
||||||
'caseManagement.featureCase.changeNumber': '变更序号',
|
'caseManagement.featureCase.changeNumber': '变更序号',
|
||||||
'caseManagement.featureCase.changeType': '类型',
|
'caseManagement.featureCase.changeType': '类型',
|
||||||
'caseManagement.featureCase.operator': '操作人',
|
'caseManagement.featureCase.operator': '操作人',
|
||||||
'caseManagement.featureCase.cancelLinkSuccess': '取消关联成功',
|
|
||||||
'caseManagement.featureCase.preview': '预览',
|
'caseManagement.featureCase.preview': '预览',
|
||||||
'caseManagement.featureCase.defectList': '缺陷列表',
|
'caseManagement.featureCase.defectList': '缺陷列表',
|
||||||
'caseManagement.featureCase.addPresetCase': '添加前置用例',
|
'caseManagement.featureCase.addPresetCase': '添加前置用例',
|
||||||
|
|
|
@ -99,7 +99,7 @@ export default {
|
||||||
'system.orgTemplate.addAttachment': 'Add attachment',
|
'system.orgTemplate.addAttachment': 'Add attachment',
|
||||||
'system.orgTemplate.addAttachmentTip': 'Support any type of file, the file size does not exceed 500MB',
|
'system.orgTemplate.addAttachmentTip': 'Support any type of file, the file size does not exceed 500MB',
|
||||||
'system.orgTemplate.enabledSuccessfully': 'Enabled successfully',
|
'system.orgTemplate.enabledSuccessfully': 'Enabled successfully',
|
||||||
'system.orgTemplate.thirdPartyPlatforms': 'Used to map field values for third-party platforms such as JARA',
|
'system.orgTemplate.thirdPartyPlatforms': 'Used to map field values for third-party platforms such as JIRA',
|
||||||
'system.orgTemplate.optionsIdNoRepeat': 'The option ID must be unique',
|
'system.orgTemplate.optionsIdNoRepeat': 'The option ID must be unique',
|
||||||
'system.orgTemplate.optionsContentNoRepeat': 'The options cannot be repeated',
|
'system.orgTemplate.optionsContentNoRepeat': 'The options cannot be repeated',
|
||||||
'system.orgTemplate.thirdParty': 'Connect to third-party platforms',
|
'system.orgTemplate.thirdParty': 'Connect to third-party platforms',
|
||||||
|
@ -181,4 +181,7 @@ export default {
|
||||||
'system.orgTemplate.enableWarningTip': 'Enabled, irreversible for organization template, please careful operation.',
|
'system.orgTemplate.enableWarningTip': 'Enabled, irreversible for organization template, please careful operation.',
|
||||||
'system.orgTemplate.typeEmptyTip': 'The type cannot be empty',
|
'system.orgTemplate.typeEmptyTip': 'The type cannot be empty',
|
||||||
'system.orgTemplate.searchOrgPlaceholder': 'Please enter the organization name :{name}',
|
'system.orgTemplate.searchOrgPlaceholder': 'Please enter the organization name :{name}',
|
||||||
|
'system.orgTemplate.associatedField': 'Associated field ',
|
||||||
|
'system.orgTemplate.associatedHasField': 'Associate an added field',
|
||||||
|
'system.orgTemplate.addFieldDesc': 'Adds a new field',
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,7 +99,7 @@ export default {
|
||||||
'system.orgTemplate.addAttachment': '添加附件',
|
'system.orgTemplate.addAttachment': '添加附件',
|
||||||
'system.orgTemplate.addAttachmentTip': '支持任意类型文件,文件大小不超过 500MB',
|
'system.orgTemplate.addAttachmentTip': '支持任意类型文件,文件大小不超过 500MB',
|
||||||
'system.orgTemplate.enabledSuccessfully': '启用成功',
|
'system.orgTemplate.enabledSuccessfully': '启用成功',
|
||||||
'system.orgTemplate.thirdPartyPlatforms': '用于映射 JARA 等第三方平台字段值',
|
'system.orgTemplate.thirdPartyPlatforms': '用于映射 JIRA 等第三方平台字段值',
|
||||||
'system.orgTemplate.optionsIdNoRepeat': '选项 ID 不可以重复',
|
'system.orgTemplate.optionsIdNoRepeat': '选项 ID 不可以重复',
|
||||||
'system.orgTemplate.optionsContentNoRepeat': '选项内容不可以重复',
|
'system.orgTemplate.optionsContentNoRepeat': '选项内容不可以重复',
|
||||||
'system.orgTemplate.thirdParty': '对接第三方平台',
|
'system.orgTemplate.thirdParty': '对接第三方平台',
|
||||||
|
@ -170,4 +170,9 @@ export default {
|
||||||
'system.orgTemplate.enableWarningTip': '启用后,不可恢复为组织模版,请谨慎操作!',
|
'system.orgTemplate.enableWarningTip': '启用后,不可恢复为组织模版,请谨慎操作!',
|
||||||
'system.orgTemplate.typeEmptyTip': '类型不能为空',
|
'system.orgTemplate.typeEmptyTip': '类型不能为空',
|
||||||
'system.orgTemplate.searchOrgPlaceholder': '请输入组织名称: {name} ',
|
'system.orgTemplate.searchOrgPlaceholder': '请输入组织名称: {name} ',
|
||||||
|
'system.orgTemplate.associatedField': '关联字段 ',
|
||||||
|
'system.orgTemplate.associatedHasField': '关联已添加的字段',
|
||||||
|
'system.orgTemplate.addFieldDesc': '新增一个新的字段',
|
||||||
|
'system.orgTemplate.toTop': '上移',
|
||||||
|
'system.orgTemplate.toBottom': '下移',
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue