Browse Source

称重传感器

master
lucky 5 years ago
parent
commit
8bc6b3cde0
  1. 6
      src/components/LoadCells/LoadCells.vue
  2. 2
      src/mixins/socket.js
  3. 10
      src/store/modules/messages/state.js

6
src/components/LoadCells/LoadCells.vue

@ -75,6 +75,8 @@ export default {
}; };
}, },
computed: mapState('home', ['weighSensor1', 'weighSensor2', 'weighSensor3', 'weighSensor4']),
watch: { watch: {
weighSensor1(value) { weighSensor1(value) {
console.log('value: ', value); console.log('value: ', value);
@ -100,10 +102,6 @@ export default {
}, },
}, },
computed: {
...mapState('home', ['weighSensor1', 'weighSensor2', 'weighSensor3', 'weighSensor4']),
},
methods: {}, methods: {},
}; };
</script> </script>

2
src/mixins/socket.js

@ -63,7 +63,7 @@ const mixin = {
case 1: // 体重 case 1: // 体重
// 收到同步消息 // 收到同步消息
// 把消息添加到store 的消息栈中 // 把消息添加到store 的消息栈中
this.messagesAddWeight(data.data); this.messagesAddWeight(data.data.value);
break; break;
case 2: // RFID case 2: // RFID
this.messagesAddRfid(data.data); this.messagesAddRfid(data.data);

10
src/store/modules/messages/state.js

@ -1,11 +1,11 @@
const state = { const state = {
syncMessages: [], // 同步消息 syncMessages: [], // 同步消息
weightMessage: null, // 体重 weightMessage: 0, // 体重
rfidMessage: null, // RFID rfidMessage: null, // RFID
weighSensor1: '', // 称重传感器一 weighSensor1: 0, // 称重传感器一
weighSensor2: '', // 称重传感器二 weighSensor2: 0, // 称重传感器二
weighSensor3: '', // 称重传感器三 weighSensor3: 0, // 称重传感器三
weighSensor4: '', // 称重传感器四 weighSensor4: 0, // 称重传感器四
vibrationSensor: null, // 震动传感器 vibrationSensor: null, // 震动传感器
thrombolyticDose: null, // 溶栓剂量(总量) thrombolyticDose: null, // 溶栓剂量(总量)
bolusDose: null, // 团注剂量 bolusDose: null, // 团注剂量

Loading…
Cancel
Save