fix: 修复任务中心参数问题&关联用例调整
This commit is contained in:
parent
9d2a050983
commit
8a8e584886
|
@ -113,7 +113,7 @@
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<template #caseLevel="{ record }">
|
<template #caseLevel="{ record }">
|
||||||
<caseLevel :case-level="getCaseLevel(record)" />
|
<caseLevel v-if="getCaseLevel(record)" :case-level="getCaseLevel(record)" />
|
||||||
</template>
|
</template>
|
||||||
</ms-base-table>
|
</ms-base-table>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
@ -175,24 +175,30 @@
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = withDefaults(
|
||||||
visible: boolean;
|
defineProps<{
|
||||||
projectId?: string; // 项目id
|
visible: boolean;
|
||||||
caseId?: string; // 用例id 用例评审那边不需要传递
|
projectId?: string; // 项目id
|
||||||
getModulesFunc: (params: TableQueryParams) => Promise<ModuleTreeNode[]>; // 获取模块树请求
|
caseId?: string; // 用例id 用例评审那边不需要传递
|
||||||
modulesParams?: Record<string, any>; // 获取模块树请求
|
getModulesFunc: (params: TableQueryParams) => Promise<ModuleTreeNode[]>; // 获取模块树请求
|
||||||
getTableFunc: (params: TableQueryParams) => Promise<CommonList<CaseManagementTable>>; // 获取表请求函数
|
modulesParams?: Record<string, any>; // 获取模块树请求
|
||||||
tableParams?: TableQueryParams; // 查询表格的额外的参数
|
getTableFunc: (params: TableQueryParams) => Promise<CommonList<CaseManagementTable>>; // 获取表请求函数
|
||||||
okButtonDisabled?: boolean; // 确认按钮是否禁用
|
tableParams?: TableQueryParams; // 查询表格的额外的参数
|
||||||
currentSelectCase: string | number | Record<string, any> | undefined; // 当前选中的用例类型
|
okButtonDisabled?: boolean; // 确认按钮是否禁用
|
||||||
moduleOptions?: { label: string; value: string }[]; // 功能模块对应用例下拉
|
currentSelectCase: string | number | Record<string, any> | undefined; // 当前选中的用例类型
|
||||||
confirmLoading: boolean;
|
moduleOptions?: { label: string; value: string }[]; // 功能模块对应用例下拉
|
||||||
associatedIds: string[]; // 已关联用例id集合用于去重已关联
|
confirmLoading: boolean;
|
||||||
hasNotAssociatedIds?: string[];
|
associatedIds: string[]; // 已关联用例id集合用于去重已关联
|
||||||
type: RequestModuleEnum[keyof RequestModuleEnum];
|
hasNotAssociatedIds?: string[];
|
||||||
moduleCountParams?: TableQueryParams; // 获取模块树数量额外的参数
|
type: RequestModuleEnum[keyof RequestModuleEnum];
|
||||||
hideProjectSelect?: boolean; // 是否隐藏项目选择
|
moduleCountParams?: TableQueryParams; // 获取模块树数量额外的参数
|
||||||
}>();
|
hideProjectSelect?: boolean; // 是否隐藏项目选择
|
||||||
|
isHiddenCaseLevel?: boolean;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
isHiddenCaseLevel: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:visible', val: boolean): void;
|
(e: 'update:visible', val: boolean): void;
|
||||||
|
@ -318,6 +324,20 @@
|
||||||
const keyword = ref('');
|
const keyword = ref('');
|
||||||
const version = ref('');
|
const version = ref('');
|
||||||
|
|
||||||
|
function getCaseLevelColumn() {
|
||||||
|
if (!props.isHiddenCaseLevel) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
title: 'ms.case.associate.caseLevel',
|
||||||
|
dataIndex: 'caseLevel',
|
||||||
|
slotName: 'caseLevel',
|
||||||
|
width: 90,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
const columns: MsTableColumn = [
|
const columns: MsTableColumn = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
|
@ -342,12 +362,7 @@
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
width: 250,
|
width: 250,
|
||||||
},
|
},
|
||||||
{
|
...getCaseLevelColumn(),
|
||||||
title: 'ms.case.associate.caseLevel',
|
|
||||||
dataIndex: 'caseLevel',
|
|
||||||
slotName: 'caseLevel',
|
|
||||||
width: 90,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'ms.case.associate.tags',
|
title: 'ms.case.associate.tags',
|
||||||
dataIndex: 'tags',
|
dataIndex: 'tags',
|
||||||
|
@ -355,6 +370,10 @@
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
getCaseLevelColumn();
|
||||||
|
});
|
||||||
|
|
||||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setTableSelected } = useTable(
|
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector, setTableSelected } = useTable(
|
||||||
props.getTableFunc,
|
props.getTableFunc,
|
||||||
{
|
{
|
||||||
|
@ -379,8 +398,13 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
// 用例等级
|
// 用例等级
|
||||||
|
// TODO: 这个版本用例和接口以及场景不存在用例等级 不展示等级内容
|
||||||
function getCaseLevel(record: CaseManagementTable) {
|
function getCaseLevel(record: CaseManagementTable) {
|
||||||
return (record.customFields.find((item: any) => item.name === '用例等级')?.value as CaseLevel) || 'P1';
|
if (record.customFields && record.customFields.length) {
|
||||||
|
const caseItem = record.customFields.find((item: any) => item.fieldName === '用例等级' && item.internal);
|
||||||
|
return caseItem?.options.find((item: any) => item.value === caseItem?.defaultValue).text;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchParams = ref<TableQueryParams>({
|
const searchParams = ref<TableQueryParams>({
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
:case-id="props.bugId"
|
:case-id="props.bugId"
|
||||||
:associated-ids="associatedIds"
|
:associated-ids="associatedIds"
|
||||||
:type="RequestModuleEnum.BUG_MANAGEMENT"
|
:type="RequestModuleEnum.BUG_MANAGEMENT"
|
||||||
|
:is-hidden-case-level="true"
|
||||||
@close="emit('close')"
|
@close="emit('close')"
|
||||||
@save="saveHandler"
|
@save="saveHandler"
|
||||||
>
|
>
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
:case-id="props.caseId"
|
:case-id="props.caseId"
|
||||||
:associated-ids="associatedIds"
|
:associated-ids="associatedIds"
|
||||||
:type="RequestModuleEnum.API_CASE"
|
:type="RequestModuleEnum.API_CASE"
|
||||||
|
:is-hidden-case-level="true"
|
||||||
@close="emit('close')"
|
@close="emit('close')"
|
||||||
@save="saveHandler"
|
@save="saveHandler"
|
||||||
>
|
>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="wrapper mb-6 flex justify-between">
|
<div class="wrapper mb-6 flex justify-between">
|
||||||
<span class="font-medium text-[var(--color-text-000)]">{{ t('project.basicInfo.basicInfo') }}</span>
|
<span class="font-medium text-[var(--color-text-000)]">{{ t('project.basicInfo.basicInfo') }}</span>
|
||||||
<a-button
|
<a-button
|
||||||
v-if="!projectDetail?.deleted"
|
v-show="!projectDetail?.deleted"
|
||||||
v-permission="['PROJECT_BASE_INFO:READ+UPDATE']"
|
v-permission="['PROJECT_BASE_INFO:READ+UPDATE']"
|
||||||
type="outline"
|
type="outline"
|
||||||
@click="editHandler"
|
@click="editHandler"
|
||||||
|
@ -19,12 +19,9 @@
|
||||||
<span class="one-line-text mr-1 max-w-[300px] font-medium text-[var(--color-text-000)]">{{
|
<span class="one-line-text mr-1 max-w-[300px] font-medium text-[var(--color-text-000)]">{{
|
||||||
projectDetail?.name
|
projectDetail?.name
|
||||||
}}</span>
|
}}</span>
|
||||||
<span
|
<span class="button mr-1" :class="[projectDetail?.deleted ? 'delete-button' : 'enable-button']">{{
|
||||||
v-if="!projectDetail?.deleted && projectDetail?.enable"
|
projectDetail?.deleted ? t('project.basicInfo.deleted') : t('project.basicInfo.enable')
|
||||||
class="button mr-1"
|
}}</span>
|
||||||
:class="[projectDetail?.enable ? 'enable-button' : 'delete-button']"
|
|
||||||
>{{ projectDetail?.enable ? t('project.basicInfo.enable') : t('project.basicInfo.enable') }}</span
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="one-line-text text-xs text-[--color-text-4]">{{ projectDetail?.description }}</div>
|
<div class="one-line-text text-xs text-[--color-text-4]">{{ projectDetail?.description }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-row items-center">
|
<div class="flex flex-row items-center">
|
||||||
<div class="text-[var(--color-text-1)]"> {{ t('project.menu.management') }}</div>
|
<div class="text-[var(--color-text-1)]"> {{ t('project.menu.management') }}</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<MsIcon
|
|
||||||
class="ml-[4px] text-[var(--color-text-4)] hover:text-[rgb(var(--primary-5))]"
|
|
||||||
type="icon-icon-maybe_outlined"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<MsBaseTable
|
<MsBaseTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
|
|
@ -500,7 +500,7 @@
|
||||||
function batchStopRealTask() {
|
function batchStopRealTask() {
|
||||||
openModal({
|
openModal({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: t('project.taskCenter.batchStopTask', { num: batchParams.value.selectIds.length }),
|
title: t('project.taskCenter.batchStopTask', { num: batchParams.value.currentSelectCount }),
|
||||||
content: t('project.taskCenter.stopTaskContent'),
|
content: t('project.taskCenter.stopTaskContent'),
|
||||||
okText: t('project.taskCenter.confirmStop'),
|
okText: t('project.taskCenter.confirmStop'),
|
||||||
cancelText: t('common.cancel'),
|
cancelText: t('common.cancel'),
|
||||||
|
@ -509,11 +509,12 @@
|
||||||
},
|
},
|
||||||
onBeforeOk: async () => {
|
onBeforeOk: async () => {
|
||||||
try {
|
try {
|
||||||
const { selectIds, selectAll } = batchParams.value;
|
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
||||||
await loadRealMap.value[props.group].batchStop({
|
await loadRealMap.value[props.group].batchStop({
|
||||||
moduleType: props.moduleType,
|
moduleType: props.moduleType,
|
||||||
selectIds: selectAll ? [] : selectIds,
|
selectIds: selectIds || [],
|
||||||
selectAll,
|
selectAll: !!selectAll,
|
||||||
|
excludeIds: excludeIds || [],
|
||||||
condition: {
|
condition: {
|
||||||
keyword: keyword.value,
|
keyword: keyword.value,
|
||||||
filter: {
|
filter: {
|
||||||
|
|
|
@ -488,7 +488,7 @@
|
||||||
function batchEnableTask() {
|
function batchEnableTask() {
|
||||||
openModal({
|
openModal({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: t('project.taskCenter.batchEnableTask', { num: batchParams.value.selectIds.length }),
|
title: t('project.taskCenter.batchEnableTask', { num: batchParams.value.currentSelectCount }),
|
||||||
content: t('project.taskCenter.batchEnableTaskContent'),
|
content: t('project.taskCenter.batchEnableTaskContent'),
|
||||||
okText: t('project.taskCenter.confirmEnable'),
|
okText: t('project.taskCenter.confirmEnable'),
|
||||||
cancelText: t('common.cancel'),
|
cancelText: t('common.cancel'),
|
||||||
|
@ -499,8 +499,8 @@
|
||||||
try {
|
try {
|
||||||
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
||||||
await loadRealMap.value[props.group].batchEnable({
|
await loadRealMap.value[props.group].batchEnable({
|
||||||
selectIds: selectAll ? [] : selectIds,
|
selectIds: selectIds || [],
|
||||||
selectAll,
|
selectAll: !!selectAll,
|
||||||
scheduleTagType: props.moduleType,
|
scheduleTagType: props.moduleType,
|
||||||
excludeIds,
|
excludeIds,
|
||||||
condition: {
|
condition: {
|
||||||
|
@ -526,7 +526,7 @@
|
||||||
function batchDisableTask() {
|
function batchDisableTask() {
|
||||||
openModal({
|
openModal({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
title: t('project.taskCenter.batchDisableTask', { num: batchParams.value.selectIds.length }),
|
title: t('project.taskCenter.batchDisableTask', { num: batchParams.value.currentSelectCount }),
|
||||||
content: t('project.taskCenter.batchDisableTaskContent'),
|
content: t('project.taskCenter.batchDisableTaskContent'),
|
||||||
okText: t('project.taskCenter.confirmDisable'),
|
okText: t('project.taskCenter.confirmDisable'),
|
||||||
cancelText: t('common.cancel'),
|
cancelText: t('common.cancel'),
|
||||||
|
@ -535,10 +535,11 @@
|
||||||
},
|
},
|
||||||
onBeforeOk: async () => {
|
onBeforeOk: async () => {
|
||||||
try {
|
try {
|
||||||
const { selectIds, selectAll } = batchParams.value;
|
const { selectIds, selectAll, excludeIds } = batchParams.value;
|
||||||
await loadRealMap.value[props.group].batchDisable({
|
await loadRealMap.value[props.group].batchDisable({
|
||||||
selectIds: selectAll ? [] : selectIds,
|
selectIds: selectIds || [],
|
||||||
selectAll,
|
selectAll: !!selectAll,
|
||||||
|
excludeIds: excludeIds || [],
|
||||||
scheduleTagType: props.moduleType,
|
scheduleTagType: props.moduleType,
|
||||||
condition: {
|
condition: {
|
||||||
keyword: keyword.value,
|
keyword: keyword.value,
|
||||||
|
|
Loading…
Reference in New Issue