vxe-table 3.8.15 → 3.8.17

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.
Files changed (73) hide show
  1. package/lib/edit/src/mixin.js +39 -29
  2. package/lib/edit/src/mixin.min.js +1 -1
  3. package/lib/export/src/mixin.js +26 -6
  4. package/lib/export/src/mixin.min.js +1 -1
  5. package/lib/filter/src/mixin.js +5 -0
  6. package/lib/filter/src/mixin.min.js +1 -1
  7. package/lib/grid/src/grid.js +63 -20
  8. package/lib/grid/src/grid.min.js +1 -1
  9. package/lib/icon/style/{iconfont.1721269958416.ttf → iconfont.1723002262597.ttf} +0 -0
  10. package/lib/icon/style/iconfont.1723002262597.woff +0 -0
  11. package/lib/icon/style/iconfont.1723002262597.woff2 +0 -0
  12. package/lib/icon/style/style.css +81 -3
  13. package/lib/icon/style/style.min.css +81 -3
  14. package/lib/{iconfont.1721269958416.ttf → iconfont.1723002262597.ttf} +0 -0
  15. package/lib/iconfont.1723002262597.woff +0 -0
  16. package/lib/iconfont.1723002262597.woff2 +0 -0
  17. package/lib/index.css +1 -1
  18. package/lib/index.umd.js +182 -85
  19. package/lib/index.umd.min.js +1 -1
  20. package/lib/input/src/input.js +14 -6
  21. package/lib/input/src/input.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/table/src/column.js +1 -1
  25. package/lib/table/src/column.min.js +1 -1
  26. package/lib/table/src/columnInfo.js +2 -1
  27. package/lib/table/src/columnInfo.min.js +1 -1
  28. package/lib/table/src/methods.js +18 -16
  29. package/lib/table/src/methods.min.js +1 -1
  30. package/lib/table/style/style.css +70 -46
  31. package/lib/table/style/style.min.css +1 -1
  32. package/lib/toolbar/src/toolbar.js +3 -0
  33. package/lib/toolbar/src/toolbar.min.js +1 -1
  34. package/lib/tools/log.js +1 -1
  35. package/lib/tools/log.min.js +1 -1
  36. package/lib/tools/utils.js +1 -1
  37. package/lib/tools/utils.min.js +1 -1
  38. package/lib/v-x-e-table/index.js +1 -1
  39. package/lib/v-x-e-table/index.min.js +1 -1
  40. package/lib/v-x-e-table/src/conf.js +2 -1
  41. package/lib/v-x-e-table/src/conf.min.js +1 -1
  42. package/lib/v-x-e-table/src/renderer.js +16 -7
  43. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  44. package/lib/v-x-e-table/style/style.css +57 -3
  45. package/lib/v-x-e-table/style/style.min.css +1 -1
  46. package/lib/vxe-icon/style/style.css +81 -3
  47. package/lib/vxe-icon/style/style.min.css +1 -1
  48. package/lib/vxe-table/style/style.css +70 -46
  49. package/lib/vxe-table/style/style.min.css +1 -1
  50. package/package.json +2 -2
  51. package/packages/edit/src/mixin.js +10 -3
  52. package/packages/export/src/mixin.js +15 -4
  53. package/packages/filter/src/mixin.js +5 -0
  54. package/packages/grid/src/grid.js +48 -18
  55. package/packages/input/src/input.js +14 -8
  56. package/packages/table/src/column.js +1 -1
  57. package/packages/table/src/columnInfo.js +2 -1
  58. package/packages/table/src/methods.js +16 -14
  59. package/packages/toolbar/src/toolbar.js +3 -0
  60. package/packages/tools/utils.js +1 -1
  61. package/packages/v-x-e-table/src/conf.js +2 -1
  62. package/packages/v-x-e-table/src/renderer.js +11 -4
  63. package/styles/form.scss +4 -4
  64. package/styles/icon/iconfont.ttf +0 -0
  65. package/styles/icon/iconfont.woff +0 -0
  66. package/styles/icon/iconfont.woff2 +0 -0
  67. package/styles/icon.scss +53 -4
  68. package/styles/old-icon.scss +4 -0
  69. package/styles/table.scss +37 -17
  70. package/lib/icon/style/iconfont.1721269958416.woff +0 -0
  71. package/lib/icon/style/iconfont.1721269958416.woff2 +0 -0
  72. package/lib/iconfont.1721269958416.woff +0 -0
  73. package/lib/iconfont.1721269958416.woff2 +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.8.15",
3
+ "version": "3.8.17",
4
4
  "description": "一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印导出、自定义模板、渲染器、JSON 配置式...",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -27,7 +27,7 @@
27
27
  "typings": "types/index.d.ts",
28
28
  "dependencies": {
29
29
  "dom-zindex": "^1.0.4",
30
- "xe-utils": "^3.5.26"
30
+ "xe-utils": "^3.5.29"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/resize-observer-browser": "^0.1.11",
@@ -368,11 +368,18 @@ export default {
368
368
  * 获取表格数据集,包含新增、删除、修改
369
369
  */
370
370
  _getRecordset () {
371
+ const removeRecords = this.getRemoveRecords()
372
+ const pendingRecords = this.getPendingRecords()
373
+ const delRecords = removeRecords.concat(pendingRecords)
374
+ // 如果已经被删除,则无需放到更新数组
375
+ const updateRecords = this.getUpdateRecords().filter(row => {
376
+ return !delRecords.some(item => this.eqRow(item, row))
377
+ })
371
378
  return {
372
379
  insertRecords: this.getInsertRecords(),
373
- removeRecords: this.getRemoveRecords(),
374
- updateRecords: this.getUpdateRecords(),
375
- pendingRecords: this.getPendingRecords()
380
+ removeRecords,
381
+ updateRecords,
382
+ pendingRecords
376
383
  }
377
384
  },
378
385
  /**
@@ -828,6 +828,8 @@ function handleImport ($xetable, content, opts) {
828
828
  .then((data) => {
829
829
  let loadRest
830
830
  if (opts.mode === 'insert' || opts.mode === 'insertBottom') {
831
+ loadRest = $xetable.insertAt(data, -1)
832
+ } if (opts.mode === 'insertTop') {
831
833
  loadRest = $xetable.insert(data)
832
834
  } else {
833
835
  loadRest = $xetable.reloadData(data)
@@ -895,7 +897,7 @@ function handleFileImport ($xetable, file, opts) {
895
897
  $xetable._importResolve = _importResolve
896
898
  $xetable._importReject = _importReject
897
899
  if (window.FileReader) {
898
- const options = Object.assign({ mode: 'insertBottom' }, opts, { type, filename })
900
+ const options = Object.assign({ mode: 'insertTop' }, opts, { type, filename })
899
901
  if (options.remote) {
900
902
  if (importMethod) {
901
903
  Promise.resolve(importMethod({ file, options, $table: $xetable })).then(() => {
@@ -1328,6 +1330,8 @@ export default {
1328
1330
  if ($xegrid && !opts.remote) {
1329
1331
  const { beforeQueryAll, afterQueryAll, ajax = {}, props = {} } = $xegrid.proxyOpts
1330
1332
  const ajaxMethods = ajax.queryAll
1333
+ const queryAllSuccessMethods = ajax.queryAllSuccess
1334
+ const queryAllErrorMethods = ajax.queryAllError
1331
1335
 
1332
1336
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1333
1337
  if (!ajaxMethods) {
@@ -1346,14 +1350,21 @@ export default {
1346
1350
  options: opts
1347
1351
  }
1348
1352
  return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
1349
- .catch(e => e)
1350
1353
  .then(rest => {
1351
1354
  opts.data = (props.list ? XEUtils.get(rest, props.list) : rest) || []
1352
1355
  if (afterQueryAll) {
1353
1356
  afterQueryAll(params)
1354
1357
  }
1358
+ if (queryAllSuccessMethods) {
1359
+ queryAllSuccessMethods({ ...params, response: rest })
1360
+ }
1355
1361
  return handleExport(this, opts)
1356
1362
  })
1363
+ .catch((rest) => {
1364
+ if (queryAllErrorMethods) {
1365
+ queryAllErrorMethods({ ...params, response: rest })
1366
+ }
1367
+ })
1357
1368
  }
1358
1369
  }
1359
1370
  } else if (mode === 'current') {
@@ -1442,10 +1453,10 @@ export default {
1442
1453
  _openImport (options) {
1443
1454
  const { importOpts } = this
1444
1455
  const defOpts = Object.assign({
1445
- mode: 'insertBottom',
1456
+ mode: 'insertTop',
1446
1457
  message: true,
1447
1458
  types: XEUtils.keys(importOpts._typeMaps),
1448
- modes: ['insertBottom', 'covering']
1459
+ modes: ['insertTop', 'covering']
1449
1460
  }, options, importOpts)
1450
1461
  const types = defOpts.types || []
1451
1462
  const modes = defOpts.modes || []
@@ -261,6 +261,11 @@ export default {
261
261
  })
262
262
  }
263
263
  return this.updateData()
264
+ },
265
+ _updateFilterOptionStatus (item, checked) {
266
+ item._checked = checked
267
+ item.checked = checked
268
+ return this.$nextTick()
264
269
  }
265
270
  }
266
271
  }
@@ -368,11 +368,15 @@ export default {
368
368
  }
369
369
  },
370
370
  computed: {
371
- isMsg () {
372
- return this.proxyOpts.message !== false
371
+ isRespMsg () {
372
+ const { proxyOpts } = this
373
+ return XEUtils.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg
374
+ },
375
+ isActiveMsg () {
376
+ return this.proxyOpts.showActiveMsg
373
377
  },
374
378
  proxyOpts () {
375
- return Object.assign({}, GlobalConfig.grid.proxyConfig, this.proxyConfig)
379
+ return XEUtils.merge({}, GlobalConfig.grid.proxyConfig, this.proxyConfig)
376
380
  },
377
381
  pagerOpts () {
378
382
  return Object.assign({}, GlobalConfig.grid.pagerConfig, this.pagerConfig)
@@ -571,7 +575,7 @@ export default {
571
575
  * @param {String/Object} code 字符串或对象
572
576
  */
573
577
  commitProxy (proxyTarget, ...args) {
574
- const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, formData, isMsg, validConfig, pagerOpts } = this
578
+ const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, formData, isRespMsg, isActiveMsg, validConfig, pagerOpts } = this
575
579
  const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts
576
580
  const resConfigs = proxyOpts.response || proxyOpts.props || {}
577
581
  const $xetable = $refs.xTable
@@ -621,6 +625,8 @@ export default {
621
625
  case 'reload':
622
626
  case 'query': {
623
627
  const ajaxMethods = ajax.query
628
+ const querySuccessMethods = ajax.querySuccess
629
+ const queryErrorMethods = ajax.queryError
624
630
  if (ajaxMethods) {
625
631
  const isInited = code === '_init'
626
632
  const isReload = code === 'reload'
@@ -660,7 +666,7 @@ export default {
660
666
  filterList = $xetable.getCheckedFilters()
661
667
  }
662
668
  }
663
- const params = {
669
+ const commitParams = {
664
670
  code,
665
671
  button,
666
672
  isInited,
@@ -676,7 +682,7 @@ export default {
676
682
  this.sortData = sortList
677
683
  this.filterData = filterList
678
684
  this.tableLoading = true
679
- const applyArgs = [params].concat(args)
685
+ const applyArgs = [commitParams].concat(args)
680
686
  return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs))
681
687
  .then(rest => {
682
688
  this.tableLoading = false
@@ -702,9 +708,15 @@ export default {
702
708
  if (afterQuery) {
703
709
  afterQuery(...applyArgs)
704
710
  }
711
+ if (querySuccessMethods) {
712
+ querySuccessMethods({ ...commitParams, response: rest })
713
+ }
705
714
  return { status: true }
706
- }).catch(() => {
715
+ }).catch((rest) => {
707
716
  this.tableLoading = false
717
+ if (queryErrorMethods) {
718
+ queryErrorMethods({ ...commitParams, response: rest })
719
+ }
708
720
  return { status: false }
709
721
  })
710
722
  } else {
@@ -716,11 +728,14 @@ export default {
716
728
  }
717
729
  case 'delete': {
718
730
  const ajaxMethods = ajax.delete
731
+ const deleteSuccessMethods = ajax.deleteSuccess
732
+ const deleteErrorMethods = ajax.deleteError
719
733
  if (ajaxMethods) {
720
734
  const selectRecords = $xetable.getCheckboxRecords()
721
735
  const removeRecords = selectRecords.filter(row => !$xetable.isInsertByRow(row))
722
736
  const body = { removeRecords }
723
- const applyArgs = [{ $grid: this, code, button, body, form: formData, options: ajaxMethods }].concat(args)
737
+ const commitParams = { $grid: this, code, button, body, form: formData, options: ajaxMethods }
738
+ const applyArgs = [commitParams].concat(args)
724
739
  if (selectRecords.length) {
725
740
  return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
726
741
  if (!removeRecords.length) {
@@ -731,7 +746,7 @@ export default {
731
746
  .then(rest => {
732
747
  this.tableLoading = false
733
748
  $xetable.setPendingRow(removeRecords, false)
734
- if (isMsg) {
749
+ if (isRespMsg) {
735
750
  // 检测弹窗模块
736
751
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
737
752
  if (!VXETable.modal) {
@@ -745,11 +760,14 @@ export default {
745
760
  } else {
746
761
  this.commitProxy('query')
747
762
  }
763
+ if (deleteSuccessMethods) {
764
+ deleteSuccessMethods({ ...commitParams, response: rest })
765
+ }
748
766
  return { status: true }
749
767
  })
750
768
  .catch(rest => {
751
769
  this.tableLoading = false
752
- if (isMsg) {
770
+ if (isRespMsg) {
753
771
  // 检测弹窗模块
754
772
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
755
773
  if (!VXETable.modal) {
@@ -758,11 +776,14 @@ export default {
758
776
  }
759
777
  VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
760
778
  }
779
+ if (deleteErrorMethods) {
780
+ deleteErrorMethods({ ...commitParams, response: rest })
781
+ }
761
782
  return { status: false }
762
783
  })
763
784
  })
764
785
  } else {
765
- if (isMsg) {
786
+ if (isActiveMsg) {
766
787
  // 检测弹窗模块
767
788
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
768
789
  if (!VXETable.modal) {
@@ -781,10 +802,13 @@ export default {
781
802
  }
782
803
  case 'save': {
783
804
  const ajaxMethods = ajax.save
805
+ const saveSuccessMethods = ajax.saveSuccess
806
+ const saveErrorMethods = ajax.saveError
784
807
  if (ajaxMethods) {
785
808
  const body = this.getRecordset()
786
809
  const { insertRecords, removeRecords, updateRecords, pendingRecords } = body
787
- const applyArgs = [{ $grid: this, code, button, body, form: formData, options: ajaxMethods }].concat(args)
810
+ const commitParams = { $grid: this, code, button, body, form: formData, options: ajaxMethods }
811
+ const applyArgs = [commitParams].concat(args)
788
812
  // 排除掉新增且标记为删除的数据
789
813
  if (insertRecords.length) {
790
814
  body.pendingRecords = pendingRecords.filter(row => insertRecords.indexOf(row) === -1)
@@ -809,7 +833,7 @@ export default {
809
833
  .then(rest => {
810
834
  this.tableLoading = false
811
835
  $xetable.clearPendingRow()
812
- if (isMsg) {
836
+ if (isRespMsg) {
813
837
  // 检测弹窗模块
814
838
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
815
839
  if (!VXETable.modal) {
@@ -823,11 +847,14 @@ export default {
823
847
  } else {
824
848
  this.commitProxy('query')
825
849
  }
850
+ if (saveSuccessMethods) {
851
+ saveSuccessMethods({ ...commitParams, response: rest })
852
+ }
826
853
  return { status: true }
827
854
  })
828
855
  .catch(rest => {
829
856
  this.tableLoading = false
830
- if (isMsg) {
857
+ if (isRespMsg) {
831
858
  // 检测弹窗模块
832
859
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
833
860
  if (!VXETable.modal) {
@@ -836,10 +863,13 @@ export default {
836
863
  }
837
864
  VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
838
865
  }
866
+ if (saveErrorMethods) {
867
+ saveErrorMethods({ ...commitParams, response: rest })
868
+ }
839
869
  return { status: false }
840
870
  })
841
871
  } else {
842
- if (isMsg) {
872
+ if (isActiveMsg) {
843
873
  // 检测弹窗模块
844
874
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
845
875
  if (!VXETable.modal) {
@@ -883,7 +913,7 @@ export default {
883
913
  },
884
914
  handleDeleteRow (code, alertKey, callback) {
885
915
  const selectRecords = this.getCheckboxRecords()
886
- if (this.isMsg) {
916
+ if (this.isActiveMsg) {
887
917
  if (selectRecords.length) {
888
918
  return VXETable.modal.confirm({ id: `cfm_${code}`, content: GlobalConfig.i18n(alertKey), escClosable: true }).then(type => {
889
919
  if (type === 'confirm') {
@@ -931,13 +961,13 @@ export default {
931
961
  this.$emit('toolbar-tool-click', { code: tool.code, tool, $grid: this, $event: evnt })
932
962
  },
933
963
  triggerPendingEvent (code) {
934
- const { isMsg } = this
964
+ const { isActiveMsg } = this
935
965
  const selectRecords = this.getCheckboxRecords()
936
966
  if (selectRecords.length) {
937
967
  this.togglePendingRow(selectRecords)
938
968
  this.clearCheckboxRow()
939
969
  } else {
940
- if (isMsg) {
970
+ if (isActiveMsg) {
941
971
  // 检测弹窗模块
942
972
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
943
973
  if (!VXETable.modal) {
@@ -628,8 +628,8 @@ export default {
628
628
  type: String,
629
629
  default: () => XEUtils.eqNull(GlobalConfig.input.placeholder) ? GlobalConfig.i18n('vxe.base.pleaseInput') : GlobalConfig.input.placeholder
630
630
  },
631
- maxlength: [String, Number],
632
- autocomplete: { type: String, default: 'off' },
631
+ maxLength: [String, Number],
632
+ autoComplete: { type: String, default: 'off' },
633
633
  align: String,
634
634
  form: String,
635
635
  className: String,
@@ -673,7 +673,12 @@ export default {
673
673
  prefixIcon: String,
674
674
  suffixIcon: String,
675
675
  placement: String,
676
- transfer: { type: Boolean, default: () => GlobalConfig.input.transfer }
676
+ transfer: { type: Boolean, default: () => GlobalConfig.input.transfer },
677
+
678
+ // 已废弃
679
+ maxlength: [String, Number],
680
+ // 已废弃
681
+ autocomplete: String
677
682
  },
678
683
  inject: {
679
684
  $xeform: {
@@ -722,7 +727,8 @@ export default {
722
727
  return XEUtils.getSize(this.inputValue)
723
728
  },
724
729
  isCountError () {
725
- return this.maxlength && this.inputCount > XEUtils.toNumber(this.maxlength)
730
+ const { maxLength, maxlength } = this
731
+ return (maxLength || maxlength) && this.inputCount > XEUtils.toNumber(maxLength || maxlength)
726
732
  },
727
733
  stepValue () {
728
734
  const { type, step } = this
@@ -1047,9 +1053,9 @@ export default {
1047
1053
  return type
1048
1054
  },
1049
1055
  inpMaxlength () {
1050
- const { isNumType, maxlength } = this
1056
+ const { isNumType, maxLength, maxlength } = this
1051
1057
  // 数值最大长度限制 16 位,包含小数
1052
- return isNumType && !XEUtils.toNumber(maxlength) ? 16 : maxlength
1058
+ return isNumType && !XEUtils.toNumber(maxLength || maxlength) ? 16 : (maxLength || maxlength)
1053
1059
  },
1054
1060
  inpReadonly () {
1055
1061
  const { type, readonly, editable, multiple } = this
@@ -1135,7 +1141,7 @@ export default {
1135
1141
  GlobalEvent.off(this, 'blur')
1136
1142
  },
1137
1143
  render (h) {
1138
- const { name, form, inputType, inpPlaceholder, inpMaxlength, inpReadonly, className, controls, showWordCount, countMethod, inputValue, isDatePickerType, visiblePanel, isActivated, vSize, type, align, readonly, disabled, autocomplete } = this
1144
+ const { name, form, inputType, inpPlaceholder, inpMaxlength, inpReadonly, className, controls, showWordCount, countMethod, inputValue, isDatePickerType, visiblePanel, isActivated, vSize, type, align, readonly, disabled, autoComplete, autocomplete } = this
1139
1145
  const childs = []
1140
1146
  const prefix = rendePrefixIcon(h, this)
1141
1147
  const suffix = renderSuffixIcon(h, this)
@@ -1159,7 +1165,7 @@ export default {
1159
1165
  maxlength: inpMaxlength,
1160
1166
  readonly: inpReadonly,
1161
1167
  disabled,
1162
- autocomplete
1168
+ autocomplete: autoComplete || autocomplete
1163
1169
  },
1164
1170
  on: {
1165
1171
  keydown: this.keydownEvent,
@@ -129,7 +129,7 @@ export default {
129
129
  this.columnConfig = this.createColumn(this.$xetable, this)
130
130
  },
131
131
  mounted () {
132
- UtilTools.assemColumn(this)
132
+ UtilTools.assembleColumn(this)
133
133
  },
134
134
  destroyed () {
135
135
  UtilTools.destroyColumn(this)
@@ -151,7 +151,8 @@ export class ColumnInfo {
151
151
  }
152
152
 
153
153
  getKey () {
154
- return this.field || (this.type ? `type=${this.type}` : null)
154
+ const { type } = this
155
+ return this.field || (type ? `type=${type}` : null)
155
156
  }
156
157
 
157
158
  update (name, value) {
@@ -392,11 +392,11 @@ const Methods = {
392
392
  if (childrenField === treeOpts.mapChildrenField) {
393
393
  errLog('vxe.error.errConflicts', ['tree-config.childrenField', 'tree-config.mapChildrenField'])
394
394
  }
395
- fullData.forEach(row => {
396
- if (row[childrenField] && row[childrenField].length) {
397
- warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${childrenField}`])
398
- }
399
- })
395
+ // fullData.forEach(row => {
396
+ // if (row[childrenField] && row[childrenField].length) {
397
+ // warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${childrenField}`])
398
+ // }
399
+ // })
400
400
  }
401
401
  treeData = XEUtils.toArrayTree(fullData, {
402
402
  key: treeOpts.rowField,
@@ -725,7 +725,7 @@ const Methods = {
725
725
  }, { children: childrenField })
726
726
  row[childrenField] = rows
727
727
  if (transform) {
728
- row[mapChildrenField] = rows
728
+ row[mapChildrenField] = XEUtils.clone(rows, false)
729
729
  }
730
730
  this.updateAfterDataIndex()
731
731
  return rows
@@ -2655,13 +2655,15 @@ const Methods = {
2655
2655
  this.clearSelected()
2656
2656
  }
2657
2657
  if (areaOpts.autoClear) {
2658
- const cellAreas = this.getCellAreas()
2659
- if (cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
2660
- this.preventEvent(evnt, 'event.clearAreas', {}, () => {
2661
- this.clearCellAreas()
2662
- this.clearCopyCellArea()
2663
- this.emitEvent('clear-cell-area-selection', { cellAreas }, evnt)
2664
- })
2658
+ if (this.getCellAreas) {
2659
+ const cellAreas = this.getCellAreas()
2660
+ if (cellAreas && cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
2661
+ this.preventEvent(evnt, 'event.clearAreas', {}, () => {
2662
+ this.clearCellAreas()
2663
+ this.clearCopyCellArea()
2664
+ this.emitEvent('clear-cell-area-selection', { cellAreas }, evnt)
2665
+ })
2666
+ }
2665
2667
  }
2666
2668
  }
2667
2669
  }
@@ -5478,7 +5480,7 @@ const Methods = {
5478
5480
  }
5479
5481
 
5480
5482
  // Module methods
5481
- const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,getPrintHtml,exportData,openImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',')
5483
+ const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,getPrintHtml,exportData,openImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',')
5482
5484
 
5483
5485
  funcs.forEach(name => {
5484
5486
  Methods[name] = function (...args) {
@@ -18,6 +18,7 @@ const renderDropdowns = (h, _vm, item, isBtn) => {
18
18
  disabled: child.disabled,
19
19
  loading: child.loading,
20
20
  type: child.type,
21
+ mode: child.mode,
21
22
  icon: child.icon,
22
23
  circle: child.circle,
23
24
  round: child.round,
@@ -63,6 +64,7 @@ function renderBtns (h, _vm) {
63
64
  disabled: item.disabled,
64
65
  loading: item.loading,
65
66
  type: item.type,
67
+ mode: item.mode,
66
68
  icon: item.icon,
67
69
  circle: item.circle,
68
70
  round: item.round,
@@ -112,6 +114,7 @@ function renderRightTools (h, _vm) {
112
114
  disabled: item.disabled,
113
115
  loading: item.loading,
114
116
  type: item.type,
117
+ mode: item.mode,
115
118
  icon: item.icon,
116
119
  circle: item.circle,
117
120
  round: item.round,
@@ -48,7 +48,7 @@ export const UtilTools = {
48
48
  return XEUtils.set(row, column.field, value)
49
49
  },
50
50
  // 组装列配置
51
- assemColumn (_vm) {
51
+ assembleColumn (_vm) {
52
52
  const { $el, $xetable, $xecolumn, columnConfig } = _vm
53
53
  const groupConfig = $xecolumn ? $xecolumn.columnConfig : null
54
54
  columnConfig.slots = _vm.$scopedSlots
@@ -263,7 +263,8 @@ export default {
263
263
  proxyConfig: {
264
264
  enabled: true,
265
265
  autoLoad: true,
266
- message: true,
266
+ showResponseMsg: true,
267
+ showActiveMsg: true,
267
268
  props: {
268
269
  list: null,
269
270
  result: 'result',
@@ -418,6 +418,13 @@ function handleFilterMethod ({ option, row, column }) {
418
418
  return cellValue == data
419
419
  }
420
420
 
421
+ function handleInputFilterMethod ({ option, row, column }) {
422
+ const { data } = option
423
+ const cellValue = XEUtils.get(row, column.property)
424
+ /* eslint-disable eqeqeq */
425
+ return XEUtils.toValueString(cellValue).indexOf(data) > -1
426
+ }
427
+
421
428
  function nativeSelectEditRender (h, renderOpts, params) {
422
429
  return [
423
430
  h('select', {
@@ -463,7 +470,7 @@ function getSelectCellValue (renderOpts, { row, column }) {
463
470
  let selectItem
464
471
  const labelProp = optionProps.label || 'label'
465
472
  const valueProp = optionProps.value || 'value'
466
- if (!isEmptyValue(cellValue)) {
473
+ if (!(cellValue === null || cellValue === undefined)) {
467
474
  return XEUtils.map(props.multiple ? cellValue : [cellValue], optionGroups ? (value) => {
468
475
  const groupOptions = optionGroupProps.options || 'options'
469
476
  for (let index = 0; index < optionGroups.length; index++) {
@@ -662,7 +669,7 @@ const renderMap = {
662
669
  renderEdit: nativeEditRender,
663
670
  renderDefault: nativeEditRender,
664
671
  renderFilter: nativeFilterRender,
665
- defaultFilterMethod: handleFilterMethod,
672
+ defaultFilterMethod: handleInputFilterMethod,
666
673
  renderItemContent: nativeItemRender
667
674
  },
668
675
  textarea: {
@@ -727,7 +734,7 @@ const renderMap = {
727
734
  },
728
735
  renderDefault: defaultEditRender,
729
736
  renderFilter: defaultFilterRender,
730
- defaultFilterMethod: handleFilterMethod,
737
+ defaultFilterMethod: handleInputFilterMethod,
731
738
  renderItemContent: defaultItemRender
732
739
  },
733
740
  VxeTextarea: {
@@ -838,7 +845,7 @@ const renderMap = {
838
845
  },
839
846
  renderDefault: oldEditRender,
840
847
  renderFilter: oldFilterRender,
841
- defaultFilterMethod: handleFilterMethod,
848
+ defaultFilterMethod: handleInputFilterMethod,
842
849
  renderItemContent: oldItemRender
843
850
  },
844
851
  $textarea: {
package/styles/form.scss CHANGED
@@ -234,7 +234,7 @@
234
234
  padding: 0 0.8em;
235
235
  }
236
236
  .vxe-default-textarea {
237
- height: calc($vxe-button-height-default * 2);
237
+ height: $vxe-button-height-default * 2;
238
238
  padding: 0.3em 0.6em;
239
239
  }
240
240
  .vxe-default-input[type="number"] {
@@ -324,7 +324,7 @@
324
324
  height: $vxe-button-height-medium;
325
325
  }
326
326
  .vxe-default-textarea {
327
- height: calc($vxe-button-height-medium * 2);
327
+ height: $vxe-button-height-medium * 2;
328
328
  }
329
329
  }
330
330
  &.size--small {
@@ -341,7 +341,7 @@
341
341
  height: $vxe-button-height-small;
342
342
  }
343
343
  .vxe-default-textarea {
344
- height: calc($vxe-button-height-small * 2);
344
+ height: $vxe-button-height-small * 2;
345
345
  }
346
346
  }
347
347
  &.size--mini {
@@ -358,7 +358,7 @@
358
358
  height: $vxe-button-height-mini;
359
359
  }
360
360
  .vxe-default-textarea {
361
- height: calc($vxe-button-height-mini * 2);
361
+ height: $vxe-button-height-mini * 2;
362
362
  }
363
363
  }
364
364
  }
Binary file
Binary file
Binary file