@weitutech/by-components 1.1.148 → 1.1.149

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