@weitutech/by-components 1.1.129 → 1.1.131
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/by-components.common.js +102 -20
- package/lib/by-components.umd.js +102 -20
- package/lib/by-components.umd.min.js +1 -1
- package/package.json +1 -1
|
@@ -60751,8 +60751,8 @@ var component = normalizeComponent(
|
|
|
60751
60751
|
)
|
|
60752
60752
|
|
|
60753
60753
|
/* harmony default export */ var pager = (component.exports);
|
|
60754
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=
|
|
60755
|
-
var
|
|
60754
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=5b90b233
|
|
60755
|
+
var tablevue_type_template_id_5b90b233_render = function render() {
|
|
60756
60756
|
var _vm = this,
|
|
60757
60757
|
_c = _vm._self._c;
|
|
60758
60758
|
return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
|
|
@@ -60826,7 +60826,7 @@ var tablevue_type_template_id_d8d0f56a_render = function render() {
|
|
|
60826
60826
|
}
|
|
60827
60827
|
}) : _vm._e()], 1);
|
|
60828
60828
|
};
|
|
60829
|
-
var
|
|
60829
|
+
var tablevue_type_template_id_5b90b233_staticRenderFns = [];
|
|
60830
60830
|
|
|
60831
60831
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
60832
60832
|
var es_array_push = __webpack_require__(4114);
|
|
@@ -61874,6 +61874,9 @@ var custom_column_component = normalizeComponent(
|
|
|
61874
61874
|
this.checkDeviceType();
|
|
61875
61875
|
this.initResizeListener();
|
|
61876
61876
|
}
|
|
61877
|
+
|
|
61878
|
+
// 前端分页模式下初始化默认排序
|
|
61879
|
+
this.initDefaultSortForFrontendPagination();
|
|
61877
61880
|
},
|
|
61878
61881
|
beforeDestroy() {
|
|
61879
61882
|
// 确保只在客户端环境中移除事件监听
|
|
@@ -61896,6 +61899,7 @@ var custom_column_component = normalizeComponent(
|
|
|
61896
61899
|
handler() {
|
|
61897
61900
|
this.$nextTick(() => {
|
|
61898
61901
|
setTimeout(() => {
|
|
61902
|
+
var _this$gridOptions$pag, _this$gridOptions$sor;
|
|
61899
61903
|
if (this.$refs.xGrid && this.$refs.xGrid.refreshScroll) {
|
|
61900
61904
|
this.$refs.xGrid.refreshScroll(); // 刷新滚动布局
|
|
61901
61905
|
}
|
|
@@ -61905,13 +61909,19 @@ var custom_column_component = normalizeComponent(
|
|
|
61905
61909
|
left: 0
|
|
61906
61910
|
});
|
|
61907
61911
|
}
|
|
61908
|
-
|
|
61909
|
-
|
|
61910
|
-
|
|
61911
|
-
|
|
61912
|
-
|
|
61913
|
-
|
|
61914
|
-
|
|
61912
|
+
|
|
61913
|
+
// 前端分页或前端排序模式下,数据变化时确保默认排序高亮
|
|
61914
|
+
if ((_this$gridOptions$pag = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag !== void 0 && _this$gridOptions$pag.frontendPagination || (_this$gridOptions$sor = this.gridOptions.sortConfig) !== null && _this$gridOptions$sor !== void 0 && _this$gridOptions$sor.frontendSort) {
|
|
61915
|
+
this.ensureDefaultSortHighlight();
|
|
61916
|
+
} else {
|
|
61917
|
+
// 后端模式,恢复之前的排序高亮
|
|
61918
|
+
if (this.sortState.field && this.sortState.order && this.$refs.xGrid) {
|
|
61919
|
+
setTimeout(() => {
|
|
61920
|
+
this.$refs.xGrid.sort(this.sortState.field, this.sortState.order, {
|
|
61921
|
+
silent: true
|
|
61922
|
+
});
|
|
61923
|
+
}, 100);
|
|
61924
|
+
}
|
|
61915
61925
|
}
|
|
61916
61926
|
}, 0);
|
|
61917
61927
|
});
|
|
@@ -62121,9 +62131,9 @@ var custom_column_component = normalizeComponent(
|
|
|
62121
62131
|
* @param values 分页参数
|
|
62122
62132
|
*/
|
|
62123
62133
|
pageChange(values) {
|
|
62124
|
-
var _this$gridOptions$
|
|
62134
|
+
var _this$gridOptions$pag2;
|
|
62125
62135
|
// 前端分页
|
|
62126
|
-
if ((_this$gridOptions$
|
|
62136
|
+
if ((_this$gridOptions$pag2 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag2 !== void 0 && _this$gridOptions$pag2.frontendPagination) {
|
|
62127
62137
|
setTimeout(() => {
|
|
62128
62138
|
const newData = this.spliteListData(this.allData, values.page, values.limit);
|
|
62129
62139
|
this.$refs.xGrid.reloadData(newData);
|
|
@@ -62347,19 +62357,19 @@ var custom_column_component = normalizeComponent(
|
|
|
62347
62357
|
* @param event
|
|
62348
62358
|
*/
|
|
62349
62359
|
handleSortChange(event) {
|
|
62350
|
-
var _this$gridOptions$
|
|
62360
|
+
var _this$gridOptions$pag3, _this$gridOptions$sor2;
|
|
62351
62361
|
const {
|
|
62352
62362
|
property,
|
|
62353
62363
|
order
|
|
62354
62364
|
} = event;
|
|
62355
|
-
const shouldHandleSort = ((_this$gridOptions$
|
|
62365
|
+
const shouldHandleSort = ((_this$gridOptions$pag3 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag3 === void 0 ? void 0 : _this$gridOptions$pag3.frontendPagination) || ((_this$gridOptions$sor2 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor2 === void 0 ? void 0 : _this$gridOptions$sor2.frontendSort);
|
|
62356
62366
|
|
|
62357
62367
|
// 无论前端还是后端分页,都保存排序状态用于恢复箭头高亮
|
|
62358
62368
|
this.sortState.field = property;
|
|
62359
62369
|
this.sortState.order = order;
|
|
62360
62370
|
if (shouldHandleSort) {
|
|
62361
|
-
var _this$gridOptions$
|
|
62362
|
-
const newData = this.spliteListData(this.allData, (_this$gridOptions$
|
|
62371
|
+
var _this$gridOptions$pag4, _this$gridOptions$pag5;
|
|
62372
|
+
const newData = this.spliteListData(this.allData, (_this$gridOptions$pag4 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag4 !== void 0 && _this$gridOptions$pag4.frontendPagination ? this.gridOptions.pagerConfig.currentPage : null, (_this$gridOptions$pag5 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag5 !== void 0 && _this$gridOptions$pag5.frontendPagination ? this.gridOptions.pagerConfig.pageSize : null);
|
|
62363
62373
|
if (this.$refs.xGrid) {
|
|
62364
62374
|
this.$refs.xGrid.reloadData(newData);
|
|
62365
62375
|
this.$nextTick(() => {
|
|
@@ -62372,8 +62382,8 @@ var custom_column_component = normalizeComponent(
|
|
|
62372
62382
|
}, 100);
|
|
62373
62383
|
}
|
|
62374
62384
|
setTimeout(() => {
|
|
62375
|
-
var _this$gridOptions$
|
|
62376
|
-
if ((_this$gridOptions$
|
|
62385
|
+
var _this$gridOptions$pag6;
|
|
62386
|
+
if ((_this$gridOptions$pag6 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag6 !== void 0 && _this$gridOptions$pag6.frontendPagination && this.$refs.xGrid) {
|
|
62377
62387
|
// 前端分页时,排序状态变化,回到第一页
|
|
62378
62388
|
const currentPage = this.gridOptions.pagerConfig.currentPage;
|
|
62379
62389
|
if (currentPage !== 1) {
|
|
@@ -62416,6 +62426,78 @@ var custom_column_component = normalizeComponent(
|
|
|
62416
62426
|
silent: true
|
|
62417
62427
|
});
|
|
62418
62428
|
}, 100);
|
|
62429
|
+
|
|
62430
|
+
// 🔧 修复:重置后自动应用默认排序(支持虚拟滚动和前端分页)
|
|
62431
|
+
this.$nextTick(() => {
|
|
62432
|
+
var _this$gridOptions$sor3;
|
|
62433
|
+
const defaultSort = (_this$gridOptions$sor3 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor3 === void 0 ? void 0 : _this$gridOptions$sor3.defaultSort;
|
|
62434
|
+
if (defaultSort && defaultSort.field && defaultSort.order) {
|
|
62435
|
+
this.sortState.field = defaultSort.field;
|
|
62436
|
+
this.sortState.order = defaultSort.order;
|
|
62437
|
+
setTimeout(() => {
|
|
62438
|
+
if (this.$refs.xGrid) {
|
|
62439
|
+
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62440
|
+
silent: true
|
|
62441
|
+
});
|
|
62442
|
+
}
|
|
62443
|
+
}, 150);
|
|
62444
|
+
}
|
|
62445
|
+
});
|
|
62446
|
+
},
|
|
62447
|
+
/**
|
|
62448
|
+
* 初始化默认排序(支持前端分页和虚拟滚动)
|
|
62449
|
+
*/
|
|
62450
|
+
initDefaultSortForFrontendPagination() {
|
|
62451
|
+
var _this$gridOptions$pag7, _this$gridOptions$sor4, _this$gridOptions$sor5;
|
|
62452
|
+
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62453
|
+
const shouldInitSort = ((_this$gridOptions$pag7 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag7 === void 0 ? void 0 : _this$gridOptions$pag7.frontendPagination) || ((_this$gridOptions$sor4 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor4 === void 0 ? void 0 : _this$gridOptions$sor4.frontendSort);
|
|
62454
|
+
if (!shouldInitSort) {
|
|
62455
|
+
return;
|
|
62456
|
+
}
|
|
62457
|
+
const defaultSort = (_this$gridOptions$sor5 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor5 === void 0 ? void 0 : _this$gridOptions$sor5.defaultSort;
|
|
62458
|
+
if (defaultSort && defaultSort.field && defaultSort.order) {
|
|
62459
|
+
// 设置排序状态
|
|
62460
|
+
this.sortState.field = defaultSort.field;
|
|
62461
|
+
this.sortState.order = defaultSort.order;
|
|
62462
|
+
|
|
62463
|
+
// 在下一个tick中应用排序高亮
|
|
62464
|
+
this.$nextTick(() => {
|
|
62465
|
+
if (this.$refs.xGrid) {
|
|
62466
|
+
setTimeout(() => {
|
|
62467
|
+
// 只高亮排序图标,不触发排序事件
|
|
62468
|
+
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62469
|
+
silent: true
|
|
62470
|
+
});
|
|
62471
|
+
}, 100);
|
|
62472
|
+
}
|
|
62473
|
+
});
|
|
62474
|
+
}
|
|
62475
|
+
},
|
|
62476
|
+
/**
|
|
62477
|
+
* 确保默认排序高亮(数据变化时调用,支持前端分页和虚拟滚动)
|
|
62478
|
+
*/
|
|
62479
|
+
ensureDefaultSortHighlight() {
|
|
62480
|
+
var _this$gridOptions$pag8, _this$gridOptions$sor6, _this$gridOptions$sor7;
|
|
62481
|
+
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62482
|
+
const shouldEnsureSort = ((_this$gridOptions$pag8 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag8 === void 0 ? void 0 : _this$gridOptions$pag8.frontendPagination) || ((_this$gridOptions$sor6 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor6 === void 0 ? void 0 : _this$gridOptions$sor6.frontendSort);
|
|
62483
|
+
if (!shouldEnsureSort) {
|
|
62484
|
+
return;
|
|
62485
|
+
}
|
|
62486
|
+
const defaultSort = (_this$gridOptions$sor7 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor7 === void 0 ? void 0 : _this$gridOptions$sor7.defaultSort;
|
|
62487
|
+
if (defaultSort && defaultSort.field && defaultSort.order) {
|
|
62488
|
+
// 确保排序状态与默认排序一致
|
|
62489
|
+
this.sortState.field = defaultSort.field;
|
|
62490
|
+
this.sortState.order = defaultSort.order;
|
|
62491
|
+
|
|
62492
|
+
// 应用排序高亮
|
|
62493
|
+
if (this.$refs.xGrid) {
|
|
62494
|
+
setTimeout(() => {
|
|
62495
|
+
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62496
|
+
silent: true
|
|
62497
|
+
});
|
|
62498
|
+
}, 100);
|
|
62499
|
+
}
|
|
62500
|
+
}
|
|
62419
62501
|
}
|
|
62420
62502
|
}
|
|
62421
62503
|
});
|
|
@@ -62431,8 +62513,8 @@ var custom_column_component = normalizeComponent(
|
|
|
62431
62513
|
;
|
|
62432
62514
|
var table_component = normalizeComponent(
|
|
62433
62515
|
components_tablevue_type_script_lang_js,
|
|
62434
|
-
|
|
62435
|
-
|
|
62516
|
+
tablevue_type_template_id_5b90b233_render,
|
|
62517
|
+
tablevue_type_template_id_5b90b233_staticRenderFns,
|
|
62436
62518
|
false,
|
|
62437
62519
|
null,
|
|
62438
62520
|
null,
|
package/lib/by-components.umd.js
CHANGED
|
@@ -60761,8 +60761,8 @@ var component = normalizeComponent(
|
|
|
60761
60761
|
)
|
|
60762
60762
|
|
|
60763
60763
|
/* harmony default export */ var pager = (component.exports);
|
|
60764
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=
|
|
60765
|
-
var
|
|
60764
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=5b90b233
|
|
60765
|
+
var tablevue_type_template_id_5b90b233_render = function render() {
|
|
60766
60766
|
var _vm = this,
|
|
60767
60767
|
_c = _vm._self._c;
|
|
60768
60768
|
return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
|
|
@@ -60836,7 +60836,7 @@ var tablevue_type_template_id_d8d0f56a_render = function render() {
|
|
|
60836
60836
|
}
|
|
60837
60837
|
}) : _vm._e()], 1);
|
|
60838
60838
|
};
|
|
60839
|
-
var
|
|
60839
|
+
var tablevue_type_template_id_5b90b233_staticRenderFns = [];
|
|
60840
60840
|
|
|
60841
60841
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
60842
60842
|
var es_array_push = __webpack_require__(4114);
|
|
@@ -61884,6 +61884,9 @@ var custom_column_component = normalizeComponent(
|
|
|
61884
61884
|
this.checkDeviceType();
|
|
61885
61885
|
this.initResizeListener();
|
|
61886
61886
|
}
|
|
61887
|
+
|
|
61888
|
+
// 前端分页模式下初始化默认排序
|
|
61889
|
+
this.initDefaultSortForFrontendPagination();
|
|
61887
61890
|
},
|
|
61888
61891
|
beforeDestroy() {
|
|
61889
61892
|
// 确保只在客户端环境中移除事件监听
|
|
@@ -61906,6 +61909,7 @@ var custom_column_component = normalizeComponent(
|
|
|
61906
61909
|
handler() {
|
|
61907
61910
|
this.$nextTick(() => {
|
|
61908
61911
|
setTimeout(() => {
|
|
61912
|
+
var _this$gridOptions$pag, _this$gridOptions$sor;
|
|
61909
61913
|
if (this.$refs.xGrid && this.$refs.xGrid.refreshScroll) {
|
|
61910
61914
|
this.$refs.xGrid.refreshScroll(); // 刷新滚动布局
|
|
61911
61915
|
}
|
|
@@ -61915,13 +61919,19 @@ var custom_column_component = normalizeComponent(
|
|
|
61915
61919
|
left: 0
|
|
61916
61920
|
});
|
|
61917
61921
|
}
|
|
61918
|
-
|
|
61919
|
-
|
|
61920
|
-
|
|
61921
|
-
|
|
61922
|
-
|
|
61923
|
-
|
|
61924
|
-
|
|
61922
|
+
|
|
61923
|
+
// 前端分页或前端排序模式下,数据变化时确保默认排序高亮
|
|
61924
|
+
if ((_this$gridOptions$pag = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag !== void 0 && _this$gridOptions$pag.frontendPagination || (_this$gridOptions$sor = this.gridOptions.sortConfig) !== null && _this$gridOptions$sor !== void 0 && _this$gridOptions$sor.frontendSort) {
|
|
61925
|
+
this.ensureDefaultSortHighlight();
|
|
61926
|
+
} else {
|
|
61927
|
+
// 后端模式,恢复之前的排序高亮
|
|
61928
|
+
if (this.sortState.field && this.sortState.order && this.$refs.xGrid) {
|
|
61929
|
+
setTimeout(() => {
|
|
61930
|
+
this.$refs.xGrid.sort(this.sortState.field, this.sortState.order, {
|
|
61931
|
+
silent: true
|
|
61932
|
+
});
|
|
61933
|
+
}, 100);
|
|
61934
|
+
}
|
|
61925
61935
|
}
|
|
61926
61936
|
}, 0);
|
|
61927
61937
|
});
|
|
@@ -62131,9 +62141,9 @@ var custom_column_component = normalizeComponent(
|
|
|
62131
62141
|
* @param values 分页参数
|
|
62132
62142
|
*/
|
|
62133
62143
|
pageChange(values) {
|
|
62134
|
-
var _this$gridOptions$
|
|
62144
|
+
var _this$gridOptions$pag2;
|
|
62135
62145
|
// 前端分页
|
|
62136
|
-
if ((_this$gridOptions$
|
|
62146
|
+
if ((_this$gridOptions$pag2 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag2 !== void 0 && _this$gridOptions$pag2.frontendPagination) {
|
|
62137
62147
|
setTimeout(() => {
|
|
62138
62148
|
const newData = this.spliteListData(this.allData, values.page, values.limit);
|
|
62139
62149
|
this.$refs.xGrid.reloadData(newData);
|
|
@@ -62357,19 +62367,19 @@ var custom_column_component = normalizeComponent(
|
|
|
62357
62367
|
* @param event
|
|
62358
62368
|
*/
|
|
62359
62369
|
handleSortChange(event) {
|
|
62360
|
-
var _this$gridOptions$
|
|
62370
|
+
var _this$gridOptions$pag3, _this$gridOptions$sor2;
|
|
62361
62371
|
const {
|
|
62362
62372
|
property,
|
|
62363
62373
|
order
|
|
62364
62374
|
} = event;
|
|
62365
|
-
const shouldHandleSort = ((_this$gridOptions$
|
|
62375
|
+
const shouldHandleSort = ((_this$gridOptions$pag3 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag3 === void 0 ? void 0 : _this$gridOptions$pag3.frontendPagination) || ((_this$gridOptions$sor2 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor2 === void 0 ? void 0 : _this$gridOptions$sor2.frontendSort);
|
|
62366
62376
|
|
|
62367
62377
|
// 无论前端还是后端分页,都保存排序状态用于恢复箭头高亮
|
|
62368
62378
|
this.sortState.field = property;
|
|
62369
62379
|
this.sortState.order = order;
|
|
62370
62380
|
if (shouldHandleSort) {
|
|
62371
|
-
var _this$gridOptions$
|
|
62372
|
-
const newData = this.spliteListData(this.allData, (_this$gridOptions$
|
|
62381
|
+
var _this$gridOptions$pag4, _this$gridOptions$pag5;
|
|
62382
|
+
const newData = this.spliteListData(this.allData, (_this$gridOptions$pag4 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag4 !== void 0 && _this$gridOptions$pag4.frontendPagination ? this.gridOptions.pagerConfig.currentPage : null, (_this$gridOptions$pag5 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag5 !== void 0 && _this$gridOptions$pag5.frontendPagination ? this.gridOptions.pagerConfig.pageSize : null);
|
|
62373
62383
|
if (this.$refs.xGrid) {
|
|
62374
62384
|
this.$refs.xGrid.reloadData(newData);
|
|
62375
62385
|
this.$nextTick(() => {
|
|
@@ -62382,8 +62392,8 @@ var custom_column_component = normalizeComponent(
|
|
|
62382
62392
|
}, 100);
|
|
62383
62393
|
}
|
|
62384
62394
|
setTimeout(() => {
|
|
62385
|
-
var _this$gridOptions$
|
|
62386
|
-
if ((_this$gridOptions$
|
|
62395
|
+
var _this$gridOptions$pag6;
|
|
62396
|
+
if ((_this$gridOptions$pag6 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag6 !== void 0 && _this$gridOptions$pag6.frontendPagination && this.$refs.xGrid) {
|
|
62387
62397
|
// 前端分页时,排序状态变化,回到第一页
|
|
62388
62398
|
const currentPage = this.gridOptions.pagerConfig.currentPage;
|
|
62389
62399
|
if (currentPage !== 1) {
|
|
@@ -62426,6 +62436,78 @@ var custom_column_component = normalizeComponent(
|
|
|
62426
62436
|
silent: true
|
|
62427
62437
|
});
|
|
62428
62438
|
}, 100);
|
|
62439
|
+
|
|
62440
|
+
// 🔧 修复:重置后自动应用默认排序(支持虚拟滚动和前端分页)
|
|
62441
|
+
this.$nextTick(() => {
|
|
62442
|
+
var _this$gridOptions$sor3;
|
|
62443
|
+
const defaultSort = (_this$gridOptions$sor3 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor3 === void 0 ? void 0 : _this$gridOptions$sor3.defaultSort;
|
|
62444
|
+
if (defaultSort && defaultSort.field && defaultSort.order) {
|
|
62445
|
+
this.sortState.field = defaultSort.field;
|
|
62446
|
+
this.sortState.order = defaultSort.order;
|
|
62447
|
+
setTimeout(() => {
|
|
62448
|
+
if (this.$refs.xGrid) {
|
|
62449
|
+
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62450
|
+
silent: true
|
|
62451
|
+
});
|
|
62452
|
+
}
|
|
62453
|
+
}, 150);
|
|
62454
|
+
}
|
|
62455
|
+
});
|
|
62456
|
+
},
|
|
62457
|
+
/**
|
|
62458
|
+
* 初始化默认排序(支持前端分页和虚拟滚动)
|
|
62459
|
+
*/
|
|
62460
|
+
initDefaultSortForFrontendPagination() {
|
|
62461
|
+
var _this$gridOptions$pag7, _this$gridOptions$sor4, _this$gridOptions$sor5;
|
|
62462
|
+
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62463
|
+
const shouldInitSort = ((_this$gridOptions$pag7 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag7 === void 0 ? void 0 : _this$gridOptions$pag7.frontendPagination) || ((_this$gridOptions$sor4 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor4 === void 0 ? void 0 : _this$gridOptions$sor4.frontendSort);
|
|
62464
|
+
if (!shouldInitSort) {
|
|
62465
|
+
return;
|
|
62466
|
+
}
|
|
62467
|
+
const defaultSort = (_this$gridOptions$sor5 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor5 === void 0 ? void 0 : _this$gridOptions$sor5.defaultSort;
|
|
62468
|
+
if (defaultSort && defaultSort.field && defaultSort.order) {
|
|
62469
|
+
// 设置排序状态
|
|
62470
|
+
this.sortState.field = defaultSort.field;
|
|
62471
|
+
this.sortState.order = defaultSort.order;
|
|
62472
|
+
|
|
62473
|
+
// 在下一个tick中应用排序高亮
|
|
62474
|
+
this.$nextTick(() => {
|
|
62475
|
+
if (this.$refs.xGrid) {
|
|
62476
|
+
setTimeout(() => {
|
|
62477
|
+
// 只高亮排序图标,不触发排序事件
|
|
62478
|
+
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62479
|
+
silent: true
|
|
62480
|
+
});
|
|
62481
|
+
}, 100);
|
|
62482
|
+
}
|
|
62483
|
+
});
|
|
62484
|
+
}
|
|
62485
|
+
},
|
|
62486
|
+
/**
|
|
62487
|
+
* 确保默认排序高亮(数据变化时调用,支持前端分页和虚拟滚动)
|
|
62488
|
+
*/
|
|
62489
|
+
ensureDefaultSortHighlight() {
|
|
62490
|
+
var _this$gridOptions$pag8, _this$gridOptions$sor6, _this$gridOptions$sor7;
|
|
62491
|
+
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62492
|
+
const shouldEnsureSort = ((_this$gridOptions$pag8 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag8 === void 0 ? void 0 : _this$gridOptions$pag8.frontendPagination) || ((_this$gridOptions$sor6 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor6 === void 0 ? void 0 : _this$gridOptions$sor6.frontendSort);
|
|
62493
|
+
if (!shouldEnsureSort) {
|
|
62494
|
+
return;
|
|
62495
|
+
}
|
|
62496
|
+
const defaultSort = (_this$gridOptions$sor7 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor7 === void 0 ? void 0 : _this$gridOptions$sor7.defaultSort;
|
|
62497
|
+
if (defaultSort && defaultSort.field && defaultSort.order) {
|
|
62498
|
+
// 确保排序状态与默认排序一致
|
|
62499
|
+
this.sortState.field = defaultSort.field;
|
|
62500
|
+
this.sortState.order = defaultSort.order;
|
|
62501
|
+
|
|
62502
|
+
// 应用排序高亮
|
|
62503
|
+
if (this.$refs.xGrid) {
|
|
62504
|
+
setTimeout(() => {
|
|
62505
|
+
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62506
|
+
silent: true
|
|
62507
|
+
});
|
|
62508
|
+
}, 100);
|
|
62509
|
+
}
|
|
62510
|
+
}
|
|
62429
62511
|
}
|
|
62430
62512
|
}
|
|
62431
62513
|
});
|
|
@@ -62441,8 +62523,8 @@ var custom_column_component = normalizeComponent(
|
|
|
62441
62523
|
;
|
|
62442
62524
|
var table_component = normalizeComponent(
|
|
62443
62525
|
components_tablevue_type_script_lang_js,
|
|
62444
|
-
|
|
62445
|
-
|
|
62526
|
+
tablevue_type_template_id_5b90b233_render,
|
|
62527
|
+
tablevue_type_template_id_5b90b233_staticRenderFns,
|
|
62446
62528
|
false,
|
|
62447
62529
|
null,
|
|
62448
62530
|
null,
|