Skip to content

Commit

Permalink
fix(frontend): 全选或勾选后,修改了筛选条件这时候应该重置勾选状态 TencentBlueKing#9237
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed Feb 11, 2025
1 parent 971c25a commit 93a138a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dbm-ui/frontend/src/components/db-table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
let sortParams = {};

let isReady = false;

let isPaginationChangeFetch = false;
/**
* 判断是否处于搜索状态
*/
Expand All @@ -366,6 +366,10 @@
replaceSearchParams,
} = useUrlSearch();

const triggerSelection = () => {
emits('selection', Object.keys(rowSelectMemo.value), Object.values(rowSelectMemo.value));
};

const fetchListData = (loading = true) => {
isReady = true;
Promise.resolve()
Expand Down Expand Up @@ -406,6 +410,12 @@
if (!props.fixedPagination && props.releateUrlQuery) {
replaceSearchParams(params);
}
if (!isPaginationChangeFetch) {
isPaginationChangeFetch = false;
rowSelectMemo.value = {}
isWholeChecked.value = false
triggerSelection();
}

emits('requestSuccess', data);
})
Expand Down Expand Up @@ -439,9 +449,7 @@
tableKey.value = Date.now().toString();
});

const triggerSelection = () => {
emits('selection', Object.keys(rowSelectMemo.value), Object.values(rowSelectMemo.value));
};


// 解析 URL 上面的分页信息
const parseURL = () => {
Expand Down Expand Up @@ -600,6 +608,7 @@
}
pagination.limit = pageLimit;
pagination.current = 1;
isPaginationChangeFetch = true
fetchListData();
};

Expand All @@ -609,6 +618,7 @@
return
}
pagination.current = pageValue;
isPaginationChangeFetch = true

fetchListData();
};
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default defineConfig(({ mode }) => {
server: {
strictPort: true,
host: '127.0.0.1',
allowedHosts: true,
port: 8088,
proxy: {
'/bkrepo_upload': {
Expand Down

0 comments on commit 93a138a

Please sign in to comment.