| | |
| | | loading.value = false; |
| | | await nextTick(); |
| | | resizeAllCharts(); |
| | | if (!background && dashboardCode.value === 'purchase-sales') { |
| | | if (!background) { |
| | | const intervals = charts.value.map((chart) => chart.refreshInterval).filter((interval) => interval > 0); |
| | | if (intervals.length) dataRefreshTimer = setInterval(() => { |
| | | if (!loading.value && document.visibilityState === 'visible') loadData(true); |
| | |
| | | return val.slice(0, 10); |
| | | } |
| | | return val; |
| | | } |
| | | |
| | | // 大屏表格「实时滚动」:数据复制一份,配合 CSS marquee 做无缝纵向滚动 |
| | | function duplicateRows(rows?: Record<string, unknown>[]): Record<string, unknown>[] { |
| | | return rows ? [...rows, ...rows] : []; |
| | | } |
| | | |
| | | // ======== 看板主题色 ======== |
| | |
| | | >{{ key }}</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tbody class="marquee-tbody"> |
| | | <tr |
| | | v-for="(row, ri) in chart.data" |
| | | v-for="(row, ri) in duplicateRows(chart.data)" |
| | | :key="ri" |
| | | :style="{ animationDelay: `${ri * 50}ms` }" |
| | | > |
| | |
| | | } |
| | | |
| | | .table-wrap { |
| | | overflow-x: auto; border-radius: 8px; |
| | | overflow-x: auto; |
| | | overflow-y: hidden; |
| | | max-height: 320px; |
| | | border-radius: 8px; |
| | | background: rgba(4, 14, 36, 0.55); |
| | | backdrop-filter: blur(6px); |
| | | -webkit-backdrop-filter: blur(6px); |
| | |
| | | |
| | | .data-table { |
| | | width: 100%; border-collapse: collapse; font-size: 12px; |
| | | } |
| | | |
| | | .data-table thead { |
| | | position: sticky; |
| | | top: 0; |
| | | z-index: 2; |
| | | } |
| | | |
| | | .data-table thead th { |
| | |
| | | to { opacity: 1; transform: translateY(0); } |
| | | } |
| | | |
| | | /* 大屏表格「实时滚动」:tbody 复制一份后 translateY(-50%) 无缝循环 */ |
| | | .marquee-tbody { |
| | | animation: table-marquee 15s linear infinite; |
| | | } |
| | | .marquee-tbody:hover { |
| | | animation-play-state: paused; |
| | | } |
| | | @keyframes table-marquee { |
| | | from { transform: translateY(0); } |
| | | to { transform: translateY(-50%); } |
| | | } |
| | | |
| | | /* ======== 空状态 ======== */ |
| | | .empty-state { |
| | | position: relative; z-index: 1; |