Browse Source

fix: 消毒设置改为关闭

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

66
src/components/home/HomeSetting.vue

@ -118,7 +118,8 @@ const onSave = async () => {
}
formulaStore.updateSelectedFormulaDataByList(cloneDeep(formData)) //
if (!homeStore.isDeviceIdle) { //
if (!homeStore.isDeviceIdle) {
//
const res = await sendCmd({
className: 'DisinfectionCtrlServiceExt',
fnName: 'getRealtimeConfig',
@ -127,19 +128,23 @@ const onSave = async () => {
const diff = compareJSON(res, formData)
const diffKeys = Object.keys(diff)
if (diffKeys.length) {
await Promise.all(diffKeys.map(async (key) => {
await setRealtimeConfig(key, diff[key].newVal)
}))
await Promise.all(
diffKeys.map(async (key) => {
await setRealtimeConfig(key, diff[key].newVal)
}),
)
FtMessage.success('配方修改成功')
}
}
else { //
else {
//
if (formData.formula_id) {
formulaStore.updateSelectedFormulaDataByList(formData)
}
}
onClose() //
}
console.log(onSave)
/**
* @function 设置实时消毒参数
@ -170,10 +175,11 @@ const onSetPressure = () => {
const { typeDisplayNames, types, intensitys } = pressureVal || {}
//
const leftOptions: System.Option[] = typeDisplayNames?.map((name: string, index: number) => ({
label: name,
value: types[index],
})) || []
const leftOptions: System.Option[]
= typeDisplayNames?.map((name: string, index: number) => ({
label: name,
value: types[index],
})) || []
//
const rightOptions: System.Option[] = []
@ -285,13 +291,13 @@ const settingWidth = computed(() => {
</div>
</div>
<ft-dialog v-model="disinfectFormulaVisible" :title="disinfectFormulaTitle" width="80vw">
<div style="height: 80vh;overflow: auto">
<div style="height: 80vh; overflow: auto">
<Config ref="configRef" />
</div>
<template #footer>
<div class="config-btn">
<BtButton
button-text="取消"
button-text="关闭"
border-radius="5px"
width="7rem"
text-size="1.5rem"
@ -299,16 +305,16 @@ const settingWidth = computed(() => {
height="3rem"
@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>
</template>
</ft-dialog>
@ -325,23 +331,23 @@ const settingWidth = computed(() => {
</template>
<style lang="scss" scoped>
.home-start-opt{
.home-start-opt {
margin: 0.5rem;
gap: 5px;
width: 100%;
.home-opt-flex{
.home-opt-flex {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
.home-opt-ml{
.home-opt-ml {
margin-left: 5px;
}
}
}
.config {
border: 1px solid red;
}
.config-btn{
//margin-top: -3rem
}
.config {
border: 1px solid red;
}
.config-btn {
//margin-top: -3rem
}
</style>
Loading…
Cancel
Save