@weitutech/by-components 1.1.175 → 1.1.176

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.
@@ -74524,8 +74524,8 @@ var component = normalizeComponent(
74524
74524
  )
74525
74525
 
74526
74526
  /* harmony default export */ var pager = (component.exports);
74527
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-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=61c6f6ac
74528
- var tablevue_type_template_id_61c6f6ac_render = function render() {
74527
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-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=35ba1298
74528
+ var tablevue_type_template_id_35ba1298_render = function render() {
74529
74529
  var _vm = this,
74530
74530
  _c = _vm._self._c;
74531
74531
  return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
@@ -74609,7 +74609,7 @@ var tablevue_type_template_id_61c6f6ac_render = function render() {
74609
74609
  }
74610
74610
  }) : _vm._e()], 1);
74611
74611
  };
74612
- var tablevue_type_template_id_61c6f6ac_staticRenderFns = [];
74612
+ var tablevue_type_template_id_35ba1298_staticRenderFns = [];
74613
74613
 
74614
74614
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
74615
74615
  var es_array_push = __webpack_require__(4114);
@@ -76773,6 +76773,9 @@ var custom_column_component = normalizeComponent(
76773
76773
  // 为表头补充tooltips展示能力
76774
76774
  newColumns = this.applyColumnTooltips(newColumns);
76775
76775
 
76776
+ // 为列应用默认的对齐方式(如果列本身没有配置)
76777
+ newColumns = this.applyDefaultAlign(newColumns);
76778
+
76776
76779
  // 处理前端分页和虚拟滚动
76777
76780
  let data = others.data || [];
76778
76781
  if ((_others$pagerConfig = others.pagerConfig) !== null && _others$pagerConfig !== void 0 && _others$pagerConfig.frontendPagination || (_others$sortConfig = others.sortConfig) !== null && _others$sortConfig !== void 0 && _others$sortConfig.frontendSort) {
@@ -76816,8 +76819,9 @@ var custom_column_component = normalizeComponent(
76816
76819
  } : {
76817
76820
  height: 720
76818
76821
  }),
76819
- // 表格级别的默认对齐:headerAlign 默认居中,align 默认居左(如果外部有配置,以外部配置为准)
76820
- align: 'center',
76822
+ // 表格级别的默认对齐:如果外部有配置,以外部配置为准,否则使用默认值
76823
+ align: this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center',
76824
+ headerAlign: this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center',
76821
76825
  copyFields: this.gridOptions.copyFields || [],
76822
76826
  emptyText: this.gridOptions.emptyText || '暂无数据',
76823
76827
  loading: this.loading,
@@ -76967,6 +76971,34 @@ var custom_column_component = normalizeComponent(
76967
76971
  return newColumn;
76968
76972
  });
76969
76973
  },
76974
+ /**
76975
+ * 为列应用默认的对齐方式(如果列本身没有配置)
76976
+ * @param {Array} columns
76977
+ */
76978
+ applyDefaultAlign(columns) {
76979
+ if (!Array.isArray(columns)) return columns;
76980
+ const defaultAlign = this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center';
76981
+ const defaultHeaderAlign = this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center';
76982
+ return columns.map(column => {
76983
+ const newColumn = {
76984
+ ...column
76985
+ };
76986
+ if (Array.isArray(newColumn.children) && newColumn.children.length) {
76987
+ newColumn.children = this.applyDefaultAlign(newColumn.children);
76988
+ }
76989
+
76990
+ // 如果列没有配置 align,应用默认值
76991
+ if (newColumn.align === undefined || newColumn.align === null) {
76992
+ newColumn.align = defaultAlign;
76993
+ }
76994
+
76995
+ // 如果列没有配置 headerAlign,应用默认值(只有有 field 的列才需要 headerAlign)
76996
+ if (newColumn.field && (newColumn.headerAlign === undefined || newColumn.headerAlign === null)) {
76997
+ newColumn.headerAlign = defaultHeaderAlign;
76998
+ }
76999
+ return newColumn;
77000
+ });
77001
+ },
76970
77002
  /**
76971
77003
  * 规范化列配置上的tooltips字段
76972
77004
  * @param {string|Object} tooltips
@@ -77187,8 +77219,8 @@ var custom_column_component = normalizeComponent(
77187
77219
  if (item.align !== undefined && item.align !== null) {
77188
77220
  return item.align;
77189
77221
  }
77190
- if (this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null) {
77191
- return this.gridOptions.headerAlign;
77222
+ if (this.gridOptions.align !== undefined && this.gridOptions.align !== null) {
77223
+ return this.gridOptions.align;
77192
77224
  }
77193
77225
  return 'center';
77194
77226
  },
@@ -77196,8 +77228,8 @@ var custom_column_component = normalizeComponent(
77196
77228
  if (item.headerAlign !== undefined && item.headerAlign !== null) {
77197
77229
  return item.headerAlign;
77198
77230
  }
77199
- if (this.gridOptions.align !== undefined && this.gridOptions.align !== null) {
77200
- return this.gridOptions.align;
77231
+ if (this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null) {
77232
+ return this.gridOptions.headerAlign;
77201
77233
  }
77202
77234
  return 'center';
77203
77235
  },
@@ -77495,8 +77527,8 @@ var custom_column_component = normalizeComponent(
77495
77527
  ;
77496
77528
  var table_component = normalizeComponent(
77497
77529
  components_tablevue_type_script_lang_js,
77498
- tablevue_type_template_id_61c6f6ac_render,
77499
- tablevue_type_template_id_61c6f6ac_staticRenderFns,
77530
+ tablevue_type_template_id_35ba1298_render,
77531
+ tablevue_type_template_id_35ba1298_staticRenderFns,
77500
77532
  false,
77501
77533
  null,
77502
77534
  null,
@@ -74534,8 +74534,8 @@ var component = normalizeComponent(
74534
74534
  )
74535
74535
 
74536
74536
  /* harmony default export */ var pager = (component.exports);
74537
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-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=61c6f6ac
74538
- var tablevue_type_template_id_61c6f6ac_render = function render() {
74537
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-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=35ba1298
74538
+ var tablevue_type_template_id_35ba1298_render = function render() {
74539
74539
  var _vm = this,
74540
74540
  _c = _vm._self._c;
74541
74541
  return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
@@ -74619,7 +74619,7 @@ var tablevue_type_template_id_61c6f6ac_render = function render() {
74619
74619
  }
74620
74620
  }) : _vm._e()], 1);
74621
74621
  };
74622
- var tablevue_type_template_id_61c6f6ac_staticRenderFns = [];
74622
+ var tablevue_type_template_id_35ba1298_staticRenderFns = [];
74623
74623
 
74624
74624
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
74625
74625
  var es_array_push = __webpack_require__(4114);
@@ -76783,6 +76783,9 @@ var custom_column_component = normalizeComponent(
76783
76783
  // 为表头补充tooltips展示能力
76784
76784
  newColumns = this.applyColumnTooltips(newColumns);
76785
76785
 
76786
+ // 为列应用默认的对齐方式(如果列本身没有配置)
76787
+ newColumns = this.applyDefaultAlign(newColumns);
76788
+
76786
76789
  // 处理前端分页和虚拟滚动
76787
76790
  let data = others.data || [];
76788
76791
  if ((_others$pagerConfig = others.pagerConfig) !== null && _others$pagerConfig !== void 0 && _others$pagerConfig.frontendPagination || (_others$sortConfig = others.sortConfig) !== null && _others$sortConfig !== void 0 && _others$sortConfig.frontendSort) {
@@ -76826,8 +76829,9 @@ var custom_column_component = normalizeComponent(
76826
76829
  } : {
76827
76830
  height: 720
76828
76831
  }),
76829
- // 表格级别的默认对齐:headerAlign 默认居中,align 默认居左(如果外部有配置,以外部配置为准)
76830
- align: 'center',
76832
+ // 表格级别的默认对齐:如果外部有配置,以外部配置为准,否则使用默认值
76833
+ align: this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center',
76834
+ headerAlign: this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center',
76831
76835
  copyFields: this.gridOptions.copyFields || [],
76832
76836
  emptyText: this.gridOptions.emptyText || '暂无数据',
76833
76837
  loading: this.loading,
@@ -76977,6 +76981,34 @@ var custom_column_component = normalizeComponent(
76977
76981
  return newColumn;
76978
76982
  });
76979
76983
  },
76984
+ /**
76985
+ * 为列应用默认的对齐方式(如果列本身没有配置)
76986
+ * @param {Array} columns
76987
+ */
76988
+ applyDefaultAlign(columns) {
76989
+ if (!Array.isArray(columns)) return columns;
76990
+ const defaultAlign = this.gridOptions.align !== undefined && this.gridOptions.align !== null ? this.gridOptions.align : 'center';
76991
+ const defaultHeaderAlign = this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null ? this.gridOptions.headerAlign : 'center';
76992
+ return columns.map(column => {
76993
+ const newColumn = {
76994
+ ...column
76995
+ };
76996
+ if (Array.isArray(newColumn.children) && newColumn.children.length) {
76997
+ newColumn.children = this.applyDefaultAlign(newColumn.children);
76998
+ }
76999
+
77000
+ // 如果列没有配置 align,应用默认值
77001
+ if (newColumn.align === undefined || newColumn.align === null) {
77002
+ newColumn.align = defaultAlign;
77003
+ }
77004
+
77005
+ // 如果列没有配置 headerAlign,应用默认值(只有有 field 的列才需要 headerAlign)
77006
+ if (newColumn.field && (newColumn.headerAlign === undefined || newColumn.headerAlign === null)) {
77007
+ newColumn.headerAlign = defaultHeaderAlign;
77008
+ }
77009
+ return newColumn;
77010
+ });
77011
+ },
76980
77012
  /**
76981
77013
  * 规范化列配置上的tooltips字段
76982
77014
  * @param {string|Object} tooltips
@@ -77197,8 +77229,8 @@ var custom_column_component = normalizeComponent(
77197
77229
  if (item.align !== undefined && item.align !== null) {
77198
77230
  return item.align;
77199
77231
  }
77200
- if (this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null) {
77201
- return this.gridOptions.headerAlign;
77232
+ if (this.gridOptions.align !== undefined && this.gridOptions.align !== null) {
77233
+ return this.gridOptions.align;
77202
77234
  }
77203
77235
  return 'center';
77204
77236
  },
@@ -77206,8 +77238,8 @@ var custom_column_component = normalizeComponent(
77206
77238
  if (item.headerAlign !== undefined && item.headerAlign !== null) {
77207
77239
  return item.headerAlign;
77208
77240
  }
77209
- if (this.gridOptions.align !== undefined && this.gridOptions.align !== null) {
77210
- return this.gridOptions.align;
77241
+ if (this.gridOptions.headerAlign !== undefined && this.gridOptions.headerAlign !== null) {
77242
+ return this.gridOptions.headerAlign;
77211
77243
  }
77212
77244
  return 'center';
77213
77245
  },
@@ -77505,8 +77537,8 @@ var custom_column_component = normalizeComponent(
77505
77537
  ;
77506
77538
  var table_component = normalizeComponent(
77507
77539
  components_tablevue_type_script_lang_js,
77508
- tablevue_type_template_id_61c6f6ac_render,
77509
- tablevue_type_template_id_61c6f6ac_staticRenderFns,
77540
+ tablevue_type_template_id_35ba1298_render,
77541
+ tablevue_type_template_id_35ba1298_staticRenderFns,
77510
77542
  false,
77511
77543
  null,
77512
77544
  null,