vxe-table 3.5.9-beta.8 → 3.6.0-beta.0
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.
- package/lib/button/src/button.js +5 -1
- package/lib/button/src/button.min.js +1 -1
- package/lib/edit/src/mixin.js +12 -8
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/filter/src/panel.js +2 -1
- package/lib/filter/src/panel.min.js +1 -1
- package/lib/form/src/form-config-item.js +9 -13
- package/lib/form/src/form-config-item.min.js +1 -1
- package/lib/form/src/form-gather.js +1 -3
- package/lib/form/src/form-gather.min.js +1 -1
- package/lib/form/src/form-item.js +12 -13
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +6 -3
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/util.js +41 -0
- package/lib/form/src/util.min.js +1 -1
- package/lib/grid/src/grid.js +3 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +1 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/header/src/header.js +9 -2
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/style/style.css +0 -100
- package/lib/header/style/style.min.css +0 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +756 -660
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +9 -7
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/modal/style/style.css +2 -2
- package/lib/modal/style/style.min.css +1 -1
- package/lib/pager/style/style.css +1 -1
- package/lib/pager/style/style.min.css +1 -1
- package/lib/select/src/select.js +3 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/cell.js +23 -16
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +300 -269
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +101 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/style/style.css +1 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tools/vn.js +18 -0
- package/lib/tools/vn.min.js +1 -0
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +10 -5
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +1 -1
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/button/src/button.js +7 -1
- package/packages/edit/src/mixin.js +10 -7
- package/packages/filter/src/panel.js +1 -1
- package/packages/form/src/form-config-item.js +8 -12
- package/packages/form/src/form-gather.js +1 -3
- package/packages/form/src/form-item.js +12 -14
- package/packages/form/src/form.js +6 -4
- package/packages/form/src/util.js +23 -0
- package/packages/grid/src/grid.js +2 -1
- package/packages/header/src/header.js +3 -2
- package/packages/modal/src/modal.js +5 -4
- package/packages/select/src/select.js +2 -1
- package/packages/table/src/cell.js +17 -13
- package/packages/table/src/methods.js +67 -46
- package/packages/tools/vn.js +8 -0
- package/packages/v-x-e-table/src/store.js +8 -4
- package/styles/header.scss +0 -134
- package/styles/table.scss +134 -0
- package/styles/variable.scss +1 -1
- package/types/column.d.ts +8 -8
- package/types/component.d.ts +3 -1
- package/types/v-x-e-table/renderer.d.ts +2 -1
|
@@ -7,6 +7,7 @@ import UtilTools, { eqEmptyValue, isEnableConf, getFuncText } from '../../tools/
|
|
|
7
7
|
import DomTools, { browse, getPaddingTopBottomSize, setScrollTop, setScrollLeft } from '../../tools/dom'
|
|
8
8
|
import { formats } from '../../v-x-e-table/src/formats'
|
|
9
9
|
import { warnLog, errLog } from '../../tools/log'
|
|
10
|
+
import { getSlotVNs } from '../../tools/vn'
|
|
10
11
|
|
|
11
12
|
const { setCellValue, hasChildrenList, getColumnList } = UtilTools
|
|
12
13
|
const { calcHeight, hasClass, addClass, removeClass, getEventTargetNode, isNodeElement } = DomTools
|
|
@@ -245,7 +246,7 @@ const Methods = {
|
|
|
245
246
|
return $xegrid.callSlot(slotFunc, params, h, vNodes)
|
|
246
247
|
}
|
|
247
248
|
if (XEUtils.isFunction(slotFunc)) {
|
|
248
|
-
return slotFunc.call(this, params, h, vNodes)
|
|
249
|
+
return getSlotVNs(slotFunc.call(this, params, h, vNodes))
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
return []
|
|
@@ -1124,9 +1125,9 @@ const Methods = {
|
|
|
1124
1125
|
} else {
|
|
1125
1126
|
const { selection } = this
|
|
1126
1127
|
if (treeConfig) {
|
|
1127
|
-
rowList = XEUtils.filterTree(currTableData, row =>
|
|
1128
|
+
rowList = XEUtils.filterTree(currTableData, row => this.findRowIndexOf(selection, row) > -1, { children: transform ? mapChildren : children })
|
|
1128
1129
|
} else {
|
|
1129
|
-
rowList = currTableData.filter(row =>
|
|
1130
|
+
rowList = currTableData.filter(row => this.findRowIndexOf(selection, row) > -1)
|
|
1130
1131
|
}
|
|
1131
1132
|
}
|
|
1132
1133
|
return rowList
|
|
@@ -2227,7 +2228,7 @@ const Methods = {
|
|
|
2227
2228
|
// 如果点击了当前表格之外
|
|
2228
2229
|
!getEventTargetNode(evnt, $el).flag
|
|
2229
2230
|
) {
|
|
2230
|
-
setTimeout(() => this.
|
|
2231
|
+
setTimeout(() => this.clearEdit(evnt))
|
|
2231
2232
|
}
|
|
2232
2233
|
})
|
|
2233
2234
|
}
|
|
@@ -2288,7 +2289,7 @@ const Methods = {
|
|
|
2288
2289
|
// 如果是激活编辑状态,则取消编辑
|
|
2289
2290
|
if (actived.row) {
|
|
2290
2291
|
const params = actived.args
|
|
2291
|
-
this.
|
|
2292
|
+
this.clearEdit(evnt)
|
|
2292
2293
|
// 如果配置了选中功能,则为选中状态
|
|
2293
2294
|
if (mouseConfig && mouseOpts.selected) {
|
|
2294
2295
|
this.$nextTick(() => this.handleSelected(params, evnt))
|
|
@@ -2377,7 +2378,7 @@ const Methods = {
|
|
|
2377
2378
|
// 如果是激活编辑状态,则取消编辑
|
|
2378
2379
|
if (actived.row) {
|
|
2379
2380
|
params = actived.args
|
|
2380
|
-
this.
|
|
2381
|
+
this.clearEdit(evnt)
|
|
2381
2382
|
// 如果配置了选中功能,则为选中状态
|
|
2382
2383
|
if (mouseConfig && mouseOpts.selected) {
|
|
2383
2384
|
this.$nextTick(() => this.handleSelected(params, evnt))
|
|
@@ -2726,7 +2727,7 @@ const Methods = {
|
|
|
2726
2727
|
getCheckboxIndeterminateRecords (isFull) {
|
|
2727
2728
|
const { treeConfig, treeIndeterminates, afterFullData } = this
|
|
2728
2729
|
if (treeConfig) {
|
|
2729
|
-
return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(row =>
|
|
2730
|
+
return isFull ? treeIndeterminates.slice(0) : treeIndeterminates.filter(row => this.findRowIndexOf(afterFullData, row) > -1)
|
|
2730
2731
|
}
|
|
2731
2732
|
return []
|
|
2732
2733
|
},
|
|
@@ -2761,14 +2762,16 @@ const Methods = {
|
|
|
2761
2762
|
return this.$nextTick()
|
|
2762
2763
|
},
|
|
2763
2764
|
isCheckedByCheckboxRow (row) {
|
|
2765
|
+
const { selection } = this
|
|
2764
2766
|
const { checkField } = this.checkboxOpts
|
|
2765
2767
|
if (checkField) {
|
|
2766
2768
|
return XEUtils.get(row, checkField)
|
|
2767
2769
|
}
|
|
2768
|
-
return this.selection
|
|
2770
|
+
return this.findRowIndexOf(selection, row) > -1
|
|
2769
2771
|
},
|
|
2770
2772
|
isIndeterminateByCheckboxRow (row) {
|
|
2771
|
-
|
|
2773
|
+
const { treeIndeterminates } = this
|
|
2774
|
+
return this.findRowIndexOf(treeIndeterminates, row) > -1 && !this.isCheckedByCheckboxRow(row)
|
|
2772
2775
|
},
|
|
2773
2776
|
/**
|
|
2774
2777
|
* 多选,行选中事件
|
|
@@ -2780,31 +2783,31 @@ const Methods = {
|
|
|
2780
2783
|
if (checkField) {
|
|
2781
2784
|
if (treeConfig && !checkStrictly) {
|
|
2782
2785
|
if (value === -1) {
|
|
2783
|
-
if (
|
|
2786
|
+
if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
|
|
2784
2787
|
treeIndeterminates.push(row)
|
|
2785
2788
|
}
|
|
2786
2789
|
XEUtils.set(row, checkField, false)
|
|
2787
2790
|
} else {
|
|
2788
2791
|
// 更新子节点状态
|
|
2789
2792
|
XEUtils.eachTree([row], (item) => {
|
|
2790
|
-
if (row
|
|
2793
|
+
if (this.eqRow(item, row) || (!checkMethod || checkMethod({ row: item }))) {
|
|
2791
2794
|
XEUtils.set(item, checkField, value)
|
|
2792
|
-
XEUtils.remove(treeIndeterminates, half => half
|
|
2795
|
+
XEUtils.remove(treeIndeterminates, half => this.eqRow(half, item))
|
|
2793
2796
|
this.handleCheckboxReserveRow(row, value)
|
|
2794
2797
|
}
|
|
2795
2798
|
}, treeOpts)
|
|
2796
2799
|
}
|
|
2797
2800
|
// 如果存在父节点,更新父节点状态
|
|
2798
|
-
const matchObj = XEUtils.findTree(afterFullData, item => item
|
|
2801
|
+
const matchObj = XEUtils.findTree(afterFullData, item => this.eqRow(item, row), treeOpts)
|
|
2799
2802
|
if (matchObj && matchObj.parent) {
|
|
2800
2803
|
let parentStatus
|
|
2801
2804
|
const vItems = checkMethod ? matchObj.items.filter((item) => checkMethod({ row: item })) : matchObj.items
|
|
2802
|
-
const indeterminatesItem = XEUtils.find(matchObj.items, item =>
|
|
2805
|
+
const indeterminatesItem = XEUtils.find(matchObj.items, item => this.findRowIndexOf(treeIndeterminates, item) > -1)
|
|
2803
2806
|
if (indeterminatesItem) {
|
|
2804
2807
|
parentStatus = -1
|
|
2805
2808
|
} else {
|
|
2806
2809
|
const selectItems = matchObj.items.filter(item => XEUtils.get(item, checkField))
|
|
2807
|
-
parentStatus = selectItems.filter(item =>
|
|
2810
|
+
parentStatus = selectItems.filter(item => this.findRowIndexOf(vItems, item) > -1).length === vItems.length ? true : (selectItems.length || value === -1 ? -1 : false)
|
|
2808
2811
|
}
|
|
2809
2812
|
return this.handleSelectRow({ row: matchObj.parent }, parentStatus)
|
|
2810
2813
|
}
|
|
@@ -2817,46 +2820,46 @@ const Methods = {
|
|
|
2817
2820
|
} else {
|
|
2818
2821
|
if (treeConfig && !checkStrictly) {
|
|
2819
2822
|
if (value === -1) {
|
|
2820
|
-
if (
|
|
2823
|
+
if (this.findRowIndexOf(treeIndeterminates, row) === -1) {
|
|
2821
2824
|
treeIndeterminates.push(row)
|
|
2822
2825
|
}
|
|
2823
|
-
XEUtils.remove(selection, item => item
|
|
2826
|
+
XEUtils.remove(selection, item => this.eqRow(item, row))
|
|
2824
2827
|
} else {
|
|
2825
2828
|
// 更新子节点状态
|
|
2826
2829
|
XEUtils.eachTree([row], (item) => {
|
|
2827
|
-
if (row
|
|
2830
|
+
if (this.eqRow(item, row) || (!checkMethod || checkMethod({ row: item }))) {
|
|
2828
2831
|
if (value) {
|
|
2829
2832
|
selection.push(item)
|
|
2830
2833
|
} else {
|
|
2831
|
-
XEUtils.remove(selection, select => select
|
|
2834
|
+
XEUtils.remove(selection, select => this.eqRow(select, item))
|
|
2832
2835
|
}
|
|
2833
|
-
XEUtils.remove(treeIndeterminates, half => half
|
|
2836
|
+
XEUtils.remove(treeIndeterminates, half => this.eqRow(half, item))
|
|
2834
2837
|
this.handleCheckboxReserveRow(row, value)
|
|
2835
2838
|
}
|
|
2836
2839
|
}, treeOpts)
|
|
2837
2840
|
}
|
|
2838
2841
|
// 如果存在父节点,更新父节点状态
|
|
2839
|
-
const matchObj = XEUtils.findTree(afterFullData, item => item
|
|
2842
|
+
const matchObj = XEUtils.findTree(afterFullData, item => this.eqRow(item, row), treeOpts)
|
|
2840
2843
|
if (matchObj && matchObj.parent) {
|
|
2841
2844
|
let parentStatus
|
|
2842
2845
|
const vItems = checkMethod ? matchObj.items.filter((item) => checkMethod({ row: item })) : matchObj.items
|
|
2843
|
-
const indeterminatesItem = XEUtils.find(matchObj.items, item =>
|
|
2846
|
+
const indeterminatesItem = XEUtils.find(matchObj.items, item => this.findRowIndexOf(treeIndeterminates, item) > -1)
|
|
2844
2847
|
if (indeterminatesItem) {
|
|
2845
2848
|
parentStatus = -1
|
|
2846
2849
|
} else {
|
|
2847
|
-
const selectItems = matchObj.items.filter(item =>
|
|
2848
|
-
parentStatus = selectItems.filter(item =>
|
|
2850
|
+
const selectItems = matchObj.items.filter(item => this.findRowIndexOf(selection, item) > -1)
|
|
2851
|
+
parentStatus = selectItems.filter(item => this.findRowIndexOf(vItems, item) > -1).length === vItems.length ? true : (selectItems.length || value === -1 ? -1 : false)
|
|
2849
2852
|
}
|
|
2850
2853
|
return this.handleSelectRow({ row: matchObj.parent }, parentStatus)
|
|
2851
2854
|
}
|
|
2852
2855
|
} else {
|
|
2853
2856
|
if (!checkMethod || checkMethod({ row })) {
|
|
2854
2857
|
if (value) {
|
|
2855
|
-
if (
|
|
2858
|
+
if (this.findRowIndexOf(selection, row) === -1) {
|
|
2856
2859
|
selection.push(row)
|
|
2857
2860
|
}
|
|
2858
2861
|
} else {
|
|
2859
|
-
XEUtils.remove(selection, item => item
|
|
2862
|
+
XEUtils.remove(selection, item => this.eqRow(item, row))
|
|
2860
2863
|
}
|
|
2861
2864
|
this.handleCheckboxReserveRow(row, value)
|
|
2862
2865
|
}
|
|
@@ -2868,7 +2871,7 @@ const Methods = {
|
|
|
2868
2871
|
const { selection, checkboxOpts } = this
|
|
2869
2872
|
const { checkField } = checkboxOpts
|
|
2870
2873
|
const { row } = params
|
|
2871
|
-
const value = checkField ? !XEUtils.get(row, checkField) :
|
|
2874
|
+
const value = checkField ? !XEUtils.get(row, checkField) : this.findRowIndexOf(selection, row) === -1
|
|
2872
2875
|
if (evnt) {
|
|
2873
2876
|
this.triggerCheckRowEvent(evnt, params, value)
|
|
2874
2877
|
} else {
|
|
@@ -2879,7 +2882,12 @@ const Methods = {
|
|
|
2879
2882
|
const { checkMethod } = this.checkboxOpts
|
|
2880
2883
|
if (!checkMethod || checkMethod({ row: params.row })) {
|
|
2881
2884
|
this.handleSelectRow(params, value)
|
|
2882
|
-
this.emitEvent('checkbox-change', Object.assign({
|
|
2885
|
+
this.emitEvent('checkbox-change', Object.assign({
|
|
2886
|
+
records: this.getCheckboxRecords(),
|
|
2887
|
+
reserves: this.getCheckboxReserveRecords(),
|
|
2888
|
+
indeterminates: this.getCheckboxIndeterminateRecords(),
|
|
2889
|
+
checked: value
|
|
2890
|
+
}, params), evnt)
|
|
2883
2891
|
}
|
|
2884
2892
|
},
|
|
2885
2893
|
/**
|
|
@@ -2897,7 +2905,7 @@ const Methods = {
|
|
|
2897
2905
|
const { afterFullData, treeConfig, treeOpts, selection, checkboxReserveRowMap, checkboxOpts } = this
|
|
2898
2906
|
const { checkField, reserve, checkStrictly, checkMethod } = checkboxOpts
|
|
2899
2907
|
let selectRows = []
|
|
2900
|
-
const beforeSelection = treeConfig ? [] : selection.filter(row =>
|
|
2908
|
+
const beforeSelection = treeConfig ? [] : selection.filter(row => this.findRowIndexOf(afterFullData, row) === -1)
|
|
2901
2909
|
if (checkStrictly) {
|
|
2902
2910
|
this.isAllSelected = value
|
|
2903
2911
|
} else {
|
|
@@ -2944,7 +2952,7 @@ const Methods = {
|
|
|
2944
2952
|
*/
|
|
2945
2953
|
if (checkMethod) {
|
|
2946
2954
|
XEUtils.eachTree(afterFullData, (row) => {
|
|
2947
|
-
if (checkMethod({ row }) ? 0 :
|
|
2955
|
+
if (checkMethod({ row }) ? 0 : this.findRowIndexOf(selection, row) > -1) {
|
|
2948
2956
|
selectRows.push(row)
|
|
2949
2957
|
}
|
|
2950
2958
|
}, treeOpts)
|
|
@@ -2958,7 +2966,7 @@ const Methods = {
|
|
|
2958
2966
|
* 如果不存在选中方法,则添加所有数据到临时集合中
|
|
2959
2967
|
*/
|
|
2960
2968
|
if (checkMethod) {
|
|
2961
|
-
selectRows = afterFullData.filter((row) =>
|
|
2969
|
+
selectRows = afterFullData.filter((row) => this.findRowIndexOf(selection, row) > -1 || checkMethod({ row }))
|
|
2962
2970
|
} else {
|
|
2963
2971
|
selectRows = afterFullData.slice(0)
|
|
2964
2972
|
}
|
|
@@ -2969,7 +2977,7 @@ const Methods = {
|
|
|
2969
2977
|
* 如果不存在选中方法,无需处理,临时集合默认为空
|
|
2970
2978
|
*/
|
|
2971
2979
|
if (checkMethod) {
|
|
2972
|
-
selectRows = afterFullData.filter((row) => checkMethod({ row }) ? 0 :
|
|
2980
|
+
selectRows = afterFullData.filter((row) => checkMethod({ row }) ? 0 : this.findRowIndexOf(selection, row) > -1)
|
|
2973
2981
|
}
|
|
2974
2982
|
}
|
|
2975
2983
|
}
|
|
@@ -3016,9 +3024,9 @@ const Methods = {
|
|
|
3016
3024
|
isAllSelected = isAllResolve && afterFullData.length !== disableRows.length
|
|
3017
3025
|
if (treeConfig) {
|
|
3018
3026
|
if (halfField) {
|
|
3019
|
-
isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || XEUtils.get(row, halfField) ||
|
|
3027
|
+
isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || XEUtils.get(row, halfField) || this.findRowIndexOf(treeIndeterminates, row) > -1)
|
|
3020
3028
|
} else {
|
|
3021
|
-
isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) ||
|
|
3029
|
+
isIndeterminate = !isAllSelected && afterFullData.some(row => XEUtils.get(row, checkField) || this.findRowIndexOf(treeIndeterminates, row) > -1)
|
|
3022
3030
|
}
|
|
3023
3031
|
} else {
|
|
3024
3032
|
if (halfField) {
|
|
@@ -3035,19 +3043,19 @@ const Methods = {
|
|
|
3035
3043
|
disableRows.push(row)
|
|
3036
3044
|
return true
|
|
3037
3045
|
}
|
|
3038
|
-
if (
|
|
3046
|
+
if (this.findRowIndexOf(selection, row) > -1) {
|
|
3039
3047
|
checkRows.push(row)
|
|
3040
3048
|
return true
|
|
3041
3049
|
}
|
|
3042
3050
|
return false
|
|
3043
3051
|
}
|
|
3044
|
-
: row =>
|
|
3052
|
+
: row => this.findRowIndexOf(selection, row) > -1
|
|
3045
3053
|
)
|
|
3046
3054
|
isAllSelected = isAllResolve && afterFullData.length !== disableRows.length
|
|
3047
3055
|
if (treeConfig) {
|
|
3048
|
-
isIndeterminate = !isAllSelected && afterFullData.some(row =>
|
|
3056
|
+
isIndeterminate = !isAllSelected && afterFullData.some(row => this.findRowIndexOf(treeIndeterminates, row) > -1 || this.findRowIndexOf(selection, row) > -1)
|
|
3049
3057
|
} else {
|
|
3050
|
-
isIndeterminate = !isAllSelected && afterFullData.some(row =>
|
|
3058
|
+
isIndeterminate = !isAllSelected && afterFullData.some(row => this.findRowIndexOf(selection, row) > -1)
|
|
3051
3059
|
}
|
|
3052
3060
|
}
|
|
3053
3061
|
this.isAllSelected = isAllSelected
|
|
@@ -3694,7 +3702,7 @@ const Methods = {
|
|
|
3694
3702
|
const rest = fullAllDataRowMap.get(row)
|
|
3695
3703
|
if (lazy && rest) {
|
|
3696
3704
|
rest.expandLoaded = false
|
|
3697
|
-
XEUtils.remove(expandLazyLoadeds, item => row
|
|
3705
|
+
XEUtils.remove(expandLazyLoadeds, item => this.eqRow(item, row))
|
|
3698
3706
|
}
|
|
3699
3707
|
return this.$nextTick()
|
|
3700
3708
|
},
|
|
@@ -3705,7 +3713,7 @@ const Methods = {
|
|
|
3705
3713
|
reloadRowExpand (row) {
|
|
3706
3714
|
const { expandOpts, expandLazyLoadeds } = this
|
|
3707
3715
|
const { lazy } = expandOpts
|
|
3708
|
-
if (lazy &&
|
|
3716
|
+
if (lazy && this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
|
|
3709
3717
|
this.clearRowExpandLoaded(row)
|
|
3710
3718
|
.then(() => this.handleAsyncRowExpand(row))
|
|
3711
3719
|
}
|
|
@@ -3725,7 +3733,7 @@ const Methods = {
|
|
|
3725
3733
|
const { expandOpts, expandLazyLoadeds, expandColumn: column } = this
|
|
3726
3734
|
const { row } = params
|
|
3727
3735
|
const { lazy } = expandOpts
|
|
3728
|
-
if (!lazy ||
|
|
3736
|
+
if (!lazy || this.findRowIndexOf(expandLazyLoadeds, row) === -1) {
|
|
3729
3737
|
const expanded = !this.isExpandByRow(row)
|
|
3730
3738
|
const columnIndex = this.getColumnIndex(column)
|
|
3731
3739
|
const $columnIndex = this.getVMColumnIndex(column)
|
|
@@ -3774,7 +3782,7 @@ const Methods = {
|
|
|
3774
3782
|
}).catch(() => {
|
|
3775
3783
|
rest.expandLoaded = false
|
|
3776
3784
|
}).finally(() => {
|
|
3777
|
-
XEUtils.remove(this.expandLazyLoadeds, item => item
|
|
3785
|
+
XEUtils.remove(this.expandLazyLoadeds, item => this.eqRow(item, row))
|
|
3778
3786
|
resolve(this.$nextTick().then(this.recalculate))
|
|
3779
3787
|
})
|
|
3780
3788
|
})
|
|
@@ -3805,9 +3813,9 @@ const Methods = {
|
|
|
3805
3813
|
const validRows = toggleMethod ? rows.filter(row => toggleMethod({ expanded, column, columnIndex, $columnIndex, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) })) : rows
|
|
3806
3814
|
if (expanded) {
|
|
3807
3815
|
validRows.forEach(row => {
|
|
3808
|
-
if (
|
|
3816
|
+
if (this.findRowIndexOf(rowExpandeds, row) === -1) {
|
|
3809
3817
|
const rest = fullAllDataRowMap.get(row)
|
|
3810
|
-
const isLoad = lazy && !rest.expandLoaded &&
|
|
3818
|
+
const isLoad = lazy && !rest.expandLoaded && this.findRowIndexOf(expandLazyLoadeds, row) === -1
|
|
3811
3819
|
if (isLoad) {
|
|
3812
3820
|
lazyRests.push(this.handleAsyncRowExpand(row))
|
|
3813
3821
|
} else {
|
|
@@ -3816,7 +3824,7 @@ const Methods = {
|
|
|
3816
3824
|
}
|
|
3817
3825
|
})
|
|
3818
3826
|
} else {
|
|
3819
|
-
XEUtils.remove(rowExpandeds, row =>
|
|
3827
|
+
XEUtils.remove(rowExpandeds, row => this.findRowIndexOf(validRows, row) > -1)
|
|
3820
3828
|
}
|
|
3821
3829
|
if (reserve) {
|
|
3822
3830
|
validRows.forEach(row => this.handleRowExpandReserve(row, expanded))
|
|
@@ -3830,7 +3838,8 @@ const Methods = {
|
|
|
3830
3838
|
* @param {Row} row 行对象
|
|
3831
3839
|
*/
|
|
3832
3840
|
isExpandByRow (row) {
|
|
3833
|
-
|
|
3841
|
+
const { rowExpandeds } = this
|
|
3842
|
+
return this.findRowIndexOf(rowExpandeds, row) > -1
|
|
3834
3843
|
},
|
|
3835
3844
|
/**
|
|
3836
3845
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
@@ -4645,6 +4654,18 @@ const Methods = {
|
|
|
4645
4654
|
}
|
|
4646
4655
|
return cellLabel
|
|
4647
4656
|
},
|
|
4657
|
+
findRowIndexOf (list, row) {
|
|
4658
|
+
return row ? XEUtils.findIndexOf(list, item => this.eqRow(item, row)) : -1
|
|
4659
|
+
},
|
|
4660
|
+
eqRow (row1, row2) {
|
|
4661
|
+
if (row1 && row2) {
|
|
4662
|
+
if (row1 === row2) {
|
|
4663
|
+
return true
|
|
4664
|
+
}
|
|
4665
|
+
return getRowid(this, row1) === getRowid(this, row2)
|
|
4666
|
+
}
|
|
4667
|
+
return false
|
|
4668
|
+
},
|
|
4648
4669
|
/*************************
|
|
4649
4670
|
* Publish methods
|
|
4650
4671
|
*************************/
|
|
@@ -19,13 +19,17 @@ class Store {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
add (name, render) {
|
|
22
|
+
const conf = this.store[name]
|
|
22
23
|
// 检测是否覆盖
|
|
23
24
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const confKeys = XEUtils.keys(conf)
|
|
26
|
+
XEUtils.each(render, (item, key) => {
|
|
27
|
+
if (confKeys.includes(key)) {
|
|
28
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
29
|
+
}
|
|
30
|
+
})
|
|
27
31
|
}
|
|
28
|
-
this.store[name] = render
|
|
32
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
29
33
|
return Store
|
|
30
34
|
}
|
|
31
35
|
|
package/styles/header.scss
CHANGED
|
@@ -1,135 +1 @@
|
|
|
1
1
|
/**Variable**/
|
|
2
|
-
|
|
3
|
-
.vxe-table {
|
|
4
|
-
.vxe-table--header-wrapper {
|
|
5
|
-
color: $vxe-table-header-font-color;
|
|
6
|
-
.vxe-table--header-border-line {
|
|
7
|
-
position: absolute;
|
|
8
|
-
left: 0;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
height: 0;
|
|
11
|
-
border-bottom: $vxe-table-border-width solid $vxe-table-border-color;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/*排序*/
|
|
15
|
-
.vxe-cell--sort {
|
|
16
|
-
width: 1.5em;
|
|
17
|
-
height: 1.35em;
|
|
18
|
-
vertical-align: middle;
|
|
19
|
-
text-align: center;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
position: relative;
|
|
22
|
-
}
|
|
23
|
-
.vxe-sort--asc-btn,
|
|
24
|
-
.vxe-sort--desc-btn {
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 0.35em;
|
|
27
|
-
color: $vxe-table-column-icon-border-color;
|
|
28
|
-
width: 1em;
|
|
29
|
-
text-align: center;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
&:hover {
|
|
32
|
-
color: $vxe-table-font-color;
|
|
33
|
-
}
|
|
34
|
-
&.sort--active {
|
|
35
|
-
color: $vxe-primary-color;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
.vxe-sort--asc-btn {
|
|
39
|
-
top: -0.15em;
|
|
40
|
-
}
|
|
41
|
-
.vxe-sort--desc-btn {
|
|
42
|
-
bottom: -0.15em;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.vxe-header--column {
|
|
47
|
-
position: relative;
|
|
48
|
-
font-weight: $vxe-table-header-font-weight;
|
|
49
|
-
// user-select: none;
|
|
50
|
-
&.col--ellipsis {
|
|
51
|
-
& > .vxe-cell {
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
.vxe-cell--title {
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
text-overflow: ellipsis;
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
}
|
|
59
|
-
& > i,
|
|
60
|
-
& > span {
|
|
61
|
-
&:not(.vxe-cell--title) {
|
|
62
|
-
flex-shrink: 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
.vxe-cell--required-icon {
|
|
68
|
-
display: inline-block;
|
|
69
|
-
color: $vxe-table-validate-error-color;
|
|
70
|
-
width: 0.8em;
|
|
71
|
-
height: 1em;
|
|
72
|
-
line-height: 1em;
|
|
73
|
-
font-family: $vxe-icon-font-family;
|
|
74
|
-
font-weight: normal;
|
|
75
|
-
position: relative;
|
|
76
|
-
&:before {
|
|
77
|
-
content: "*";
|
|
78
|
-
position: absolute;
|
|
79
|
-
left: 0;
|
|
80
|
-
top: 0.2em;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// .vxe-cell--required-icon,
|
|
84
|
-
// .vxe-cell--edit-icon,
|
|
85
|
-
// .vxe-cell-help-icon,
|
|
86
|
-
// .vxe-cell--title {
|
|
87
|
-
// vertical-align: middle;
|
|
88
|
-
// }
|
|
89
|
-
.vxe-cell--required-icon {
|
|
90
|
-
margin-right: 0.1em;
|
|
91
|
-
}
|
|
92
|
-
.vxe-cell--edit-icon,
|
|
93
|
-
.vxe-cell-help-icon {
|
|
94
|
-
margin-right: 0.2em;
|
|
95
|
-
}
|
|
96
|
-
.vxe-cell-help-icon {
|
|
97
|
-
cursor: help;
|
|
98
|
-
}
|
|
99
|
-
.vxe-resizable {
|
|
100
|
-
position: absolute;
|
|
101
|
-
right: -7px;
|
|
102
|
-
bottom: 0;
|
|
103
|
-
width: 14px;
|
|
104
|
-
height: 100%;
|
|
105
|
-
text-align: center;
|
|
106
|
-
z-index: 1;
|
|
107
|
-
cursor: col-resize;
|
|
108
|
-
&.is--line {
|
|
109
|
-
&:before,
|
|
110
|
-
&:after {
|
|
111
|
-
content: "";
|
|
112
|
-
display: inline-block;
|
|
113
|
-
vertical-align: middle;
|
|
114
|
-
}
|
|
115
|
-
&:before {
|
|
116
|
-
width: 1px;
|
|
117
|
-
height: 50%;
|
|
118
|
-
background-color: $vxe-table-resizable-line-color;
|
|
119
|
-
}
|
|
120
|
-
&:after {
|
|
121
|
-
width: 0;
|
|
122
|
-
height: 100%;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.vxe-table--fixed-right-wrapper {
|
|
129
|
-
.vxe-header--column {
|
|
130
|
-
.vxe-resizable {
|
|
131
|
-
right: auto;
|
|
132
|
-
left: -7px;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
package/styles/table.scss
CHANGED
|
@@ -311,6 +311,140 @@
|
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
/*header*/
|
|
315
|
+
.vxe-table {
|
|
316
|
+
.vxe-table--header-wrapper {
|
|
317
|
+
color: $vxe-table-header-font-color;
|
|
318
|
+
.vxe-table--header-border-line {
|
|
319
|
+
position: absolute;
|
|
320
|
+
left: 0;
|
|
321
|
+
bottom: 0;
|
|
322
|
+
height: 0;
|
|
323
|
+
border-bottom: $vxe-table-border-width solid $vxe-table-border-color;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/*排序*/
|
|
327
|
+
.vxe-cell--sort {
|
|
328
|
+
width: 1.5em;
|
|
329
|
+
height: 1.35em;
|
|
330
|
+
vertical-align: middle;
|
|
331
|
+
text-align: center;
|
|
332
|
+
display: inline-block;
|
|
333
|
+
position: relative;
|
|
334
|
+
}
|
|
335
|
+
.vxe-sort--asc-btn,
|
|
336
|
+
.vxe-sort--desc-btn {
|
|
337
|
+
position: absolute;
|
|
338
|
+
left: 0.35em;
|
|
339
|
+
color: $vxe-table-column-icon-border-color;
|
|
340
|
+
width: 1em;
|
|
341
|
+
text-align: center;
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
&:hover {
|
|
344
|
+
color: $vxe-table-font-color;
|
|
345
|
+
}
|
|
346
|
+
&.sort--active {
|
|
347
|
+
color: $vxe-primary-color;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
.vxe-sort--asc-btn {
|
|
351
|
+
top: -0.15em;
|
|
352
|
+
}
|
|
353
|
+
.vxe-sort--desc-btn {
|
|
354
|
+
bottom: -0.15em;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.vxe-header--column {
|
|
359
|
+
position: relative;
|
|
360
|
+
font-weight: $vxe-table-header-font-weight;
|
|
361
|
+
// user-select: none;
|
|
362
|
+
&.col--ellipsis {
|
|
363
|
+
& > .vxe-cell {
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
.vxe-cell--title {
|
|
367
|
+
overflow: hidden;
|
|
368
|
+
text-overflow: ellipsis;
|
|
369
|
+
white-space: nowrap;
|
|
370
|
+
}
|
|
371
|
+
& > i,
|
|
372
|
+
& > span {
|
|
373
|
+
&:not(.vxe-cell--title) {
|
|
374
|
+
flex-shrink: 0;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
.vxe-cell--required-icon {
|
|
380
|
+
display: inline-block;
|
|
381
|
+
color: $vxe-table-validate-error-color;
|
|
382
|
+
width: 0.8em;
|
|
383
|
+
height: 1em;
|
|
384
|
+
line-height: 1em;
|
|
385
|
+
font-family: $vxe-icon-font-family;
|
|
386
|
+
font-weight: normal;
|
|
387
|
+
position: relative;
|
|
388
|
+
&:before {
|
|
389
|
+
content: "*";
|
|
390
|
+
position: absolute;
|
|
391
|
+
left: 0;
|
|
392
|
+
top: 0.2em;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
// .vxe-cell--required-icon,
|
|
396
|
+
// .vxe-cell--edit-icon,
|
|
397
|
+
// .vxe-cell-help-icon,
|
|
398
|
+
// .vxe-cell--title {
|
|
399
|
+
// vertical-align: middle;
|
|
400
|
+
// }
|
|
401
|
+
.vxe-cell--required-icon {
|
|
402
|
+
margin-right: 0.1em;
|
|
403
|
+
}
|
|
404
|
+
.vxe-cell--edit-icon,
|
|
405
|
+
.vxe-cell-help-icon {
|
|
406
|
+
margin-right: 0.2em;
|
|
407
|
+
}
|
|
408
|
+
.vxe-cell-help-icon {
|
|
409
|
+
cursor: help;
|
|
410
|
+
}
|
|
411
|
+
.vxe-resizable {
|
|
412
|
+
position: absolute;
|
|
413
|
+
right: -7px;
|
|
414
|
+
bottom: 0;
|
|
415
|
+
width: 14px;
|
|
416
|
+
height: 100%;
|
|
417
|
+
text-align: center;
|
|
418
|
+
z-index: 1;
|
|
419
|
+
cursor: col-resize;
|
|
420
|
+
&.is--line {
|
|
421
|
+
&:before,
|
|
422
|
+
&:after {
|
|
423
|
+
content: "";
|
|
424
|
+
display: inline-block;
|
|
425
|
+
vertical-align: middle;
|
|
426
|
+
}
|
|
427
|
+
&:before {
|
|
428
|
+
width: 1px;
|
|
429
|
+
height: 50%;
|
|
430
|
+
background-color: $vxe-table-resizable-line-color;
|
|
431
|
+
}
|
|
432
|
+
&:after {
|
|
433
|
+
width: 0;
|
|
434
|
+
height: 100%;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
.vxe-table--fixed-right-wrapper {
|
|
440
|
+
.vxe-header--column {
|
|
441
|
+
.vxe-resizable {
|
|
442
|
+
right: auto;
|
|
443
|
+
left: -7px;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
314
448
|
/*table*/
|
|
315
449
|
.vxe-table--render-default {
|
|
316
450
|
position: relative;
|
package/styles/variable.scss
CHANGED
|
@@ -108,7 +108,7 @@ $vxe-table-menu-item-width: 178px !default;
|
|
|
108
108
|
$vxe-table-menu-background-color: #fff !default;
|
|
109
109
|
|
|
110
110
|
/*loading*/
|
|
111
|
-
$vxe-loading-background-color: rgba(0, 0, 0, 0.
|
|
111
|
+
$vxe-loading-background-color: rgba(0, 0, 0, 0.3) !default;
|
|
112
112
|
$vxe-loading-z-index: 999 !default;
|
|
113
113
|
|
|
114
114
|
/*validate*/
|