From b164e6fdd2e7f011bd10a9d3694a5a1f60795a53 Mon Sep 17 00:00:00 2001 From: lucky Date: Tue, 15 Dec 2020 18:26:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A7=B0=E9=87=8D=E4=BC=A0=E6=84=9F?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rest/project.http | 18 ++++++- src/App.vue | 6 +-- src/components/LoadCells/LoadCells.vue | 69 +++++++++++++++++++------ src/mixins/socket.js | 22 ++++---- src/store/modules/messages/mutations.js | 1 + src/store/modules/messages/state.js | 8 +-- 6 files changed, 90 insertions(+), 34 deletions(-) diff --git a/rest/project.http b/rest/project.http index bae2841..1a820a5 100644 --- a/rest/project.http +++ b/rest/project.http @@ -1,6 +1,7 @@ # @tall = {{url}}/tall/v1.0 -@tall = http://www.sxwikionline.com/gateway/tall/v1.0 +@tall = http://test.tall.wiki/gateway/tall/v1.0 @greenvalley = http://www.sxwikionline.com/gateway/greenvalley +@record = https://test.tall.wiki/gateway/wisdomcar @type = content-type: application/json;charset=utf-8 ### login @@ -54,3 +55,18 @@ Authorization: Bearer {{login.response.body.$.data.token}} "teamName": "" } } + +### 根据团队id查看研发团队相关信息 + +POST {{record}}/debug/record +{{type}} +# Authorization: Bearer {{login.response.body.$.data.token}} + +{ + "param":{ + "carNumber": "001", + "type": "1", + "value":"70000", + "time":"1607937529000" + } +} diff --git a/src/App.vue b/src/App.vue index a3a66ce..aa264f0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,9 +19,9 @@ export default { computed: mapState('home', ['anyringToken']), created() { - const userId = '1338747522436435968'; - const params = { userId }; - this.getUserId(params); + // const userId = '1338747522436435968'; + // const params = { userId }; + // this.getUserId(params); }, methods: mapActions('home', ['getUserId']), diff --git a/src/components/LoadCells/LoadCells.vue b/src/components/LoadCells/LoadCells.vue index cc7a415..86c751d 100644 --- a/src/components/LoadCells/LoadCells.vue +++ b/src/components/LoadCells/LoadCells.vue @@ -8,63 +8,102 @@ >
{{ item.name }}
+
+ {{ item.number[a-1] ? item.number[a-1] : 0 }} +
+
+ diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 033a4d0..24274a0 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -55,7 +55,7 @@ const mixin = { */ handleMessagesData(item) { const data = JSON.parse(item.data); - console.log('data: ', data); + console.log('data: ', data.data); switch (data.type) { case 'ChannelStatus': // 认证消息 this.handleAuthMessage(data); @@ -63,34 +63,34 @@ const mixin = { case 1: // 体重 // 收到同步消息 // 把消息添加到store 的消息栈中 - this.messagesAddWeight(data); + this.messagesAddWeight(data.data); break; case 2: // RFID - this.messagesAddRfid(data); + this.messagesAddRfid(data.data); break; case 3: // 称重传感器一 - this.messagesAddWeighSensor1(data); + this.messagesAddWeighSensor1(data.data.value); break; case 4: // 称重传感器二 - this.messagesAddWeighSensor2(data); + this.messagesAddWeighSensor2(data.data.value); break; case 5: // 称重传感器三 - this.messagesAddWeighSensor3(data); + this.messagesAddWeighSensor3(data.data.value); break; case 6: // 称重传感器四 - this.messagesAddWeighSensor4(data); + this.messagesAddWeighSensor4(data.data.value); break; case 7: // 震动传感器 - this.messagesAddVibrationSensor(data); + this.messagesAddVibrationSensor(data.data); break; case 8: // 溶栓剂量(总量) - this.messagesAddThrombolyticDose(data); + this.messagesAddThrombolyticDose(data.data); break; case 9: // 团注剂量 - this.messagesAddBolusDose(data); + this.messagesAddBolusDose(data.data); break; case 10: // 维持剂量 - this.messagesAddMaintenanceDose(data); + this.messagesAddMaintenanceDose(data.data); break; default: break; diff --git a/src/store/modules/messages/mutations.js b/src/store/modules/messages/mutations.js index 2ba1ebe..dd90eb1 100644 --- a/src/store/modules/messages/mutations.js +++ b/src/store/modules/messages/mutations.js @@ -104,6 +104,7 @@ const mutations = { * @param {*} data */ messagesAddWeighSensor1(state, data) { + console.log('weighSensor1: ', data); state.weighSensor1 = data; }, diff --git a/src/store/modules/messages/state.js b/src/store/modules/messages/state.js index 3a86c92..f926073 100644 --- a/src/store/modules/messages/state.js +++ b/src/store/modules/messages/state.js @@ -2,10 +2,10 @@ const state = { syncMessages: [], // 同步消息 weightMessage: null, // 体重 rfidMessage: null, // RFID - weighSensor1: null, // 称重传感器一 - weighSensor2: null, // 称重传感器二 - weighSensor3: null, // 称重传感器三 - weighSensor4: null, // 称重传感器四 + weighSensor1: '', // 称重传感器一 + weighSensor2: '', // 称重传感器二 + weighSensor3: '', // 称重传感器三 + weighSensor4: '', // 称重传感器四 vibrationSensor: null, // 震动传感器 thrombolyticDose: null, // 溶栓剂量(总量) bolusDose: null, // 团注剂量 From 8bc6b3cde026f5bb90ef6a214cd926e0b4fc98e0 Mon Sep 17 00:00:00 2001 From: lucky Date: Tue, 15 Dec 2020 18:29:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=A7=B0=E9=87=8D=E4=BC=A0=E6=84=9F?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LoadCells/LoadCells.vue | 6 ++---- src/mixins/socket.js | 2 +- src/store/modules/messages/state.js | 10 +++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/components/LoadCells/LoadCells.vue b/src/components/LoadCells/LoadCells.vue index 86c751d..c394212 100644 --- a/src/components/LoadCells/LoadCells.vue +++ b/src/components/LoadCells/LoadCells.vue @@ -75,6 +75,8 @@ export default { }; }, + computed: mapState('home', ['weighSensor1', 'weighSensor2', 'weighSensor3', 'weighSensor4']), + watch: { weighSensor1(value) { console.log('value: ', value); @@ -100,10 +102,6 @@ export default { }, }, - computed: { - ...mapState('home', ['weighSensor1', 'weighSensor2', 'weighSensor3', 'weighSensor4']), - }, - methods: {}, }; diff --git a/src/mixins/socket.js b/src/mixins/socket.js index 24274a0..3d6401a 100644 --- a/src/mixins/socket.js +++ b/src/mixins/socket.js @@ -63,7 +63,7 @@ const mixin = { case 1: // 体重 // 收到同步消息 // 把消息添加到store 的消息栈中 - this.messagesAddWeight(data.data); + this.messagesAddWeight(data.data.value); break; case 2: // RFID this.messagesAddRfid(data.data); diff --git a/src/store/modules/messages/state.js b/src/store/modules/messages/state.js index f926073..545d00d 100644 --- a/src/store/modules/messages/state.js +++ b/src/store/modules/messages/state.js @@ -1,11 +1,11 @@ const state = { syncMessages: [], // 同步消息 - weightMessage: null, // 体重 + weightMessage: 0, // 体重 rfidMessage: null, // RFID - weighSensor1: '', // 称重传感器一 - weighSensor2: '', // 称重传感器二 - weighSensor3: '', // 称重传感器三 - weighSensor4: '', // 称重传感器四 + weighSensor1: 0, // 称重传感器一 + weighSensor2: 0, // 称重传感器二 + weighSensor3: 0, // 称重传感器三 + weighSensor4: 0, // 称重传感器四 vibrationSensor: null, // 震动传感器 thrombolyticDose: null, // 溶栓剂量(总量) bolusDose: null, // 团注剂量