diff --git a/src/api/home.ts b/src/api/home.ts index c08518e..a348511 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -17,12 +17,29 @@ export const getHomeData = () => { export type getSystemInfoResult = { success: boolean; data: { - title: string; - value: number; - color: string; - status?: "success" | "exception" | "warning"; - info: string[]; - }[]; + visual: { + title: string; + value: number; + color: string; + status?: "success" | "exception" | "warning"; + info: string[]; + }[]; + fsSize: { + fs: string; + type: string; + size: string; + used: string; + available: number; + use: number; + mount: string; + rw: boolean; + color: string; + }[]; + info: { + key: string; + value: string; + }[]; + }; }; /** 获取系统信息 */ diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index 9fdee23..0c993f0 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -171,7 +171,7 @@ - + + @@ -315,9 +385,11 @@ const weekChartData = ref< }[] >([]); const callStat = ref(null); -const systemInfo = ref( - Array.from({ length: 5 }, (_, index) => ({})) as any -); +const systemInfo = ref({ + visual: Array.from({ length: 5 }, (_, index) => ({})) as any, + fsSize: [], + info: [] +}); getChartData().then(res => { chartData.value = res.chartData; @@ -346,6 +418,19 @@ const optionsBasis: Array = [ label: "30天" } ]; + +// 滚动条 6px +const increaseScrollbarWidth = (event: any) => { + console.log(event.target.getBoundingClientRect()); + if (systemInfo.value.fsSize.length > 6) { + console.log(event.target.getBoundingClientRect()); + event.target.style.width = `${event.target.getBoundingClientRect().width + 6}px`; + } +}; + +const resetScrollbarWidth = (event: any) => { + event.target.style.width = `100%`; +};