|
@ -81,18 +81,21 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import A1 from '@/assets/img/air/1.png' |
|
|
import A1 from '@/assets/img/air/1.png' |
|
|
import A2 from '@/assets/img/air/2.png' |
|
|
import A2 from '@/assets/img/air/2.png' |
|
|
import { useSealStore, useWebSocketStore } from '@/store' |
|
|
|
|
|
|
|
|
import { useSealStore, useWebSocketStore, useSettingStore } from '@/store' |
|
|
import { |
|
|
import { |
|
|
AirInletProportionalValve_setStateJSON, |
|
|
AirInletProportionalValve_setStateJSON, |
|
|
AirOutletProportionalValve_setStateJSON, |
|
|
AirOutletProportionalValve_setStateJSON, |
|
|
airInletProportionalValve_getStateJSON, |
|
|
airInletProportionalValve_getStateJSON, |
|
|
|
|
|
getAllSettingJSON, |
|
|
AirOutletProportionalValve_getStateJSON, |
|
|
AirOutletProportionalValve_getStateJSON, |
|
|
|
|
|
AirInOutletProportionalValve_setStateJSON, |
|
|
} from '@/mock/command' |
|
|
} from '@/mock/command' |
|
|
import { ref, onMounted, watch, computed } from 'vue' |
|
|
import { ref, onMounted, watch, computed } from 'vue' |
|
|
|
|
|
|
|
|
const activeTab = ref('1') |
|
|
const activeTab = ref('1') |
|
|
const sealStore = useSealStore() |
|
|
const sealStore = useSealStore() |
|
|
const webSocketStore = useWebSocketStore() |
|
|
const webSocketStore = useWebSocketStore() |
|
|
|
|
|
const settingStore = useSettingStore() |
|
|
|
|
|
|
|
|
const changeTab = tab => { |
|
|
const changeTab = tab => { |
|
|
activeTab.value = tab |
|
|
activeTab.value = tab |
|
@ -126,18 +129,31 @@ const changeAir = tab => { |
|
|
// 取消选中: |
|
|
// 取消选中: |
|
|
// 两个阀设置成0 |
|
|
// 两个阀设置成0 |
|
|
if (tab == '0') { |
|
|
if (tab == '0') { |
|
|
webSocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([0])) |
|
|
|
|
|
webSocketStore.sendCommandMsg(AirOutletProportionalValve_setStateJSON([0])) |
|
|
|
|
|
|
|
|
webSocketStore.sendCommandMsg( |
|
|
|
|
|
AirInOutletProportionalValve_setStateJSON([0, 0]), |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
if (tab == '1') { |
|
|
if (tab == '1') { |
|
|
webSocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([100])) |
|
|
|
|
|
webSocketStore.sendCommandMsg(AirOutletProportionalValve_setStateJSON([0])) |
|
|
|
|
|
|
|
|
webSocketStore.sendCommandMsg( |
|
|
|
|
|
AirInOutletProportionalValve_setStateJSON([ |
|
|
|
|
|
settingStore.proportionalValveDefaultValue * 10, |
|
|
|
|
|
0, |
|
|
|
|
|
]), |
|
|
|
|
|
) |
|
|
|
|
|
selectedValuesTop.value = [ |
|
|
|
|
|
settingStore.proportionalValveDefaultValue * 10 + '', |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
if (tab == '2') { |
|
|
if (tab == '2') { |
|
|
webSocketStore.sendCommandMsg(AirInletProportionalValve_setStateJSON([0])) |
|
|
|
|
|
webSocketStore.sendCommandMsg( |
|
|
webSocketStore.sendCommandMsg( |
|
|
AirOutletProportionalValve_setStateJSON([100]), |
|
|
|
|
|
|
|
|
AirInOutletProportionalValve_setStateJSON([ |
|
|
|
|
|
0, |
|
|
|
|
|
settingStore.proportionalValveDefaultValue * 10, |
|
|
|
|
|
]), |
|
|
) |
|
|
) |
|
|
|
|
|
selectedValuesBottom.value = [ |
|
|
|
|
|
settingStore.proportionalValveDefaultValue * 10 + '', |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -158,8 +174,8 @@ const selectedValuesTop = ref(['100']) |
|
|
const selectedValuesBottom = ref(['100']) |
|
|
const selectedValuesBottom = ref(['100']) |
|
|
|
|
|
|
|
|
const tabChange = () => { |
|
|
const tabChange = () => { |
|
|
console.log('airin', sealStore.airInletProportionalInitVal) |
|
|
|
|
|
console.log('airout', sealStore.airOutletProportionalInitVal) |
|
|
|
|
|
|
|
|
console.log('airin', sealStore.airInletProportionalInitVal[0]) |
|
|
|
|
|
console.log('airout', sealStore.airOutletProportionalInitVal[0]) |
|
|
if ( |
|
|
if ( |
|
|
sealStore.airInletProportionalInitVal == 0 && |
|
|
sealStore.airInletProportionalInitVal == 0 && |
|
|
sealStore.airOutletProportionalInitVal == 0 |
|
|
sealStore.airOutletProportionalInitVal == 0 |
|
@ -169,10 +185,14 @@ const tabChange = () => { |
|
|
} |
|
|
} |
|
|
if (sealStore.airInletProportionalInitVal > 0) { |
|
|
if (sealStore.airInletProportionalInitVal > 0) { |
|
|
activeTab.value = '1' |
|
|
activeTab.value = '1' |
|
|
|
|
|
selectedValuesTop.value = [sealStore.airInletProportionalInitVal[0] + ''] |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (sealStore.airOutletProportionalInitVal > 0) { |
|
|
if (sealStore.airOutletProportionalInitVal > 0) { |
|
|
activeTab.value = '2' |
|
|
activeTab.value = '2' |
|
|
|
|
|
selectedValuesBottom.value = [ |
|
|
|
|
|
sealStore.airOutletProportionalInitVal[0] + '', |
|
|
|
|
|
] |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
activeTab.value = '0' |
|
|
activeTab.value = '0' |
|
@ -182,9 +202,11 @@ onMounted(() => { |
|
|
try { |
|
|
try { |
|
|
webSocketStore.sendCommandMsg(airInletProportionalValve_getStateJSON) |
|
|
webSocketStore.sendCommandMsg(airInletProportionalValve_getStateJSON) |
|
|
webSocketStore.sendCommandMsg(AirOutletProportionalValve_getStateJSON) |
|
|
webSocketStore.sendCommandMsg(AirOutletProportionalValve_getStateJSON) |
|
|
|
|
|
webSocketStore.sendCommandMsg(getAllSettingJSON) |
|
|
tabChange() |
|
|
tabChange() |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
|
|
|
webSocketStore.sendCommandMsg(getAllSettingJSON) |
|
|
webSocketStore.sendCommandMsg(airInletProportionalValve_getStateJSON) |
|
|
webSocketStore.sendCommandMsg(airInletProportionalValve_getStateJSON) |
|
|
webSocketStore.sendCommandMsg(AirOutletProportionalValve_getStateJSON) |
|
|
webSocketStore.sendCommandMsg(AirOutletProportionalValve_getStateJSON) |
|
|
}, 1000) |
|
|
}, 1000) |
|
|