fix(测试计划): 关联用例抽屉表格排序&修改高级搜索组件
--bug=1040867 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001040867
This commit is contained in:
parent
8d6ba0bfce
commit
386e1d91c6
|
@ -458,22 +458,20 @@
|
||||||
slotName: 'num',
|
slotName: 'num',
|
||||||
sortIndex: 1,
|
sortIndex: 1,
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
// TODO 后台没有加
|
sortable: {
|
||||||
// sortable: {
|
sortDirections: ['ascend', 'descend'],
|
||||||
// sortDirections: ['ascend', 'descend'],
|
sorter: true,
|
||||||
// sorter: true,
|
},
|
||||||
// },
|
|
||||||
width: 120,
|
width: 120,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ms.case.associate.caseName',
|
title: 'ms.case.associate.caseName',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
// TODO 后台没有加
|
sortable: {
|
||||||
// sortable: {
|
sortDirections: ['ascend', 'descend'],
|
||||||
// sortDirections: ['ascend', 'descend'],
|
sorter: true,
|
||||||
// sorter: true,
|
},
|
||||||
// },
|
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
width: 250,
|
width: 250,
|
||||||
},
|
},
|
||||||
|
@ -496,10 +494,10 @@
|
||||||
title: 'caseManagement.featureCase.tableColumnCreateTime',
|
title: 'caseManagement.featureCase.tableColumnCreateTime',
|
||||||
slotName: 'createTime',
|
slotName: 'createTime',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
// sortable: {
|
sortable: {
|
||||||
// sortDirections: ['ascend', 'descend'],
|
sortDirections: ['ascend', 'descend'],
|
||||||
// sorter: true,
|
sorter: true,
|
||||||
// },
|
},
|
||||||
width: 200,
|
width: 200,
|
||||||
showDrag: true,
|
showDrag: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-row items-center justify-between">
|
<div class="flex flex-row items-center justify-between">
|
||||||
<slot name="left"></slot>
|
<slot name="left">
|
||||||
|
<a-popover v-if="props.name" title="" position="bottom">
|
||||||
|
<div class="flex">
|
||||||
|
<div class="one-line-text mr-1 max-h-[32px] max-w-[300px] text-[var(--color-text-1)]">
|
||||||
|
{{ props.name }}
|
||||||
|
</div>
|
||||||
|
<span class="text-[var(--color-text-4)]"> ({{ props.count }})</span>
|
||||||
|
</div>
|
||||||
|
<template #content>
|
||||||
|
<div class="max-w-[400px] text-[14px] font-medium text-[var(--color-text-1)]">
|
||||||
|
{{ props.name }}
|
||||||
|
<span class="text-[var(--color-text-4)]">({{ props.count }})</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-popover>
|
||||||
|
</slot>
|
||||||
<div class="flex flex-row gap-[12px]">
|
<div class="flex flex-row gap-[12px]">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:modelValue="innerKeyword"
|
v-model:modelValue="innerKeyword"
|
||||||
|
@ -65,6 +80,8 @@
|
||||||
filterConfigList: FilterFormItem[]; // 系统字段
|
filterConfigList: FilterFormItem[]; // 系统字段
|
||||||
customFieldsConfigList?: FilterFormItem[]; // 自定义字段
|
customFieldsConfigList?: FilterFormItem[]; // 自定义字段
|
||||||
searchPlaceholder?: string;
|
searchPlaceholder?: string;
|
||||||
|
name?: string;
|
||||||
|
count?: number;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|
|
@ -9,26 +9,12 @@
|
||||||
:custom-fields-config-list="searchCustomFields"
|
:custom-fields-config-list="searchCustomFields"
|
||||||
:search-placeholder="t('caseManagement.featureCase.searchPlaceholder')"
|
:search-placeholder="t('caseManagement.featureCase.searchPlaceholder')"
|
||||||
:row-count="filterRowCount"
|
:row-count="filterRowCount"
|
||||||
|
:count="props.modulesCount[props.activeFolder] || 0"
|
||||||
|
:name="moduleNamePath"
|
||||||
@keyword-search="fetchData"
|
@keyword-search="fetchData"
|
||||||
@adv-search="handleAdvSearch"
|
@adv-search="handleAdvSearch"
|
||||||
@refresh="fetchData()"
|
@refresh="fetchData()"
|
||||||
>
|
>
|
||||||
<template #left>
|
|
||||||
<a-popover title="" position="bottom">
|
|
||||||
<div class="show-table-top-title">
|
|
||||||
<div class="one-line-text max-h-[32px] max-w-[300px] text-[var(--color-text-1)]">
|
|
||||||
{{ moduleNamePath }}
|
|
||||||
</div>
|
|
||||||
<span class="text-[var(--color-text-4)]"> ({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
|
||||||
</div>
|
|
||||||
<template #content>
|
|
||||||
<div class="max-w-[400px] text-[14px] font-medium text-[var(--color-text-1)]">
|
|
||||||
{{ moduleNamePath }}
|
|
||||||
<span class="text-[var(--color-text-4)]">({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</a-popover>
|
|
||||||
</template>
|
|
||||||
<template #right>
|
<template #right>
|
||||||
<!-- <a-radio-group v-model:model-value="showType" type="button" size="small" class="list-show-type">
|
<!-- <a-radio-group v-model:model-value="showType" type="button" size="small" class="list-show-type">
|
||||||
<a-radio value="list" class="show-type-icon !m-[2px]">
|
<a-radio value="list" class="show-type-icon !m-[2px]">
|
||||||
|
|
|
@ -69,28 +69,13 @@
|
||||||
:filter-config-list="filterConfigList"
|
:filter-config-list="filterConfigList"
|
||||||
:custom-fields-config-list="searchCustomFields"
|
:custom-fields-config-list="searchCustomFields"
|
||||||
:row-count="filterRowCount"
|
:row-count="filterRowCount"
|
||||||
|
:count="recycleModulesCount[activeFolder] || 0"
|
||||||
|
:name="moduleNamePath"
|
||||||
:search-placeholder="t('caseManagement.featureCase.searchPlaceholder')"
|
:search-placeholder="t('caseManagement.featureCase.searchPlaceholder')"
|
||||||
@keyword-search="fetchData"
|
@keyword-search="fetchData"
|
||||||
@adv-search="handleAdvSearch"
|
@adv-search="handleAdvSearch"
|
||||||
@refresh="fetchData()"
|
@refresh="fetchData()"
|
||||||
>
|
/>
|
||||||
<template #left>
|
|
||||||
<a-popover title="" position="bottom">
|
|
||||||
<div class="show-table-top-title">
|
|
||||||
<div class="one-line-text max-h-[32px] max-w-[116px] text-[var(--color-text-1)]">
|
|
||||||
{{ moduleNamePath }}
|
|
||||||
</div>
|
|
||||||
<span class="text-[var(--color-text-4)]"> ({{ recycleModulesCount[activeFolder] || 0 }})</span>
|
|
||||||
</div>
|
|
||||||
<template #content>
|
|
||||||
<div class="max-w-[400px] text-[14px] font-medium text-[var(--color-text-1)]">
|
|
||||||
{{ moduleNamePath }}
|
|
||||||
<span class="text-[var(--color-text-4)]">({{ recycleModulesCount[activeFolder] || 0 }})</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</a-popover>
|
|
||||||
</template>
|
|
||||||
</MsAdvanceFilter>
|
|
||||||
<ms-base-table
|
<ms-base-table
|
||||||
class="my-4"
|
class="my-4"
|
||||||
v-bind="propsRes"
|
v-bind="propsRes"
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="p-[16px]">
|
<div class="p-[16px]">
|
||||||
<div class="mb-[16px] flex justify-end">
|
<MsAdvanceFilter
|
||||||
<a-input-search
|
v-model:keyword="keyword"
|
||||||
v-model:model-value="keyword"
|
:filter-config-list="[]"
|
||||||
:placeholder="t('ms.case.associate.searchPlaceholder')"
|
:custom-fields-config-list="[]"
|
||||||
allow-clear
|
:row-count="0"
|
||||||
class="mr-[8px] w-[240px]"
|
:count="props.modulesCount[props.activeModule] || 0"
|
||||||
@search="loadCaseList"
|
:name="moduleNamePath"
|
||||||
@press-enter="loadCaseList"
|
:search-placeholder="t('ms.case.associate.searchPlaceholder')"
|
||||||
@clear="loadCaseList"
|
@keyword-search="loadCaseList"
|
||||||
|
@adv-search="loadCaseList"
|
||||||
|
@refresh="loadCaseList"
|
||||||
/>
|
/>
|
||||||
<a-button type="outline" class="arco-btn-outline--secondary !p-[8px]" @click="loadCaseList">
|
|
||||||
<template #icon>
|
|
||||||
<icon-refresh class="text-[var(--color-text-4)]" />
|
|
||||||
</template>
|
|
||||||
</a-button>
|
|
||||||
</div>
|
|
||||||
<MsBaseTable
|
<MsBaseTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
class="mt-[16px]"
|
||||||
v-bind="propsRes"
|
v-bind="propsRes"
|
||||||
:action-config="batchActions"
|
:action-config="batchActions"
|
||||||
:selectable="hasOperationPermission"
|
:selectable="hasOperationPermission"
|
||||||
|
@ -172,6 +169,7 @@
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { FormInstance, Message, SelectOptionData } from '@arco-design/web-vue';
|
import { FormInstance, Message, SelectOptionData } from '@arco-design/web-vue';
|
||||||
|
|
||||||
|
import { MsAdvanceFilter } from '@/components/pure/ms-advance-filter';
|
||||||
import MsButton from '@/components/pure/ms-button/index.vue';
|
import MsButton from '@/components/pure/ms-button/index.vue';
|
||||||
import MsPopconfirm from '@/components/pure/ms-popconfirm/index.vue';
|
import MsPopconfirm from '@/components/pure/ms-popconfirm/index.vue';
|
||||||
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
|
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
|
||||||
|
@ -221,6 +219,8 @@
|
||||||
} from '@/views/case-management/caseManagementFeature/components/utils';
|
} from '@/views/case-management/caseManagementFeature/components/utils';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
modulesCount: Record<string, number>; // 模块数量统计对象
|
||||||
|
moduleName: string;
|
||||||
activeModule: string;
|
activeModule: string;
|
||||||
offspringIds: string[];
|
offspringIds: string[];
|
||||||
planId: string;
|
planId: string;
|
||||||
|
@ -243,6 +243,9 @@
|
||||||
const { openModal } = useModal();
|
const { openModal } = useModal();
|
||||||
|
|
||||||
const keyword = ref('');
|
const keyword = ref('');
|
||||||
|
const moduleNamePath = computed(() => {
|
||||||
|
return props.activeModule === 'all' ? t('caseManagement.featureCase.allCase') : props.moduleName;
|
||||||
|
});
|
||||||
|
|
||||||
const hasOperationPermission = computed(
|
const hasOperationPermission = computed(
|
||||||
() => hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE', 'PROJECT_TEST_PLAN:READ+ASSOCIATION']) && props.canEdit
|
() => hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE', 'PROJECT_TEST_PLAN:READ+ASSOCIATION']) && props.canEdit
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
count: 'count',
|
count: 'count',
|
||||||
}"
|
}"
|
||||||
block-node
|
block-node
|
||||||
title-tooltip-position="left"
|
|
||||||
@select="folderNodeSelect"
|
@select="folderNodeSelect"
|
||||||
>
|
>
|
||||||
<template #title="nodeData">
|
<template #title="nodeData">
|
||||||
|
@ -74,7 +73,7 @@
|
||||||
selectedKeys: string[]; // 选中的节点 key
|
selectedKeys: string[]; // 选中的节点 key
|
||||||
}>();
|
}>();
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'folderNodeSelect', ids: string[], _offspringIds: string[]): void;
|
(e: 'folderNodeSelect', ids: string[], _offspringIds: string[], nodeName?: string): void;
|
||||||
(e: 'init', params: ModuleTreeNode[]): void;
|
(e: 'init', params: ModuleTreeNode[]): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
@ -144,7 +143,7 @@
|
||||||
return e;
|
return e;
|
||||||
});
|
});
|
||||||
activeFolder.value = node.id;
|
activeFolder.value = node.id;
|
||||||
emit('folderNodeSelect', _selectedKeys as string[], offspringIds);
|
emit('folderNodeSelect', _selectedKeys as string[], offspringIds, node.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
<CaseTable
|
<CaseTable
|
||||||
ref="caseTableRef"
|
ref="caseTableRef"
|
||||||
:plan-id="planId"
|
:plan-id="planId"
|
||||||
|
:modules-count="modulesCount"
|
||||||
|
:module-name="moduleName"
|
||||||
:repeat-case="props.repeatCase"
|
:repeat-case="props.repeatCase"
|
||||||
:active-module="activeFolderId"
|
:active-module="activeFolderId"
|
||||||
:offspring-ids="offspringIds"
|
:offspring-ids="offspringIds"
|
||||||
|
@ -65,14 +67,16 @@
|
||||||
|
|
||||||
const caseTableRef = ref<InstanceType<typeof CaseTable>>();
|
const caseTableRef = ref<InstanceType<typeof CaseTable>>();
|
||||||
const activeFolderId = ref<string>('all');
|
const activeFolderId = ref<string>('all');
|
||||||
|
const moduleName = ref<string>('');
|
||||||
const offspringIds = ref<string[]>([]);
|
const offspringIds = ref<string[]>([]);
|
||||||
const selectedKeys = computed({
|
const selectedKeys = computed({
|
||||||
get: () => [activeFolderId.value],
|
get: () => [activeFolderId.value],
|
||||||
set: (val) => val,
|
set: (val) => val,
|
||||||
});
|
});
|
||||||
function handleFolderNodeSelect(ids: string[], _offspringIds: string[]) {
|
function handleFolderNodeSelect(ids: string[], _offspringIds: string[], name?: string) {
|
||||||
[activeFolderId.value] = ids;
|
[activeFolderId.value] = ids;
|
||||||
offspringIds.value = [..._offspringIds];
|
offspringIds.value = [..._offspringIds];
|
||||||
|
moduleName.value = name ?? '';
|
||||||
caseTableRef.value?.resetSelector();
|
caseTableRef.value?.resetSelector();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue