Browse Source

设置-设备参数设置增加恢复出厂设置配置

master
sige 1 year ago
parent
commit
4216b6c110
  1. 26
      src/components/Setting/components/Device.vue
  2. 2
      src/store/modules/setting.js

26
src/components/Setting/components/Device.vue

@ -97,6 +97,13 @@
/> />
</p> </p>
</div> </div>
<div class="row_wrap">
<p class="title">恢复默认设置</p>
<p class="num">
<div class="btn" style="font-size: 1rem;margin-right: 50px;" @click="actionDefaultSetting">恢复</div>
</p>
</div>
<van-number-keyboard <van-number-keyboard
v-model="addLiquidConfigVal" v-model="addLiquidConfigVal"
:title="addLiquidConfigVal" :title="addLiquidConfigVal"
@ -209,10 +216,15 @@ import Down from '@/assets/img/arrow/down.png'
import Top from '@/assets/img/arrow/top.png' import Top from '@/assets/img/arrow/top.png'
import { import {
setSettingValJSON, setSettingValJSON,
getAllSettingJSON,
changeDisinfectionParameterJSON, changeDisinfectionParameterJSON,
updateSettingInRunInfectionJSON, updateSettingInRunInfectionJSON,
} from '@/mock/command' } from '@/mock/command'
import MyModal from '../../../utils/MyModal'
const topContainer = () => { const topContainer = () => {
const ele = document.getElementById('set_device_container') const ele = document.getElementById('set_device_container')
ele.scrollTop = ele.scrollTop - 100 < 100 ? 0 : ele.scrollTop - 100 ele.scrollTop = ele.scrollTop - 100 < 100 ? 0 : ele.scrollTop - 100
@ -721,6 +733,20 @@ const setSprayLiquidVal = () => {
} }
showSuccessToast('设置成功') showSuccessToast('设置成功')
} }
//
async function actionDefaultSetting() {
let isConfirmed = await MyModal.confirm('是否恢复到默认设置?');
if (!isConfirmed) {
return;
}
if ( !props.runInfection ) {
await webSocketStore.call('factoryResetSettings');
webSocketStore.sendCommandMsg(getAllSettingJSON);
}
showSuccessToast('设置成功')
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

2
src/store/modules/setting.js

@ -113,6 +113,7 @@ export const useSettingStore = defineStore({
this.stoped_satur = stoped_saturObj.val this.stoped_satur = stoped_saturObj.val
this.continued_gs = continued_gsObj.val this.continued_gs = continued_gsObj.val
this.stoped_gs = stoped_gsObj.val this.stoped_gs = stoped_gsObj.val
this.allSettingList = allSettingList
// 对当前数组进行处理 赋予给泵参数 // 对当前数组进行处理 赋予给泵参数
const addLiquid = allSettingList.filter( const addLiquid = allSettingList.filter(
item => item.name == 'drainage_pump_speed', item => item.name == 'drainage_pump_speed',
@ -123,7 +124,6 @@ export const useSettingStore = defineStore({
this.addLiquidConfigVal = addLiquid.val this.addLiquidConfigVal = addLiquid.val
this.sprayLiquidConfigVal = sprayLiquid.val this.sprayLiquidConfigVal = sprayLiquid.val
this.allSettingList = allSettingList
}, },
updateInitLoading() { updateInitLoading() {
this.initLoading = false this.initLoading = false

Loading…
Cancel
Save