shijiplus-web-plugin 0.1.54 → 0.1.56
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
|
@@ -78,6 +78,16 @@ export default {
|
|
|
78
78
|
// 结束日期的占位符
|
|
79
79
|
default: '结束时间'
|
|
80
80
|
},
|
|
81
|
+
initialDate: {
|
|
82
|
+
// 初始时间
|
|
83
|
+
type: [Object],
|
|
84
|
+
default() {
|
|
85
|
+
return {
|
|
86
|
+
begin: null,
|
|
87
|
+
end: null
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
81
91
|
min: {
|
|
82
92
|
// 允许的最小日期,可以是对象或字符串
|
|
83
93
|
default() {
|
|
@@ -150,6 +160,19 @@ export default {
|
|
|
150
160
|
deep: true,
|
|
151
161
|
immediate: true
|
|
152
162
|
},
|
|
163
|
+
initialDate: {
|
|
164
|
+
// 监听format属性变化
|
|
165
|
+
handler(val) {
|
|
166
|
+
if (val.begin) {
|
|
167
|
+
this.beginChange(this.$formatDate(val.begin, this.beginFormat))
|
|
168
|
+
}
|
|
169
|
+
if (val.end) {
|
|
170
|
+
this.endChange(this.$formatDate(val.end, this.endFormat))
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
deep: true,
|
|
174
|
+
immediate: true
|
|
175
|
+
},
|
|
153
176
|
begin: {
|
|
154
177
|
// 监听begin属性变化
|
|
155
178
|
handler(val) {
|
|
@@ -325,63 +325,70 @@ export default {
|
|
|
325
325
|
}
|
|
326
326
|
},
|
|
327
327
|
methods: {
|
|
328
|
-
|
|
329
|
-
this.$
|
|
330
|
-
|
|
331
|
-
|
|
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.
|
|
333
|
+
resolve(this.getClientHeight(count + 1))
|
|
334
334
|
}, 100)
|
|
335
|
-
|
|
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
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
)
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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) {
|