verce-vue-test 0.0.69 → 0.0.70
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
|
@@ -9,8 +9,9 @@ export default {
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
|
-
import { ref, type Component } from 'vue'
|
|
12
|
+
import { onBeforeUnmount, onDeactivated, onMounted, ref, type Component } from 'vue'
|
|
13
13
|
import { storeToRefs } from 'pinia'
|
|
14
|
+
import { ElMessage } from 'element-plus'
|
|
14
15
|
import { Grid, Menu } from '@element-plus/icons-vue'
|
|
15
16
|
import ForecastInfoPanel from './components/ForecastInfoPanel.vue'
|
|
16
17
|
import FlowInfoPanel from './components/FlowInfoPanel.vue'
|
|
@@ -35,11 +36,60 @@ const { cardLayout } = storeToRefs(forecastInfoStore)
|
|
|
35
36
|
* 抽屉和弹窗不再直接挂到 body,避免 Layout 路由切换或 KeepAlive 缓存时遮罩残留在其他页面上。
|
|
36
37
|
*/
|
|
37
38
|
const overlayContainer = ref<HTMLElement | null>(null)
|
|
39
|
+
/** 全屏只挂载当前业务页面,浏览器会自动排除外层侧边栏和顶部 Layout。 */
|
|
40
|
+
const pageContainer = ref<HTMLElement | null>(null)
|
|
41
|
+
const isFullscreen = ref(false)
|
|
42
|
+
|
|
43
|
+
function syncFullscreenState() {
|
|
44
|
+
isFullscreen.value = document.fullscreenElement === pageContainer.value
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function toggleFullscreen() {
|
|
48
|
+
const container = pageContainer.value
|
|
49
|
+
|
|
50
|
+
if (!container) return
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
if (document.fullscreenElement === container) {
|
|
54
|
+
await document.exitFullscreen()
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!container.requestFullscreen) {
|
|
59
|
+
ElMessage.warning('当前浏览器不支持页面全屏')
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
await container.requestFullscreen()
|
|
64
|
+
} catch {
|
|
65
|
+
ElMessage.error('进入全屏失败,请检查浏览器权限设置')
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function exitPageFullscreen() {
|
|
70
|
+
if (document.fullscreenElement === pageContainer.value) {
|
|
71
|
+
void document.exitFullscreen()
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
onMounted(() => document.addEventListener('fullscreenchange', syncFullscreenState))
|
|
76
|
+
onDeactivated(exitPageFullscreen)
|
|
77
|
+
onBeforeUnmount(() => {
|
|
78
|
+
document.removeEventListener('fullscreenchange', syncFullscreenState)
|
|
79
|
+
exitPageFullscreen()
|
|
80
|
+
})
|
|
38
81
|
</script>
|
|
39
82
|
|
|
40
83
|
<template>
|
|
41
84
|
<!-- 水平布局使用两列;垂直布局由公共样式切换为两行等高卡片。 -->
|
|
42
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
ref="pageContainer"
|
|
87
|
+
class="forecast-info-page"
|
|
88
|
+
:class="{
|
|
89
|
+
'forecast-info-page--horizontal': cardLayout === 'horizontal',
|
|
90
|
+
'forecast-info-page--fullscreen': isFullscreen,
|
|
91
|
+
}"
|
|
92
|
+
>
|
|
43
93
|
<!-- 固定定位且不参与网格布局,专门承接本页抽屉和弹窗。 -->
|
|
44
94
|
<div ref="overlayContainer" class="forecast-info-overlay-host"></div>
|
|
45
95
|
<!-- 两个面板接收同一布局值,保证任一入口切换后页面整体保持一致。 -->
|
|
@@ -47,13 +97,17 @@ const overlayContainer = ref<HTMLElement | null>(null)
|
|
|
47
97
|
:layout="cardLayout"
|
|
48
98
|
:layout-options="layoutOptions"
|
|
49
99
|
:overlay-container="overlayContainer"
|
|
100
|
+
:is-fullscreen="isFullscreen"
|
|
50
101
|
@change-layout="forecastInfoStore.setCardLayout"
|
|
102
|
+
@toggle-fullscreen="toggleFullscreen"
|
|
51
103
|
/>
|
|
52
104
|
<FlowInfoPanel
|
|
53
105
|
:layout="cardLayout"
|
|
54
106
|
:layout-options="layoutOptions"
|
|
55
107
|
:overlay-container="overlayContainer"
|
|
108
|
+
:is-fullscreen="isFullscreen"
|
|
56
109
|
@change-layout="forecastInfoStore.setCardLayout"
|
|
110
|
+
@toggle-fullscreen="toggleFullscreen"
|
|
57
111
|
/>
|
|
58
112
|
</div>
|
|
59
113
|
</template>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, onBeforeUnmount, onDeactivated, reactive, ref, type Component } from 'vue'
|
|
3
3
|
import { storeToRefs } from 'pinia'
|
|
4
4
|
import { ElMessage } from 'element-plus'
|
|
5
|
-
import { Search } from '@element-plus/icons-vue'
|
|
5
|
+
import { FullScreen, Search } from '@element-plus/icons-vue'
|
|
6
6
|
import type { RangeValue } from '@/components/NumberRange.vue'
|
|
7
7
|
import { formatThousands } from '@/utils/formatters'
|
|
8
8
|
import {
|
|
@@ -32,12 +32,15 @@ type TableColumn = {
|
|
|
32
32
|
defineProps<{
|
|
33
33
|
layout: ForecastInfoCardLayout
|
|
34
34
|
layoutOptions: LayoutOption[]
|
|
35
|
+
/** 当前页面是否已进入浏览器全屏。 */
|
|
36
|
+
isFullscreen: boolean
|
|
35
37
|
/** 页面级局部浮层容器,防止抽屉直接挂到 Layout 的 body 节点。 */
|
|
36
38
|
overlayContainer: HTMLElement | null
|
|
37
39
|
}>()
|
|
38
40
|
|
|
39
41
|
const emit = defineEmits<{
|
|
40
42
|
changeLayout: [layout: ForecastInfoCardLayout]
|
|
43
|
+
toggleFullscreen: []
|
|
41
44
|
}>()
|
|
42
45
|
|
|
43
46
|
/** 流水接口方向编码与预报不同:1 为收入,0 为支出。 */
|
|
@@ -210,28 +213,48 @@ function getFlowSequence(index: number) {
|
|
|
210
213
|
<!-- 卡片标题和页面级布局切换;操作会同步影响预报卡片。 -->
|
|
211
214
|
<header class="forecast-info-card__header">
|
|
212
215
|
<h2 id="flow-info-title" class="forecast-info-card__title">流水信息</h2>
|
|
213
|
-
<div class="forecast-info-
|
|
216
|
+
<div class="forecast-info-header-actions">
|
|
214
217
|
<el-tooltip
|
|
215
|
-
|
|
216
|
-
:key="option.value"
|
|
217
|
-
:content="option.label"
|
|
218
|
+
:content="isFullscreen ? '退出全屏' : '全屏显示'"
|
|
218
219
|
placement="top"
|
|
219
220
|
:show-after="200"
|
|
221
|
+
:append-to="overlayContainer || undefined"
|
|
220
222
|
>
|
|
221
223
|
<button
|
|
222
224
|
type="button"
|
|
223
|
-
class="forecast-info-
|
|
224
|
-
:class="{ 'is-active':
|
|
225
|
-
|
|
226
|
-
:aria-
|
|
227
|
-
|
|
228
|
-
@click="emit('changeLayout', option.value)"
|
|
225
|
+
class="forecast-info-fullscreen-button"
|
|
226
|
+
:class="{ 'is-active': isFullscreen }"
|
|
227
|
+
:aria-label="isFullscreen ? '退出全屏' : '全屏显示当前页面'"
|
|
228
|
+
:aria-pressed="isFullscreen"
|
|
229
|
+
@click="emit('toggleFullscreen')"
|
|
229
230
|
>
|
|
230
|
-
<el-icon>
|
|
231
|
-
<component :is="option.icon" />
|
|
232
|
-
</el-icon>
|
|
231
|
+
<el-icon><FullScreen /></el-icon>
|
|
233
232
|
</button>
|
|
234
233
|
</el-tooltip>
|
|
234
|
+
<div class="forecast-info-layout-switch" role="radiogroup" aria-label="切换流水信息卡片排列方式">
|
|
235
|
+
<el-tooltip
|
|
236
|
+
v-for="option in layoutOptions"
|
|
237
|
+
:key="option.value"
|
|
238
|
+
:content="option.label"
|
|
239
|
+
placement="top"
|
|
240
|
+
:show-after="200"
|
|
241
|
+
:append-to="overlayContainer || undefined"
|
|
242
|
+
>
|
|
243
|
+
<button
|
|
244
|
+
type="button"
|
|
245
|
+
class="forecast-info-layout-switch__button"
|
|
246
|
+
:class="{ 'is-active': layout === option.value }"
|
|
247
|
+
role="radio"
|
|
248
|
+
:aria-label="option.label"
|
|
249
|
+
:aria-checked="layout === option.value"
|
|
250
|
+
@click="emit('changeLayout', option.value)"
|
|
251
|
+
>
|
|
252
|
+
<el-icon>
|
|
253
|
+
<component :is="option.icon" />
|
|
254
|
+
</el-icon>
|
|
255
|
+
</button>
|
|
256
|
+
</el-tooltip>
|
|
257
|
+
</div>
|
|
235
258
|
</div>
|
|
236
259
|
</header>
|
|
237
260
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
CirclePlus,
|
|
8
8
|
DataAnalysis,
|
|
9
9
|
EditPen,
|
|
10
|
+
FullScreen,
|
|
10
11
|
Money,
|
|
11
12
|
RefreshLeft,
|
|
12
13
|
Search,
|
|
@@ -54,6 +55,8 @@ const amountColumnProps = new Set(['predAmt', 'verifyAmt'])
|
|
|
54
55
|
defineProps<{
|
|
55
56
|
layout: ForecastInfoCardLayout
|
|
56
57
|
layoutOptions: LayoutOption[]
|
|
58
|
+
/** 当前页面是否已进入浏览器全屏。 */
|
|
59
|
+
isFullscreen: boolean
|
|
57
60
|
/** 页面级局部浮层容器,防止抽屉与弹窗直接污染 Layout 的 body 节点。 */
|
|
58
61
|
overlayContainer: HTMLElement | null
|
|
59
62
|
}>()
|
|
@@ -61,6 +64,7 @@ defineProps<{
|
|
|
61
64
|
/** 任一业务卡片点击布局图标时,将新布局回传给页面容器。 */
|
|
62
65
|
const emit = defineEmits<{
|
|
63
66
|
changeLayout: [layout: ForecastInfoCardLayout]
|
|
67
|
+
toggleFullscreen: []
|
|
64
68
|
}>()
|
|
65
69
|
|
|
66
70
|
/** 预报筛选的后端收支方向编码。 */
|
|
@@ -384,28 +388,48 @@ function handleForecastPaginationChange(_value: { page: number; pageSize: number
|
|
|
384
388
|
<!-- 卡片标题与布局切换;两个面板使用相同的切换事件。 -->
|
|
385
389
|
<header class="forecast-info-card__header">
|
|
386
390
|
<h2 id="forecast-info-title" class="forecast-info-card__title">预报信息</h2>
|
|
387
|
-
<div class="forecast-info-
|
|
391
|
+
<div class="forecast-info-header-actions">
|
|
388
392
|
<el-tooltip
|
|
389
|
-
|
|
390
|
-
:key="option.value"
|
|
391
|
-
:content="option.label"
|
|
393
|
+
:content="isFullscreen ? '退出全屏' : '全屏显示'"
|
|
392
394
|
placement="top"
|
|
393
395
|
:show-after="200"
|
|
396
|
+
:append-to="overlayContainer || undefined"
|
|
394
397
|
>
|
|
395
398
|
<button
|
|
396
399
|
type="button"
|
|
397
|
-
class="forecast-info-
|
|
398
|
-
:class="{ 'is-active':
|
|
399
|
-
|
|
400
|
-
:aria-
|
|
401
|
-
|
|
402
|
-
@click="emit('changeLayout', option.value)"
|
|
400
|
+
class="forecast-info-fullscreen-button"
|
|
401
|
+
:class="{ 'is-active': isFullscreen }"
|
|
402
|
+
:aria-label="isFullscreen ? '退出全屏' : '全屏显示当前页面'"
|
|
403
|
+
:aria-pressed="isFullscreen"
|
|
404
|
+
@click="emit('toggleFullscreen')"
|
|
403
405
|
>
|
|
404
|
-
<el-icon>
|
|
405
|
-
<component :is="option.icon" />
|
|
406
|
-
</el-icon>
|
|
406
|
+
<el-icon><FullScreen /></el-icon>
|
|
407
407
|
</button>
|
|
408
408
|
</el-tooltip>
|
|
409
|
+
<div class="forecast-info-layout-switch" role="radiogroup" aria-label="切换预报信息卡片排列方式">
|
|
410
|
+
<el-tooltip
|
|
411
|
+
v-for="option in layoutOptions"
|
|
412
|
+
:key="option.value"
|
|
413
|
+
:content="option.label"
|
|
414
|
+
placement="top"
|
|
415
|
+
:show-after="200"
|
|
416
|
+
:append-to="overlayContainer || undefined"
|
|
417
|
+
>
|
|
418
|
+
<button
|
|
419
|
+
type="button"
|
|
420
|
+
class="forecast-info-layout-switch__button"
|
|
421
|
+
:class="{ 'is-active': layout === option.value }"
|
|
422
|
+
role="radio"
|
|
423
|
+
:aria-label="option.label"
|
|
424
|
+
:aria-checked="layout === option.value"
|
|
425
|
+
@click="emit('changeLayout', option.value)"
|
|
426
|
+
>
|
|
427
|
+
<el-icon>
|
|
428
|
+
<component :is="option.icon" />
|
|
429
|
+
</el-icon>
|
|
430
|
+
</button>
|
|
431
|
+
</el-tooltip>
|
|
432
|
+
</div>
|
|
409
433
|
</div>
|
|
410
434
|
</header>
|
|
411
435
|
|
|
@@ -37,6 +37,15 @@
|
|
|
37
37
|
align-items: stretch;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/* 浏览器全屏时页面根节点独占视口,不再预留外层 Layout 的头部高度。 */
|
|
41
|
+
.forecast-info-page:fullscreen,
|
|
42
|
+
.forecast-info-page--fullscreen {
|
|
43
|
+
width: 100vw;
|
|
44
|
+
height: 100vh;
|
|
45
|
+
margin: 0;
|
|
46
|
+
padding: 12px 14px 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
/* ---- 卡片与标题:两张业务卡片共享相同的边框、阴影和内部弹性结构。 ---- */
|
|
41
50
|
.forecast-info-page .forecast-info-card {
|
|
42
51
|
display: flex;
|
|
@@ -64,6 +73,43 @@
|
|
|
64
73
|
padding: 0 4px;
|
|
65
74
|
}
|
|
66
75
|
|
|
76
|
+
.forecast-info-page .forecast-info-header-actions {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: 6px;
|
|
80
|
+
flex: 0 0 auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.forecast-info-page .forecast-info-fullscreen-button {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
width: 30px;
|
|
86
|
+
height: 30px;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
padding: 0;
|
|
90
|
+
border: 1px solid #d8e1ee;
|
|
91
|
+
border-radius: 5px;
|
|
92
|
+
background: #f6f9fd;
|
|
93
|
+
color: #5f6f86;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.forecast-info-page .forecast-info-fullscreen-button:hover,
|
|
99
|
+
.forecast-info-page .forecast-info-fullscreen-button.is-active {
|
|
100
|
+
border-color: #b8cff4;
|
|
101
|
+
background: #e8f1ff;
|
|
102
|
+
color: #1668ff;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.forecast-info-page .forecast-info-fullscreen-button.is-active {
|
|
106
|
+
box-shadow: 0 3px 8px rgba(22, 104, 255, .16);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.forecast-info-page .forecast-info-fullscreen-button .el-icon {
|
|
110
|
+
font-size: 16px;
|
|
111
|
+
}
|
|
112
|
+
|
|
67
113
|
.forecast-info-page .forecast-info-layout-switch {
|
|
68
114
|
display: inline-flex;
|
|
69
115
|
align-items: center;
|