vue2-client 1.8.209 → 1.8.211
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 +1 -1
- package/src/App.vue +1 -1
- package/src/base-client/components/common/XForm/XForm.vue +1 -0
- package/src/base-client/components/common/XFormTable/XFormTable.vue +9 -6
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +1 -1
- package/src/base-client/components/common/XTable/XTable.vue +32 -8
- package/vue.config.js +1 -1
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
<x-form
|
|
33
33
|
ref="xForm"
|
|
34
|
+
@toggleAdvanced="toggleAdvanced"
|
|
34
35
|
@onSubmit="onSearchSubmit">
|
|
35
36
|
<slot name="formBtnExpand"></slot>
|
|
36
37
|
</x-form>
|
|
@@ -442,16 +443,18 @@ export default {
|
|
|
442
443
|
afterDelete (res) {
|
|
443
444
|
this.$emit('afterDelete', res)
|
|
444
445
|
},
|
|
446
|
+
/**
|
|
447
|
+
* 更多条件是否展示
|
|
448
|
+
*/
|
|
449
|
+
toggleAdvanced () {
|
|
450
|
+
this.$refs.xTable.setScrollYHeight({})
|
|
451
|
+
},
|
|
445
452
|
/**
|
|
446
453
|
* 查询表单部分显示/隐藏切换
|
|
447
454
|
*/
|
|
448
455
|
toggleIsFormShow () {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (!visible && window.__MICRO_APP_ENVIRONMENT__) {
|
|
452
|
-
height = 'calc(100vh - 23.5rem)'
|
|
453
|
-
}
|
|
454
|
-
this.$refs.xTable.setScrollYHeight(height)
|
|
456
|
+
this.$refs.xForm.toggleVisible()
|
|
457
|
+
this.$refs.xTable.setScrollYHeight({})
|
|
455
458
|
},
|
|
456
459
|
/**
|
|
457
460
|
* 选择列事件
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
</a-row>
|
|
56
56
|
<s-table
|
|
57
57
|
ref="table"
|
|
58
|
+
id="XTable"
|
|
58
59
|
:alert="true"
|
|
59
60
|
:columns="tableColumns"
|
|
60
61
|
:data="loadData"
|
|
@@ -310,7 +311,7 @@ export default {
|
|
|
310
311
|
}
|
|
311
312
|
}
|
|
312
313
|
// 设置表格高度为固定值
|
|
313
|
-
this.setScrollYHeight('default')
|
|
314
|
+
this.setScrollYHeight({ type: 'default' })
|
|
314
315
|
// 横向滚动长度大于所有宽度,才能实现固定表头
|
|
315
316
|
this.scrollXWidth = totalWidth
|
|
316
317
|
// 加载筛选列完成
|
|
@@ -379,14 +380,37 @@ export default {
|
|
|
379
380
|
this.$refs.table.refresh(bool)
|
|
380
381
|
})
|
|
381
382
|
},
|
|
382
|
-
setScrollYHeight (
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
383
|
+
setScrollYHeight ({ extraHeight = 80, id = 'XTable', type = '' }) {
|
|
384
|
+
this.$nextTick(() => {
|
|
385
|
+
if (typeof extraHeight == 'undefined') {
|
|
386
|
+
// 默认底部分页32 + 边距48
|
|
387
|
+
extraHeight = 48 + 32
|
|
387
388
|
}
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
let tHeader = null
|
|
390
|
+
console.log(document.getElementById(id))
|
|
391
|
+
if (id) {
|
|
392
|
+
tHeader = document.getElementById(id) ? document.getElementById(id).getElementsByClassName('ant-table-thead')[0] : null
|
|
393
|
+
} else {
|
|
394
|
+
tHeader = document.getElementsByClassName('ant-table-thead')[0]
|
|
395
|
+
}
|
|
396
|
+
// 表格内容距离顶部的距离
|
|
397
|
+
let tHeaderBottom = 0
|
|
398
|
+
if (tHeader) {
|
|
399
|
+
console.log(tHeader.getBoundingClientRect())
|
|
400
|
+
tHeaderBottom = tHeader.getBoundingClientRect().bottom
|
|
401
|
+
}
|
|
402
|
+
if (tHeaderBottom === 0) {
|
|
403
|
+
this.scrollYHeight = 'calc(100vh - 31rem)'
|
|
404
|
+
if (window.__MICRO_APP_ENVIRONMENT__) {
|
|
405
|
+
this.scrollYHeight = 'calc(100vh - 28.5rem)'
|
|
406
|
+
}
|
|
407
|
+
return
|
|
408
|
+
}
|
|
409
|
+
// 窗体高度-表格内容顶部的高度-表格内容底部的高度
|
|
410
|
+
// this.scrollYHeight = document.body.clientHeight - tHeaderBottom - extraHeight
|
|
411
|
+
console.log(`calc(100vh - ${tHeaderBottom + extraHeight}px)`)
|
|
412
|
+
this.scrollYHeight = `calc(100vh - ${tHeaderBottom + extraHeight}px)`
|
|
413
|
+
})
|
|
390
414
|
},
|
|
391
415
|
/**
|
|
392
416
|
* 格式化日期
|