n20-common-lib 2.10.10 → 2.10.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.10.10",
3
+ "version": "2.10.12",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -336,6 +336,12 @@ export default {
336
336
  calcColumnWidth(columns) {
337
337
  columns = XEUtils.clone(columns, true)
338
338
  const wrapperEl = document.querySelector('div#app')
339
+ const notHasWidth = columns.filter(
340
+ (column) => !column.width && !column.minWidth && column.label !== $lc('操作')
341
+ )
342
+ if (!wrapperEl || notHasWidth.length > 0) {
343
+ return columns
344
+ }
339
345
  const { width: windowWidth } = wrapperEl.getBoundingClientRect()
340
346
  function calc(columns) {
341
347
  let columnsWidth = 0
@@ -343,6 +349,9 @@ export default {
343
349
  if (column.static && column.label === $lc('操作') && !column.width && !column.minWidth) {
344
350
  column.width = 80
345
351
  }
352
+ if (column.type) {
353
+ column.width = 80
354
+ }
346
355
  const width = column.minWidth || column.width
347
356
  column['_width_'] = column['_width_'] || parseInt(width)
348
357
  column['width'] = parseInt(width)