vxe-table 3.9.0-rc.8 → 3.9.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/README.md +1 -1
- package/es/grid/src/grid.js +120 -66
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.esm.js +22 -3
- package/es/locale/lang/en-US.js +2 -8
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/hu-HU.d.ts +2 -0
- package/es/locale/lang/hu-HU.js +497 -501
- package/es/locale/lang/ja-JP.js +2 -8
- package/es/locale/lang/ko-KR.d.ts +2 -0
- package/es/locale/lang/ko-KR.js +2 -8
- package/es/locale/lang/pt-BR.js +2 -8
- package/es/locale/lang/ru-RU.d.ts +2 -0
- package/es/locale/lang/ru-RU.js +497 -503
- package/es/locale/lang/uk-UA.d.ts +2 -0
- package/es/locale/lang/uk-UA.js +667 -0
- package/es/locale/lang/vi-VN.js +2 -8
- package/es/locale/lang/zh-CHT.d.ts +2 -0
- package/es/locale/lang/zh-CHT.js +667 -0
- package/es/locale/lang/zh-CN.js +2 -8
- package/es/locale/lang/zh-HK.js +2 -2
- package/es/locale/lang/zh-MO.js +2 -2
- package/es/locale/lang/zh-TC.js +2 -673
- package/es/locale/lang/zh-TW.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +183 -173
- package/es/table/module/edit/mixin.js +33 -24
- package/es/table/module/export/export-panel.js +32 -4
- package/es/table/module/export/import-panel.js +25 -6
- package/es/table/module/export/mixin.js +11 -11
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/render/index.js +17 -11
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +3 -3
- package/es/table/src/methods.js +54 -42
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +175 -60
- package/es/table/src/util.js +3 -2
- package/es/table/style.css +37 -48
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +21 -7
- package/es/toolbar/style.css +0 -1
- package/es/toolbar/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/es/vxe-table/style.css +37 -48
- package/es/vxe-table/style.min.css +1 -1
- package/es/vxe-toolbar/style.css +0 -1
- package/es/vxe-toolbar/style.min.css +1 -1
- package/lib/colgroup/index.js +3 -3
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +3 -3
- package/lib/column/index.min.js +1 -1
- package/lib/components.js +9 -11
- package/lib/components.min.js +1 -1
- package/lib/grid/index.js +3 -3
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +581 -491
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.common.js +3 -4
- package/lib/index.umd.js +9212 -17224
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -8
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -8
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/hu-HU.d.ts +2 -0
- package/lib/locale/lang/hu-HU.js +497 -501
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +687 -0
- package/lib/locale/lang/ja-JP.js +2 -8
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -8
- package/lib/locale/lang/ko-KR.d.ts +2 -0
- package/lib/locale/lang/ko-KR.js +2 -8
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +687 -0
- package/lib/locale/lang/pt-BR.js +2 -8
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -8
- package/lib/locale/lang/ru-RU.d.ts +2 -0
- package/lib/locale/lang/ru-RU.js +497 -503
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +687 -0
- package/lib/locale/lang/uk-UA.d.ts +2 -0
- package/lib/locale/lang/uk-UA.js +673 -0
- package/lib/locale/lang/uk-UA.min.js +1 -0
- package/lib/locale/lang/uk-UA.umd.js +687 -0
- package/lib/locale/lang/vi-VN.js +2 -8
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.d.ts +2 -0
- package/lib/locale/lang/zh-CHT.js +673 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -0
- package/lib/locale/lang/zh-CHT.umd.js +687 -0
- package/lib/locale/lang/zh-CN.js +2 -8
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -8
- package/lib/locale/lang/zh-HK.js +2 -2
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +7 -677
- package/lib/locale/lang/zh-MO.js +2 -2
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +7 -677
- package/lib/locale/lang/zh-TC.js +3 -673
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +7 -677
- package/lib/locale/lang/zh-TW.js +2 -2
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +7 -677
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +4 -4
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/mixin.js +53 -44
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +310 -239
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +436 -371
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +136 -106
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +75 -54
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +592 -597
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +6 -4
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/module/filter/mixin.js +147 -118
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +86 -65
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +163 -151
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +125 -114
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +36 -34
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +225 -214
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +401 -297
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +411 -349
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +470 -344
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +46 -55
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +157 -132
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +1 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +170 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2758 -2478
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +33 -74
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +519 -397
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +143 -131
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +37 -48
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/index.js +3 -3
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +332 -284
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +0 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/ui/index.js +50 -41
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +2 -3
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +29 -28
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +6 -4
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -7
- package/lib/v-x-e-table/index.js +3 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +3 -4
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +3 -4
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +3 -4
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/lib/vxe-table/index.js +3 -4
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +37 -48
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +3 -4
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-toolbar/style/style.css +0 -1
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +3 -4
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +3 -4
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +5 -4
- package/packages/grid/src/grid.ts +127 -65
- package/packages/locale/lang/en-US.ts +2 -10
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +497 -503
- package/packages/locale/lang/ja-JP.ts +2 -10
- package/packages/locale/lang/ko-KR.ts +2 -10
- package/packages/locale/lang/pt-BR.ts +2 -10
- package/packages/locale/lang/ru-RU.ts +497 -505
- package/packages/locale/lang/uk-UA.ts +667 -0
- package/packages/locale/lang/vi-VN.ts +2 -10
- package/packages/locale/lang/zh-CHT.ts +667 -0
- package/packages/locale/lang/zh-CN.ts +2 -10
- package/packages/locale/lang/zh-HK.ts +2 -2
- package/packages/locale/lang/zh-MO.ts +2 -2
- package/packages/locale/lang/zh-TC.ts +2 -674
- package/packages/locale/lang/zh-TW.ts +2 -2
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +32 -23
- package/packages/table/module/export/export-panel.ts +36 -4
- package/packages/table/module/export/import-panel.ts +29 -6
- package/packages/table/module/export/mixin.ts +11 -11
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/render/index.ts +20 -11
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +3 -3
- package/packages/table/src/methods.ts +53 -42
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +183 -57
- package/packages/table/src/util.ts +3 -2
- package/packages/toolbar/src/toolbar.ts +21 -7
- package/packages/ui/index.ts +3 -1
- package/styles/components/table.scss +82 -17
- package/types/all.d.ts +1 -0
- /package/es/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/es/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/es/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
- /package/lib/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/lib/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/lib/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
|
@@ -11,44 +11,40 @@ var _util = require("../../src/util");
|
|
|
11
11
|
var _dom = require("../../../ui/src/dom");
|
|
12
12
|
var _log = require("../../../ui/src/log");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
20
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
-
var getConfig = _ui.VxeUI.getConfig,
|
|
25
|
-
renderer = _ui.VxeUI.renderer,
|
|
26
|
-
getI18n = _ui.VxeUI.getI18n;
|
|
14
|
+
const {
|
|
15
|
+
getConfig,
|
|
16
|
+
renderer,
|
|
17
|
+
getI18n
|
|
18
|
+
} = _ui.VxeUI;
|
|
27
19
|
function insertTreeRow(_vm, newRecords, isAppend) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
20
|
+
const {
|
|
21
|
+
tableFullTreeData,
|
|
22
|
+
afterFullData,
|
|
23
|
+
fullDataRowIdData,
|
|
24
|
+
fullAllDataRowIdData,
|
|
25
|
+
treeOpts
|
|
26
|
+
} = _vm;
|
|
27
|
+
const {
|
|
28
|
+
rowField,
|
|
29
|
+
parentField,
|
|
30
|
+
mapChildrenField
|
|
31
|
+
} = treeOpts;
|
|
32
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
33
|
+
const funcName = isAppend ? 'push' : 'unshift';
|
|
34
|
+
newRecords.forEach(item => {
|
|
35
|
+
const parentRowId = item[parentField];
|
|
36
|
+
const rowid = (0, _util.getRowid)(_vm, item);
|
|
37
|
+
const matchObj = parentRowId ? _xeUtils.default.findTree(tableFullTreeData, item => parentRowId === item[rowField], {
|
|
44
38
|
children: mapChildrenField
|
|
45
39
|
}) : null;
|
|
46
40
|
if (matchObj) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
const {
|
|
42
|
+
item: parentRow
|
|
43
|
+
} = matchObj;
|
|
44
|
+
const parentRest = fullAllDataRowIdData[(0, _util.getRowid)(_vm, parentRow)];
|
|
45
|
+
const parentLevel = parentRest ? parentRest.level : 0;
|
|
46
|
+
let parentChilds = parentRow[childrenField];
|
|
47
|
+
let mapChilds = parentRow[mapChildrenField];
|
|
52
48
|
if (!_xeUtils.default.isArray(parentChilds)) {
|
|
53
49
|
parentChilds = parentRow[childrenField] = [];
|
|
54
50
|
}
|
|
@@ -57,9 +53,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
57
53
|
}
|
|
58
54
|
parentChilds[funcName](item);
|
|
59
55
|
mapChilds[funcName](item);
|
|
60
|
-
|
|
56
|
+
const rest = {
|
|
61
57
|
row: item,
|
|
62
|
-
rowid
|
|
58
|
+
rowid,
|
|
63
59
|
seq: -1,
|
|
64
60
|
index: -1,
|
|
65
61
|
_index: -1,
|
|
@@ -71,16 +67,16 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
71
67
|
fullDataRowIdData[rowid] = rest;
|
|
72
68
|
fullAllDataRowIdData[rowid] = rest;
|
|
73
69
|
} else {
|
|
74
|
-
if (process.env.
|
|
70
|
+
if (process.env.NODE_ENV === 'development') {
|
|
75
71
|
if (parentRowId) {
|
|
76
72
|
(0, _log.warnLog)('vxe.error.unableInsert');
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
afterFullData[funcName](item);
|
|
80
76
|
tableFullTreeData[funcName](item);
|
|
81
|
-
|
|
77
|
+
const rest = {
|
|
82
78
|
row: item,
|
|
83
|
-
rowid
|
|
79
|
+
rowid,
|
|
84
80
|
seq: -1,
|
|
85
81
|
index: -1,
|
|
86
82
|
_index: -1,
|
|
@@ -89,41 +85,48 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
89
85
|
parent: null,
|
|
90
86
|
level: 0
|
|
91
87
|
};
|
|
92
|
-
fullDataRowIdData[rowid] =
|
|
93
|
-
fullAllDataRowIdData[rowid] =
|
|
88
|
+
fullDataRowIdData[rowid] = rest;
|
|
89
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
94
90
|
}
|
|
95
91
|
});
|
|
96
92
|
}
|
|
97
93
|
function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
94
|
+
const {
|
|
95
|
+
tableFullTreeData,
|
|
96
|
+
mergeList,
|
|
97
|
+
afterFullData,
|
|
98
|
+
editStore,
|
|
99
|
+
tableFullData,
|
|
100
|
+
treeConfig,
|
|
101
|
+
fullDataRowIdData,
|
|
102
|
+
fullAllDataRowIdData,
|
|
103
|
+
treeOpts
|
|
104
|
+
} = _vm;
|
|
105
|
+
const {
|
|
106
|
+
transform,
|
|
107
|
+
rowField,
|
|
108
|
+
mapChildrenField
|
|
109
|
+
} = treeOpts;
|
|
110
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
111
111
|
if (!_xeUtils.default.isArray(records)) {
|
|
112
112
|
records = [records];
|
|
113
113
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
const newRecords = _vm.defineField(records.map(record => Object.assign(treeConfig && transform ? {
|
|
115
|
+
[mapChildrenField]: [],
|
|
116
|
+
[childrenField]: []
|
|
117
|
+
} : {}, record)));
|
|
117
118
|
if (_xeUtils.default.eqNull(row)) {
|
|
118
119
|
// 如果为虚拟树
|
|
119
120
|
if (treeConfig && transform) {
|
|
120
121
|
insertTreeRow(_vm, newRecords, false);
|
|
121
122
|
} else {
|
|
122
|
-
afterFullData.unshift
|
|
123
|
-
tableFullData.unshift
|
|
123
|
+
afterFullData.unshift(...newRecords);
|
|
124
|
+
tableFullData.unshift(...newRecords);
|
|
124
125
|
// 刷新单元格合并
|
|
125
|
-
mergeList.forEach(
|
|
126
|
-
|
|
126
|
+
mergeList.forEach(mergeItem => {
|
|
127
|
+
const {
|
|
128
|
+
row: mergeRowIndex
|
|
129
|
+
} = mergeItem;
|
|
127
130
|
if (mergeRowIndex > 0) {
|
|
128
131
|
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
129
132
|
}
|
|
@@ -135,12 +138,14 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
135
138
|
if (treeConfig && transform) {
|
|
136
139
|
insertTreeRow(_vm, newRecords, true);
|
|
137
140
|
} else {
|
|
138
|
-
afterFullData.push
|
|
139
|
-
tableFullData.push
|
|
141
|
+
afterFullData.push(...newRecords);
|
|
142
|
+
tableFullData.push(...newRecords);
|
|
140
143
|
// 刷新单元格合并
|
|
141
|
-
mergeList.forEach(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
mergeList.forEach(mergeItem => {
|
|
145
|
+
const {
|
|
146
|
+
row: mergeRowIndex,
|
|
147
|
+
rowspan: mergeRowspan
|
|
148
|
+
} = mergeItem;
|
|
144
149
|
if (mergeRowIndex + mergeRowspan > afterFullData.length) {
|
|
145
150
|
mergeItem.rowspan = mergeRowspan + newRecords.length;
|
|
146
151
|
}
|
|
@@ -149,36 +154,36 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
149
154
|
} else {
|
|
150
155
|
// 如果为虚拟树
|
|
151
156
|
if (treeConfig && transform) {
|
|
152
|
-
|
|
153
|
-
return row[rowField] === item[rowField];
|
|
154
|
-
}, {
|
|
157
|
+
const matchMapObj = _xeUtils.default.findTree(tableFullTreeData, item => row[rowField] === item[rowField], {
|
|
155
158
|
children: mapChildrenField
|
|
156
159
|
});
|
|
157
160
|
if (matchMapObj) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
const {
|
|
162
|
+
parent: parentRow
|
|
163
|
+
} = matchMapObj;
|
|
164
|
+
const parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData;
|
|
165
|
+
const parentRest = fullAllDataRowIdData[(0, _util.getRowid)(_vm, parentRow)];
|
|
166
|
+
const parentLevel = parentRest ? parentRest.level : 0;
|
|
167
|
+
newRecords.forEach((item, i) => {
|
|
168
|
+
const rowid = (0, _util.getRowid)(_vm, item);
|
|
169
|
+
if (process.env.NODE_ENV === 'development') {
|
|
165
170
|
if (item[treeOpts.parentField]) {
|
|
166
171
|
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
167
|
-
(0, _log.errLog)('vxe.error.errProp', [
|
|
172
|
+
(0, _log.errLog)('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
|
|
168
173
|
}
|
|
169
174
|
}
|
|
170
175
|
}
|
|
171
176
|
if (parentRow) {
|
|
172
177
|
item[treeOpts.parentField] = parentRow[rowField];
|
|
173
178
|
}
|
|
174
|
-
|
|
179
|
+
let targetIndex = matchMapObj.index + i;
|
|
175
180
|
if (isInsertNextRow) {
|
|
176
181
|
targetIndex = targetIndex + 1;
|
|
177
182
|
}
|
|
178
183
|
parentMapChilds.splice(targetIndex, 0, item);
|
|
179
|
-
|
|
184
|
+
const rest = {
|
|
180
185
|
row: item,
|
|
181
|
-
rowid
|
|
186
|
+
rowid,
|
|
182
187
|
seq: -1,
|
|
183
188
|
index: -1,
|
|
184
189
|
_index: -1,
|
|
@@ -192,22 +197,20 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
192
197
|
});
|
|
193
198
|
// 源
|
|
194
199
|
if (parentRow) {
|
|
195
|
-
|
|
196
|
-
return row[rowField] === item[rowField];
|
|
197
|
-
}, {
|
|
200
|
+
const matchObj = _xeUtils.default.findTree(tableFullTreeData, item => row[rowField] === item[rowField], {
|
|
198
201
|
children: childrenField
|
|
199
202
|
});
|
|
200
203
|
if (matchObj) {
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
const parentChilds = matchObj.items;
|
|
205
|
+
let targetIndex = matchObj.index;
|
|
203
206
|
if (isInsertNextRow) {
|
|
204
207
|
targetIndex = targetIndex + 1;
|
|
205
208
|
}
|
|
206
|
-
parentChilds.splice
|
|
209
|
+
parentChilds.splice(targetIndex, 0, ...newRecords);
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
} else {
|
|
210
|
-
if (process.env.
|
|
213
|
+
if (process.env.NODE_ENV === 'development') {
|
|
211
214
|
(0, _log.warnLog)('vxe.error.unableInsert');
|
|
212
215
|
}
|
|
213
216
|
insertTreeRow(_vm, newRecords, true);
|
|
@@ -216,7 +219,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
216
219
|
if (treeConfig) {
|
|
217
220
|
throw new Error(getI18n('vxe.error.noTree', ['insert']));
|
|
218
221
|
}
|
|
219
|
-
|
|
222
|
+
let afIndex = -1;
|
|
220
223
|
// 如果是可视索引
|
|
221
224
|
if (_xeUtils.default.isNumber(row)) {
|
|
222
225
|
if (row < afterFullData.length) {
|
|
@@ -232,12 +235,14 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
232
235
|
if (afIndex === -1) {
|
|
233
236
|
throw new Error((0, _log.errLog)('vxe.error.unableInsert'));
|
|
234
237
|
}
|
|
235
|
-
afterFullData.splice
|
|
236
|
-
tableFullData.splice
|
|
238
|
+
afterFullData.splice(afIndex, 0, ...newRecords);
|
|
239
|
+
tableFullData.splice(_vm.findRowIndexOf(tableFullData, row), 0, ...newRecords);
|
|
237
240
|
// 刷新单元格合并
|
|
238
|
-
mergeList.forEach(
|
|
239
|
-
|
|
240
|
-
|
|
241
|
+
mergeList.forEach(mergeItem => {
|
|
242
|
+
const {
|
|
243
|
+
row: mergeRowIndex,
|
|
244
|
+
rowspan: mergeRowspan
|
|
245
|
+
} = mergeItem;
|
|
241
246
|
if (mergeRowIndex > afIndex) {
|
|
242
247
|
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
243
248
|
} else if (mergeRowIndex + mergeRowspan > afIndex) {
|
|
@@ -247,13 +252,15 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
247
252
|
}
|
|
248
253
|
}
|
|
249
254
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
const {
|
|
256
|
+
insertList,
|
|
257
|
+
insertMaps
|
|
258
|
+
} = editStore;
|
|
259
|
+
newRecords.forEach(newRow => {
|
|
260
|
+
const rowid = (0, _util.getRowid)(_vm, newRow);
|
|
254
261
|
insertMaps[rowid] = newRow;
|
|
255
262
|
});
|
|
256
|
-
insertList.unshift
|
|
263
|
+
insertList.unshift(...newRecords);
|
|
257
264
|
_vm.cacheRowMap();
|
|
258
265
|
_vm.updateScrollYStatus();
|
|
259
266
|
_vm.handleTableData(treeConfig && transform);
|
|
@@ -265,10 +272,10 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
265
272
|
if (_vm.scrollYLoad) {
|
|
266
273
|
_vm.updateScrollYSpace();
|
|
267
274
|
}
|
|
268
|
-
return _vm.$nextTick().then(
|
|
275
|
+
return _vm.$nextTick().then(() => {
|
|
269
276
|
_vm.updateCellAreas();
|
|
270
277
|
return _vm.recalculate();
|
|
271
|
-
}).then(
|
|
278
|
+
}).then(() => {
|
|
272
279
|
return {
|
|
273
280
|
row: newRecords.length ? newRecords[newRecords.length - 1] : null,
|
|
274
281
|
rows: newRecords
|
|
@@ -282,7 +289,7 @@ var _default = exports.default = {
|
|
|
282
289
|
*
|
|
283
290
|
* @param {*} records
|
|
284
291
|
*/
|
|
285
|
-
_insert
|
|
292
|
+
_insert(records) {
|
|
286
293
|
return handleInsertRowAt(this, records, null);
|
|
287
294
|
},
|
|
288
295
|
/**
|
|
@@ -294,10 +301,10 @@ var _default = exports.default = {
|
|
|
294
301
|
* @param {Row} row 指定行
|
|
295
302
|
* @returns
|
|
296
303
|
*/
|
|
297
|
-
_insertAt
|
|
304
|
+
_insertAt(records, row) {
|
|
298
305
|
return handleInsertRowAt(this, records, row);
|
|
299
306
|
},
|
|
300
|
-
_insertNextAt
|
|
307
|
+
_insertNextAt(records, row) {
|
|
301
308
|
return handleInsertRowAt(this, records, row, true);
|
|
302
309
|
},
|
|
303
310
|
/**
|
|
@@ -306,43 +313,50 @@ var _default = exports.default = {
|
|
|
306
313
|
* 如果传 rows 则删除多行
|
|
307
314
|
* 如果为空则删除所有
|
|
308
315
|
*/
|
|
309
|
-
_remove
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
tableFullData
|
|
313
|
-
tableFullTreeData
|
|
314
|
-
treeConfig
|
|
315
|
-
mergeList
|
|
316
|
-
editStore
|
|
317
|
-
checkboxOpts
|
|
318
|
-
selectCheckboxMaps
|
|
319
|
-
isInsertByRow
|
|
320
|
-
treeOpts
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
316
|
+
_remove(rows) {
|
|
317
|
+
const {
|
|
318
|
+
afterFullData,
|
|
319
|
+
tableFullData,
|
|
320
|
+
tableFullTreeData,
|
|
321
|
+
treeConfig,
|
|
322
|
+
mergeList,
|
|
323
|
+
editStore,
|
|
324
|
+
checkboxOpts,
|
|
325
|
+
selectCheckboxMaps,
|
|
326
|
+
isInsertByRow,
|
|
327
|
+
treeOpts
|
|
328
|
+
} = this;
|
|
329
|
+
const {
|
|
330
|
+
transform,
|
|
331
|
+
mapChildrenField
|
|
332
|
+
} = treeOpts;
|
|
333
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
334
|
+
const {
|
|
335
|
+
actived,
|
|
336
|
+
removeList,
|
|
337
|
+
insertList,
|
|
338
|
+
insertMaps
|
|
339
|
+
} = editStore;
|
|
340
|
+
const {
|
|
341
|
+
checkField
|
|
342
|
+
} = checkboxOpts;
|
|
343
|
+
let delList = [];
|
|
330
344
|
if (!rows) {
|
|
331
345
|
rows = tableFullData;
|
|
332
346
|
} else if (!_xeUtils.default.isArray(rows)) {
|
|
333
347
|
rows = [rows];
|
|
334
348
|
}
|
|
335
349
|
// 如果是新增,则保存记录
|
|
336
|
-
rows.forEach(
|
|
350
|
+
rows.forEach(row => {
|
|
337
351
|
if (!isInsertByRow(row)) {
|
|
338
352
|
removeList.push(row);
|
|
339
353
|
}
|
|
340
354
|
});
|
|
341
355
|
// 如果绑定了多选属性,则更新状态
|
|
342
356
|
if (!checkField) {
|
|
343
|
-
|
|
344
|
-
rows.forEach(
|
|
345
|
-
|
|
357
|
+
const selectRowMaps = Object.assign({}, selectCheckboxMaps);
|
|
358
|
+
rows.forEach(row => {
|
|
359
|
+
const rowid = (0, _util.getRowid)(this, row);
|
|
346
360
|
if (selectRowMaps[rowid]) {
|
|
347
361
|
delete selectRowMaps[rowid];
|
|
348
362
|
}
|
|
@@ -358,43 +372,41 @@ var _default = exports.default = {
|
|
|
358
372
|
} else {
|
|
359
373
|
// 如果为虚拟树
|
|
360
374
|
if (treeConfig && transform) {
|
|
361
|
-
rows.forEach(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
return rowid === (0, _util.getRowid)(_this, item);
|
|
365
|
-
}, {
|
|
375
|
+
rows.forEach(row => {
|
|
376
|
+
const rowid = (0, _util.getRowid)(this, row);
|
|
377
|
+
const matchMapObj = _xeUtils.default.findTree(tableFullTreeData, item => rowid === (0, _util.getRowid)(this, item), {
|
|
366
378
|
children: mapChildrenField
|
|
367
379
|
});
|
|
368
380
|
if (matchMapObj) {
|
|
369
|
-
|
|
381
|
+
const rItems = matchMapObj.items.splice(matchMapObj.index, 1);
|
|
370
382
|
delList.push(rItems[0]);
|
|
371
383
|
}
|
|
372
|
-
|
|
373
|
-
return rowid === (0, _util.getRowid)(_this, item);
|
|
374
|
-
}, {
|
|
384
|
+
const matchObj = _xeUtils.default.findTree(tableFullTreeData, item => rowid === (0, _util.getRowid)(this, item), {
|
|
375
385
|
children: childrenField
|
|
376
386
|
});
|
|
377
387
|
if (matchObj) {
|
|
378
388
|
matchObj.items.splice(matchObj.index, 1);
|
|
379
389
|
}
|
|
380
|
-
|
|
390
|
+
const afIndex = this.findRowIndexOf(afterFullData, row);
|
|
381
391
|
if (afIndex > -1) {
|
|
382
392
|
afterFullData.splice(afIndex, 1);
|
|
383
393
|
}
|
|
384
394
|
});
|
|
385
395
|
} else {
|
|
386
|
-
rows.forEach(
|
|
387
|
-
|
|
396
|
+
rows.forEach(row => {
|
|
397
|
+
const tfIndex = this.findRowIndexOf(tableFullData, row);
|
|
388
398
|
if (tfIndex > -1) {
|
|
389
|
-
|
|
399
|
+
const rItems = tableFullData.splice(tfIndex, 1);
|
|
390
400
|
delList.push(rItems[0]);
|
|
391
401
|
}
|
|
392
|
-
|
|
402
|
+
const afIndex = this.findRowIndexOf(afterFullData, row);
|
|
393
403
|
if (afIndex > -1) {
|
|
394
404
|
// 刷新单元格合并
|
|
395
|
-
mergeList.forEach(
|
|
396
|
-
|
|
397
|
-
|
|
405
|
+
mergeList.forEach(mergeItem => {
|
|
406
|
+
const {
|
|
407
|
+
row: mergeRowIndex,
|
|
408
|
+
rowspan: mergeRowspan
|
|
409
|
+
} = mergeItem;
|
|
398
410
|
if (mergeRowIndex > afIndex) {
|
|
399
411
|
mergeItem.row = mergeRowIndex - 1;
|
|
400
412
|
} else if (mergeRowIndex + mergeRowspan > afIndex) {
|
|
@@ -411,9 +423,9 @@ var _default = exports.default = {
|
|
|
411
423
|
this.clearEdit();
|
|
412
424
|
}
|
|
413
425
|
// 从新增中移除已删除的数据
|
|
414
|
-
rows.forEach(
|
|
415
|
-
|
|
416
|
-
|
|
426
|
+
rows.forEach(row => {
|
|
427
|
+
const rowid = (0, _util.getRowid)(this, row);
|
|
428
|
+
const iIndex = this.findRowIndexOf(insertList, row);
|
|
417
429
|
if (iIndex > -1) {
|
|
418
430
|
insertList.splice(iIndex, 1);
|
|
419
431
|
}
|
|
@@ -429,10 +441,10 @@ var _default = exports.default = {
|
|
|
429
441
|
if (this.scrollYLoad) {
|
|
430
442
|
this.updateScrollYSpace();
|
|
431
443
|
}
|
|
432
|
-
return this.$nextTick().then(
|
|
433
|
-
|
|
434
|
-
return
|
|
435
|
-
}).then(
|
|
444
|
+
return this.$nextTick().then(() => {
|
|
445
|
+
this.updateCellAreas();
|
|
446
|
+
return this.recalculate();
|
|
447
|
+
}).then(() => {
|
|
436
448
|
return {
|
|
437
449
|
row: delList.length ? delList[delList.length - 1] : null,
|
|
438
450
|
rows: delList
|
|
@@ -442,66 +454,61 @@ var _default = exports.default = {
|
|
|
442
454
|
/**
|
|
443
455
|
* 删除复选框选中的数据
|
|
444
456
|
*/
|
|
445
|
-
_removeCheckboxRow
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
_this2.clearCheckboxRow();
|
|
457
|
+
_removeCheckboxRow() {
|
|
458
|
+
return this.remove(this.getCheckboxRecords()).then(params => {
|
|
459
|
+
this.clearCheckboxRow();
|
|
449
460
|
return params;
|
|
450
461
|
});
|
|
451
462
|
},
|
|
452
463
|
/**
|
|
453
464
|
* 删除单选框选中的数据
|
|
454
465
|
*/
|
|
455
|
-
_removeRadioRow
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
_this3.clearRadioRow();
|
|
466
|
+
_removeRadioRow() {
|
|
467
|
+
const radioRecord = this.getRadioRecord();
|
|
468
|
+
return this.remove(radioRecord || []).then(params => {
|
|
469
|
+
this.clearRadioRow();
|
|
460
470
|
return params;
|
|
461
471
|
});
|
|
462
472
|
},
|
|
463
473
|
/**
|
|
464
474
|
* 删除当前行选中的数据
|
|
465
475
|
*/
|
|
466
|
-
_removeCurrentRow
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
_this4.clearCurrentRow();
|
|
476
|
+
_removeCurrentRow() {
|
|
477
|
+
const currentRecord = this.getCurrentRecord();
|
|
478
|
+
return this.remove(currentRecord || []).then(params => {
|
|
479
|
+
this.clearCurrentRow();
|
|
471
480
|
return params;
|
|
472
481
|
});
|
|
473
482
|
},
|
|
474
483
|
/**
|
|
475
484
|
* 获取表格数据集,包含新增、删除、修改
|
|
476
485
|
*/
|
|
477
|
-
_getRecordset
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
var delRecords = removeRecords.concat(pendingRecords);
|
|
486
|
+
_getRecordset() {
|
|
487
|
+
const removeRecords = this.getRemoveRecords();
|
|
488
|
+
const pendingRecords = this.getPendingRecords();
|
|
489
|
+
const delRecords = removeRecords.concat(pendingRecords);
|
|
482
490
|
// 如果已经被删除,则无需放到更新数组
|
|
483
|
-
|
|
484
|
-
return !delRecords.some(
|
|
485
|
-
return _this5.eqRow(item, row);
|
|
486
|
-
});
|
|
491
|
+
const updateRecords = this.getUpdateRecords().filter(row => {
|
|
492
|
+
return !delRecords.some(item => this.eqRow(item, row));
|
|
487
493
|
});
|
|
488
494
|
return {
|
|
489
495
|
insertRecords: this.getInsertRecords(),
|
|
490
|
-
removeRecords
|
|
491
|
-
updateRecords
|
|
492
|
-
pendingRecords
|
|
496
|
+
removeRecords,
|
|
497
|
+
updateRecords,
|
|
498
|
+
pendingRecords
|
|
493
499
|
};
|
|
494
500
|
},
|
|
495
501
|
/**
|
|
496
502
|
* 获取新增的临时数据
|
|
497
503
|
*/
|
|
498
|
-
_getInsertRecords
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
504
|
+
_getInsertRecords() {
|
|
505
|
+
const {
|
|
506
|
+
fullAllDataRowIdData
|
|
507
|
+
} = this;
|
|
508
|
+
const insertList = this.editStore.insertList;
|
|
509
|
+
const insertRecords = [];
|
|
510
|
+
insertList.forEach(row => {
|
|
511
|
+
const rowid = (0, _util.getRowid)(this, row);
|
|
505
512
|
if (fullAllDataRowIdData[rowid]) {
|
|
506
513
|
insertRecords.push(row);
|
|
507
514
|
}
|
|
@@ -511,7 +518,7 @@ var _default = exports.default = {
|
|
|
511
518
|
/**
|
|
512
519
|
* 获取已删除的数据
|
|
513
520
|
*/
|
|
514
|
-
_getRemoveRecords
|
|
521
|
+
_getRemoveRecords() {
|
|
515
522
|
return this.editStore.removeList;
|
|
516
523
|
},
|
|
517
524
|
/**
|
|
@@ -519,55 +526,66 @@ var _default = exports.default = {
|
|
|
519
526
|
* 只精准匹配 row 的更改
|
|
520
527
|
* 如果是树表格,子节点更改状态不会影响父节点的更新状态
|
|
521
528
|
*/
|
|
522
|
-
_getUpdateRecords
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
+
_getUpdateRecords() {
|
|
530
|
+
const {
|
|
531
|
+
keepSource,
|
|
532
|
+
tableFullData,
|
|
533
|
+
isUpdateByRow,
|
|
534
|
+
treeConfig,
|
|
535
|
+
treeOpts,
|
|
536
|
+
editStore
|
|
537
|
+
} = this;
|
|
529
538
|
if (keepSource) {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
539
|
+
const {
|
|
540
|
+
actived
|
|
541
|
+
} = editStore;
|
|
542
|
+
const {
|
|
543
|
+
row,
|
|
544
|
+
column
|
|
545
|
+
} = actived;
|
|
533
546
|
if (row || column) {
|
|
534
547
|
this._syncActivedCell();
|
|
535
548
|
}
|
|
536
549
|
if (treeConfig) {
|
|
537
|
-
return _xeUtils.default.filterTree(tableFullData,
|
|
538
|
-
return isUpdateByRow(row);
|
|
539
|
-
}, treeOpts);
|
|
550
|
+
return _xeUtils.default.filterTree(tableFullData, row => isUpdateByRow(row), treeOpts);
|
|
540
551
|
}
|
|
541
|
-
return tableFullData.filter(
|
|
542
|
-
return isUpdateByRow(row);
|
|
543
|
-
});
|
|
552
|
+
return tableFullData.filter(row => isUpdateByRow(row));
|
|
544
553
|
}
|
|
545
554
|
return [];
|
|
546
555
|
},
|
|
547
556
|
/**
|
|
548
557
|
* 处理激活编辑
|
|
549
558
|
*/
|
|
550
|
-
handleEdit
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
editOpts
|
|
554
|
-
tableColumn
|
|
555
|
-
editConfig
|
|
556
|
-
mouseConfig
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
559
|
+
handleEdit(params, evnt) {
|
|
560
|
+
const {
|
|
561
|
+
editStore,
|
|
562
|
+
editOpts,
|
|
563
|
+
tableColumn,
|
|
564
|
+
editConfig,
|
|
565
|
+
mouseConfig
|
|
566
|
+
} = this;
|
|
567
|
+
const {
|
|
568
|
+
mode
|
|
569
|
+
} = editOpts;
|
|
570
|
+
const {
|
|
571
|
+
actived,
|
|
572
|
+
focused
|
|
573
|
+
} = editStore;
|
|
574
|
+
const {
|
|
575
|
+
row,
|
|
576
|
+
column
|
|
577
|
+
} = params;
|
|
578
|
+
const {
|
|
579
|
+
editRender
|
|
580
|
+
} = column;
|
|
581
|
+
const cell = params.cell = params.cell || this.getCellElement(row, column);
|
|
582
|
+
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
565
583
|
if (cell && (0, _utils.isEnableConf)(editConfig) && (0, _utils.isEnableConf)(editRender)) {
|
|
566
584
|
// 激活编辑
|
|
567
585
|
if (!this.hasPendingByRow(row)) {
|
|
568
586
|
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
569
587
|
// 判断是否禁用编辑
|
|
570
|
-
|
|
588
|
+
let type = 'edit-disabled';
|
|
571
589
|
if (!beforeEditMethod || beforeEditMethod(Object.assign(Object.assign({}, params), {
|
|
572
590
|
$table: this,
|
|
573
591
|
$grid: this.$xegrid
|
|
@@ -587,51 +605,53 @@ var _default = exports.default = {
|
|
|
587
605
|
actived.row = row;
|
|
588
606
|
actived.column = column;
|
|
589
607
|
if (mode === 'row') {
|
|
590
|
-
tableColumn.forEach(
|
|
591
|
-
return _this7._getColumnModel(row, column);
|
|
592
|
-
});
|
|
608
|
+
tableColumn.forEach(column => this._getColumnModel(row, column));
|
|
593
609
|
} else {
|
|
594
610
|
this._getColumnModel(row, column);
|
|
595
611
|
}
|
|
596
|
-
|
|
597
|
-
this.$nextTick(
|
|
598
|
-
|
|
612
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
613
|
+
this.$nextTick(() => {
|
|
614
|
+
this.handleFocus(params, evnt);
|
|
599
615
|
if (afterEditMethod) {
|
|
600
616
|
afterEditMethod(Object.assign(Object.assign({}, params), {
|
|
601
|
-
$table:
|
|
602
|
-
$grid:
|
|
617
|
+
$table: this,
|
|
618
|
+
$grid: this.$xegrid
|
|
603
619
|
}));
|
|
604
620
|
}
|
|
605
621
|
});
|
|
606
622
|
}
|
|
607
623
|
this.emitEvent(type, {
|
|
608
|
-
row
|
|
624
|
+
row,
|
|
609
625
|
rowIndex: this.getRowIndex(row),
|
|
610
626
|
$rowIndex: this.getVMRowIndex(row),
|
|
611
|
-
column
|
|
627
|
+
column,
|
|
612
628
|
columnIndex: this.getColumnIndex(column),
|
|
613
629
|
$columnIndex: this.getVMColumnIndex(column)
|
|
614
630
|
}, evnt);
|
|
615
631
|
// v4已废弃
|
|
616
632
|
if (type === 'edit-activated') {
|
|
617
633
|
this.emitEvent('edit-actived', {
|
|
618
|
-
row
|
|
634
|
+
row,
|
|
619
635
|
rowIndex: this.getRowIndex(row),
|
|
620
636
|
$rowIndex: this.getVMRowIndex(row),
|
|
621
|
-
column
|
|
637
|
+
column,
|
|
622
638
|
columnIndex: this.getColumnIndex(column),
|
|
623
639
|
$columnIndex: this.getVMColumnIndex(column)
|
|
624
640
|
}, evnt);
|
|
625
641
|
}
|
|
626
642
|
} else {
|
|
627
|
-
|
|
643
|
+
const {
|
|
644
|
+
column: oldColumn
|
|
645
|
+
} = actived;
|
|
628
646
|
if (mouseConfig) {
|
|
629
647
|
this.clearSelected(evnt);
|
|
630
648
|
this.clearCellAreas(evnt);
|
|
631
649
|
this.clearCopyCellArea(evnt);
|
|
632
650
|
}
|
|
633
651
|
if (oldColumn !== column) {
|
|
634
|
-
|
|
652
|
+
const {
|
|
653
|
+
model: oldModel
|
|
654
|
+
} = oldColumn;
|
|
635
655
|
if (oldModel.update) {
|
|
636
656
|
(0, _util.setCellValue)(row, oldColumn, oldModel.value);
|
|
637
657
|
}
|
|
@@ -640,8 +660,8 @@ var _default = exports.default = {
|
|
|
640
660
|
column.renderHeight = cell.offsetHeight;
|
|
641
661
|
actived.args = params;
|
|
642
662
|
actived.column = column;
|
|
643
|
-
setTimeout(
|
|
644
|
-
|
|
663
|
+
setTimeout(() => {
|
|
664
|
+
this.handleFocus(params, evnt);
|
|
645
665
|
});
|
|
646
666
|
}
|
|
647
667
|
focused.column = null;
|
|
@@ -654,46 +674,53 @@ var _default = exports.default = {
|
|
|
654
674
|
/**
|
|
655
675
|
* @deprecated
|
|
656
676
|
*/
|
|
657
|
-
handleActived
|
|
677
|
+
handleActived(params, evnt) {
|
|
658
678
|
return this.handleEdit(params, evnt);
|
|
659
679
|
},
|
|
660
|
-
_getColumnModel
|
|
661
|
-
|
|
662
|
-
|
|
680
|
+
_getColumnModel(row, column) {
|
|
681
|
+
const {
|
|
682
|
+
model,
|
|
683
|
+
editRender
|
|
684
|
+
} = column;
|
|
663
685
|
if (editRender) {
|
|
664
686
|
model.value = (0, _util.getCellValue)(row, column);
|
|
665
687
|
model.update = false;
|
|
666
688
|
}
|
|
667
689
|
},
|
|
668
|
-
_setColumnModel
|
|
669
|
-
|
|
670
|
-
|
|
690
|
+
_setColumnModel(row, column) {
|
|
691
|
+
const {
|
|
692
|
+
model,
|
|
693
|
+
editRender
|
|
694
|
+
} = column;
|
|
671
695
|
if (editRender && model.update) {
|
|
672
696
|
(0, _util.setCellValue)(row, column, model.value);
|
|
673
697
|
model.update = false;
|
|
674
698
|
model.value = null;
|
|
675
699
|
}
|
|
676
700
|
},
|
|
677
|
-
_syncActivedCell
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
editStore
|
|
681
|
-
editOpts
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
701
|
+
_syncActivedCell() {
|
|
702
|
+
const {
|
|
703
|
+
tableColumn,
|
|
704
|
+
editStore,
|
|
705
|
+
editOpts
|
|
706
|
+
} = this;
|
|
707
|
+
const {
|
|
708
|
+
actived
|
|
709
|
+
} = editStore;
|
|
710
|
+
const {
|
|
711
|
+
row,
|
|
712
|
+
column
|
|
713
|
+
} = actived;
|
|
685
714
|
if (row || column) {
|
|
686
715
|
if (editOpts.mode === 'row') {
|
|
687
|
-
tableColumn.forEach(
|
|
688
|
-
return _this8._setColumnModel(row, column);
|
|
689
|
-
});
|
|
716
|
+
tableColumn.forEach(column => this._setColumnModel(row, column));
|
|
690
717
|
} else {
|
|
691
718
|
this._setColumnModel(row, column);
|
|
692
719
|
}
|
|
693
720
|
}
|
|
694
721
|
},
|
|
695
|
-
_clearActived
|
|
696
|
-
if (process.env.
|
|
722
|
+
_clearActived(evnt) {
|
|
723
|
+
if (process.env.NODE_ENV === 'development') {
|
|
697
724
|
(0, _log.warnLog)('vxe.error.delFunc', ['clearActived', 'clearEdit']);
|
|
698
725
|
}
|
|
699
726
|
// 即将废弃
|
|
@@ -702,12 +729,18 @@ var _default = exports.default = {
|
|
|
702
729
|
/**
|
|
703
730
|
* 清除激活的编辑
|
|
704
731
|
*/
|
|
705
|
-
_clearEdit
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
732
|
+
_clearEdit(evnt) {
|
|
733
|
+
const {
|
|
734
|
+
editStore
|
|
735
|
+
} = this;
|
|
736
|
+
const {
|
|
737
|
+
actived,
|
|
738
|
+
focused
|
|
739
|
+
} = editStore;
|
|
740
|
+
const {
|
|
741
|
+
row,
|
|
742
|
+
column
|
|
743
|
+
} = actived;
|
|
711
744
|
if (row || column) {
|
|
712
745
|
this._syncActivedCell();
|
|
713
746
|
actived.args = null;
|
|
@@ -715,10 +748,10 @@ var _default = exports.default = {
|
|
|
715
748
|
actived.column = null;
|
|
716
749
|
this.updateFooter();
|
|
717
750
|
this.emitEvent('edit-closed', {
|
|
718
|
-
row
|
|
751
|
+
row,
|
|
719
752
|
rowIndex: this.getRowIndex(row),
|
|
720
753
|
$rowIndex: this.getVMRowIndex(row),
|
|
721
|
-
column
|
|
754
|
+
column,
|
|
722
755
|
columnIndex: this.getColumnIndex(column),
|
|
723
756
|
$columnIndex: this.getVMColumnIndex(column)
|
|
724
757
|
}, evnt);
|
|
@@ -732,27 +765,33 @@ var _default = exports.default = {
|
|
|
732
765
|
}
|
|
733
766
|
return this.$nextTick();
|
|
734
767
|
},
|
|
735
|
-
_getActiveRecord
|
|
736
|
-
if (process.env.
|
|
768
|
+
_getActiveRecord() {
|
|
769
|
+
if (process.env.NODE_ENV === 'development') {
|
|
737
770
|
(0, _log.warnLog)('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
|
|
738
771
|
}
|
|
739
772
|
// 即将废弃
|
|
740
773
|
return this.getEditRecord();
|
|
741
774
|
},
|
|
742
|
-
_getEditRecord
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
775
|
+
_getEditRecord() {
|
|
776
|
+
const {
|
|
777
|
+
$el,
|
|
778
|
+
editStore,
|
|
779
|
+
afterFullData
|
|
780
|
+
} = this;
|
|
781
|
+
const {
|
|
782
|
+
actived
|
|
783
|
+
} = editStore;
|
|
784
|
+
const {
|
|
785
|
+
args,
|
|
786
|
+
row
|
|
787
|
+
} = actived;
|
|
749
788
|
if (args && this.findRowIndexOf(afterFullData, row) > -1 && $el.querySelectorAll('.vxe-body--column.col--active').length) {
|
|
750
789
|
return Object.assign({}, args);
|
|
751
790
|
}
|
|
752
791
|
return null;
|
|
753
792
|
},
|
|
754
|
-
_isActiveByRow
|
|
755
|
-
if (process.env.
|
|
793
|
+
_isActiveByRow(row) {
|
|
794
|
+
if (process.env.NODE_ENV === 'development') {
|
|
756
795
|
(0, _log.warnLog)('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
|
|
757
796
|
}
|
|
758
797
|
// 即将废弃
|
|
@@ -762,35 +801,45 @@ var _default = exports.default = {
|
|
|
762
801
|
* 判断行是否为激活编辑状态
|
|
763
802
|
* @param {Row} row 行对象
|
|
764
803
|
*/
|
|
765
|
-
_isEditByRow
|
|
804
|
+
_isEditByRow(row) {
|
|
766
805
|
return this.editStore.actived.row === row;
|
|
767
806
|
},
|
|
768
807
|
/**
|
|
769
808
|
* 处理聚焦
|
|
770
809
|
*/
|
|
771
|
-
handleFocus
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
810
|
+
handleFocus(params) {
|
|
811
|
+
const {
|
|
812
|
+
editOpts
|
|
813
|
+
} = this;
|
|
814
|
+
const {
|
|
815
|
+
row,
|
|
816
|
+
column,
|
|
817
|
+
cell
|
|
818
|
+
} = params;
|
|
819
|
+
const {
|
|
820
|
+
editRender
|
|
821
|
+
} = column;
|
|
776
822
|
if ((0, _utils.isEnableConf)(editRender)) {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
if (
|
|
793
|
-
inputElem.
|
|
823
|
+
const compRender = renderer.get(editRender.name);
|
|
824
|
+
let autoFocus = editRender.autofocus || editRender.autoFocus;
|
|
825
|
+
let autoSelect = editRender.autoSelect || editRender.autoselect;
|
|
826
|
+
let inputElem;
|
|
827
|
+
// 是否启用聚焦
|
|
828
|
+
if (editOpts.autoFocus) {
|
|
829
|
+
if (!autoFocus && compRender) {
|
|
830
|
+
autoFocus = compRender.tableAutoFocus || compRender.tableAutofocus || compRender.autoFocus || compRender.autofocus;
|
|
831
|
+
}
|
|
832
|
+
if (!autoSelect && compRender) {
|
|
833
|
+
autoSelect = compRender.tableAutoSelect || compRender.autoSelect || compRender.autoselect;
|
|
834
|
+
}
|
|
835
|
+
// 如果指定了聚焦 class
|
|
836
|
+
if (_xeUtils.default.isFunction(autoFocus)) {
|
|
837
|
+
inputElem = autoFocus.call(this, params);
|
|
838
|
+
} else if (autoFocus) {
|
|
839
|
+
inputElem = cell.querySelector(autoFocus);
|
|
840
|
+
if (inputElem) {
|
|
841
|
+
inputElem.focus();
|
|
842
|
+
}
|
|
794
843
|
}
|
|
795
844
|
}
|
|
796
845
|
if (inputElem) {
|
|
@@ -799,19 +848,24 @@ var _default = exports.default = {
|
|
|
799
848
|
} else {
|
|
800
849
|
// 保持一致行为,光标移到末端
|
|
801
850
|
if (_dom.browse.msie) {
|
|
802
|
-
|
|
851
|
+
const textRange = inputElem.createTextRange();
|
|
803
852
|
textRange.collapse(false);
|
|
804
853
|
textRange.select();
|
|
805
854
|
}
|
|
806
855
|
}
|
|
807
856
|
} else {
|
|
808
|
-
//
|
|
809
|
-
|
|
857
|
+
// 是否自动定位
|
|
858
|
+
if (editOpts.autoPos) {
|
|
859
|
+
if (!column.fixed) {
|
|
860
|
+
// 显示到可视区中
|
|
861
|
+
this.scrollToRow(row, column);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
810
864
|
}
|
|
811
865
|
}
|
|
812
866
|
},
|
|
813
|
-
_setActiveRow
|
|
814
|
-
if (process.env.
|
|
867
|
+
_setActiveRow(row) {
|
|
868
|
+
if (process.env.NODE_ENV === 'development') {
|
|
815
869
|
(0, _log.warnLog)('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
|
|
816
870
|
}
|
|
817
871
|
// 即将废弃
|
|
@@ -820,17 +874,15 @@ var _default = exports.default = {
|
|
|
820
874
|
/**
|
|
821
875
|
* 激活行编辑
|
|
822
876
|
*/
|
|
823
|
-
_setEditRow
|
|
824
|
-
|
|
825
|
-
return (0, _utils.isEnableConf)(column.editRender);
|
|
826
|
-
});
|
|
877
|
+
_setEditRow(row, fieldOrColumn) {
|
|
878
|
+
let column = _xeUtils.default.find(this.visibleColumn, column => (0, _utils.isEnableConf)(column.editRender));
|
|
827
879
|
if (fieldOrColumn) {
|
|
828
880
|
column = _xeUtils.default.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
829
881
|
}
|
|
830
882
|
return this.setEditCell(row, column);
|
|
831
883
|
},
|
|
832
|
-
_setActiveCell
|
|
833
|
-
if (process.env.
|
|
884
|
+
_setActiveCell(row, fieldOrColumn) {
|
|
885
|
+
if (process.env.NODE_ENV === 'development') {
|
|
834
886
|
(0, _log.warnLog)('vxe.error.delFunc', ['setActiveCell', 'setEditCell']);
|
|
835
887
|
}
|
|
836
888
|
// 即将废弃
|
|
@@ -839,23 +891,24 @@ var _default = exports.default = {
|
|
|
839
891
|
/**
|
|
840
892
|
* 激活单元格编辑
|
|
841
893
|
*/
|
|
842
|
-
_setEditCell
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
894
|
+
_setEditCell(row, fieldOrColumn) {
|
|
895
|
+
const {
|
|
896
|
+
editConfig
|
|
897
|
+
} = this;
|
|
898
|
+
const column = _xeUtils.default.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
846
899
|
if (row && column && (0, _utils.isEnableConf)(editConfig) && (0, _utils.isEnableConf)(column.editRender)) {
|
|
847
|
-
return this.scrollToRow(row, true).then(
|
|
848
|
-
|
|
900
|
+
return this.scrollToRow(row, true).then(() => {
|
|
901
|
+
const cell = this.getCellElement(row, column);
|
|
849
902
|
if (cell) {
|
|
850
|
-
|
|
851
|
-
row
|
|
852
|
-
rowIndex:
|
|
853
|
-
column
|
|
854
|
-
columnIndex:
|
|
855
|
-
cell
|
|
856
|
-
$table:
|
|
903
|
+
this.handleEdit({
|
|
904
|
+
row,
|
|
905
|
+
rowIndex: this.getRowIndex(row),
|
|
906
|
+
column,
|
|
907
|
+
columnIndex: this.getColumnIndex(column),
|
|
908
|
+
cell,
|
|
909
|
+
$table: this
|
|
857
910
|
});
|
|
858
|
-
|
|
911
|
+
this.lastCallTime = Date.now();
|
|
859
912
|
}
|
|
860
913
|
});
|
|
861
914
|
}
|
|
@@ -864,21 +917,23 @@ var _default = exports.default = {
|
|
|
864
917
|
/**
|
|
865
918
|
* 只对 trigger=dblclick 有效,选中单元格
|
|
866
919
|
*/
|
|
867
|
-
_setSelectCell
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
920
|
+
_setSelectCell(row, fieldOrColumn) {
|
|
921
|
+
const {
|
|
922
|
+
tableData,
|
|
923
|
+
editOpts,
|
|
924
|
+
visibleColumn
|
|
925
|
+
} = this;
|
|
926
|
+
const column = _xeUtils.default.isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
872
927
|
if (row && column && editOpts.trigger !== 'manual') {
|
|
873
|
-
|
|
928
|
+
const rowIndex = this.findRowIndexOf(tableData, row);
|
|
874
929
|
if (rowIndex > -1) {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
row
|
|
878
|
-
rowIndex
|
|
879
|
-
column
|
|
930
|
+
const cell = this.getCellElement(row, column);
|
|
931
|
+
const params = {
|
|
932
|
+
row,
|
|
933
|
+
rowIndex,
|
|
934
|
+
column,
|
|
880
935
|
columnIndex: visibleColumn.indexOf(column),
|
|
881
|
-
cell
|
|
936
|
+
cell
|
|
882
937
|
};
|
|
883
938
|
this.handleSelected(params, {});
|
|
884
939
|
}
|
|
@@ -888,47 +943,53 @@ var _default = exports.default = {
|
|
|
888
943
|
/**
|
|
889
944
|
* 处理选中源
|
|
890
945
|
*/
|
|
891
|
-
handleSelected
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
mouseOpts
|
|
895
|
-
editOpts
|
|
896
|
-
editStore
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
946
|
+
handleSelected(params, evnt) {
|
|
947
|
+
const {
|
|
948
|
+
mouseConfig,
|
|
949
|
+
mouseOpts,
|
|
950
|
+
editOpts,
|
|
951
|
+
editStore
|
|
952
|
+
} = this;
|
|
953
|
+
const {
|
|
954
|
+
actived,
|
|
955
|
+
selected
|
|
956
|
+
} = editStore;
|
|
957
|
+
const {
|
|
958
|
+
row,
|
|
959
|
+
column
|
|
960
|
+
} = params;
|
|
961
|
+
const isMouseSelected = mouseConfig && mouseOpts.selected;
|
|
962
|
+
const selectMethod = () => {
|
|
903
963
|
if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
|
|
904
964
|
if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
965
|
+
this.clearEdit(evnt);
|
|
966
|
+
this.clearSelected(evnt);
|
|
967
|
+
this.clearCellAreas(evnt);
|
|
968
|
+
this.clearCopyCellArea(evnt);
|
|
909
969
|
selected.args = params;
|
|
910
970
|
selected.row = row;
|
|
911
971
|
selected.column = column;
|
|
912
972
|
if (isMouseSelected) {
|
|
913
|
-
|
|
973
|
+
this.addColSdCls();
|
|
914
974
|
}
|
|
915
|
-
|
|
975
|
+
this.focus();
|
|
916
976
|
if (evnt) {
|
|
917
|
-
|
|
977
|
+
this.emitEvent('cell-selected', params, evnt);
|
|
918
978
|
}
|
|
919
979
|
}
|
|
920
980
|
}
|
|
921
|
-
return
|
|
981
|
+
return this.$nextTick();
|
|
922
982
|
};
|
|
923
983
|
return selectMethod();
|
|
924
984
|
},
|
|
925
985
|
/**
|
|
926
986
|
* 获取选中的单元格
|
|
927
987
|
*/
|
|
928
|
-
_getSelectedCell
|
|
929
|
-
|
|
930
|
-
args
|
|
931
|
-
column
|
|
988
|
+
_getSelectedCell() {
|
|
989
|
+
const {
|
|
990
|
+
args,
|
|
991
|
+
column
|
|
992
|
+
} = this.editStore.selected;
|
|
932
993
|
if (args && column) {
|
|
933
994
|
return Object.assign({}, args);
|
|
934
995
|
}
|
|
@@ -937,35 +998,39 @@ var _default = exports.default = {
|
|
|
937
998
|
/**
|
|
938
999
|
* 清除所选中源状态
|
|
939
1000
|
*/
|
|
940
|
-
_clearSelected
|
|
941
|
-
|
|
1001
|
+
_clearSelected() {
|
|
1002
|
+
const {
|
|
1003
|
+
selected
|
|
1004
|
+
} = this.editStore;
|
|
942
1005
|
selected.row = null;
|
|
943
1006
|
selected.column = null;
|
|
944
1007
|
this.reColTitleSdCls();
|
|
945
1008
|
this.reColSdCls();
|
|
946
1009
|
return this.$nextTick();
|
|
947
1010
|
},
|
|
948
|
-
reColTitleSdCls
|
|
949
|
-
|
|
1011
|
+
reColTitleSdCls() {
|
|
1012
|
+
const headerElem = this.elemStore['main-header-list'];
|
|
950
1013
|
if (headerElem) {
|
|
951
|
-
_xeUtils.default.arrayEach(headerElem.querySelectorAll('.col--title-selected'),
|
|
952
|
-
return (0, _dom.removeClass)(elem, 'col--title-selected');
|
|
953
|
-
});
|
|
1014
|
+
_xeUtils.default.arrayEach(headerElem.querySelectorAll('.col--title-selected'), elem => (0, _dom.removeClass)(elem, 'col--title-selected'));
|
|
954
1015
|
}
|
|
955
1016
|
},
|
|
956
|
-
reColSdCls
|
|
957
|
-
|
|
1017
|
+
reColSdCls() {
|
|
1018
|
+
const cell = this.$el.querySelector('.col--selected');
|
|
958
1019
|
if (cell) {
|
|
959
1020
|
(0, _dom.removeClass)(cell, 'col--selected');
|
|
960
1021
|
}
|
|
961
1022
|
},
|
|
962
|
-
addColSdCls
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1023
|
+
addColSdCls() {
|
|
1024
|
+
const {
|
|
1025
|
+
selected
|
|
1026
|
+
} = this.editStore;
|
|
1027
|
+
const {
|
|
1028
|
+
row,
|
|
1029
|
+
column
|
|
1030
|
+
} = selected;
|
|
966
1031
|
this.reColSdCls();
|
|
967
1032
|
if (row && column) {
|
|
968
|
-
|
|
1033
|
+
const cell = this.getCellElement(row, column);
|
|
969
1034
|
if (cell) {
|
|
970
1035
|
(0, _dom.addClass)(cell, 'col--selected');
|
|
971
1036
|
}
|