@weitutech/by-components 1.1.148 → 1.1.150
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 +112 -25
- package/lib/by-components.umd.js +112 -25
- package/lib/by-components.umd.min.js +13 -13
- package/lib/index.css +1 -1
- package/package.json +1 -1
|
@@ -61876,8 +61876,8 @@ var es_set_is_superset_of_v2 = __webpack_require__(2475);
|
|
|
61876
61876
|
var es_set_symmetric_difference_v2 = __webpack_require__(5024);
|
|
61877
61877
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.union.v2.js
|
|
61878
61878
|
var es_set_union_v2 = __webpack_require__(1698);
|
|
61879
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ddfb4ac0-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/custom-column/index.vue?vue&type=template&id=
|
|
61880
|
-
var
|
|
61879
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ddfb4ac0-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/custom-column/index.vue?vue&type=template&id=208dd294
|
|
61880
|
+
var custom_columnvue_type_template_id_208dd294_render = function render() {
|
|
61881
61881
|
var _vm = this,
|
|
61882
61882
|
_c = _vm._self._c;
|
|
61883
61883
|
return _c('div', {
|
|
@@ -62008,14 +62008,19 @@ var custom_columnvue_type_template_id_4e4c01d8_render = function render() {
|
|
|
62008
62008
|
staticClass: "right_header"
|
|
62009
62009
|
}, [_c('span', {
|
|
62010
62010
|
staticClass: "drag_title"
|
|
62011
|
-
}, [_vm._v(_vm._s(`已选指标(${_vm.number})`))]), _c('
|
|
62011
|
+
}, [_vm._v(_vm._s(`已选指标(${_vm.number})`))]), _c('el-button', {
|
|
62012
62012
|
staticClass: "recover",
|
|
62013
|
+
attrs: {
|
|
62014
|
+
"type": "text",
|
|
62015
|
+
"size": "mini"
|
|
62016
|
+
},
|
|
62013
62017
|
on: {
|
|
62014
62018
|
"click": _vm.recoverDefault
|
|
62015
62019
|
}
|
|
62016
|
-
}, [_vm._v("恢复默认")])]), !_vm.useMultiLevelHeader ? _c('div', {
|
|
62020
|
+
}, [_vm._v("恢复默认")])], 1), !_vm.useMultiLevelHeader ? _c('div', {
|
|
62017
62021
|
staticClass: "drag_box"
|
|
62018
62022
|
}, [_c('div', {
|
|
62023
|
+
ref: "rightScrollContainer",
|
|
62019
62024
|
staticClass: "drag_ul"
|
|
62020
62025
|
}, [_c('draggable', {
|
|
62021
62026
|
attrs: {
|
|
@@ -62071,6 +62076,7 @@ var custom_columnvue_type_template_id_4e4c01d8_render = function render() {
|
|
|
62071
62076
|
}), 0)], 1)], 1)]) : _c('div', {
|
|
62072
62077
|
staticClass: "drag_box"
|
|
62073
62078
|
}, [_c('div', {
|
|
62079
|
+
ref: "rightScrollContainer",
|
|
62074
62080
|
staticClass: "drag_ul"
|
|
62075
62081
|
}, [_c('div', {
|
|
62076
62082
|
staticStyle: {
|
|
@@ -62264,7 +62270,7 @@ var custom_columnvue_type_template_id_4e4c01d8_render = function render() {
|
|
|
62264
62270
|
}), 0)], 1)], 1)]);
|
|
62265
62271
|
}), 0)], 1)], 1)])])])])], 1);
|
|
62266
62272
|
};
|
|
62267
|
-
var
|
|
62273
|
+
var custom_columnvue_type_template_id_208dd294_staticRenderFns = [];
|
|
62268
62274
|
|
|
62269
62275
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
|
|
62270
62276
|
var es_iterator_filter = __webpack_require__(2489);
|
|
@@ -62951,37 +62957,103 @@ const groupedColumnsForTable = (columns, fixed_max_count = 6) => {
|
|
|
62951
62957
|
}
|
|
62952
62958
|
|
|
62953
62959
|
// 固定列数量<=6个时,才进行重新分组
|
|
62954
|
-
|
|
62955
|
-
const
|
|
62960
|
+
// 先收集所有固定列,按 sort 值排序,保持用户配置的顺序
|
|
62961
|
+
const allFixedCols = [];
|
|
62956
62962
|
columns.forEach(group => {
|
|
62957
|
-
const fixedItems = [];
|
|
62958
|
-
const normalItems = [];
|
|
62959
62963
|
group.data.forEach(col => {
|
|
62960
|
-
if (col.fixed === 'left') {
|
|
62961
|
-
|
|
62962
|
-
|
|
62963
|
-
|
|
62964
|
+
if (col.fixed === 'left' && ['true', true, '1', 1].includes(col.type)) {
|
|
62965
|
+
allFixedCols.push({
|
|
62966
|
+
...col,
|
|
62967
|
+
__groupLabel: group.label
|
|
62968
|
+
});
|
|
62964
62969
|
}
|
|
62965
62970
|
});
|
|
62971
|
+
});
|
|
62972
|
+
// 按 sort 值排序固定列,确保表头显示顺序与配置顺序一致
|
|
62973
|
+
allFixedCols.sort((a, b) => {
|
|
62974
|
+
const sa = typeof a.sort === 'number' ? a.sort : Number(a.sort) || 0;
|
|
62975
|
+
const sb = typeof b.sort === 'number' ? b.sort : Number(b.sort) || 0;
|
|
62976
|
+
return sa - sb;
|
|
62977
|
+
});
|
|
62966
62978
|
|
|
62967
|
-
|
|
62968
|
-
|
|
62969
|
-
|
|
62970
|
-
|
|
62971
|
-
|
|
62972
|
-
|
|
62973
|
-
|
|
62979
|
+
// 按原始分组组织固定列,并记录每个分组的最小 sort 值用于排序分组
|
|
62980
|
+
const fixedColsByGroup = new Map(); // groupLabel -> fixedCols[]
|
|
62981
|
+
const groupMinSortMap = new Map(); // groupLabel -> minSort
|
|
62982
|
+
allFixedCols.forEach(col => {
|
|
62983
|
+
const groupLabel = col.__groupLabel;
|
|
62984
|
+
const sortValue = typeof col.sort === 'number' ? col.sort : Number(col.sort) || 0;
|
|
62985
|
+
|
|
62986
|
+
// 收集固定列到对应分组
|
|
62987
|
+
if (!fixedColsByGroup.has(groupLabel)) {
|
|
62988
|
+
fixedColsByGroup.set(groupLabel, []);
|
|
62989
|
+
groupMinSortMap.set(groupLabel, sortValue);
|
|
62990
|
+
} else {
|
|
62991
|
+
// 更新分组的最小 sort 值
|
|
62992
|
+
const currentMin = groupMinSortMap.get(groupLabel);
|
|
62993
|
+
if (sortValue < currentMin) {
|
|
62994
|
+
groupMinSortMap.set(groupLabel, sortValue);
|
|
62995
|
+
}
|
|
62974
62996
|
}
|
|
62997
|
+
// 移除临时属性
|
|
62998
|
+
const {
|
|
62999
|
+
__groupLabel,
|
|
63000
|
+
...colData
|
|
63001
|
+
} = col;
|
|
63002
|
+
fixedColsByGroup.get(groupLabel).push(colData);
|
|
63003
|
+
});
|
|
63004
|
+
|
|
63005
|
+
// 构建固定分组,分组内的列已按 sort 排序(因为 allFixedCols 已排序)
|
|
63006
|
+
// 分组本身按最小 sort 值排序,确保跨分组的固定列顺序正确
|
|
63007
|
+
const fixedGroups = Array.from(fixedColsByGroup.entries()).map(([groupLabel, cols]) => ({
|
|
63008
|
+
label: groupLabel,
|
|
63009
|
+
fixed: 'left',
|
|
63010
|
+
data: cols
|
|
63011
|
+
})).sort((a, b) => {
|
|
63012
|
+
var _groupMinSortMap$get, _groupMinSortMap$get2;
|
|
63013
|
+
const aMinSort = (_groupMinSortMap$get = groupMinSortMap.get(a.label)) !== null && _groupMinSortMap$get !== void 0 ? _groupMinSortMap$get : 99999;
|
|
63014
|
+
const bMinSort = (_groupMinSortMap$get2 = groupMinSortMap.get(b.label)) !== null && _groupMinSortMap$get2 !== void 0 ? _groupMinSortMap$get2 : 99999;
|
|
63015
|
+
return aMinSort - bMinSort;
|
|
63016
|
+
});
|
|
62975
63017
|
|
|
62976
|
-
|
|
63018
|
+
// 处理普通列(非固定列)
|
|
63019
|
+
// 为了保持原始分组顺序,需要记录每个分组在原始 columns 中的索引
|
|
63020
|
+
const groupOriginalIndexMap = new Map(); // groupLabel -> originalIndex
|
|
63021
|
+
columns.forEach((group, index) => {
|
|
63022
|
+
groupOriginalIndexMap.set(group.label, index);
|
|
63023
|
+
});
|
|
63024
|
+
const normalGroups = [];
|
|
63025
|
+
// 按照原始 columns 的顺序遍历,确保分组顺序正确
|
|
63026
|
+
columns.forEach(group => {
|
|
63027
|
+
const normalItems = group.data.filter(col => col.fixed !== 'left');
|
|
62977
63028
|
if (normalItems.length > 0) {
|
|
63029
|
+
// 普通列也需要按 sort 排序
|
|
63030
|
+
normalItems.sort((a, b) => {
|
|
63031
|
+
const sa = typeof a.sort === 'number' ? a.sort : Number(a.sort) || 0;
|
|
63032
|
+
const sb = typeof b.sort === 'number' ? b.sort : Number(b.sort) || 0;
|
|
63033
|
+
return sa - sb;
|
|
63034
|
+
});
|
|
62978
63035
|
normalGroups.push({
|
|
62979
63036
|
label: group.label,
|
|
62980
|
-
data: normalItems
|
|
63037
|
+
data: normalItems,
|
|
63038
|
+
__originalIndex: groupOriginalIndexMap.get(group.label) // 保存原始索引用于排序
|
|
62981
63039
|
});
|
|
62982
63040
|
}
|
|
62983
63041
|
});
|
|
62984
|
-
|
|
63042
|
+
|
|
63043
|
+
// 按照原始索引排序普通分组,确保取消固定后能回到原位置
|
|
63044
|
+
normalGroups.sort((a, b) => {
|
|
63045
|
+
var _a$__originalIndex, _b$__originalIndex;
|
|
63046
|
+
const aIndex = (_a$__originalIndex = a.__originalIndex) !== null && _a$__originalIndex !== void 0 ? _a$__originalIndex : 99999;
|
|
63047
|
+
const bIndex = (_b$__originalIndex = b.__originalIndex) !== null && _b$__originalIndex !== void 0 ? _b$__originalIndex : 99999;
|
|
63048
|
+
return aIndex - bIndex;
|
|
63049
|
+
});
|
|
63050
|
+
|
|
63051
|
+
// 移除临时属性
|
|
63052
|
+
const cleanNormalGroups = normalGroups.map(({
|
|
63053
|
+
__originalIndex,
|
|
63054
|
+
...group
|
|
63055
|
+
}) => group);
|
|
63056
|
+
const result = [...fixedGroups, ...cleanNormalGroups];
|
|
62985
63057
|
|
|
62986
63058
|
// 将固定分组添加到最前面
|
|
62987
63059
|
return result;
|
|
@@ -63350,6 +63422,21 @@ var pin_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAA
|
|
|
63350
63422
|
this.baseGroupOrder = [];
|
|
63351
63423
|
}
|
|
63352
63424
|
this.initTableList(this.deepClone(this.columnList));
|
|
63425
|
+
// 恢复默认后,滚动到顶部
|
|
63426
|
+
this.$nextTick(() => {
|
|
63427
|
+
this.$nextTick(() => {
|
|
63428
|
+
setTimeout(() => {
|
|
63429
|
+
const scrollContainer = this.$refs.rightScrollContainer;
|
|
63430
|
+
if (scrollContainer) {
|
|
63431
|
+
// 使用 scrollTo 方法实现平滑滚动
|
|
63432
|
+
scrollContainer.scrollTo({
|
|
63433
|
+
top: 0,
|
|
63434
|
+
behavior: 'smooth'
|
|
63435
|
+
});
|
|
63436
|
+
}
|
|
63437
|
+
}, 50);
|
|
63438
|
+
});
|
|
63439
|
+
});
|
|
63353
63440
|
},
|
|
63354
63441
|
/**
|
|
63355
63442
|
* @describe 判断分组的勾选状态
|
|
@@ -63699,8 +63786,8 @@ var pin_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAA
|
|
|
63699
63786
|
;
|
|
63700
63787
|
var custom_column_component = normalizeComponent(
|
|
63701
63788
|
components_custom_columnvue_type_script_lang_js,
|
|
63702
|
-
|
|
63703
|
-
|
|
63789
|
+
custom_columnvue_type_template_id_208dd294_render,
|
|
63790
|
+
custom_columnvue_type_template_id_208dd294_staticRenderFns,
|
|
63704
63791
|
false,
|
|
63705
63792
|
null,
|
|
63706
63793
|
null,
|
package/lib/by-components.umd.js
CHANGED
|
@@ -61886,8 +61886,8 @@ var es_set_is_superset_of_v2 = __webpack_require__(2475);
|
|
|
61886
61886
|
var es_set_symmetric_difference_v2 = __webpack_require__(5024);
|
|
61887
61887
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.union.v2.js
|
|
61888
61888
|
var es_set_union_v2 = __webpack_require__(1698);
|
|
61889
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ddfb4ac0-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/custom-column/index.vue?vue&type=template&id=
|
|
61890
|
-
var
|
|
61889
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ddfb4ac0-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/custom-column/index.vue?vue&type=template&id=208dd294
|
|
61890
|
+
var custom_columnvue_type_template_id_208dd294_render = function render() {
|
|
61891
61891
|
var _vm = this,
|
|
61892
61892
|
_c = _vm._self._c;
|
|
61893
61893
|
return _c('div', {
|
|
@@ -62018,14 +62018,19 @@ var custom_columnvue_type_template_id_4e4c01d8_render = function render() {
|
|
|
62018
62018
|
staticClass: "right_header"
|
|
62019
62019
|
}, [_c('span', {
|
|
62020
62020
|
staticClass: "drag_title"
|
|
62021
|
-
}, [_vm._v(_vm._s(`已选指标(${_vm.number})`))]), _c('
|
|
62021
|
+
}, [_vm._v(_vm._s(`已选指标(${_vm.number})`))]), _c('el-button', {
|
|
62022
62022
|
staticClass: "recover",
|
|
62023
|
+
attrs: {
|
|
62024
|
+
"type": "text",
|
|
62025
|
+
"size": "mini"
|
|
62026
|
+
},
|
|
62023
62027
|
on: {
|
|
62024
62028
|
"click": _vm.recoverDefault
|
|
62025
62029
|
}
|
|
62026
|
-
}, [_vm._v("恢复默认")])]), !_vm.useMultiLevelHeader ? _c('div', {
|
|
62030
|
+
}, [_vm._v("恢复默认")])], 1), !_vm.useMultiLevelHeader ? _c('div', {
|
|
62027
62031
|
staticClass: "drag_box"
|
|
62028
62032
|
}, [_c('div', {
|
|
62033
|
+
ref: "rightScrollContainer",
|
|
62029
62034
|
staticClass: "drag_ul"
|
|
62030
62035
|
}, [_c('draggable', {
|
|
62031
62036
|
attrs: {
|
|
@@ -62081,6 +62086,7 @@ var custom_columnvue_type_template_id_4e4c01d8_render = function render() {
|
|
|
62081
62086
|
}), 0)], 1)], 1)]) : _c('div', {
|
|
62082
62087
|
staticClass: "drag_box"
|
|
62083
62088
|
}, [_c('div', {
|
|
62089
|
+
ref: "rightScrollContainer",
|
|
62084
62090
|
staticClass: "drag_ul"
|
|
62085
62091
|
}, [_c('div', {
|
|
62086
62092
|
staticStyle: {
|
|
@@ -62274,7 +62280,7 @@ var custom_columnvue_type_template_id_4e4c01d8_render = function render() {
|
|
|
62274
62280
|
}), 0)], 1)], 1)]);
|
|
62275
62281
|
}), 0)], 1)], 1)])])])])], 1);
|
|
62276
62282
|
};
|
|
62277
|
-
var
|
|
62283
|
+
var custom_columnvue_type_template_id_208dd294_staticRenderFns = [];
|
|
62278
62284
|
|
|
62279
62285
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
|
|
62280
62286
|
var es_iterator_filter = __webpack_require__(2489);
|
|
@@ -62961,37 +62967,103 @@ const groupedColumnsForTable = (columns, fixed_max_count = 6) => {
|
|
|
62961
62967
|
}
|
|
62962
62968
|
|
|
62963
62969
|
// 固定列数量<=6个时,才进行重新分组
|
|
62964
|
-
|
|
62965
|
-
const
|
|
62970
|
+
// 先收集所有固定列,按 sort 值排序,保持用户配置的顺序
|
|
62971
|
+
const allFixedCols = [];
|
|
62966
62972
|
columns.forEach(group => {
|
|
62967
|
-
const fixedItems = [];
|
|
62968
|
-
const normalItems = [];
|
|
62969
62973
|
group.data.forEach(col => {
|
|
62970
|
-
if (col.fixed === 'left') {
|
|
62971
|
-
|
|
62972
|
-
|
|
62973
|
-
|
|
62974
|
+
if (col.fixed === 'left' && ['true', true, '1', 1].includes(col.type)) {
|
|
62975
|
+
allFixedCols.push({
|
|
62976
|
+
...col,
|
|
62977
|
+
__groupLabel: group.label
|
|
62978
|
+
});
|
|
62974
62979
|
}
|
|
62975
62980
|
});
|
|
62981
|
+
});
|
|
62982
|
+
// 按 sort 值排序固定列,确保表头显示顺序与配置顺序一致
|
|
62983
|
+
allFixedCols.sort((a, b) => {
|
|
62984
|
+
const sa = typeof a.sort === 'number' ? a.sort : Number(a.sort) || 0;
|
|
62985
|
+
const sb = typeof b.sort === 'number' ? b.sort : Number(b.sort) || 0;
|
|
62986
|
+
return sa - sb;
|
|
62987
|
+
});
|
|
62976
62988
|
|
|
62977
|
-
|
|
62978
|
-
|
|
62979
|
-
|
|
62980
|
-
|
|
62981
|
-
|
|
62982
|
-
|
|
62983
|
-
|
|
62989
|
+
// 按原始分组组织固定列,并记录每个分组的最小 sort 值用于排序分组
|
|
62990
|
+
const fixedColsByGroup = new Map(); // groupLabel -> fixedCols[]
|
|
62991
|
+
const groupMinSortMap = new Map(); // groupLabel -> minSort
|
|
62992
|
+
allFixedCols.forEach(col => {
|
|
62993
|
+
const groupLabel = col.__groupLabel;
|
|
62994
|
+
const sortValue = typeof col.sort === 'number' ? col.sort : Number(col.sort) || 0;
|
|
62995
|
+
|
|
62996
|
+
// 收集固定列到对应分组
|
|
62997
|
+
if (!fixedColsByGroup.has(groupLabel)) {
|
|
62998
|
+
fixedColsByGroup.set(groupLabel, []);
|
|
62999
|
+
groupMinSortMap.set(groupLabel, sortValue);
|
|
63000
|
+
} else {
|
|
63001
|
+
// 更新分组的最小 sort 值
|
|
63002
|
+
const currentMin = groupMinSortMap.get(groupLabel);
|
|
63003
|
+
if (sortValue < currentMin) {
|
|
63004
|
+
groupMinSortMap.set(groupLabel, sortValue);
|
|
63005
|
+
}
|
|
62984
63006
|
}
|
|
63007
|
+
// 移除临时属性
|
|
63008
|
+
const {
|
|
63009
|
+
__groupLabel,
|
|
63010
|
+
...colData
|
|
63011
|
+
} = col;
|
|
63012
|
+
fixedColsByGroup.get(groupLabel).push(colData);
|
|
63013
|
+
});
|
|
63014
|
+
|
|
63015
|
+
// 构建固定分组,分组内的列已按 sort 排序(因为 allFixedCols 已排序)
|
|
63016
|
+
// 分组本身按最小 sort 值排序,确保跨分组的固定列顺序正确
|
|
63017
|
+
const fixedGroups = Array.from(fixedColsByGroup.entries()).map(([groupLabel, cols]) => ({
|
|
63018
|
+
label: groupLabel,
|
|
63019
|
+
fixed: 'left',
|
|
63020
|
+
data: cols
|
|
63021
|
+
})).sort((a, b) => {
|
|
63022
|
+
var _groupMinSortMap$get, _groupMinSortMap$get2;
|
|
63023
|
+
const aMinSort = (_groupMinSortMap$get = groupMinSortMap.get(a.label)) !== null && _groupMinSortMap$get !== void 0 ? _groupMinSortMap$get : 99999;
|
|
63024
|
+
const bMinSort = (_groupMinSortMap$get2 = groupMinSortMap.get(b.label)) !== null && _groupMinSortMap$get2 !== void 0 ? _groupMinSortMap$get2 : 99999;
|
|
63025
|
+
return aMinSort - bMinSort;
|
|
63026
|
+
});
|
|
62985
63027
|
|
|
62986
|
-
|
|
63028
|
+
// 处理普通列(非固定列)
|
|
63029
|
+
// 为了保持原始分组顺序,需要记录每个分组在原始 columns 中的索引
|
|
63030
|
+
const groupOriginalIndexMap = new Map(); // groupLabel -> originalIndex
|
|
63031
|
+
columns.forEach((group, index) => {
|
|
63032
|
+
groupOriginalIndexMap.set(group.label, index);
|
|
63033
|
+
});
|
|
63034
|
+
const normalGroups = [];
|
|
63035
|
+
// 按照原始 columns 的顺序遍历,确保分组顺序正确
|
|
63036
|
+
columns.forEach(group => {
|
|
63037
|
+
const normalItems = group.data.filter(col => col.fixed !== 'left');
|
|
62987
63038
|
if (normalItems.length > 0) {
|
|
63039
|
+
// 普通列也需要按 sort 排序
|
|
63040
|
+
normalItems.sort((a, b) => {
|
|
63041
|
+
const sa = typeof a.sort === 'number' ? a.sort : Number(a.sort) || 0;
|
|
63042
|
+
const sb = typeof b.sort === 'number' ? b.sort : Number(b.sort) || 0;
|
|
63043
|
+
return sa - sb;
|
|
63044
|
+
});
|
|
62988
63045
|
normalGroups.push({
|
|
62989
63046
|
label: group.label,
|
|
62990
|
-
data: normalItems
|
|
63047
|
+
data: normalItems,
|
|
63048
|
+
__originalIndex: groupOriginalIndexMap.get(group.label) // 保存原始索引用于排序
|
|
62991
63049
|
});
|
|
62992
63050
|
}
|
|
62993
63051
|
});
|
|
62994
|
-
|
|
63052
|
+
|
|
63053
|
+
// 按照原始索引排序普通分组,确保取消固定后能回到原位置
|
|
63054
|
+
normalGroups.sort((a, b) => {
|
|
63055
|
+
var _a$__originalIndex, _b$__originalIndex;
|
|
63056
|
+
const aIndex = (_a$__originalIndex = a.__originalIndex) !== null && _a$__originalIndex !== void 0 ? _a$__originalIndex : 99999;
|
|
63057
|
+
const bIndex = (_b$__originalIndex = b.__originalIndex) !== null && _b$__originalIndex !== void 0 ? _b$__originalIndex : 99999;
|
|
63058
|
+
return aIndex - bIndex;
|
|
63059
|
+
});
|
|
63060
|
+
|
|
63061
|
+
// 移除临时属性
|
|
63062
|
+
const cleanNormalGroups = normalGroups.map(({
|
|
63063
|
+
__originalIndex,
|
|
63064
|
+
...group
|
|
63065
|
+
}) => group);
|
|
63066
|
+
const result = [...fixedGroups, ...cleanNormalGroups];
|
|
62995
63067
|
|
|
62996
63068
|
// 将固定分组添加到最前面
|
|
62997
63069
|
return result;
|
|
@@ -63360,6 +63432,21 @@ var pin_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAA
|
|
|
63360
63432
|
this.baseGroupOrder = [];
|
|
63361
63433
|
}
|
|
63362
63434
|
this.initTableList(this.deepClone(this.columnList));
|
|
63435
|
+
// 恢复默认后,滚动到顶部
|
|
63436
|
+
this.$nextTick(() => {
|
|
63437
|
+
this.$nextTick(() => {
|
|
63438
|
+
setTimeout(() => {
|
|
63439
|
+
const scrollContainer = this.$refs.rightScrollContainer;
|
|
63440
|
+
if (scrollContainer) {
|
|
63441
|
+
// 使用 scrollTo 方法实现平滑滚动
|
|
63442
|
+
scrollContainer.scrollTo({
|
|
63443
|
+
top: 0,
|
|
63444
|
+
behavior: 'smooth'
|
|
63445
|
+
});
|
|
63446
|
+
}
|
|
63447
|
+
}, 50);
|
|
63448
|
+
});
|
|
63449
|
+
});
|
|
63363
63450
|
},
|
|
63364
63451
|
/**
|
|
63365
63452
|
* @describe 判断分组的勾选状态
|
|
@@ -63709,8 +63796,8 @@ var pin_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAA
|
|
|
63709
63796
|
;
|
|
63710
63797
|
var custom_column_component = normalizeComponent(
|
|
63711
63798
|
components_custom_columnvue_type_script_lang_js,
|
|
63712
|
-
|
|
63713
|
-
|
|
63799
|
+
custom_columnvue_type_template_id_208dd294_render,
|
|
63800
|
+
custom_columnvue_type_template_id_208dd294_staticRenderFns,
|
|
63714
63801
|
false,
|
|
63715
63802
|
null,
|
|
63716
63803
|
null,
|