@opentinyvue/vue-grid 2.21.0 → 3.21.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/index.js +712 -877
- package/package.json +14 -14
- package/src/body/src/body.d.ts +26 -1
- package/src/column/src/column.d.ts +229 -1
- package/src/column-anchor/src/methods.d.ts +3 -1
- package/src/config.d.ts +30 -10
- package/src/filter/src/panel.d.ts +40 -1
- package/src/footer/src/footer.d.ts +38 -1
- package/src/grid/grid.d.ts +71 -1
- package/src/header/src/header.d.ts +26 -1
- package/src/loading/src/loading.d.ts +23 -1
- package/src/menu/src/children.d.ts +17 -1
- package/src/menu/src/panel.d.ts +5 -1
- package/src/mobile-first/column-content.vue.d.ts +24 -1
- package/src/mobile-first/column-layout.vue.d.ts +23 -1
- package/src/mobile-first/column-link.vue.d.ts +21 -1
- package/src/mobile-first/column-type.vue.d.ts +21 -1
- package/src/mobile-first/custom-view.vue.d.ts +17 -1
- package/src/mobile-first/gantt-view.vue.d.ts +17 -1
- package/src/mobile-first/index.vue.d.ts +76 -1
- package/src/mobile-first/list-view.vue.d.ts +17 -1
- package/src/mobile-first/table-row.vue.d.ts +31 -1
- package/src/radio/src/radio.d.ts +49 -1
- package/src/table/src/table.d.ts +624 -1
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { t } from '@opentinyvue/vue-locale';
|
|
|
2
2
|
import '@opentinyvue/vue-theme/grid/index.css';
|
|
3
3
|
import { Interceptor, StoreMap } from '@opentinyvue/vue-renderless/grid/core';
|
|
4
4
|
import { extend, getObj } from '@opentinyvue/vue-renderless/common/object';
|
|
5
|
-
import { iconError, iconSortTriangleDescending, iconSortTriangleAscending, iconSortTriangle, iconUnfilter, iconEdit, iconConmentRefresh, iconMinscreen, iconFullscreen, iconSetting, iconRadio, iconRadioselected, iconSearch, iconCheckedSur, iconCheck, iconHalfselect, iconArrowBottom, IconEllipsis, iconClose, iconYes, iconExpand, iconPutAway, iconEllipsis, iconChevronRight, iconChevronDown
|
|
5
|
+
import { iconError, iconSortTriangleDescending, iconSortTriangleAscending, iconSortTriangle, iconUnfilter, iconEdit, iconConmentRefresh, iconMinscreen, iconFullscreen, iconSetting, iconRadio, iconRadioselected, iconSearch, iconCheckedSur, iconCheck, iconHalfselect, iconArrowBottom, IconEllipsis, iconClose, iconYes, iconExpand, iconPutAway, iconEllipsis, iconMarkOn, iconChevronRight, iconChevronDown } from '@opentinyvue/vue-icon';
|
|
6
6
|
import { $prefix, defineComponent, h, hooks, $install, isVue2, isVnode, $props, mergeClass, resolveTheme, useInstanceSlots, useRelation, emitter, resolveMode, useBreakpoint, setup as setup$1 } from '@opentinyvue/vue-common';
|
|
7
7
|
import { uniqueId, toNumber as toNumber$1, isBoolean, each, isObject as isObject$1, isFunction, isArray, findIndexOf, get, set, clear, destructuring, clone, mapTree, eachTree, findTree as findTree$1, has, isUndefined, find, isEqual, filterTree, arrayEach, isNumber, sum, template, assign, objectMap, sortBy, isString, remove, toStringJSON, toArray, arrayIndexOf } from '@opentinyvue/vue-renderless/grid/static/';
|
|
8
8
|
import { emitEvent, getFuncText, getDomNode, getRowid, getEventTargetNode, isScale, hasChildrenList, getListeners, setColumnFormat, updateCellTitle, getFilters, getColumnConfig, formatText, setCellValue, getColumnList, rowToVisible, colToVisible, getCell, assemColumn, getRowkey, GlobalEvent, getCellValue, getClass, isPx, getRowNodes, getCellNodeIndex } from '@opentinyvue/vue-renderless/grid/utils';
|
|
@@ -10,6 +10,7 @@ import Tooltip$1 from '@opentinyvue/vue-tooltip';
|
|
|
10
10
|
import { isNull, isObject, isEmptyObject, isNumber as isNumber$1, isDate } from '@opentinyvue/vue-renderless/common/type';
|
|
11
11
|
import { addClass, removeClass, isDisplayNone, on, getStyle, preventDefault, off, hasClass } from '@opentinyvue/vue-renderless/common/deps/dom';
|
|
12
12
|
import { random, toDecimal, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, toBoolValue } from '@opentinyvue/vue-renderless/common/string';
|
|
13
|
+
import { createVNode, isVNode, mergeProps, createTextVNode, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, normalizeStyle, createElementVNode, Fragment, renderList } from 'vue';
|
|
13
14
|
import { toDate, getDateWithNewTimezone, format, toDateStr } from '@opentinyvue/vue-renderless/common/date';
|
|
14
15
|
import { log } from '@opentinyvue/vue-renderless/common';
|
|
15
16
|
import { toNumber, findTree, find as find$1, isEqual as isEqual$1, arrayEach as arrayEach$1 } from '@opentinyvue/vue-renderless/grid/static';
|
|
@@ -35,77 +36,38 @@ import Resize$1 from '@opentinyvue/vue-renderless/grid/plugins/resize';
|
|
|
35
36
|
import Modal$1 from '@opentinyvue/vue-modal';
|
|
36
37
|
import Pager$1 from '@opentinyvue/vue-pager';
|
|
37
38
|
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
function requireHelper() {
|
|
45
|
-
if (hasRequiredHelper) return helper;
|
|
46
|
-
hasRequiredHelper = 1;
|
|
47
|
-
function _extends() {
|
|
48
|
-
return _extends = Object.assign ? Object.assign.bind() : function(a) {
|
|
49
|
-
for (var b, c = 1; c < arguments.length; c++) for (var d in b = arguments[c], b) Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d]);
|
|
50
|
-
return a;
|
|
51
|
-
}, _extends.apply(this, arguments);
|
|
52
|
-
}
|
|
53
|
-
var normalMerge = ["attrs", "props", "domProps"], toArrayMerge = ["class", "style", "directives"], functionalMerge = ["on", "nativeOn"], mergeJsxProps = function mergeJsxProps2(a) {
|
|
54
|
-
return a.reduce(function(c, a2) {
|
|
55
|
-
for (var b in a2) if (!c[b]) c[b] = a2[b];
|
|
56
|
-
else if (-1 !== normalMerge.indexOf(b)) c[b] = _extends({}, c[b], a2[b]);
|
|
57
|
-
else if (-1 !== toArrayMerge.indexOf(b)) {
|
|
58
|
-
var d = c[b] instanceof Array ? c[b] : [c[b]], e = a2[b] instanceof Array ? a2[b] : [a2[b]];
|
|
59
|
-
c[b] = [].concat(d, e);
|
|
60
|
-
} else if (-1 !== functionalMerge.indexOf(b)) {
|
|
61
|
-
for (var f in a2[b]) if (c[b][f]) {
|
|
62
|
-
var g = c[b][f] instanceof Array ? c[b][f] : [c[b][f]], h = a2[b][f] instanceof Array ? a2[b][f] : [a2[b][f]];
|
|
63
|
-
c[b][f] = [].concat(g, h);
|
|
64
|
-
} else c[b][f] = a2[b][f];
|
|
65
|
-
} else if ("hook" === b) for (var i in a2[b]) c[b][i] = c[b][i] ? mergeFn(c[b][i], a2[b][i]) : a2[b][i];
|
|
66
|
-
else c[b] = a2[b];
|
|
67
|
-
return c;
|
|
68
|
-
}, {});
|
|
69
|
-
}, mergeFn = function mergeFn2(a, b) {
|
|
39
|
+
function _createForOfIteratorHelperLoose$1(r, e) {
|
|
40
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
41
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
42
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
|
|
43
|
+
t && (r = t);
|
|
44
|
+
var o = 0;
|
|
70
45
|
return function() {
|
|
71
|
-
|
|
46
|
+
return o >= r.length ? { done: true } : { done: false, value: r[o++] };
|
|
72
47
|
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return helper;
|
|
48
|
+
}
|
|
49
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
76
50
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (render) {
|
|
83
|
-
options.render = render;
|
|
84
|
-
options.staticRenderFns = staticRenderFns;
|
|
85
|
-
options._compiled = true;
|
|
86
|
-
}
|
|
87
|
-
var hook;
|
|
88
|
-
if (injectStyles) {
|
|
89
|
-
hook = injectStyles;
|
|
90
|
-
}
|
|
91
|
-
if (hook) {
|
|
92
|
-
if (options.functional) {
|
|
93
|
-
options._injectStyles = hook;
|
|
94
|
-
var originalRender = options.render;
|
|
95
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
96
|
-
hook.call(context);
|
|
97
|
-
return originalRender(h, context);
|
|
98
|
-
};
|
|
99
|
-
} else {
|
|
100
|
-
var existing = options.beforeCreate;
|
|
101
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
102
|
-
}
|
|
51
|
+
function _unsupportedIterableToArray$1(r, a) {
|
|
52
|
+
if (r) {
|
|
53
|
+
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
|
|
54
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
55
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
|
|
103
56
|
}
|
|
104
|
-
return {
|
|
105
|
-
exports: scriptExports,
|
|
106
|
-
options
|
|
107
|
-
};
|
|
108
57
|
}
|
|
58
|
+
function _arrayLikeToArray$1(r, a) {
|
|
59
|
+
(null == a || a > r.length) && (a = r.length);
|
|
60
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
61
|
+
return n;
|
|
62
|
+
}
|
|
63
|
+
var _export_sfc = function _export_sfc2(sfc, props) {
|
|
64
|
+
var target = sfc.__vccOpts || sfc;
|
|
65
|
+
for (var _iterator = _createForOfIteratorHelperLoose$1(props), _step; !(_step = _iterator()).done; ) {
|
|
66
|
+
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
|
|
67
|
+
target[key] = val;
|
|
68
|
+
}
|
|
69
|
+
return target;
|
|
70
|
+
};
|
|
109
71
|
|
|
110
72
|
var _excluded = ["input", "change"], _excluded2 = ["field"];
|
|
111
73
|
function _defineProperties(e, r) {
|
|
@@ -3057,7 +3019,7 @@ function renderColumn(args1) {
|
|
|
3057
3019
|
return h2("td", colProps, colChildren);
|
|
3058
3020
|
}
|
|
3059
3021
|
function renderRowGroupTds(args) {
|
|
3060
|
-
var $table = args.$table, closeable = args.closeable, currentIcon = args.currentIcon,
|
|
3022
|
+
var $table = args.$table, closeable = args.closeable, currentIcon = args.currentIcon, render18 = args.render, renderGroupCell = args.renderGroupCell;
|
|
3061
3023
|
var row2 = args.row, tableColumn3 = args.tableColumn, tds = args.tds, title = args.title;
|
|
3062
3024
|
var targetColumn = $table._rowGroupTargetColumn;
|
|
3063
3025
|
var value = row2.value || "";
|
|
@@ -3080,30 +3042,26 @@ function renderRowGroupTds(args) {
|
|
|
3080
3042
|
}
|
|
3081
3043
|
if (column === targetColumn) {
|
|
3082
3044
|
var groupTitleVNode = void 0;
|
|
3083
|
-
if (
|
|
3084
|
-
groupTitleVNode =
|
|
3045
|
+
if (render18) {
|
|
3046
|
+
groupTitleVNode = render18(h, params);
|
|
3085
3047
|
} else {
|
|
3086
|
-
groupTitleVNode = [
|
|
3048
|
+
groupTitleVNode = [createVNode("span", {
|
|
3087
3049
|
"class": "row-group-title"
|
|
3088
|
-
}, [header]), ":" + value,
|
|
3050
|
+
}, [header]), ":" + value, createVNode("span", {
|
|
3089
3051
|
"class": "tiny-badge"
|
|
3090
3052
|
}, [row2.children.length])];
|
|
3091
3053
|
}
|
|
3092
|
-
tds.push(
|
|
3054
|
+
tds.push(createVNode("td", {
|
|
3093
3055
|
"class": ["tiny-grid-body__column td-group", column.id],
|
|
3094
|
-
"
|
|
3095
|
-
|
|
3096
|
-
}
|
|
3097
|
-
}, [h("div", {
|
|
3056
|
+
"colspan": column._rowGroupColspan
|
|
3057
|
+
}, [createVNode("div", {
|
|
3098
3058
|
"class": "tiny-grid-cell-group"
|
|
3099
3059
|
}, [[closeable ? currentIcon : null].concat(groupTitleVNode)])]));
|
|
3100
3060
|
} else {
|
|
3101
|
-
tds.push(
|
|
3061
|
+
tds.push(createVNode("td", {
|
|
3102
3062
|
"class": ["tiny-grid-body__column td-placeholder", column.id],
|
|
3103
|
-
"
|
|
3104
|
-
|
|
3105
|
-
}
|
|
3106
|
-
}, [h("div", {
|
|
3063
|
+
"colspan": column._rowGroupColspan
|
|
3064
|
+
}, [createVNode("div", {
|
|
3107
3065
|
"class": "tiny-grid-cell-group"
|
|
3108
3066
|
}, [renderGroupCell ? renderGroupCell(h, params) : null])]));
|
|
3109
3067
|
}
|
|
@@ -3115,18 +3073,18 @@ function renderRowGroupData(_ref55) {
|
|
|
3115
3073
|
if (!virtualRow) {
|
|
3116
3074
|
return;
|
|
3117
3075
|
}
|
|
3118
|
-
var title = rowGroup.title, _rowGroup$closeable2 = rowGroup.closeable, closeable = _rowGroup$closeable2 === void 0 ? true : _rowGroup$closeable2,
|
|
3076
|
+
var title = rowGroup.title, _rowGroup$closeable2 = rowGroup.closeable, closeable = _rowGroup$closeable2 === void 0 ? true : _rowGroup$closeable2, render18 = rowGroup.render, renderGroupCell = rowGroup.renderGroupCell, className = rowGroup.className;
|
|
3119
3077
|
var _ref56 = {}, _ref56$tds = _ref56.tds, tds = _ref56$tds === void 0 ? [] : _ref56$tds, _ref56$ChevronRight = _ref56.ChevronRight, ChevronRight = _ref56$ChevronRight === void 0 ? iconChevronRight() : _ref56$ChevronRight, _ref56$ChevronDown = _ref56.ChevronDown, ChevronDown = _ref56$ChevronDown === void 0 ? iconChevronDown() : _ref56$ChevronDown;
|
|
3120
|
-
var currentIcon = row2.fold ?
|
|
3078
|
+
var currentIcon = row2.fold ? createVNode(ChevronRight, {
|
|
3121
3079
|
"class": "tiny-svg-size"
|
|
3122
|
-
}) :
|
|
3080
|
+
}, null) : createVNode(ChevronDown, {
|
|
3123
3081
|
"class": "tiny-svg-size"
|
|
3124
|
-
});
|
|
3082
|
+
}, null);
|
|
3125
3083
|
var args = {
|
|
3126
3084
|
$table,
|
|
3127
3085
|
closeable,
|
|
3128
3086
|
currentIcon,
|
|
3129
|
-
render:
|
|
3087
|
+
render: render18,
|
|
3130
3088
|
renderGroupCell
|
|
3131
3089
|
};
|
|
3132
3090
|
Object.assign(args, {
|
|
@@ -3145,22 +3103,18 @@ function renderRowGroupData(_ref55) {
|
|
|
3145
3103
|
}, event]);
|
|
3146
3104
|
}
|
|
3147
3105
|
};
|
|
3148
|
-
rows.push(
|
|
3106
|
+
rows.push(createVNode("tr", {
|
|
3149
3107
|
"class": ["tiny-grid-body__row", "group", className, {
|
|
3150
3108
|
hover: row2.hover
|
|
3151
3109
|
}],
|
|
3152
|
-
"
|
|
3153
|
-
|
|
3110
|
+
"data-rowid": rowid2,
|
|
3111
|
+
"onMouseout": function onMouseout() {
|
|
3112
|
+
return row2.hover = false;
|
|
3154
3113
|
},
|
|
3155
|
-
"
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
"mouseover": function mouseover() {
|
|
3160
|
-
return row2.hover = true;
|
|
3161
|
-
},
|
|
3162
|
-
"click": onClick
|
|
3163
|
-
}
|
|
3114
|
+
"onMouseover": function onMouseover() {
|
|
3115
|
+
return row2.hover = true;
|
|
3116
|
+
},
|
|
3117
|
+
"onClick": onClick
|
|
3164
3118
|
}, [tds]));
|
|
3165
3119
|
}
|
|
3166
3120
|
function renderRow(args) {
|
|
@@ -3505,7 +3459,7 @@ function renderYSpace(_ref66) {
|
|
|
3505
3459
|
class: "tiny-grid-body__y-scrollbar"
|
|
3506
3460
|
}) : [null]]);
|
|
3507
3461
|
}
|
|
3508
|
-
var Body = defineComponent({
|
|
3462
|
+
var Body = /* @__PURE__ */ defineComponent({
|
|
3509
3463
|
name: $prefix + "GridBody",
|
|
3510
3464
|
props: {
|
|
3511
3465
|
collectColumn: Array,
|
|
@@ -3726,6 +3680,9 @@ Radio.model = {
|
|
|
3726
3680
|
event: "update:modelValue"
|
|
3727
3681
|
};
|
|
3728
3682
|
$install(Radio);
|
|
3683
|
+
function _isSlot(s) {
|
|
3684
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
3685
|
+
}
|
|
3729
3686
|
var renderInputArgs = function renderInputArgs2(_ref71) {
|
|
3730
3687
|
var _vm = _ref71._vm, inputFilter = _ref71.inputFilter;
|
|
3731
3688
|
var isAddbyProgram = false;
|
|
@@ -3792,15 +3749,15 @@ var iconRender = function iconRender2(checked, index2, halfChecked) {
|
|
|
3792
3749
|
tabindex: index2
|
|
3793
3750
|
};
|
|
3794
3751
|
if (typeof halfChecked === "undefined") {
|
|
3795
|
-
return checked ?
|
|
3752
|
+
return checked ? createVNode(CheckedSur, mergeProps(props, {
|
|
3796
3753
|
"class": "is-checked"
|
|
3797
|
-
}
|
|
3754
|
+
}), null) : createVNode(Check, props, null);
|
|
3798
3755
|
} else {
|
|
3799
|
-
return checked ?
|
|
3756
|
+
return checked ? createVNode(CheckedSur, mergeProps(props, {
|
|
3800
3757
|
"class": "is-checked"
|
|
3801
|
-
}
|
|
3758
|
+
}), null) : halfChecked ? createVNode(HalfCheck, mergeProps(props, {
|
|
3802
3759
|
"class": "is-checked"
|
|
3803
|
-
}
|
|
3760
|
+
}), null) : createVNode(Check, props, null);
|
|
3804
3761
|
}
|
|
3805
3762
|
};
|
|
3806
3763
|
var renderEnumableOptions = function renderEnumableOptions2(_ref73) {
|
|
@@ -3811,60 +3768,52 @@ var renderEnumableOptions = function renderEnumableOptions2(_ref73) {
|
|
|
3811
3768
|
});
|
|
3812
3769
|
if (resultList.length) {
|
|
3813
3770
|
var filterList = resultList.map(function(item, index2) {
|
|
3814
|
-
return
|
|
3771
|
+
return createVNode("li", {
|
|
3815
3772
|
"class": ["tiny-grid__filter-option", {
|
|
3816
3773
|
selected: item.checked
|
|
3817
3774
|
}],
|
|
3818
|
-
"
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
item.checked = !item.checked;
|
|
3827
|
-
}
|
|
3775
|
+
"onClick": function onClick() {
|
|
3776
|
+
if (!filterStore.multi) {
|
|
3777
|
+
filterStore.options.forEach(function(option) {
|
|
3778
|
+
option.checked = option === item;
|
|
3779
|
+
});
|
|
3780
|
+
_vm.filterEnum();
|
|
3781
|
+
} else {
|
|
3782
|
+
item.checked = !item.checked;
|
|
3828
3783
|
}
|
|
3829
3784
|
}
|
|
3830
|
-
}, [filterStore.multi ? iconRender3(item.checked, index2 + 1) : null,
|
|
3831
|
-
"
|
|
3832
|
-
|
|
3833
|
-
}
|
|
3834
|
-
}, [" ", item.label, " "])]);
|
|
3785
|
+
}, [filterStore.multi ? iconRender3(item.checked, index2 + 1) : null, createVNode("a", {
|
|
3786
|
+
"title": item.label
|
|
3787
|
+
}, [createTextVNode(" "), item.label, createTextVNode(" ")])]);
|
|
3835
3788
|
});
|
|
3836
3789
|
var isShowAllSelect = selectAll && (!filterStore.multi || !searchable && filterStore.multi);
|
|
3837
|
-
return isShowAllSelect ? [
|
|
3790
|
+
return isShowAllSelect ? [createVNode("li", {
|
|
3838
3791
|
"class": "tiny-grid__filter-option",
|
|
3839
|
-
"
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
_vm.filterEnum();
|
|
3849
|
-
}
|
|
3792
|
+
"onClick": function onClick() {
|
|
3793
|
+
var isAllSelected = filterStore.options.every(function(item) {
|
|
3794
|
+
return item.checked;
|
|
3795
|
+
});
|
|
3796
|
+
filterStore.options.forEach(function(option) {
|
|
3797
|
+
option.checked = !isAllSelected;
|
|
3798
|
+
});
|
|
3799
|
+
if (!filterStore.multi) {
|
|
3800
|
+
_vm.filterEnum();
|
|
3850
3801
|
}
|
|
3851
3802
|
}
|
|
3852
3803
|
}, [filterStore.multi ? iconRender3(filterStore.options.every(function(item) {
|
|
3853
3804
|
return item.checked;
|
|
3854
3805
|
}), 0, filterStore.options.some(function(item) {
|
|
3855
3806
|
return item.checked;
|
|
3856
|
-
})) : null,
|
|
3857
|
-
"
|
|
3858
|
-
|
|
3859
|
-
}
|
|
3860
|
-
}, [" ", _vm.i18n("ui.grid.filter.allSelect")])])].concat(filterList) : filterList;
|
|
3807
|
+
})) : null, createVNode("a", {
|
|
3808
|
+
"title": _vm.i18n("ui.grid.filter.allSelect")
|
|
3809
|
+
}, [createTextVNode(" "), _vm.i18n("ui.grid.filter.allSelect")])])].concat(filterList) : filterList;
|
|
3861
3810
|
} else {
|
|
3862
|
-
return [
|
|
3811
|
+
return [createVNode("li", {
|
|
3863
3812
|
"class": "tiny-grid__filter-empty"
|
|
3864
3813
|
}, [_vm.i18n("ui.grid.emptyText")])];
|
|
3865
3814
|
}
|
|
3866
3815
|
};
|
|
3867
|
-
var Panel$1 = defineComponent({
|
|
3816
|
+
var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
3868
3817
|
name: $prefix + "GridFilter",
|
|
3869
3818
|
props: {
|
|
3870
3819
|
filterStore: Object,
|
|
@@ -3894,7 +3843,6 @@ var Panel$1 = defineComponent({
|
|
|
3894
3843
|
},
|
|
3895
3844
|
render: function render5() {
|
|
3896
3845
|
var _this3 = this, _ref74;
|
|
3897
|
-
var h2 = arguments[0];
|
|
3898
3846
|
var filterStore = this.filterStore, $grid = this.$grid, $table = this.$parent, optimizeOpts2 = this.optimizeOpts, renderInput2 = this.renderInput, renderEnumable2 = this.renderEnumable, renderDefault2 = this.renderDefault, renderExtends2 = this.renderExtends, renderBase2 = this.renderBase, renderSimple2 = this.renderSimple;
|
|
3899
3847
|
var args = filterStore.args, column = filterStore.column, options = filterStore.options, _filterStore$layout = filterStore.layout, layout = _filterStore$layout === void 0 ? "input,enum,default,extends,base" : _filterStore$layout;
|
|
3900
3848
|
var layoutMap = {
|
|
@@ -3911,12 +3859,12 @@ var Panel$1 = defineComponent({
|
|
|
3911
3859
|
var map = {
|
|
3912
3860
|
filterActive: "filter__active"
|
|
3913
3861
|
};
|
|
3914
|
-
return
|
|
3862
|
+
return createVNode("div", {
|
|
3915
3863
|
"class": ["tiny-grid__wrapper", "tiny-grid__filter-wrapper", "filter__prevent-default", (_ref74 = {
|
|
3916
3864
|
"tiny-grid__animat": optimizeOpts2.animat
|
|
3917
3865
|
}, _ref74[map.filterActive] = filterStore.visible, _ref74["tiny-grid__filter-simple"] = layout.includes("simple"), _ref74["filter-wrapper-saas"] = $table.isThemeSaas, _ref74)],
|
|
3918
3866
|
"style": filterStore.style
|
|
3919
|
-
}, [filterStore.visible ?
|
|
3867
|
+
}, [filterStore.visible ? createVNode("div", {
|
|
3920
3868
|
"class": ["tiny-grid__filter-body", {
|
|
3921
3869
|
"show-addvance": this.showAdvance
|
|
3922
3870
|
}]
|
|
@@ -3974,85 +3922,72 @@ var Panel$1 = defineComponent({
|
|
|
3974
3922
|
}),
|
|
3975
3923
|
// 基础清除选项
|
|
3976
3924
|
renderBase: function renderBase() {
|
|
3977
|
-
|
|
3978
|
-
return h2("ul", {
|
|
3925
|
+
return createVNode("ul", {
|
|
3979
3926
|
"class": "tiny-grid__filter-panel filter-panel__clear"
|
|
3980
|
-
}, [
|
|
3927
|
+
}, [createVNode("li", {
|
|
3981
3928
|
"class": "tiny-grid__filter-option",
|
|
3982
|
-
"
|
|
3983
|
-
|
|
3984
|
-
}
|
|
3985
|
-
}, [h2("a", {
|
|
3929
|
+
"onClick": this.resetFilter
|
|
3930
|
+
}, [createVNode("a", {
|
|
3986
3931
|
"class": "item-content"
|
|
3987
|
-
}, [this.i18n("ui.grid.filter.clear")])]),
|
|
3932
|
+
}, [this.i18n("ui.grid.filter.clear")])]), createVNode("li", {
|
|
3988
3933
|
"class": "tiny-grid__filter-option",
|
|
3989
|
-
"
|
|
3990
|
-
|
|
3991
|
-
}
|
|
3992
|
-
}, [h2("a", {
|
|
3934
|
+
"onClick": this.clearFilter
|
|
3935
|
+
}, [createVNode("a", {
|
|
3993
3936
|
"class": "item-content"
|
|
3994
3937
|
}, [this.i18n("ui.grid.filter.clearAll")])])]);
|
|
3995
3938
|
},
|
|
3996
3939
|
// 设置筛选条件为空和不为空
|
|
3997
3940
|
renderDefault: function renderDefault() {
|
|
3998
3941
|
var _this5 = this;
|
|
3999
|
-
var h2 = this.$createElement;
|
|
4000
3942
|
var condition2 = this.condition, filterStore = this.filterStore;
|
|
4001
3943
|
if (!filterStore.defaultFilter) {
|
|
4002
3944
|
return null;
|
|
4003
3945
|
}
|
|
4004
|
-
return
|
|
3946
|
+
return createVNode("ul", {
|
|
4005
3947
|
"class": "tiny-grid__filter-panel filter-panel__default"
|
|
4006
|
-
}, [
|
|
3948
|
+
}, [createVNode("li", {
|
|
4007
3949
|
"class": ["tiny-grid__filter-option", {
|
|
4008
3950
|
active: condition2.empty === true
|
|
4009
3951
|
}],
|
|
4010
|
-
"
|
|
4011
|
-
|
|
4012
|
-
_this5.filterNull(true);
|
|
4013
|
-
}
|
|
3952
|
+
"onClick": function onClick() {
|
|
3953
|
+
_this5.filterNull(true);
|
|
4014
3954
|
}
|
|
4015
|
-
}, [
|
|
3955
|
+
}, [createVNode("a", {
|
|
4016
3956
|
"class": "item-content"
|
|
4017
|
-
}, [this.i18n("ui.grid.filter.empty")])]),
|
|
3957
|
+
}, [this.i18n("ui.grid.filter.empty")])]), createVNode("li", {
|
|
4018
3958
|
"class": ["tiny-grid__filter-option", {
|
|
4019
3959
|
active: condition2.empty === false
|
|
4020
3960
|
}],
|
|
4021
|
-
"
|
|
4022
|
-
|
|
4023
|
-
_this5.filterNull(false);
|
|
4024
|
-
}
|
|
3961
|
+
"onClick": function onClick() {
|
|
3962
|
+
_this5.filterNull(false);
|
|
4025
3963
|
}
|
|
4026
|
-
}, [
|
|
3964
|
+
}, [createVNode("a", {
|
|
4027
3965
|
"class": "item-content"
|
|
4028
3966
|
}, [this.i18n("ui.grid.filter.unempty")])])]);
|
|
4029
3967
|
},
|
|
4030
3968
|
// 筛选扩展项
|
|
4031
3969
|
renderExtends: function renderExtends() {
|
|
4032
3970
|
var _this6 = this;
|
|
4033
|
-
var h2 = this.$createElement;
|
|
4034
3971
|
var filterStore = this.filterStore;
|
|
4035
3972
|
if (!filterStore.extends) {
|
|
4036
3973
|
return null;
|
|
4037
3974
|
}
|
|
4038
|
-
return
|
|
3975
|
+
return createVNode("ul", {
|
|
4039
3976
|
"class": "tiny-grid__filter-panel filter-panel__clear"
|
|
4040
3977
|
}, [filterStore.extends.map(function(item) {
|
|
4041
|
-
return
|
|
3978
|
+
return createVNode("li", {
|
|
4042
3979
|
"class": "tiny-grid__filter-option",
|
|
4043
|
-
"
|
|
4044
|
-
|
|
4045
|
-
_this6.filterExtends(item);
|
|
4046
|
-
}
|
|
3980
|
+
"onClick": function onClick() {
|
|
3981
|
+
_this6.filterExtends(item);
|
|
4047
3982
|
}
|
|
4048
|
-
}, [
|
|
3983
|
+
}, [createVNode("a", {
|
|
4049
3984
|
"class": "item-content"
|
|
4050
3985
|
}, [item.label])]);
|
|
4051
3986
|
})]);
|
|
4052
3987
|
},
|
|
4053
3988
|
// 输入筛选项
|
|
4054
3989
|
renderInput: function renderInput() {
|
|
4055
|
-
var
|
|
3990
|
+
var _slot, _slot2, _slot3;
|
|
4056
3991
|
this.correctRelations();
|
|
4057
3992
|
var condition2 = this.condition, filterStore = this.filterStore;
|
|
4058
3993
|
var inputFilter = filterStore.inputFilter;
|
|
@@ -4076,81 +4011,85 @@ var Panel$1 = defineComponent({
|
|
|
4076
4011
|
});
|
|
4077
4012
|
var inputProps = ret.inputProps;
|
|
4078
4013
|
InputComponent = ret.InputComponent;
|
|
4079
|
-
return
|
|
4014
|
+
return createVNode("ul", {
|
|
4080
4015
|
"class": "tiny-grid__filter-panel"
|
|
4081
|
-
}, [isAddbyProgram ? null :
|
|
4016
|
+
}, [isAddbyProgram ? null : createVNode("li", {
|
|
4082
4017
|
"class": "tiny-grid__filter-option filter-option__radios"
|
|
4083
4018
|
}, [inputRelations.map(function(_ref75) {
|
|
4084
4019
|
var label = _ref75.label, value = _ref75.value, method = _ref75.method;
|
|
4085
|
-
return
|
|
4086
|
-
"
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4020
|
+
return createVNode(Radio, {
|
|
4021
|
+
"modelValue": condition2.relation,
|
|
4022
|
+
"label": value,
|
|
4023
|
+
"onChange": function onChange(value2) {
|
|
4024
|
+
condition2.relation = value2;
|
|
4025
|
+
condition2.method = method || function() {
|
|
4026
|
+
return true;
|
|
4027
|
+
};
|
|
4028
|
+
}
|
|
4029
|
+
}, _isSlot(label) ? label : {
|
|
4030
|
+
default: function _default25() {
|
|
4031
|
+
return [label];
|
|
4097
4032
|
}
|
|
4098
|
-
}
|
|
4099
|
-
})]),
|
|
4033
|
+
});
|
|
4034
|
+
})]), createVNode("li", {
|
|
4100
4035
|
"class": "filter-option__input"
|
|
4101
|
-
}, [
|
|
4036
|
+
}, [h(InputComponent, inputProps)]), createVNode("li", {
|
|
4102
4037
|
"class": "tiny-grid__filter-option filter-option__btns"
|
|
4103
|
-
}, [
|
|
4104
|
-
"
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4038
|
+
}, [createVNode(Button, {
|
|
4039
|
+
"type": "primary",
|
|
4040
|
+
"onClick": this.filterInput
|
|
4041
|
+
}, _isSlot(_slot = this.i18n("ui.base.confirm")) ? _slot : {
|
|
4042
|
+
default: function _default25() {
|
|
4043
|
+
return [_slot];
|
|
4109
4044
|
}
|
|
4110
|
-
}
|
|
4111
|
-
"
|
|
4112
|
-
|
|
4045
|
+
}), createVNode(Button, {
|
|
4046
|
+
"onClick": this.resetInput
|
|
4047
|
+
}, _isSlot(_slot2 = this.i18n("ui.base.reset")) ? _slot2 : {
|
|
4048
|
+
default: function _default25() {
|
|
4049
|
+
return [_slot2];
|
|
4113
4050
|
}
|
|
4114
|
-
}
|
|
4115
|
-
"
|
|
4116
|
-
|
|
4051
|
+
}), createVNode(Button, {
|
|
4052
|
+
"onClick": this.close
|
|
4053
|
+
}, _isSlot(_slot3 = this.i18n("ui.base.cancel")) ? _slot3 : {
|
|
4054
|
+
default: function _default25() {
|
|
4055
|
+
return [_slot3];
|
|
4117
4056
|
}
|
|
4118
|
-
}
|
|
4057
|
+
})])]);
|
|
4119
4058
|
},
|
|
4120
4059
|
// 选择筛选项
|
|
4121
4060
|
renderEnumable: function renderEnumable() {
|
|
4122
|
-
var
|
|
4061
|
+
var _slot4, _slot5;
|
|
4123
4062
|
var filterStore = this.filterStore;
|
|
4124
4063
|
if (!filterStore.enumable) return null;
|
|
4125
|
-
return
|
|
4064
|
+
return createVNode("div", {
|
|
4126
4065
|
"class": "tiny-grid__filter-panel filter-panel__enum"
|
|
4127
|
-
}, [
|
|
4066
|
+
}, [createVNode("ul", {
|
|
4128
4067
|
"class": "tiny-grid__filter-options"
|
|
4129
4068
|
}, [renderEnumableOptions({
|
|
4130
4069
|
iconRender,
|
|
4131
4070
|
_vm: this,
|
|
4132
4071
|
filterStore
|
|
4133
|
-
})]), filterStore.multi ?
|
|
4072
|
+
})]), filterStore.multi ? createVNode("div", {
|
|
4134
4073
|
"class": "tiny-grid__filter-option filter-option__btns"
|
|
4135
|
-
}, [
|
|
4136
|
-
"
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4074
|
+
}, [createVNode(Button, {
|
|
4075
|
+
"type": "primary",
|
|
4076
|
+
"onClick": this.filterEnum
|
|
4077
|
+
}, _isSlot(_slot4 = this.i18n("ui.base.confirm")) ? _slot4 : {
|
|
4078
|
+
default: function _default25() {
|
|
4079
|
+
return [_slot4];
|
|
4141
4080
|
}
|
|
4142
|
-
}
|
|
4143
|
-
"
|
|
4144
|
-
|
|
4145
|
-
filterStore.visible = false;
|
|
4146
|
-
}
|
|
4081
|
+
}), createVNode(Button, {
|
|
4082
|
+
"onClick": function onClick() {
|
|
4083
|
+
filterStore.visible = false;
|
|
4147
4084
|
}
|
|
4148
|
-
},
|
|
4085
|
+
}, _isSlot(_slot5 = this.i18n("ui.base.cancel")) ? _slot5 : {
|
|
4086
|
+
default: function _default25() {
|
|
4087
|
+
return [_slot5];
|
|
4088
|
+
}
|
|
4089
|
+
})]) : null]);
|
|
4149
4090
|
},
|
|
4150
4091
|
// 简化版筛选按钮对齐,对齐管理侧规范
|
|
4151
4092
|
renderSimple: function renderSimple() {
|
|
4152
|
-
var _this7 = this;
|
|
4153
|
-
var h2 = this.$createElement;
|
|
4154
4093
|
var filterStore = this.filterStore;
|
|
4155
4094
|
var simpleFilter = filterStore.simpleFilter;
|
|
4156
4095
|
if (!simpleFilter) {
|
|
@@ -4158,6 +4097,7 @@ var Panel$1 = defineComponent({
|
|
|
4158
4097
|
}
|
|
4159
4098
|
if (simpleFilter.isDatetime) {
|
|
4160
4099
|
var _simpleFilter$datetim, _simpleFilter$datetim2, _simpleFilter$datetim3, _simpleFilter$datetim4, _simpleFilter$datetim5, _simpleFilter$datetim6;
|
|
4100
|
+
var _slot6, _slot7;
|
|
4161
4101
|
var DatePickComponents = simpleFilter != null && (_simpleFilter$datetim = simpleFilter.datetimeConfig) != null && _simpleFilter$datetim.component ? hooks.toRaw(simpleFilter.datetimeConfig.component) : null;
|
|
4162
4102
|
var _format = simpleFilter == null ? void 0 : (_simpleFilter$datetim2 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim2.format;
|
|
4163
4103
|
var valueFormat = simpleFilter == null ? void 0 : (_simpleFilter$datetim3 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim3.valueFormat;
|
|
@@ -4169,107 +4109,88 @@ var Panel$1 = defineComponent({
|
|
|
4169
4109
|
return time2.getTime() < min || time2.getTime() > max;
|
|
4170
4110
|
}
|
|
4171
4111
|
};
|
|
4172
|
-
return
|
|
4112
|
+
return createVNode("div", {
|
|
4173
4113
|
"class": "tiny-grid__filter-panel filter-panel__enum filter-panel__simple"
|
|
4174
|
-
}, [
|
|
4114
|
+
}, [createVNode("div", {
|
|
4175
4115
|
"class": "tiny-grid__filter-date-title"
|
|
4176
|
-
}, [this.i18n("ui.grid.filter.dateTips")]),
|
|
4116
|
+
}, [this.i18n("ui.grid.filter.dateTips")]), createVNode("ul", {
|
|
4177
4117
|
"class": "tiny-grid__filter-date"
|
|
4178
|
-
}, [
|
|
4118
|
+
}, [createVNode("li", {
|
|
4179
4119
|
"class": "tiny-grid__filter-date-item"
|
|
4180
|
-
}, [
|
|
4181
|
-
"
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
"picker-options": pickerOptions
|
|
4186
|
-
},
|
|
4120
|
+
}, [createVNode("span", null, [this.i18n("ui.grid.filter.startDate")]), createVNode(DatePickComponents, {
|
|
4121
|
+
"format": _format,
|
|
4122
|
+
"type": type,
|
|
4123
|
+
"value-format": valueFormat,
|
|
4124
|
+
"picker-options": pickerOptions,
|
|
4187
4125
|
"class": "tiny-grid__filter-date-pick",
|
|
4188
|
-
"
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
filterStore.datetimeConfig.startDate = value;
|
|
4192
|
-
}
|
|
4126
|
+
"onChange": function onChange(value) {
|
|
4127
|
+
if (filterStore.datetimeConfig) {
|
|
4128
|
+
filterStore.datetimeConfig.startDate = value;
|
|
4193
4129
|
}
|
|
4194
4130
|
},
|
|
4195
|
-
"
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
_this7.$set(filterStore, "startDate", $$v);
|
|
4199
|
-
}
|
|
4131
|
+
"modelValue": filterStore.startDate,
|
|
4132
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
4133
|
+
return filterStore.startDate = $event;
|
|
4200
4134
|
}
|
|
4201
|
-
})]),
|
|
4135
|
+
}, null)]), createVNode("li", {
|
|
4202
4136
|
"class": "tiny-grid__filter-date-item"
|
|
4203
|
-
}, [
|
|
4204
|
-
"
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
"picker-options": pickerOptions
|
|
4209
|
-
},
|
|
4137
|
+
}, [createVNode("span", null, [this.i18n("ui.grid.filter.endDate")]), createVNode(DatePickComponents, {
|
|
4138
|
+
"format": _format,
|
|
4139
|
+
"type": type,
|
|
4140
|
+
"value-format": valueFormat,
|
|
4141
|
+
"picker-options": pickerOptions,
|
|
4210
4142
|
"class": "tiny-grid__filter-date-pick",
|
|
4211
|
-
"
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
filterStore.datetimeConfig.endDate = value;
|
|
4215
|
-
}
|
|
4216
|
-
}
|
|
4143
|
+
"modelValue": filterStore.endDate,
|
|
4144
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
4145
|
+
return filterStore.endDate = $event;
|
|
4217
4146
|
},
|
|
4218
|
-
"
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
_this7.$set(filterStore, "endDate", $$v);
|
|
4147
|
+
"onChange": function onChange(value) {
|
|
4148
|
+
if (filterStore.datetimeConfig) {
|
|
4149
|
+
filterStore.datetimeConfig.endDate = value;
|
|
4222
4150
|
}
|
|
4223
4151
|
}
|
|
4224
|
-
})])]),
|
|
4152
|
+
}, null)])]), createVNode("div", {
|
|
4225
4153
|
"class": "tiny-grid__filter-option filter-option__btns filter-option__date-button"
|
|
4226
|
-
}, [
|
|
4227
|
-
"
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4154
|
+
}, [createVNode(Button, {
|
|
4155
|
+
"type": "primary",
|
|
4156
|
+
"onClick": this.filterDate
|
|
4157
|
+
}, _isSlot(_slot6 = this.i18n("ui.base.confirm")) ? _slot6 : {
|
|
4158
|
+
default: function _default25() {
|
|
4159
|
+
return [_slot6];
|
|
4232
4160
|
}
|
|
4233
|
-
}
|
|
4234
|
-
"
|
|
4235
|
-
|
|
4236
|
-
filterStore.visible = false;
|
|
4237
|
-
}
|
|
4161
|
+
}), createVNode(Button, {
|
|
4162
|
+
"onClick": function onClick() {
|
|
4163
|
+
filterStore.visible = false;
|
|
4238
4164
|
}
|
|
4239
|
-
},
|
|
4165
|
+
}, _isSlot(_slot7 = this.i18n("ui.base.cancel")) ? _slot7 : {
|
|
4166
|
+
default: function _default25() {
|
|
4167
|
+
return [_slot7];
|
|
4168
|
+
}
|
|
4169
|
+
})])]);
|
|
4240
4170
|
} else {
|
|
4241
4171
|
var _simpleFilter$searchC;
|
|
4172
|
+
var _slot8, _slot9;
|
|
4242
4173
|
var IconSearch = iconSearch();
|
|
4243
4174
|
var InputComponents = simpleFilter != null && (_simpleFilter$searchC = simpleFilter.searchConfig) != null && _simpleFilter$searchC.component ? hooks.toRaw(simpleFilter.searchConfig.component) : null;
|
|
4244
|
-
return
|
|
4175
|
+
return createVNode("div", {
|
|
4245
4176
|
"class": "tiny-grid__filter-panel filter-panel__enum filter-panel__simple"
|
|
4246
|
-
}, [InputComponents ?
|
|
4247
|
-
"
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4177
|
+
}, [InputComponents ? createVNode(InputComponents, {
|
|
4178
|
+
"modelValue": filterStore.searchValue,
|
|
4179
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
4180
|
+
return filterStore.searchValue = $event;
|
|
4181
|
+
},
|
|
4182
|
+
"onChange": function onChange(value) {
|
|
4183
|
+
if (filterStore.searchConfig) {
|
|
4184
|
+
filterStore.searchConfig.searchValue = value;
|
|
4252
4185
|
}
|
|
4253
4186
|
},
|
|
4254
4187
|
"class": "tiny-grid__filter-search",
|
|
4255
|
-
"
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
name: "slots",
|
|
4260
|
-
value: {
|
|
4261
|
-
suffix: function suffix() {
|
|
4262
|
-
return h2(IconSearch);
|
|
4263
|
-
}
|
|
4264
|
-
}
|
|
4265
|
-
}],
|
|
4266
|
-
"model": {
|
|
4267
|
-
value: filterStore.searchValue,
|
|
4268
|
-
callback: function callback($$v) {
|
|
4269
|
-
_this7.$set(filterStore, "searchValue", $$v);
|
|
4270
|
-
}
|
|
4188
|
+
"clearable": true
|
|
4189
|
+
}, {
|
|
4190
|
+
suffix: function suffix() {
|
|
4191
|
+
return createVNode(IconSearch, null, null);
|
|
4271
4192
|
}
|
|
4272
|
-
}) : null,
|
|
4193
|
+
}) : null, createVNode("ul", {
|
|
4273
4194
|
"class": "tiny-grid__filter-options"
|
|
4274
4195
|
}, [renderEnumableOptions({
|
|
4275
4196
|
iconRender,
|
|
@@ -4277,22 +4198,24 @@ var Panel$1 = defineComponent({
|
|
|
4277
4198
|
filterStore,
|
|
4278
4199
|
selectAll: simpleFilter.selectAll,
|
|
4279
4200
|
searchable: Boolean(InputComponents)
|
|
4280
|
-
})]), filterStore.multi ?
|
|
4201
|
+
})]), filterStore.multi ? createVNode("div", {
|
|
4281
4202
|
"class": "tiny-grid__filter-option filter-option__btns"
|
|
4282
|
-
}, [
|
|
4283
|
-
"
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4203
|
+
}, [createVNode(Button, {
|
|
4204
|
+
"type": "primary",
|
|
4205
|
+
"onClick": this.filterEnum
|
|
4206
|
+
}, _isSlot(_slot8 = this.i18n("ui.base.confirm")) ? _slot8 : {
|
|
4207
|
+
default: function _default25() {
|
|
4208
|
+
return [_slot8];
|
|
4288
4209
|
}
|
|
4289
|
-
}
|
|
4290
|
-
"
|
|
4291
|
-
|
|
4292
|
-
filterStore.visible = false;
|
|
4293
|
-
}
|
|
4210
|
+
}), createVNode(Button, {
|
|
4211
|
+
"onClick": function onClick() {
|
|
4212
|
+
filterStore.visible = false;
|
|
4294
4213
|
}
|
|
4295
|
-
},
|
|
4214
|
+
}, _isSlot(_slot9 = this.i18n("ui.base.cancel")) ? _slot9 : {
|
|
4215
|
+
default: function _default25() {
|
|
4216
|
+
return [_slot9];
|
|
4217
|
+
}
|
|
4218
|
+
})]) : null]);
|
|
4296
4219
|
}
|
|
4297
4220
|
},
|
|
4298
4221
|
renderSlot: function renderSlot(h2) {
|
|
@@ -4849,7 +4772,7 @@ var Methods$f = {
|
|
|
4849
4772
|
},
|
|
4850
4773
|
// 确认筛选
|
|
4851
4774
|
confirmFilterEvent: function confirmFilterEvent() {
|
|
4852
|
-
var
|
|
4775
|
+
var _this7 = this;
|
|
4853
4776
|
var visibleColumn = this.visibleColumn, filterStore = this.filterStore, scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, remoteFilter = this.remoteFilter, lastScrollLeft = this.lastScrollLeft;
|
|
4854
4777
|
filterStore.visible = false;
|
|
4855
4778
|
if (!remoteFilter) {
|
|
@@ -4867,7 +4790,7 @@ var Methods$f = {
|
|
|
4867
4790
|
}]);
|
|
4868
4791
|
this.updateFooter();
|
|
4869
4792
|
var restoreScrollLeft = function restoreScrollLeft2() {
|
|
4870
|
-
return
|
|
4793
|
+
return _this7.scrollTo(lastScrollLeft);
|
|
4871
4794
|
};
|
|
4872
4795
|
if (scrollXLoad || scrollYLoad) {
|
|
4873
4796
|
scrollXLoad && this.clearScroll();
|
|
@@ -4978,11 +4901,11 @@ var Children = defineComponent({
|
|
|
4978
4901
|
},
|
|
4979
4902
|
watch: {
|
|
4980
4903
|
show: function show(value) {
|
|
4981
|
-
var
|
|
4904
|
+
var _this8 = this;
|
|
4982
4905
|
if (value) {
|
|
4983
4906
|
this.$el.style.top = "0px";
|
|
4984
4907
|
this.$nextTick(function() {
|
|
4985
|
-
var tableInstance =
|
|
4908
|
+
var tableInstance = _this8.tableInstance, $el = _this8.$el;
|
|
4986
4909
|
var _$el$getBoundingClien = $el.getBoundingClientRect(), width = _$el$getBoundingClien.width, height2 = _$el$getBoundingClien.height, bottom = _$el$getBoundingClien.bottom;
|
|
4987
4910
|
var _getDomNode = getDomNode(), visibleHeight = _getDomNode.visibleHeight, visibleWidth = _getDomNode.visibleWidth;
|
|
4988
4911
|
var ctxElem = tableInstance.$refs.ctxWrapper.$el;
|
|
@@ -5129,7 +5052,7 @@ var Methods$e = {
|
|
|
5129
5052
|
},
|
|
5130
5053
|
// 处理菜单的移动
|
|
5131
5054
|
moveCtxMenu: function moveCtxMenu(_ref86) {
|
|
5132
|
-
var
|
|
5055
|
+
var _this9 = this;
|
|
5133
5056
|
var event = _ref86.event, keyCode = _ref86.keyCode, ctxMenuStore = _ref86.ctxMenuStore, property = _ref86.property, operKey = _ref86.operKey, operRest = _ref86.operRest, menuList = _ref86.menuList;
|
|
5134
5057
|
var selectIndex = findIndexOf(menuList, function(item) {
|
|
5135
5058
|
return ctxMenuStore[property] === item;
|
|
@@ -5171,7 +5094,7 @@ var Methods$e = {
|
|
|
5171
5094
|
return ctxMenuStore[property] && (keyCode === 13 || keyCode === 32);
|
|
5172
5095
|
},
|
|
5173
5096
|
action: function action() {
|
|
5174
|
-
|
|
5097
|
+
_this9.ctxMenuLinkEvent(event, ctxMenuStore[property]);
|
|
5175
5098
|
}
|
|
5176
5099
|
}];
|
|
5177
5100
|
for (var i = 0; i < ruleChains.length; i++) {
|
|
@@ -5243,7 +5166,7 @@ var Methods$e = {
|
|
|
5243
5166
|
},
|
|
5244
5167
|
// 显示快捷菜单
|
|
5245
5168
|
openContextMenu: function openContextMenu(event, type, params) {
|
|
5246
|
-
var
|
|
5169
|
+
var _this10 = this;
|
|
5247
5170
|
var ctxMenuOpts2 = this.ctxMenuOpts, ctxMenuStore = this.ctxMenuStore;
|
|
5248
5171
|
var visibleMethod = ctxMenuOpts2.visibleMethod;
|
|
5249
5172
|
var config2 = ctxMenuOpts2[type];
|
|
@@ -5264,7 +5187,7 @@ var Methods$e = {
|
|
|
5264
5187
|
params.options = options;
|
|
5265
5188
|
var end = function end2() {
|
|
5266
5189
|
if (visibleMethod && !visibleMethod(params, event)) {
|
|
5267
|
-
|
|
5190
|
+
_this10.closeMenu();
|
|
5268
5191
|
return;
|
|
5269
5192
|
}
|
|
5270
5193
|
event.preventDefault();
|
|
@@ -5286,14 +5209,14 @@ var Methods$e = {
|
|
|
5286
5209
|
visible: true
|
|
5287
5210
|
});
|
|
5288
5211
|
var next = function next2() {
|
|
5289
|
-
var ctxElem =
|
|
5212
|
+
var ctxElem = _this10.$refs.ctxWrapper.$el;
|
|
5290
5213
|
var clientWidth = ctxElem.clientWidth, clientHeight = ctxElem.clientHeight;
|
|
5291
5214
|
var offsetLeft = clientX + clientWidth - visibleWidth;
|
|
5292
5215
|
var offsetTop = clientY + clientHeight - visibleHeight;
|
|
5293
5216
|
offsetLeft > -10 && (ctxMenuStore.style.left = left - clientWidth + "px");
|
|
5294
5217
|
offsetTop > -10 && (ctxMenuStore.style.top = top - clientHeight + "px");
|
|
5295
5218
|
};
|
|
5296
|
-
|
|
5219
|
+
_this10.$nextTick(next);
|
|
5297
5220
|
};
|
|
5298
5221
|
this.preventEvent(event, "event.show_menu", params, null, end);
|
|
5299
5222
|
this.closeFilter();
|
|
@@ -5579,19 +5502,19 @@ function getColumnRuleTypeOther(_ref100) {
|
|
|
5579
5502
|
var isCheckStrictly = function isCheckStrictly2(selectConfig) {
|
|
5580
5503
|
return selectConfig && selectConfig.checkStrictly && !selectConfig.showHeader || selectConfig && !selectConfig.checkStrictly && selectConfig.showHeader === false;
|
|
5581
5504
|
};
|
|
5582
|
-
var runRender = function runRender2(
|
|
5505
|
+
var runRender = function runRender2(render18) {
|
|
5583
5506
|
var vnode;
|
|
5584
5507
|
try {
|
|
5585
5508
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
5586
5509
|
params[_key - 1] = arguments[_key];
|
|
5587
5510
|
}
|
|
5588
|
-
vnode =
|
|
5511
|
+
vnode = render18.apply(void 0, params);
|
|
5589
5512
|
} catch (e) {
|
|
5590
5513
|
warn("ui.grid.error.renderParamError");
|
|
5591
5514
|
} finally {
|
|
5592
5515
|
if (!vnode || !isVnode(vnode)) {
|
|
5593
5516
|
try {
|
|
5594
|
-
vnode = hooks.h(
|
|
5517
|
+
vnode = hooks.h(render18);
|
|
5595
5518
|
} catch (e) {
|
|
5596
5519
|
vnode = null;
|
|
5597
5520
|
warn("ui.grid.error.classComponentError");
|
|
@@ -6204,10 +6127,10 @@ var Cell = {
|
|
|
6204
6127
|
if (slots && slots.default) {
|
|
6205
6128
|
return slots.default(params, h2);
|
|
6206
6129
|
}
|
|
6207
|
-
var _operationConfig$butt = operationConfig.buttons, buttons = _operationConfig$butt === void 0 ? [] : _operationConfig$butt,
|
|
6130
|
+
var _operationConfig$butt = operationConfig.buttons, buttons = _operationConfig$butt === void 0 ? [] : _operationConfig$butt, render18 = operationConfig.render, _operationConfig$max = operationConfig.max, max = _operationConfig$max === void 0 ? 3 : _operationConfig$max, _operationConfig$disa = operationConfig.disabledClass, disabledClass = _operationConfig$disa === void 0 ? "" : _operationConfig$disa;
|
|
6208
6131
|
var viewClass = $table.viewCls("operButton");
|
|
6209
|
-
if (
|
|
6210
|
-
return
|
|
6132
|
+
if (render18) {
|
|
6133
|
+
return render18({
|
|
6211
6134
|
h: h2,
|
|
6212
6135
|
buttons,
|
|
6213
6136
|
params
|
|
@@ -7372,7 +7295,7 @@ function onGlobalKeydown(event, _vm) {
|
|
|
7372
7295
|
}
|
|
7373
7296
|
}
|
|
7374
7297
|
function handleGlobalMousedownEvent(event) {
|
|
7375
|
-
var
|
|
7298
|
+
var _this11 = this;
|
|
7376
7299
|
var $el = this.$el, ctxMenuStore = this.ctxMenuStore, _this$editConfig = this.editConfig, editConfig = _this$editConfig === void 0 ? {} : _this$editConfig, filterStore = this.filterStore;
|
|
7377
7300
|
var _this$$refs = this.$refs, filterWrapper = _this$$refs.filterWrapper, validTip = _this$$refs.validTip;
|
|
7378
7301
|
var actived = this.editStore.actived;
|
|
@@ -7395,10 +7318,10 @@ function handleGlobalMousedownEvent(event) {
|
|
|
7395
7318
|
else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
|
|
7396
7319
|
this.preventEvent(event, "event.clear_actived", actived.args, function() {
|
|
7397
7320
|
var isClear;
|
|
7398
|
-
var isReadonlyCol = !
|
|
7321
|
+
var isReadonlyCol = !_this11.getEventTargetNode(event, $el, "col__edit").flag;
|
|
7399
7322
|
isClear = handleGlobalIsClear({
|
|
7400
7323
|
$el,
|
|
7401
|
-
_vm:
|
|
7324
|
+
_vm: _this11,
|
|
7402
7325
|
actived,
|
|
7403
7326
|
editConfig,
|
|
7404
7327
|
event,
|
|
@@ -7407,7 +7330,7 @@ function handleGlobalMousedownEvent(event) {
|
|
|
7407
7330
|
});
|
|
7408
7331
|
handleGlobalClearActived({
|
|
7409
7332
|
$el,
|
|
7410
|
-
_vm:
|
|
7333
|
+
_vm: _this11,
|
|
7411
7334
|
event,
|
|
7412
7335
|
isClear
|
|
7413
7336
|
});
|
|
@@ -7433,7 +7356,7 @@ function handleGlobalMousewheelEvent(event) {
|
|
|
7433
7356
|
this.closeMenu();
|
|
7434
7357
|
}
|
|
7435
7358
|
function handleEscKeyDown(_ref163) {
|
|
7436
|
-
var
|
|
7359
|
+
var _this12 = this;
|
|
7437
7360
|
var event = _ref163.event, actived = _ref163.actived, mouseConfig = _ref163.mouseConfig;
|
|
7438
7361
|
this.closeMenu();
|
|
7439
7362
|
this.closeFilter();
|
|
@@ -7441,13 +7364,13 @@ function handleEscKeyDown(_ref163) {
|
|
|
7441
7364
|
this.clearActived(event);
|
|
7442
7365
|
if (mouseConfig.selected) {
|
|
7443
7366
|
this.$nextTick(function() {
|
|
7444
|
-
return
|
|
7367
|
+
return _this12.handleSelected(actived.args, event);
|
|
7445
7368
|
});
|
|
7446
7369
|
}
|
|
7447
7370
|
}
|
|
7448
7371
|
}
|
|
7449
7372
|
function handleEnterKeyDown(_ref164) {
|
|
7450
|
-
var
|
|
7373
|
+
var _this13 = this;
|
|
7451
7374
|
var event = _ref164.event, selected = _ref164.selected, actived = _ref164.actived;
|
|
7452
7375
|
var highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow, treeConfig = this.treeConfig;
|
|
7453
7376
|
var isLeftArrow = event.keyCode === 37;
|
|
@@ -7468,10 +7391,10 @@ function handleEnterKeyDown(_ref164) {
|
|
|
7468
7391
|
event.preventDefault();
|
|
7469
7392
|
var targetRow = children[0];
|
|
7470
7393
|
this.setTreeExpansion(currentRow, true).then(function() {
|
|
7471
|
-
return
|
|
7394
|
+
return _this13.scrollToRow(targetRow);
|
|
7472
7395
|
}).then(function() {
|
|
7473
|
-
return
|
|
7474
|
-
$table:
|
|
7396
|
+
return _this13.triggerCurrentRowEvent(event, {
|
|
7397
|
+
$table: _this13,
|
|
7475
7398
|
row: targetRow
|
|
7476
7399
|
});
|
|
7477
7400
|
});
|
|
@@ -7525,7 +7448,7 @@ function handleArrowKeyDown(_ref166) {
|
|
|
7525
7448
|
}
|
|
7526
7449
|
}
|
|
7527
7450
|
function handleDelKeyDown(_ref167) {
|
|
7528
|
-
var
|
|
7451
|
+
var _this14 = this;
|
|
7529
7452
|
var event = _ref167.event, selected = _ref167.selected;
|
|
7530
7453
|
var _this$keyboardConfig = this.keyboardConfig, keyboardConfig = _this$keyboardConfig === void 0 ? {} : _this$keyboardConfig, treeConfig = this.treeConfig, highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow;
|
|
7531
7454
|
var isBack = event.keyCode === 8;
|
|
@@ -7541,10 +7464,10 @@ function handleDelKeyDown(_ref167) {
|
|
|
7541
7464
|
if (parentRow) {
|
|
7542
7465
|
event.preventDefault();
|
|
7543
7466
|
this.setTreeExpansion(parentRow, false).then(function() {
|
|
7544
|
-
return
|
|
7467
|
+
return _this14.scrollToRow(parentRow);
|
|
7545
7468
|
}).then(function() {
|
|
7546
|
-
return
|
|
7547
|
-
$table:
|
|
7469
|
+
return _this14.triggerCurrentRowEvent(event, {
|
|
7470
|
+
$table: _this14,
|
|
7548
7471
|
row: parentRow
|
|
7549
7472
|
});
|
|
7550
7473
|
});
|
|
@@ -7597,11 +7520,11 @@ function handleOtherKeyDown(_ref172) {
|
|
|
7597
7520
|
}
|
|
7598
7521
|
}
|
|
7599
7522
|
function handleGlobalKeydownEvent(event) {
|
|
7600
|
-
var
|
|
7523
|
+
var _this15 = this;
|
|
7601
7524
|
this.preventEvent(event, "event.keydown", {
|
|
7602
7525
|
$table: this
|
|
7603
7526
|
}, function() {
|
|
7604
|
-
onGlobalKeydown(event,
|
|
7527
|
+
onGlobalKeydown(event, _this15);
|
|
7605
7528
|
});
|
|
7606
7529
|
}
|
|
7607
7530
|
function handleGlobalResizeEvent() {
|
|
@@ -7711,10 +7634,10 @@ var Methods$d = {
|
|
|
7711
7634
|
return this.clearActived();
|
|
7712
7635
|
},
|
|
7713
7636
|
refreshData: function refreshData(data8) {
|
|
7714
|
-
var
|
|
7637
|
+
var _this16 = this;
|
|
7715
7638
|
var next = function next2() {
|
|
7716
|
-
|
|
7717
|
-
return
|
|
7639
|
+
_this16.tableData = [];
|
|
7640
|
+
return _this16.loadTableData(data8 || _this16.tableFullData);
|
|
7718
7641
|
};
|
|
7719
7642
|
return this.$nextTick().then(next);
|
|
7720
7643
|
},
|
|
@@ -7733,11 +7656,11 @@ var Methods$d = {
|
|
|
7733
7656
|
return this.$nextTick();
|
|
7734
7657
|
},
|
|
7735
7658
|
updateData: function updateData() {
|
|
7736
|
-
var
|
|
7659
|
+
var _this17 = this;
|
|
7737
7660
|
return this.handleTableData(true).then(function() {
|
|
7738
|
-
return
|
|
7661
|
+
return _this17.updateFooter();
|
|
7739
7662
|
}).then(function() {
|
|
7740
|
-
return
|
|
7663
|
+
return _this17.recalculate();
|
|
7741
7664
|
});
|
|
7742
7665
|
},
|
|
7743
7666
|
// 处理表格数据(过滤,排序,虚拟滚动需要渲染数据的条数)
|
|
@@ -7749,7 +7672,7 @@ var Methods$d = {
|
|
|
7749
7672
|
},
|
|
7750
7673
|
// 全量加载表格数据
|
|
7751
7674
|
loadTableData: function loadTableData(datas, notRefresh) {
|
|
7752
|
-
var
|
|
7675
|
+
var _this18 = this;
|
|
7753
7676
|
var $grid = this.$grid, $refs = this.$refs, editStore = this.editStore, height2 = this.height, maxHeight = this.maxHeight; this.treeConfig; var lastScrollLeft = this.lastScrollLeft, lastScrollTop = this.lastScrollTop, optimizeOpts2 = this.optimizeOpts;
|
|
7754
7677
|
var _$grid$fetchOption = $grid.fetchOption, fetchOption = _$grid$fetchOption === void 0 ? {} : _$grid$fetchOption;
|
|
7755
7678
|
var _fetchOption$isReload2 = fetchOption.isReloadScroll, isReloadScroll = _fetchOption$isReload2 === void 0 ? false : _fetchOption$isReload2;
|
|
@@ -7778,11 +7701,11 @@ var Methods$d = {
|
|
|
7778
7701
|
this.handleTableData(true);
|
|
7779
7702
|
run(["reserveCheckSelection", "checkSelectionStatus"], this);
|
|
7780
7703
|
var first = function first2() {
|
|
7781
|
-
return !notRefresh &&
|
|
7704
|
+
return !notRefresh && _this18.recalculate();
|
|
7782
7705
|
};
|
|
7783
7706
|
var second = function second2() {
|
|
7784
7707
|
if (lastScrollLeft || lastScrollTop) {
|
|
7785
|
-
return
|
|
7708
|
+
return _this18.attemptRestoreScoll({
|
|
7786
7709
|
lastScrollLeft,
|
|
7787
7710
|
lastScrollTop
|
|
7788
7711
|
});
|
|
@@ -7795,18 +7718,18 @@ var Methods$d = {
|
|
|
7795
7718
|
},
|
|
7796
7719
|
// 重新加载数据
|
|
7797
7720
|
reloadData: function reloadData(datas) {
|
|
7798
|
-
var
|
|
7721
|
+
var _this19 = this;
|
|
7799
7722
|
return this.clearAll().then(function() {
|
|
7800
|
-
return
|
|
7723
|
+
return _this19.loadTableData(datas);
|
|
7801
7724
|
}).then(function() {
|
|
7802
|
-
return
|
|
7725
|
+
return _this19.handleDefault();
|
|
7803
7726
|
});
|
|
7804
7727
|
},
|
|
7805
7728
|
// 加载全量数据
|
|
7806
7729
|
loadData: function loadData(datas) {
|
|
7807
|
-
var
|
|
7730
|
+
var _this20 = this;
|
|
7808
7731
|
return new Promise(function(resolve) {
|
|
7809
|
-
|
|
7732
|
+
_this20.loadTableData(datas);
|
|
7810
7733
|
resolve();
|
|
7811
7734
|
});
|
|
7812
7735
|
},
|
|
@@ -7833,29 +7756,29 @@ var Methods$d = {
|
|
|
7833
7756
|
},
|
|
7834
7757
|
// 从新加载列配置
|
|
7835
7758
|
reloadColumn: function reloadColumn(columns2) {
|
|
7836
|
-
var
|
|
7759
|
+
var _this21 = this;
|
|
7837
7760
|
return this.clearAll().then(function() {
|
|
7838
|
-
return
|
|
7761
|
+
return _this21.loadColumn(columns2);
|
|
7839
7762
|
});
|
|
7840
7763
|
},
|
|
7841
7764
|
loadColumn: function loadColumn(columns2) {
|
|
7842
|
-
var
|
|
7765
|
+
var _this22 = this;
|
|
7843
7766
|
return new Promise(function(resolve) {
|
|
7844
|
-
|
|
7845
|
-
return Cell.createColumn(
|
|
7767
|
+
_this22.collectColumn = mapTree(columns2, function(column) {
|
|
7768
|
+
return Cell.createColumn(_this22, column);
|
|
7846
7769
|
}, headerProps);
|
|
7847
7770
|
resolve();
|
|
7848
7771
|
}).then(function() {
|
|
7849
|
-
return
|
|
7772
|
+
return _this22.$nextTick();
|
|
7850
7773
|
});
|
|
7851
7774
|
},
|
|
7852
7775
|
// 更新数据的 Map
|
|
7853
7776
|
updateCache: function updateCache(source) {
|
|
7854
|
-
var
|
|
7777
|
+
var _this23 = this;
|
|
7855
7778
|
var fullAllDataRowIdData = this.fullAllDataRowIdData, fullAllDataRowMap = this.fullAllDataRowMap, fullDataRowIdData = this.fullDataRowIdData, fullDataRowMap = this.fullDataRowMap, tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
7856
7779
|
var rowKey = getTableRowKey(this);
|
|
7857
7780
|
var buildRowCache = function buildRowCache2(row2, index2) {
|
|
7858
|
-
var rowId = getRowid(
|
|
7781
|
+
var rowId = getRowid(_this23, row2);
|
|
7859
7782
|
if (isNull(rowId) || rowId === "") {
|
|
7860
7783
|
rowId = getRowUniqueId();
|
|
7861
7784
|
set(row2, rowKey, rowId);
|
|
@@ -7874,11 +7797,11 @@ var Methods$d = {
|
|
|
7874
7797
|
};
|
|
7875
7798
|
var clearCache = function clearCache2() {
|
|
7876
7799
|
fullAllDataRowIdData = {};
|
|
7877
|
-
|
|
7800
|
+
_this23.fullAllDataRowIdData = fullAllDataRowIdData;
|
|
7878
7801
|
fullAllDataRowMap.clear();
|
|
7879
7802
|
if (source) {
|
|
7880
7803
|
fullDataRowIdData = {};
|
|
7881
|
-
|
|
7804
|
+
_this23.fullDataRowIdData = fullDataRowIdData;
|
|
7882
7805
|
fullDataRowMap.clear();
|
|
7883
7806
|
}
|
|
7884
7807
|
};
|
|
@@ -7907,7 +7830,7 @@ var Methods$d = {
|
|
|
7907
7830
|
},
|
|
7908
7831
|
// 通过tr的dom元素获取行数据等相关信息
|
|
7909
7832
|
getRowNode: function getRowNode(tr) {
|
|
7910
|
-
var
|
|
7833
|
+
var _this24 = this;
|
|
7911
7834
|
if (!tr) {
|
|
7912
7835
|
return null;
|
|
7913
7836
|
}
|
|
@@ -7915,7 +7838,7 @@ var Methods$d = {
|
|
|
7915
7838
|
var dataRowid = tr.getAttribute("data-rowid");
|
|
7916
7839
|
if (treeConfig) {
|
|
7917
7840
|
var matches = findTree$1(tableFullData, function(row2) {
|
|
7918
|
-
return getRowid(
|
|
7841
|
+
return getRowid(_this24, row2) === dataRowid;
|
|
7919
7842
|
}, treeConfig);
|
|
7920
7843
|
if (matches) {
|
|
7921
7844
|
return matches;
|
|
@@ -7990,20 +7913,20 @@ var Methods$d = {
|
|
|
7990
7913
|
return row2;
|
|
7991
7914
|
},
|
|
7992
7915
|
isTemporaryRow: function isTemporaryRow(row2) {
|
|
7993
|
-
var
|
|
7916
|
+
var _this25 = this;
|
|
7994
7917
|
var rowid2 = getRowid(this, row2);
|
|
7995
7918
|
return find(this.temporaryRows, function(r) {
|
|
7996
|
-
return rowid2 === getRowid(
|
|
7919
|
+
return rowid2 === getRowid(_this25, r);
|
|
7997
7920
|
});
|
|
7998
7921
|
},
|
|
7999
7922
|
createData: function createData(records, copy) {
|
|
8000
|
-
var
|
|
7923
|
+
var _this26 = this;
|
|
8001
7924
|
var isArr = isArray(records);
|
|
8002
7925
|
if (!isArr) {
|
|
8003
7926
|
records = [records];
|
|
8004
7927
|
}
|
|
8005
7928
|
var tmp = records.map(function(record) {
|
|
8006
|
-
return
|
|
7929
|
+
return _this26.defineField(record, copy);
|
|
8007
7930
|
});
|
|
8008
7931
|
return new Promise(function(resolve) {
|
|
8009
7932
|
resolve(isArr ? tmp : tmp[0]);
|
|
@@ -8020,13 +7943,13 @@ var Methods$d = {
|
|
|
8020
7943
|
* 如果还额外传了field,则清空指定单元格内容;
|
|
8021
7944
|
*/
|
|
8022
7945
|
clearData: function clearData(rows, field) {
|
|
8023
|
-
var
|
|
7946
|
+
var _this27 = this;
|
|
8024
7947
|
rows = !arguments.length ? this.tableFullData : rows && !isArray(rows) ? [rows] : rows;
|
|
8025
7948
|
rows.forEach(function(row2) {
|
|
8026
7949
|
if (field) {
|
|
8027
7950
|
set(row2, field, null);
|
|
8028
7951
|
} else {
|
|
8029
|
-
|
|
7952
|
+
_this27.visibleColumn.forEach(function(column) {
|
|
8030
7953
|
column.property && setCellValue(row2, column, null);
|
|
8031
7954
|
});
|
|
8032
7955
|
}
|
|
@@ -8059,7 +7982,7 @@ var Methods$d = {
|
|
|
8059
7982
|
return result;
|
|
8060
7983
|
},
|
|
8061
7984
|
hasRowChange: function hasRowChange(row2, field) {
|
|
8062
|
-
var _editConfig$insertCha,
|
|
7985
|
+
var _editConfig$insertCha, _this28 = this;
|
|
8063
7986
|
var tableSourceData = this.tableSourceData, treeConfig = this.treeConfig, visibleColumn = this.visibleColumn, backupMap = this.backupMap, editConfig = this.editConfig;
|
|
8064
7987
|
var insertChanged = (_editConfig$insertCha = editConfig == null ? void 0 : editConfig.insertChanged) != null ? _editConfig$insertCha : false;
|
|
8065
7988
|
var argsLength = arguments.length;
|
|
@@ -8079,7 +8002,7 @@ var Methods$d = {
|
|
|
8079
8002
|
}
|
|
8080
8003
|
} else {
|
|
8081
8004
|
originRow = find(tableSourceData, function(item) {
|
|
8082
|
-
return rowId === getRowid(
|
|
8005
|
+
return rowId === getRowid(_this28, item);
|
|
8083
8006
|
});
|
|
8084
8007
|
}
|
|
8085
8008
|
if (originRow) {
|
|
@@ -8166,7 +8089,7 @@ var Methods$d = {
|
|
|
8166
8089
|
},
|
|
8167
8090
|
// 对数据进行筛选和排序,获取处理后数据。服务端筛选和排序,在接口调用时已传入参数
|
|
8168
8091
|
updateAfterFullData: function updateAfterFullData() {
|
|
8169
|
-
var
|
|
8092
|
+
var _this29 = this;
|
|
8170
8093
|
var remoteFilter = this.remoteFilter, remoteSort = this.remoteSort, tableFullData = this.tableFullData, visibleColumn = this.visibleColumn, sortOpts2 = this.sortOpts;
|
|
8171
8094
|
var tableData = tableFullData;
|
|
8172
8095
|
var sortColumn = find(visibleColumn, function(column) {
|
|
@@ -8179,13 +8102,13 @@ var Methods$d = {
|
|
|
8179
8102
|
var doTableSort = function doTableSort2() {
|
|
8180
8103
|
var order = sortColumn.order, property = sortColumn.property;
|
|
8181
8104
|
var params = {
|
|
8182
|
-
$table:
|
|
8105
|
+
$table: _this29,
|
|
8183
8106
|
column: sortColumn,
|
|
8184
8107
|
data: tableData,
|
|
8185
8108
|
order,
|
|
8186
8109
|
property
|
|
8187
8110
|
};
|
|
8188
|
-
tableData =
|
|
8111
|
+
tableData = _this29.sortMethod(params) || tableData;
|
|
8189
8112
|
};
|
|
8190
8113
|
var doColumnSort = function doColumnSort2() {
|
|
8191
8114
|
var sortedFlag = false;
|
|
@@ -8195,7 +8118,7 @@ var Methods$d = {
|
|
|
8195
8118
|
return !!order;
|
|
8196
8119
|
});
|
|
8197
8120
|
if (sortColumns.length > 1) {
|
|
8198
|
-
tableData = sortMultiple(tableData, sortColumns,
|
|
8121
|
+
tableData = sortMultiple(tableData, sortColumns, _this29);
|
|
8199
8122
|
sortedFlag = true;
|
|
8200
8123
|
}
|
|
8201
8124
|
}
|
|
@@ -8207,7 +8130,7 @@ var Methods$d = {
|
|
|
8207
8130
|
};
|
|
8208
8131
|
tableData = tableData.filter(function(row2) {
|
|
8209
8132
|
return filterColumn.every(function(column) {
|
|
8210
|
-
return remoteFilter ? true :
|
|
8133
|
+
return remoteFilter ? true : _this29.handleLocalFilter(row2, column);
|
|
8211
8134
|
});
|
|
8212
8135
|
});
|
|
8213
8136
|
if (sortColumn && sortColumn.order) {
|
|
@@ -8236,7 +8159,7 @@ var Methods$d = {
|
|
|
8236
8159
|
};
|
|
8237
8160
|
},
|
|
8238
8161
|
handleDefault: function handleDefault() {
|
|
8239
|
-
var
|
|
8162
|
+
var _this30 = this;
|
|
8240
8163
|
this.handleAsyncColumn(this.tableData);
|
|
8241
8164
|
this.selectConfig && this.handleSelectionDefChecked();
|
|
8242
8165
|
this.radioConfig && this.handleRadioDefChecked();
|
|
@@ -8244,7 +8167,7 @@ var Methods$d = {
|
|
|
8244
8167
|
this.treeConfig && this.handleDefaultTreeExpand();
|
|
8245
8168
|
this.updateFooter();
|
|
8246
8169
|
this.$nextTick(function() {
|
|
8247
|
-
return setTimeout(
|
|
8170
|
+
return setTimeout(_this30.recalculate);
|
|
8248
8171
|
});
|
|
8249
8172
|
},
|
|
8250
8173
|
// 动态列处理
|
|
@@ -8323,16 +8246,16 @@ var Methods$d = {
|
|
|
8323
8246
|
},
|
|
8324
8247
|
// 初始化加载动态列:customColumns 列信息,sort 是否按顺序加载
|
|
8325
8248
|
reloadCustoms: function reloadCustoms(customColumns, sort2, colWidth) {
|
|
8326
|
-
var
|
|
8249
|
+
var _this31 = this;
|
|
8327
8250
|
var first = function first2() {
|
|
8328
|
-
|
|
8251
|
+
_this31.mergeCustomColumn(customColumns, sort2, colWidth);
|
|
8329
8252
|
};
|
|
8330
8253
|
var second = function second2() {
|
|
8331
|
-
|
|
8254
|
+
_this31.handleTableData(true);
|
|
8332
8255
|
};
|
|
8333
8256
|
var third = function third2() {
|
|
8334
|
-
return
|
|
8335
|
-
return
|
|
8257
|
+
return _this31.refreshColumn().then(function() {
|
|
8258
|
+
return _this31.tableFullColumn.slice(0);
|
|
8336
8259
|
});
|
|
8337
8260
|
};
|
|
8338
8261
|
return this.$nextTick().then(first).then(second).then(third);
|
|
@@ -8375,7 +8298,7 @@ var Methods$d = {
|
|
|
8375
8298
|
* 如果使用了分组表头,固定列必须在左侧或者右侧
|
|
8376
8299
|
*/
|
|
8377
8300
|
refreshColumn: function refreshColumn() {
|
|
8378
|
-
var
|
|
8301
|
+
var _this32 = this;
|
|
8379
8302
|
var leftList = [], centerList = [], rightList = [];
|
|
8380
8303
|
var letIndex = 0, leftStartIndex = null, rightEndIndex = null, isColspan = void 0;
|
|
8381
8304
|
var columnStore = this.columnStore, isGroup2 = this.isGroup;
|
|
@@ -8443,12 +8366,12 @@ var Methods$d = {
|
|
|
8443
8366
|
this.visibleColumnChanged = true;
|
|
8444
8367
|
this.columnAnchor && this.$grid.buildColumnAnchorParams();
|
|
8445
8368
|
return this.$nextTick().then(function() {
|
|
8446
|
-
|
|
8447
|
-
|
|
8369
|
+
_this32.updateFooter();
|
|
8370
|
+
_this32.recalculate();
|
|
8448
8371
|
}).then(function() {
|
|
8449
|
-
|
|
8450
|
-
if (
|
|
8451
|
-
|
|
8372
|
+
_this32.$emit("after-refresh-column");
|
|
8373
|
+
if (_this32.isColumnReady) {
|
|
8374
|
+
_this32.attemptRestoreScoll();
|
|
8452
8375
|
}
|
|
8453
8376
|
});
|
|
8454
8377
|
},
|
|
@@ -8527,7 +8450,7 @@ var Methods$d = {
|
|
|
8527
8450
|
* 支持(width=?、width=?px、width=?%、min-width=?、min-width=?px、min-width=?%)
|
|
8528
8451
|
*/
|
|
8529
8452
|
recalculate: function recalculate() {
|
|
8530
|
-
var
|
|
8453
|
+
var _this33 = this;
|
|
8531
8454
|
var mainBody = this.elemStore["main-body-wrapper"];
|
|
8532
8455
|
if (isDisplayNone(mainBody)) {
|
|
8533
8456
|
return;
|
|
@@ -8546,7 +8469,7 @@ var Methods$d = {
|
|
|
8546
8469
|
this.autoCellWidth(headerElem, bodyElem, footerElem);
|
|
8547
8470
|
if (scrollXLoad || scrollYLoad || scrollLoad) {
|
|
8548
8471
|
return this.computeScrollLoad().then(function() {
|
|
8549
|
-
|
|
8472
|
+
_this33.autoCellWidth(headerElem, bodyElem, footerElem);
|
|
8550
8473
|
});
|
|
8551
8474
|
}
|
|
8552
8475
|
return this.computeScrollLoad();
|
|
@@ -8623,7 +8546,7 @@ var Methods$d = {
|
|
|
8623
8546
|
return this.recalculate();
|
|
8624
8547
|
},
|
|
8625
8548
|
updateStyle: function updateStyle() {
|
|
8626
|
-
var
|
|
8549
|
+
var _this34 = this;
|
|
8627
8550
|
var columnStore = this.columnStore, currentRow = this.currentRow, height2 = this.height, maxHeight = this.maxHeight, minHeight = this.minHeight, parentHeight2 = this.parentHeight, tableColumn3 = this.tableColumn, scrollbarWidth = this.scrollbarWidth;
|
|
8628
8551
|
var scrollYLoad = this.scrollYLoad, scrollXLoad = this.scrollXLoad, scrollLoad = this.scrollLoad;
|
|
8629
8552
|
var layoutList = ["header", "body", "footer"];
|
|
@@ -8642,7 +8565,7 @@ var Methods$d = {
|
|
|
8642
8565
|
}
|
|
8643
8566
|
layoutList.forEach(function(layout) {
|
|
8644
8567
|
var args1 = {
|
|
8645
|
-
_vm:
|
|
8568
|
+
_vm: _this34,
|
|
8646
8569
|
columnStore,
|
|
8647
8570
|
customHeight
|
|
8648
8571
|
};
|
|
@@ -8674,10 +8597,10 @@ var Methods$d = {
|
|
|
8674
8597
|
});
|
|
8675
8598
|
},
|
|
8676
8599
|
preventEvent: function preventEvent(event, type, args, next, end) {
|
|
8677
|
-
var
|
|
8600
|
+
var _this35 = this;
|
|
8678
8601
|
var eventList = Interceptor.get(type);
|
|
8679
8602
|
if (!eventList.some(function(listener) {
|
|
8680
|
-
return listener(args, event,
|
|
8603
|
+
return listener(args, event, _this35) === false;
|
|
8681
8604
|
})) {
|
|
8682
8605
|
next && next();
|
|
8683
8606
|
}
|
|
@@ -8842,12 +8765,12 @@ var Methods$d = {
|
|
|
8842
8765
|
},
|
|
8843
8766
|
// 当单元格发生改变时,如果存在规则,则校验
|
|
8844
8767
|
handleChangeCell: function handleChangeCell(event, params) {
|
|
8845
|
-
var
|
|
8768
|
+
var _this36 = this;
|
|
8846
8769
|
this.triggerValidate("blur").catch(function(e) {
|
|
8847
8770
|
return e;
|
|
8848
8771
|
}).then(function() {
|
|
8849
|
-
|
|
8850
|
-
return
|
|
8772
|
+
_this36.handleActived(params, event).then(function() {
|
|
8773
|
+
return _this36.triggerValidate("change");
|
|
8851
8774
|
}).catch(function(e) {
|
|
8852
8775
|
return e;
|
|
8853
8776
|
});
|
|
@@ -8918,7 +8841,7 @@ var Methods$d = {
|
|
|
8918
8841
|
},
|
|
8919
8842
|
// 列双击点击事件:如果是双击模式,则激活为编辑状态
|
|
8920
8843
|
triggerCellDBLClickEvent: function triggerCellDBLClickEvent(event, params) {
|
|
8921
|
-
var
|
|
8844
|
+
var _this37 = this;
|
|
8922
8845
|
var editStore = this.editStore, editConfig = this.editConfig;
|
|
8923
8846
|
var actived = editStore.actived;
|
|
8924
8847
|
var isActiveNewCell = !actived.args || event.currentTarget !== actived.args.cell;
|
|
@@ -8927,8 +8850,8 @@ var Methods$d = {
|
|
|
8927
8850
|
this.triggerValidate("blur").catch(function(e) {
|
|
8928
8851
|
return e;
|
|
8929
8852
|
}).then(function() {
|
|
8930
|
-
|
|
8931
|
-
return
|
|
8853
|
+
_this37.handleActived(params, event).then(function() {
|
|
8854
|
+
return _this37.triggerValidate("change");
|
|
8932
8855
|
}).catch(function(e) {
|
|
8933
8856
|
return e;
|
|
8934
8857
|
});
|
|
@@ -8936,7 +8859,7 @@ var Methods$d = {
|
|
|
8936
8859
|
}
|
|
8937
8860
|
if (isDblclickNewCell && editConfig.mode === "cell") {
|
|
8938
8861
|
this.handleActived(params, event).then(function() {
|
|
8939
|
-
return
|
|
8862
|
+
return _this37.triggerValidate("change");
|
|
8940
8863
|
}).catch(function(e) {
|
|
8941
8864
|
return e;
|
|
8942
8865
|
});
|
|
@@ -9066,11 +8989,11 @@ var Methods$d = {
|
|
|
9066
8989
|
return ~this.expandeds.indexOf(row2);
|
|
9067
8990
|
},
|
|
9068
8991
|
clearRowExpand: function clearRowExpand() {
|
|
9069
|
-
var
|
|
8992
|
+
var _this38 = this;
|
|
9070
8993
|
var hasExpand = this.expandeds.length;
|
|
9071
8994
|
this.expandeds = [];
|
|
9072
8995
|
return this.$nextTick().then(function() {
|
|
9073
|
-
return hasExpand ?
|
|
8996
|
+
return hasExpand ? _this38.recalculate() : 0;
|
|
9074
8997
|
});
|
|
9075
8998
|
},
|
|
9076
8999
|
// 获取虚拟滚动状态
|
|
@@ -9089,13 +9012,13 @@ var Methods$d = {
|
|
|
9089
9012
|
this.loadScrollXData(event);
|
|
9090
9013
|
},
|
|
9091
9014
|
debounceScrollX: function debounceScrollX(event) {
|
|
9092
|
-
var
|
|
9015
|
+
var _this39 = this;
|
|
9093
9016
|
if (!this.tasks.debounceScrollX) {
|
|
9094
9017
|
this.tasks.debounceScrollXHandler = null;
|
|
9095
9018
|
this.tasks.debounceScrollX = function() {
|
|
9096
9019
|
return requestAnimationFrame(function() {
|
|
9097
|
-
|
|
9098
|
-
|
|
9020
|
+
_this39.tasks.debounceScrollXHandler = null;
|
|
9021
|
+
_this39.loadScrollXData(event);
|
|
9099
9022
|
});
|
|
9100
9023
|
};
|
|
9101
9024
|
}
|
|
@@ -9146,21 +9069,21 @@ var Methods$d = {
|
|
|
9146
9069
|
},
|
|
9147
9070
|
// 处理滚动分页相关逻辑
|
|
9148
9071
|
debounceScrollLoad: function debounceScrollLoad(event) {
|
|
9149
|
-
var
|
|
9072
|
+
var _this40 = this;
|
|
9150
9073
|
if (!this.tasks.debounceScrollLoad) {
|
|
9151
9074
|
this.tasks.debounceScrollLoad = debounce(debounceScrollLoadDuration, function() {
|
|
9152
|
-
var
|
|
9153
|
-
var
|
|
9075
|
+
var _this40$scrollLoadSto = _this40.scrollLoadStore, scrollHeight = _this40$scrollLoadSto.scrollHeight, bodyHeight = _this40$scrollLoadSto.bodyHeight;
|
|
9076
|
+
var _this40$$grid$tablePa = _this40.$grid.tablePage, currentPage = _this40$$grid$tablePa.currentPage, pageSize = _this40$$grid$tablePa.pageSize;
|
|
9154
9077
|
var max = scrollHeight - bodyHeight;
|
|
9155
9078
|
var scrollTop = event.target.scrollTop;
|
|
9156
9079
|
if (scrollTop > max) {
|
|
9157
9080
|
scrollTop = max;
|
|
9158
9081
|
}
|
|
9159
|
-
var rowHeight =
|
|
9082
|
+
var rowHeight = _this40.scrollYStore.rowHeight;
|
|
9160
9083
|
var visibleIndex = Math.ceil(scrollTop / rowHeight);
|
|
9161
9084
|
var page = Math.ceil(visibleIndex / pageSize) + 1;
|
|
9162
9085
|
if (currentPage !== page) {
|
|
9163
|
-
|
|
9086
|
+
_this40.$grid.pageCurrentChange(page);
|
|
9164
9087
|
}
|
|
9165
9088
|
});
|
|
9166
9089
|
}
|
|
@@ -9168,7 +9091,7 @@ var Methods$d = {
|
|
|
9168
9091
|
},
|
|
9169
9092
|
// 纵向 Y 可视渲染处理
|
|
9170
9093
|
loadScrollYData: function loadScrollYData(event) {
|
|
9171
|
-
var
|
|
9094
|
+
var _this41 = this;
|
|
9172
9095
|
var scrollYStore = this.scrollYStore;
|
|
9173
9096
|
var startIndex = scrollYStore.startIndex, renderSize = scrollYStore.renderSize, offsetSize = scrollYStore.offsetSize, visibleIndex = scrollYStore.visibleIndex, visibleSize = scrollYStore.visibleSize, rowHeight = scrollYStore.rowHeight;
|
|
9174
9097
|
var scrollTop = event.target.scrollTop;
|
|
@@ -9194,7 +9117,7 @@ var Methods$d = {
|
|
|
9194
9117
|
}
|
|
9195
9118
|
scrollYStore.visibleIndex = toVisibleIndex;
|
|
9196
9119
|
this.$nextTick(function() {
|
|
9197
|
-
|
|
9120
|
+
_this41.updateSelectedCls(true);
|
|
9198
9121
|
});
|
|
9199
9122
|
},
|
|
9200
9123
|
getRowHeight: function getRowHeight() {
|
|
@@ -9218,16 +9141,16 @@ var Methods$d = {
|
|
|
9218
9141
|
},
|
|
9219
9142
|
// 计算可视渲染相关数据
|
|
9220
9143
|
computeScrollLoad: function computeScrollLoad() {
|
|
9221
|
-
var
|
|
9144
|
+
var _this42 = this;
|
|
9222
9145
|
return this.$nextTick().then(function() {
|
|
9223
|
-
var $refs =
|
|
9224
|
-
var scrollLoad =
|
|
9146
|
+
var $refs = _this42.$refs, optimizeOpts2 = _this42.optimizeOpts, visibleColumn = _this42.visibleColumn;
|
|
9147
|
+
var scrollLoad = _this42.scrollLoad, scrollXLoad = _this42.scrollXLoad, scrollXStore = _this42.scrollXStore, scrollYLoad = _this42.scrollYLoad, scrollYStore = _this42.scrollYStore;
|
|
9225
9148
|
var scrollX = optimizeOpts2.scrollX, scrollY = optimizeOpts2.scrollY;
|
|
9226
9149
|
var tableBody = $refs.tableBody;
|
|
9227
9150
|
var bodyElem = tableBody ? tableBody.$el : null;
|
|
9228
9151
|
if (bodyElem) {
|
|
9229
9152
|
computeScrollXLoad({
|
|
9230
|
-
_vm:
|
|
9153
|
+
_vm: _this42,
|
|
9231
9154
|
scrollX,
|
|
9232
9155
|
scrollXLoad,
|
|
9233
9156
|
scrollXStore,
|
|
@@ -9235,7 +9158,7 @@ var Methods$d = {
|
|
|
9235
9158
|
visibleColumn
|
|
9236
9159
|
});
|
|
9237
9160
|
computeScrollYLoad({
|
|
9238
|
-
_vm:
|
|
9161
|
+
_vm: _this42,
|
|
9239
9162
|
scrollLoad,
|
|
9240
9163
|
scrollY,
|
|
9241
9164
|
scrollYLoad,
|
|
@@ -9243,12 +9166,12 @@ var Methods$d = {
|
|
|
9243
9166
|
tableBodyElem: bodyElem
|
|
9244
9167
|
});
|
|
9245
9168
|
}
|
|
9246
|
-
|
|
9169
|
+
_this42.$nextTick(_this42.updateStyle);
|
|
9247
9170
|
});
|
|
9248
9171
|
},
|
|
9249
9172
|
// 处理x轴方向虚拟滚动列数据加载
|
|
9250
9173
|
updateScrollXData: function updateScrollXData() {
|
|
9251
|
-
var
|
|
9174
|
+
var _this43 = this;
|
|
9252
9175
|
var scrollXStore = this.scrollXStore;
|
|
9253
9176
|
var ret = sliceVisibleColumn(this);
|
|
9254
9177
|
if (ret.sliced) {
|
|
@@ -9257,9 +9180,9 @@ var Methods$d = {
|
|
|
9257
9180
|
}
|
|
9258
9181
|
this.debounceRaf("updateScrollXDataHandler", function() {
|
|
9259
9182
|
scrollXStore.lastStartIndex = ret.lastStartIndex;
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9183
|
+
_this43.tableColumn = ret.tableColumn;
|
|
9184
|
+
_this43.visibleColumnChanged = ret.visibleColumnChanged;
|
|
9185
|
+
_this43.$nextTick(_this43.updateStyle);
|
|
9263
9186
|
});
|
|
9264
9187
|
},
|
|
9265
9188
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
@@ -9289,22 +9212,22 @@ var Methods$d = {
|
|
|
9289
9212
|
this.$nextTick(this.updateStyle);
|
|
9290
9213
|
},
|
|
9291
9214
|
debounceRaf: function debounceRaf(handlerKey, callback) {
|
|
9292
|
-
var
|
|
9215
|
+
var _this44 = this;
|
|
9293
9216
|
if (this[handlerKey]) {
|
|
9294
9217
|
cancelAnimationFrame(this[handlerKey]);
|
|
9295
9218
|
}
|
|
9296
9219
|
this[handlerKey] = requestAnimationFrame(function() {
|
|
9297
|
-
|
|
9220
|
+
_this44[handlerKey] = null;
|
|
9298
9221
|
callback();
|
|
9299
9222
|
});
|
|
9300
9223
|
},
|
|
9301
9224
|
// 处理虚拟滚动加载数据,并更新YSpace位置
|
|
9302
9225
|
updateScrollYData: function updateScrollYData() {
|
|
9303
|
-
var
|
|
9226
|
+
var _this45 = this;
|
|
9304
9227
|
this.updateScrollYSpace();
|
|
9305
9228
|
this.debounceRaf("updateScrollYDataHandler", function() {
|
|
9306
|
-
|
|
9307
|
-
return
|
|
9229
|
+
_this45.handleTableData().then(function() {
|
|
9230
|
+
return _this45.$nextTick(_this45.updateStyle);
|
|
9308
9231
|
});
|
|
9309
9232
|
});
|
|
9310
9233
|
},
|
|
@@ -9371,7 +9294,7 @@ var Methods$d = {
|
|
|
9371
9294
|
return this.scrollToColumn(column, isDelayArg, move);
|
|
9372
9295
|
},
|
|
9373
9296
|
scrollToTreeRow: function scrollToTreeRow(row2) {
|
|
9374
|
-
var
|
|
9297
|
+
var _this46 = this;
|
|
9375
9298
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig, treeOpts = this.treeOpts;
|
|
9376
9299
|
if (!treeConfig) {
|
|
9377
9300
|
return this.$nextTick();
|
|
@@ -9384,20 +9307,20 @@ var Methods$d = {
|
|
|
9384
9307
|
}
|
|
9385
9308
|
var nodes = matchObj.nodes;
|
|
9386
9309
|
nodes.forEach(function(row22, index2) {
|
|
9387
|
-
if (index2 === nodes.length - 1 ||
|
|
9310
|
+
if (index2 === nodes.length - 1 || _this46.hasTreeExpand(row22)) {
|
|
9388
9311
|
return;
|
|
9389
9312
|
}
|
|
9390
|
-
|
|
9313
|
+
_this46.setTreeExpansion(row22, true);
|
|
9391
9314
|
});
|
|
9392
9315
|
return this.$nextTick();
|
|
9393
9316
|
},
|
|
9394
9317
|
scrollToColumn: function scrollToColumn(column, isDelay, move) {
|
|
9395
|
-
var
|
|
9318
|
+
var _this47 = this;
|
|
9396
9319
|
var hasColCache = this.fullColumnMap.has(column);
|
|
9397
9320
|
column && hasColCache && colToVisible(this, column, move);
|
|
9398
9321
|
return isDelay && (this.scrollXLoad || this.scrollYLoad) ? new Promise(function(resolve) {
|
|
9399
9322
|
return setTimeout(function() {
|
|
9400
|
-
return resolve(
|
|
9323
|
+
return resolve(_this47.$nextTick());
|
|
9401
9324
|
}, 50);
|
|
9402
9325
|
}) : this.$nextTick();
|
|
9403
9326
|
},
|
|
@@ -9405,7 +9328,7 @@ var Methods$d = {
|
|
|
9405
9328
|
this.lastScrollTop = 0;
|
|
9406
9329
|
},
|
|
9407
9330
|
clearScroll: function clearScroll() {
|
|
9408
|
-
var
|
|
9331
|
+
var _this48 = this;
|
|
9409
9332
|
var scrollXStore = this.scrollXStore, scrollYStore = this.scrollYStore, elemStore = this.elemStore;
|
|
9410
9333
|
Object.assign(this, {
|
|
9411
9334
|
lastScrollLeft: 0,
|
|
@@ -9423,7 +9346,7 @@ var Methods$d = {
|
|
|
9423
9346
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
9424
9347
|
var tableHeaderElem = elemStore["main-header-wrapper"];
|
|
9425
9348
|
var tableFooterElem = elemStore["main-footer-wrapper"];
|
|
9426
|
-
if (
|
|
9349
|
+
if (_this48.afterMounted) {
|
|
9427
9350
|
tableBodyElem && Object.assign(tableBodyElem, {
|
|
9428
9351
|
scrollLeft: 0,
|
|
9429
9352
|
scrollTop: 0
|
|
@@ -9440,7 +9363,7 @@ var Methods$d = {
|
|
|
9440
9363
|
},
|
|
9441
9364
|
// 更新表尾合计
|
|
9442
9365
|
updateFooter: function updateFooter() {
|
|
9443
|
-
var
|
|
9366
|
+
var _this49 = this;
|
|
9444
9367
|
var afterFullData = this.afterFullData, footerMethod = this.footerMethod, showFooter = this.showFooter, summaryConfig = this.summaryConfig, tableColumn3 = this.tableColumn;
|
|
9445
9368
|
if (footerMethod && showFooter) {
|
|
9446
9369
|
var data8 = footerMethod({
|
|
@@ -9461,7 +9384,7 @@ var Methods$d = {
|
|
|
9461
9384
|
return text || "";
|
|
9462
9385
|
}
|
|
9463
9386
|
if (~fields.indexOf(column.property)) {
|
|
9464
|
-
return toDecimal(sum(
|
|
9387
|
+
return toDecimal(sum(_this49.afterFullData, column.property), fraction, _truncate);
|
|
9465
9388
|
}
|
|
9466
9389
|
return null;
|
|
9467
9390
|
});
|
|
@@ -9471,10 +9394,10 @@ var Methods$d = {
|
|
|
9471
9394
|
},
|
|
9472
9395
|
// 更新列状态:如果组件值v-model发生change,调用该函数更新列的编辑状态。如果单元格配置了校验规则,则进行校验
|
|
9473
9396
|
updateStatus: function updateStatus(scope, cellValue, renderOpts) {
|
|
9474
|
-
var
|
|
9397
|
+
var _this50 = this;
|
|
9475
9398
|
var customValue = !isUndefined(cellValue);
|
|
9476
9399
|
return this.$nextTick().then(function() {
|
|
9477
|
-
var $refs =
|
|
9400
|
+
var $refs = _this50.$refs, editRules = _this50.editRules, tableData = _this50.tableData, validStore = _this50.validStore;
|
|
9478
9401
|
var tableBody = $refs.tableBody;
|
|
9479
9402
|
if (!scope || !tableBody || !editRules) {
|
|
9480
9403
|
return;
|
|
@@ -9484,11 +9407,11 @@ var Methods$d = {
|
|
|
9484
9407
|
}
|
|
9485
9408
|
var column = scope.column, row2 = scope.row;
|
|
9486
9409
|
var type = "change";
|
|
9487
|
-
if (!
|
|
9410
|
+
if (!_this50.hasCellRules(type, row2, column)) {
|
|
9488
9411
|
return;
|
|
9489
9412
|
}
|
|
9490
9413
|
var rowIndex = tableData.indexOf(row2);
|
|
9491
|
-
getCell(
|
|
9414
|
+
getCell(_this50, {
|
|
9492
9415
|
row: row2,
|
|
9493
9416
|
rowIndex,
|
|
9494
9417
|
column
|
|
@@ -9496,13 +9419,13 @@ var Methods$d = {
|
|
|
9496
9419
|
if (!cell) {
|
|
9497
9420
|
return;
|
|
9498
9421
|
}
|
|
9499
|
-
return
|
|
9422
|
+
return _this50.validCellRules(type, row2, column, cellValue).then(function() {
|
|
9500
9423
|
customValue && validStore.visible && setCellValue(row2, column, cellValue);
|
|
9501
|
-
|
|
9424
|
+
_this50.clearValidate();
|
|
9502
9425
|
}).catch(function(_ref190) {
|
|
9503
9426
|
var rule = _ref190.rule;
|
|
9504
9427
|
customValue && setCellValue(row2, column, cellValue);
|
|
9505
|
-
|
|
9428
|
+
_this50.showValidTooltip({
|
|
9506
9429
|
rule,
|
|
9507
9430
|
row: row2,
|
|
9508
9431
|
column,
|
|
@@ -9514,15 +9437,15 @@ var Methods$d = {
|
|
|
9514
9437
|
},
|
|
9515
9438
|
/* X/Y 方向滚动 */
|
|
9516
9439
|
updateScrollStatus: function updateScrollStatus() {
|
|
9517
|
-
var
|
|
9440
|
+
var _this51 = this;
|
|
9518
9441
|
if (!this.tasks.updateScrollStatus) {
|
|
9519
9442
|
this.tasks.updateScrollStatus = debounce(AsyncCollectTimeout, function() {
|
|
9520
|
-
var scrollXLoad =
|
|
9443
|
+
var scrollXLoad = _this51.scrollXLoad, scrollYLoad = _this51.scrollYLoad, isAsyncColumn = _this51.isAsyncColumn;
|
|
9521
9444
|
if (isAsyncColumn && (scrollXLoad || scrollYLoad)) {
|
|
9522
|
-
var tableData =
|
|
9445
|
+
var tableData = _this51.tableData, scrollXStore = _this51.scrollXStore, scrollYStore = _this51.scrollYStore, tableFullData = _this51.tableFullData, _this51$scrollDirecti = _this51.scrollDirection, scrollDirection = _this51$scrollDirecti === void 0 ? "N" : _this51$scrollDirecti;
|
|
9523
9446
|
var isInit = scrollXLoad && scrollXStore.visibleIndex === 0 || scrollYLoad && scrollYStore.visibleIndex === 0;
|
|
9524
9447
|
if (isInit || scrollDirection !== "N") {
|
|
9525
|
-
|
|
9448
|
+
_this51.handleResolveColumn(tableFullData, _this51.collectAsyncColumn(tableData));
|
|
9526
9449
|
}
|
|
9527
9450
|
}
|
|
9528
9451
|
});
|
|
@@ -9539,7 +9462,7 @@ var Methods$d = {
|
|
|
9539
9462
|
},
|
|
9540
9463
|
// 收集异步列
|
|
9541
9464
|
collectAsyncColumn: function collectAsyncColumn(tableData) {
|
|
9542
|
-
var
|
|
9465
|
+
var _this52 = this;
|
|
9543
9466
|
var fetchColumns = [];
|
|
9544
9467
|
var rowId = this.rowId, asyncRenderMap = this.asyncRenderMap, tableColumn3 = this.tableColumn;
|
|
9545
9468
|
if (!rowId) {
|
|
@@ -9558,7 +9481,7 @@ var Methods$d = {
|
|
|
9558
9481
|
}
|
|
9559
9482
|
var cellValuesCount = 1;
|
|
9560
9483
|
var cellValues = [cellValue];
|
|
9561
|
-
var uniqueKey =
|
|
9484
|
+
var uniqueKey = _this52.getAsyncColumnUniqueKey(col.property, row2);
|
|
9562
9485
|
if (splitConfig.enabled === true) {
|
|
9563
9486
|
cellValues = cellValue.split(splitConfig.valueSplit || ",");
|
|
9564
9487
|
cellValuesCount = cellValues.length;
|
|
@@ -9629,12 +9552,12 @@ var Methods$d = {
|
|
|
9629
9552
|
},
|
|
9630
9553
|
// 更新表体高度
|
|
9631
9554
|
updateTableBodyHeight: function updateTableBodyHeight() {
|
|
9632
|
-
var
|
|
9555
|
+
var _this53 = this;
|
|
9633
9556
|
if (!this.tasks.updateTableBodyHeight) {
|
|
9634
9557
|
this.tasks.updateTableBodyHeight = function() {
|
|
9635
9558
|
fastdom.measure(function() {
|
|
9636
|
-
var tableBodyElem =
|
|
9637
|
-
|
|
9559
|
+
var tableBodyElem = _this53.elemStore["main-body-wrapper"];
|
|
9560
|
+
_this53.tableBodyHeight = tableBodyElem ? tableBodyElem.clientHeight : 0;
|
|
9638
9561
|
});
|
|
9639
9562
|
};
|
|
9640
9563
|
}
|
|
@@ -9645,17 +9568,17 @@ var Methods$d = {
|
|
|
9645
9568
|
return column.order ? column.order === "asc" ? "desc" : null : "asc";
|
|
9646
9569
|
},
|
|
9647
9570
|
watchDataForVue3: function watchDataForVue3() {
|
|
9648
|
-
var
|
|
9571
|
+
var _this54 = this;
|
|
9649
9572
|
if (isVue2) return;
|
|
9650
9573
|
var stopWatch = hooks.watch([function() {
|
|
9651
|
-
return
|
|
9574
|
+
return _this54.data;
|
|
9652
9575
|
}, function() {
|
|
9653
|
-
return
|
|
9576
|
+
return _this54.data && _this54.data.length;
|
|
9654
9577
|
}], function(_ref194, _ref195) {
|
|
9655
9578
|
var newData = _ref194[0], newLength = _ref194[1];
|
|
9656
9579
|
var oldData = _ref195[0], oldLength = _ref195[1];
|
|
9657
|
-
if (Array.isArray(
|
|
9658
|
-
|
|
9580
|
+
if (Array.isArray(_this54.data) && newData === oldData && newLength !== oldLength) {
|
|
9581
|
+
_this54.handleDataChange();
|
|
9659
9582
|
}
|
|
9660
9583
|
});
|
|
9661
9584
|
hooks.onBeforeUnmount(function() {
|
|
@@ -9691,7 +9614,7 @@ var Methods$d = {
|
|
|
9691
9614
|
},
|
|
9692
9615
|
// 尝试恢复滚动位置,规范了最大滚动位置的取值
|
|
9693
9616
|
attemptRestoreScoll: function attemptRestoreScoll(options) {
|
|
9694
|
-
var
|
|
9617
|
+
var _this55 = this;
|
|
9695
9618
|
var _ref196 = options || this, lastScrollTop = _ref196.lastScrollTop, lastScrollLeft = _ref196.lastScrollLeft;
|
|
9696
9619
|
var scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, elemStore = this.elemStore;
|
|
9697
9620
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
@@ -9702,10 +9625,10 @@ var Methods$d = {
|
|
|
9702
9625
|
lastScrollTop = Math.min(lastScrollTop, maxScrollTop);
|
|
9703
9626
|
lastScrollLeft = Math.min(lastScrollLeft, maxScrollLeft);
|
|
9704
9627
|
fastdom.mutate(function() {
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
scrollXLoad &&
|
|
9708
|
-
scrollYLoad &&
|
|
9628
|
+
_this55.restoreScollFlag = true;
|
|
9629
|
+
_this55.scrollTo(lastScrollLeft, lastScrollTop);
|
|
9630
|
+
scrollXLoad && _this55.triggerScrollXEvent();
|
|
9631
|
+
scrollYLoad && _this55.triggerScrollYEvent({
|
|
9709
9632
|
target: {
|
|
9710
9633
|
scrollTop: lastScrollTop
|
|
9711
9634
|
}
|
|
@@ -9730,7 +9653,7 @@ var fnFields = function fnFields2(fields) {
|
|
|
9730
9653
|
var fnFieldConfig = function fnFieldConfig2(field) {
|
|
9731
9654
|
return Array.isArray(field) && field.length > 1 ? field[1] : {};
|
|
9732
9655
|
};
|
|
9733
|
-
var
|
|
9656
|
+
var _sfc_main$8 = defineComponent({
|
|
9734
9657
|
props: _extends({}, $props, {
|
|
9735
9658
|
datas: Object,
|
|
9736
9659
|
row: Object
|
|
@@ -9752,25 +9675,14 @@ var __vue2_script$8 = defineComponent({
|
|
|
9752
9675
|
}, selectionColumn.renderCell(h, params));
|
|
9753
9676
|
}
|
|
9754
9677
|
});
|
|
9755
|
-
var
|
|
9756
|
-
var __cssModules$8 = {};
|
|
9757
|
-
var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, __vue2_render$5, __vue2_staticRenderFns$5, false, __vue2_injectStyles$8);
|
|
9758
|
-
function __vue2_injectStyles$8(context) {
|
|
9759
|
-
for (var o in __cssModules$8) {
|
|
9760
|
-
this[o] = __cssModules$8[o];
|
|
9761
|
-
}
|
|
9762
|
-
}
|
|
9763
|
-
var ColumnType = /* @__PURE__ */ function() {
|
|
9764
|
-
return __component__$8.exports;
|
|
9765
|
-
}();
|
|
9766
|
-
var __vue2_script$7 = defineComponent({
|
|
9678
|
+
var _sfc_main$7 = defineComponent({
|
|
9767
9679
|
inject: ["$mftable"],
|
|
9768
9680
|
props: _extends({}, $props, {
|
|
9769
9681
|
datas: Object,
|
|
9770
9682
|
row: Object
|
|
9771
9683
|
}),
|
|
9772
9684
|
render: function render10() {
|
|
9773
|
-
var
|
|
9685
|
+
var _this56 = this;
|
|
9774
9686
|
var datas = this.datas, row2 = this.row;
|
|
9775
9687
|
var primaryColumn = datas.primaryColumn, contentColumns = datas.contentColumns, genParams2 = datas.genParams, config2 = datas.config, cardView2 = datas.cardView;
|
|
9776
9688
|
var _config$cardConfig = config2.cardConfig, cardConfig = _config$cardConfig === void 0 ? {} : _config$cardConfig;
|
|
@@ -9782,8 +9694,8 @@ var __vue2_script$7 = defineComponent({
|
|
|
9782
9694
|
};
|
|
9783
9695
|
var ons = function ons2() {
|
|
9784
9696
|
return {
|
|
9785
|
-
mouseenter:
|
|
9786
|
-
mouseleave:
|
|
9697
|
+
mouseenter: _this56.handleMouseenter,
|
|
9698
|
+
mouseleave: _this56.handleMouseleave
|
|
9787
9699
|
};
|
|
9788
9700
|
};
|
|
9789
9701
|
if (!primaryColumn || !primaryColumn.renderCell) {
|
|
@@ -9920,18 +9832,7 @@ var __vue2_script$7 = defineComponent({
|
|
|
9920
9832
|
}
|
|
9921
9833
|
}
|
|
9922
9834
|
});
|
|
9923
|
-
var
|
|
9924
|
-
var __cssModules$7 = {};
|
|
9925
|
-
var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, __vue2_render$4, __vue2_staticRenderFns$4, false, __vue2_injectStyles$7);
|
|
9926
|
-
function __vue2_injectStyles$7(context) {
|
|
9927
|
-
for (var o in __cssModules$7) {
|
|
9928
|
-
this[o] = __cssModules$7[o];
|
|
9929
|
-
}
|
|
9930
|
-
}
|
|
9931
|
-
var ColumnContent = /* @__PURE__ */ function() {
|
|
9932
|
-
return __component__$7.exports;
|
|
9933
|
-
}();
|
|
9934
|
-
var __vue2_script$6 = defineComponent({
|
|
9835
|
+
var _sfc_main$6 = defineComponent({
|
|
9935
9836
|
props: _extends({}, $props, {
|
|
9936
9837
|
datas: Object,
|
|
9937
9838
|
row: Object
|
|
@@ -10032,26 +9933,15 @@ var __vue2_script$6 = defineComponent({
|
|
|
10032
9933
|
}, [vnode]);
|
|
10033
9934
|
}
|
|
10034
9935
|
});
|
|
10035
|
-
var
|
|
10036
|
-
var __cssModules$6 = {};
|
|
10037
|
-
var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, __vue2_render$3, __vue2_staticRenderFns$3, false, __vue2_injectStyles$6);
|
|
10038
|
-
function __vue2_injectStyles$6(context) {
|
|
10039
|
-
for (var o in __cssModules$6) {
|
|
10040
|
-
this[o] = __cssModules$6[o];
|
|
10041
|
-
}
|
|
10042
|
-
}
|
|
10043
|
-
var ColumnLink = /* @__PURE__ */ function() {
|
|
10044
|
-
return __component__$6.exports;
|
|
10045
|
-
}();
|
|
10046
|
-
var __vue2_script$5 = defineComponent({
|
|
9936
|
+
var _sfc_main$5 = defineComponent({
|
|
10047
9937
|
props: _extends({}, $props, {
|
|
10048
9938
|
datas: Object,
|
|
10049
9939
|
row: Object
|
|
10050
9940
|
}),
|
|
10051
9941
|
components: {
|
|
10052
|
-
ColumnType,
|
|
10053
|
-
ColumnContent,
|
|
10054
|
-
ColumnLink
|
|
9942
|
+
ColumnType: _sfc_main$8,
|
|
9943
|
+
ColumnContent: _sfc_main$7,
|
|
9944
|
+
ColumnLink: _sfc_main$6
|
|
10055
9945
|
},
|
|
10056
9946
|
computed: {
|
|
10057
9947
|
showLink: function showLink() {
|
|
@@ -10060,48 +9950,37 @@ var __vue2_script$5 = defineComponent({
|
|
|
10060
9950
|
}
|
|
10061
9951
|
}
|
|
10062
9952
|
});
|
|
10063
|
-
|
|
10064
|
-
var
|
|
10065
|
-
var
|
|
10066
|
-
var
|
|
10067
|
-
return
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
"
|
|
10073
|
-
}
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
}
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
}) : _vm._e()], 1);
|
|
10092
|
-
};
|
|
10093
|
-
var staticRenderFns$2 = [];
|
|
10094
|
-
var __cssModules$5 = {};
|
|
10095
|
-
var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$2, staticRenderFns$2, false, __vue2_injectStyles$5);
|
|
10096
|
-
function __vue2_injectStyles$5(context) {
|
|
10097
|
-
for (var o in __cssModules$5) {
|
|
10098
|
-
this[o] = __cssModules$5[o];
|
|
10099
|
-
}
|
|
9953
|
+
function _sfc_render$2(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
9954
|
+
var _component_column_type = resolveComponent("column-type");
|
|
9955
|
+
var _component_column_content = resolveComponent("column-content");
|
|
9956
|
+
var _component_column_link = resolveComponent("column-link");
|
|
9957
|
+
return openBlock(), createElementBlock(
|
|
9958
|
+
"div",
|
|
9959
|
+
{
|
|
9960
|
+
ref: "layout",
|
|
9961
|
+
"data-tag": "tiny-table-column-layout",
|
|
9962
|
+
class: normalizeClass(["grid", [_ctx.datas.hasType && _ctx.showLink ? "grid-cols-[theme(spacing.7)_auto_theme(spacing.7)]" : "", _ctx.datas.hasType && !_ctx.showLink ? "grid-cols-[theme(spacing.7)_auto]" : "", !_ctx.datas.hasType && _ctx.showLink ? "grid-cols-[auto_theme(spacing.7)]" : "", !_ctx.datas.hasType && !_ctx.showLink ? "grid-cols-[auto]" : ""]])
|
|
9963
|
+
},
|
|
9964
|
+
[_ctx.datas.hasType ? (openBlock(), createBlock(_component_column_type, {
|
|
9965
|
+
key: 0,
|
|
9966
|
+
ref: "type",
|
|
9967
|
+
datas: _ctx.datas,
|
|
9968
|
+
row: _ctx.row
|
|
9969
|
+
}, null, 8, ["datas", "row"])) : createCommentVNode("v-if", true), createVNode(_component_column_content, {
|
|
9970
|
+
datas: _ctx.datas,
|
|
9971
|
+
row: _ctx.row
|
|
9972
|
+
}, null, 8, ["datas", "row"]), _ctx.showLink ? (openBlock(), createBlock(_component_column_link, {
|
|
9973
|
+
key: 1,
|
|
9974
|
+
ref: "link",
|
|
9975
|
+
datas: _ctx.datas,
|
|
9976
|
+
row: _ctx.row
|
|
9977
|
+
}, null, 8, ["datas", "row"])) : createCommentVNode("v-if", true)],
|
|
9978
|
+
2
|
|
9979
|
+
/* CLASS */
|
|
9980
|
+
);
|
|
10100
9981
|
}
|
|
10101
|
-
var ColumnLayout = /* @__PURE__ */
|
|
10102
|
-
|
|
10103
|
-
}();
|
|
10104
|
-
var __vue2_script$4 = defineComponent({
|
|
9982
|
+
var ColumnLayout = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2]]);
|
|
9983
|
+
var _sfc_main$4 = defineComponent({
|
|
10105
9984
|
components: {
|
|
10106
9985
|
ColumnLayout
|
|
10107
9986
|
},
|
|
@@ -10142,38 +10021,23 @@ var __vue2_script$4 = defineComponent({
|
|
|
10142
10021
|
}
|
|
10143
10022
|
}
|
|
10144
10023
|
});
|
|
10145
|
-
var
|
|
10146
|
-
|
|
10147
|
-
var
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
}
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
}, [
|
|
10159
|
-
attrs: {
|
|
10160
|
-
"datas": _vm.datas,
|
|
10161
|
-
"row": _vm.row
|
|
10162
|
-
}
|
|
10163
|
-
})], 1);
|
|
10164
|
-
};
|
|
10165
|
-
var staticRenderFns$1 = [];
|
|
10166
|
-
var __cssModules$4 = {};
|
|
10167
|
-
var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$1, staticRenderFns$1, false, __vue2_injectStyles$4);
|
|
10168
|
-
function __vue2_injectStyles$4(context) {
|
|
10169
|
-
for (var o in __cssModules$4) {
|
|
10170
|
-
this[o] = __cssModules$4[o];
|
|
10171
|
-
}
|
|
10024
|
+
var _hoisted_1 = ["data-rowid"];
|
|
10025
|
+
function _sfc_render$1(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
10026
|
+
var _component_column_layout = resolveComponent("column-layout");
|
|
10027
|
+
return openBlock(), createElementBlock("div", {
|
|
10028
|
+
class: normalizeClass(_ctx.mergeClass(_ctx.datas.rowClass, _ctx.currentRowId === _ctx.rowid && _ctx.isCardType ? "border sm:border-2 sm:border-color-brand" : "")),
|
|
10029
|
+
"data-tag": "tiny-table-row",
|
|
10030
|
+
"data-rowid": _ctx.rowid,
|
|
10031
|
+
onClick: _cache[0] || (_cache[0] = function() {
|
|
10032
|
+
return _ctx.handleClick && _ctx.handleClick.apply(_ctx, arguments);
|
|
10033
|
+
})
|
|
10034
|
+
}, [createVNode(_component_column_layout, {
|
|
10035
|
+
datas: _ctx.datas,
|
|
10036
|
+
row: _ctx.row
|
|
10037
|
+
}, null, 8, ["datas", "row"])], 10, _hoisted_1);
|
|
10172
10038
|
}
|
|
10173
|
-
var TableRow = /* @__PURE__ */
|
|
10174
|
-
|
|
10175
|
-
}();
|
|
10176
|
-
var __vue2_script$3 = defineComponent({
|
|
10039
|
+
var TableRow = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1]]);
|
|
10040
|
+
var _sfc_main$3 = defineComponent({
|
|
10177
10041
|
inject: ["$mftable"],
|
|
10178
10042
|
props: _extends({}, $props),
|
|
10179
10043
|
render: function render12() {
|
|
@@ -10189,18 +10053,7 @@ var __vue2_script$3 = defineComponent({
|
|
|
10189
10053
|
return typeof $mftable.slotList === "function" ? $mftable.slotList(params) : null;
|
|
10190
10054
|
}
|
|
10191
10055
|
});
|
|
10192
|
-
var
|
|
10193
|
-
var __cssModules$3 = {};
|
|
10194
|
-
var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, __vue2_render$2, __vue2_staticRenderFns$2, false, __vue2_injectStyles$3);
|
|
10195
|
-
function __vue2_injectStyles$3(context) {
|
|
10196
|
-
for (var o in __cssModules$3) {
|
|
10197
|
-
this[o] = __cssModules$3[o];
|
|
10198
|
-
}
|
|
10199
|
-
}
|
|
10200
|
-
var ListView = /* @__PURE__ */ function() {
|
|
10201
|
-
return __component__$3.exports;
|
|
10202
|
-
}();
|
|
10203
|
-
var __vue2_script$2 = defineComponent({
|
|
10056
|
+
var _sfc_main$2 = defineComponent({
|
|
10204
10057
|
inject: ["$mftable"],
|
|
10205
10058
|
props: _extends({}, $props),
|
|
10206
10059
|
render: function render13() {
|
|
@@ -10216,18 +10069,7 @@ var __vue2_script$2 = defineComponent({
|
|
|
10216
10069
|
return typeof $mftable.slotGantt === "function" ? $mftable.slotGantt(params) : null;
|
|
10217
10070
|
}
|
|
10218
10071
|
});
|
|
10219
|
-
var
|
|
10220
|
-
var __cssModules$2 = {};
|
|
10221
|
-
var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, __vue2_render$1, __vue2_staticRenderFns$1, false, __vue2_injectStyles$2);
|
|
10222
|
-
function __vue2_injectStyles$2(context) {
|
|
10223
|
-
for (var o in __cssModules$2) {
|
|
10224
|
-
this[o] = __cssModules$2[o];
|
|
10225
|
-
}
|
|
10226
|
-
}
|
|
10227
|
-
var GanttView = /* @__PURE__ */ function() {
|
|
10228
|
-
return __component__$2.exports;
|
|
10229
|
-
}();
|
|
10230
|
-
var __vue2_script$1 = defineComponent({
|
|
10072
|
+
var _sfc_main$1 = defineComponent({
|
|
10231
10073
|
inject: ["$mftable"],
|
|
10232
10074
|
props: _extends({}, $props),
|
|
10233
10075
|
render: function render14() {
|
|
@@ -10243,25 +10085,14 @@ var __vue2_script$1 = defineComponent({
|
|
|
10243
10085
|
return typeof $mftable.slotCustom === "function" ? $mftable.slotCustom(params) : null;
|
|
10244
10086
|
}
|
|
10245
10087
|
});
|
|
10246
|
-
var
|
|
10247
|
-
var __cssModules$1 = {};
|
|
10248
|
-
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles$1);
|
|
10249
|
-
function __vue2_injectStyles$1(context) {
|
|
10250
|
-
for (var o in __cssModules$1) {
|
|
10251
|
-
this[o] = __cssModules$1[o];
|
|
10252
|
-
}
|
|
10253
|
-
}
|
|
10254
|
-
var CustomView = /* @__PURE__ */ function() {
|
|
10255
|
-
return __component__$1.exports;
|
|
10256
|
-
}();
|
|
10257
|
-
var __vue2_script = defineComponent({
|
|
10088
|
+
var _sfc_main = defineComponent({
|
|
10258
10089
|
components: {
|
|
10259
10090
|
TableRow,
|
|
10260
10091
|
Tooltip: Tooltip$1,
|
|
10261
10092
|
Exception,
|
|
10262
|
-
ListView,
|
|
10263
|
-
GanttView,
|
|
10264
|
-
CustomView
|
|
10093
|
+
ListView: _sfc_main$3,
|
|
10094
|
+
GanttView: _sfc_main$2,
|
|
10095
|
+
CustomView: _sfc_main$1
|
|
10265
10096
|
},
|
|
10266
10097
|
provide: function provide() {
|
|
10267
10098
|
return {
|
|
@@ -10421,7 +10252,7 @@ var __vue2_script = defineComponent({
|
|
|
10421
10252
|
var _this$cardConfig = this.cardConfig, cardConfig = _this$cardConfig === void 0 ? {} : _this$cardConfig, _this$listConfig = this.listConfig, listConfig = _this$listConfig === void 0 ? {} : _this$listConfig, _this$ganttConfig = this.ganttConfig, ganttConfig = _this$ganttConfig === void 0 ? {} : _this$ganttConfig, _this$customConfig = this.customConfig, customConfig = _this$customConfig === void 0 ? {} : _this$customConfig;
|
|
10422
10253
|
var tableColumn3 = config2 == null ? void 0 : (_config$tableVm10 = config2.tableVm) == null ? void 0 : _config$tableVm10.tableColumn;
|
|
10423
10254
|
var primaryField = cardConfig.primaryField, contentFields = cardConfig.contentFields, selectable = cardConfig.selectable, renderLink = cardConfig.renderLink, operable = cardConfig.operable, _cardConfig$few = cardConfig.few, few = _cardConfig$few === void 0 ? 4 : _cardConfig$few;
|
|
10424
|
-
var
|
|
10255
|
+
var renderList2 = listConfig.renderList;
|
|
10425
10256
|
var renderGantt = ganttConfig.renderGantt;
|
|
10426
10257
|
var renderCustom = customConfig.renderCustom;
|
|
10427
10258
|
var fieldName = "";
|
|
@@ -10460,7 +10291,7 @@ var __vue2_script = defineComponent({
|
|
|
10460
10291
|
});
|
|
10461
10292
|
}
|
|
10462
10293
|
slotLink = (config2 == null ? void 0 : (_config$tableVm11 = config2.tableVm) == null ? void 0 : (_config$tableVm11$$gr = _config$tableVm11.$grid) == null ? void 0 : (_config$tableVm11$$gr2 = _config$tableVm11$$gr.slots) == null ? void 0 : _config$tableVm11$$gr2.link) || renderLink;
|
|
10463
|
-
slotList = (config2 == null ? void 0 : (_config$tableVm12 = config2.tableVm) == null ? void 0 : (_config$tableVm12$$gr = _config$tableVm12.$grid) == null ? void 0 : (_config$tableVm12$$gr2 = _config$tableVm12$$gr.slots) == null ? void 0 : _config$tableVm12$$gr2.list) ||
|
|
10294
|
+
slotList = (config2 == null ? void 0 : (_config$tableVm12 = config2.tableVm) == null ? void 0 : (_config$tableVm12$$gr = _config$tableVm12.$grid) == null ? void 0 : (_config$tableVm12$$gr2 = _config$tableVm12$$gr.slots) == null ? void 0 : _config$tableVm12$$gr2.list) || renderList2;
|
|
10464
10295
|
slotGantt = (config2 == null ? void 0 : (_config$tableVm13 = config2.tableVm) == null ? void 0 : (_config$tableVm13$$gr = _config$tableVm13.$grid) == null ? void 0 : (_config$tableVm13$$gr2 = _config$tableVm13$$gr.slots) == null ? void 0 : _config$tableVm13$$gr2.gantt) || renderGantt;
|
|
10465
10296
|
slotCustom = (config2 == null ? void 0 : (_config$tableVm14 = config2.tableVm) == null ? void 0 : (_config$tableVm14$$gr = _config$tableVm14.$grid) == null ? void 0 : (_config$tableVm14$$gr2 = _config$tableVm14$$gr.slots) == null ? void 0 : _config$tableVm14$$gr2.custom) || renderCustom;
|
|
10466
10297
|
Object.assign(this, {
|
|
@@ -10612,72 +10443,76 @@ var __vue2_script = defineComponent({
|
|
|
10612
10443
|
}
|
|
10613
10444
|
}
|
|
10614
10445
|
});
|
|
10615
|
-
|
|
10616
|
-
var
|
|
10617
|
-
var
|
|
10618
|
-
var
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10446
|
+
function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
10447
|
+
var _component_exception = resolveComponent("exception");
|
|
10448
|
+
var _component_list_view = resolveComponent("list-view");
|
|
10449
|
+
var _component_gantt_view = resolveComponent("gantt-view");
|
|
10450
|
+
var _component_custom_view = resolveComponent("custom-view");
|
|
10451
|
+
var _component_table_row = resolveComponent("table-row");
|
|
10452
|
+
var _component_tooltip = resolveComponent("tooltip");
|
|
10453
|
+
return openBlock(), createElementBlock(
|
|
10454
|
+
"div",
|
|
10455
|
+
{
|
|
10456
|
+
ref: "warpperElem",
|
|
10457
|
+
"data-tag": "tiny-table-wrapper",
|
|
10458
|
+
class: normalizeClass(["scrollbar-size-0", _ctx.wrapperClass]),
|
|
10459
|
+
style: normalizeStyle(_ctx.wrapperStyle),
|
|
10460
|
+
onScroll: _cache[1] || (_cache[1] = function() {
|
|
10461
|
+
return _ctx.scrollEvent && _ctx.scrollEvent.apply(_ctx, arguments);
|
|
10462
|
+
})
|
|
10626
10463
|
},
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
attrs: {
|
|
10633
|
-
"tiny_mode": "mobile-first",
|
|
10634
|
-
"tiny_mode_root": "",
|
|
10464
|
+
[_ctx.exceptionVisible ? (openBlock(), createBlock(_component_exception, {
|
|
10465
|
+
key: 0,
|
|
10466
|
+
tiny_mode: "mobile-first",
|
|
10467
|
+
tiny_mode_root: "",
|
|
10468
|
+
class: "min-h-[theme(spacing.72)]",
|
|
10635
10469
|
"component-page": "",
|
|
10636
|
-
|
|
10637
|
-
}
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
}
|
|
10644
|
-
}, [_vm.listView ? [_c("list-view")] : _vm.ganttView ? [_c("gantt-view")] : _vm.customView ? [_c("custom-view")] : _vm._l(_vm.tableData, function(row2, i) {
|
|
10645
|
-
return _c("table-row", {
|
|
10646
|
-
key: "" + _vm.rowKey + i,
|
|
10647
|
-
attrs: {
|
|
10648
|
-
"datas": _vm.cfg(row2),
|
|
10649
|
-
"current-row-id": _vm.currentRowId
|
|
10650
|
-
},
|
|
10651
|
-
on: {
|
|
10652
|
-
"card-click": _vm.handleCardClick
|
|
10653
|
-
}
|
|
10654
|
-
});
|
|
10655
|
-
})], 2), _c("tooltip", {
|
|
10656
|
-
ref: "tooltip",
|
|
10657
|
-
attrs: {
|
|
10658
|
-
"content": _vm.tooltipContent,
|
|
10659
|
-
"manual": ""
|
|
10660
|
-
},
|
|
10661
|
-
model: {
|
|
10662
|
-
value: _vm.tooltipVisible,
|
|
10663
|
-
callback: function callback($$v) {
|
|
10664
|
-
_vm.tooltipVisible = $$v;
|
|
10470
|
+
type: "nodata"
|
|
10471
|
+
})) : createCommentVNode("v-if", true), createElementVNode(
|
|
10472
|
+
"div",
|
|
10473
|
+
{
|
|
10474
|
+
"data-tag": "tiny-table",
|
|
10475
|
+
class: normalizeClass([_ctx.tableClass, _ctx.cardClass]),
|
|
10476
|
+
ref: "table"
|
|
10665
10477
|
},
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10478
|
+
[_ctx.listView ? (openBlock(), createBlock(_component_list_view, {
|
|
10479
|
+
key: 0
|
|
10480
|
+
})) : _ctx.ganttView ? (openBlock(), createBlock(_component_gantt_view, {
|
|
10481
|
+
key: 1
|
|
10482
|
+
})) : _ctx.customView ? (openBlock(), createBlock(_component_custom_view, {
|
|
10483
|
+
key: 2
|
|
10484
|
+
})) : (openBlock(true), createElementBlock(
|
|
10485
|
+
Fragment,
|
|
10486
|
+
{
|
|
10487
|
+
key: 3
|
|
10488
|
+
},
|
|
10489
|
+
renderList(_ctx.tableData, function(row2, i) {
|
|
10490
|
+
return openBlock(), createBlock(_component_table_row, {
|
|
10491
|
+
key: "" + _ctx.rowKey + i,
|
|
10492
|
+
datas: _ctx.cfg(row2),
|
|
10493
|
+
"current-row-id": _ctx.currentRowId,
|
|
10494
|
+
onCardClick: _ctx.handleCardClick
|
|
10495
|
+
}, null, 8, ["datas", "current-row-id", "onCardClick"]);
|
|
10496
|
+
}),
|
|
10497
|
+
128
|
|
10498
|
+
/* KEYED_FRAGMENT */
|
|
10499
|
+
))],
|
|
10500
|
+
2
|
|
10501
|
+
/* CLASS */
|
|
10502
|
+
), createVNode(_component_tooltip, {
|
|
10503
|
+
ref: "tooltip",
|
|
10504
|
+
modelValue: _ctx.tooltipVisible,
|
|
10505
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
|
|
10506
|
+
return _ctx.tooltipVisible = $event;
|
|
10507
|
+
}),
|
|
10508
|
+
content: _ctx.tooltipContent,
|
|
10509
|
+
manual: ""
|
|
10510
|
+
}, null, 8, ["modelValue", "content"])],
|
|
10511
|
+
38
|
|
10512
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
10513
|
+
);
|
|
10677
10514
|
}
|
|
10678
|
-
var MfTable = /* @__PURE__ */
|
|
10679
|
-
return __component__.exports;
|
|
10680
|
-
}();
|
|
10515
|
+
var MfTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
10681
10516
|
var initDrag = function initDrag2(dndProxyElement, dndElements, config2) {
|
|
10682
10517
|
if (config2 === void 0) {
|
|
10683
10518
|
config2 = {};
|
|
@@ -12119,20 +11954,20 @@ var Table = defineComponent({
|
|
|
12119
11954
|
});
|
|
12120
11955
|
},
|
|
12121
11956
|
mounted: function mounted5() {
|
|
12122
|
-
var
|
|
11957
|
+
var _this57 = this;
|
|
12123
11958
|
if (this.$refs.tableWrapper) {
|
|
12124
11959
|
document.body.appendChild(this.$refs.tableWrapper);
|
|
12125
11960
|
}
|
|
12126
11961
|
this.$nextTick().then(function() {
|
|
12127
|
-
|
|
12128
|
-
if (
|
|
12129
|
-
|
|
11962
|
+
_this57.afterMounted = true;
|
|
11963
|
+
if (_this57.autoResize && Grid$1._resize) {
|
|
11964
|
+
_this57.bindResize();
|
|
12130
11965
|
}
|
|
12131
11966
|
});
|
|
12132
11967
|
setTimeout(function() {
|
|
12133
|
-
var tableFooter =
|
|
12134
|
-
|
|
12135
|
-
|
|
11968
|
+
var tableFooter = _this57.$refs.tableFooter;
|
|
11969
|
+
_this57.showFooterBorder = !!tableFooter;
|
|
11970
|
+
_this57.footerBorderBottom = tableFooter ? tableFooter.$el.getBoundingClientRect().height : 0;
|
|
12136
11971
|
});
|
|
12137
11972
|
},
|
|
12138
11973
|
activated: function activated() {
|
|
@@ -12219,7 +12054,7 @@ var Table = defineComponent({
|
|
|
12219
12054
|
tableColumn: tableColumn3
|
|
12220
12055
|
};
|
|
12221
12056
|
},
|
|
12222
|
-
render: function
|
|
12057
|
+
render: function render15() {
|
|
12223
12058
|
this.border; var collectColumn2 = this.collectColumn, columnStore = this.columnStore; this.editConfig; this.highlightCell; this.highlightHoverColumn; var instanceSlots = this.instanceSlots;
|
|
12224
12059
|
this.highlightHoverRow; var isGroup2 = this.isGroup, loading = this.loading, loadingComponent = this.loadingComponent; this.mouseConfig; var optimizeOpts2 = this.optimizeOpts;
|
|
12225
12060
|
var overflowX = this.overflowX; this.overflowY; var showFooter = this.showFooter, showHeader = this.showHeader; this.showHeaderOverflow; this.showOverflow; this.dropConfig; this.isThemeSaas;
|
|
@@ -12503,7 +12338,7 @@ var Column = defineComponent({
|
|
|
12503
12338
|
});
|
|
12504
12339
|
return state;
|
|
12505
12340
|
},
|
|
12506
|
-
render: function
|
|
12341
|
+
render: function render16() {
|
|
12507
12342
|
var $table = this.$table, firstRow = this.firstRow, columnConfig = this.columnConfig, instanceSlots = this.instanceSlots;
|
|
12508
12343
|
var slotVnode;
|
|
12509
12344
|
try {
|
|
@@ -12635,10 +12470,10 @@ var Grid = defineComponent({
|
|
|
12635
12470
|
return this.proxyOpts.message !== false;
|
|
12636
12471
|
},
|
|
12637
12472
|
tableProps: function tableProps() {
|
|
12638
|
-
var
|
|
12473
|
+
var _this58 = this;
|
|
12639
12474
|
var rest = {};
|
|
12640
12475
|
propKeys.forEach(function(key) {
|
|
12641
|
-
return rest[key] =
|
|
12476
|
+
return rest[key] = _this58[key];
|
|
12642
12477
|
});
|
|
12643
12478
|
return rest;
|
|
12644
12479
|
},
|
|
@@ -12679,16 +12514,16 @@ var Grid = defineComponent({
|
|
|
12679
12514
|
this.toolbar && this.$refs.toolbar && this.$refs.toolbar.loadStorage();
|
|
12680
12515
|
},
|
|
12681
12516
|
columnAnchorParams: function columnAnchorParams() {
|
|
12682
|
-
var
|
|
12517
|
+
var _this59 = this;
|
|
12683
12518
|
setTimeout(function() {
|
|
12684
|
-
return
|
|
12519
|
+
return _this59.emitter.emit("active-anchor");
|
|
12685
12520
|
}, this.columnAnchorParams.activeAnchor.delay);
|
|
12686
12521
|
},
|
|
12687
12522
|
viewType: function viewType(value) {
|
|
12688
|
-
var
|
|
12523
|
+
var _this60 = this;
|
|
12689
12524
|
if (value === V_MF && this.fullScreenClass) {
|
|
12690
12525
|
this.$nextTick(function() {
|
|
12691
|
-
return
|
|
12526
|
+
return _this60.recalculate(true);
|
|
12692
12527
|
});
|
|
12693
12528
|
}
|
|
12694
12529
|
}
|
|
@@ -12778,8 +12613,8 @@ var Grid = defineComponent({
|
|
|
12778
12613
|
api: ["designConfig", "tableListeners", "tinyTheme", "tinyMode", "currentBreakpoint"]
|
|
12779
12614
|
});
|
|
12780
12615
|
},
|
|
12781
|
-
render: function
|
|
12782
|
-
var
|
|
12616
|
+
render: function render17() {
|
|
12617
|
+
var _this61 = this;
|
|
12783
12618
|
var editConfig = this.editConfig, fetchOption = this.fetchOption, listeners = this.listeners, loading = this.loading, optimization = this.optimization, pager = this.pager, pagerConfig = this.pagerConfig, remoteFilter = this.remoteFilter, remoteSort = this.remoteSort, selectToolbar = this.selectToolbar;
|
|
12784
12619
|
var seqIndex2 = this.seqIndex, $slots = this.slots, tableCustoms2 = this.tableCustoms, tableData = this.tableData, tableListeners = this.tableListeners, tableLoading = this.tableLoading, tableProps2 = this.tableProps, toolbar = this.toolbar, vSize4 = this.vSize, designConfig = this.designConfig, viewType2 = this.viewType;
|
|
12785
12620
|
var columnAnchor = this.columnAnchor, columnAnchorParams2 = this.columnAnchorParams, fullScreenClass = this.fullScreenClass;
|
|
@@ -12807,7 +12642,7 @@ var Grid = defineComponent({
|
|
|
12807
12642
|
}
|
|
12808
12643
|
toolbar && !(toolbar.setting && toolbar.setting.storage) && (props.customs = tableCustoms2);
|
|
12809
12644
|
toolbar && (tableOns["update:customs"] = function(value) {
|
|
12810
|
-
return
|
|
12645
|
+
return _this61.tableCustoms = value;
|
|
12811
12646
|
});
|
|
12812
12647
|
tableOns["column-init-ready"] = this.handleColumnInitReady;
|
|
12813
12648
|
if (editConfig) {
|
|
@@ -12849,12 +12684,12 @@ var Grid = defineComponent({
|
|
|
12849
12684
|
methods: {
|
|
12850
12685
|
// 配置高度减去(表格锚点+工具栏+分页)计算得出表格高度
|
|
12851
12686
|
updateParentHeight: function updateParentHeight2() {
|
|
12852
|
-
var
|
|
12687
|
+
var _this62 = this;
|
|
12853
12688
|
if (!this.tasks.updateParentHeight) {
|
|
12854
12689
|
this.tasks.updateParentHeight = debounce(10, function() {
|
|
12855
|
-
var $el =
|
|
12690
|
+
var $el = _this62.$el, $refs = _this62.$refs;
|
|
12856
12691
|
var tinyTable = $refs.tinyTable, tinyGridColumnAnchor = $refs.tinyGridColumnAnchor;
|
|
12857
|
-
var toolbarVm =
|
|
12692
|
+
var toolbarVm = _this62.getVm("toolbar");
|
|
12858
12693
|
if (tinyTable) {
|
|
12859
12694
|
var columnAnchorHeight = 0;
|
|
12860
12695
|
if (tinyGridColumnAnchor) {
|
|
@@ -12927,7 +12762,7 @@ var Grid = defineComponent({
|
|
|
12927
12762
|
},
|
|
12928
12763
|
// 监听某个元素是否出现在视口中
|
|
12929
12764
|
addIntersectionObserver: function addIntersectionObserver() {
|
|
12930
|
-
var
|
|
12765
|
+
var _this63 = this;
|
|
12931
12766
|
if (this.intersectionOption && this.intersectionOption.disabled || typeof IntersectionObserver === "undefined") return;
|
|
12932
12767
|
this.intersectionObserver = new IntersectionObserver(function(entries) {
|
|
12933
12768
|
var entry = entries[0];
|
|
@@ -12939,7 +12774,7 @@ var Grid = defineComponent({
|
|
|
12939
12774
|
entry = intersectingEntry;
|
|
12940
12775
|
}
|
|
12941
12776
|
}
|
|
12942
|
-
|
|
12777
|
+
_this63.handleVisibilityChange(entry.isIntersecting, entry);
|
|
12943
12778
|
}, this.intersectionOption);
|
|
12944
12779
|
this.intersectionObserver.observe(this.$el);
|
|
12945
12780
|
},
|
|
@@ -12992,38 +12827,38 @@ function operArrs(_ref207) {
|
|
|
12992
12827
|
Array.prototype.push.apply(_vm.temporaryRows, newRecordsCopy);
|
|
12993
12828
|
}
|
|
12994
12829
|
var _setActiveCell = function _setActiveCell2(row2, field) {
|
|
12995
|
-
var
|
|
12830
|
+
var _this64 = this;
|
|
12996
12831
|
var next1 = function next12() {
|
|
12997
12832
|
if (!row2 || !field) {
|
|
12998
|
-
return
|
|
12833
|
+
return _this64.$nextTick();
|
|
12999
12834
|
}
|
|
13000
|
-
var column = find(
|
|
12835
|
+
var column = find(_this64.visibleColumn, function(column2) {
|
|
13001
12836
|
return column2.property === field;
|
|
13002
12837
|
});
|
|
13003
12838
|
if (!column || !column.editor) {
|
|
13004
|
-
return
|
|
12839
|
+
return _this64.$nextTick();
|
|
13005
12840
|
}
|
|
13006
12841
|
var next2 = function next22(cell) {
|
|
13007
12842
|
if (!cell) {
|
|
13008
12843
|
return;
|
|
13009
12844
|
}
|
|
13010
|
-
var rowIndex =
|
|
13011
|
-
var columnIndex =
|
|
13012
|
-
|
|
12845
|
+
var rowIndex = _this64.getRowIndex(row2);
|
|
12846
|
+
var columnIndex = _this64.getColumnIndex(column);
|
|
12847
|
+
_this64.handleActived({
|
|
13013
12848
|
row: row2,
|
|
13014
12849
|
rowIndex,
|
|
13015
12850
|
column,
|
|
13016
12851
|
columnIndex,
|
|
13017
12852
|
cell,
|
|
13018
|
-
$table:
|
|
12853
|
+
$table: _this64
|
|
13019
12854
|
});
|
|
13020
|
-
|
|
12855
|
+
_this64.lastCallTime = Date.now();
|
|
13021
12856
|
};
|
|
13022
|
-
getCell(
|
|
12857
|
+
getCell(_this64, {
|
|
13023
12858
|
row: row2,
|
|
13024
12859
|
column
|
|
13025
12860
|
}).then(next2);
|
|
13026
|
-
return
|
|
12861
|
+
return _this64.$nextTick();
|
|
13027
12862
|
};
|
|
13028
12863
|
return this.scrollToRow(row2, true).then(next1);
|
|
13029
12864
|
};
|
|
@@ -13033,7 +12868,7 @@ var Methods$c = {
|
|
|
13033
12868
|
},
|
|
13034
12869
|
// 根据位置从指定行添加数据
|
|
13035
12870
|
_insertAt: function _insertAt(records, row2) {
|
|
13036
|
-
var
|
|
12871
|
+
var _this65 = this;
|
|
13037
12872
|
var afterFullData = this.afterFullData, editStore = this.editStore, isAsyncColumn = this.isAsyncColumn, scrollYLoad = this.scrollYLoad, tableFullData = this.tableFullData, _this$tableSourceData = this.tableSourceData, tableSourceData = _this$tableSourceData === void 0 ? [] : _this$tableSourceData, treeConfig = this.treeConfig;
|
|
13038
12873
|
if (treeConfig) {
|
|
13039
12874
|
throw new Error(error("ui.grid.error.treeInsert"));
|
|
@@ -13051,7 +12886,7 @@ var Methods$c = {
|
|
|
13051
12886
|
}
|
|
13052
12887
|
var nowData = afterFullData;
|
|
13053
12888
|
var newRecords = records.map(function(record) {
|
|
13054
|
-
return hooks.reactive(
|
|
12889
|
+
return hooks.reactive(_this65.defineField(_extends({}, record)));
|
|
13055
12890
|
});
|
|
13056
12891
|
var newRecordsCopy = clone(newRecords, true);
|
|
13057
12892
|
operArrs({
|
|
@@ -13076,7 +12911,7 @@ var Methods$c = {
|
|
|
13076
12911
|
rows: newRecords
|
|
13077
12912
|
};
|
|
13078
12913
|
return this.$nextTick().then(function() {
|
|
13079
|
-
|
|
12914
|
+
_this65.recalculate();
|
|
13080
12915
|
return res;
|
|
13081
12916
|
});
|
|
13082
12917
|
},
|
|
@@ -13086,7 +12921,7 @@ var Methods$c = {
|
|
|
13086
12921
|
* 如果传 rows 则删除多行
|
|
13087
12922
|
*/
|
|
13088
12923
|
_remove: function _remove(rows) {
|
|
13089
|
-
var
|
|
12924
|
+
var _this66 = this;
|
|
13090
12925
|
var afterFullData = this.afterFullData, scrollYLoad = this.scrollYLoad, _this$selectConfig3 = this.selectConfig, selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3;
|
|
13091
12926
|
var selection = this.selection, tableFullData = this.tableFullData, treeConfig = this.treeConfig, _this$tableSourceData2 = this.tableSourceData, tableSourceData = _this$tableSourceData2 === void 0 ? [] : _this$tableSourceData2;
|
|
13092
12927
|
var _this$editStore = this.editStore, insertList = _this$editStore.insertList, removeList = _this$editStore.removeList;
|
|
@@ -13130,9 +12965,9 @@ var Methods$c = {
|
|
|
13130
12965
|
}
|
|
13131
12966
|
remove(tableSourceData, function(row3) {
|
|
13132
12967
|
return find(insertList, function(r) {
|
|
13133
|
-
return getRowid(
|
|
12968
|
+
return getRowid(_this66, r) === getRowid(_this66, row3);
|
|
13134
12969
|
}) && find(rows, function(r) {
|
|
13135
|
-
return getRowid(
|
|
12970
|
+
return getRowid(_this66, r) === getRowid(_this66, row3);
|
|
13136
12971
|
});
|
|
13137
12972
|
});
|
|
13138
12973
|
remove(insertList, function(row3) {
|
|
@@ -13150,7 +12985,7 @@ var Methods$c = {
|
|
|
13150
12985
|
rows: rest
|
|
13151
12986
|
};
|
|
13152
12987
|
return this.$nextTick().then(function() {
|
|
13153
|
-
|
|
12988
|
+
_this66.recalculate();
|
|
13154
12989
|
return res;
|
|
13155
12990
|
});
|
|
13156
12991
|
},
|
|
@@ -13158,10 +12993,10 @@ var Methods$c = {
|
|
|
13158
12993
|
* 删除选中数据
|
|
13159
12994
|
*/
|
|
13160
12995
|
_removeSelecteds: function _removeSelecteds() {
|
|
13161
|
-
var
|
|
12996
|
+
var _this67 = this;
|
|
13162
12997
|
var selectRecords = this.getSelectRecords(true);
|
|
13163
12998
|
var callback = function callback2(params) {
|
|
13164
|
-
|
|
12999
|
+
_this67.clearSelection();
|
|
13165
13000
|
return params;
|
|
13166
13001
|
};
|
|
13167
13002
|
return this.remove(selectRecords).then(callback);
|
|
@@ -13178,7 +13013,7 @@ var Methods$c = {
|
|
|
13178
13013
|
* 如果还额外传了field则还原指定单元格。
|
|
13179
13014
|
*/
|
|
13180
13015
|
_revertData: function _revertData(rows, field) {
|
|
13181
|
-
var
|
|
13016
|
+
var _this68 = this;
|
|
13182
13017
|
var tableSourceData = this.tableSourceData, tableSynchData = this.tableSynchData;
|
|
13183
13018
|
if (arguments.length && rows && !isArray(rows)) {
|
|
13184
13019
|
rows = [rows];
|
|
@@ -13189,7 +13024,7 @@ var Methods$c = {
|
|
|
13189
13024
|
var _loop2 = function _loop22() {
|
|
13190
13025
|
var row2 = rows[i];
|
|
13191
13026
|
var oRow = find(tableSourceData, function(item) {
|
|
13192
|
-
return getRowid(
|
|
13027
|
+
return getRowid(_this68, row2) === getRowid(_this68, item);
|
|
13193
13028
|
});
|
|
13194
13029
|
if (oRow && row2) {
|
|
13195
13030
|
if (field) {
|
|
@@ -13234,10 +13069,10 @@ var Methods$c = {
|
|
|
13234
13069
|
* 只精准匹配row的更改。如果是树表格,子节点更改状态不会影响父节点的更新状态
|
|
13235
13070
|
*/
|
|
13236
13071
|
_getUpdateRecords: function _getUpdateRecords() {
|
|
13237
|
-
var
|
|
13072
|
+
var _this69 = this;
|
|
13238
13073
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
13239
13074
|
var handler6 = function handler7(row2) {
|
|
13240
|
-
return !
|
|
13075
|
+
return !_this69.isTemporaryRow(row2) && _this69.hasRowChange(row2);
|
|
13241
13076
|
};
|
|
13242
13077
|
var updateRecords = treeConfig ? filterTree(tableFullData, handler6, treeConfig) : tableFullData.filter(handler6);
|
|
13243
13078
|
return updateRecords;
|
|
@@ -13246,13 +13081,13 @@ var Methods$c = {
|
|
|
13246
13081
|
* 处理激活编辑
|
|
13247
13082
|
*/
|
|
13248
13083
|
handleActived: function handleActived(params, event) {
|
|
13249
|
-
var
|
|
13084
|
+
var _this70 = this;
|
|
13250
13085
|
return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
|
|
13251
13086
|
var editConfig, editStore, tableColumn3, cell, column, row2, editor, actived, isActiveCell, type, canActive, args;
|
|
13252
13087
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13253
13088
|
while (1) switch (_context.prev = _context.next) {
|
|
13254
13089
|
case 0:
|
|
13255
|
-
editConfig =
|
|
13090
|
+
editConfig = _this70.editConfig, editStore = _this70.editStore, tableColumn3 = _this70.tableColumn;
|
|
13256
13091
|
cell = params.cell, column = params.column, row2 = params.row;
|
|
13257
13092
|
editor = column.editor;
|
|
13258
13093
|
actived = editStore.actived;
|
|
@@ -13275,7 +13110,7 @@ var Methods$c = {
|
|
|
13275
13110
|
case 9:
|
|
13276
13111
|
canActive = _context.sent;
|
|
13277
13112
|
args = {
|
|
13278
|
-
_vm:
|
|
13113
|
+
_vm: _this70,
|
|
13279
13114
|
actived,
|
|
13280
13115
|
canActive,
|
|
13281
13116
|
cell,
|
|
@@ -13291,14 +13126,14 @@ var Methods$c = {
|
|
|
13291
13126
|
});
|
|
13292
13127
|
type = handleActivedDoActive(args);
|
|
13293
13128
|
handleActivedClearActive({
|
|
13294
|
-
_vm:
|
|
13129
|
+
_vm: _this70,
|
|
13295
13130
|
canActive,
|
|
13296
13131
|
event
|
|
13297
13132
|
});
|
|
13298
|
-
emitEvent(
|
|
13133
|
+
emitEvent(_this70, type, [params, event]);
|
|
13299
13134
|
case 15:
|
|
13300
13135
|
handleActivedTryActive({
|
|
13301
|
-
_vm:
|
|
13136
|
+
_vm: _this70,
|
|
13302
13137
|
actived,
|
|
13303
13138
|
cell,
|
|
13304
13139
|
column,
|
|
@@ -13308,7 +13143,7 @@ var Methods$c = {
|
|
|
13308
13143
|
params,
|
|
13309
13144
|
row: row2
|
|
13310
13145
|
});
|
|
13311
|
-
return _context.abrupt("return",
|
|
13146
|
+
return _context.abrupt("return", _this70.$nextTick());
|
|
13312
13147
|
case 17:
|
|
13313
13148
|
case "end":
|
|
13314
13149
|
return _context.stop();
|
|
@@ -13342,14 +13177,14 @@ var Methods$c = {
|
|
|
13342
13177
|
* 清除已激活的编辑
|
|
13343
13178
|
*/
|
|
13344
13179
|
_clearActived: function _clearActived(event) {
|
|
13345
|
-
var
|
|
13180
|
+
var _this71 = this;
|
|
13346
13181
|
var _this$editConfig2 = this.editConfig, editConfig = _this$editConfig2 === void 0 ? {} : _this$editConfig2, editStore = this.editStore, tableColumn3 = this.tableColumn;
|
|
13347
13182
|
var actived = editStore.actived;
|
|
13348
13183
|
var args = actived.args, column = actived.column, row2 = actived.row;
|
|
13349
13184
|
var isActived = row2 || column;
|
|
13350
13185
|
if (isActived && editConfig.mode === "row") {
|
|
13351
13186
|
tableColumn3.forEach(function(column22) {
|
|
13352
|
-
return
|
|
13187
|
+
return _this71._setColumnModel(row2, column22);
|
|
13353
13188
|
});
|
|
13354
13189
|
}
|
|
13355
13190
|
if (isActived && editConfig.mode !== "row") {
|
|
@@ -13428,7 +13263,7 @@ var Methods$c = {
|
|
|
13428
13263
|
* 只对trigger为dblclick有效,选中单元格
|
|
13429
13264
|
*/
|
|
13430
13265
|
_setSelectCell: function _setSelectCell(row2, field) {
|
|
13431
|
-
var
|
|
13266
|
+
var _this72 = this;
|
|
13432
13267
|
var editConfig = this.editConfig, tableData = this.tableData, visibleColumn = this.visibleColumn;
|
|
13433
13268
|
if (!row2 || !field || editConfig.trigger === "manual") {
|
|
13434
13269
|
return this.$nextTick();
|
|
@@ -13449,7 +13284,7 @@ var Methods$c = {
|
|
|
13449
13284
|
columnIndex,
|
|
13450
13285
|
cell
|
|
13451
13286
|
};
|
|
13452
|
-
|
|
13287
|
+
_this72.handleSelected(params, {});
|
|
13453
13288
|
};
|
|
13454
13289
|
getCell(this, {
|
|
13455
13290
|
row: row2,
|
|
@@ -13477,36 +13312,36 @@ var Methods$c = {
|
|
|
13477
13312
|
* 处理选中源
|
|
13478
13313
|
*/
|
|
13479
13314
|
handleSelected: function handleSelected(params, event) {
|
|
13480
|
-
var
|
|
13315
|
+
var _this73 = this;
|
|
13481
13316
|
var editConfig = this.editConfig, editStore = this.editStore, elemStore = this.elemStore, _this$mouseConfig4 = this.mouseConfig, mouseConfig = _this$mouseConfig4 === void 0 ? {} : _this$mouseConfig4;
|
|
13482
13317
|
var actived = editStore.actived, selected = editStore.selected;
|
|
13483
13318
|
var _ref209 = params || {}, cell = _ref209.cell, column = _ref209.column, row2 = _ref209.row;
|
|
13484
13319
|
var selectMethod = function selectMethod2() {
|
|
13485
13320
|
if (selected.row === row2 && selected.column === column || actived.row === row2 && (editConfig.mode !== "cell" || actived.column === column)) {
|
|
13486
|
-
return
|
|
13321
|
+
return _this73.$nextTick();
|
|
13487
13322
|
}
|
|
13488
|
-
if (
|
|
13489
|
-
|
|
13490
|
-
|
|
13491
|
-
|
|
13492
|
-
|
|
13323
|
+
if (_this73.keyboardConfig || _this73.mouseConfig) {
|
|
13324
|
+
_this73.clearChecked(event);
|
|
13325
|
+
_this73.clearIndexChecked();
|
|
13326
|
+
_this73.clearHeaderChecked();
|
|
13327
|
+
_this73.clearSelected(event);
|
|
13493
13328
|
}
|
|
13494
|
-
|
|
13329
|
+
_this73.clearActived(event);
|
|
13495
13330
|
selected.args = params;
|
|
13496
13331
|
selected.row = row2;
|
|
13497
13332
|
selected.column = column;
|
|
13498
|
-
|
|
13333
|
+
_this73.updateSelectedCls();
|
|
13499
13334
|
if (!mouseConfig.checked) {
|
|
13500
|
-
return
|
|
13335
|
+
return _this73.$nextTick();
|
|
13501
13336
|
}
|
|
13502
13337
|
var headerElem = elemStore["main-header-list"];
|
|
13503
|
-
|
|
13338
|
+
_this73.handleChecked([[cell]]);
|
|
13504
13339
|
if (!headerElem) {
|
|
13505
|
-
return
|
|
13340
|
+
return _this73.$nextTick();
|
|
13506
13341
|
}
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
return
|
|
13342
|
+
_this73.handleHeaderChecked([[headerElem.querySelector("." + (column && column.id))]]);
|
|
13343
|
+
_this73.handleIndexChecked([[cell && cell.parentNode && cell.parentNode.querySelector(".col__index")]]);
|
|
13344
|
+
return _this73.$nextTick();
|
|
13510
13345
|
};
|
|
13511
13346
|
selectMethod = debounce(20, selectMethod);
|
|
13512
13347
|
return selectMethod();
|
|
@@ -13928,7 +13763,7 @@ var Methods$b = {
|
|
|
13928
13763
|
},
|
|
13929
13764
|
// 当前行方向键移动处理
|
|
13930
13765
|
moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, event) {
|
|
13931
|
-
var
|
|
13766
|
+
var _this74 = this;
|
|
13932
13767
|
var afterFullData = this.afterFullData, currentRow = this.currentRow, treeConfig = this.treeConfig;
|
|
13933
13768
|
var targetRow;
|
|
13934
13769
|
event.preventDefault();
|
|
@@ -13951,8 +13786,8 @@ var Methods$b = {
|
|
|
13951
13786
|
}
|
|
13952
13787
|
if (targetRow) {
|
|
13953
13788
|
this.scrollToRow(targetRow).then(function() {
|
|
13954
|
-
return
|
|
13955
|
-
$table:
|
|
13789
|
+
return _this74.triggerCurrentRowEvent(event, {
|
|
13790
|
+
$table: _this74,
|
|
13956
13791
|
row: targetRow
|
|
13957
13792
|
});
|
|
13958
13793
|
});
|
|
@@ -13960,7 +13795,7 @@ var Methods$b = {
|
|
|
13960
13795
|
},
|
|
13961
13796
|
// 可编辑方向键移动处理
|
|
13962
13797
|
moveSelected: function moveSelected(_ref218) {
|
|
13963
|
-
var
|
|
13798
|
+
var _this75 = this;
|
|
13964
13799
|
var args = _ref218.args, isLeftArrow = _ref218.isLeftArrow, isUpArrow = _ref218.isUpArrow, isRightArrow = _ref218.isRightArrow, isDownArrow = _ref218.isDownArrow, event = _ref218.event;
|
|
13965
13800
|
var hasIndexColumn2 = this.hasIndexColumn, visibleColumn = this.tableColumn, tableData = this.tableFullData;
|
|
13966
13801
|
var params = _extends({}, args);
|
|
@@ -13990,8 +13825,8 @@ var Methods$b = {
|
|
|
13990
13825
|
}
|
|
13991
13826
|
getCell(this, params).then(function(resCell) {
|
|
13992
13827
|
params.cell = resCell;
|
|
13993
|
-
|
|
13994
|
-
|
|
13828
|
+
_this75.handleSelected(params, event);
|
|
13829
|
+
_this75.scrollToRow(params.row, params.column, false, {
|
|
13995
13830
|
isLeftArrow,
|
|
13996
13831
|
isRightArrow,
|
|
13997
13832
|
from: column
|
|
@@ -14000,7 +13835,7 @@ var Methods$b = {
|
|
|
14000
13835
|
},
|
|
14001
13836
|
// 表头按下事件
|
|
14002
13837
|
triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(event, params) {
|
|
14003
|
-
var
|
|
13838
|
+
var _this76 = this;
|
|
14004
13839
|
var $el = this.$el, elemStore = this.elemStore, _this$mouseConfig5 = this.mouseConfig, mouseConfig = _this$mouseConfig5 === void 0 ? {} : _this$mouseConfig5, tableData = this.tableData;
|
|
14005
13840
|
var headerList = elemStore["main-header-list"].children;
|
|
14006
13841
|
var bodyList = elemStore["main-body-list"].children;
|
|
@@ -14044,10 +13879,10 @@ var Methods$b = {
|
|
|
14044
13879
|
params.row = tableData[0];
|
|
14045
13880
|
getCell(this, params).then(function(cellRes) {
|
|
14046
13881
|
params.cell = cellRes;
|
|
14047
|
-
|
|
13882
|
+
_this76.handleSelected(params, event);
|
|
14048
13883
|
var rowNodes = getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(lastTr.querySelector(".col__index")));
|
|
14049
|
-
|
|
14050
|
-
|
|
13884
|
+
_this76.handleIndexChecked(rowNodes);
|
|
13885
|
+
_this76.handleChecked(getRowNodes(bodyList, getCellNodeIndex(startCell), getCellNodeIndex(lastCell)));
|
|
14051
13886
|
});
|
|
14052
13887
|
this.closeMenu();
|
|
14053
13888
|
},
|
|
@@ -14177,7 +14012,7 @@ var Methods$b = {
|
|
|
14177
14012
|
return this.$nextTick();
|
|
14178
14013
|
},
|
|
14179
14014
|
_getMouseCheckeds: function _getMouseCheckeds() {
|
|
14180
|
-
var
|
|
14015
|
+
var _this77 = this;
|
|
14181
14016
|
var _this$editStore$check = this.editStore.checked.rowNodes, rowNodes = _this$editStore$check === void 0 ? [] : _this$editStore$check;
|
|
14182
14017
|
var _ref219 = {}, _ref219$rows = _ref219.rows, rows = _ref219$rows === void 0 ? [] : _ref219$rows, _ref219$columns = _ref219.columns, columns2 = _ref219$columns === void 0 ? [] : _ref219$columns;
|
|
14183
14018
|
var res = {
|
|
@@ -14187,10 +14022,10 @@ var Methods$b = {
|
|
|
14187
14022
|
};
|
|
14188
14023
|
if (rowNodes && rowNodes.length) {
|
|
14189
14024
|
res.rows = rowNodes.map(function(arr) {
|
|
14190
|
-
return
|
|
14025
|
+
return _this77.getRowNode(arr[0].parentNode).item;
|
|
14191
14026
|
});
|
|
14192
14027
|
res.columns = rowNodes[0].map(function(col) {
|
|
14193
|
-
return
|
|
14028
|
+
return _this77.getColumnNode(col).item;
|
|
14194
14029
|
});
|
|
14195
14030
|
}
|
|
14196
14031
|
return res;
|
|
@@ -14243,7 +14078,7 @@ var Methods$b = {
|
|
|
14243
14078
|
this.editStore.checked.rowNodes = rowNodes;
|
|
14244
14079
|
},
|
|
14245
14080
|
handleAllChecked: function handleAllChecked(event) {
|
|
14246
|
-
var
|
|
14081
|
+
var _this78 = this;
|
|
14247
14082
|
var elemStore = this.elemStore, _this$mouseConfig7 = this.mouseConfig, mouseConfig = _this$mouseConfig7 === void 0 ? {} : _this$mouseConfig7, tableData = this.tableData, visibleColumn = this.visibleColumn;
|
|
14248
14083
|
if (!mouseConfig.checked) {
|
|
14249
14084
|
return;
|
|
@@ -14271,10 +14106,10 @@ var Methods$b = {
|
|
|
14271
14106
|
params.columnIndex = this.getColumnIndex(params.column);
|
|
14272
14107
|
getCell(this, params).then(function(resCell) {
|
|
14273
14108
|
params.cell = resCell;
|
|
14274
|
-
|
|
14275
|
-
|
|
14276
|
-
|
|
14277
|
-
|
|
14109
|
+
_this78.handleSelected(params, event);
|
|
14110
|
+
_this78.handleHeaderChecked(getRowNodes(headerList, getCellNodeIndex(cell.nextElementSibling), getCellNodeIndex(cell.parentNode.lastElementChild)));
|
|
14111
|
+
_this78.handleIndexChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(lastTrElem.querySelector(selectorColumnId))));
|
|
14112
|
+
_this78.handleChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell.nextElementSibling), getCellNodeIndex(lastTrElem.lastElementChild)));
|
|
14278
14113
|
});
|
|
14279
14114
|
},
|
|
14280
14115
|
handleIndexChecked: function handleIndexChecked(rowNodes) {
|
|
@@ -14614,17 +14449,17 @@ var Methods$a = {
|
|
|
14614
14449
|
},
|
|
14615
14450
|
// 聚焦到校验通过的单元格并弹出校验错误提示
|
|
14616
14451
|
handleValidError: function handleValidError(params) {
|
|
14617
|
-
var
|
|
14452
|
+
var _this79 = this;
|
|
14618
14453
|
var event = {
|
|
14619
14454
|
type: "valid-error",
|
|
14620
14455
|
trigger: "call"
|
|
14621
14456
|
};
|
|
14622
14457
|
this.handleActived(params, event).then(function() {
|
|
14623
|
-
return
|
|
14458
|
+
return _this79.showValidTooltip(params);
|
|
14624
14459
|
});
|
|
14625
14460
|
},
|
|
14626
14461
|
validatePromise: function validatePromise(row2, column, columnIndex, isAll, validRest) {
|
|
14627
|
-
var
|
|
14462
|
+
var _this80 = this;
|
|
14628
14463
|
function onrejected(_ref228) {
|
|
14629
14464
|
var _vm = _ref228._vm, reject = _ref228.reject, resolve = _ref228.resolve;
|
|
14630
14465
|
return function(_ref229) {
|
|
@@ -14647,8 +14482,8 @@ var Methods$a = {
|
|
|
14647
14482
|
};
|
|
14648
14483
|
}
|
|
14649
14484
|
return new Promise(function(resolve, reject) {
|
|
14650
|
-
|
|
14651
|
-
_vm:
|
|
14485
|
+
_this80.validCellRules("all", row2, column).then(resolve).catch(onrejected({
|
|
14486
|
+
_vm: _this80,
|
|
14652
14487
|
reject,
|
|
14653
14488
|
resolve
|
|
14654
14489
|
}));
|
|
@@ -14733,7 +14568,7 @@ var Methods$a = {
|
|
|
14733
14568
|
* @param { any } defaultValue 需要校验的默认值
|
|
14734
14569
|
*/
|
|
14735
14570
|
validCellRules: function validCellRules(type, row2, column, defaultValue) {
|
|
14736
|
-
var
|
|
14571
|
+
var _this81 = this;
|
|
14737
14572
|
var editRules = this.editRules, rowId = this.rowId;
|
|
14738
14573
|
var property = column.property;
|
|
14739
14574
|
var _ref232 = {}, _ref232$descriptor = _ref232.descriptor, descriptor = _ref232$descriptor === void 0 ? {} : _ref232$descriptor, _ref232$model = _ref232.model, model = _ref232$model === void 0 ? {} : _ref232$model;
|
|
@@ -14778,11 +14613,11 @@ var Methods$a = {
|
|
|
14778
14613
|
validator.validate(model, validArgs).then(resolve).catch(onRejected3);
|
|
14779
14614
|
};
|
|
14780
14615
|
var onFulfilled = function onFulfilled2() {
|
|
14781
|
-
|
|
14616
|
+
_this81.validatedMap[column.id + "-" + row2[rowId]] = false;
|
|
14782
14617
|
return Promise.resolve();
|
|
14783
14618
|
};
|
|
14784
14619
|
var onRejected22 = function onRejected23(errors) {
|
|
14785
|
-
|
|
14620
|
+
_this81.validatedMap[column.id + "-" + row2[rowId]] = true;
|
|
14786
14621
|
return Promise.reject(errors);
|
|
14787
14622
|
};
|
|
14788
14623
|
return new Promise(executor).then(onFulfilled).catch(onRejected22);
|
|
@@ -14801,7 +14636,7 @@ var Methods$a = {
|
|
|
14801
14636
|
},
|
|
14802
14637
|
// 触发校验
|
|
14803
14638
|
triggerValidate: function triggerValidate(type) {
|
|
14804
|
-
var
|
|
14639
|
+
var _this82 = this;
|
|
14805
14640
|
var editConfig = this.editConfig, editRules = this.editRules, editStore = this.editStore, validStore = this.validStore;
|
|
14806
14641
|
var actived = editStore.actived;
|
|
14807
14642
|
if (!actived.row || !editRules) {
|
|
@@ -14812,7 +14647,7 @@ var Methods$a = {
|
|
|
14812
14647
|
return Promise.resolve();
|
|
14813
14648
|
}
|
|
14814
14649
|
var onfulfilled = function onfulfilled2() {
|
|
14815
|
-
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column &&
|
|
14650
|
+
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column && _this82.clearValidate();
|
|
14816
14651
|
};
|
|
14817
14652
|
var onrejected = function onrejected2(_ref234) {
|
|
14818
14653
|
var rule = _ref234.rule;
|
|
@@ -14825,14 +14660,14 @@ var Methods$a = {
|
|
|
14825
14660
|
row: row2,
|
|
14826
14661
|
rule
|
|
14827
14662
|
};
|
|
14828
|
-
|
|
14663
|
+
_this82.showValidTooltip(rest);
|
|
14829
14664
|
return Promise.reject(rest);
|
|
14830
14665
|
};
|
|
14831
14666
|
return this.validCellRules(type, row2, column).then(onfulfilled).catch(onrejected);
|
|
14832
14667
|
},
|
|
14833
14668
|
// 弹出校验错误提示
|
|
14834
14669
|
showValidTooltip: function showValidTooltip(params) {
|
|
14835
|
-
var
|
|
14670
|
+
var _this83 = this;
|
|
14836
14671
|
var $refs = this.$refs, height2 = this.height, tableData = this.tableData, validOpts2 = this.validOpts;
|
|
14837
14672
|
var cell = params.cell, column = params.column, row2 = params.row, rule = params.rule;
|
|
14838
14673
|
var content = rule.message;
|
|
@@ -14840,7 +14675,7 @@ var Methods$a = {
|
|
|
14840
14675
|
var isMessageTooltip = validOpts2.isMessageTooltip, isMessageDefault = validOpts2.isMessageDefault, isMessageInline = validOpts2.isMessageInline;
|
|
14841
14676
|
var showMsg = isMessageTooltip || isMessageDefault && !height2 && tableData.length < 2;
|
|
14842
14677
|
this.$nextTick(function() {
|
|
14843
|
-
Object.assign(
|
|
14678
|
+
Object.assign(_this83.validStore, {
|
|
14844
14679
|
row: row2,
|
|
14845
14680
|
column,
|
|
14846
14681
|
rule,
|
|
@@ -14848,19 +14683,19 @@ var Methods$a = {
|
|
|
14848
14683
|
visible: true
|
|
14849
14684
|
});
|
|
14850
14685
|
if (validTip && showMsg) {
|
|
14851
|
-
|
|
14852
|
-
|
|
14686
|
+
_this83.clostValidTooltip();
|
|
14687
|
+
_this83.validTipContent = content;
|
|
14853
14688
|
validTip.state.referenceElm = cell;
|
|
14854
14689
|
validTip.$refs.popper && (validTip.$refs.popper.style.display = "none");
|
|
14855
14690
|
validTip.doDestroy();
|
|
14856
14691
|
validTip.setExpectedState(true);
|
|
14857
|
-
|
|
14692
|
+
_this83.activateTooltipValid(validTip);
|
|
14858
14693
|
} else if (isMessageInline) {
|
|
14859
|
-
|
|
14860
|
-
return
|
|
14694
|
+
_this83.$nextTick(function() {
|
|
14695
|
+
return _this83.recalculate();
|
|
14861
14696
|
});
|
|
14862
14697
|
}
|
|
14863
|
-
emitEvent(
|
|
14698
|
+
emitEvent(_this83, "valid-error", [params]);
|
|
14864
14699
|
});
|
|
14865
14700
|
},
|
|
14866
14701
|
// 关闭 validTip
|
|
@@ -14881,11 +14716,11 @@ var Validator = {
|
|
|
14881
14716
|
};
|
|
14882
14717
|
var Methods$9 = {
|
|
14883
14718
|
bindResize: function bindResize() {
|
|
14884
|
-
var
|
|
14719
|
+
var _this84 = this;
|
|
14885
14720
|
var resizeObserver = new Resize$1(function() {
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14721
|
+
_this84.updateParentHeight();
|
|
14722
|
+
_this84.updateTableBodyHeight();
|
|
14723
|
+
_this84.recalculate();
|
|
14889
14724
|
}, GlobalConfig$1.resizeInterval);
|
|
14890
14725
|
var parentElem = this.getParentElem();
|
|
14891
14726
|
parentElem && resizeObserver.observe(parentElem);
|
|
@@ -14930,7 +14765,7 @@ var Methods$8 = {
|
|
|
14930
14765
|
}
|
|
14931
14766
|
},
|
|
14932
14767
|
handleFetch: function handleFetch(code, sortArg) {
|
|
14933
|
-
var
|
|
14768
|
+
var _this85 = this;
|
|
14934
14769
|
var pager = this.pager, sortData = this.sortData, filterData = this.filterData, pagerConfig = this.pagerConfig, fetchOption = this.fetchOption, fetchData = this.fetchData, dataset = this.dataset;
|
|
14935
14770
|
if (this.isInitialLoading) {
|
|
14936
14771
|
this.isInitialLoading = false;
|
|
@@ -14989,7 +14824,7 @@ var Methods$8 = {
|
|
|
14989
14824
|
}, params);
|
|
14990
14825
|
}
|
|
14991
14826
|
return search.then(this.loadFetchData).catch(function(error2) {
|
|
14992
|
-
|
|
14827
|
+
_this85.tableLoading = false;
|
|
14993
14828
|
throw error2;
|
|
14994
14829
|
});
|
|
14995
14830
|
},
|
|
@@ -15094,19 +14929,19 @@ var Methods$7 = {
|
|
|
15094
14929
|
return res;
|
|
15095
14930
|
},
|
|
15096
14931
|
pageChangeEvent: function pageChangeEvent(params) {
|
|
15097
|
-
var
|
|
14932
|
+
var _this86 = this;
|
|
15098
14933
|
this.tablePageLoading = true;
|
|
15099
14934
|
if (!this.tasks.updatePage) {
|
|
15100
14935
|
this.tasks.updatePage = debounce(200, function() {
|
|
15101
14936
|
var eventParams = _extends({
|
|
15102
|
-
$grid:
|
|
14937
|
+
$grid: _this86
|
|
15103
14938
|
}, params);
|
|
15104
|
-
var toolbarVm =
|
|
15105
|
-
emitEvent(
|
|
15106
|
-
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
14939
|
+
var toolbarVm = _this86.getVm("toolbar");
|
|
14940
|
+
emitEvent(_this86, "page-change", eventParams);
|
|
14941
|
+
_this86.emitter.emit("page-change", eventParams);
|
|
14942
|
+
_this86.handleFetch("query").then(function() {
|
|
14943
|
+
_this86.realTimeTablePage = _extends({}, _this86.tablePage);
|
|
14944
|
+
_this86.tablePageLoading = false;
|
|
15110
14945
|
});
|
|
15111
14946
|
if (toolbarVm) {
|
|
15112
14947
|
toolbarVm.orderSetting();
|
|
@@ -15128,7 +14963,7 @@ var Methods$7 = {
|
|
|
15128
14963
|
}
|
|
15129
14964
|
},
|
|
15130
14965
|
beforePageChangeHandler: function beforePageChangeHandler(params) {
|
|
15131
|
-
var
|
|
14966
|
+
var _this87 = this;
|
|
15132
14967
|
if (!this.showSaveMsg) {
|
|
15133
14968
|
var eventParams = extend(false, {
|
|
15134
14969
|
$grid: this
|
|
@@ -15143,8 +14978,8 @@ var Methods$7 = {
|
|
|
15143
14978
|
var next = function next2(res) {
|
|
15144
14979
|
if (res === "confirm") {
|
|
15145
14980
|
rollback && rollback();
|
|
15146
|
-
emitEvent(
|
|
15147
|
-
|
|
14981
|
+
emitEvent(_this87, "cancel-page-change", _this87);
|
|
14982
|
+
_this87.emitter.emit("cancel-page-change", _this87);
|
|
15148
14983
|
} else {
|
|
15149
14984
|
callback && callback();
|
|
15150
14985
|
}
|
|
@@ -15242,7 +15077,7 @@ var Methods$6 = {
|
|
|
15242
15077
|
}();
|
|
15243
15078
|
},
|
|
15244
15079
|
handleSave: function handleSave(code, args) {
|
|
15245
|
-
var
|
|
15080
|
+
var _this88 = this;
|
|
15246
15081
|
var saveData = this.saveData, isMsg2 = this.isMsg;
|
|
15247
15082
|
if (!saveData) {
|
|
15248
15083
|
error("ui.grid.error.notSave");
|
|
@@ -15260,7 +15095,7 @@ var Methods$6 = {
|
|
|
15260
15095
|
return;
|
|
15261
15096
|
}
|
|
15262
15097
|
var canInvoke = invokeSaveDataApi({
|
|
15263
|
-
_vm:
|
|
15098
|
+
_vm: _this88,
|
|
15264
15099
|
args,
|
|
15265
15100
|
body,
|
|
15266
15101
|
code,
|
|
@@ -15271,7 +15106,7 @@ var Methods$6 = {
|
|
|
15271
15106
|
valid
|
|
15272
15107
|
});
|
|
15273
15108
|
doRemoveOrShowMsg({
|
|
15274
|
-
_vm:
|
|
15109
|
+
_vm: _this88,
|
|
15275
15110
|
canInvoke,
|
|
15276
15111
|
code,
|
|
15277
15112
|
isMsg: isMsg2,
|
|
@@ -15287,11 +15122,11 @@ var Methods$6 = {
|
|
|
15287
15122
|
pendingRecords
|
|
15288
15123
|
});
|
|
15289
15124
|
return new Promise(function(resolve) {
|
|
15290
|
-
|
|
15125
|
+
_this88.validate(validRows, getCallback(resolve));
|
|
15291
15126
|
});
|
|
15292
15127
|
},
|
|
15293
15128
|
handleDelete: function handleDelete(code, args) {
|
|
15294
|
-
var
|
|
15129
|
+
var _this89 = this;
|
|
15295
15130
|
var deleteData = this.deleteData, isMsg2 = this.isMsg;
|
|
15296
15131
|
if (!deleteData) {
|
|
15297
15132
|
error("ui.grid.error.notDelete");
|
|
@@ -15299,7 +15134,7 @@ var Methods$6 = {
|
|
|
15299
15134
|
}
|
|
15300
15135
|
var selecteds = this.getSelectRecords(true);
|
|
15301
15136
|
var afterRemove = function afterRemove2() {
|
|
15302
|
-
var removeds =
|
|
15137
|
+
var removeds = _this89.getRemoveRecords();
|
|
15303
15138
|
if (!removeds.length && isMsg2 && !selecteds.length) {
|
|
15304
15139
|
Modal$1.message({
|
|
15305
15140
|
id: code,
|
|
@@ -15309,34 +15144,34 @@ var Methods$6 = {
|
|
|
15309
15144
|
}
|
|
15310
15145
|
if (removeds.length) {
|
|
15311
15146
|
var apiArgs = [{
|
|
15312
|
-
$grid:
|
|
15147
|
+
$grid: _this89,
|
|
15313
15148
|
changeRecords: {
|
|
15314
15149
|
removeRecords: removeds
|
|
15315
15150
|
}
|
|
15316
15151
|
}].concat(args);
|
|
15317
15152
|
var stopLoading = function stopLoading2() {
|
|
15318
|
-
|
|
15153
|
+
_this89.tableLoading = false;
|
|
15319
15154
|
};
|
|
15320
|
-
|
|
15321
|
-
return deleteData.api.apply(
|
|
15322
|
-
return
|
|
15155
|
+
_this89.tableLoading = true;
|
|
15156
|
+
return deleteData.api.apply(_this89, apiArgs).then(stopLoading).catch(stopLoading).then(function() {
|
|
15157
|
+
return _this89.commitProxy("reload");
|
|
15323
15158
|
});
|
|
15324
15159
|
}
|
|
15325
15160
|
};
|
|
15326
15161
|
this.remove(selecteds).then(afterRemove);
|
|
15327
15162
|
},
|
|
15328
15163
|
handleFullScreen: function handleFullScreen(_ref242) {
|
|
15329
|
-
var
|
|
15164
|
+
var _this90 = this;
|
|
15330
15165
|
var show2 = _ref242[0];
|
|
15331
15166
|
this.fullScreenClass = show2 ? "tiny-fullscreen-full" : "";
|
|
15332
15167
|
this.$nextTick(function() {
|
|
15333
|
-
|
|
15334
|
-
emitEvent(
|
|
15335
|
-
|
|
15168
|
+
_this90.recalculate(true);
|
|
15169
|
+
emitEvent(_this90, "fullscreen", show2);
|
|
15170
|
+
_this90.emitter.emit("fullscreen", show2);
|
|
15336
15171
|
});
|
|
15337
15172
|
},
|
|
15338
15173
|
commitProxy: function commitProxy(code) {
|
|
15339
|
-
var
|
|
15174
|
+
var _this91 = this;
|
|
15340
15175
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
15341
15176
|
args[_key2 - 1] = arguments[_key2];
|
|
15342
15177
|
}
|
|
@@ -15346,17 +15181,17 @@ var Methods$6 = {
|
|
|
15346
15181
|
} else if (code === "insert_actived") {
|
|
15347
15182
|
this.insert().then(function(_ref243) {
|
|
15348
15183
|
var row2 = _ref243.row;
|
|
15349
|
-
return
|
|
15184
|
+
return _this91.setActiveRow(row2);
|
|
15350
15185
|
});
|
|
15351
15186
|
} else if (code === "mark_cancel") {
|
|
15352
15187
|
this.triggerPendingEvent(code);
|
|
15353
15188
|
} else if (code === "delete_selection") {
|
|
15354
15189
|
this.handleDeleteRow(code, "ui.grid.deleteSelectRecord", function() {
|
|
15355
|
-
return
|
|
15190
|
+
return _this91.commitProxy(["delete"].concat(args));
|
|
15356
15191
|
});
|
|
15357
15192
|
} else if (code === "remove_selection") {
|
|
15358
15193
|
this.handleDeleteRow(code, "ui.grid.removeSelectRecord", function() {
|
|
15359
|
-
return
|
|
15194
|
+
return _this91.removeSelecteds();
|
|
15360
15195
|
});
|
|
15361
15196
|
} else if (code === "export") {
|
|
15362
15197
|
this.exportCsv();
|
|
@@ -15464,9 +15299,9 @@ var Methods$5 = {
|
|
|
15464
15299
|
key: _vm.columnAnchorKey,
|
|
15465
15300
|
ref: "tinyGridColumnAnchor"
|
|
15466
15301
|
}, anchors.map(function(anchor) {
|
|
15467
|
-
var _anchor$active = anchor.active, active = _anchor$active === void 0 ? false : _anchor$active, _anchor$label = anchor.label, label = _anchor$label === void 0 ? "" : _anchor$label, _anchor$field = anchor.field, field = _anchor$field === void 0 ? "" : _anchor$field,
|
|
15468
|
-
if (typeof
|
|
15469
|
-
return
|
|
15302
|
+
var _anchor$active = anchor.active, active = _anchor$active === void 0 ? false : _anchor$active, _anchor$label = anchor.label, label = _anchor$label === void 0 ? "" : _anchor$label, _anchor$field = anchor.field, field = _anchor$field === void 0 ? "" : _anchor$field, render18 = anchor.render;
|
|
15303
|
+
if (typeof render18 === "function") {
|
|
15304
|
+
return render18({
|
|
15470
15305
|
h,
|
|
15471
15306
|
anchor,
|
|
15472
15307
|
action
|
|
@@ -15526,7 +15361,7 @@ var Methods$5 = {
|
|
|
15526
15361
|
}
|
|
15527
15362
|
},
|
|
15528
15363
|
buildColumnAnchorParams: function buildColumnAnchorParams() {
|
|
15529
|
-
var
|
|
15364
|
+
var _this92 = this;
|
|
15530
15365
|
var columnAnchor = this.columnAnchor;
|
|
15531
15366
|
var anchors = [];
|
|
15532
15367
|
var activeAnchor = {
|
|
@@ -15536,19 +15371,19 @@ var Methods$5 = {
|
|
|
15536
15371
|
if (Array.isArray(columnAnchor) && columnAnchor.length) {
|
|
15537
15372
|
columnAnchor.forEach(function(item) {
|
|
15538
15373
|
if (typeof item === "string") {
|
|
15539
|
-
|
|
15374
|
+
_this92.buildColumnAnchor({
|
|
15540
15375
|
property: item,
|
|
15541
15376
|
anchors
|
|
15542
15377
|
});
|
|
15543
15378
|
} else if (Array.isArray(item)) {
|
|
15544
|
-
if (item.length > 1)
|
|
15379
|
+
if (item.length > 1) _this92.buildColumnAnchor({
|
|
15545
15380
|
property: item[0],
|
|
15546
15381
|
label: item[1],
|
|
15547
15382
|
anchors
|
|
15548
15383
|
});
|
|
15549
15384
|
} else if (item && typeof item === "object") {
|
|
15550
15385
|
var field = item.field, other = _objectWithoutPropertiesLoose(item, _excluded2);
|
|
15551
|
-
|
|
15386
|
+
_this92.buildColumnAnchor({
|
|
15552
15387
|
property: field,
|
|
15553
15388
|
label: other,
|
|
15554
15389
|
anchors,
|
|
@@ -15564,19 +15399,19 @@ var Methods$5 = {
|
|
|
15564
15399
|
anchors,
|
|
15565
15400
|
activeAnchor,
|
|
15566
15401
|
action: function action(field, e) {
|
|
15567
|
-
return
|
|
15402
|
+
return _this92.anchorAction({
|
|
15568
15403
|
field,
|
|
15569
15404
|
anchors,
|
|
15570
|
-
_vm:
|
|
15405
|
+
_vm: _this92,
|
|
15571
15406
|
e
|
|
15572
15407
|
});
|
|
15573
15408
|
}
|
|
15574
15409
|
};
|
|
15575
15410
|
this.emitter.once("active-anchor", function() {
|
|
15576
|
-
return
|
|
15411
|
+
return _this92.anchorAction({
|
|
15577
15412
|
field: activeAnchor.field,
|
|
15578
15413
|
anchors,
|
|
15579
|
-
_vm:
|
|
15414
|
+
_vm: _this92
|
|
15580
15415
|
});
|
|
15581
15416
|
});
|
|
15582
15417
|
},
|
|
@@ -15721,7 +15556,7 @@ var getSortColumns = function getSortColumns2(columns2) {
|
|
|
15721
15556
|
var Methods$4 = {
|
|
15722
15557
|
// 处理列拖拽
|
|
15723
15558
|
columnDrop: function columnDrop(headerEl) {
|
|
15724
|
-
var
|
|
15559
|
+
var _this93 = this;
|
|
15725
15560
|
var _ref250 = this.dropConfig || {}, plugin = _ref250.plugin, onBeforeMove = _ref250.onBeforeMove, filter2 = _ref250.filter;
|
|
15726
15561
|
var columnDropContainer = headerEl.querySelector(".tiny-grid__header .tiny-grid-header__row");
|
|
15727
15562
|
var columnDropOptions = {
|
|
@@ -15729,7 +15564,7 @@ var Methods$4 = {
|
|
|
15729
15564
|
filter: filter2,
|
|
15730
15565
|
onEnd: function onEnd(event) {
|
|
15731
15566
|
var item = event.item, newIndex = event.newIndex, oldIndex = event.oldIndex;
|
|
15732
|
-
var
|
|
15567
|
+
var _this93$getTableColum = _this93.getTableColumn(), fullColumn = _this93$getTableColum.fullColumn, tableColumn3 = _this93$getTableColum.tableColumn;
|
|
15733
15568
|
var sortVisibleCols = getSortColumns(tableColumn3);
|
|
15734
15569
|
var targetThElem = item;
|
|
15735
15570
|
var wrapperElem = targetThElem.parentNode;
|
|
@@ -15750,21 +15585,21 @@ var Methods$4 = {
|
|
|
15750
15585
|
status: "error"
|
|
15751
15586
|
});
|
|
15752
15587
|
}
|
|
15753
|
-
var oldColumnIndex =
|
|
15754
|
-
var newColumnIndex =
|
|
15588
|
+
var oldColumnIndex = _this93.getColumnIndex(sortVisibleCols[oldIndex]);
|
|
15589
|
+
var newColumnIndex = _this93.getColumnIndex(sortVisibleCols[newIndex]);
|
|
15755
15590
|
var currCol = fullColumn.splice(oldColumnIndex, 1)[0];
|
|
15756
15591
|
fullColumn.splice(newColumnIndex, 0, currCol);
|
|
15757
|
-
|
|
15758
|
-
|
|
15759
|
-
var toolbarVm =
|
|
15760
|
-
|
|
15592
|
+
_this93.loadColumn(fullColumn);
|
|
15593
|
+
_this93.$emit("column-drop-end", event, _this93);
|
|
15594
|
+
var toolbarVm = _this93.getVm("toolbar");
|
|
15595
|
+
_this93.isDragHeaderSorting && toolbarVm && toolbarVm.updateSetting();
|
|
15761
15596
|
},
|
|
15762
15597
|
onStart: function onStart(event) {
|
|
15763
|
-
|
|
15598
|
+
_this93.$emit("column-drop-start", event, _this93);
|
|
15764
15599
|
},
|
|
15765
15600
|
onMove: function onMove(event) {
|
|
15766
|
-
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("column", null, event,
|
|
15767
|
-
|
|
15601
|
+
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("column", null, event, _this93) : true;
|
|
15602
|
+
_this93.$emit("column-drop-move", event, _this93);
|
|
15768
15603
|
return cancel === void 0 || cancel;
|
|
15769
15604
|
}
|
|
15770
15605
|
};
|
|
@@ -15772,7 +15607,7 @@ var Methods$4 = {
|
|
|
15772
15607
|
},
|
|
15773
15608
|
// 处理行拖拽
|
|
15774
15609
|
rowDrop: function rowDrop(bodyEl) {
|
|
15775
|
-
var
|
|
15610
|
+
var _this94 = this;
|
|
15776
15611
|
var _this$dropConfig2 = this.dropConfig, plugin = _this$dropConfig2.plugin, onBeforeMove = _this$dropConfig2.onBeforeMove, filter2 = _this$dropConfig2.filter, _this$dropConfig2$ref = _this$dropConfig2.refresh, refresh = _this$dropConfig2$ref === void 0 ? true : _this$dropConfig2$ref, rowHandle = _this$dropConfig2.rowHandle, trigger = _this$dropConfig2.trigger;
|
|
15777
15612
|
var rowDropContainer = bodyEl.querySelector(".tiny-grid__body tbody");
|
|
15778
15613
|
var handle = trigger || ".tiny-grid-body__row";
|
|
@@ -15787,15 +15622,15 @@ var Methods$4 = {
|
|
|
15787
15622
|
refresh
|
|
15788
15623
|
}),
|
|
15789
15624
|
onStart: function onStart(event) {
|
|
15790
|
-
|
|
15625
|
+
_this94.$emit("row-drop-start", event, _this94);
|
|
15791
15626
|
},
|
|
15792
15627
|
onMove: function onMove(event) {
|
|
15793
|
-
var insertRecords =
|
|
15628
|
+
var insertRecords = _this94.getInsertRecords();
|
|
15794
15629
|
if (insertRecords.length) return false;
|
|
15795
15630
|
var dragged = event.dragged;
|
|
15796
|
-
var selfRow =
|
|
15797
|
-
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("row", selfRow, event,
|
|
15798
|
-
|
|
15631
|
+
var selfRow = _this94.getRowNode(dragged).item;
|
|
15632
|
+
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("row", selfRow, event, _this94) : true;
|
|
15633
|
+
_this94.$emit("row-drop-move", event, _this94);
|
|
15799
15634
|
return cancel === void 0 || cancel;
|
|
15800
15635
|
}
|
|
15801
15636
|
};
|
|
@@ -16345,13 +16180,13 @@ var Methods$1 = {
|
|
|
16345
16180
|
}
|
|
16346
16181
|
},
|
|
16347
16182
|
setSelection: function setSelection(rows, value) {
|
|
16348
|
-
var
|
|
16183
|
+
var _this95 = this;
|
|
16349
16184
|
if (rows) {
|
|
16350
16185
|
if (!isArray(rows)) {
|
|
16351
16186
|
rows = [rows];
|
|
16352
16187
|
}
|
|
16353
16188
|
rows.forEach(function(row2) {
|
|
16354
|
-
return
|
|
16189
|
+
return _this95.handleSelectRow({
|
|
16355
16190
|
row: row2
|
|
16356
16191
|
}, !!value);
|
|
16357
16192
|
});
|
|
@@ -16634,7 +16469,7 @@ var Checkbox = {
|
|
|
16634
16469
|
var Methods = {
|
|
16635
16470
|
// 展开树节点事件
|
|
16636
16471
|
triggerTreeExpandEvent: function triggerTreeExpandEvent(event, _ref276) {
|
|
16637
|
-
var
|
|
16472
|
+
var _this96 = this;
|
|
16638
16473
|
var row2 = _ref276.row;
|
|
16639
16474
|
var currentColumn = this.currentColumn, currentRow = this.currentRow;
|
|
16640
16475
|
var rest = this.toggleTreeExpansion(row2);
|
|
@@ -16646,9 +16481,9 @@ var Methods = {
|
|
|
16646
16481
|
emitEvent(this, "toggle-tree-change", [eventParams, event]);
|
|
16647
16482
|
this.$nextTick(function() {
|
|
16648
16483
|
if (currentRow) {
|
|
16649
|
-
|
|
16484
|
+
_this96.setCurrentRow(currentRow);
|
|
16650
16485
|
} else if (currentColumn) {
|
|
16651
|
-
|
|
16486
|
+
_this96.setCurrentColumn(currentColumn);
|
|
16652
16487
|
}
|
|
16653
16488
|
});
|
|
16654
16489
|
return rest;
|
|
@@ -16659,7 +16494,7 @@ var Methods = {
|
|
|
16659
16494
|
},
|
|
16660
16495
|
// 处理默认展开树节点
|
|
16661
16496
|
handleDefaultTreeExpand: function handleDefaultTreeExpand() {
|
|
16662
|
-
var
|
|
16497
|
+
var _this97 = this;
|
|
16663
16498
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
16664
16499
|
if (!treeConfig) {
|
|
16665
16500
|
return;
|
|
@@ -16674,7 +16509,7 @@ var Methods = {
|
|
|
16674
16509
|
filterTree(tableFullData, function(row2) {
|
|
16675
16510
|
return isNonEmptyArr(row2[children]) && treeExpandeds.push(row2);
|
|
16676
16511
|
}, treeConfig);
|
|
16677
|
-
|
|
16512
|
+
_this97.treeExpandeds = treeExpandeds;
|
|
16678
16513
|
};
|
|
16679
16514
|
var doExpandRows = function doExpandRows2() {
|
|
16680
16515
|
rowids.forEach(function(rowid2) {
|
|
@@ -16683,7 +16518,7 @@ var Methods = {
|
|
|
16683
16518
|
}, treeConfig);
|
|
16684
16519
|
matchObj && isNonEmptyArr(matchObj.item[children]) && treeExpandeds.push(matchObj.item);
|
|
16685
16520
|
});
|
|
16686
|
-
|
|
16521
|
+
_this97.treeExpandeds = treeExpandeds;
|
|
16687
16522
|
};
|
|
16688
16523
|
if (expandAll) {
|
|
16689
16524
|
doExpandAll();
|
|
@@ -16751,12 +16586,12 @@ var Methods = {
|
|
|
16751
16586
|
return ~this.treeExpandeds.indexOf(row2);
|
|
16752
16587
|
},
|
|
16753
16588
|
clearTreeExpand: function clearTreeExpand() {
|
|
16754
|
-
var
|
|
16589
|
+
var _this98 = this;
|
|
16755
16590
|
var hasExpand = this.treeExpandeds.length;
|
|
16756
16591
|
this.treeExpandeds = [];
|
|
16757
16592
|
setTreeScrollYCache(this);
|
|
16758
16593
|
return this.$nextTick().then(function() {
|
|
16759
|
-
return hasExpand ?
|
|
16594
|
+
return hasExpand ? _this98.recalculate() : 0;
|
|
16760
16595
|
});
|
|
16761
16596
|
}
|
|
16762
16597
|
};
|
|
@@ -16766,7 +16601,7 @@ var Tree = {
|
|
|
16766
16601
|
Object.assign(host.methods, Methods);
|
|
16767
16602
|
}
|
|
16768
16603
|
};
|
|
16769
|
-
var version = "
|
|
16604
|
+
var version = "3.21.0";
|
|
16770
16605
|
var plugins = [Panel, Edit, Export, Keyboard, Validator, Resize, Panel$1, FetchData, Pager, Toolbar, ColumnAnchor, Dragger, Sort, Tooltip, Checkbox, Tree];
|
|
16771
16606
|
Grid$1.setup({
|
|
16772
16607
|
i18n: t
|