Skip to content

Commit 0ec8978

Browse files
committed
fix: remove scrollbars of charts
1 parent 0b99453 commit 0ec8978

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

src/pages/app/components/Dashboard/DashboardCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const DashboardCard: FunctionalComponent<DashboardCardProps> = ({ span, height,
2727
width: '100%',
2828
height: cvtPxScale(bodyHeight ?? '100%'),
2929
boxSizing: 'border-box',
30+
overflow: 'hidden',
3031
}}
3132
v-slots={ctx.slots}
3233
/>

src/pages/app/components/Dashboard/components/Indicator.tsx

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Flex from "@pages/components/Flex"
1414
import { selectSite } from "@service/stat-service"
1515
import { calcMostPeriodOf2Hours } from "@util/period"
1616
import { getStartOfDay, MILL_PER_DAY, MILL_PER_MINUTE } from "@util/time"
17-
import { ElIcon } from "element-plus"
17+
import { ElIcon, ElScrollbar } from "element-plus"
1818
import { computed, defineComponent, toRef, type VNode } from "vue"
1919

2020
type _Value = {
@@ -102,34 +102,36 @@ const _default = defineComponent(() => {
102102
const most2HourParam = computed(() => computeMost2HourParam(data.value))
103103

104104
return () => (
105-
<Flex column gap={4} style={{ textAlign: isXs.value ? 'center' : undefined }}>
106-
<Flex align="center" justify="center" marginBlock="0 15px">
107-
<ElIcon size={45}>
108-
<Sunrise />
109-
</ElIcon>
105+
<ElScrollbar>
106+
<Flex column gap={4} style={{ textAlign: isXs.value ? 'center' : undefined }} height='100%'>
107+
<Flex align="center" justify="center" marginBlock="0 15px">
108+
<ElIcon size={45}>
109+
<Sunrise />
110+
</ElIcon>
111+
</Flex>
112+
<IndicatorLabel
113+
v-show={data.value?.installedDays}
114+
path={msg => msg.dashboard.indicator.installedDays}
115+
param={{ number: data.value?.installedDays || 0 }}
116+
duration={1.5}
117+
/>
118+
<IndicatorLabel
119+
path={msg => msg.dashboard.indicator.visitCount}
120+
param={{ visit: data.value?.visits || 0, site: data.value?.sites || 0 }}
121+
duration={1.75}
122+
/>
123+
<IndicatorLabel
124+
path={msg => msg.dashboard.indicator.browsingTime}
125+
param={{ minute: Math.floor((data.value?.browsingTime || 0) / MILL_PER_MINUTE) }}
126+
duration={2}
127+
/>
128+
<IndicatorLabel
129+
path={msg => msg.dashboard.indicator.mostUse}
130+
param={most2HourParam.value}
131+
duration={2.25}
132+
/>
110133
</Flex>
111-
<IndicatorLabel
112-
v-show={data.value?.installedDays}
113-
path={msg => msg.dashboard.indicator.installedDays}
114-
param={{ number: data.value?.installedDays || 0 }}
115-
duration={1.5}
116-
/>
117-
<IndicatorLabel
118-
path={msg => msg.dashboard.indicator.visitCount}
119-
param={{ visit: data.value?.visits || 0, site: data.value?.sites || 0 }}
120-
duration={1.75}
121-
/>
122-
<IndicatorLabel
123-
path={msg => msg.dashboard.indicator.browsingTime}
124-
param={{ minute: Math.floor((data.value?.browsingTime || 0) / MILL_PER_MINUTE) }}
125-
duration={2}
126-
/>
127-
<IndicatorLabel
128-
path={msg => msg.dashboard.indicator.mostUse}
129-
param={most2HourParam.value}
130-
duration={2.25}
131-
/>
132-
</Flex>
134+
</ElScrollbar>
133135
)
134136
})
135137

0 commit comments

Comments
 (0)