Browse Source

Merge branch 'master' of dd.tall.wiki:binbin0314/salt-lake-hospital

master
lucky 5 years ago
parent
commit
e60c98d5de
  1. 67
      src/components/Panel/Panel.vue
  2. 21
      src/components/Sensor/Sensor.js
  3. 13
      src/components/Sensor/Sensor.vue
  4. 12
      src/mixins/socket.js
  5. 4
      src/views/BtnPage/BtnPage.vue
  6. 7
      src/views/Index/Index.vue

67
src/components/Panel/Panel.vue

@ -24,24 +24,13 @@
<div style="width: 95%; padding-left: 5%">
<div style="width: 120%">
<span :style="{ marginLeft: percentA }" class="tips">
123
{{ info }}
<a-icon class="down-icon" type="caret-down" />
</span>
</div>
<a-progress
:percent="percent"
:show-info="false"
:stroke-color="strokeColor"
:stroke-width="strokeWidth"
status="active"
/>
<a-progress :percent="percent" :show-info="false" :stroke-color="strokeColor" :stroke-width="strokeWidth" status="active" />
<div class="flex-1" style="width: 106%; margin-left: -3%">
<div
:key="index"
class="flex-1"
style="justify-content: center"
v-for="(item, index) in lists"
>{{ item }}</div>
<div class="flex-1" style="justify-content: center" v-for="(item, index) in lists" :key="index">{{ item }}</div>
</div>
</div>
</div>
@ -49,7 +38,7 @@
</template>
<script>
import { mapState } from 'vuex';
import { mapState, mapMutations } from 'vuex';
export default {
name: 'Panel',
data() {
@ -82,21 +71,49 @@ export default {
'解脱',
'结束',
],
info: '呼叫',
};
},
computed: mapState('messages', ['weightMessage', 'bolusDose', 'maintenanceDose', 'thrombolyticDose']),
mounted() {
const that = this;
var add = setInterval(function() {
if (that.percent === 100) {
that.percent = 0;
that.percentA = 0;
computed: mapState('messages', ['weightMessage', 'bolusDose', 'maintenanceDose', 'thrombolyticDose', 'startMessages', 'rfidMessage']),
watch: {
rfidMessage(val) {
console.log(val);
if (this.startMessages) {
this.percent = 0;
this.percentA = 0;
this.info = '呼叫';
this.setStartMessages(false);
} else {
that.percent += 100 / 16;
that.percentA = (that.percent * 100) / 120 + '%';
if (val.step && val.step - 0 > (this.percent * 16) / 100 && val.step - 0 <= 16) {
console.log(val.step - 0, this.percent);
this.percent = ((val.step - 0) * 100) / 16;
this.percentA = (this.percent * 100) / 120 + '%';
this.info = this.lists[val.step - 0];
}
}
}, 1000);
},
startMessages(val) {
if (val) {
this.percent = 0;
this.percentA = 0;
this.info = '呼叫';
this.setStartMessages(false);
}
},
},
methods: { ...mapMutations('messages', ['setStartMessages']) },
// mounted() {
// const that = this;
// var add = setInterval(function() {
// if (that.percent === 100) {
// that.percent = 0;
// that.percentA = 0;
// } else {
// that.percent += 100 / 16;
// that.percentA = (that.percent * 100) / 120 + '%';
// }
// }, 1000);
// },
};
</script>

21
src/components/Sensor/Sensor.js

@ -2,16 +2,14 @@ import { mapState } from 'vuex';
const mixin = {
data() {
return {
series1: [10, 20, 30, 10, 20, 30, 10, 20, 30], // 传感器1
series2: [20, 30, 10, 20, 30, 10, 20, 30, 10], // 传感器2
series3: [30, 10, 20, 30, 10, 20, 30, 10, 20], // 传感器3
series1: [10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30], // 传感器1
series2: [20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10], // 传感器2
series3: [30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20], // 传感器3
};
},
computed: {
...mapState('messages', ['vibrationSensor']),
option() {
// const that = this;
console.log('series1', this.series1, this.vibrationSensor);
return {
legend: {
x: 'center',
@ -25,6 +23,8 @@ const mixin = {
xAxis: {
type: 'category',
boundaryGap: false,
max: this.series1.length >= 6 ? this.series1.length - 1 : 6,
min: this.series1.length >= 6 ? this.series1.length - 6 : 0,
axisLine: {
//y轴
show: false,
@ -51,7 +51,6 @@ const mixin = {
show: false,
},
},
series: [
{
name: '传感器1',
@ -154,15 +153,7 @@ const mixin = {
};
},
},
watch: {
vibrationSensor(val) {
var vibList = val.split(',');
this.series1 = this.series1.concat(parseInt(vibList[0]));
this.series2 = this.series1.concat(parseInt(vibList[1]));
this.series3 = this.series1.concat(parseInt(vibList[2]));
console.log('vibrationSensor:', val);
},
},
watch: {},
};
export default mixin;

13
src/components/Sensor/Sensor.vue

@ -16,6 +16,19 @@ export default {
height: '',
};
},
watch: {
vibrationSensor(val) {
console.log(val.value);
if (val.type === 7) {
var vibList = val.value.split(',');
this.series1 = this.series1.concat(parseInt(vibList[0]));
this.series2 = this.series2.concat(parseInt(vibList[1]));
this.series3 = this.series3.concat(parseInt(vibList[2]));
this.drawLine();
}
console.log(this.series1, this.series2, this.series3);
},
},
mounted() {
this.drawLine();
let wh = window.innerWidth;

12
src/mixins/socket.js

@ -45,6 +45,7 @@ const mixin = {
socket.onclose = this.websocketClose;
socket.onerror = this.websocketError;
} else {
// @ts-ignore
this.$message.error('当前浏览器不支持 websocket');
}
lockSocket = false;
@ -70,6 +71,7 @@ const mixin = {
case 1: // 体重
// 收到同步消息
// 把消息添加到store 的消息栈中
this.setStartMessages(true);
this.messagesAddWeight(data.data.value);
break;
case 2: // RFID
@ -109,7 +111,15 @@ const mixin = {
break;
}
},
/**
*
* data:{
* data: {
* value: ''
* },
* type: '',
* }
*/
/**
* 收到ws 消息
* @param {object} res 收到的消息数据

4
src/views/BtnPage/BtnPage.vue

@ -1,6 +1,6 @@
<template>
<div class="wrap">
<a-button type="primary" @click="sendData(20)">开始</a-button>
<a-button type="primary" @click="sendData(20)">呼叫</a-button>
<a-button type="primary" v-for="(item, index) in nameList" :key="index" @click="sendData(index)"> {{ item.name }} </a-button>
<a-button type="primary" @click="sendData(21)">震动传感器</a-button>
<a-button type="primary" @click="sendData(25)">药物剂量</a-button>
@ -107,7 +107,7 @@ export default {
param: {
authId: '1',
type: '7',
value: '10,20,10',
value: '10,20,30',
time: new Date().getTime(),
},
};

7
src/views/Index/Index.vue

@ -50,11 +50,8 @@
</div>
</div>
</div>
<div class="flex-2 ma-2" style="position:relative">
<iframe
class="fill-width fill-height"
src="https://www.thingjs.com/pp/6dab0a018283ef357a85684c"
></iframe>
<div class="flex-2 ma-2" style="position: relative">
<iframe class="fill-width fill-height" src="https://www.thingjs.com/pp/6dab0a018283ef357a85684c"></iframe>
<!-- 地图 -->
<shanxi-map class="sxmap" />
<!-- 视频 -->

Loading…
Cancel
Save