From 3f4b3c67f261f21121c8e9f7c14d926f152a5836 Mon Sep 17 00:00:00 2001 From: Sun <95302870@qq.com> Date: Sat, 6 Jan 2024 11:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90=E4=BA=86?= =?UTF-8?q?=E5=A2=9E=E6=94=B9=E6=9F=A5=E5=8C=85=E6=8B=AC=E7=A3=81=E7=9B=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppIconSystemMonitor/Disk.vue | 1 - .../SystemMonitor/Edit/DiskEditor/index.vue | 57 ++++++++++++------- .../Edit/GenericProgressStyleEditor/index.vue | 21 +++++-- .../deskModule/SystemMonitor/Edit/index.vue | 20 ++++--- .../deskModule/SystemMonitor/index.vue | 11 +++- src/utils/defaultData/index.ts | 10 ++++ 6 files changed, 81 insertions(+), 39 deletions(-) create mode 100644 src/utils/defaultData/index.ts diff --git a/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue index 9443215..41898d2 100644 --- a/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue +++ b/src/components/deskModule/SystemMonitor/AppIconSystemMonitor/Disk.vue @@ -31,7 +31,6 @@ function formatdiskToByte(v: number): number { } async function getData() { - console.log(props.path) try { const { data, code } = await getDiskStateByPath(props.path) if (code === 0) diff --git a/src/components/deskModule/SystemMonitor/Edit/DiskEditor/index.vue b/src/components/deskModule/SystemMonitor/Edit/DiskEditor/index.vue index 77606be..db2e1ff 100644 --- a/src/components/deskModule/SystemMonitor/Edit/DiskEditor/index.vue +++ b/src/components/deskModule/SystemMonitor/Edit/DiskEditor/index.vue @@ -6,6 +6,7 @@ import GenericMonitorCard from '../../components/GenericMonitorCard/index.vue' import GenericProgress from '../../components/GenericProgress/index.vue' import { PanelPanelConfigStyleEnum } from '@/enums' import { getDiskMountpoints } from '@/api/system/systemMonitor' +import { defautSwatchesBackground } from '@/utils/defaultData' interface Emit { (e: 'update:diskExtendParam', visible: DiskExtendParam): void @@ -21,7 +22,7 @@ const mountPointList = ref<{ value: string }[]>([]) -const data = computed({ +const extendParam = computed({ get: () => props.diskExtendParam, set: (visible) => { emit('update:diskExtendParam', visible) @@ -34,8 +35,11 @@ async function getMountPointList() { mountPointList.value = [] for (let i = 0; i < data.length; i++) { const element = data[i] + if (i === 0 && !extendParam.value.path) + extendParam.value.path = element.mountpoint + mountPointList.value.push({ - label: element.device, + label: element.mountpoint, value: element.mountpoint, }) } @@ -52,26 +56,25 @@ onMounted(() => { + + diff --git a/src/components/deskModule/SystemMonitor/Edit/GenericProgressStyleEditor/index.vue b/src/components/deskModule/SystemMonitor/Edit/GenericProgressStyleEditor/index.vue index 6451c6c..bf23d44 100644 --- a/src/components/deskModule/SystemMonitor/Edit/GenericProgressStyleEditor/index.vue +++ b/src/components/deskModule/SystemMonitor/Edit/GenericProgressStyleEditor/index.vue @@ -5,6 +5,7 @@ import type { GenericProgressStyleExtendParam } from '../../typings' import GenericMonitorCard from '../../components/GenericMonitorCard/index.vue' import GenericProgress from '../../components/GenericProgress/index.vue' import { PanelPanelConfigStyleEnum } from '@/enums' +import { defautSwatchesBackground } from '@/utils/defaultData' interface Emit { (e: 'update:genericProgressStyleExtendParam', visible: GenericProgressStyleExtendParam): void @@ -27,7 +28,7 @@ const data = computed({
-
+
- + - + - + - +
+ + diff --git a/src/components/deskModule/SystemMonitor/Edit/index.vue b/src/components/deskModule/SystemMonitor/Edit/index.vue index 3456622..ee1a360 100644 --- a/src/components/deskModule/SystemMonitor/Edit/index.vue +++ b/src/components/deskModule/SystemMonitor/Edit/index.vue @@ -63,13 +63,16 @@ watch(() => props.visible, (value) => { active.value = props.monitorData?.monitorType || MonitorType.cpu if (props.monitorData?.monitorType === MonitorType.cpu || props.monitorData?.monitorType === MonitorType.memory) currentGenericProgressStyleExtendParam.value = { ...props.monitorData?.extendParam } + else if (props.monitorData?.monitorType === MonitorType.disk) + currentDiskExtendParam.value = { ...props.monitorData?.extendParam } if (!value) - handleResetGenericProgressStyleExtendParam() + handleResetExtendParam() }) -function handleResetGenericProgressStyleExtendParam() { +function handleResetExtendParam() { currentGenericProgressStyleExtendParam.value = { ...defaultGenericProgressStyleExtendParam } + currentDiskExtendParam.value = { ...defaultDiskExtendParam } } // 保存提交 @@ -109,25 +112,26 @@ async function handleSubmit() {