Browse Source

阀门数值*10

master
maochaoying 2 years ago
parent
commit
82b3e35f92
  1. 28
      src/components/info/AirSwitchConfig.vue

28
src/components/info/AirSwitchConfig.vue

@ -87,30 +87,30 @@ const bottomText = ref('0%')
const topChange = ({ selectedOptions, selectedValues }) => {
topText.value = selectedOptions[0].text
webSocketStore.sendCommandMsg(
AirInletProportionalValve_setStateJSON([parseInt(selectedValues[0] * 10)]),
AirInletProportionalValve_setStateJSON([parseInt(selectedValues[0])]),
)
sealStore.updateAirInletProportionalValue(parseInt(selectedValues[0]))
}
const bottomChange = ({ selectedOptions, selectedValues }) => {
bottomText.value = selectedOptions[0].text
webSocketStore.sendCommandMsg(
AirOutletProportionalValve_setStateJSON([parseInt(selectedValues[0] * 10)]),
AirOutletProportionalValve_setStateJSON([parseInt(selectedValues[0])]),
)
sealStore.updateAirOutletProportionalValue(parseInt(selectedValues[0]))
}
const columns = ref([
{ text: '0%', value: '0' },
{ text: '10%', value: '10' },
{ text: '20%', value: '20' },
{ text: '30%', value: '30' },
{ text: '40%', value: '40' },
{ text: '50%', value: '50' },
{ text: '60%', value: '60' },
{ text: '70%', value: '70' },
{ text: '80%', value: '80' },
{ text: '90%', value: '90' },
{ text: '100%', value: '100' },
{ text: '10%', value: '100' },
{ text: '20%', value: '200' },
{ text: '30%', value: '300' },
{ text: '40%', value: '400' },
{ text: '50%', value: '500' },
{ text: '60%', value: '600' },
{ text: '70%', value: '700' },
{ text: '80%', value: '800' },
{ text: '90%', value: '900' },
{ text: '100%', value: '1000' },
])
const selectedValuesTop = ref(['0'])
@ -133,7 +133,7 @@ watch(
(newVal, oldVal) => {
console.log('airInletProportionalInitVal', newVal)
selectedValuesTop.value = [newVal + '']
topText.value = `${newVal}%`
topText.value = `${newVal / 10}%`
},
)
@ -142,7 +142,7 @@ watch(
(newVal, oldVal) => {
console.log('airOutletProportionalInitVal', newVal)
selectedValuesBottom.value = [newVal + '']
bottomText.value = `${newVal}%`
bottomText.value = `${newVal / 10}%`
},
)
</script>

Loading…
Cancel
Save