修复导出设置默认文件名无效问题 #1988

This commit is contained in:
xuliangzhan
2023-03-16 22:27:57 +08:00
parent cce5b71315
commit d0ea8f4359
5 changed files with 21 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "3.6.12-beta.4",
"version": "3.6.12-beta.6",
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器等...",
"scripts": {
"update": "npm install --legacy-peer-deps",

View File

@@ -1091,11 +1091,9 @@ function handleExportAndPrint ($xetable, options, isPrint) {
visible: true
})
// 默认参数
if (!initStore.export) {
Object.assign(exportParams, {
mode: selectRecords.length ? 'selected' : 'current'
}, defOpts)
}
Object.assign(exportParams, {
mode: selectRecords.length ? 'selected' : 'current'
}, defOpts)
if (modes.indexOf(exportParams.mode) === -1) {
exportParams.mode = modes[0]
}

View File

@@ -187,6 +187,8 @@ export default {
autoResize: { type: Boolean, default: () => GlobalConfig.table.autoResize },
// 是否自动根据状态属性去更新响应式表格宽高
syncResize: [Boolean, String, Number],
// 响应式布局配置项
resizeConfig: Object,
// 列配置信息
columnConfig: Object,
// 行配置信息
@@ -479,6 +481,9 @@ export default {
rowOpts () {
return Object.assign({}, GlobalConfig.table.rowConfig, this.rowConfig)
},
resizeOpts () {
return Object.assign({}, GlobalConfig.table.resizeConfig, this.resizeConfig)
},
resizableOpts () {
return Object.assign({}, GlobalConfig.table.resizableConfig, this.resizableConfig)
},
@@ -903,7 +908,11 @@ export default {
}
}
if (this.autoResize) {
const resizeObserver = createResizeEvent(() => this.recalculate(true))
const resizeObserver = createResizeEvent(this.resizeOpts.refreshDelay ? XEUtils.throttle(() => {
this.recalculate(true)
}, this.resizeOpts.refreshDelay, { leading: true, trailing: true }) : () => {
this.recalculate(true)
})
resizeObserver.observe(this.$el)
resizeObserver.observe(this.getParentElem())
this.$resize = resizeObserver

View File

@@ -84,10 +84,10 @@ function renderBtns (h, _vm) {
* 渲染右侧工具
*/
function renderRightTools (h, _vm) {
const { _e, $scopedSlots, $xetable, tools = [] } = _vm
const { _e, $scopedSlots, $xetable, $xegrid, tools = [] } = _vm
const toolsSlot = $scopedSlots.tools
if (toolsSlot) {
return toolsSlot.call(_vm, { $table: $xetable, $grid: $xetable.xegrid }, h)
return toolsSlot.call(_vm, { $table: $xetable, $grid: $xegrid }, h)
}
return tools.map(item => {
const { dropdowns, toolRender } = item
@@ -100,7 +100,7 @@ function renderRightTools (h, _vm) {
if (renderToolbarTool) {
return h('span', {
class: 'vxe-tool--item'
}, getSlotVNs(renderToolbarTool.call(_vm, h, toolRender, { $table: $xetable, $grid: $xetable.xegrid, tool: item })))
}, getSlotVNs(renderToolbarTool.call(_vm, h, toolRender, { $table: $xetable, $grid: $xegrid, tool: item })))
}
}
return h('vxe-button', {
@@ -601,7 +601,7 @@ export default {
$xegrid.triggerToolbarBtnEvent(item, evnt)
} else {
const commandMethod = VXETable.commands.get(code)
const params = { code, button: item, $table: $xetable, $grid: $xetable.xegrid, $event: evnt }
const params = { code, button: item, $table: $xetable, $grid: $xegrid, $event: evnt }
if (commandMethod) {
commandMethod.call(this, params, evnt)
}

View File

@@ -30,6 +30,9 @@ export default {
// rowConfig: {
// keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
// },
resizeConfig: {
refreshDelay: 250
},
radioConfig: {
// trigger: 'default'
strict: true