@opentinyvue/vue-grid 2.22.0 → 3.22.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 +714 -879
- package/package.json +15 -15
- 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,11 +2,12 @@ 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 { addClass, isNull, debounce, PopupManager, PopperJS, extend, browserInfo, isObject, isEmptyObject, isServer, removeClass, getDataset, random, isDisplayNone, toDecimal, fastdom, logger, tryToCurrency, tryToDecimal, tryToInt, toFileSize, truncate, toRate, isNumber as isNumber$1, toBoolValue, toDate, getDateWithNewTimezone, isDate, formatDateByPattern, toDateStr, on, Validator as Validator$1, getObj, getStyle, preventDefault, off, throttle, callInterceptor, hasClass } from '@opentinyvue/utils';
|
|
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';
|
|
9
9
|
import Tooltip$1 from '@opentinyvue/vue-tooltip';
|
|
10
|
+
import { createVNode, isVNode, mergeProps, createTextVNode, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, normalizeStyle, createElementVNode, Fragment, renderList } from 'vue';
|
|
10
11
|
import { toNumber, findTree, find as find$1, isEqual as isEqual$1, arrayEach as arrayEach$1 } from '@opentinyvue/vue-renderless/grid/static';
|
|
11
12
|
import { AutoTip } from '@opentinyvue/vue-directive';
|
|
12
13
|
import Button from '@opentinyvue/vue-button';
|
|
@@ -21,77 +22,38 @@ import Resize$1 from '@opentinyvue/vue-renderless/grid/plugins/resize';
|
|
|
21
22
|
import Modal$1 from '@opentinyvue/vue-modal';
|
|
22
23
|
import Pager$1 from '@opentinyvue/vue-pager';
|
|
23
24
|
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
function requireHelper() {
|
|
31
|
-
if (hasRequiredHelper) return helper;
|
|
32
|
-
hasRequiredHelper = 1;
|
|
33
|
-
function _extends() {
|
|
34
|
-
return _extends = Object.assign ? Object.assign.bind() : function(a) {
|
|
35
|
-
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]);
|
|
36
|
-
return a;
|
|
37
|
-
}, _extends.apply(this, arguments);
|
|
38
|
-
}
|
|
39
|
-
var normalMerge = ["attrs", "props", "domProps"], toArrayMerge = ["class", "style", "directives"], functionalMerge = ["on", "nativeOn"], mergeJsxProps = function mergeJsxProps2(a) {
|
|
40
|
-
return a.reduce(function(c, a2) {
|
|
41
|
-
for (var b in a2) if (!c[b]) c[b] = a2[b];
|
|
42
|
-
else if (-1 !== normalMerge.indexOf(b)) c[b] = _extends({}, c[b], a2[b]);
|
|
43
|
-
else if (-1 !== toArrayMerge.indexOf(b)) {
|
|
44
|
-
var d = c[b] instanceof Array ? c[b] : [c[b]], e = a2[b] instanceof Array ? a2[b] : [a2[b]];
|
|
45
|
-
c[b] = [].concat(d, e);
|
|
46
|
-
} else if (-1 !== functionalMerge.indexOf(b)) {
|
|
47
|
-
for (var f in a2[b]) if (c[b][f]) {
|
|
48
|
-
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]];
|
|
49
|
-
c[b][f] = [].concat(g, h);
|
|
50
|
-
} else c[b][f] = a2[b][f];
|
|
51
|
-
} 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];
|
|
52
|
-
else c[b] = a2[b];
|
|
53
|
-
return c;
|
|
54
|
-
}, {});
|
|
55
|
-
}, mergeFn = function mergeFn2(a, b) {
|
|
25
|
+
function _createForOfIteratorHelperLoose$1(r, e) {
|
|
26
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
27
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
28
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
|
|
29
|
+
t && (r = t);
|
|
30
|
+
var o = 0;
|
|
56
31
|
return function() {
|
|
57
|
-
|
|
32
|
+
return o >= r.length ? { done: true } : { done: false, value: r[o++] };
|
|
58
33
|
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return helper;
|
|
34
|
+
}
|
|
35
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
62
36
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (render) {
|
|
69
|
-
options.render = render;
|
|
70
|
-
options.staticRenderFns = staticRenderFns;
|
|
71
|
-
options._compiled = true;
|
|
72
|
-
}
|
|
73
|
-
var hook;
|
|
74
|
-
if (injectStyles) {
|
|
75
|
-
hook = injectStyles;
|
|
76
|
-
}
|
|
77
|
-
if (hook) {
|
|
78
|
-
if (options.functional) {
|
|
79
|
-
options._injectStyles = hook;
|
|
80
|
-
var originalRender = options.render;
|
|
81
|
-
options.render = function renderWithStyleInjection(h, context) {
|
|
82
|
-
hook.call(context);
|
|
83
|
-
return originalRender(h, context);
|
|
84
|
-
};
|
|
85
|
-
} else {
|
|
86
|
-
var existing = options.beforeCreate;
|
|
87
|
-
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
88
|
-
}
|
|
37
|
+
function _unsupportedIterableToArray$1(r, a) {
|
|
38
|
+
if (r) {
|
|
39
|
+
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
|
|
40
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
41
|
+
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;
|
|
89
42
|
}
|
|
90
|
-
return {
|
|
91
|
-
exports: scriptExports,
|
|
92
|
-
options
|
|
93
|
-
};
|
|
94
43
|
}
|
|
44
|
+
function _arrayLikeToArray$1(r, a) {
|
|
45
|
+
(null == a || a > r.length) && (a = r.length);
|
|
46
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
47
|
+
return n;
|
|
48
|
+
}
|
|
49
|
+
var _export_sfc = function _export_sfc2(sfc, props) {
|
|
50
|
+
var target = sfc.__vccOpts || sfc;
|
|
51
|
+
for (var _iterator = _createForOfIteratorHelperLoose$1(props), _step; !(_step = _iterator()).done; ) {
|
|
52
|
+
var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
|
|
53
|
+
target[key] = val;
|
|
54
|
+
}
|
|
55
|
+
return target;
|
|
56
|
+
};
|
|
95
57
|
|
|
96
58
|
var _excluded = ["input", "change"], _excluded2 = ["field"];
|
|
97
59
|
function _defineProperties(e, r) {
|
|
@@ -3042,7 +3004,7 @@ function renderColumn(args1) {
|
|
|
3042
3004
|
return h2("td", colProps, colChildren);
|
|
3043
3005
|
}
|
|
3044
3006
|
function renderRowGroupTds(args) {
|
|
3045
|
-
var $table = args.$table, closeable = args.closeable, currentIcon = args.currentIcon,
|
|
3007
|
+
var $table = args.$table, closeable = args.closeable, currentIcon = args.currentIcon, render18 = args.render, renderGroupCell = args.renderGroupCell;
|
|
3046
3008
|
var row2 = args.row, tableColumn3 = args.tableColumn, tds = args.tds, title = args.title;
|
|
3047
3009
|
var targetColumn = $table._rowGroupTargetColumn;
|
|
3048
3010
|
var value = row2.value || "";
|
|
@@ -3065,30 +3027,26 @@ function renderRowGroupTds(args) {
|
|
|
3065
3027
|
}
|
|
3066
3028
|
if (column === targetColumn) {
|
|
3067
3029
|
var groupTitleVNode = void 0;
|
|
3068
|
-
if (
|
|
3069
|
-
groupTitleVNode =
|
|
3030
|
+
if (render18) {
|
|
3031
|
+
groupTitleVNode = render18(h, params);
|
|
3070
3032
|
} else {
|
|
3071
|
-
groupTitleVNode = [
|
|
3033
|
+
groupTitleVNode = [createVNode("span", {
|
|
3072
3034
|
"class": "row-group-title"
|
|
3073
|
-
}, [header]), ":" + value,
|
|
3035
|
+
}, [header]), ":" + value, createVNode("span", {
|
|
3074
3036
|
"class": "tiny-badge"
|
|
3075
3037
|
}, [row2.children.length])];
|
|
3076
3038
|
}
|
|
3077
|
-
tds.push(
|
|
3039
|
+
tds.push(createVNode("td", {
|
|
3078
3040
|
"class": ["tiny-grid-body__column td-group", column.id],
|
|
3079
|
-
"
|
|
3080
|
-
|
|
3081
|
-
}
|
|
3082
|
-
}, [h("div", {
|
|
3041
|
+
"colspan": column._rowGroupColspan
|
|
3042
|
+
}, [createVNode("div", {
|
|
3083
3043
|
"class": "tiny-grid-cell-group"
|
|
3084
3044
|
}, [[closeable ? currentIcon : null].concat(groupTitleVNode)])]));
|
|
3085
3045
|
} else {
|
|
3086
|
-
tds.push(
|
|
3046
|
+
tds.push(createVNode("td", {
|
|
3087
3047
|
"class": ["tiny-grid-body__column td-placeholder", column.id],
|
|
3088
|
-
"
|
|
3089
|
-
|
|
3090
|
-
}
|
|
3091
|
-
}, [h("div", {
|
|
3048
|
+
"colspan": column._rowGroupColspan
|
|
3049
|
+
}, [createVNode("div", {
|
|
3092
3050
|
"class": "tiny-grid-cell-group"
|
|
3093
3051
|
}, [renderGroupCell ? renderGroupCell(h, params) : null])]));
|
|
3094
3052
|
}
|
|
@@ -3100,18 +3058,18 @@ function renderRowGroupData(_ref55) {
|
|
|
3100
3058
|
if (!virtualRow) {
|
|
3101
3059
|
return;
|
|
3102
3060
|
}
|
|
3103
|
-
var title = rowGroup.title, _rowGroup$closeable2 = rowGroup.closeable, closeable = _rowGroup$closeable2 === void 0 ? true : _rowGroup$closeable2,
|
|
3061
|
+
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;
|
|
3104
3062
|
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;
|
|
3105
|
-
var currentIcon = row2.fold ?
|
|
3063
|
+
var currentIcon = row2.fold ? createVNode(ChevronRight, {
|
|
3106
3064
|
"class": "tiny-svg-size"
|
|
3107
|
-
}) :
|
|
3065
|
+
}, null) : createVNode(ChevronDown, {
|
|
3108
3066
|
"class": "tiny-svg-size"
|
|
3109
|
-
});
|
|
3067
|
+
}, null);
|
|
3110
3068
|
var args = {
|
|
3111
3069
|
$table,
|
|
3112
3070
|
closeable,
|
|
3113
3071
|
currentIcon,
|
|
3114
|
-
render:
|
|
3072
|
+
render: render18,
|
|
3115
3073
|
renderGroupCell
|
|
3116
3074
|
};
|
|
3117
3075
|
Object.assign(args, {
|
|
@@ -3130,22 +3088,18 @@ function renderRowGroupData(_ref55) {
|
|
|
3130
3088
|
}, event]);
|
|
3131
3089
|
}
|
|
3132
3090
|
};
|
|
3133
|
-
rows.push(
|
|
3091
|
+
rows.push(createVNode("tr", {
|
|
3134
3092
|
"class": ["tiny-grid-body__row", "group", className, {
|
|
3135
3093
|
hover: row2.hover
|
|
3136
3094
|
}],
|
|
3137
|
-
"
|
|
3138
|
-
|
|
3095
|
+
"data-rowid": rowid2,
|
|
3096
|
+
"onMouseout": function onMouseout() {
|
|
3097
|
+
return row2.hover = false;
|
|
3139
3098
|
},
|
|
3140
|
-
"
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
"mouseover": function mouseover() {
|
|
3145
|
-
return row2.hover = true;
|
|
3146
|
-
},
|
|
3147
|
-
"click": onClick
|
|
3148
|
-
}
|
|
3099
|
+
"onMouseover": function onMouseover() {
|
|
3100
|
+
return row2.hover = true;
|
|
3101
|
+
},
|
|
3102
|
+
"onClick": onClick
|
|
3149
3103
|
}, [tds]));
|
|
3150
3104
|
}
|
|
3151
3105
|
function renderRow(args) {
|
|
@@ -3501,7 +3455,7 @@ function renderYSpace(_ref66) {
|
|
|
3501
3455
|
class: "tiny-grid-body__y-scrollbar"
|
|
3502
3456
|
}) : [null]]);
|
|
3503
3457
|
}
|
|
3504
|
-
var Body = defineComponent({
|
|
3458
|
+
var Body = /* @__PURE__ */ defineComponent({
|
|
3505
3459
|
name: $prefix + "GridBody",
|
|
3506
3460
|
props: {
|
|
3507
3461
|
collectColumn: Array,
|
|
@@ -3723,6 +3677,9 @@ Radio.model = {
|
|
|
3723
3677
|
event: "update:modelValue"
|
|
3724
3678
|
};
|
|
3725
3679
|
$install(Radio);
|
|
3680
|
+
function _isSlot(s) {
|
|
3681
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
3682
|
+
}
|
|
3726
3683
|
var renderInputArgs = function renderInputArgs2(_ref71) {
|
|
3727
3684
|
var _vm = _ref71._vm, inputFilter = _ref71.inputFilter;
|
|
3728
3685
|
var isAddbyProgram = false;
|
|
@@ -3789,15 +3746,15 @@ var iconRender = function iconRender2(checked, index2, halfChecked) {
|
|
|
3789
3746
|
tabindex: index2
|
|
3790
3747
|
};
|
|
3791
3748
|
if (typeof halfChecked === "undefined") {
|
|
3792
|
-
return checked ?
|
|
3749
|
+
return checked ? createVNode(CheckedSur, mergeProps(props, {
|
|
3793
3750
|
"class": "is-checked"
|
|
3794
|
-
}
|
|
3751
|
+
}), null) : createVNode(Check, props, null);
|
|
3795
3752
|
} else {
|
|
3796
|
-
return checked ?
|
|
3753
|
+
return checked ? createVNode(CheckedSur, mergeProps(props, {
|
|
3797
3754
|
"class": "is-checked"
|
|
3798
|
-
}
|
|
3755
|
+
}), null) : halfChecked ? createVNode(HalfCheck, mergeProps(props, {
|
|
3799
3756
|
"class": "is-checked"
|
|
3800
|
-
}
|
|
3757
|
+
}), null) : createVNode(Check, props, null);
|
|
3801
3758
|
}
|
|
3802
3759
|
};
|
|
3803
3760
|
var renderEnumableOptions = function renderEnumableOptions2(_ref73) {
|
|
@@ -3808,60 +3765,52 @@ var renderEnumableOptions = function renderEnumableOptions2(_ref73) {
|
|
|
3808
3765
|
});
|
|
3809
3766
|
if (resultList.length) {
|
|
3810
3767
|
var filterList = resultList.map(function(item, index2) {
|
|
3811
|
-
return
|
|
3768
|
+
return createVNode("li", {
|
|
3812
3769
|
"class": ["tiny-grid__filter-option", {
|
|
3813
3770
|
selected: item.checked
|
|
3814
3771
|
}],
|
|
3815
|
-
"
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
item.checked = !item.checked;
|
|
3824
|
-
}
|
|
3772
|
+
"onClick": function onClick() {
|
|
3773
|
+
if (!filterStore.multi) {
|
|
3774
|
+
filterStore.options.forEach(function(option) {
|
|
3775
|
+
option.checked = option === item;
|
|
3776
|
+
});
|
|
3777
|
+
_vm.filterEnum();
|
|
3778
|
+
} else {
|
|
3779
|
+
item.checked = !item.checked;
|
|
3825
3780
|
}
|
|
3826
3781
|
}
|
|
3827
|
-
}, [filterStore.multi ? iconRender3(item.checked, index2 + 1) : null,
|
|
3828
|
-
"
|
|
3829
|
-
|
|
3830
|
-
}
|
|
3831
|
-
}, [" ", item.label, " "])]);
|
|
3782
|
+
}, [filterStore.multi ? iconRender3(item.checked, index2 + 1) : null, createVNode("a", {
|
|
3783
|
+
"title": item.label
|
|
3784
|
+
}, [createTextVNode(" "), item.label, createTextVNode(" ")])]);
|
|
3832
3785
|
});
|
|
3833
3786
|
var isShowAllSelect = selectAll && (!filterStore.multi || !searchable && filterStore.multi);
|
|
3834
|
-
return isShowAllSelect ? [
|
|
3787
|
+
return isShowAllSelect ? [createVNode("li", {
|
|
3835
3788
|
"class": "tiny-grid__filter-option",
|
|
3836
|
-
"
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
_vm.filterEnum();
|
|
3846
|
-
}
|
|
3789
|
+
"onClick": function onClick() {
|
|
3790
|
+
var isAllSelected = filterStore.options.every(function(item) {
|
|
3791
|
+
return item.checked;
|
|
3792
|
+
});
|
|
3793
|
+
filterStore.options.forEach(function(option) {
|
|
3794
|
+
option.checked = !isAllSelected;
|
|
3795
|
+
});
|
|
3796
|
+
if (!filterStore.multi) {
|
|
3797
|
+
_vm.filterEnum();
|
|
3847
3798
|
}
|
|
3848
3799
|
}
|
|
3849
3800
|
}, [filterStore.multi ? iconRender3(filterStore.options.every(function(item) {
|
|
3850
3801
|
return item.checked;
|
|
3851
3802
|
}), 0, filterStore.options.some(function(item) {
|
|
3852
3803
|
return item.checked;
|
|
3853
|
-
})) : null,
|
|
3854
|
-
"
|
|
3855
|
-
|
|
3856
|
-
}
|
|
3857
|
-
}, [" ", _vm.i18n("ui.grid.filter.allSelect")])])].concat(filterList) : filterList;
|
|
3804
|
+
})) : null, createVNode("a", {
|
|
3805
|
+
"title": _vm.i18n("ui.grid.filter.allSelect")
|
|
3806
|
+
}, [createTextVNode(" "), _vm.i18n("ui.grid.filter.allSelect")])])].concat(filterList) : filterList;
|
|
3858
3807
|
} else {
|
|
3859
|
-
return [
|
|
3808
|
+
return [createVNode("li", {
|
|
3860
3809
|
"class": "tiny-grid__filter-empty"
|
|
3861
3810
|
}, [_vm.i18n("ui.grid.emptyText")])];
|
|
3862
3811
|
}
|
|
3863
3812
|
};
|
|
3864
|
-
var Panel$1 = defineComponent({
|
|
3813
|
+
var Panel$1 = /* @__PURE__ */ defineComponent({
|
|
3865
3814
|
name: $prefix + "GridFilter",
|
|
3866
3815
|
props: {
|
|
3867
3816
|
filterStore: Object,
|
|
@@ -3891,7 +3840,6 @@ var Panel$1 = defineComponent({
|
|
|
3891
3840
|
},
|
|
3892
3841
|
render: function render5() {
|
|
3893
3842
|
var _this3 = this, _ref74;
|
|
3894
|
-
var h2 = arguments[0];
|
|
3895
3843
|
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;
|
|
3896
3844
|
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;
|
|
3897
3845
|
var layoutMap = {
|
|
@@ -3908,12 +3856,12 @@ var Panel$1 = defineComponent({
|
|
|
3908
3856
|
var map = {
|
|
3909
3857
|
filterActive: "filter__active"
|
|
3910
3858
|
};
|
|
3911
|
-
return
|
|
3859
|
+
return createVNode("div", {
|
|
3912
3860
|
"class": ["tiny-grid__wrapper", "tiny-grid__filter-wrapper", "filter__prevent-default", (_ref74 = {
|
|
3913
3861
|
"tiny-grid__animat": optimizeOpts2.animat
|
|
3914
3862
|
}, _ref74[map.filterActive] = filterStore.visible, _ref74["tiny-grid__filter-simple"] = layout.includes("simple"), _ref74["filter-wrapper-saas"] = $table.isThemeSaas, _ref74)],
|
|
3915
3863
|
"style": filterStore.style
|
|
3916
|
-
}, [filterStore.visible ?
|
|
3864
|
+
}, [filterStore.visible ? createVNode("div", {
|
|
3917
3865
|
"class": ["tiny-grid__filter-body", {
|
|
3918
3866
|
"show-addvance": this.showAdvance
|
|
3919
3867
|
}]
|
|
@@ -3971,85 +3919,72 @@ var Panel$1 = defineComponent({
|
|
|
3971
3919
|
}),
|
|
3972
3920
|
// 基础清除选项
|
|
3973
3921
|
renderBase: function renderBase() {
|
|
3974
|
-
|
|
3975
|
-
return h2("ul", {
|
|
3922
|
+
return createVNode("ul", {
|
|
3976
3923
|
"class": "tiny-grid__filter-panel filter-panel__clear"
|
|
3977
|
-
}, [
|
|
3924
|
+
}, [createVNode("li", {
|
|
3978
3925
|
"class": "tiny-grid__filter-option",
|
|
3979
|
-
"
|
|
3980
|
-
|
|
3981
|
-
}
|
|
3982
|
-
}, [h2("a", {
|
|
3926
|
+
"onClick": this.resetFilter
|
|
3927
|
+
}, [createVNode("a", {
|
|
3983
3928
|
"class": "item-content"
|
|
3984
|
-
}, [this.i18n("ui.grid.filter.clear")])]),
|
|
3929
|
+
}, [this.i18n("ui.grid.filter.clear")])]), createVNode("li", {
|
|
3985
3930
|
"class": "tiny-grid__filter-option",
|
|
3986
|
-
"
|
|
3987
|
-
|
|
3988
|
-
}
|
|
3989
|
-
}, [h2("a", {
|
|
3931
|
+
"onClick": this.clearFilter
|
|
3932
|
+
}, [createVNode("a", {
|
|
3990
3933
|
"class": "item-content"
|
|
3991
3934
|
}, [this.i18n("ui.grid.filter.clearAll")])])]);
|
|
3992
3935
|
},
|
|
3993
3936
|
// 设置筛选条件为空和不为空
|
|
3994
3937
|
renderDefault: function renderDefault() {
|
|
3995
3938
|
var _this5 = this;
|
|
3996
|
-
var h2 = this.$createElement;
|
|
3997
3939
|
var condition2 = this.condition, filterStore = this.filterStore;
|
|
3998
3940
|
if (!filterStore.defaultFilter) {
|
|
3999
3941
|
return null;
|
|
4000
3942
|
}
|
|
4001
|
-
return
|
|
3943
|
+
return createVNode("ul", {
|
|
4002
3944
|
"class": "tiny-grid__filter-panel filter-panel__default"
|
|
4003
|
-
}, [
|
|
3945
|
+
}, [createVNode("li", {
|
|
4004
3946
|
"class": ["tiny-grid__filter-option", {
|
|
4005
3947
|
active: condition2.empty === true
|
|
4006
3948
|
}],
|
|
4007
|
-
"
|
|
4008
|
-
|
|
4009
|
-
_this5.filterNull(true);
|
|
4010
|
-
}
|
|
3949
|
+
"onClick": function onClick() {
|
|
3950
|
+
_this5.filterNull(true);
|
|
4011
3951
|
}
|
|
4012
|
-
}, [
|
|
3952
|
+
}, [createVNode("a", {
|
|
4013
3953
|
"class": "item-content"
|
|
4014
|
-
}, [this.i18n("ui.grid.filter.empty")])]),
|
|
3954
|
+
}, [this.i18n("ui.grid.filter.empty")])]), createVNode("li", {
|
|
4015
3955
|
"class": ["tiny-grid__filter-option", {
|
|
4016
3956
|
active: condition2.empty === false
|
|
4017
3957
|
}],
|
|
4018
|
-
"
|
|
4019
|
-
|
|
4020
|
-
_this5.filterNull(false);
|
|
4021
|
-
}
|
|
3958
|
+
"onClick": function onClick() {
|
|
3959
|
+
_this5.filterNull(false);
|
|
4022
3960
|
}
|
|
4023
|
-
}, [
|
|
3961
|
+
}, [createVNode("a", {
|
|
4024
3962
|
"class": "item-content"
|
|
4025
3963
|
}, [this.i18n("ui.grid.filter.unempty")])])]);
|
|
4026
3964
|
},
|
|
4027
3965
|
// 筛选扩展项
|
|
4028
3966
|
renderExtends: function renderExtends() {
|
|
4029
3967
|
var _this6 = this;
|
|
4030
|
-
var h2 = this.$createElement;
|
|
4031
3968
|
var filterStore = this.filterStore;
|
|
4032
3969
|
if (!filterStore.extends) {
|
|
4033
3970
|
return null;
|
|
4034
3971
|
}
|
|
4035
|
-
return
|
|
3972
|
+
return createVNode("ul", {
|
|
4036
3973
|
"class": "tiny-grid__filter-panel filter-panel__clear"
|
|
4037
3974
|
}, [filterStore.extends.map(function(item) {
|
|
4038
|
-
return
|
|
3975
|
+
return createVNode("li", {
|
|
4039
3976
|
"class": "tiny-grid__filter-option",
|
|
4040
|
-
"
|
|
4041
|
-
|
|
4042
|
-
_this6.filterExtends(item);
|
|
4043
|
-
}
|
|
3977
|
+
"onClick": function onClick() {
|
|
3978
|
+
_this6.filterExtends(item);
|
|
4044
3979
|
}
|
|
4045
|
-
}, [
|
|
3980
|
+
}, [createVNode("a", {
|
|
4046
3981
|
"class": "item-content"
|
|
4047
3982
|
}, [item.label])]);
|
|
4048
3983
|
})]);
|
|
4049
3984
|
},
|
|
4050
3985
|
// 输入筛选项
|
|
4051
3986
|
renderInput: function renderInput() {
|
|
4052
|
-
var
|
|
3987
|
+
var _slot, _slot2, _slot3;
|
|
4053
3988
|
this.correctRelations();
|
|
4054
3989
|
var condition2 = this.condition, filterStore = this.filterStore;
|
|
4055
3990
|
var inputFilter = filterStore.inputFilter;
|
|
@@ -4073,81 +4008,85 @@ var Panel$1 = defineComponent({
|
|
|
4073
4008
|
});
|
|
4074
4009
|
var inputProps = ret.inputProps;
|
|
4075
4010
|
InputComponent = ret.InputComponent;
|
|
4076
|
-
return
|
|
4011
|
+
return createVNode("ul", {
|
|
4077
4012
|
"class": "tiny-grid__filter-panel"
|
|
4078
|
-
}, [isAddbyProgram ? null :
|
|
4013
|
+
}, [isAddbyProgram ? null : createVNode("li", {
|
|
4079
4014
|
"class": "tiny-grid__filter-option filter-option__radios"
|
|
4080
4015
|
}, [inputRelations.map(function(_ref75) {
|
|
4081
4016
|
var label = _ref75.label, value = _ref75.value, method = _ref75.method;
|
|
4082
|
-
return
|
|
4083
|
-
"
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
condition2.method = method || function() {
|
|
4091
|
-
return true;
|
|
4092
|
-
};
|
|
4093
|
-
}
|
|
4017
|
+
return createVNode(Radio, {
|
|
4018
|
+
"modelValue": condition2.relation,
|
|
4019
|
+
"label": value,
|
|
4020
|
+
"onChange": function onChange(value2) {
|
|
4021
|
+
condition2.relation = value2;
|
|
4022
|
+
condition2.method = method || function() {
|
|
4023
|
+
return true;
|
|
4024
|
+
};
|
|
4094
4025
|
}
|
|
4095
|
-
},
|
|
4096
|
-
|
|
4026
|
+
}, _isSlot(label) ? label : {
|
|
4027
|
+
default: function _default25() {
|
|
4028
|
+
return [label];
|
|
4029
|
+
}
|
|
4030
|
+
});
|
|
4031
|
+
})]), createVNode("li", {
|
|
4097
4032
|
"class": "filter-option__input"
|
|
4098
|
-
}, [
|
|
4033
|
+
}, [h(InputComponent, inputProps)]), createVNode("li", {
|
|
4099
4034
|
"class": "tiny-grid__filter-option filter-option__btns"
|
|
4100
|
-
}, [
|
|
4101
|
-
"
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4035
|
+
}, [createVNode(Button, {
|
|
4036
|
+
"type": "primary",
|
|
4037
|
+
"onClick": this.filterInput
|
|
4038
|
+
}, _isSlot(_slot = this.i18n("ui.base.confirm")) ? _slot : {
|
|
4039
|
+
default: function _default25() {
|
|
4040
|
+
return [_slot];
|
|
4106
4041
|
}
|
|
4107
|
-
}
|
|
4108
|
-
"
|
|
4109
|
-
|
|
4042
|
+
}), createVNode(Button, {
|
|
4043
|
+
"onClick": this.resetInput
|
|
4044
|
+
}, _isSlot(_slot2 = this.i18n("ui.base.reset")) ? _slot2 : {
|
|
4045
|
+
default: function _default25() {
|
|
4046
|
+
return [_slot2];
|
|
4110
4047
|
}
|
|
4111
|
-
}
|
|
4112
|
-
"
|
|
4113
|
-
|
|
4048
|
+
}), createVNode(Button, {
|
|
4049
|
+
"onClick": this.close
|
|
4050
|
+
}, _isSlot(_slot3 = this.i18n("ui.base.cancel")) ? _slot3 : {
|
|
4051
|
+
default: function _default25() {
|
|
4052
|
+
return [_slot3];
|
|
4114
4053
|
}
|
|
4115
|
-
}
|
|
4054
|
+
})])]);
|
|
4116
4055
|
},
|
|
4117
4056
|
// 选择筛选项
|
|
4118
4057
|
renderEnumable: function renderEnumable() {
|
|
4119
|
-
var
|
|
4058
|
+
var _slot4, _slot5;
|
|
4120
4059
|
var filterStore = this.filterStore;
|
|
4121
4060
|
if (!filterStore.enumable) return null;
|
|
4122
|
-
return
|
|
4061
|
+
return createVNode("div", {
|
|
4123
4062
|
"class": "tiny-grid__filter-panel filter-panel__enum"
|
|
4124
|
-
}, [
|
|
4063
|
+
}, [createVNode("ul", {
|
|
4125
4064
|
"class": "tiny-grid__filter-options"
|
|
4126
4065
|
}, [renderEnumableOptions({
|
|
4127
4066
|
iconRender,
|
|
4128
4067
|
_vm: this,
|
|
4129
4068
|
filterStore
|
|
4130
|
-
})]), filterStore.multi ?
|
|
4069
|
+
})]), filterStore.multi ? createVNode("div", {
|
|
4131
4070
|
"class": "tiny-grid__filter-option filter-option__btns"
|
|
4132
|
-
}, [
|
|
4133
|
-
"
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4071
|
+
}, [createVNode(Button, {
|
|
4072
|
+
"type": "primary",
|
|
4073
|
+
"onClick": this.filterEnum
|
|
4074
|
+
}, _isSlot(_slot4 = this.i18n("ui.base.confirm")) ? _slot4 : {
|
|
4075
|
+
default: function _default25() {
|
|
4076
|
+
return [_slot4];
|
|
4138
4077
|
}
|
|
4139
|
-
}
|
|
4140
|
-
"
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4078
|
+
}), createVNode(Button, {
|
|
4079
|
+
"onClick": function onClick() {
|
|
4080
|
+
filterStore.visible = false;
|
|
4081
|
+
}
|
|
4082
|
+
}, _isSlot(_slot5 = this.i18n("ui.base.cancel")) ? _slot5 : {
|
|
4083
|
+
default: function _default25() {
|
|
4084
|
+
return [_slot5];
|
|
4144
4085
|
}
|
|
4145
|
-
}
|
|
4086
|
+
})]) : null]);
|
|
4146
4087
|
},
|
|
4147
4088
|
// 简化版筛选按钮对齐,对齐管理侧规范
|
|
4148
4089
|
renderSimple: function renderSimple() {
|
|
4149
|
-
var _this7 = this;
|
|
4150
|
-
var h2 = this.$createElement;
|
|
4151
4090
|
var filterStore = this.filterStore;
|
|
4152
4091
|
var simpleFilter = filterStore.simpleFilter;
|
|
4153
4092
|
if (!simpleFilter) {
|
|
@@ -4155,6 +4094,7 @@ var Panel$1 = defineComponent({
|
|
|
4155
4094
|
}
|
|
4156
4095
|
if (simpleFilter.isDatetime) {
|
|
4157
4096
|
var _simpleFilter$datetim, _simpleFilter$datetim2, _simpleFilter$datetim3, _simpleFilter$datetim4, _simpleFilter$datetim5, _simpleFilter$datetim6;
|
|
4097
|
+
var _slot6, _slot7;
|
|
4158
4098
|
var DatePickComponents = simpleFilter != null && (_simpleFilter$datetim = simpleFilter.datetimeConfig) != null && _simpleFilter$datetim.component ? hooks.toRaw(simpleFilter.datetimeConfig.component) : null;
|
|
4159
4099
|
var format = simpleFilter == null ? void 0 : (_simpleFilter$datetim2 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim2.format;
|
|
4160
4100
|
var valueFormat = simpleFilter == null ? void 0 : (_simpleFilter$datetim3 = simpleFilter.datetimeConfig) == null ? void 0 : _simpleFilter$datetim3.valueFormat;
|
|
@@ -4166,107 +4106,88 @@ var Panel$1 = defineComponent({
|
|
|
4166
4106
|
return time2.getTime() < min || time2.getTime() > max;
|
|
4167
4107
|
}
|
|
4168
4108
|
};
|
|
4169
|
-
return
|
|
4109
|
+
return createVNode("div", {
|
|
4170
4110
|
"class": "tiny-grid__filter-panel filter-panel__enum filter-panel__simple"
|
|
4171
|
-
}, [
|
|
4111
|
+
}, [createVNode("div", {
|
|
4172
4112
|
"class": "tiny-grid__filter-date-title"
|
|
4173
|
-
}, [this.i18n("ui.grid.filter.dateTips")]),
|
|
4113
|
+
}, [this.i18n("ui.grid.filter.dateTips")]), createVNode("ul", {
|
|
4174
4114
|
"class": "tiny-grid__filter-date"
|
|
4175
|
-
}, [
|
|
4115
|
+
}, [createVNode("li", {
|
|
4176
4116
|
"class": "tiny-grid__filter-date-item"
|
|
4177
|
-
}, [
|
|
4178
|
-
"
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
"picker-options": pickerOptions
|
|
4183
|
-
},
|
|
4117
|
+
}, [createVNode("span", null, [this.i18n("ui.grid.filter.startDate")]), createVNode(DatePickComponents, {
|
|
4118
|
+
"format": format,
|
|
4119
|
+
"type": type,
|
|
4120
|
+
"value-format": valueFormat,
|
|
4121
|
+
"picker-options": pickerOptions,
|
|
4184
4122
|
"class": "tiny-grid__filter-date-pick",
|
|
4185
|
-
"
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
filterStore.datetimeConfig.startDate = value;
|
|
4189
|
-
}
|
|
4123
|
+
"onChange": function onChange(value) {
|
|
4124
|
+
if (filterStore.datetimeConfig) {
|
|
4125
|
+
filterStore.datetimeConfig.startDate = value;
|
|
4190
4126
|
}
|
|
4191
4127
|
},
|
|
4192
|
-
"
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
_this7.$set(filterStore, "startDate", $$v);
|
|
4196
|
-
}
|
|
4128
|
+
"modelValue": filterStore.startDate,
|
|
4129
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
4130
|
+
return filterStore.startDate = $event;
|
|
4197
4131
|
}
|
|
4198
|
-
})]),
|
|
4132
|
+
}, null)]), createVNode("li", {
|
|
4199
4133
|
"class": "tiny-grid__filter-date-item"
|
|
4200
|
-
}, [
|
|
4201
|
-
"
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
"picker-options": pickerOptions
|
|
4206
|
-
},
|
|
4134
|
+
}, [createVNode("span", null, [this.i18n("ui.grid.filter.endDate")]), createVNode(DatePickComponents, {
|
|
4135
|
+
"format": format,
|
|
4136
|
+
"type": type,
|
|
4137
|
+
"value-format": valueFormat,
|
|
4138
|
+
"picker-options": pickerOptions,
|
|
4207
4139
|
"class": "tiny-grid__filter-date-pick",
|
|
4208
|
-
"
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
filterStore.datetimeConfig.endDate = value;
|
|
4212
|
-
}
|
|
4213
|
-
}
|
|
4140
|
+
"modelValue": filterStore.endDate,
|
|
4141
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
4142
|
+
return filterStore.endDate = $event;
|
|
4214
4143
|
},
|
|
4215
|
-
"
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
_this7.$set(filterStore, "endDate", $$v);
|
|
4144
|
+
"onChange": function onChange(value) {
|
|
4145
|
+
if (filterStore.datetimeConfig) {
|
|
4146
|
+
filterStore.datetimeConfig.endDate = value;
|
|
4219
4147
|
}
|
|
4220
4148
|
}
|
|
4221
|
-
})])]),
|
|
4149
|
+
}, null)])]), createVNode("div", {
|
|
4222
4150
|
"class": "tiny-grid__filter-option filter-option__btns filter-option__date-button"
|
|
4223
|
-
}, [
|
|
4224
|
-
"
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4151
|
+
}, [createVNode(Button, {
|
|
4152
|
+
"type": "primary",
|
|
4153
|
+
"onClick": this.filterDate
|
|
4154
|
+
}, _isSlot(_slot6 = this.i18n("ui.base.confirm")) ? _slot6 : {
|
|
4155
|
+
default: function _default25() {
|
|
4156
|
+
return [_slot6];
|
|
4229
4157
|
}
|
|
4230
|
-
}
|
|
4231
|
-
"
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4158
|
+
}), createVNode(Button, {
|
|
4159
|
+
"onClick": function onClick() {
|
|
4160
|
+
filterStore.visible = false;
|
|
4161
|
+
}
|
|
4162
|
+
}, _isSlot(_slot7 = this.i18n("ui.base.cancel")) ? _slot7 : {
|
|
4163
|
+
default: function _default25() {
|
|
4164
|
+
return [_slot7];
|
|
4235
4165
|
}
|
|
4236
|
-
}
|
|
4166
|
+
})])]);
|
|
4237
4167
|
} else {
|
|
4238
4168
|
var _simpleFilter$searchC;
|
|
4169
|
+
var _slot8, _slot9;
|
|
4239
4170
|
var IconSearch = iconSearch();
|
|
4240
4171
|
var InputComponents = simpleFilter != null && (_simpleFilter$searchC = simpleFilter.searchConfig) != null && _simpleFilter$searchC.component ? hooks.toRaw(simpleFilter.searchConfig.component) : null;
|
|
4241
|
-
return
|
|
4172
|
+
return createVNode("div", {
|
|
4242
4173
|
"class": "tiny-grid__filter-panel filter-panel__enum filter-panel__simple"
|
|
4243
|
-
}, [InputComponents ?
|
|
4244
|
-
"
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4174
|
+
}, [InputComponents ? createVNode(InputComponents, {
|
|
4175
|
+
"modelValue": filterStore.searchValue,
|
|
4176
|
+
"onUpdate:modelValue": function onUpdateModelValue($event) {
|
|
4177
|
+
return filterStore.searchValue = $event;
|
|
4178
|
+
},
|
|
4179
|
+
"onChange": function onChange(value) {
|
|
4180
|
+
if (filterStore.searchConfig) {
|
|
4181
|
+
filterStore.searchConfig.searchValue = value;
|
|
4249
4182
|
}
|
|
4250
4183
|
},
|
|
4251
4184
|
"class": "tiny-grid__filter-search",
|
|
4252
|
-
"
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
name: "slots",
|
|
4257
|
-
value: {
|
|
4258
|
-
suffix: function suffix() {
|
|
4259
|
-
return h2(IconSearch);
|
|
4260
|
-
}
|
|
4261
|
-
}
|
|
4262
|
-
}],
|
|
4263
|
-
"model": {
|
|
4264
|
-
value: filterStore.searchValue,
|
|
4265
|
-
callback: function callback($$v) {
|
|
4266
|
-
_this7.$set(filterStore, "searchValue", $$v);
|
|
4267
|
-
}
|
|
4185
|
+
"clearable": true
|
|
4186
|
+
}, {
|
|
4187
|
+
suffix: function suffix() {
|
|
4188
|
+
return createVNode(IconSearch, null, null);
|
|
4268
4189
|
}
|
|
4269
|
-
}) : null,
|
|
4190
|
+
}) : null, createVNode("ul", {
|
|
4270
4191
|
"class": "tiny-grid__filter-options"
|
|
4271
4192
|
}, [renderEnumableOptions({
|
|
4272
4193
|
iconRender,
|
|
@@ -4274,22 +4195,24 @@ var Panel$1 = defineComponent({
|
|
|
4274
4195
|
filterStore,
|
|
4275
4196
|
selectAll: simpleFilter.selectAll,
|
|
4276
4197
|
searchable: Boolean(InputComponents)
|
|
4277
|
-
})]), filterStore.multi ?
|
|
4198
|
+
})]), filterStore.multi ? createVNode("div", {
|
|
4278
4199
|
"class": "tiny-grid__filter-option filter-option__btns"
|
|
4279
|
-
}, [
|
|
4280
|
-
"
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4200
|
+
}, [createVNode(Button, {
|
|
4201
|
+
"type": "primary",
|
|
4202
|
+
"onClick": this.filterEnum
|
|
4203
|
+
}, _isSlot(_slot8 = this.i18n("ui.base.confirm")) ? _slot8 : {
|
|
4204
|
+
default: function _default25() {
|
|
4205
|
+
return [_slot8];
|
|
4285
4206
|
}
|
|
4286
|
-
}
|
|
4287
|
-
"
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4207
|
+
}), createVNode(Button, {
|
|
4208
|
+
"onClick": function onClick() {
|
|
4209
|
+
filterStore.visible = false;
|
|
4210
|
+
}
|
|
4211
|
+
}, _isSlot(_slot9 = this.i18n("ui.base.cancel")) ? _slot9 : {
|
|
4212
|
+
default: function _default25() {
|
|
4213
|
+
return [_slot9];
|
|
4291
4214
|
}
|
|
4292
|
-
}
|
|
4215
|
+
})]) : null]);
|
|
4293
4216
|
}
|
|
4294
4217
|
},
|
|
4295
4218
|
renderSlot: function renderSlot(h2) {
|
|
@@ -4846,7 +4769,7 @@ var Methods$f = {
|
|
|
4846
4769
|
},
|
|
4847
4770
|
// 确认筛选
|
|
4848
4771
|
confirmFilterEvent: function confirmFilterEvent() {
|
|
4849
|
-
var
|
|
4772
|
+
var _this7 = this;
|
|
4850
4773
|
var visibleColumn = this.visibleColumn, filterStore = this.filterStore, scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, remoteFilter = this.remoteFilter, lastScrollLeft = this.lastScrollLeft;
|
|
4851
4774
|
filterStore.visible = false;
|
|
4852
4775
|
if (!remoteFilter) {
|
|
@@ -4864,7 +4787,7 @@ var Methods$f = {
|
|
|
4864
4787
|
}]);
|
|
4865
4788
|
this.updateFooter();
|
|
4866
4789
|
var restoreScrollLeft = function restoreScrollLeft2() {
|
|
4867
|
-
return
|
|
4790
|
+
return _this7.scrollTo(lastScrollLeft);
|
|
4868
4791
|
};
|
|
4869
4792
|
if (scrollXLoad || scrollYLoad) {
|
|
4870
4793
|
scrollXLoad && this.clearScroll();
|
|
@@ -4975,11 +4898,11 @@ var Children = defineComponent({
|
|
|
4975
4898
|
},
|
|
4976
4899
|
watch: {
|
|
4977
4900
|
show: function show(value) {
|
|
4978
|
-
var
|
|
4901
|
+
var _this8 = this;
|
|
4979
4902
|
if (value) {
|
|
4980
4903
|
this.$el.style.top = "0px";
|
|
4981
4904
|
this.$nextTick(function() {
|
|
4982
|
-
var tableInstance =
|
|
4905
|
+
var tableInstance = _this8.tableInstance, $el = _this8.$el;
|
|
4983
4906
|
var _$el$getBoundingClien = $el.getBoundingClientRect(), width = _$el$getBoundingClien.width, height2 = _$el$getBoundingClien.height, bottom = _$el$getBoundingClien.bottom;
|
|
4984
4907
|
var _getDomNode = getDomNode(), visibleHeight = _getDomNode.visibleHeight, visibleWidth = _getDomNode.visibleWidth;
|
|
4985
4908
|
var ctxElem = tableInstance.$refs.ctxWrapper.$el;
|
|
@@ -5126,7 +5049,7 @@ var Methods$e = {
|
|
|
5126
5049
|
},
|
|
5127
5050
|
// 处理菜单的移动
|
|
5128
5051
|
moveCtxMenu: function moveCtxMenu(_ref86) {
|
|
5129
|
-
var
|
|
5052
|
+
var _this9 = this;
|
|
5130
5053
|
var event = _ref86.event, keyCode = _ref86.keyCode, ctxMenuStore = _ref86.ctxMenuStore, property = _ref86.property, operKey = _ref86.operKey, operRest = _ref86.operRest, menuList = _ref86.menuList;
|
|
5131
5054
|
var selectIndex = findIndexOf(menuList, function(item) {
|
|
5132
5055
|
return ctxMenuStore[property] === item;
|
|
@@ -5168,7 +5091,7 @@ var Methods$e = {
|
|
|
5168
5091
|
return ctxMenuStore[property] && (keyCode === 13 || keyCode === 32);
|
|
5169
5092
|
},
|
|
5170
5093
|
action: function action() {
|
|
5171
|
-
|
|
5094
|
+
_this9.ctxMenuLinkEvent(event, ctxMenuStore[property]);
|
|
5172
5095
|
}
|
|
5173
5096
|
}];
|
|
5174
5097
|
for (var i = 0; i < ruleChains.length; i++) {
|
|
@@ -5240,7 +5163,7 @@ var Methods$e = {
|
|
|
5240
5163
|
},
|
|
5241
5164
|
// 显示快捷菜单
|
|
5242
5165
|
openContextMenu: function openContextMenu(event, type, params) {
|
|
5243
|
-
var
|
|
5166
|
+
var _this10 = this;
|
|
5244
5167
|
var ctxMenuOpts2 = this.ctxMenuOpts, ctxMenuStore = this.ctxMenuStore;
|
|
5245
5168
|
var visibleMethod = ctxMenuOpts2.visibleMethod;
|
|
5246
5169
|
var config2 = ctxMenuOpts2[type];
|
|
@@ -5261,7 +5184,7 @@ var Methods$e = {
|
|
|
5261
5184
|
params.options = options;
|
|
5262
5185
|
var end = function end2() {
|
|
5263
5186
|
if (visibleMethod && !visibleMethod(params, event)) {
|
|
5264
|
-
|
|
5187
|
+
_this10.closeMenu();
|
|
5265
5188
|
return;
|
|
5266
5189
|
}
|
|
5267
5190
|
event.preventDefault();
|
|
@@ -5283,14 +5206,14 @@ var Methods$e = {
|
|
|
5283
5206
|
visible: true
|
|
5284
5207
|
});
|
|
5285
5208
|
var next = function next2() {
|
|
5286
|
-
var ctxElem =
|
|
5209
|
+
var ctxElem = _this10.$refs.ctxWrapper.$el;
|
|
5287
5210
|
var clientWidth = ctxElem.clientWidth, clientHeight = ctxElem.clientHeight;
|
|
5288
5211
|
var offsetLeft = clientX + clientWidth - visibleWidth;
|
|
5289
5212
|
var offsetTop = clientY + clientHeight - visibleHeight;
|
|
5290
5213
|
offsetLeft > -10 && (ctxMenuStore.style.left = left - clientWidth + "px");
|
|
5291
5214
|
offsetTop > -10 && (ctxMenuStore.style.top = top - clientHeight + "px");
|
|
5292
5215
|
};
|
|
5293
|
-
|
|
5216
|
+
_this10.$nextTick(next);
|
|
5294
5217
|
};
|
|
5295
5218
|
this.preventEvent(event, "event.show_menu", params, null, end);
|
|
5296
5219
|
this.closeFilter();
|
|
@@ -5576,19 +5499,19 @@ function getColumnRuleTypeOther(_ref100) {
|
|
|
5576
5499
|
var isCheckStrictly = function isCheckStrictly2(selectConfig) {
|
|
5577
5500
|
return selectConfig && selectConfig.checkStrictly && !selectConfig.showHeader || selectConfig && !selectConfig.checkStrictly && selectConfig.showHeader === false;
|
|
5578
5501
|
};
|
|
5579
|
-
var runRender = function runRender2(
|
|
5502
|
+
var runRender = function runRender2(render18) {
|
|
5580
5503
|
var vnode;
|
|
5581
5504
|
try {
|
|
5582
5505
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
5583
5506
|
params[_key - 1] = arguments[_key];
|
|
5584
5507
|
}
|
|
5585
|
-
vnode =
|
|
5508
|
+
vnode = render18.apply(void 0, params);
|
|
5586
5509
|
} catch (e) {
|
|
5587
5510
|
warn("ui.grid.error.renderParamError");
|
|
5588
5511
|
} finally {
|
|
5589
5512
|
if (!vnode || !isVnode(vnode)) {
|
|
5590
5513
|
try {
|
|
5591
|
-
vnode = hooks.h(
|
|
5514
|
+
vnode = hooks.h(render18);
|
|
5592
5515
|
} catch (e) {
|
|
5593
5516
|
vnode = null;
|
|
5594
5517
|
warn("ui.grid.error.classComponentError");
|
|
@@ -6201,10 +6124,10 @@ var Cell = {
|
|
|
6201
6124
|
if (slots && slots.default) {
|
|
6202
6125
|
return slots.default(params, h2);
|
|
6203
6126
|
}
|
|
6204
|
-
var _operationConfig$butt = operationConfig.buttons, buttons = _operationConfig$butt === void 0 ? [] : _operationConfig$butt,
|
|
6127
|
+
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;
|
|
6205
6128
|
var viewClass = $table.viewCls("operButton");
|
|
6206
|
-
if (
|
|
6207
|
-
return
|
|
6129
|
+
if (render18) {
|
|
6130
|
+
return render18({
|
|
6208
6131
|
h: h2,
|
|
6209
6132
|
buttons,
|
|
6210
6133
|
params
|
|
@@ -7374,7 +7297,7 @@ function onGlobalKeydown(event, _vm) {
|
|
|
7374
7297
|
}
|
|
7375
7298
|
}
|
|
7376
7299
|
function handleGlobalMousedownEvent(event) {
|
|
7377
|
-
var
|
|
7300
|
+
var _this11 = this;
|
|
7378
7301
|
var $el = this.$el, ctxMenuStore = this.ctxMenuStore, _this$editConfig = this.editConfig, editConfig = _this$editConfig === void 0 ? {} : _this$editConfig, filterStore = this.filterStore;
|
|
7379
7302
|
var _this$$refs = this.$refs, filterWrapper = _this$$refs.filterWrapper, validTip = _this$$refs.validTip;
|
|
7380
7303
|
var actived = this.editStore.actived;
|
|
@@ -7397,10 +7320,10 @@ function handleGlobalMousedownEvent(event) {
|
|
|
7397
7320
|
else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) {
|
|
7398
7321
|
this.preventEvent(event, "event.clear_actived", actived.args, function() {
|
|
7399
7322
|
var isClear;
|
|
7400
|
-
var isReadonlyCol = !
|
|
7323
|
+
var isReadonlyCol = !_this11.getEventTargetNode(event, $el, "col__edit").flag;
|
|
7401
7324
|
isClear = handleGlobalIsClear({
|
|
7402
7325
|
$el,
|
|
7403
|
-
_vm:
|
|
7326
|
+
_vm: _this11,
|
|
7404
7327
|
actived,
|
|
7405
7328
|
editConfig,
|
|
7406
7329
|
event,
|
|
@@ -7409,7 +7332,7 @@ function handleGlobalMousedownEvent(event) {
|
|
|
7409
7332
|
});
|
|
7410
7333
|
handleGlobalClearActived({
|
|
7411
7334
|
$el,
|
|
7412
|
-
_vm:
|
|
7335
|
+
_vm: _this11,
|
|
7413
7336
|
event,
|
|
7414
7337
|
isClear
|
|
7415
7338
|
});
|
|
@@ -7435,7 +7358,7 @@ function handleGlobalMousewheelEvent(event) {
|
|
|
7435
7358
|
this.closeMenu();
|
|
7436
7359
|
}
|
|
7437
7360
|
function handleEscKeyDown(_ref163) {
|
|
7438
|
-
var
|
|
7361
|
+
var _this12 = this;
|
|
7439
7362
|
var event = _ref163.event, actived = _ref163.actived, mouseConfig = _ref163.mouseConfig;
|
|
7440
7363
|
this.closeMenu();
|
|
7441
7364
|
this.closeFilter();
|
|
@@ -7443,13 +7366,13 @@ function handleEscKeyDown(_ref163) {
|
|
|
7443
7366
|
this.clearActived(event);
|
|
7444
7367
|
if (mouseConfig.selected) {
|
|
7445
7368
|
this.$nextTick(function() {
|
|
7446
|
-
return
|
|
7369
|
+
return _this12.handleSelected(actived.args, event);
|
|
7447
7370
|
});
|
|
7448
7371
|
}
|
|
7449
7372
|
}
|
|
7450
7373
|
}
|
|
7451
7374
|
function handleEnterKeyDown(_ref164) {
|
|
7452
|
-
var
|
|
7375
|
+
var _this13 = this;
|
|
7453
7376
|
var event = _ref164.event, selected = _ref164.selected, actived = _ref164.actived;
|
|
7454
7377
|
var highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow, treeConfig = this.treeConfig;
|
|
7455
7378
|
var isLeftArrow = event.keyCode === 37;
|
|
@@ -7470,10 +7393,10 @@ function handleEnterKeyDown(_ref164) {
|
|
|
7470
7393
|
event.preventDefault();
|
|
7471
7394
|
var targetRow = children[0];
|
|
7472
7395
|
this.setTreeExpansion(currentRow, true).then(function() {
|
|
7473
|
-
return
|
|
7396
|
+
return _this13.scrollToRow(targetRow);
|
|
7474
7397
|
}).then(function() {
|
|
7475
|
-
return
|
|
7476
|
-
$table:
|
|
7398
|
+
return _this13.triggerCurrentRowEvent(event, {
|
|
7399
|
+
$table: _this13,
|
|
7477
7400
|
row: targetRow
|
|
7478
7401
|
});
|
|
7479
7402
|
});
|
|
@@ -7527,7 +7450,7 @@ function handleArrowKeyDown(_ref166) {
|
|
|
7527
7450
|
}
|
|
7528
7451
|
}
|
|
7529
7452
|
function handleDelKeyDown(_ref167) {
|
|
7530
|
-
var
|
|
7453
|
+
var _this14 = this;
|
|
7531
7454
|
var event = _ref167.event, selected = _ref167.selected;
|
|
7532
7455
|
var _this$keyboardConfig = this.keyboardConfig, keyboardConfig = _this$keyboardConfig === void 0 ? {} : _this$keyboardConfig, treeConfig = this.treeConfig, highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow;
|
|
7533
7456
|
var isBack = event.keyCode === 8;
|
|
@@ -7543,10 +7466,10 @@ function handleDelKeyDown(_ref167) {
|
|
|
7543
7466
|
if (parentRow) {
|
|
7544
7467
|
event.preventDefault();
|
|
7545
7468
|
this.setTreeExpansion(parentRow, false).then(function() {
|
|
7546
|
-
return
|
|
7469
|
+
return _this14.scrollToRow(parentRow);
|
|
7547
7470
|
}).then(function() {
|
|
7548
|
-
return
|
|
7549
|
-
$table:
|
|
7471
|
+
return _this14.triggerCurrentRowEvent(event, {
|
|
7472
|
+
$table: _this14,
|
|
7550
7473
|
row: parentRow
|
|
7551
7474
|
});
|
|
7552
7475
|
});
|
|
@@ -7599,11 +7522,11 @@ function handleOtherKeyDown(_ref172) {
|
|
|
7599
7522
|
}
|
|
7600
7523
|
}
|
|
7601
7524
|
function handleGlobalKeydownEvent(event) {
|
|
7602
|
-
var
|
|
7525
|
+
var _this15 = this;
|
|
7603
7526
|
this.preventEvent(event, "event.keydown", {
|
|
7604
7527
|
$table: this
|
|
7605
7528
|
}, function() {
|
|
7606
|
-
onGlobalKeydown(event,
|
|
7529
|
+
onGlobalKeydown(event, _this15);
|
|
7607
7530
|
});
|
|
7608
7531
|
}
|
|
7609
7532
|
function handleGlobalResizeEvent() {
|
|
@@ -7713,10 +7636,10 @@ var Methods$d = {
|
|
|
7713
7636
|
return this.clearActived();
|
|
7714
7637
|
},
|
|
7715
7638
|
refreshData: function refreshData(data8) {
|
|
7716
|
-
var
|
|
7639
|
+
var _this16 = this;
|
|
7717
7640
|
var next = function next2() {
|
|
7718
|
-
|
|
7719
|
-
return
|
|
7641
|
+
_this16.tableData = [];
|
|
7642
|
+
return _this16.loadTableData(data8 || _this16.tableFullData);
|
|
7720
7643
|
};
|
|
7721
7644
|
return this.$nextTick().then(next);
|
|
7722
7645
|
},
|
|
@@ -7735,11 +7658,11 @@ var Methods$d = {
|
|
|
7735
7658
|
return this.$nextTick();
|
|
7736
7659
|
},
|
|
7737
7660
|
updateData: function updateData() {
|
|
7738
|
-
var
|
|
7661
|
+
var _this17 = this;
|
|
7739
7662
|
return this.handleTableData(true).then(function() {
|
|
7740
|
-
return
|
|
7663
|
+
return _this17.updateFooter();
|
|
7741
7664
|
}).then(function() {
|
|
7742
|
-
return
|
|
7665
|
+
return _this17.recalculate();
|
|
7743
7666
|
});
|
|
7744
7667
|
},
|
|
7745
7668
|
// 处理表格数据(过滤,排序,虚拟滚动需要渲染数据的条数)
|
|
@@ -7751,7 +7674,7 @@ var Methods$d = {
|
|
|
7751
7674
|
},
|
|
7752
7675
|
// 全量加载表格数据
|
|
7753
7676
|
loadTableData: function loadTableData(datas, notRefresh) {
|
|
7754
|
-
var
|
|
7677
|
+
var _this18 = this;
|
|
7755
7678
|
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;
|
|
7756
7679
|
var _$grid$fetchOption = $grid.fetchOption, fetchOption = _$grid$fetchOption === void 0 ? {} : _$grid$fetchOption;
|
|
7757
7680
|
var _fetchOption$isReload2 = fetchOption.isReloadScroll, isReloadScroll = _fetchOption$isReload2 === void 0 ? false : _fetchOption$isReload2;
|
|
@@ -7780,11 +7703,11 @@ var Methods$d = {
|
|
|
7780
7703
|
this.handleTableData(true);
|
|
7781
7704
|
run(["reserveCheckSelection", "checkSelectionStatus"], this);
|
|
7782
7705
|
var first = function first2() {
|
|
7783
|
-
return !notRefresh &&
|
|
7706
|
+
return !notRefresh && _this18.recalculate();
|
|
7784
7707
|
};
|
|
7785
7708
|
var second = function second2() {
|
|
7786
7709
|
if (lastScrollLeft || lastScrollTop) {
|
|
7787
|
-
return
|
|
7710
|
+
return _this18.attemptRestoreScoll({
|
|
7788
7711
|
lastScrollLeft,
|
|
7789
7712
|
lastScrollTop
|
|
7790
7713
|
});
|
|
@@ -7797,18 +7720,18 @@ var Methods$d = {
|
|
|
7797
7720
|
},
|
|
7798
7721
|
// 重新加载数据
|
|
7799
7722
|
reloadData: function reloadData(datas) {
|
|
7800
|
-
var
|
|
7723
|
+
var _this19 = this;
|
|
7801
7724
|
return this.clearAll().then(function() {
|
|
7802
|
-
return
|
|
7725
|
+
return _this19.loadTableData(datas);
|
|
7803
7726
|
}).then(function() {
|
|
7804
|
-
return
|
|
7727
|
+
return _this19.handleDefault();
|
|
7805
7728
|
});
|
|
7806
7729
|
},
|
|
7807
7730
|
// 加载全量数据
|
|
7808
7731
|
loadData: function loadData(datas) {
|
|
7809
|
-
var
|
|
7732
|
+
var _this20 = this;
|
|
7810
7733
|
return new Promise(function(resolve) {
|
|
7811
|
-
|
|
7734
|
+
_this20.loadTableData(datas);
|
|
7812
7735
|
resolve();
|
|
7813
7736
|
});
|
|
7814
7737
|
},
|
|
@@ -7835,29 +7758,29 @@ var Methods$d = {
|
|
|
7835
7758
|
},
|
|
7836
7759
|
// 从新加载列配置
|
|
7837
7760
|
reloadColumn: function reloadColumn(columns2) {
|
|
7838
|
-
var
|
|
7761
|
+
var _this21 = this;
|
|
7839
7762
|
return this.clearAll().then(function() {
|
|
7840
|
-
return
|
|
7763
|
+
return _this21.loadColumn(columns2);
|
|
7841
7764
|
});
|
|
7842
7765
|
},
|
|
7843
7766
|
loadColumn: function loadColumn(columns2) {
|
|
7844
|
-
var
|
|
7767
|
+
var _this22 = this;
|
|
7845
7768
|
return new Promise(function(resolve) {
|
|
7846
|
-
|
|
7847
|
-
return Cell.createColumn(
|
|
7769
|
+
_this22.collectColumn = mapTree(columns2, function(column) {
|
|
7770
|
+
return Cell.createColumn(_this22, column);
|
|
7848
7771
|
}, headerProps);
|
|
7849
7772
|
resolve();
|
|
7850
7773
|
}).then(function() {
|
|
7851
|
-
return
|
|
7774
|
+
return _this22.$nextTick();
|
|
7852
7775
|
});
|
|
7853
7776
|
},
|
|
7854
7777
|
// 更新数据的 Map
|
|
7855
7778
|
updateCache: function updateCache(source) {
|
|
7856
|
-
var
|
|
7779
|
+
var _this23 = this;
|
|
7857
7780
|
var fullAllDataRowIdData = this.fullAllDataRowIdData, fullAllDataRowMap = this.fullAllDataRowMap, fullDataRowIdData = this.fullDataRowIdData, fullDataRowMap = this.fullDataRowMap, tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
7858
7781
|
var rowKey = getTableRowKey(this);
|
|
7859
7782
|
var buildRowCache = function buildRowCache2(row2, index2) {
|
|
7860
|
-
var rowId = getRowid(
|
|
7783
|
+
var rowId = getRowid(_this23, row2);
|
|
7861
7784
|
if (isNull(rowId) || rowId === "") {
|
|
7862
7785
|
rowId = getRowUniqueId();
|
|
7863
7786
|
set(row2, rowKey, rowId);
|
|
@@ -7876,11 +7799,11 @@ var Methods$d = {
|
|
|
7876
7799
|
};
|
|
7877
7800
|
var clearCache = function clearCache2() {
|
|
7878
7801
|
fullAllDataRowIdData = {};
|
|
7879
|
-
|
|
7802
|
+
_this23.fullAllDataRowIdData = fullAllDataRowIdData;
|
|
7880
7803
|
fullAllDataRowMap.clear();
|
|
7881
7804
|
if (source) {
|
|
7882
7805
|
fullDataRowIdData = {};
|
|
7883
|
-
|
|
7806
|
+
_this23.fullDataRowIdData = fullDataRowIdData;
|
|
7884
7807
|
fullDataRowMap.clear();
|
|
7885
7808
|
}
|
|
7886
7809
|
};
|
|
@@ -7909,7 +7832,7 @@ var Methods$d = {
|
|
|
7909
7832
|
},
|
|
7910
7833
|
// 通过tr的dom元素获取行数据等相关信息
|
|
7911
7834
|
getRowNode: function getRowNode(tr) {
|
|
7912
|
-
var
|
|
7835
|
+
var _this24 = this;
|
|
7913
7836
|
if (!tr) {
|
|
7914
7837
|
return null;
|
|
7915
7838
|
}
|
|
@@ -7917,7 +7840,7 @@ var Methods$d = {
|
|
|
7917
7840
|
var dataRowid = tr.getAttribute("data-rowid");
|
|
7918
7841
|
if (treeConfig) {
|
|
7919
7842
|
var matches = findTree$1(tableFullData, function(row2) {
|
|
7920
|
-
return getRowid(
|
|
7843
|
+
return getRowid(_this24, row2) === dataRowid;
|
|
7921
7844
|
}, treeConfig);
|
|
7922
7845
|
if (matches) {
|
|
7923
7846
|
return matches;
|
|
@@ -7992,20 +7915,20 @@ var Methods$d = {
|
|
|
7992
7915
|
return row2;
|
|
7993
7916
|
},
|
|
7994
7917
|
isTemporaryRow: function isTemporaryRow(row2) {
|
|
7995
|
-
var
|
|
7918
|
+
var _this25 = this;
|
|
7996
7919
|
var rowid2 = getRowid(this, row2);
|
|
7997
7920
|
return find(this.temporaryRows, function(r) {
|
|
7998
|
-
return rowid2 === getRowid(
|
|
7921
|
+
return rowid2 === getRowid(_this25, r);
|
|
7999
7922
|
});
|
|
8000
7923
|
},
|
|
8001
7924
|
createData: function createData(records, copy) {
|
|
8002
|
-
var
|
|
7925
|
+
var _this26 = this;
|
|
8003
7926
|
var isArr = isArray(records);
|
|
8004
7927
|
if (!isArr) {
|
|
8005
7928
|
records = [records];
|
|
8006
7929
|
}
|
|
8007
7930
|
var tmp = records.map(function(record) {
|
|
8008
|
-
return
|
|
7931
|
+
return _this26.defineField(record, copy);
|
|
8009
7932
|
});
|
|
8010
7933
|
return new Promise(function(resolve) {
|
|
8011
7934
|
resolve(isArr ? tmp : tmp[0]);
|
|
@@ -8022,13 +7945,13 @@ var Methods$d = {
|
|
|
8022
7945
|
* 如果还额外传了field,则清空指定单元格内容;
|
|
8023
7946
|
*/
|
|
8024
7947
|
clearData: function clearData(rows, field) {
|
|
8025
|
-
var
|
|
7948
|
+
var _this27 = this;
|
|
8026
7949
|
rows = !arguments.length ? this.tableFullData : rows && !isArray(rows) ? [rows] : rows;
|
|
8027
7950
|
rows.forEach(function(row2) {
|
|
8028
7951
|
if (field) {
|
|
8029
7952
|
set(row2, field, null);
|
|
8030
7953
|
} else {
|
|
8031
|
-
|
|
7954
|
+
_this27.visibleColumn.forEach(function(column) {
|
|
8032
7955
|
column.property && setCellValue(row2, column, null);
|
|
8033
7956
|
});
|
|
8034
7957
|
}
|
|
@@ -8061,7 +7984,7 @@ var Methods$d = {
|
|
|
8061
7984
|
return result;
|
|
8062
7985
|
},
|
|
8063
7986
|
hasRowChange: function hasRowChange(row2, field) {
|
|
8064
|
-
var _editConfig$insertCha,
|
|
7987
|
+
var _editConfig$insertCha, _this28 = this;
|
|
8065
7988
|
var tableSourceData = this.tableSourceData, treeConfig = this.treeConfig, visibleColumn = this.visibleColumn, backupMap = this.backupMap, editConfig = this.editConfig;
|
|
8066
7989
|
var insertChanged = (_editConfig$insertCha = editConfig == null ? void 0 : editConfig.insertChanged) != null ? _editConfig$insertCha : false;
|
|
8067
7990
|
var argsLength = arguments.length;
|
|
@@ -8081,7 +8004,7 @@ var Methods$d = {
|
|
|
8081
8004
|
}
|
|
8082
8005
|
} else {
|
|
8083
8006
|
originRow = find(tableSourceData, function(item) {
|
|
8084
|
-
return rowId === getRowid(
|
|
8007
|
+
return rowId === getRowid(_this28, item);
|
|
8085
8008
|
});
|
|
8086
8009
|
}
|
|
8087
8010
|
if (originRow) {
|
|
@@ -8168,7 +8091,7 @@ var Methods$d = {
|
|
|
8168
8091
|
},
|
|
8169
8092
|
// 对数据进行筛选和排序,获取处理后数据。服务端筛选和排序,在接口调用时已传入参数
|
|
8170
8093
|
updateAfterFullData: function updateAfterFullData() {
|
|
8171
|
-
var
|
|
8094
|
+
var _this29 = this;
|
|
8172
8095
|
var remoteFilter = this.remoteFilter, remoteSort = this.remoteSort, tableFullData = this.tableFullData, visibleColumn = this.visibleColumn, sortOpts2 = this.sortOpts;
|
|
8173
8096
|
var tableData = tableFullData;
|
|
8174
8097
|
var sortColumn = find(visibleColumn, function(column) {
|
|
@@ -8181,13 +8104,13 @@ var Methods$d = {
|
|
|
8181
8104
|
var doTableSort = function doTableSort2() {
|
|
8182
8105
|
var order = sortColumn.order, property = sortColumn.property;
|
|
8183
8106
|
var params = {
|
|
8184
|
-
$table:
|
|
8107
|
+
$table: _this29,
|
|
8185
8108
|
column: sortColumn,
|
|
8186
8109
|
data: tableData,
|
|
8187
8110
|
order,
|
|
8188
8111
|
property
|
|
8189
8112
|
};
|
|
8190
|
-
tableData =
|
|
8113
|
+
tableData = _this29.sortMethod(params) || tableData;
|
|
8191
8114
|
};
|
|
8192
8115
|
var doColumnSort = function doColumnSort2() {
|
|
8193
8116
|
var sortedFlag = false;
|
|
@@ -8197,7 +8120,7 @@ var Methods$d = {
|
|
|
8197
8120
|
return !!order;
|
|
8198
8121
|
});
|
|
8199
8122
|
if (sortColumns.length > 1) {
|
|
8200
|
-
tableData = sortMultiple(tableData, sortColumns,
|
|
8123
|
+
tableData = sortMultiple(tableData, sortColumns, _this29);
|
|
8201
8124
|
sortedFlag = true;
|
|
8202
8125
|
}
|
|
8203
8126
|
}
|
|
@@ -8209,7 +8132,7 @@ var Methods$d = {
|
|
|
8209
8132
|
};
|
|
8210
8133
|
tableData = tableData.filter(function(row2) {
|
|
8211
8134
|
return filterColumn.every(function(column) {
|
|
8212
|
-
return remoteFilter ? true :
|
|
8135
|
+
return remoteFilter ? true : _this29.handleLocalFilter(row2, column);
|
|
8213
8136
|
});
|
|
8214
8137
|
});
|
|
8215
8138
|
if (sortColumn && sortColumn.order) {
|
|
@@ -8238,7 +8161,7 @@ var Methods$d = {
|
|
|
8238
8161
|
};
|
|
8239
8162
|
},
|
|
8240
8163
|
handleDefault: function handleDefault() {
|
|
8241
|
-
var
|
|
8164
|
+
var _this30 = this;
|
|
8242
8165
|
this.handleAsyncColumn(this.tableData);
|
|
8243
8166
|
this.selectConfig && this.handleSelectionDefChecked();
|
|
8244
8167
|
this.radioConfig && this.handleRadioDefChecked();
|
|
@@ -8246,7 +8169,7 @@ var Methods$d = {
|
|
|
8246
8169
|
this.treeConfig && this.handleDefaultTreeExpand();
|
|
8247
8170
|
this.updateFooter();
|
|
8248
8171
|
this.$nextTick(function() {
|
|
8249
|
-
return setTimeout(
|
|
8172
|
+
return setTimeout(_this30.recalculate);
|
|
8250
8173
|
});
|
|
8251
8174
|
},
|
|
8252
8175
|
// 动态列处理
|
|
@@ -8325,16 +8248,16 @@ var Methods$d = {
|
|
|
8325
8248
|
},
|
|
8326
8249
|
// 初始化加载动态列:customColumns 列信息,sort 是否按顺序加载
|
|
8327
8250
|
reloadCustoms: function reloadCustoms(customColumns, sort2, colWidth) {
|
|
8328
|
-
var
|
|
8251
|
+
var _this31 = this;
|
|
8329
8252
|
var first = function first2() {
|
|
8330
|
-
|
|
8253
|
+
_this31.mergeCustomColumn(customColumns, sort2, colWidth);
|
|
8331
8254
|
};
|
|
8332
8255
|
var second = function second2() {
|
|
8333
|
-
|
|
8256
|
+
_this31.handleTableData(true);
|
|
8334
8257
|
};
|
|
8335
8258
|
var third = function third2() {
|
|
8336
|
-
return
|
|
8337
|
-
return
|
|
8259
|
+
return _this31.refreshColumn().then(function() {
|
|
8260
|
+
return _this31.tableFullColumn.slice(0);
|
|
8338
8261
|
});
|
|
8339
8262
|
};
|
|
8340
8263
|
return this.$nextTick().then(first).then(second).then(third);
|
|
@@ -8377,7 +8300,7 @@ var Methods$d = {
|
|
|
8377
8300
|
* 如果使用了分组表头,固定列必须在左侧或者右侧
|
|
8378
8301
|
*/
|
|
8379
8302
|
refreshColumn: function refreshColumn() {
|
|
8380
|
-
var
|
|
8303
|
+
var _this32 = this;
|
|
8381
8304
|
var leftList = [], centerList = [], rightList = [];
|
|
8382
8305
|
var letIndex = 0, leftStartIndex = null, rightEndIndex = null, isColspan = void 0;
|
|
8383
8306
|
var columnStore = this.columnStore, isGroup2 = this.isGroup;
|
|
@@ -8445,12 +8368,12 @@ var Methods$d = {
|
|
|
8445
8368
|
this.visibleColumnChanged = true;
|
|
8446
8369
|
this.columnAnchor && this.$grid.buildColumnAnchorParams();
|
|
8447
8370
|
return this.$nextTick().then(function() {
|
|
8448
|
-
|
|
8449
|
-
|
|
8371
|
+
_this32.updateFooter();
|
|
8372
|
+
_this32.recalculate();
|
|
8450
8373
|
}).then(function() {
|
|
8451
|
-
|
|
8452
|
-
if (
|
|
8453
|
-
|
|
8374
|
+
_this32.$emit("after-refresh-column");
|
|
8375
|
+
if (_this32.isColumnReady) {
|
|
8376
|
+
_this32.attemptRestoreScoll();
|
|
8454
8377
|
}
|
|
8455
8378
|
});
|
|
8456
8379
|
},
|
|
@@ -8529,7 +8452,7 @@ var Methods$d = {
|
|
|
8529
8452
|
* 支持(width=?、width=?px、width=?%、min-width=?、min-width=?px、min-width=?%)
|
|
8530
8453
|
*/
|
|
8531
8454
|
recalculate: function recalculate() {
|
|
8532
|
-
var
|
|
8455
|
+
var _this33 = this;
|
|
8533
8456
|
var mainBody = this.elemStore["main-body-wrapper"];
|
|
8534
8457
|
if (isDisplayNone(mainBody)) {
|
|
8535
8458
|
return;
|
|
@@ -8548,7 +8471,7 @@ var Methods$d = {
|
|
|
8548
8471
|
this.autoCellWidth(headerElem, bodyElem, footerElem);
|
|
8549
8472
|
if (scrollXLoad || scrollYLoad || scrollLoad) {
|
|
8550
8473
|
return this.computeScrollLoad().then(function() {
|
|
8551
|
-
|
|
8474
|
+
_this33.autoCellWidth(headerElem, bodyElem, footerElem);
|
|
8552
8475
|
});
|
|
8553
8476
|
}
|
|
8554
8477
|
return this.computeScrollLoad();
|
|
@@ -8625,7 +8548,7 @@ var Methods$d = {
|
|
|
8625
8548
|
return this.recalculate();
|
|
8626
8549
|
},
|
|
8627
8550
|
updateStyle: function updateStyle() {
|
|
8628
|
-
var
|
|
8551
|
+
var _this34 = this;
|
|
8629
8552
|
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;
|
|
8630
8553
|
var scrollYLoad = this.scrollYLoad, scrollXLoad = this.scrollXLoad, scrollLoad = this.scrollLoad;
|
|
8631
8554
|
var layoutList = ["header", "body", "footer"];
|
|
@@ -8644,7 +8567,7 @@ var Methods$d = {
|
|
|
8644
8567
|
}
|
|
8645
8568
|
layoutList.forEach(function(layout) {
|
|
8646
8569
|
var args1 = {
|
|
8647
|
-
_vm:
|
|
8570
|
+
_vm: _this34,
|
|
8648
8571
|
columnStore,
|
|
8649
8572
|
customHeight
|
|
8650
8573
|
};
|
|
@@ -8676,10 +8599,10 @@ var Methods$d = {
|
|
|
8676
8599
|
});
|
|
8677
8600
|
},
|
|
8678
8601
|
preventEvent: function preventEvent(event, type, args, next, end) {
|
|
8679
|
-
var
|
|
8602
|
+
var _this35 = this;
|
|
8680
8603
|
var eventList = Interceptor.get(type);
|
|
8681
8604
|
if (!eventList.some(function(listener) {
|
|
8682
|
-
return listener(args, event,
|
|
8605
|
+
return listener(args, event, _this35) === false;
|
|
8683
8606
|
})) {
|
|
8684
8607
|
next && next();
|
|
8685
8608
|
}
|
|
@@ -8844,12 +8767,12 @@ var Methods$d = {
|
|
|
8844
8767
|
},
|
|
8845
8768
|
// 当单元格发生改变时,如果存在规则,则校验
|
|
8846
8769
|
handleChangeCell: function handleChangeCell(event, params) {
|
|
8847
|
-
var
|
|
8770
|
+
var _this36 = this;
|
|
8848
8771
|
this.triggerValidate("blur").catch(function(e) {
|
|
8849
8772
|
return e;
|
|
8850
8773
|
}).then(function() {
|
|
8851
|
-
|
|
8852
|
-
return
|
|
8774
|
+
_this36.handleActived(params, event).then(function() {
|
|
8775
|
+
return _this36.triggerValidate("change");
|
|
8853
8776
|
}).catch(function(e) {
|
|
8854
8777
|
return e;
|
|
8855
8778
|
});
|
|
@@ -8920,7 +8843,7 @@ var Methods$d = {
|
|
|
8920
8843
|
},
|
|
8921
8844
|
// 列双击点击事件:如果是双击模式,则激活为编辑状态
|
|
8922
8845
|
triggerCellDBLClickEvent: function triggerCellDBLClickEvent(event, params) {
|
|
8923
|
-
var
|
|
8846
|
+
var _this37 = this;
|
|
8924
8847
|
var editStore = this.editStore, editConfig = this.editConfig;
|
|
8925
8848
|
var actived = editStore.actived;
|
|
8926
8849
|
var isActiveNewCell = !actived.args || event.currentTarget !== actived.args.cell;
|
|
@@ -8929,8 +8852,8 @@ var Methods$d = {
|
|
|
8929
8852
|
this.triggerValidate("blur").catch(function(e) {
|
|
8930
8853
|
return e;
|
|
8931
8854
|
}).then(function() {
|
|
8932
|
-
|
|
8933
|
-
return
|
|
8855
|
+
_this37.handleActived(params, event).then(function() {
|
|
8856
|
+
return _this37.triggerValidate("change");
|
|
8934
8857
|
}).catch(function(e) {
|
|
8935
8858
|
return e;
|
|
8936
8859
|
});
|
|
@@ -8938,7 +8861,7 @@ var Methods$d = {
|
|
|
8938
8861
|
}
|
|
8939
8862
|
if (isDblclickNewCell && editConfig.mode === "cell") {
|
|
8940
8863
|
this.handleActived(params, event).then(function() {
|
|
8941
|
-
return
|
|
8864
|
+
return _this37.triggerValidate("change");
|
|
8942
8865
|
}).catch(function(e) {
|
|
8943
8866
|
return e;
|
|
8944
8867
|
});
|
|
@@ -9068,11 +8991,11 @@ var Methods$d = {
|
|
|
9068
8991
|
return ~this.expandeds.indexOf(row2);
|
|
9069
8992
|
},
|
|
9070
8993
|
clearRowExpand: function clearRowExpand() {
|
|
9071
|
-
var
|
|
8994
|
+
var _this38 = this;
|
|
9072
8995
|
var hasExpand = this.expandeds.length;
|
|
9073
8996
|
this.expandeds = [];
|
|
9074
8997
|
return this.$nextTick().then(function() {
|
|
9075
|
-
return hasExpand ?
|
|
8998
|
+
return hasExpand ? _this38.recalculate() : 0;
|
|
9076
8999
|
});
|
|
9077
9000
|
},
|
|
9078
9001
|
// 获取虚拟滚动状态
|
|
@@ -9091,13 +9014,13 @@ var Methods$d = {
|
|
|
9091
9014
|
this.loadScrollXData(event);
|
|
9092
9015
|
},
|
|
9093
9016
|
debounceScrollX: function debounceScrollX(event) {
|
|
9094
|
-
var
|
|
9017
|
+
var _this39 = this;
|
|
9095
9018
|
if (!this.tasks.debounceScrollX) {
|
|
9096
9019
|
this.tasks.debounceScrollXHandler = null;
|
|
9097
9020
|
this.tasks.debounceScrollX = function() {
|
|
9098
9021
|
return requestAnimationFrame(function() {
|
|
9099
|
-
|
|
9100
|
-
|
|
9022
|
+
_this39.tasks.debounceScrollXHandler = null;
|
|
9023
|
+
_this39.loadScrollXData(event);
|
|
9101
9024
|
});
|
|
9102
9025
|
};
|
|
9103
9026
|
}
|
|
@@ -9148,21 +9071,21 @@ var Methods$d = {
|
|
|
9148
9071
|
},
|
|
9149
9072
|
// 处理滚动分页相关逻辑
|
|
9150
9073
|
debounceScrollLoad: function debounceScrollLoad(event) {
|
|
9151
|
-
var
|
|
9074
|
+
var _this40 = this;
|
|
9152
9075
|
if (!this.tasks.debounceScrollLoad) {
|
|
9153
9076
|
this.tasks.debounceScrollLoad = debounce(debounceScrollLoadDuration, function() {
|
|
9154
|
-
var
|
|
9155
|
-
var
|
|
9077
|
+
var _this40$scrollLoadSto = _this40.scrollLoadStore, scrollHeight = _this40$scrollLoadSto.scrollHeight, bodyHeight = _this40$scrollLoadSto.bodyHeight;
|
|
9078
|
+
var _this40$$grid$tablePa = _this40.$grid.tablePage, currentPage = _this40$$grid$tablePa.currentPage, pageSize = _this40$$grid$tablePa.pageSize;
|
|
9156
9079
|
var max = scrollHeight - bodyHeight;
|
|
9157
9080
|
var scrollTop = event.target.scrollTop;
|
|
9158
9081
|
if (scrollTop > max) {
|
|
9159
9082
|
scrollTop = max;
|
|
9160
9083
|
}
|
|
9161
|
-
var rowHeight =
|
|
9084
|
+
var rowHeight = _this40.scrollYStore.rowHeight;
|
|
9162
9085
|
var visibleIndex = Math.ceil(scrollTop / rowHeight);
|
|
9163
9086
|
var page = Math.ceil(visibleIndex / pageSize) + 1;
|
|
9164
9087
|
if (currentPage !== page) {
|
|
9165
|
-
|
|
9088
|
+
_this40.$grid.pageCurrentChange(page);
|
|
9166
9089
|
}
|
|
9167
9090
|
});
|
|
9168
9091
|
}
|
|
@@ -9170,7 +9093,7 @@ var Methods$d = {
|
|
|
9170
9093
|
},
|
|
9171
9094
|
// 纵向 Y 可视渲染处理
|
|
9172
9095
|
loadScrollYData: function loadScrollYData(event) {
|
|
9173
|
-
var
|
|
9096
|
+
var _this41 = this;
|
|
9174
9097
|
var scrollYStore = this.scrollYStore;
|
|
9175
9098
|
var startIndex = scrollYStore.startIndex, renderSize = scrollYStore.renderSize, offsetSize = scrollYStore.offsetSize, visibleIndex = scrollYStore.visibleIndex, visibleSize = scrollYStore.visibleSize, rowHeight = scrollYStore.rowHeight;
|
|
9176
9099
|
var scrollTop = event.target.scrollTop;
|
|
@@ -9196,7 +9119,7 @@ var Methods$d = {
|
|
|
9196
9119
|
}
|
|
9197
9120
|
scrollYStore.visibleIndex = toVisibleIndex;
|
|
9198
9121
|
this.$nextTick(function() {
|
|
9199
|
-
|
|
9122
|
+
_this41.updateSelectedCls(true);
|
|
9200
9123
|
});
|
|
9201
9124
|
},
|
|
9202
9125
|
getRowHeight: function getRowHeight() {
|
|
@@ -9220,16 +9143,16 @@ var Methods$d = {
|
|
|
9220
9143
|
},
|
|
9221
9144
|
// 计算可视渲染相关数据
|
|
9222
9145
|
computeScrollLoad: function computeScrollLoad() {
|
|
9223
|
-
var
|
|
9146
|
+
var _this42 = this;
|
|
9224
9147
|
return this.$nextTick().then(function() {
|
|
9225
|
-
var $refs =
|
|
9226
|
-
var scrollLoad =
|
|
9148
|
+
var $refs = _this42.$refs, optimizeOpts2 = _this42.optimizeOpts, visibleColumn = _this42.visibleColumn;
|
|
9149
|
+
var scrollLoad = _this42.scrollLoad, scrollXLoad = _this42.scrollXLoad, scrollXStore = _this42.scrollXStore, scrollYLoad = _this42.scrollYLoad, scrollYStore = _this42.scrollYStore;
|
|
9227
9150
|
var scrollX = optimizeOpts2.scrollX, scrollY = optimizeOpts2.scrollY;
|
|
9228
9151
|
var tableBody = $refs.tableBody;
|
|
9229
9152
|
var bodyElem = tableBody ? tableBody.$el : null;
|
|
9230
9153
|
if (bodyElem) {
|
|
9231
9154
|
computeScrollXLoad({
|
|
9232
|
-
_vm:
|
|
9155
|
+
_vm: _this42,
|
|
9233
9156
|
scrollX,
|
|
9234
9157
|
scrollXLoad,
|
|
9235
9158
|
scrollXStore,
|
|
@@ -9237,7 +9160,7 @@ var Methods$d = {
|
|
|
9237
9160
|
visibleColumn
|
|
9238
9161
|
});
|
|
9239
9162
|
computeScrollYLoad({
|
|
9240
|
-
_vm:
|
|
9163
|
+
_vm: _this42,
|
|
9241
9164
|
scrollLoad,
|
|
9242
9165
|
scrollY,
|
|
9243
9166
|
scrollYLoad,
|
|
@@ -9245,12 +9168,12 @@ var Methods$d = {
|
|
|
9245
9168
|
tableBodyElem: bodyElem
|
|
9246
9169
|
});
|
|
9247
9170
|
}
|
|
9248
|
-
|
|
9171
|
+
_this42.$nextTick(_this42.updateStyle);
|
|
9249
9172
|
});
|
|
9250
9173
|
},
|
|
9251
9174
|
// 处理x轴方向虚拟滚动列数据加载
|
|
9252
9175
|
updateScrollXData: function updateScrollXData() {
|
|
9253
|
-
var
|
|
9176
|
+
var _this43 = this;
|
|
9254
9177
|
var scrollXStore = this.scrollXStore;
|
|
9255
9178
|
var ret = sliceVisibleColumn(this);
|
|
9256
9179
|
if (ret.sliced) {
|
|
@@ -9259,11 +9182,11 @@ var Methods$d = {
|
|
|
9259
9182
|
}
|
|
9260
9183
|
this.debounceRaf("updateScrollXDataHandler", function() {
|
|
9261
9184
|
scrollXStore.lastStartIndex = ret.lastStartIndex;
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9185
|
+
_this43.tableColumn = ret.tableColumn;
|
|
9186
|
+
_this43.visibleColumnChanged = ret.visibleColumnChanged;
|
|
9187
|
+
_this43.$nextTick(function() {
|
|
9188
|
+
_this43.updateFooter();
|
|
9189
|
+
_this43.updateStyle();
|
|
9267
9190
|
});
|
|
9268
9191
|
});
|
|
9269
9192
|
},
|
|
@@ -9294,22 +9217,22 @@ var Methods$d = {
|
|
|
9294
9217
|
this.$nextTick(this.updateStyle);
|
|
9295
9218
|
},
|
|
9296
9219
|
debounceRaf: function debounceRaf(handlerKey, callback) {
|
|
9297
|
-
var
|
|
9220
|
+
var _this44 = this;
|
|
9298
9221
|
if (this[handlerKey]) {
|
|
9299
9222
|
cancelAnimationFrame(this[handlerKey]);
|
|
9300
9223
|
}
|
|
9301
9224
|
this[handlerKey] = requestAnimationFrame(function() {
|
|
9302
|
-
|
|
9225
|
+
_this44[handlerKey] = null;
|
|
9303
9226
|
callback();
|
|
9304
9227
|
});
|
|
9305
9228
|
},
|
|
9306
9229
|
// 处理虚拟滚动加载数据,并更新YSpace位置
|
|
9307
9230
|
updateScrollYData: function updateScrollYData() {
|
|
9308
|
-
var
|
|
9231
|
+
var _this45 = this;
|
|
9309
9232
|
this.updateScrollYSpace();
|
|
9310
9233
|
this.debounceRaf("updateScrollYDataHandler", function() {
|
|
9311
|
-
|
|
9312
|
-
return
|
|
9234
|
+
_this45.handleTableData().then(function() {
|
|
9235
|
+
return _this45.$nextTick(_this45.updateStyle);
|
|
9313
9236
|
});
|
|
9314
9237
|
});
|
|
9315
9238
|
},
|
|
@@ -9376,7 +9299,7 @@ var Methods$d = {
|
|
|
9376
9299
|
return this.scrollToColumn(column, isDelayArg, move);
|
|
9377
9300
|
},
|
|
9378
9301
|
scrollToTreeRow: function scrollToTreeRow(row2) {
|
|
9379
|
-
var
|
|
9302
|
+
var _this46 = this;
|
|
9380
9303
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig, treeOpts = this.treeOpts;
|
|
9381
9304
|
if (!treeConfig) {
|
|
9382
9305
|
return this.$nextTick();
|
|
@@ -9389,20 +9312,20 @@ var Methods$d = {
|
|
|
9389
9312
|
}
|
|
9390
9313
|
var nodes = matchObj.nodes;
|
|
9391
9314
|
nodes.forEach(function(row22, index2) {
|
|
9392
|
-
if (index2 === nodes.length - 1 ||
|
|
9315
|
+
if (index2 === nodes.length - 1 || _this46.hasTreeExpand(row22)) {
|
|
9393
9316
|
return;
|
|
9394
9317
|
}
|
|
9395
|
-
|
|
9318
|
+
_this46.setTreeExpansion(row22, true);
|
|
9396
9319
|
});
|
|
9397
9320
|
return this.$nextTick();
|
|
9398
9321
|
},
|
|
9399
9322
|
scrollToColumn: function scrollToColumn(column, isDelay, move) {
|
|
9400
|
-
var
|
|
9323
|
+
var _this47 = this;
|
|
9401
9324
|
var hasColCache = this.fullColumnMap.has(column);
|
|
9402
9325
|
column && hasColCache && colToVisible(this, column, move);
|
|
9403
9326
|
return isDelay && (this.scrollXLoad || this.scrollYLoad) ? new Promise(function(resolve) {
|
|
9404
9327
|
return setTimeout(function() {
|
|
9405
|
-
return resolve(
|
|
9328
|
+
return resolve(_this47.$nextTick());
|
|
9406
9329
|
}, 50);
|
|
9407
9330
|
}) : this.$nextTick();
|
|
9408
9331
|
},
|
|
@@ -9410,7 +9333,7 @@ var Methods$d = {
|
|
|
9410
9333
|
this.lastScrollTop = 0;
|
|
9411
9334
|
},
|
|
9412
9335
|
clearScroll: function clearScroll() {
|
|
9413
|
-
var
|
|
9336
|
+
var _this48 = this;
|
|
9414
9337
|
var scrollXStore = this.scrollXStore, scrollYStore = this.scrollYStore, elemStore = this.elemStore;
|
|
9415
9338
|
Object.assign(this, {
|
|
9416
9339
|
lastScrollLeft: 0,
|
|
@@ -9428,7 +9351,7 @@ var Methods$d = {
|
|
|
9428
9351
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
9429
9352
|
var tableHeaderElem = elemStore["main-header-wrapper"];
|
|
9430
9353
|
var tableFooterElem = elemStore["main-footer-wrapper"];
|
|
9431
|
-
if (
|
|
9354
|
+
if (_this48.afterMounted) {
|
|
9432
9355
|
tableBodyElem && Object.assign(tableBodyElem, {
|
|
9433
9356
|
scrollLeft: 0,
|
|
9434
9357
|
scrollTop: 0
|
|
@@ -9445,7 +9368,7 @@ var Methods$d = {
|
|
|
9445
9368
|
},
|
|
9446
9369
|
// 更新表尾合计
|
|
9447
9370
|
updateFooter: function updateFooter() {
|
|
9448
|
-
var
|
|
9371
|
+
var _this49 = this;
|
|
9449
9372
|
var afterFullData = this.afterFullData, footerMethod = this.footerMethod, showFooter = this.showFooter, summaryConfig = this.summaryConfig, tableColumn3 = this.tableColumn;
|
|
9450
9373
|
if (footerMethod && showFooter) {
|
|
9451
9374
|
var data8 = footerMethod({
|
|
@@ -9466,7 +9389,7 @@ var Methods$d = {
|
|
|
9466
9389
|
return text || "";
|
|
9467
9390
|
}
|
|
9468
9391
|
if (~fields.indexOf(column.property)) {
|
|
9469
|
-
return toDecimal(sum(
|
|
9392
|
+
return toDecimal(sum(_this49.afterFullData, column.property), fraction, _truncate);
|
|
9470
9393
|
}
|
|
9471
9394
|
return null;
|
|
9472
9395
|
});
|
|
@@ -9476,10 +9399,10 @@ var Methods$d = {
|
|
|
9476
9399
|
},
|
|
9477
9400
|
// 更新列状态:如果组件值v-model发生change,调用该函数更新列的编辑状态。如果单元格配置了校验规则,则进行校验
|
|
9478
9401
|
updateStatus: function updateStatus(scope, cellValue, renderOpts) {
|
|
9479
|
-
var
|
|
9402
|
+
var _this50 = this;
|
|
9480
9403
|
var customValue = !isUndefined(cellValue);
|
|
9481
9404
|
return this.$nextTick().then(function() {
|
|
9482
|
-
var $refs =
|
|
9405
|
+
var $refs = _this50.$refs, editRules = _this50.editRules, tableData = _this50.tableData, validStore = _this50.validStore;
|
|
9483
9406
|
var tableBody = $refs.tableBody;
|
|
9484
9407
|
if (!scope || !tableBody || !editRules) {
|
|
9485
9408
|
return;
|
|
@@ -9489,11 +9412,11 @@ var Methods$d = {
|
|
|
9489
9412
|
}
|
|
9490
9413
|
var column = scope.column, row2 = scope.row;
|
|
9491
9414
|
var type = "change";
|
|
9492
|
-
if (!
|
|
9415
|
+
if (!_this50.hasCellRules(type, row2, column)) {
|
|
9493
9416
|
return;
|
|
9494
9417
|
}
|
|
9495
9418
|
var rowIndex = tableData.indexOf(row2);
|
|
9496
|
-
getCell(
|
|
9419
|
+
getCell(_this50, {
|
|
9497
9420
|
row: row2,
|
|
9498
9421
|
rowIndex,
|
|
9499
9422
|
column
|
|
@@ -9501,13 +9424,13 @@ var Methods$d = {
|
|
|
9501
9424
|
if (!cell) {
|
|
9502
9425
|
return;
|
|
9503
9426
|
}
|
|
9504
|
-
return
|
|
9427
|
+
return _this50.validCellRules(type, row2, column, cellValue).then(function() {
|
|
9505
9428
|
customValue && validStore.visible && setCellValue(row2, column, cellValue);
|
|
9506
|
-
|
|
9429
|
+
_this50.clearValidate();
|
|
9507
9430
|
}).catch(function(_ref190) {
|
|
9508
9431
|
var rule = _ref190.rule;
|
|
9509
9432
|
customValue && setCellValue(row2, column, cellValue);
|
|
9510
|
-
|
|
9433
|
+
_this50.showValidTooltip({
|
|
9511
9434
|
rule,
|
|
9512
9435
|
row: row2,
|
|
9513
9436
|
column,
|
|
@@ -9519,15 +9442,15 @@ var Methods$d = {
|
|
|
9519
9442
|
},
|
|
9520
9443
|
/* X/Y 方向滚动 */
|
|
9521
9444
|
updateScrollStatus: function updateScrollStatus() {
|
|
9522
|
-
var
|
|
9445
|
+
var _this51 = this;
|
|
9523
9446
|
if (!this.tasks.updateScrollStatus) {
|
|
9524
9447
|
this.tasks.updateScrollStatus = debounce(AsyncCollectTimeout, function() {
|
|
9525
|
-
var scrollXLoad =
|
|
9448
|
+
var scrollXLoad = _this51.scrollXLoad, scrollYLoad = _this51.scrollYLoad, isAsyncColumn = _this51.isAsyncColumn;
|
|
9526
9449
|
if (isAsyncColumn && (scrollXLoad || scrollYLoad)) {
|
|
9527
|
-
var tableData =
|
|
9450
|
+
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;
|
|
9528
9451
|
var isInit = scrollXLoad && scrollXStore.visibleIndex === 0 || scrollYLoad && scrollYStore.visibleIndex === 0;
|
|
9529
9452
|
if (isInit || scrollDirection !== "N") {
|
|
9530
|
-
|
|
9453
|
+
_this51.handleResolveColumn(tableFullData, _this51.collectAsyncColumn(tableData));
|
|
9531
9454
|
}
|
|
9532
9455
|
}
|
|
9533
9456
|
});
|
|
@@ -9544,7 +9467,7 @@ var Methods$d = {
|
|
|
9544
9467
|
},
|
|
9545
9468
|
// 收集异步列
|
|
9546
9469
|
collectAsyncColumn: function collectAsyncColumn(tableData) {
|
|
9547
|
-
var
|
|
9470
|
+
var _this52 = this;
|
|
9548
9471
|
var fetchColumns = [];
|
|
9549
9472
|
var rowId = this.rowId, asyncRenderMap = this.asyncRenderMap, tableColumn3 = this.tableColumn;
|
|
9550
9473
|
if (!rowId) {
|
|
@@ -9563,7 +9486,7 @@ var Methods$d = {
|
|
|
9563
9486
|
}
|
|
9564
9487
|
var cellValuesCount = 1;
|
|
9565
9488
|
var cellValues = [cellValue];
|
|
9566
|
-
var uniqueKey =
|
|
9489
|
+
var uniqueKey = _this52.getAsyncColumnUniqueKey(col.property, row2);
|
|
9567
9490
|
if (splitConfig.enabled === true) {
|
|
9568
9491
|
cellValues = cellValue.split(splitConfig.valueSplit || ",");
|
|
9569
9492
|
cellValuesCount = cellValues.length;
|
|
@@ -9634,12 +9557,12 @@ var Methods$d = {
|
|
|
9634
9557
|
},
|
|
9635
9558
|
// 更新表体高度
|
|
9636
9559
|
updateTableBodyHeight: function updateTableBodyHeight() {
|
|
9637
|
-
var
|
|
9560
|
+
var _this53 = this;
|
|
9638
9561
|
if (!this.tasks.updateTableBodyHeight) {
|
|
9639
9562
|
this.tasks.updateTableBodyHeight = function() {
|
|
9640
9563
|
fastdom.measure(function() {
|
|
9641
|
-
var tableBodyElem =
|
|
9642
|
-
|
|
9564
|
+
var tableBodyElem = _this53.elemStore["main-body-wrapper"];
|
|
9565
|
+
_this53.tableBodyHeight = tableBodyElem ? tableBodyElem.clientHeight : 0;
|
|
9643
9566
|
});
|
|
9644
9567
|
};
|
|
9645
9568
|
}
|
|
@@ -9650,17 +9573,17 @@ var Methods$d = {
|
|
|
9650
9573
|
return column.order ? column.order === "asc" ? "desc" : null : "asc";
|
|
9651
9574
|
},
|
|
9652
9575
|
watchDataForVue3: function watchDataForVue3() {
|
|
9653
|
-
var
|
|
9576
|
+
var _this54 = this;
|
|
9654
9577
|
if (isVue2) return;
|
|
9655
9578
|
var stopWatch = hooks.watch([function() {
|
|
9656
|
-
return
|
|
9579
|
+
return _this54.data;
|
|
9657
9580
|
}, function() {
|
|
9658
|
-
return
|
|
9581
|
+
return _this54.data && _this54.data.length;
|
|
9659
9582
|
}], function(_ref194, _ref195) {
|
|
9660
9583
|
var newData = _ref194[0], newLength = _ref194[1];
|
|
9661
9584
|
var oldData = _ref195[0], oldLength = _ref195[1];
|
|
9662
|
-
if (Array.isArray(
|
|
9663
|
-
|
|
9585
|
+
if (Array.isArray(_this54.data) && newData === oldData && newLength !== oldLength) {
|
|
9586
|
+
_this54.handleDataChange();
|
|
9664
9587
|
}
|
|
9665
9588
|
});
|
|
9666
9589
|
hooks.onBeforeUnmount(function() {
|
|
@@ -9696,7 +9619,7 @@ var Methods$d = {
|
|
|
9696
9619
|
},
|
|
9697
9620
|
// 尝试恢复滚动位置,规范了最大滚动位置的取值
|
|
9698
9621
|
attemptRestoreScoll: function attemptRestoreScoll(options) {
|
|
9699
|
-
var
|
|
9622
|
+
var _this55 = this;
|
|
9700
9623
|
var _ref196 = options || this, lastScrollTop = _ref196.lastScrollTop, lastScrollLeft = _ref196.lastScrollLeft;
|
|
9701
9624
|
var scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, elemStore = this.elemStore;
|
|
9702
9625
|
var tableBodyElem = elemStore["main-body-wrapper"];
|
|
@@ -9707,10 +9630,10 @@ var Methods$d = {
|
|
|
9707
9630
|
lastScrollTop = Math.min(lastScrollTop, maxScrollTop);
|
|
9708
9631
|
lastScrollLeft = Math.min(lastScrollLeft, maxScrollLeft);
|
|
9709
9632
|
fastdom.mutate(function() {
|
|
9710
|
-
|
|
9711
|
-
|
|
9712
|
-
scrollXLoad &&
|
|
9713
|
-
scrollYLoad &&
|
|
9633
|
+
_this55.restoreScollFlag = true;
|
|
9634
|
+
_this55.scrollTo(lastScrollLeft, lastScrollTop);
|
|
9635
|
+
scrollXLoad && _this55.triggerScrollXEvent();
|
|
9636
|
+
scrollYLoad && _this55.triggerScrollYEvent({
|
|
9714
9637
|
target: {
|
|
9715
9638
|
scrollTop: lastScrollTop
|
|
9716
9639
|
}
|
|
@@ -9735,7 +9658,7 @@ var fnFields = function fnFields2(fields) {
|
|
|
9735
9658
|
var fnFieldConfig = function fnFieldConfig2(field) {
|
|
9736
9659
|
return Array.isArray(field) && field.length > 1 ? field[1] : {};
|
|
9737
9660
|
};
|
|
9738
|
-
var
|
|
9661
|
+
var _sfc_main$8 = defineComponent({
|
|
9739
9662
|
props: _extends({}, $props, {
|
|
9740
9663
|
datas: Object,
|
|
9741
9664
|
row: Object
|
|
@@ -9757,25 +9680,14 @@ var __vue2_script$8 = defineComponent({
|
|
|
9757
9680
|
}, selectionColumn.renderCell(h, params));
|
|
9758
9681
|
}
|
|
9759
9682
|
});
|
|
9760
|
-
var
|
|
9761
|
-
var __cssModules$8 = {};
|
|
9762
|
-
var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, __vue2_render$5, __vue2_staticRenderFns$5, false, __vue2_injectStyles$8);
|
|
9763
|
-
function __vue2_injectStyles$8(context) {
|
|
9764
|
-
for (var o in __cssModules$8) {
|
|
9765
|
-
this[o] = __cssModules$8[o];
|
|
9766
|
-
}
|
|
9767
|
-
}
|
|
9768
|
-
var ColumnType = /* @__PURE__ */ function() {
|
|
9769
|
-
return __component__$8.exports;
|
|
9770
|
-
}();
|
|
9771
|
-
var __vue2_script$7 = defineComponent({
|
|
9683
|
+
var _sfc_main$7 = defineComponent({
|
|
9772
9684
|
inject: ["$mftable"],
|
|
9773
9685
|
props: _extends({}, $props, {
|
|
9774
9686
|
datas: Object,
|
|
9775
9687
|
row: Object
|
|
9776
9688
|
}),
|
|
9777
9689
|
render: function render10() {
|
|
9778
|
-
var
|
|
9690
|
+
var _this56 = this;
|
|
9779
9691
|
var datas = this.datas, row2 = this.row;
|
|
9780
9692
|
var primaryColumn = datas.primaryColumn, contentColumns = datas.contentColumns, genParams2 = datas.genParams, config2 = datas.config, cardView2 = datas.cardView;
|
|
9781
9693
|
var _config$cardConfig = config2.cardConfig, cardConfig = _config$cardConfig === void 0 ? {} : _config$cardConfig;
|
|
@@ -9787,8 +9699,8 @@ var __vue2_script$7 = defineComponent({
|
|
|
9787
9699
|
};
|
|
9788
9700
|
var ons = function ons2() {
|
|
9789
9701
|
return {
|
|
9790
|
-
mouseenter:
|
|
9791
|
-
mouseleave:
|
|
9702
|
+
mouseenter: _this56.handleMouseenter,
|
|
9703
|
+
mouseleave: _this56.handleMouseleave
|
|
9792
9704
|
};
|
|
9793
9705
|
};
|
|
9794
9706
|
if (!primaryColumn || !primaryColumn.renderCell) {
|
|
@@ -9925,18 +9837,7 @@ var __vue2_script$7 = defineComponent({
|
|
|
9925
9837
|
}
|
|
9926
9838
|
}
|
|
9927
9839
|
});
|
|
9928
|
-
var
|
|
9929
|
-
var __cssModules$7 = {};
|
|
9930
|
-
var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, __vue2_render$4, __vue2_staticRenderFns$4, false, __vue2_injectStyles$7);
|
|
9931
|
-
function __vue2_injectStyles$7(context) {
|
|
9932
|
-
for (var o in __cssModules$7) {
|
|
9933
|
-
this[o] = __cssModules$7[o];
|
|
9934
|
-
}
|
|
9935
|
-
}
|
|
9936
|
-
var ColumnContent = /* @__PURE__ */ function() {
|
|
9937
|
-
return __component__$7.exports;
|
|
9938
|
-
}();
|
|
9939
|
-
var __vue2_script$6 = defineComponent({
|
|
9840
|
+
var _sfc_main$6 = defineComponent({
|
|
9940
9841
|
props: _extends({}, $props, {
|
|
9941
9842
|
datas: Object,
|
|
9942
9843
|
row: Object
|
|
@@ -10037,26 +9938,15 @@ var __vue2_script$6 = defineComponent({
|
|
|
10037
9938
|
}, [vnode]);
|
|
10038
9939
|
}
|
|
10039
9940
|
});
|
|
10040
|
-
var
|
|
10041
|
-
var __cssModules$6 = {};
|
|
10042
|
-
var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, __vue2_render$3, __vue2_staticRenderFns$3, false, __vue2_injectStyles$6);
|
|
10043
|
-
function __vue2_injectStyles$6(context) {
|
|
10044
|
-
for (var o in __cssModules$6) {
|
|
10045
|
-
this[o] = __cssModules$6[o];
|
|
10046
|
-
}
|
|
10047
|
-
}
|
|
10048
|
-
var ColumnLink = /* @__PURE__ */ function() {
|
|
10049
|
-
return __component__$6.exports;
|
|
10050
|
-
}();
|
|
10051
|
-
var __vue2_script$5 = defineComponent({
|
|
9941
|
+
var _sfc_main$5 = defineComponent({
|
|
10052
9942
|
props: _extends({}, $props, {
|
|
10053
9943
|
datas: Object,
|
|
10054
9944
|
row: Object
|
|
10055
9945
|
}),
|
|
10056
9946
|
components: {
|
|
10057
|
-
ColumnType,
|
|
10058
|
-
ColumnContent,
|
|
10059
|
-
ColumnLink
|
|
9947
|
+
ColumnType: _sfc_main$8,
|
|
9948
|
+
ColumnContent: _sfc_main$7,
|
|
9949
|
+
ColumnLink: _sfc_main$6
|
|
10060
9950
|
},
|
|
10061
9951
|
computed: {
|
|
10062
9952
|
showLink: function showLink() {
|
|
@@ -10065,48 +9955,37 @@ var __vue2_script$5 = defineComponent({
|
|
|
10065
9955
|
}
|
|
10066
9956
|
}
|
|
10067
9957
|
});
|
|
10068
|
-
|
|
10069
|
-
var
|
|
10070
|
-
var
|
|
10071
|
-
var
|
|
10072
|
-
return
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
"
|
|
10078
|
-
}
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
}
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
}) : _vm._e()], 1);
|
|
10097
|
-
};
|
|
10098
|
-
var staticRenderFns$2 = [];
|
|
10099
|
-
var __cssModules$5 = {};
|
|
10100
|
-
var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$2, staticRenderFns$2, false, __vue2_injectStyles$5);
|
|
10101
|
-
function __vue2_injectStyles$5(context) {
|
|
10102
|
-
for (var o in __cssModules$5) {
|
|
10103
|
-
this[o] = __cssModules$5[o];
|
|
10104
|
-
}
|
|
9958
|
+
function _sfc_render$2(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
9959
|
+
var _component_column_type = resolveComponent("column-type");
|
|
9960
|
+
var _component_column_content = resolveComponent("column-content");
|
|
9961
|
+
var _component_column_link = resolveComponent("column-link");
|
|
9962
|
+
return openBlock(), createElementBlock(
|
|
9963
|
+
"div",
|
|
9964
|
+
{
|
|
9965
|
+
ref: "layout",
|
|
9966
|
+
"data-tag": "tiny-table-column-layout",
|
|
9967
|
+
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]" : ""]])
|
|
9968
|
+
},
|
|
9969
|
+
[_ctx.datas.hasType ? (openBlock(), createBlock(_component_column_type, {
|
|
9970
|
+
key: 0,
|
|
9971
|
+
ref: "type",
|
|
9972
|
+
datas: _ctx.datas,
|
|
9973
|
+
row: _ctx.row
|
|
9974
|
+
}, null, 8, ["datas", "row"])) : createCommentVNode("v-if", true), createVNode(_component_column_content, {
|
|
9975
|
+
datas: _ctx.datas,
|
|
9976
|
+
row: _ctx.row
|
|
9977
|
+
}, null, 8, ["datas", "row"]), _ctx.showLink ? (openBlock(), createBlock(_component_column_link, {
|
|
9978
|
+
key: 1,
|
|
9979
|
+
ref: "link",
|
|
9980
|
+
datas: _ctx.datas,
|
|
9981
|
+
row: _ctx.row
|
|
9982
|
+
}, null, 8, ["datas", "row"])) : createCommentVNode("v-if", true)],
|
|
9983
|
+
2
|
|
9984
|
+
/* CLASS */
|
|
9985
|
+
);
|
|
10105
9986
|
}
|
|
10106
|
-
var ColumnLayout = /* @__PURE__ */
|
|
10107
|
-
|
|
10108
|
-
}();
|
|
10109
|
-
var __vue2_script$4 = defineComponent({
|
|
9987
|
+
var ColumnLayout = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$2]]);
|
|
9988
|
+
var _sfc_main$4 = defineComponent({
|
|
10110
9989
|
components: {
|
|
10111
9990
|
ColumnLayout
|
|
10112
9991
|
},
|
|
@@ -10147,38 +10026,23 @@ var __vue2_script$4 = defineComponent({
|
|
|
10147
10026
|
}
|
|
10148
10027
|
}
|
|
10149
10028
|
});
|
|
10150
|
-
var
|
|
10151
|
-
|
|
10152
|
-
var
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
}
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
}, [
|
|
10164
|
-
attrs: {
|
|
10165
|
-
"datas": _vm.datas,
|
|
10166
|
-
"row": _vm.row
|
|
10167
|
-
}
|
|
10168
|
-
})], 1);
|
|
10169
|
-
};
|
|
10170
|
-
var staticRenderFns$1 = [];
|
|
10171
|
-
var __cssModules$4 = {};
|
|
10172
|
-
var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$1, staticRenderFns$1, false, __vue2_injectStyles$4);
|
|
10173
|
-
function __vue2_injectStyles$4(context) {
|
|
10174
|
-
for (var o in __cssModules$4) {
|
|
10175
|
-
this[o] = __cssModules$4[o];
|
|
10176
|
-
}
|
|
10029
|
+
var _hoisted_1 = ["data-rowid"];
|
|
10030
|
+
function _sfc_render$1(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
10031
|
+
var _component_column_layout = resolveComponent("column-layout");
|
|
10032
|
+
return openBlock(), createElementBlock("div", {
|
|
10033
|
+
class: normalizeClass(_ctx.mergeClass(_ctx.datas.rowClass, _ctx.currentRowId === _ctx.rowid && _ctx.isCardType ? "border sm:border-2 sm:border-color-brand" : "")),
|
|
10034
|
+
"data-tag": "tiny-table-row",
|
|
10035
|
+
"data-rowid": _ctx.rowid,
|
|
10036
|
+
onClick: _cache[0] || (_cache[0] = function() {
|
|
10037
|
+
return _ctx.handleClick && _ctx.handleClick.apply(_ctx, arguments);
|
|
10038
|
+
})
|
|
10039
|
+
}, [createVNode(_component_column_layout, {
|
|
10040
|
+
datas: _ctx.datas,
|
|
10041
|
+
row: _ctx.row
|
|
10042
|
+
}, null, 8, ["datas", "row"])], 10, _hoisted_1);
|
|
10177
10043
|
}
|
|
10178
|
-
var TableRow = /* @__PURE__ */
|
|
10179
|
-
|
|
10180
|
-
}();
|
|
10181
|
-
var __vue2_script$3 = defineComponent({
|
|
10044
|
+
var TableRow = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1]]);
|
|
10045
|
+
var _sfc_main$3 = defineComponent({
|
|
10182
10046
|
inject: ["$mftable"],
|
|
10183
10047
|
props: _extends({}, $props),
|
|
10184
10048
|
render: function render12() {
|
|
@@ -10194,18 +10058,7 @@ var __vue2_script$3 = defineComponent({
|
|
|
10194
10058
|
return typeof $mftable.slotList === "function" ? $mftable.slotList(params) : null;
|
|
10195
10059
|
}
|
|
10196
10060
|
});
|
|
10197
|
-
var
|
|
10198
|
-
var __cssModules$3 = {};
|
|
10199
|
-
var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, __vue2_render$2, __vue2_staticRenderFns$2, false, __vue2_injectStyles$3);
|
|
10200
|
-
function __vue2_injectStyles$3(context) {
|
|
10201
|
-
for (var o in __cssModules$3) {
|
|
10202
|
-
this[o] = __cssModules$3[o];
|
|
10203
|
-
}
|
|
10204
|
-
}
|
|
10205
|
-
var ListView = /* @__PURE__ */ function() {
|
|
10206
|
-
return __component__$3.exports;
|
|
10207
|
-
}();
|
|
10208
|
-
var __vue2_script$2 = defineComponent({
|
|
10061
|
+
var _sfc_main$2 = defineComponent({
|
|
10209
10062
|
inject: ["$mftable"],
|
|
10210
10063
|
props: _extends({}, $props),
|
|
10211
10064
|
render: function render13() {
|
|
@@ -10221,18 +10074,7 @@ var __vue2_script$2 = defineComponent({
|
|
|
10221
10074
|
return typeof $mftable.slotGantt === "function" ? $mftable.slotGantt(params) : null;
|
|
10222
10075
|
}
|
|
10223
10076
|
});
|
|
10224
|
-
var
|
|
10225
|
-
var __cssModules$2 = {};
|
|
10226
|
-
var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, __vue2_render$1, __vue2_staticRenderFns$1, false, __vue2_injectStyles$2);
|
|
10227
|
-
function __vue2_injectStyles$2(context) {
|
|
10228
|
-
for (var o in __cssModules$2) {
|
|
10229
|
-
this[o] = __cssModules$2[o];
|
|
10230
|
-
}
|
|
10231
|
-
}
|
|
10232
|
-
var GanttView = /* @__PURE__ */ function() {
|
|
10233
|
-
return __component__$2.exports;
|
|
10234
|
-
}();
|
|
10235
|
-
var __vue2_script$1 = defineComponent({
|
|
10077
|
+
var _sfc_main$1 = defineComponent({
|
|
10236
10078
|
inject: ["$mftable"],
|
|
10237
10079
|
props: _extends({}, $props),
|
|
10238
10080
|
render: function render14() {
|
|
@@ -10248,25 +10090,14 @@ var __vue2_script$1 = defineComponent({
|
|
|
10248
10090
|
return typeof $mftable.slotCustom === "function" ? $mftable.slotCustom(params) : null;
|
|
10249
10091
|
}
|
|
10250
10092
|
});
|
|
10251
|
-
var
|
|
10252
|
-
var __cssModules$1 = {};
|
|
10253
|
-
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles$1);
|
|
10254
|
-
function __vue2_injectStyles$1(context) {
|
|
10255
|
-
for (var o in __cssModules$1) {
|
|
10256
|
-
this[o] = __cssModules$1[o];
|
|
10257
|
-
}
|
|
10258
|
-
}
|
|
10259
|
-
var CustomView = /* @__PURE__ */ function() {
|
|
10260
|
-
return __component__$1.exports;
|
|
10261
|
-
}();
|
|
10262
|
-
var __vue2_script = defineComponent({
|
|
10093
|
+
var _sfc_main = defineComponent({
|
|
10263
10094
|
components: {
|
|
10264
10095
|
TableRow,
|
|
10265
10096
|
Tooltip: Tooltip$1,
|
|
10266
10097
|
Exception,
|
|
10267
|
-
ListView,
|
|
10268
|
-
GanttView,
|
|
10269
|
-
CustomView
|
|
10098
|
+
ListView: _sfc_main$3,
|
|
10099
|
+
GanttView: _sfc_main$2,
|
|
10100
|
+
CustomView: _sfc_main$1
|
|
10270
10101
|
},
|
|
10271
10102
|
provide: function provide() {
|
|
10272
10103
|
return {
|
|
@@ -10426,7 +10257,7 @@ var __vue2_script = defineComponent({
|
|
|
10426
10257
|
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;
|
|
10427
10258
|
var tableColumn3 = config2 == null ? void 0 : (_config$tableVm10 = config2.tableVm) == null ? void 0 : _config$tableVm10.tableColumn;
|
|
10428
10259
|
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;
|
|
10429
|
-
var
|
|
10260
|
+
var renderList2 = listConfig.renderList;
|
|
10430
10261
|
var renderGantt = ganttConfig.renderGantt;
|
|
10431
10262
|
var renderCustom = customConfig.renderCustom;
|
|
10432
10263
|
var fieldName = "";
|
|
@@ -10465,7 +10296,7 @@ var __vue2_script = defineComponent({
|
|
|
10465
10296
|
});
|
|
10466
10297
|
}
|
|
10467
10298
|
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;
|
|
10468
|
-
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) ||
|
|
10299
|
+
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;
|
|
10469
10300
|
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;
|
|
10470
10301
|
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;
|
|
10471
10302
|
Object.assign(this, {
|
|
@@ -10617,72 +10448,76 @@ var __vue2_script = defineComponent({
|
|
|
10617
10448
|
}
|
|
10618
10449
|
}
|
|
10619
10450
|
});
|
|
10620
|
-
|
|
10621
|
-
var
|
|
10622
|
-
var
|
|
10623
|
-
var
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10451
|
+
function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
|
|
10452
|
+
var _component_exception = resolveComponent("exception");
|
|
10453
|
+
var _component_list_view = resolveComponent("list-view");
|
|
10454
|
+
var _component_gantt_view = resolveComponent("gantt-view");
|
|
10455
|
+
var _component_custom_view = resolveComponent("custom-view");
|
|
10456
|
+
var _component_table_row = resolveComponent("table-row");
|
|
10457
|
+
var _component_tooltip = resolveComponent("tooltip");
|
|
10458
|
+
return openBlock(), createElementBlock(
|
|
10459
|
+
"div",
|
|
10460
|
+
{
|
|
10461
|
+
ref: "warpperElem",
|
|
10462
|
+
"data-tag": "tiny-table-wrapper",
|
|
10463
|
+
class: normalizeClass(["scrollbar-size-0", _ctx.wrapperClass]),
|
|
10464
|
+
style: normalizeStyle(_ctx.wrapperStyle),
|
|
10465
|
+
onScroll: _cache[1] || (_cache[1] = function() {
|
|
10466
|
+
return _ctx.scrollEvent && _ctx.scrollEvent.apply(_ctx, arguments);
|
|
10467
|
+
})
|
|
10631
10468
|
},
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
attrs: {
|
|
10638
|
-
"tiny_mode": "mobile-first",
|
|
10639
|
-
"tiny_mode_root": "",
|
|
10469
|
+
[_ctx.exceptionVisible ? (openBlock(), createBlock(_component_exception, {
|
|
10470
|
+
key: 0,
|
|
10471
|
+
tiny_mode: "mobile-first",
|
|
10472
|
+
tiny_mode_root: "",
|
|
10473
|
+
class: "min-h-[theme(spacing.72)]",
|
|
10640
10474
|
"component-page": "",
|
|
10641
|
-
|
|
10642
|
-
}
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
}
|
|
10649
|
-
}, [_vm.listView ? [_c("list-view")] : _vm.ganttView ? [_c("gantt-view")] : _vm.customView ? [_c("custom-view")] : _vm._l(_vm.tableData, function(row2, i) {
|
|
10650
|
-
return _c("table-row", {
|
|
10651
|
-
key: "" + _vm.rowKey + i,
|
|
10652
|
-
attrs: {
|
|
10653
|
-
"datas": _vm.cfg(row2),
|
|
10654
|
-
"current-row-id": _vm.currentRowId
|
|
10655
|
-
},
|
|
10656
|
-
on: {
|
|
10657
|
-
"card-click": _vm.handleCardClick
|
|
10658
|
-
}
|
|
10659
|
-
});
|
|
10660
|
-
})], 2), _c("tooltip", {
|
|
10661
|
-
ref: "tooltip",
|
|
10662
|
-
attrs: {
|
|
10663
|
-
"content": _vm.tooltipContent,
|
|
10664
|
-
"manual": ""
|
|
10665
|
-
},
|
|
10666
|
-
model: {
|
|
10667
|
-
value: _vm.tooltipVisible,
|
|
10668
|
-
callback: function callback($$v) {
|
|
10669
|
-
_vm.tooltipVisible = $$v;
|
|
10475
|
+
type: "nodata"
|
|
10476
|
+
})) : createCommentVNode("v-if", true), createElementVNode(
|
|
10477
|
+
"div",
|
|
10478
|
+
{
|
|
10479
|
+
"data-tag": "tiny-table",
|
|
10480
|
+
class: normalizeClass([_ctx.tableClass, _ctx.cardClass]),
|
|
10481
|
+
ref: "table"
|
|
10670
10482
|
},
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10483
|
+
[_ctx.listView ? (openBlock(), createBlock(_component_list_view, {
|
|
10484
|
+
key: 0
|
|
10485
|
+
})) : _ctx.ganttView ? (openBlock(), createBlock(_component_gantt_view, {
|
|
10486
|
+
key: 1
|
|
10487
|
+
})) : _ctx.customView ? (openBlock(), createBlock(_component_custom_view, {
|
|
10488
|
+
key: 2
|
|
10489
|
+
})) : (openBlock(true), createElementBlock(
|
|
10490
|
+
Fragment,
|
|
10491
|
+
{
|
|
10492
|
+
key: 3
|
|
10493
|
+
},
|
|
10494
|
+
renderList(_ctx.tableData, function(row2, i) {
|
|
10495
|
+
return openBlock(), createBlock(_component_table_row, {
|
|
10496
|
+
key: "" + _ctx.rowKey + i,
|
|
10497
|
+
datas: _ctx.cfg(row2),
|
|
10498
|
+
"current-row-id": _ctx.currentRowId,
|
|
10499
|
+
onCardClick: _ctx.handleCardClick
|
|
10500
|
+
}, null, 8, ["datas", "current-row-id", "onCardClick"]);
|
|
10501
|
+
}),
|
|
10502
|
+
128
|
|
10503
|
+
/* KEYED_FRAGMENT */
|
|
10504
|
+
))],
|
|
10505
|
+
2
|
|
10506
|
+
/* CLASS */
|
|
10507
|
+
), createVNode(_component_tooltip, {
|
|
10508
|
+
ref: "tooltip",
|
|
10509
|
+
modelValue: _ctx.tooltipVisible,
|
|
10510
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) {
|
|
10511
|
+
return _ctx.tooltipVisible = $event;
|
|
10512
|
+
}),
|
|
10513
|
+
content: _ctx.tooltipContent,
|
|
10514
|
+
manual: ""
|
|
10515
|
+
}, null, 8, ["modelValue", "content"])],
|
|
10516
|
+
38
|
|
10517
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
10518
|
+
);
|
|
10682
10519
|
}
|
|
10683
|
-
var MfTable = /* @__PURE__ */
|
|
10684
|
-
return __component__.exports;
|
|
10685
|
-
}();
|
|
10520
|
+
var MfTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
10686
10521
|
var initDrag = function initDrag2(dndProxyElement, dndElements, config2) {
|
|
10687
10522
|
if (config2 === void 0) {
|
|
10688
10523
|
config2 = {};
|
|
@@ -12124,20 +11959,20 @@ var Table = defineComponent({
|
|
|
12124
11959
|
});
|
|
12125
11960
|
},
|
|
12126
11961
|
mounted: function mounted5() {
|
|
12127
|
-
var
|
|
11962
|
+
var _this57 = this;
|
|
12128
11963
|
if (this.$refs.tableWrapper) {
|
|
12129
11964
|
document.body.appendChild(this.$refs.tableWrapper);
|
|
12130
11965
|
}
|
|
12131
11966
|
this.$nextTick().then(function() {
|
|
12132
|
-
|
|
12133
|
-
if (
|
|
12134
|
-
|
|
11967
|
+
_this57.afterMounted = true;
|
|
11968
|
+
if (_this57.autoResize && Grid$1._resize) {
|
|
11969
|
+
_this57.bindResize();
|
|
12135
11970
|
}
|
|
12136
11971
|
});
|
|
12137
11972
|
setTimeout(function() {
|
|
12138
|
-
var tableFooter =
|
|
12139
|
-
|
|
12140
|
-
|
|
11973
|
+
var tableFooter = _this57.$refs.tableFooter;
|
|
11974
|
+
_this57.showFooterBorder = !!tableFooter;
|
|
11975
|
+
_this57.footerBorderBottom = tableFooter ? tableFooter.$el.getBoundingClientRect().height : 0;
|
|
12141
11976
|
});
|
|
12142
11977
|
},
|
|
12143
11978
|
activated: function activated() {
|
|
@@ -12224,7 +12059,7 @@ var Table = defineComponent({
|
|
|
12224
12059
|
tableColumn: tableColumn3
|
|
12225
12060
|
};
|
|
12226
12061
|
},
|
|
12227
|
-
render: function
|
|
12062
|
+
render: function render15() {
|
|
12228
12063
|
this.border; var collectColumn2 = this.collectColumn, columnStore = this.columnStore; this.editConfig; this.highlightCell; this.highlightHoverColumn; var instanceSlots = this.instanceSlots;
|
|
12229
12064
|
this.highlightHoverRow; var isGroup2 = this.isGroup, loading = this.loading, loadingComponent = this.loadingComponent; this.mouseConfig; var optimizeOpts2 = this.optimizeOpts;
|
|
12230
12065
|
var overflowX = this.overflowX; this.overflowY; var showFooter = this.showFooter, showHeader = this.showHeader; this.showHeaderOverflow; this.showOverflow; this.dropConfig; this.isThemeSaas;
|
|
@@ -12508,7 +12343,7 @@ var Column = defineComponent({
|
|
|
12508
12343
|
});
|
|
12509
12344
|
return state;
|
|
12510
12345
|
},
|
|
12511
|
-
render: function
|
|
12346
|
+
render: function render16() {
|
|
12512
12347
|
var $table = this.$table, firstRow = this.firstRow, columnConfig = this.columnConfig, instanceSlots = this.instanceSlots;
|
|
12513
12348
|
var slotVnode;
|
|
12514
12349
|
try {
|
|
@@ -12640,10 +12475,10 @@ var Grid = defineComponent({
|
|
|
12640
12475
|
return this.proxyOpts.message !== false;
|
|
12641
12476
|
},
|
|
12642
12477
|
tableProps: function tableProps() {
|
|
12643
|
-
var
|
|
12478
|
+
var _this58 = this;
|
|
12644
12479
|
var rest = {};
|
|
12645
12480
|
propKeys.forEach(function(key) {
|
|
12646
|
-
return rest[key] =
|
|
12481
|
+
return rest[key] = _this58[key];
|
|
12647
12482
|
});
|
|
12648
12483
|
return rest;
|
|
12649
12484
|
},
|
|
@@ -12684,16 +12519,16 @@ var Grid = defineComponent({
|
|
|
12684
12519
|
this.toolbar && this.$refs.toolbar && this.$refs.toolbar.loadStorage();
|
|
12685
12520
|
},
|
|
12686
12521
|
columnAnchorParams: function columnAnchorParams() {
|
|
12687
|
-
var
|
|
12522
|
+
var _this59 = this;
|
|
12688
12523
|
setTimeout(function() {
|
|
12689
|
-
return
|
|
12524
|
+
return _this59.emitter.emit("active-anchor");
|
|
12690
12525
|
}, this.columnAnchorParams.activeAnchor.delay);
|
|
12691
12526
|
},
|
|
12692
12527
|
viewType: function viewType(value) {
|
|
12693
|
-
var
|
|
12528
|
+
var _this60 = this;
|
|
12694
12529
|
if (value === V_MF && this.fullScreenClass) {
|
|
12695
12530
|
this.$nextTick(function() {
|
|
12696
|
-
return
|
|
12531
|
+
return _this60.recalculate(true);
|
|
12697
12532
|
});
|
|
12698
12533
|
}
|
|
12699
12534
|
}
|
|
@@ -12783,8 +12618,8 @@ var Grid = defineComponent({
|
|
|
12783
12618
|
api: ["designConfig", "tableListeners", "tinyTheme", "tinyMode", "currentBreakpoint"]
|
|
12784
12619
|
});
|
|
12785
12620
|
},
|
|
12786
|
-
render: function
|
|
12787
|
-
var
|
|
12621
|
+
render: function render17() {
|
|
12622
|
+
var _this61 = this;
|
|
12788
12623
|
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;
|
|
12789
12624
|
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;
|
|
12790
12625
|
var columnAnchor = this.columnAnchor, columnAnchorParams2 = this.columnAnchorParams, fullScreenClass = this.fullScreenClass;
|
|
@@ -12813,7 +12648,7 @@ var Grid = defineComponent({
|
|
|
12813
12648
|
}
|
|
12814
12649
|
toolbar && !(toolbar.setting && toolbar.setting.storage) && (props.customs = tableCustoms2);
|
|
12815
12650
|
toolbar && (tableOns["update:customs"] = function(value) {
|
|
12816
|
-
return
|
|
12651
|
+
return _this61.tableCustoms = value;
|
|
12817
12652
|
});
|
|
12818
12653
|
tableOns["column-init-ready"] = this.handleColumnInitReady;
|
|
12819
12654
|
if (editConfig) {
|
|
@@ -12855,12 +12690,12 @@ var Grid = defineComponent({
|
|
|
12855
12690
|
methods: {
|
|
12856
12691
|
// 配置高度减去(表格锚点+工具栏+分页)计算得出表格高度
|
|
12857
12692
|
updateParentHeight: function updateParentHeight2() {
|
|
12858
|
-
var
|
|
12693
|
+
var _this62 = this;
|
|
12859
12694
|
if (!this.tasks.updateParentHeight) {
|
|
12860
12695
|
this.tasks.updateParentHeight = debounce(10, function() {
|
|
12861
|
-
var $el =
|
|
12696
|
+
var $el = _this62.$el, $refs = _this62.$refs;
|
|
12862
12697
|
var tinyTable = $refs.tinyTable, tinyGridColumnAnchor = $refs.tinyGridColumnAnchor;
|
|
12863
|
-
var toolbarVm =
|
|
12698
|
+
var toolbarVm = _this62.getVm("toolbar");
|
|
12864
12699
|
if (tinyTable) {
|
|
12865
12700
|
var columnAnchorHeight = 0;
|
|
12866
12701
|
if (tinyGridColumnAnchor) {
|
|
@@ -12933,7 +12768,7 @@ var Grid = defineComponent({
|
|
|
12933
12768
|
},
|
|
12934
12769
|
// 监听某个元素是否出现在视口中
|
|
12935
12770
|
addIntersectionObserver: function addIntersectionObserver() {
|
|
12936
|
-
var
|
|
12771
|
+
var _this63 = this;
|
|
12937
12772
|
if (this.intersectionOption && this.intersectionOption.disabled || typeof IntersectionObserver === "undefined") return;
|
|
12938
12773
|
this.intersectionObserver = new IntersectionObserver(function(entries) {
|
|
12939
12774
|
var entry = entries[0];
|
|
@@ -12945,7 +12780,7 @@ var Grid = defineComponent({
|
|
|
12945
12780
|
entry = intersectingEntry;
|
|
12946
12781
|
}
|
|
12947
12782
|
}
|
|
12948
|
-
|
|
12783
|
+
_this63.handleVisibilityChange(entry.isIntersecting, entry);
|
|
12949
12784
|
}, this.intersectionOption);
|
|
12950
12785
|
this.intersectionObserver.observe(this.$el);
|
|
12951
12786
|
},
|
|
@@ -12998,38 +12833,38 @@ function operArrs(_ref207) {
|
|
|
12998
12833
|
Array.prototype.push.apply(_vm.temporaryRows, newRecordsCopy);
|
|
12999
12834
|
}
|
|
13000
12835
|
var _setActiveCell = function _setActiveCell2(row2, field) {
|
|
13001
|
-
var
|
|
12836
|
+
var _this64 = this;
|
|
13002
12837
|
var next1 = function next12() {
|
|
13003
12838
|
if (!row2 || !field) {
|
|
13004
|
-
return
|
|
12839
|
+
return _this64.$nextTick();
|
|
13005
12840
|
}
|
|
13006
|
-
var column = find(
|
|
12841
|
+
var column = find(_this64.visibleColumn, function(column2) {
|
|
13007
12842
|
return column2.property === field;
|
|
13008
12843
|
});
|
|
13009
12844
|
if (!column || !column.editor) {
|
|
13010
|
-
return
|
|
12845
|
+
return _this64.$nextTick();
|
|
13011
12846
|
}
|
|
13012
12847
|
var next2 = function next22(cell) {
|
|
13013
12848
|
if (!cell) {
|
|
13014
12849
|
return;
|
|
13015
12850
|
}
|
|
13016
|
-
var rowIndex =
|
|
13017
|
-
var columnIndex =
|
|
13018
|
-
|
|
12851
|
+
var rowIndex = _this64.getRowIndex(row2);
|
|
12852
|
+
var columnIndex = _this64.getColumnIndex(column);
|
|
12853
|
+
_this64.handleActived({
|
|
13019
12854
|
row: row2,
|
|
13020
12855
|
rowIndex,
|
|
13021
12856
|
column,
|
|
13022
12857
|
columnIndex,
|
|
13023
12858
|
cell,
|
|
13024
|
-
$table:
|
|
12859
|
+
$table: _this64
|
|
13025
12860
|
});
|
|
13026
|
-
|
|
12861
|
+
_this64.lastCallTime = Date.now();
|
|
13027
12862
|
};
|
|
13028
|
-
getCell(
|
|
12863
|
+
getCell(_this64, {
|
|
13029
12864
|
row: row2,
|
|
13030
12865
|
column
|
|
13031
12866
|
}).then(next2);
|
|
13032
|
-
return
|
|
12867
|
+
return _this64.$nextTick();
|
|
13033
12868
|
};
|
|
13034
12869
|
return this.scrollToRow(row2, true).then(next1);
|
|
13035
12870
|
};
|
|
@@ -13039,7 +12874,7 @@ var Methods$c = {
|
|
|
13039
12874
|
},
|
|
13040
12875
|
// 根据位置从指定行添加数据
|
|
13041
12876
|
_insertAt: function _insertAt(records, row2) {
|
|
13042
|
-
var
|
|
12877
|
+
var _this65 = this;
|
|
13043
12878
|
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;
|
|
13044
12879
|
if (treeConfig) {
|
|
13045
12880
|
throw new Error(error("ui.grid.error.treeInsert"));
|
|
@@ -13057,7 +12892,7 @@ var Methods$c = {
|
|
|
13057
12892
|
}
|
|
13058
12893
|
var nowData = afterFullData;
|
|
13059
12894
|
var newRecords = records.map(function(record) {
|
|
13060
|
-
return hooks.reactive(
|
|
12895
|
+
return hooks.reactive(_this65.defineField(_extends({}, record)));
|
|
13061
12896
|
});
|
|
13062
12897
|
var newRecordsCopy = clone(newRecords, true);
|
|
13063
12898
|
operArrs({
|
|
@@ -13082,7 +12917,7 @@ var Methods$c = {
|
|
|
13082
12917
|
rows: newRecords
|
|
13083
12918
|
};
|
|
13084
12919
|
return this.$nextTick().then(function() {
|
|
13085
|
-
|
|
12920
|
+
_this65.recalculate();
|
|
13086
12921
|
return res;
|
|
13087
12922
|
});
|
|
13088
12923
|
},
|
|
@@ -13092,7 +12927,7 @@ var Methods$c = {
|
|
|
13092
12927
|
* 如果传 rows 则删除多行
|
|
13093
12928
|
*/
|
|
13094
12929
|
_remove: function _remove(rows) {
|
|
13095
|
-
var
|
|
12930
|
+
var _this66 = this;
|
|
13096
12931
|
var afterFullData = this.afterFullData, scrollYLoad = this.scrollYLoad, _this$selectConfig3 = this.selectConfig, selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3;
|
|
13097
12932
|
var selection = this.selection, tableFullData = this.tableFullData, treeConfig = this.treeConfig, _this$tableSourceData2 = this.tableSourceData, tableSourceData = _this$tableSourceData2 === void 0 ? [] : _this$tableSourceData2;
|
|
13098
12933
|
var _this$editStore = this.editStore, insertList = _this$editStore.insertList, removeList = _this$editStore.removeList;
|
|
@@ -13136,9 +12971,9 @@ var Methods$c = {
|
|
|
13136
12971
|
}
|
|
13137
12972
|
remove(tableSourceData, function(row3) {
|
|
13138
12973
|
return find(insertList, function(r) {
|
|
13139
|
-
return getRowid(
|
|
12974
|
+
return getRowid(_this66, r) === getRowid(_this66, row3);
|
|
13140
12975
|
}) && find(rows, function(r) {
|
|
13141
|
-
return getRowid(
|
|
12976
|
+
return getRowid(_this66, r) === getRowid(_this66, row3);
|
|
13142
12977
|
});
|
|
13143
12978
|
});
|
|
13144
12979
|
remove(insertList, function(row3) {
|
|
@@ -13156,7 +12991,7 @@ var Methods$c = {
|
|
|
13156
12991
|
rows: rest
|
|
13157
12992
|
};
|
|
13158
12993
|
return this.$nextTick().then(function() {
|
|
13159
|
-
|
|
12994
|
+
_this66.recalculate();
|
|
13160
12995
|
return res;
|
|
13161
12996
|
});
|
|
13162
12997
|
},
|
|
@@ -13164,10 +12999,10 @@ var Methods$c = {
|
|
|
13164
12999
|
* 删除选中数据
|
|
13165
13000
|
*/
|
|
13166
13001
|
_removeSelecteds: function _removeSelecteds() {
|
|
13167
|
-
var
|
|
13002
|
+
var _this67 = this;
|
|
13168
13003
|
var selectRecords = this.getSelectRecords(true);
|
|
13169
13004
|
var callback = function callback2(params) {
|
|
13170
|
-
|
|
13005
|
+
_this67.clearSelection();
|
|
13171
13006
|
return params;
|
|
13172
13007
|
};
|
|
13173
13008
|
return this.remove(selectRecords).then(callback);
|
|
@@ -13184,7 +13019,7 @@ var Methods$c = {
|
|
|
13184
13019
|
* 如果还额外传了field则还原指定单元格。
|
|
13185
13020
|
*/
|
|
13186
13021
|
_revertData: function _revertData(rows, field) {
|
|
13187
|
-
var
|
|
13022
|
+
var _this68 = this;
|
|
13188
13023
|
var tableSourceData = this.tableSourceData, tableSynchData = this.tableSynchData;
|
|
13189
13024
|
if (arguments.length && rows && !isArray(rows)) {
|
|
13190
13025
|
rows = [rows];
|
|
@@ -13195,7 +13030,7 @@ var Methods$c = {
|
|
|
13195
13030
|
var _loop2 = function _loop22() {
|
|
13196
13031
|
var row2 = rows[i];
|
|
13197
13032
|
var oRow = find(tableSourceData, function(item) {
|
|
13198
|
-
return getRowid(
|
|
13033
|
+
return getRowid(_this68, row2) === getRowid(_this68, item);
|
|
13199
13034
|
});
|
|
13200
13035
|
if (oRow && row2) {
|
|
13201
13036
|
if (field) {
|
|
@@ -13240,10 +13075,10 @@ var Methods$c = {
|
|
|
13240
13075
|
* 只精准匹配row的更改。如果是树表格,子节点更改状态不会影响父节点的更新状态
|
|
13241
13076
|
*/
|
|
13242
13077
|
_getUpdateRecords: function _getUpdateRecords() {
|
|
13243
|
-
var
|
|
13078
|
+
var _this69 = this;
|
|
13244
13079
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
13245
13080
|
var handler6 = function handler7(row2) {
|
|
13246
|
-
return !
|
|
13081
|
+
return !_this69.isTemporaryRow(row2) && _this69.hasRowChange(row2);
|
|
13247
13082
|
};
|
|
13248
13083
|
var updateRecords = treeConfig ? filterTree(tableFullData, handler6, treeConfig) : tableFullData.filter(handler6);
|
|
13249
13084
|
return updateRecords;
|
|
@@ -13252,13 +13087,13 @@ var Methods$c = {
|
|
|
13252
13087
|
* 处理激活编辑
|
|
13253
13088
|
*/
|
|
13254
13089
|
handleActived: function handleActived(params, event) {
|
|
13255
|
-
var
|
|
13090
|
+
var _this70 = this;
|
|
13256
13091
|
return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
|
|
13257
13092
|
var editConfig, editStore, tableColumn3, cell, column, row2, editor, actived, isActiveCell, type, canActive, args;
|
|
13258
13093
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13259
13094
|
while (1) switch (_context.prev = _context.next) {
|
|
13260
13095
|
case 0:
|
|
13261
|
-
editConfig =
|
|
13096
|
+
editConfig = _this70.editConfig, editStore = _this70.editStore, tableColumn3 = _this70.tableColumn;
|
|
13262
13097
|
cell = params.cell, column = params.column, row2 = params.row;
|
|
13263
13098
|
editor = column.editor;
|
|
13264
13099
|
actived = editStore.actived;
|
|
@@ -13281,7 +13116,7 @@ var Methods$c = {
|
|
|
13281
13116
|
case 9:
|
|
13282
13117
|
canActive = _context.sent;
|
|
13283
13118
|
args = {
|
|
13284
|
-
_vm:
|
|
13119
|
+
_vm: _this70,
|
|
13285
13120
|
actived,
|
|
13286
13121
|
canActive,
|
|
13287
13122
|
cell,
|
|
@@ -13297,14 +13132,14 @@ var Methods$c = {
|
|
|
13297
13132
|
});
|
|
13298
13133
|
type = handleActivedDoActive(args);
|
|
13299
13134
|
handleActivedClearActive({
|
|
13300
|
-
_vm:
|
|
13135
|
+
_vm: _this70,
|
|
13301
13136
|
canActive,
|
|
13302
13137
|
event
|
|
13303
13138
|
});
|
|
13304
|
-
emitEvent(
|
|
13139
|
+
emitEvent(_this70, type, [params, event]);
|
|
13305
13140
|
case 15:
|
|
13306
13141
|
handleActivedTryActive({
|
|
13307
|
-
_vm:
|
|
13142
|
+
_vm: _this70,
|
|
13308
13143
|
actived,
|
|
13309
13144
|
cell,
|
|
13310
13145
|
column,
|
|
@@ -13314,7 +13149,7 @@ var Methods$c = {
|
|
|
13314
13149
|
params,
|
|
13315
13150
|
row: row2
|
|
13316
13151
|
});
|
|
13317
|
-
return _context.abrupt("return",
|
|
13152
|
+
return _context.abrupt("return", _this70.$nextTick());
|
|
13318
13153
|
case 17:
|
|
13319
13154
|
case "end":
|
|
13320
13155
|
return _context.stop();
|
|
@@ -13348,14 +13183,14 @@ var Methods$c = {
|
|
|
13348
13183
|
* 清除已激活的编辑
|
|
13349
13184
|
*/
|
|
13350
13185
|
_clearActived: function _clearActived(event) {
|
|
13351
|
-
var
|
|
13186
|
+
var _this71 = this;
|
|
13352
13187
|
var _this$editConfig2 = this.editConfig, editConfig = _this$editConfig2 === void 0 ? {} : _this$editConfig2, editStore = this.editStore, tableColumn3 = this.tableColumn;
|
|
13353
13188
|
var actived = editStore.actived;
|
|
13354
13189
|
var args = actived.args, column = actived.column, row2 = actived.row;
|
|
13355
13190
|
var isActived = row2 || column;
|
|
13356
13191
|
if (isActived && editConfig.mode === "row") {
|
|
13357
13192
|
tableColumn3.forEach(function(column22) {
|
|
13358
|
-
return
|
|
13193
|
+
return _this71._setColumnModel(row2, column22);
|
|
13359
13194
|
});
|
|
13360
13195
|
}
|
|
13361
13196
|
if (isActived && editConfig.mode !== "row") {
|
|
@@ -13434,7 +13269,7 @@ var Methods$c = {
|
|
|
13434
13269
|
* 只对trigger为dblclick有效,选中单元格
|
|
13435
13270
|
*/
|
|
13436
13271
|
_setSelectCell: function _setSelectCell(row2, field) {
|
|
13437
|
-
var
|
|
13272
|
+
var _this72 = this;
|
|
13438
13273
|
var editConfig = this.editConfig, tableData = this.tableData, visibleColumn = this.visibleColumn;
|
|
13439
13274
|
if (!row2 || !field || editConfig.trigger === "manual") {
|
|
13440
13275
|
return this.$nextTick();
|
|
@@ -13455,7 +13290,7 @@ var Methods$c = {
|
|
|
13455
13290
|
columnIndex,
|
|
13456
13291
|
cell
|
|
13457
13292
|
};
|
|
13458
|
-
|
|
13293
|
+
_this72.handleSelected(params, {});
|
|
13459
13294
|
};
|
|
13460
13295
|
getCell(this, {
|
|
13461
13296
|
row: row2,
|
|
@@ -13483,36 +13318,36 @@ var Methods$c = {
|
|
|
13483
13318
|
* 处理选中源
|
|
13484
13319
|
*/
|
|
13485
13320
|
handleSelected: function handleSelected(params, event) {
|
|
13486
|
-
var
|
|
13321
|
+
var _this73 = this;
|
|
13487
13322
|
var editConfig = this.editConfig, editStore = this.editStore, elemStore = this.elemStore, _this$mouseConfig4 = this.mouseConfig, mouseConfig = _this$mouseConfig4 === void 0 ? {} : _this$mouseConfig4;
|
|
13488
13323
|
var actived = editStore.actived, selected = editStore.selected;
|
|
13489
13324
|
var _ref209 = params || {}, cell = _ref209.cell, column = _ref209.column, row2 = _ref209.row;
|
|
13490
13325
|
var selectMethod = function selectMethod2() {
|
|
13491
13326
|
if (selected.row === row2 && selected.column === column || actived.row === row2 && (editConfig.mode !== "cell" || actived.column === column)) {
|
|
13492
|
-
return
|
|
13327
|
+
return _this73.$nextTick();
|
|
13493
13328
|
}
|
|
13494
|
-
if (
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13329
|
+
if (_this73.keyboardConfig || _this73.mouseConfig) {
|
|
13330
|
+
_this73.clearChecked(event);
|
|
13331
|
+
_this73.clearIndexChecked();
|
|
13332
|
+
_this73.clearHeaderChecked();
|
|
13333
|
+
_this73.clearSelected(event);
|
|
13499
13334
|
}
|
|
13500
|
-
|
|
13335
|
+
_this73.clearActived(event);
|
|
13501
13336
|
selected.args = params;
|
|
13502
13337
|
selected.row = row2;
|
|
13503
13338
|
selected.column = column;
|
|
13504
|
-
|
|
13339
|
+
_this73.updateSelectedCls();
|
|
13505
13340
|
if (!mouseConfig.checked) {
|
|
13506
|
-
return
|
|
13341
|
+
return _this73.$nextTick();
|
|
13507
13342
|
}
|
|
13508
13343
|
var headerElem = elemStore["main-header-list"];
|
|
13509
|
-
|
|
13344
|
+
_this73.handleChecked([[cell]]);
|
|
13510
13345
|
if (!headerElem) {
|
|
13511
|
-
return
|
|
13346
|
+
return _this73.$nextTick();
|
|
13512
13347
|
}
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
return
|
|
13348
|
+
_this73.handleHeaderChecked([[headerElem.querySelector("." + (column && column.id))]]);
|
|
13349
|
+
_this73.handleIndexChecked([[cell && cell.parentNode && cell.parentNode.querySelector(".col__index")]]);
|
|
13350
|
+
return _this73.$nextTick();
|
|
13516
13351
|
};
|
|
13517
13352
|
selectMethod = debounce(20, selectMethod);
|
|
13518
13353
|
return selectMethod();
|
|
@@ -13934,7 +13769,7 @@ var Methods$b = {
|
|
|
13934
13769
|
},
|
|
13935
13770
|
// 当前行方向键移动处理
|
|
13936
13771
|
moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, event) {
|
|
13937
|
-
var
|
|
13772
|
+
var _this74 = this;
|
|
13938
13773
|
var afterFullData = this.afterFullData, currentRow = this.currentRow, treeConfig = this.treeConfig;
|
|
13939
13774
|
var targetRow;
|
|
13940
13775
|
event.preventDefault();
|
|
@@ -13957,8 +13792,8 @@ var Methods$b = {
|
|
|
13957
13792
|
}
|
|
13958
13793
|
if (targetRow) {
|
|
13959
13794
|
this.scrollToRow(targetRow).then(function() {
|
|
13960
|
-
return
|
|
13961
|
-
$table:
|
|
13795
|
+
return _this74.triggerCurrentRowEvent(event, {
|
|
13796
|
+
$table: _this74,
|
|
13962
13797
|
row: targetRow
|
|
13963
13798
|
});
|
|
13964
13799
|
});
|
|
@@ -13966,7 +13801,7 @@ var Methods$b = {
|
|
|
13966
13801
|
},
|
|
13967
13802
|
// 可编辑方向键移动处理
|
|
13968
13803
|
moveSelected: function moveSelected(_ref218) {
|
|
13969
|
-
var
|
|
13804
|
+
var _this75 = this;
|
|
13970
13805
|
var args = _ref218.args, isLeftArrow = _ref218.isLeftArrow, isUpArrow = _ref218.isUpArrow, isRightArrow = _ref218.isRightArrow, isDownArrow = _ref218.isDownArrow, event = _ref218.event;
|
|
13971
13806
|
var hasIndexColumn2 = this.hasIndexColumn, visibleColumn = this.tableColumn, tableData = this.tableFullData;
|
|
13972
13807
|
var params = _extends({}, args);
|
|
@@ -13996,8 +13831,8 @@ var Methods$b = {
|
|
|
13996
13831
|
}
|
|
13997
13832
|
getCell(this, params).then(function(resCell) {
|
|
13998
13833
|
params.cell = resCell;
|
|
13999
|
-
|
|
14000
|
-
|
|
13834
|
+
_this75.handleSelected(params, event);
|
|
13835
|
+
_this75.scrollToRow(params.row, params.column, false, {
|
|
14001
13836
|
isLeftArrow,
|
|
14002
13837
|
isRightArrow,
|
|
14003
13838
|
from: column
|
|
@@ -14006,7 +13841,7 @@ var Methods$b = {
|
|
|
14006
13841
|
},
|
|
14007
13842
|
// 表头按下事件
|
|
14008
13843
|
triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(event, params) {
|
|
14009
|
-
var
|
|
13844
|
+
var _this76 = this;
|
|
14010
13845
|
var $el = this.$el, elemStore = this.elemStore, _this$mouseConfig5 = this.mouseConfig, mouseConfig = _this$mouseConfig5 === void 0 ? {} : _this$mouseConfig5, tableData = this.tableData;
|
|
14011
13846
|
var headerList = elemStore["main-header-list"].children;
|
|
14012
13847
|
var bodyList = elemStore["main-body-list"].children;
|
|
@@ -14050,10 +13885,10 @@ var Methods$b = {
|
|
|
14050
13885
|
params.row = tableData[0];
|
|
14051
13886
|
getCell(this, params).then(function(cellRes) {
|
|
14052
13887
|
params.cell = cellRes;
|
|
14053
|
-
|
|
13888
|
+
_this76.handleSelected(params, event);
|
|
14054
13889
|
var rowNodes = getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(lastTr.querySelector(".col__index")));
|
|
14055
|
-
|
|
14056
|
-
|
|
13890
|
+
_this76.handleIndexChecked(rowNodes);
|
|
13891
|
+
_this76.handleChecked(getRowNodes(bodyList, getCellNodeIndex(startCell), getCellNodeIndex(lastCell)));
|
|
14057
13892
|
});
|
|
14058
13893
|
this.closeMenu();
|
|
14059
13894
|
},
|
|
@@ -14183,7 +14018,7 @@ var Methods$b = {
|
|
|
14183
14018
|
return this.$nextTick();
|
|
14184
14019
|
},
|
|
14185
14020
|
_getMouseCheckeds: function _getMouseCheckeds() {
|
|
14186
|
-
var
|
|
14021
|
+
var _this77 = this;
|
|
14187
14022
|
var _this$editStore$check = this.editStore.checked.rowNodes, rowNodes = _this$editStore$check === void 0 ? [] : _this$editStore$check;
|
|
14188
14023
|
var _ref219 = {}, _ref219$rows = _ref219.rows, rows = _ref219$rows === void 0 ? [] : _ref219$rows, _ref219$columns = _ref219.columns, columns2 = _ref219$columns === void 0 ? [] : _ref219$columns;
|
|
14189
14024
|
var res = {
|
|
@@ -14193,10 +14028,10 @@ var Methods$b = {
|
|
|
14193
14028
|
};
|
|
14194
14029
|
if (rowNodes && rowNodes.length) {
|
|
14195
14030
|
res.rows = rowNodes.map(function(arr) {
|
|
14196
|
-
return
|
|
14031
|
+
return _this77.getRowNode(arr[0].parentNode).item;
|
|
14197
14032
|
});
|
|
14198
14033
|
res.columns = rowNodes[0].map(function(col) {
|
|
14199
|
-
return
|
|
14034
|
+
return _this77.getColumnNode(col).item;
|
|
14200
14035
|
});
|
|
14201
14036
|
}
|
|
14202
14037
|
return res;
|
|
@@ -14249,7 +14084,7 @@ var Methods$b = {
|
|
|
14249
14084
|
this.editStore.checked.rowNodes = rowNodes;
|
|
14250
14085
|
},
|
|
14251
14086
|
handleAllChecked: function handleAllChecked(event) {
|
|
14252
|
-
var
|
|
14087
|
+
var _this78 = this;
|
|
14253
14088
|
var elemStore = this.elemStore, _this$mouseConfig7 = this.mouseConfig, mouseConfig = _this$mouseConfig7 === void 0 ? {} : _this$mouseConfig7, tableData = this.tableData, visibleColumn = this.visibleColumn;
|
|
14254
14089
|
if (!mouseConfig.checked) {
|
|
14255
14090
|
return;
|
|
@@ -14277,10 +14112,10 @@ var Methods$b = {
|
|
|
14277
14112
|
params.columnIndex = this.getColumnIndex(params.column);
|
|
14278
14113
|
getCell(this, params).then(function(resCell) {
|
|
14279
14114
|
params.cell = resCell;
|
|
14280
|
-
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14115
|
+
_this78.handleSelected(params, event);
|
|
14116
|
+
_this78.handleHeaderChecked(getRowNodes(headerList, getCellNodeIndex(cell.nextElementSibling), getCellNodeIndex(cell.parentNode.lastElementChild)));
|
|
14117
|
+
_this78.handleIndexChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell), getCellNodeIndex(lastTrElem.querySelector(selectorColumnId))));
|
|
14118
|
+
_this78.handleChecked(getRowNodes(bodyList, getCellNodeIndex(firstCell.nextElementSibling), getCellNodeIndex(lastTrElem.lastElementChild)));
|
|
14284
14119
|
});
|
|
14285
14120
|
},
|
|
14286
14121
|
handleIndexChecked: function handleIndexChecked(rowNodes) {
|
|
@@ -14619,17 +14454,17 @@ var Methods$a = {
|
|
|
14619
14454
|
},
|
|
14620
14455
|
// 聚焦到校验通过的单元格并弹出校验错误提示
|
|
14621
14456
|
handleValidError: function handleValidError(params) {
|
|
14622
|
-
var
|
|
14457
|
+
var _this79 = this;
|
|
14623
14458
|
var event = {
|
|
14624
14459
|
type: "valid-error",
|
|
14625
14460
|
trigger: "call"
|
|
14626
14461
|
};
|
|
14627
14462
|
this.handleActived(params, event).then(function() {
|
|
14628
|
-
return
|
|
14463
|
+
return _this79.showValidTooltip(params);
|
|
14629
14464
|
});
|
|
14630
14465
|
},
|
|
14631
14466
|
validatePromise: function validatePromise(row2, column, columnIndex, isAll, validRest) {
|
|
14632
|
-
var
|
|
14467
|
+
var _this80 = this;
|
|
14633
14468
|
function onrejected(_ref228) {
|
|
14634
14469
|
var _vm = _ref228._vm, reject = _ref228.reject, resolve = _ref228.resolve;
|
|
14635
14470
|
return function(_ref229) {
|
|
@@ -14652,8 +14487,8 @@ var Methods$a = {
|
|
|
14652
14487
|
};
|
|
14653
14488
|
}
|
|
14654
14489
|
return new Promise(function(resolve, reject) {
|
|
14655
|
-
|
|
14656
|
-
_vm:
|
|
14490
|
+
_this80.validCellRules("all", row2, column).then(resolve).catch(onrejected({
|
|
14491
|
+
_vm: _this80,
|
|
14657
14492
|
reject,
|
|
14658
14493
|
resolve
|
|
14659
14494
|
}));
|
|
@@ -14739,7 +14574,7 @@ var Methods$a = {
|
|
|
14739
14574
|
* @param { any } defaultValue 需要校验的默认值
|
|
14740
14575
|
*/
|
|
14741
14576
|
validCellRules: function validCellRules(type, row2, column, defaultValue) {
|
|
14742
|
-
var
|
|
14577
|
+
var _this81 = this;
|
|
14743
14578
|
var editRules = this.editRules, rowId = this.rowId;
|
|
14744
14579
|
var property = column.property;
|
|
14745
14580
|
var _ref232 = {}, _ref232$descriptor = _ref232.descriptor, descriptor = _ref232$descriptor === void 0 ? {} : _ref232$descriptor, _ref232$model = _ref232.model, model = _ref232$model === void 0 ? {} : _ref232$model;
|
|
@@ -14784,11 +14619,11 @@ var Methods$a = {
|
|
|
14784
14619
|
validator.validate(model, validArgs).then(resolve).catch(onRejected3);
|
|
14785
14620
|
};
|
|
14786
14621
|
var onFulfilled = function onFulfilled2() {
|
|
14787
|
-
|
|
14622
|
+
_this81.validatedMap[column.id + "-" + row2[rowId]] = false;
|
|
14788
14623
|
return Promise.resolve();
|
|
14789
14624
|
};
|
|
14790
14625
|
var onRejected22 = function onRejected23(errors) {
|
|
14791
|
-
|
|
14626
|
+
_this81.validatedMap[column.id + "-" + row2[rowId]] = true;
|
|
14792
14627
|
return Promise.reject(errors);
|
|
14793
14628
|
};
|
|
14794
14629
|
return new Promise(executor).then(onFulfilled).catch(onRejected22);
|
|
@@ -14807,7 +14642,7 @@ var Methods$a = {
|
|
|
14807
14642
|
},
|
|
14808
14643
|
// 触发校验
|
|
14809
14644
|
triggerValidate: function triggerValidate(type) {
|
|
14810
|
-
var
|
|
14645
|
+
var _this82 = this;
|
|
14811
14646
|
var editConfig = this.editConfig, editRules = this.editRules, editStore = this.editStore, validStore = this.validStore;
|
|
14812
14647
|
var actived = editStore.actived;
|
|
14813
14648
|
if (!actived.row || !editRules) {
|
|
@@ -14818,7 +14653,7 @@ var Methods$a = {
|
|
|
14818
14653
|
return Promise.resolve();
|
|
14819
14654
|
}
|
|
14820
14655
|
var onfulfilled = function onfulfilled2() {
|
|
14821
|
-
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column &&
|
|
14656
|
+
editConfig.mode === "row" && validStore.visible && validStore.row === row2 && validStore.column === column && _this82.clearValidate();
|
|
14822
14657
|
};
|
|
14823
14658
|
var onrejected = function onrejected2(_ref234) {
|
|
14824
14659
|
var rule = _ref234.rule;
|
|
@@ -14831,14 +14666,14 @@ var Methods$a = {
|
|
|
14831
14666
|
row: row2,
|
|
14832
14667
|
rule
|
|
14833
14668
|
};
|
|
14834
|
-
|
|
14669
|
+
_this82.showValidTooltip(rest);
|
|
14835
14670
|
return Promise.reject(rest);
|
|
14836
14671
|
};
|
|
14837
14672
|
return this.validCellRules(type, row2, column).then(onfulfilled).catch(onrejected);
|
|
14838
14673
|
},
|
|
14839
14674
|
// 弹出校验错误提示
|
|
14840
14675
|
showValidTooltip: function showValidTooltip(params) {
|
|
14841
|
-
var
|
|
14676
|
+
var _this83 = this;
|
|
14842
14677
|
var $refs = this.$refs, height2 = this.height, tableData = this.tableData, validOpts2 = this.validOpts;
|
|
14843
14678
|
var cell = params.cell, column = params.column, row2 = params.row, rule = params.rule;
|
|
14844
14679
|
var content = rule.message;
|
|
@@ -14846,7 +14681,7 @@ var Methods$a = {
|
|
|
14846
14681
|
var isMessageTooltip = validOpts2.isMessageTooltip, isMessageDefault = validOpts2.isMessageDefault, isMessageInline = validOpts2.isMessageInline;
|
|
14847
14682
|
var showMsg = isMessageTooltip || isMessageDefault && !height2 && tableData.length < 2;
|
|
14848
14683
|
this.$nextTick(function() {
|
|
14849
|
-
Object.assign(
|
|
14684
|
+
Object.assign(_this83.validStore, {
|
|
14850
14685
|
row: row2,
|
|
14851
14686
|
column,
|
|
14852
14687
|
rule,
|
|
@@ -14854,19 +14689,19 @@ var Methods$a = {
|
|
|
14854
14689
|
visible: true
|
|
14855
14690
|
});
|
|
14856
14691
|
if (validTip && showMsg) {
|
|
14857
|
-
|
|
14858
|
-
|
|
14692
|
+
_this83.clostValidTooltip();
|
|
14693
|
+
_this83.validTipContent = content;
|
|
14859
14694
|
validTip.state.referenceElm = cell;
|
|
14860
14695
|
validTip.$refs.popper && (validTip.$refs.popper.style.display = "none");
|
|
14861
14696
|
validTip.doDestroy();
|
|
14862
14697
|
validTip.setExpectedState(true);
|
|
14863
|
-
|
|
14698
|
+
_this83.activateTooltipValid(validTip);
|
|
14864
14699
|
} else if (isMessageInline) {
|
|
14865
|
-
|
|
14866
|
-
return
|
|
14700
|
+
_this83.$nextTick(function() {
|
|
14701
|
+
return _this83.recalculate();
|
|
14867
14702
|
});
|
|
14868
14703
|
}
|
|
14869
|
-
emitEvent(
|
|
14704
|
+
emitEvent(_this83, "valid-error", [params]);
|
|
14870
14705
|
});
|
|
14871
14706
|
},
|
|
14872
14707
|
// 关闭 validTip
|
|
@@ -14887,11 +14722,11 @@ var Validator = {
|
|
|
14887
14722
|
};
|
|
14888
14723
|
var Methods$9 = {
|
|
14889
14724
|
bindResize: function bindResize() {
|
|
14890
|
-
var
|
|
14725
|
+
var _this84 = this;
|
|
14891
14726
|
var resizeObserver = new Resize$1(function() {
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14727
|
+
_this84.updateParentHeight();
|
|
14728
|
+
_this84.updateTableBodyHeight();
|
|
14729
|
+
_this84.recalculate();
|
|
14895
14730
|
}, GlobalConfig$1.resizeInterval);
|
|
14896
14731
|
var parentElem = this.getParentElem();
|
|
14897
14732
|
parentElem && resizeObserver.observe(parentElem);
|
|
@@ -14936,7 +14771,7 @@ var Methods$8 = {
|
|
|
14936
14771
|
}
|
|
14937
14772
|
},
|
|
14938
14773
|
handleFetch: function handleFetch(code, sortArg) {
|
|
14939
|
-
var
|
|
14774
|
+
var _this85 = this;
|
|
14940
14775
|
var pager = this.pager, sortData = this.sortData, filterData = this.filterData, pagerConfig = this.pagerConfig, fetchOption = this.fetchOption, fetchData = this.fetchData, dataset = this.dataset;
|
|
14941
14776
|
if (this.isInitialLoading) {
|
|
14942
14777
|
this.isInitialLoading = false;
|
|
@@ -14995,7 +14830,7 @@ var Methods$8 = {
|
|
|
14995
14830
|
}, params);
|
|
14996
14831
|
}
|
|
14997
14832
|
return search.then(this.loadFetchData).catch(function(error2) {
|
|
14998
|
-
|
|
14833
|
+
_this85.tableLoading = false;
|
|
14999
14834
|
throw error2;
|
|
15000
14835
|
});
|
|
15001
14836
|
},
|
|
@@ -15100,19 +14935,19 @@ var Methods$7 = {
|
|
|
15100
14935
|
return res;
|
|
15101
14936
|
},
|
|
15102
14937
|
pageChangeEvent: function pageChangeEvent(params) {
|
|
15103
|
-
var
|
|
14938
|
+
var _this86 = this;
|
|
15104
14939
|
this.tablePageLoading = true;
|
|
15105
14940
|
if (!this.tasks.updatePage) {
|
|
15106
14941
|
this.tasks.updatePage = debounce(200, function() {
|
|
15107
14942
|
var eventParams = _extends({
|
|
15108
|
-
$grid:
|
|
14943
|
+
$grid: _this86
|
|
15109
14944
|
}, params);
|
|
15110
|
-
var toolbarVm =
|
|
15111
|
-
emitEvent(
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
14945
|
+
var toolbarVm = _this86.getVm("toolbar");
|
|
14946
|
+
emitEvent(_this86, "page-change", eventParams);
|
|
14947
|
+
_this86.emitter.emit("page-change", eventParams);
|
|
14948
|
+
_this86.handleFetch("query").then(function() {
|
|
14949
|
+
_this86.realTimeTablePage = _extends({}, _this86.tablePage);
|
|
14950
|
+
_this86.tablePageLoading = false;
|
|
15116
14951
|
});
|
|
15117
14952
|
if (toolbarVm) {
|
|
15118
14953
|
toolbarVm.orderSetting();
|
|
@@ -15134,7 +14969,7 @@ var Methods$7 = {
|
|
|
15134
14969
|
}
|
|
15135
14970
|
},
|
|
15136
14971
|
beforePageChangeHandler: function beforePageChangeHandler(params) {
|
|
15137
|
-
var
|
|
14972
|
+
var _this87 = this;
|
|
15138
14973
|
if (!this.showSaveMsg) {
|
|
15139
14974
|
var eventParams = extend(false, {
|
|
15140
14975
|
$grid: this
|
|
@@ -15149,8 +14984,8 @@ var Methods$7 = {
|
|
|
15149
14984
|
var next = function next2(res) {
|
|
15150
14985
|
if (res === "confirm") {
|
|
15151
14986
|
rollback && rollback();
|
|
15152
|
-
emitEvent(
|
|
15153
|
-
|
|
14987
|
+
emitEvent(_this87, "cancel-page-change", _this87);
|
|
14988
|
+
_this87.emitter.emit("cancel-page-change", _this87);
|
|
15154
14989
|
} else {
|
|
15155
14990
|
callback && callback();
|
|
15156
14991
|
}
|
|
@@ -15248,7 +15083,7 @@ var Methods$6 = {
|
|
|
15248
15083
|
}();
|
|
15249
15084
|
},
|
|
15250
15085
|
handleSave: function handleSave(code, args) {
|
|
15251
|
-
var
|
|
15086
|
+
var _this88 = this;
|
|
15252
15087
|
var saveData = this.saveData, isMsg2 = this.isMsg;
|
|
15253
15088
|
if (!saveData) {
|
|
15254
15089
|
error("ui.grid.error.notSave");
|
|
@@ -15266,7 +15101,7 @@ var Methods$6 = {
|
|
|
15266
15101
|
return;
|
|
15267
15102
|
}
|
|
15268
15103
|
var canInvoke = invokeSaveDataApi({
|
|
15269
|
-
_vm:
|
|
15104
|
+
_vm: _this88,
|
|
15270
15105
|
args,
|
|
15271
15106
|
body,
|
|
15272
15107
|
code,
|
|
@@ -15277,7 +15112,7 @@ var Methods$6 = {
|
|
|
15277
15112
|
valid
|
|
15278
15113
|
});
|
|
15279
15114
|
doRemoveOrShowMsg({
|
|
15280
|
-
_vm:
|
|
15115
|
+
_vm: _this88,
|
|
15281
15116
|
canInvoke,
|
|
15282
15117
|
code,
|
|
15283
15118
|
isMsg: isMsg2,
|
|
@@ -15293,11 +15128,11 @@ var Methods$6 = {
|
|
|
15293
15128
|
pendingRecords
|
|
15294
15129
|
});
|
|
15295
15130
|
return new Promise(function(resolve) {
|
|
15296
|
-
|
|
15131
|
+
_this88.validate(validRows, getCallback(resolve));
|
|
15297
15132
|
});
|
|
15298
15133
|
},
|
|
15299
15134
|
handleDelete: function handleDelete(code, args) {
|
|
15300
|
-
var
|
|
15135
|
+
var _this89 = this;
|
|
15301
15136
|
var deleteData = this.deleteData, isMsg2 = this.isMsg;
|
|
15302
15137
|
if (!deleteData) {
|
|
15303
15138
|
error("ui.grid.error.notDelete");
|
|
@@ -15305,7 +15140,7 @@ var Methods$6 = {
|
|
|
15305
15140
|
}
|
|
15306
15141
|
var selecteds = this.getSelectRecords(true);
|
|
15307
15142
|
var afterRemove = function afterRemove2() {
|
|
15308
|
-
var removeds =
|
|
15143
|
+
var removeds = _this89.getRemoveRecords();
|
|
15309
15144
|
if (!removeds.length && isMsg2 && !selecteds.length) {
|
|
15310
15145
|
Modal$1.message({
|
|
15311
15146
|
id: code,
|
|
@@ -15315,34 +15150,34 @@ var Methods$6 = {
|
|
|
15315
15150
|
}
|
|
15316
15151
|
if (removeds.length) {
|
|
15317
15152
|
var apiArgs = [{
|
|
15318
|
-
$grid:
|
|
15153
|
+
$grid: _this89,
|
|
15319
15154
|
changeRecords: {
|
|
15320
15155
|
removeRecords: removeds
|
|
15321
15156
|
}
|
|
15322
15157
|
}].concat(args);
|
|
15323
15158
|
var stopLoading = function stopLoading2() {
|
|
15324
|
-
|
|
15159
|
+
_this89.tableLoading = false;
|
|
15325
15160
|
};
|
|
15326
|
-
|
|
15327
|
-
return deleteData.api.apply(
|
|
15328
|
-
return
|
|
15161
|
+
_this89.tableLoading = true;
|
|
15162
|
+
return deleteData.api.apply(_this89, apiArgs).then(stopLoading).catch(stopLoading).then(function() {
|
|
15163
|
+
return _this89.commitProxy("reload");
|
|
15329
15164
|
});
|
|
15330
15165
|
}
|
|
15331
15166
|
};
|
|
15332
15167
|
this.remove(selecteds).then(afterRemove);
|
|
15333
15168
|
},
|
|
15334
15169
|
handleFullScreen: function handleFullScreen(_ref242) {
|
|
15335
|
-
var
|
|
15170
|
+
var _this90 = this;
|
|
15336
15171
|
var show2 = _ref242[0];
|
|
15337
15172
|
this.fullScreenClass = show2 ? "tiny-fullscreen-full" : "";
|
|
15338
15173
|
this.$nextTick(function() {
|
|
15339
|
-
|
|
15340
|
-
emitEvent(
|
|
15341
|
-
|
|
15174
|
+
_this90.recalculate(true);
|
|
15175
|
+
emitEvent(_this90, "fullscreen", show2);
|
|
15176
|
+
_this90.emitter.emit("fullscreen", show2);
|
|
15342
15177
|
});
|
|
15343
15178
|
},
|
|
15344
15179
|
commitProxy: function commitProxy(code) {
|
|
15345
|
-
var
|
|
15180
|
+
var _this91 = this;
|
|
15346
15181
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
15347
15182
|
args[_key2 - 1] = arguments[_key2];
|
|
15348
15183
|
}
|
|
@@ -15352,17 +15187,17 @@ var Methods$6 = {
|
|
|
15352
15187
|
} else if (code === "insert_actived") {
|
|
15353
15188
|
this.insert().then(function(_ref243) {
|
|
15354
15189
|
var row2 = _ref243.row;
|
|
15355
|
-
return
|
|
15190
|
+
return _this91.setActiveRow(row2);
|
|
15356
15191
|
});
|
|
15357
15192
|
} else if (code === "mark_cancel") {
|
|
15358
15193
|
this.triggerPendingEvent(code);
|
|
15359
15194
|
} else if (code === "delete_selection") {
|
|
15360
15195
|
this.handleDeleteRow(code, "ui.grid.deleteSelectRecord", function() {
|
|
15361
|
-
return
|
|
15196
|
+
return _this91.commitProxy(["delete"].concat(args));
|
|
15362
15197
|
});
|
|
15363
15198
|
} else if (code === "remove_selection") {
|
|
15364
15199
|
this.handleDeleteRow(code, "ui.grid.removeSelectRecord", function() {
|
|
15365
|
-
return
|
|
15200
|
+
return _this91.removeSelecteds();
|
|
15366
15201
|
});
|
|
15367
15202
|
} else if (code === "export") {
|
|
15368
15203
|
this.exportCsv();
|
|
@@ -15470,9 +15305,9 @@ var Methods$5 = {
|
|
|
15470
15305
|
key: _vm.columnAnchorKey,
|
|
15471
15306
|
ref: "tinyGridColumnAnchor"
|
|
15472
15307
|
}, anchors.map(function(anchor) {
|
|
15473
|
-
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,
|
|
15474
|
-
if (typeof
|
|
15475
|
-
return
|
|
15308
|
+
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;
|
|
15309
|
+
if (typeof render18 === "function") {
|
|
15310
|
+
return render18({
|
|
15476
15311
|
h,
|
|
15477
15312
|
anchor,
|
|
15478
15313
|
action
|
|
@@ -15532,7 +15367,7 @@ var Methods$5 = {
|
|
|
15532
15367
|
}
|
|
15533
15368
|
},
|
|
15534
15369
|
buildColumnAnchorParams: function buildColumnAnchorParams() {
|
|
15535
|
-
var
|
|
15370
|
+
var _this92 = this;
|
|
15536
15371
|
var columnAnchor = this.columnAnchor;
|
|
15537
15372
|
var anchors = [];
|
|
15538
15373
|
var activeAnchor = {
|
|
@@ -15542,19 +15377,19 @@ var Methods$5 = {
|
|
|
15542
15377
|
if (Array.isArray(columnAnchor) && columnAnchor.length) {
|
|
15543
15378
|
columnAnchor.forEach(function(item) {
|
|
15544
15379
|
if (typeof item === "string") {
|
|
15545
|
-
|
|
15380
|
+
_this92.buildColumnAnchor({
|
|
15546
15381
|
property: item,
|
|
15547
15382
|
anchors
|
|
15548
15383
|
});
|
|
15549
15384
|
} else if (Array.isArray(item)) {
|
|
15550
|
-
if (item.length > 1)
|
|
15385
|
+
if (item.length > 1) _this92.buildColumnAnchor({
|
|
15551
15386
|
property: item[0],
|
|
15552
15387
|
label: item[1],
|
|
15553
15388
|
anchors
|
|
15554
15389
|
});
|
|
15555
15390
|
} else if (item && typeof item === "object") {
|
|
15556
15391
|
var field = item.field, other = _objectWithoutPropertiesLoose(item, _excluded2);
|
|
15557
|
-
|
|
15392
|
+
_this92.buildColumnAnchor({
|
|
15558
15393
|
property: field,
|
|
15559
15394
|
label: other,
|
|
15560
15395
|
anchors,
|
|
@@ -15570,19 +15405,19 @@ var Methods$5 = {
|
|
|
15570
15405
|
anchors,
|
|
15571
15406
|
activeAnchor,
|
|
15572
15407
|
action: function action(field, e) {
|
|
15573
|
-
return
|
|
15408
|
+
return _this92.anchorAction({
|
|
15574
15409
|
field,
|
|
15575
15410
|
anchors,
|
|
15576
|
-
_vm:
|
|
15411
|
+
_vm: _this92,
|
|
15577
15412
|
e
|
|
15578
15413
|
});
|
|
15579
15414
|
}
|
|
15580
15415
|
};
|
|
15581
15416
|
this.emitter.once("active-anchor", function() {
|
|
15582
|
-
return
|
|
15417
|
+
return _this92.anchorAction({
|
|
15583
15418
|
field: activeAnchor.field,
|
|
15584
15419
|
anchors,
|
|
15585
|
-
_vm:
|
|
15420
|
+
_vm: _this92
|
|
15586
15421
|
});
|
|
15587
15422
|
});
|
|
15588
15423
|
},
|
|
@@ -15729,7 +15564,7 @@ var getSortColumns = function getSortColumns2(columns2) {
|
|
|
15729
15564
|
var Methods$4 = {
|
|
15730
15565
|
// 处理列拖拽
|
|
15731
15566
|
columnDrop: function columnDrop(headerEl) {
|
|
15732
|
-
var
|
|
15567
|
+
var _this93 = this;
|
|
15733
15568
|
var _ref250 = this.dropConfig || {}, plugin = _ref250.plugin, onBeforeMove = _ref250.onBeforeMove, filter2 = _ref250.filter;
|
|
15734
15569
|
var columnDropContainer = headerEl.querySelector(".tiny-grid__header .tiny-grid-header__row");
|
|
15735
15570
|
var columnDropOptions = {
|
|
@@ -15737,7 +15572,7 @@ var Methods$4 = {
|
|
|
15737
15572
|
filter: filter2,
|
|
15738
15573
|
onEnd: function onEnd(event) {
|
|
15739
15574
|
var item = event.item, newIndex = event.newIndex, oldIndex = event.oldIndex;
|
|
15740
|
-
var
|
|
15575
|
+
var _this93$getTableColum = _this93.getTableColumn(), fullColumn = _this93$getTableColum.fullColumn, tableColumn3 = _this93$getTableColum.tableColumn;
|
|
15741
15576
|
var sortVisibleCols = getSortColumns(tableColumn3);
|
|
15742
15577
|
var targetThElem = item;
|
|
15743
15578
|
var wrapperElem = targetThElem.parentNode;
|
|
@@ -15758,21 +15593,21 @@ var Methods$4 = {
|
|
|
15758
15593
|
status: "error"
|
|
15759
15594
|
});
|
|
15760
15595
|
}
|
|
15761
|
-
var oldColumnIndex =
|
|
15762
|
-
var newColumnIndex =
|
|
15596
|
+
var oldColumnIndex = _this93.getColumnIndex(sortVisibleCols[oldIndex]);
|
|
15597
|
+
var newColumnIndex = _this93.getColumnIndex(sortVisibleCols[newIndex]);
|
|
15763
15598
|
var currCol = fullColumn.splice(oldColumnIndex, 1)[0];
|
|
15764
15599
|
fullColumn.splice(newColumnIndex, 0, currCol);
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
var toolbarVm =
|
|
15768
|
-
|
|
15600
|
+
_this93.loadColumn(fullColumn);
|
|
15601
|
+
_this93.$emit("column-drop-end", event, _this93);
|
|
15602
|
+
var toolbarVm = _this93.getVm("toolbar");
|
|
15603
|
+
_this93.isDragHeaderSorting && toolbarVm && toolbarVm.updateSetting();
|
|
15769
15604
|
},
|
|
15770
15605
|
onStart: function onStart(event) {
|
|
15771
|
-
|
|
15606
|
+
_this93.$emit("column-drop-start", event, _this93);
|
|
15772
15607
|
},
|
|
15773
15608
|
onMove: function onMove(event) {
|
|
15774
|
-
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("column", null, event,
|
|
15775
|
-
|
|
15609
|
+
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("column", null, event, _this93) : true;
|
|
15610
|
+
_this93.$emit("column-drop-move", event, _this93);
|
|
15776
15611
|
return cancel === void 0 || cancel;
|
|
15777
15612
|
}
|
|
15778
15613
|
};
|
|
@@ -15780,7 +15615,7 @@ var Methods$4 = {
|
|
|
15780
15615
|
},
|
|
15781
15616
|
// 处理行拖拽
|
|
15782
15617
|
rowDrop: function rowDrop(bodyEl) {
|
|
15783
|
-
var
|
|
15618
|
+
var _this94 = this;
|
|
15784
15619
|
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;
|
|
15785
15620
|
var rowDropContainer = bodyEl.querySelector(".tiny-grid__body tbody");
|
|
15786
15621
|
var handle = trigger || ".tiny-grid-body__row";
|
|
@@ -15795,15 +15630,15 @@ var Methods$4 = {
|
|
|
15795
15630
|
refresh
|
|
15796
15631
|
}),
|
|
15797
15632
|
onStart: function onStart(event) {
|
|
15798
|
-
|
|
15633
|
+
_this94.$emit("row-drop-start", event, _this94);
|
|
15799
15634
|
},
|
|
15800
15635
|
onMove: function onMove(event) {
|
|
15801
|
-
var insertRecords =
|
|
15636
|
+
var insertRecords = _this94.getInsertRecords();
|
|
15802
15637
|
if (insertRecords.length) return false;
|
|
15803
15638
|
var dragged = event.dragged;
|
|
15804
|
-
var selfRow =
|
|
15805
|
-
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("row", selfRow, event,
|
|
15806
|
-
|
|
15639
|
+
var selfRow = _this94.getRowNode(dragged).item;
|
|
15640
|
+
var cancel = typeof onBeforeMove === "function" ? onBeforeMove("row", selfRow, event, _this94) : true;
|
|
15641
|
+
_this94.$emit("row-drop-move", event, _this94);
|
|
15807
15642
|
return cancel === void 0 || cancel;
|
|
15808
15643
|
}
|
|
15809
15644
|
};
|
|
@@ -16354,13 +16189,13 @@ var Methods$1 = {
|
|
|
16354
16189
|
}
|
|
16355
16190
|
},
|
|
16356
16191
|
setSelection: function setSelection(rows, value) {
|
|
16357
|
-
var
|
|
16192
|
+
var _this95 = this;
|
|
16358
16193
|
if (rows) {
|
|
16359
16194
|
if (!isArray(rows)) {
|
|
16360
16195
|
rows = [rows];
|
|
16361
16196
|
}
|
|
16362
16197
|
rows.forEach(function(row2) {
|
|
16363
|
-
return
|
|
16198
|
+
return _this95.handleSelectRow({
|
|
16364
16199
|
row: row2
|
|
16365
16200
|
}, !!value);
|
|
16366
16201
|
});
|
|
@@ -16643,7 +16478,7 @@ var Checkbox = {
|
|
|
16643
16478
|
var Methods = {
|
|
16644
16479
|
// 展开树节点事件
|
|
16645
16480
|
triggerTreeExpandEvent: function triggerTreeExpandEvent(event, _ref276) {
|
|
16646
|
-
var
|
|
16481
|
+
var _this96 = this;
|
|
16647
16482
|
var row2 = _ref276.row;
|
|
16648
16483
|
var currentColumn = this.currentColumn, currentRow = this.currentRow;
|
|
16649
16484
|
var rest = this.toggleTreeExpansion(row2);
|
|
@@ -16655,9 +16490,9 @@ var Methods = {
|
|
|
16655
16490
|
emitEvent(this, "toggle-tree-change", [eventParams, event]);
|
|
16656
16491
|
this.$nextTick(function() {
|
|
16657
16492
|
if (currentRow) {
|
|
16658
|
-
|
|
16493
|
+
_this96.setCurrentRow(currentRow);
|
|
16659
16494
|
} else if (currentColumn) {
|
|
16660
|
-
|
|
16495
|
+
_this96.setCurrentColumn(currentColumn);
|
|
16661
16496
|
}
|
|
16662
16497
|
});
|
|
16663
16498
|
return rest;
|
|
@@ -16668,7 +16503,7 @@ var Methods = {
|
|
|
16668
16503
|
},
|
|
16669
16504
|
// 处理默认展开树节点
|
|
16670
16505
|
handleDefaultTreeExpand: function handleDefaultTreeExpand() {
|
|
16671
|
-
var
|
|
16506
|
+
var _this97 = this;
|
|
16672
16507
|
var tableFullData = this.tableFullData, treeConfig = this.treeConfig;
|
|
16673
16508
|
if (!treeConfig) {
|
|
16674
16509
|
return;
|
|
@@ -16683,7 +16518,7 @@ var Methods = {
|
|
|
16683
16518
|
filterTree(tableFullData, function(row2) {
|
|
16684
16519
|
return isNonEmptyArr(row2[children]) && treeExpandeds.push(row2);
|
|
16685
16520
|
}, treeConfig);
|
|
16686
|
-
|
|
16521
|
+
_this97.treeExpandeds = treeExpandeds;
|
|
16687
16522
|
};
|
|
16688
16523
|
var doExpandRows = function doExpandRows2() {
|
|
16689
16524
|
rowids.forEach(function(rowid2) {
|
|
@@ -16692,7 +16527,7 @@ var Methods = {
|
|
|
16692
16527
|
}, treeConfig);
|
|
16693
16528
|
matchObj && isNonEmptyArr(matchObj.item[children]) && treeExpandeds.push(matchObj.item);
|
|
16694
16529
|
});
|
|
16695
|
-
|
|
16530
|
+
_this97.treeExpandeds = treeExpandeds;
|
|
16696
16531
|
};
|
|
16697
16532
|
if (expandAll) {
|
|
16698
16533
|
doExpandAll();
|
|
@@ -16760,12 +16595,12 @@ var Methods = {
|
|
|
16760
16595
|
return ~this.treeExpandeds.indexOf(row2);
|
|
16761
16596
|
},
|
|
16762
16597
|
clearTreeExpand: function clearTreeExpand() {
|
|
16763
|
-
var
|
|
16598
|
+
var _this98 = this;
|
|
16764
16599
|
var hasExpand = this.treeExpandeds.length;
|
|
16765
16600
|
this.treeExpandeds = [];
|
|
16766
16601
|
setTreeScrollYCache(this);
|
|
16767
16602
|
return this.$nextTick().then(function() {
|
|
16768
|
-
return hasExpand ?
|
|
16603
|
+
return hasExpand ? _this98.recalculate() : 0;
|
|
16769
16604
|
});
|
|
16770
16605
|
}
|
|
16771
16606
|
};
|
|
@@ -16775,7 +16610,7 @@ var Tree = {
|
|
|
16775
16610
|
Object.assign(host.methods, Methods);
|
|
16776
16611
|
}
|
|
16777
16612
|
};
|
|
16778
|
-
var version = "
|
|
16613
|
+
var version = "3.22.0";
|
|
16779
16614
|
var plugins = [Panel, Edit, Export, Keyboard, Validator, Resize, Panel$1, FetchData, Pager, Toolbar, ColumnAnchor, Dragger, Sort, Tooltip, Checkbox, Tree];
|
|
16780
16615
|
Grid$1.setup({
|
|
16781
16616
|
i18n: t
|