fix(工作台): 修复工作台首页跳转查询缺陷&进度条进度展示错误
This commit is contained in:
parent
b402c165e0
commit
95c2531315
|
@ -847,10 +847,6 @@
|
|||
columnSelectorVisible.value = true;
|
||||
};
|
||||
|
||||
const filterData = computed(() => {
|
||||
return { ...(attrs.filter || {}) } as Record<string, any>;
|
||||
});
|
||||
|
||||
const handleFilterConfirm = (
|
||||
value: string[] | (string | number | boolean)[] | undefined,
|
||||
dataIndex: string,
|
||||
|
@ -906,6 +902,10 @@
|
|||
return disableKey ? record[disableKey] : false;
|
||||
}
|
||||
|
||||
const filterData = computed(() => {
|
||||
return { ...(attrs.filter || {}) } as Record<string, any>;
|
||||
});
|
||||
|
||||
function hasSelectedFilter(item: MsTableColumnData) {
|
||||
if (item.filterConfig && item.dataIndex) {
|
||||
return (filterData.value[item.dataIndex] || []).length > 0;
|
||||
|
@ -958,10 +958,21 @@
|
|||
});
|
||||
};
|
||||
|
||||
function initDefaultFilter() {
|
||||
currentColumns.value.forEach((e) => {
|
||||
const dataIndexKey = e.dataIndex as string;
|
||||
// 初始化配置了filterConfig默认值回显已选项
|
||||
if (e.filterConfig?.options && filterData.value[dataIndexKey] && filterData.value[dataIndexKey].length) {
|
||||
e.filterCheckedList = filterData.value[dataIndexKey];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await initColumn();
|
||||
updateAllTagVisibility();
|
||||
batchLeft.value = getBatchLeft();
|
||||
initDefaultFilter();
|
||||
});
|
||||
|
||||
const updateColumnWidth = throttle(async (dataIndex: string, width: number) => {
|
||||
|
|
|
@ -221,18 +221,6 @@
|
|||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.filter,
|
||||
(val) => {
|
||||
if (!val[props.dataIndex as string] || val[props.dataIndex as string]?.length === 0) {
|
||||
checkedList.value = []; // 清空选择
|
||||
} else {
|
||||
// 如果有过滤条件,更新 checkedList
|
||||
checkedList.value = val[props.dataIndex as string];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const searchItem = debounce(() => {
|
||||
filterListOptions.value = originFilterList.value.filter((item: SelectOptionData) =>
|
||||
item.label?.includes(filterKeyword.value)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
@selected-change="handleTableSelect"
|
||||
@batch-action="handleTableBatch"
|
||||
@drag-change="handleTableDragSort"
|
||||
@filter-change="filterChange"
|
||||
>
|
||||
<template #[FilterSlotNameEnum.API_TEST_API_REQUEST_METHODS]="{ filterContent }">
|
||||
<apiMethodName :method="filterContent.value" />
|
||||
|
@ -627,9 +628,6 @@
|
|||
async function loadApiList(hasRefreshTree: boolean) {
|
||||
const moduleIds = await getModuleIds();
|
||||
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
const params = {
|
||||
keyword: keyword.value,
|
||||
projectId: appStore.currentProjectId,
|
||||
|
@ -792,6 +790,10 @@
|
|||
}
|
||||
|
||||
function onMountedLoad() {
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
|
||||
if (props.selectedProtocols.length > 0) {
|
||||
loadApiList(true);
|
||||
}
|
||||
|
@ -1129,6 +1131,18 @@
|
|||
shareButtonRef.value?.initShareList();
|
||||
}
|
||||
|
||||
function filterChange() {
|
||||
if (typeof refreshModuleTreeCount === 'function' && !isAdvancedSearchMode.value) {
|
||||
refreshModuleTreeCount({
|
||||
keyword: keyword.value,
|
||||
filter: propsRes.value.filter,
|
||||
moduleIds: [],
|
||||
protocols: props.selectedProtocols,
|
||||
projectId: appStore.currentProjectId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => requestMethodsOptions.value,
|
||||
() => {
|
||||
|
|
|
@ -672,10 +672,6 @@
|
|||
async function loadCaseList() {
|
||||
const selectModules = await getModuleIds();
|
||||
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
|
||||
const params = {
|
||||
apiDefinitionId: props.apiDetail?.id,
|
||||
keyword: keyword.value,
|
||||
|
@ -1212,6 +1208,10 @@
|
|||
setAdvanceFilter({ conditions: [], searchMode: 'AND' }, route.query.view as string);
|
||||
viewName.value = route.query.view as string;
|
||||
}
|
||||
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
|
|
|
@ -977,11 +977,6 @@
|
|||
async function loadScenarioList(refreshTreeCount?: boolean) {
|
||||
const moduleIds = await getModuleIds();
|
||||
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = {
|
||||
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
|
||||
};
|
||||
}
|
||||
const params = {
|
||||
keyword: keyword.value,
|
||||
projectId: appStore.currentProjectId,
|
||||
|
@ -1650,6 +1645,11 @@
|
|||
setAdvanceFilter({ conditions: [], searchMode: 'AND' }, route.query.view as string);
|
||||
viewName.value = route.query.view as string;
|
||||
}
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = {
|
||||
...NAV_NAVIGATION[route.query.home as WorkNavValueEnum],
|
||||
};
|
||||
}
|
||||
if (!isActivated.value) {
|
||||
loadScenarioList();
|
||||
cacheStore.setCache(CacheTabTypeEnum.API_SCENARIO_TABLE);
|
||||
|
|
|
@ -1028,10 +1028,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
|
||||
return {
|
||||
moduleIds,
|
||||
projectId: currentProjectId.value,
|
||||
|
@ -1823,6 +1819,9 @@
|
|||
}
|
||||
|
||||
async function mountedLoad() {
|
||||
if (route.query.home) {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
await initFilter();
|
||||
await initData();
|
||||
getCaseExportData();
|
||||
|
|
|
@ -899,15 +899,6 @@
|
|||
if (isSetDefaultKey) {
|
||||
moduleIds = [];
|
||||
}
|
||||
|
||||
if (route.query.home) {
|
||||
if (route.query.home === WorkNavValueEnum.TEST_PLAN_ARCHIVED) {
|
||||
viewId.value = 'archived';
|
||||
} else {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
type: showType.value,
|
||||
moduleIds,
|
||||
|
@ -1730,6 +1721,13 @@
|
|||
setAdvanceFilter({ conditions: [], searchMode: 'AND' }, route.query.view as string);
|
||||
viewName.value = route.query.view as string;
|
||||
}
|
||||
if (route.query.home) {
|
||||
if (route.query.home === WorkNavValueEnum.TEST_PLAN_ARCHIVED) {
|
||||
viewId.value = 'archived';
|
||||
} else {
|
||||
propsRes.value.filter = { ...NAV_NAVIGATION[route.query.home as WorkNavValueEnum] };
|
||||
}
|
||||
}
|
||||
fetchData();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<a-trigger position="bottom" trigger="hover" align-point>
|
||||
<div class="progress-container">
|
||||
<div class="progress-bar-background">
|
||||
<div :class="`progress-bar w-[${props.progress}%] bg-[${props.progressColor}]`"></div>
|
||||
<div class="progress-bar" :style="{ width: `${props.progress}%`, background: `${props.progressColor}` }"></div>
|
||||
</div>
|
||||
<div class="threshold-line" :style="{ left: `${props.threshold === 100 ? 99 : props.threshold}%` }"></div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue