From 308d9ae94ee41efbfdc3aeecf21cc0703e7892dd Mon Sep 17 00:00:00 2001 From: wx <645899409@qq.com> Date: Tue, 8 Jul 2025 13:16:28 +0800 Subject: [PATCH] update --- .../components/monitoringThresholdModal.vue | 44 ++++++++++++++++--- .../monitorToll/toolManagement/toolHooks.ts | 29 ++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/monitoringThresholdModal.vue b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/monitoringThresholdModal.vue index 227f240..5a747e6 100644 --- a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/monitoringThresholdModal.vue +++ b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/components/monitoringThresholdModal.vue @@ -2,24 +2,55 @@ @@ -32,6 +63,7 @@ import { thresholdSchema } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.data'; import { setPeriod } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolManagement.api'; import { cloneDeep } from 'lodash-es'; + import { selectFour, selectOne, selectThree, selectTwo } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks'; // Emits声明 const emit = defineEmits(['register', 'success']); diff --git a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks.ts b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks.ts index 4d104d6..c57c94a 100644 --- a/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks.ts +++ b/src/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks.ts @@ -86,3 +86,32 @@ export function downloadExcel(url: string, name: string, type = '.xlsx') { a.click(); document.body.removeChild(a); } + +export const selectOne = { + one: getOption(40, 3, 5, true), + two: getOption(100, 3, 10, true), +}; +export const selectTwo = { + one: getOption(75, 4, 5, true), +}; +export const selectThree = { + two: getOption(80, 10, 1, true), +}; +export const selectFour = { + one: getOption(34.0, 20, 0.1, false), + two: getOption(37.2, 13, 0.1, false), +}; + +function getOption(start: number, length: number, step: any, b: boolean) { + let result: any[] = []; + let c = 0; + for (let i = 0; i < length; i++) { + c = parseFloat(start + i * step).toFixed(b ? 0 : 1); + result.push({ + label: c, + value: c, + }); + } + + return result; +}