diff --git a/package.json b/package.json index ab0fb56489..efaad1cdca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table", - "version": "4.9.30", + "version": "4.9.31", "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...", "scripts": { "update": "npm install --legacy-peer-deps", @@ -28,7 +28,7 @@ "style": "lib/style.css", "typings": "types/index.d.ts", "dependencies": { - "vxe-pc-ui": "^4.3.36" + "vxe-pc-ui": "^4.3.37" }, "devDependencies": { "@types/resize-observer-browser": "^0.1.11", diff --git a/packages/table/module/filter/panel.ts b/packages/table/module/filter/panel.ts index 41eb62ed05..3e1e7b6406 100644 --- a/packages/table/module/filter/panel.ts +++ b/packages/table/module/filter/panel.ts @@ -198,11 +198,13 @@ export default defineComponent({ const renderVN = () => { const { filterStore } = props const { initStore } = tableReactData - const { column } = filterStore + const { visible, multiple, column } = filterStore const filterRender = column ? column.filterRender : null const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null const filterClassName = compConf ? (compConf.tableFilterClassName || compConf.filterClassName) : '' const params = Object.assign({}, tableInternalData._currFilterParams, { $panel, $table: $xeTable }) + const filterOpts = computeFilterOpts.value + const { destroyOnClose } = filterOpts return h('div', { class: [ 'vxe-table--filter-wrapper', @@ -210,12 +212,12 @@ export default defineComponent({ getPropClass(filterClassName, params), { 'is--animat': $xeTable.props.animat, - 'is--multiple': filterStore.multiple, - 'is--active': filterStore.visible + 'is--multiple': multiple, + 'is--active': visible } ], style: filterStore.style - }, initStore.filter && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : []) + }, initStore.filter && (destroyOnClose ? visible : true) && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : []) } return renderVN diff --git a/packages/table/src/table.ts b/packages/table/src/table.ts index 0c7f369b3e..368f0a0fad 100644 --- a/packages/table/src/table.ts +++ b/packages/table/src/table.ts @@ -4924,18 +4924,25 @@ export default defineComponent({ const rowRest = fullAllDataRowIdData[getRowid($xeTable, row)] return rowRest && !!rowRest.treeLoaded }, - clearTreeExpandLoaded (row) { + clearTreeExpandLoaded (rows: any) { const { treeExpandedMaps } = reactData const { fullAllDataRowIdData } = internalData const treeOpts = computeTreeOpts.value - const { transform, lazy } = treeOpts - const rowid = getRowid($xeTable, row) - const rowRest = fullAllDataRowIdData[rowid] - if (lazy && rowRest) { - rowRest.treeLoaded = false - if (treeExpandedMaps[rowid]) { - delete treeExpandedMaps[rowid] + const { transform } = treeOpts + if (rows) { + if (!XEUtils.isArray(rows)) { + rows = [rows] } + rows.forEach((row: any) => { + const rowid = getRowid($xeTable, row) + const rowRest = fullAllDataRowIdData[rowid] + if (rowRest) { + rowRest.treeLoaded = false + if (treeExpandedMaps[rowid]) { + delete treeExpandedMaps[rowid] + } + } + }) } if (transform) { handleVirtualTreeToList() diff --git a/packages/ui/index.ts b/packages/ui/index.ts index 4e0574f0e8..ea54196137 100644 --- a/packages/ui/index.ts +++ b/packages/ui/index.ts @@ -111,6 +111,7 @@ VxeUI.setConfig({ filterConfig: { // remote: false, // filterMethod: null, + // destroyOnClose: false, showIcon: true }, treeConfig: {