vxe-table 3.4.5 → 3.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -670,7 +670,11 @@ export default {
670
670
  body.insertRecords = insertRecords.filter(row => pendingRecords.indexOf(row) === -1)
671
671
  }
672
672
  // 只校验新增和修改的数据
673
- return this.validate(body.insertRecords.concat(updateRecords)).then(() => {
673
+ return this.validate(body.insertRecords.concat(updateRecords)).then((errMap) => {
674
+ if (errMap) {
675
+ // 如果校验不通过
676
+ return
677
+ }
674
678
  if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
675
679
  this.tableLoading = true
676
680
  return Promise.resolve((beforeSave || ajaxMethods)(...applyArgs))
@@ -715,7 +719,7 @@ export default {
715
719
  VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.dataUnchanged'), status: 'info' })
716
720
  }
717
721
  }
718
- }).catch(errMap => errMap)
722
+ })
719
723
  } else {
720
724
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
721
725
  UtilTools.error('vxe.error.notFunc', ['proxy-config.ajax.save'])
@@ -2097,7 +2097,7 @@ const Methods = {
2097
2097
  * 表格键盘事件
2098
2098
  */
2099
2099
  keydownEvent (evnt) {
2100
- const { filterStore, ctxMenuStore, editStore, keyboardConfig, mouseConfig, mouseOpts } = this
2100
+ const { filterStore, ctxMenuStore, editStore, keyboardConfig, mouseConfig, mouseOpts, keyboardOpts } = this
2101
2101
  const { actived } = editStore
2102
2102
  const { keyCode } = evnt
2103
2103
  const isEsc = keyCode === 27
@@ -2110,13 +2110,15 @@ const Methods = {
2110
2110
  // 如果按下了 Esc 键,关闭快捷菜单、筛选
2111
2111
  this.closeFilter()
2112
2112
  this.closeMenu()
2113
- // 如果是激活编辑状态,则取消编辑
2114
- if (actived.row) {
2115
- const params = actived.args
2116
- this.clearActived(evnt)
2117
- // 如果配置了选中功能,则为选中状态
2118
- if (mouseConfig && mouseOpts.selected) {
2119
- this.$nextTick(() => this.handleSelected(params, evnt))
2113
+ if (keyboardConfig && keyboardOpts.isEsc) {
2114
+ // 如果是激活编辑状态,则取消编辑
2115
+ if (actived.row) {
2116
+ const params = actived.args
2117
+ this.clearActived(evnt)
2118
+ // 如果配置了选中功能,则为选中状态
2119
+ if (mouseConfig && mouseOpts.selected) {
2120
+ this.$nextTick(() => this.handleSelected(params, evnt))
2121
+ }
2120
2122
  }
2121
2123
  }
2122
2124
  }
@@ -114,15 +114,15 @@ export default {
114
114
  footerAlign: { type: String, default: () => GlobalConfig.table.footerAlign },
115
115
  // 是否显示表头
116
116
  showHeader: { type: Boolean, default: () => GlobalConfig.table.showHeader },
117
- // 是否要高亮当前选中行
117
+ // (即将废弃)是否要高亮当前选中行
118
118
  highlightCurrentRow: { type: Boolean, default: () => GlobalConfig.table.highlightCurrentRow },
119
- // 鼠标移到行是否要高亮显示
119
+ // (即将废弃)鼠标移到行是否要高亮显示
120
120
  highlightHoverRow: { type: Boolean, default: () => GlobalConfig.table.highlightHoverRow },
121
- // 是否要高亮当前选中列
121
+ // (即将废弃)是否要高亮当前选中列
122
122
  highlightCurrentColumn: { type: Boolean, default: () => GlobalConfig.table.highlightCurrentColumn },
123
- // 鼠标移到列是否要高亮显示
123
+ // (即将废弃)鼠标移到列是否要高亮显示
124
124
  highlightHoverColumn: { type: Boolean, default: () => GlobalConfig.table.highlightHoverColumn },
125
- // 激活单元格编辑时是否高亮显示
125
+ // (即将废弃)激活单元格编辑时是否高亮显示
126
126
  highlightCell: Boolean,
127
127
  // 是否显示表尾合计
128
128
  showFooter: Boolean,
@@ -235,7 +235,7 @@ export default {
235
235
  scrollX: Object,
236
236
  // 纵向虚拟滚动配置项
237
237
  scrollY: Object,
238
- // 优化相关
238
+ // (即将废弃)优化相关
239
239
  animat: { type: Boolean, default: () => GlobalConfig.table.animat },
240
240
  delayHover: { type: Number, default: () => GlobalConfig.table.delayHover },
241
241
  // 额外的参数
@@ -91,6 +91,9 @@ export default {
91
91
  mouseConfig: {
92
92
  extension: true
93
93
  },
94
+ keyboardConfig: {
95
+ isEsc: true
96
+ },
94
97
  areaConfig: {
95
98
  selectCellByHeader: true
96
99
  },