Browse Source

fix: 消毒设置改为关闭

master
guoapeng 2 weeks ago
parent
commit
88f48cc0d1
  1. 38
      src/components/home/HomeSetting.vue

38
src/components/home/HomeSetting.vue

@ -118,7 +118,8 @@ const onSave = async () => {
} }
formulaStore.updateSelectedFormulaDataByList(cloneDeep(formData)) // formulaStore.updateSelectedFormulaDataByList(cloneDeep(formData)) //
if (!homeStore.isDeviceIdle) { //
if (!homeStore.isDeviceIdle) {
//
const res = await sendCmd({ const res = await sendCmd({
className: 'DisinfectionCtrlServiceExt', className: 'DisinfectionCtrlServiceExt',
fnName: 'getRealtimeConfig', fnName: 'getRealtimeConfig',
@ -127,19 +128,23 @@ const onSave = async () => {
const diff = compareJSON(res, formData) const diff = compareJSON(res, formData)
const diffKeys = Object.keys(diff) const diffKeys = Object.keys(diff)
if (diffKeys.length) { if (diffKeys.length) {
await Promise.all(diffKeys.map(async (key) => {
await Promise.all(
diffKeys.map(async (key) => {
await setRealtimeConfig(key, diff[key].newVal) await setRealtimeConfig(key, diff[key].newVal)
}))
}),
)
FtMessage.success('配方修改成功') FtMessage.success('配方修改成功')
} }
} }
else { //
else {
//
if (formData.formula_id) { if (formData.formula_id) {
formulaStore.updateSelectedFormulaDataByList(formData) formulaStore.updateSelectedFormulaDataByList(formData)
} }
} }
onClose() // onClose() //
} }
console.log(onSave)
/** /**
* @function 设置实时消毒参数 * @function 设置实时消毒参数
@ -170,7 +175,8 @@ const onSetPressure = () => {
const { typeDisplayNames, types, intensitys } = pressureVal || {} const { typeDisplayNames, types, intensitys } = pressureVal || {}
// //
const leftOptions: System.Option[] = typeDisplayNames?.map((name: string, index: number) => ({
const leftOptions: System.Option[]
= typeDisplayNames?.map((name: string, index: number) => ({
label: name, label: name,
value: types[index], value: types[index],
})) || [] })) || []
@ -291,7 +297,7 @@ const settingWidth = computed(() => {
<template #footer> <template #footer>
<div class="config-btn"> <div class="config-btn">
<BtButton <BtButton
button-text="取消"
button-text="关闭"
border-radius="5px" border-radius="5px"
width="7rem" width="7rem"
text-size="1.5rem" text-size="1.5rem"
@ -299,16 +305,16 @@ const settingWidth = computed(() => {
height="3rem" height="3rem"
@click="onClose" @click="onClose"
/> />
<BtButton
bg-color="#1989fa"
button-text="确认"
border-radius="5px"
width="7rem"
text-size="1.5rem"
text-color="#ffffff"
height="3rem"
@click="onSave"
/>
<!-- <BtButton -->
<!-- bg-color="#1989fa" -->
<!-- button-text="确认" -->
<!-- border-radius="5px" -->
<!-- width="7rem" -->
<!-- text-size="1.5rem" -->
<!-- text-color="#ffffff" -->
<!-- height="3rem" -->
<!-- @click="onSave" -->
<!-- /> -->
</div> </div>
</template> </template>
</ft-dialog> </ft-dialog>

Loading…
Cancel
Save