From f88e91ab58e6031cd20853bd85615145c7c46862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Sun, 6 Jul 2025 17:06:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=AD=A3=E8=B4=9F=E5=8E=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=8D=E5=86=8D=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/HomeSetting.vue | 55 ---------------------- src/components/home/PressureControl.vue | 81 +++++++++++++++++++++++++++++++++ src/views/home/index.vue | 2 + 3 files changed, 83 insertions(+), 55 deletions(-) create mode 100644 src/components/home/PressureControl.vue diff --git a/src/components/home/HomeSetting.vue b/src/components/home/HomeSetting.vue index 1f097e1..8a4d164 100644 --- a/src/components/home/HomeSetting.vue +++ b/src/components/home/HomeSetting.vue @@ -157,46 +157,6 @@ const setRealtimeConfig = async (key: string, val: string) => { } /** - * @function 打开压力控制模态框 - * @desc 初始化压力类型和强度选项 - */ -const onSetPressure = () => { - const pressureVal = pressureConfig.value - const { typeDisplayNames, types, intensitys } = pressureVal || {} - - // 构建压力类型选项(左列) - const leftOptions: System.Option[] - = typeDisplayNames?.map((name: string, index: number) => ({ - label: name, - value: types[index], - })) || [] - - // 构建压力强度选项(右列) - const rightOptions: System.Option[] = [] - if (types?.includes('positivePressure')) { - intensitys?.positivePressure?.forEach((intensity: string) => { - rightOptions.push({ label: `${intensity}%`, value: intensity }) - }) - } - - optionsLeft.value = leftOptions - optionsRight.value = rightOptions - - // 获取已经设置的压力值 - syncSendCmd({ - className: 'PipelinePressureControl', - fnName: 'getState', - }).then((res) => { - if (res.ackcode === 0) { - defaultIntensityValue.value = res.rely.intensity - homeStore.updateDefaultIntensityValue(res.rely.intensity) - homeStore.updateDefaultIntensityTypeValue(res.rely.type) - isModalOpen.value = true - } - }) -} - -/** * @function 确认压力选择 * @param {string|number[]} value - 选中的压力配置值([类型, 强度]) * @desc 关闭模态框并更新压力配置 @@ -228,26 +188,11 @@ const settingWidth = computed(() => { } return '7.5rem' }) - -const deviceType = computed(() => { - return __DEVICE_TYPE__ -})