feat: 解决批量删除之后选中数据清除问题

This commit is contained in:
xuziqiang
2024-07-01 16:04:12 +08:00
parent 7eb8ba79f8
commit 2d9fc62d86
4 changed files with 19 additions and 5 deletions

View File

@@ -72,8 +72,11 @@
},
setup(props) {
const { columnActions, searchData, data } = toRefs(props);
const reload = inject('reload', () => {});
const { filterAction, transformAction } = useAction({ reload });
const clearCheck = inject('clearCheck', () => {});
const { filterAction, transformAction } = useAction({ reload, clearCheck });
const route = useRoute();
const getData = computed(() => {
return {

View File

@@ -232,6 +232,10 @@
loadErrorMessage: '',
loadinterval: 0,
});
const clearCheck = () => {
tableState.selectedRowKeys = [];
tableState.selectedRows = [];
};
const route = useRoute();
const { getColumnActionWidth } = useTableColumn({
columnActions: Object.assign({}, tableConfig.columnActions, props.columnActions),
@@ -410,8 +414,6 @@
return false;
});
console.log(getPagination.value);
const getTableBindValues = computed(() => {
const { params, dynamicParams } = props;
return {
@@ -511,7 +513,6 @@
tableState.loadError = false;
tableState.loadErrorMessage = '';
dataRef.value = res;
console.log(props.listField);
tableData.value = get(unref(dataRef), props.listField);
//saas项目配置
if (attrs['getPageParams']) {
@@ -617,10 +618,12 @@
}
provide('reload', reload); //提供刷新功能
provide('clearCheck', clearCheck); //提供清空选中功能
return {
navigateBack,
reload,
clearCheck,
formElRef,
tableElRef,
getColumnActions,