lw-cdp-ui 1.3.3-ui → 1.3.3-ui-beta
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/dist/components/lwSearch/index.vue +4 -5
- package/dist/components/lwTable/index.js +16 -4
- package/dist/components/lwTable/index.scss +1 -1
- package/dist/components/lwTable/index.vue +3 -2
- package/dist/components/lwTable/useFullscreen.js +3 -0
- package/dist/lw-cdp-ui.esm.js +1419 -1393
- package/dist/lw-cdp-ui.umd.js +8 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="lw-search-card">
|
|
3
3
|
<div class="search-content">
|
|
4
4
|
<el-form ref="searchForm"
|
|
5
5
|
:model="form"
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
</el-row>
|
|
56
56
|
|
|
57
|
-
<div class="control"
|
|
58
|
-
:style="{bottom: ((options.length%columnNumber === 0) ? '0px' : '10px')}">
|
|
57
|
+
<div class="control">
|
|
59
58
|
<el-button class="reset"
|
|
60
59
|
@click="resetForm('searchForm')">
|
|
61
60
|
{{$t('btn.reset')}}
|
|
@@ -344,7 +343,7 @@ export default {
|
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
345
|
|
|
347
|
-
|
|
346
|
+
.lw-search-card {
|
|
348
347
|
width: 100%;
|
|
349
348
|
background: var(--color-bg-2);
|
|
350
349
|
// position: relative;
|
|
@@ -403,7 +402,7 @@ export default {
|
|
|
403
402
|
.control {
|
|
404
403
|
position: absolute;
|
|
405
404
|
right: 0;
|
|
406
|
-
bottom:
|
|
405
|
+
bottom: 10px;
|
|
407
406
|
z-index: 9;
|
|
408
407
|
display: flex;
|
|
409
408
|
justify-content: flex-end;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { VueSelecto } from 'vue3-selecto'
|
|
2
2
|
import TableColumn from './components/TableColumn.vue'
|
|
3
3
|
import empty from '@/assets/images/empty.jpg'
|
|
4
|
+
import { useFullscreen } from './useFullscreen'
|
|
5
|
+
const { isFullscreen, toggle: toggleFullScreen } = useFullscreen()
|
|
4
6
|
export default {
|
|
5
7
|
name: 'lwTable',
|
|
6
8
|
components: { VueSelecto, TableColumn },
|
|
@@ -18,6 +20,7 @@ export default {
|
|
|
18
20
|
stripe: { type: Boolean, default: false }, // 是否显示斑马纹
|
|
19
21
|
hoverable: { type: Boolean, default: true }, // 是否启用鼠标悬停效果
|
|
20
22
|
maxHeight: { type: String, default: 'calc(100vh - 270px)' }, // 表格最大高度
|
|
23
|
+
height: { type: String, default: '' }, // 表格高度
|
|
21
24
|
|
|
22
25
|
// 选择功能配置
|
|
23
26
|
rowSelection: { type: Boolean, default: false }, // 是否可选择行
|
|
@@ -51,6 +54,7 @@ export default {
|
|
|
51
54
|
// 表格基础状态
|
|
52
55
|
tableHeaders: [], // 表格列配置
|
|
53
56
|
localTableSize: this.tableSize, // 表格大小
|
|
57
|
+
tableHeight: this.tableSize, // 表格高度
|
|
54
58
|
|
|
55
59
|
// 列设置相关
|
|
56
60
|
checkedKeys: [], // 选中的列
|
|
@@ -109,10 +113,13 @@ export default {
|
|
|
109
113
|
immediate: true
|
|
110
114
|
}
|
|
111
115
|
},
|
|
112
|
-
|
|
113
116
|
created() {
|
|
114
117
|
// 监听窗口大小变化
|
|
115
118
|
window.addEventListener('resize', this.handleResize)
|
|
119
|
+
|
|
120
|
+
this.$nextTick(() => {
|
|
121
|
+
this.handleResize()
|
|
122
|
+
})
|
|
116
123
|
},
|
|
117
124
|
|
|
118
125
|
beforeDestroy() {
|
|
@@ -228,9 +235,8 @@ export default {
|
|
|
228
235
|
* 切换全屏显示
|
|
229
236
|
*/
|
|
230
237
|
tableToggleFullScreen() {
|
|
231
|
-
this.$bus.$emit('tableFullScreen', !this.isFullscreen)
|
|
232
238
|
this.isFullscreen = !this.isFullscreen
|
|
233
|
-
|
|
239
|
+
toggleFullScreen()
|
|
234
240
|
},
|
|
235
241
|
|
|
236
242
|
/**
|
|
@@ -240,9 +246,15 @@ export default {
|
|
|
240
246
|
const isFull = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
|
|
241
247
|
|
|
242
248
|
if (!isFull) {
|
|
243
|
-
this.$bus.$emit('tableFullScreen', false)
|
|
244
249
|
this.isFullscreen = false
|
|
245
250
|
}
|
|
251
|
+
|
|
252
|
+
// 自动计算稿表格高度
|
|
253
|
+
const container = document.querySelector('.adminui-main > .el-container')
|
|
254
|
+
const searchCard = document.querySelector('.lw-search-card')
|
|
255
|
+
if (container && searchCard) {
|
|
256
|
+
this.tableHeight = container.clientHeight - searchCard.clientHeight - 160
|
|
257
|
+
}
|
|
246
258
|
},
|
|
247
259
|
// 拖动选中
|
|
248
260
|
onSelect({ selected }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="lw-table-page">
|
|
3
3
|
<!-- 表格主体 -->
|
|
4
4
|
<el-table v-if="!isCard"
|
|
5
5
|
ref="multipleTable"
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
:data="tableData"
|
|
9
9
|
:row-key="rowKey"
|
|
10
10
|
:max-height="maxHeight"
|
|
11
|
-
:
|
|
11
|
+
:height="height || tableHeight"
|
|
12
|
+
:size="localTableSize"
|
|
12
13
|
:stripe="stripe"
|
|
13
14
|
:hoverable="hoverable"
|
|
14
15
|
highlight-current-row
|
|
@@ -38,16 +38,19 @@ export function useFullscreen() {
|
|
|
38
38
|
|
|
39
39
|
// 全屏切换
|
|
40
40
|
const toggleFullScreen = () => {
|
|
41
|
+
console.log(isFullscreen.value)
|
|
41
42
|
if (isFullscreen.value) {
|
|
42
43
|
exitFullscreen()
|
|
43
44
|
} else {
|
|
44
45
|
enterFullscreen(document.documentElement)
|
|
45
46
|
}
|
|
47
|
+
isFullscreen.value = !isFullscreen.value
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
// 检查全屏状态
|
|
49
51
|
const handleFullscreenChange = () => {
|
|
50
52
|
isFullscreen.value = Boolean(document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement)
|
|
53
|
+
console.log('--------', isFullscreen.value)
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
// 监听全屏状态变化
|