shijiplus-web-plugin 0.1.53 → 0.1.55

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,11 +1,11 @@
1
1
  {
2
2
  "name": "shijiplus-web-plugin",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "files": [
5
5
  "src"
6
6
  ],
7
7
  "description": "A company project update table component fixedheader",
8
- "author": "jia",
8
+ "author": "super_jex",
9
9
  "license": "ISC",
10
10
  "private": false,
11
11
  "main": "./src/index.js",
@@ -122,6 +122,18 @@ export default {
122
122
  margin-top: 10px;
123
123
  }
124
124
  }
125
+ &.position-top {
126
+ flex-wrap: wrap;
127
+ .ivu-form-item-label {
128
+ width: 100% !important;
129
+ text-align: left;
130
+ margin-bottom: 5px;
131
+ display: inline-flex;
132
+ }
133
+ .ivu-form-item-content {
134
+ margin-left: 0 !important;
135
+ }
136
+ }
125
137
  &.compact-form-item {
126
138
  margin-bottom: 0px;
127
139
  }
@@ -325,63 +325,70 @@ export default {
325
325
  }
326
326
  },
327
327
  methods: {
328
- calcTableHeight(count) {
329
- this.$nextTick(() => {
330
- let tHeight = this.$refs.plusTableInnerRef.clientHeight
331
- if (!tHeight && count < 3) {
328
+ getClientHeight(count) {
329
+ let clientHeight = this.$refs.plusTableInnerRef.clientHeight
330
+ if (!clientHeight && count < 3) {
331
+ return new Promise((resolve) => {
332
332
  setTimeout(() => {
333
- this.calcTableHeight(count + 1)
333
+ resolve(this.getClientHeight(count + 1))
334
334
  }, 100)
335
- return
336
- }
335
+ })
336
+ }
337
+ return Promise.resolve(clientHeight)
338
+ },
339
+ calcTableHeight() {
340
+ this.$nextTick(() => {
337
341
  let tableWidth = this.$refs.plusTableInnerRef.clientWidth
342
+ this.getClientHeight(0).then((tHeight) => {
343
+ // 获取元素的所有计算样式
344
+ var styles = window.getComputedStyle(this.$refs.plusTableInnerRef)
338
345
 
339
- // 获取元素的所有计算样式
340
- var styles = window.getComputedStyle(this.$refs.plusTableInnerRef)
341
-
342
- var styleHeight = parseFloat(styles.getPropertyValue('height'))
343
- // 如果您只想获取特定方向的padding值,例如padding-top
344
- var paddingLeft = parseFloat(styles.getPropertyValue('padding-left'))
345
- var paddingRight = parseFloat(styles.getPropertyValue('padding-right'))
346
- var paddingTop = parseFloat(styles.getPropertyValue('padding-top'))
347
- var paddingBottom = parseFloat(
348
- styles.getPropertyValue('padding-bottom')
349
- )
350
- if (paddingLeft) {
351
- tableWidth -= paddingLeft
352
- }
353
- if (paddingRight) {
354
- tableWidth -= paddingRight
355
- }
356
- if (paddingTop) {
357
- tHeight -= paddingTop
358
- }
359
- if (paddingBottom) {
360
- tHeight -= paddingBottom
361
- }
362
- this.tableWidth = tableWidth
363
- if (this.$refs.searchAreaRef) {
364
- tHeight -= this.$refs.searchAreaRef.clientHeight
365
- }
366
- if (this.$refs.headerRef) {
367
- tHeight -= this.$refs.headerRef.clientHeight
368
- }
369
- if (this.$refs.footerRef) {
370
- tHeight -= this.$refs.footerRef.clientHeight
371
- }
372
- if (this.fixedHeader) {
373
- this.height = tHeight
374
- } else {
375
- let tableWrap =
376
- this.$refs.plusTableInnerRef.getElementsByClassName(
377
- 'ivu-table-wrapper'
378
- )[0]
379
- if (tableWrap) {
380
- if (!this.data.data || !this.data.data.length) {
381
- tableWrap.style.minHeight = tHeight + 'px'
346
+ var styleHeight = parseFloat(styles.getPropertyValue('height'))
347
+ // 如果您只想获取特定方向的padding值,例如padding-top
348
+ var paddingLeft = parseFloat(styles.getPropertyValue('padding-left'))
349
+ var paddingRight = parseFloat(
350
+ styles.getPropertyValue('padding-right')
351
+ )
352
+ var paddingTop = parseFloat(styles.getPropertyValue('padding-top'))
353
+ var paddingBottom = parseFloat(
354
+ styles.getPropertyValue('padding-bottom')
355
+ )
356
+ if (paddingLeft) {
357
+ tableWidth -= paddingLeft
358
+ }
359
+ if (paddingRight) {
360
+ tableWidth -= paddingRight
361
+ }
362
+ if (paddingTop) {
363
+ tHeight -= paddingTop
364
+ }
365
+ if (paddingBottom) {
366
+ tHeight -= paddingBottom
367
+ }
368
+ this.tableWidth = tableWidth
369
+ if (this.$refs.searchAreaRef) {
370
+ tHeight -= this.$refs.searchAreaRef.clientHeight
371
+ }
372
+ if (this.$refs.headerRef) {
373
+ tHeight -= this.$refs.headerRef.clientHeight
374
+ }
375
+ if (this.$refs.footerRef) {
376
+ tHeight -= this.$refs.footerRef.clientHeight
377
+ }
378
+ if (this.fixedHeader) {
379
+ this.height = tHeight
380
+ } else {
381
+ let tableWrap =
382
+ this.$refs.plusTableInnerRef.getElementsByClassName(
383
+ 'ivu-table-wrapper'
384
+ )[0]
385
+ if (tableWrap) {
386
+ if (!this.data.data || !this.data.data.length) {
387
+ tableWrap.style.minHeight = tHeight + 'px'
388
+ }
382
389
  }
383
390
  }
384
- }
391
+ })
385
392
  })
386
393
  },
387
394
  slotValue(col, row) {