Browse Source

RFID

master
lucky 5 years ago
parent
commit
2b0ee6a0d8
  1. 4
      src/common/index.styl
  2. 41
      src/components/Duration/Duration.js
  3. 88
      src/components/Map/Map.vue
  4. 35
      src/components/Panel/Panel.vue
  5. 256
      src/components/Sensor/Sensor.js
  6. 5
      src/components/Sensor/Sensor.vue
  7. 2
      src/components/Statistics/Statistics.js
  8. 3
      src/config/api.js
  9. 5
      src/mixins/socket.js
  10. 12
      src/router/index.js
  11. 8
      src/store/modules/messages/mutations.js
  12. 7
      src/store/modules/messages/state.js
  13. 169
      src/views/BtnPage/BtnPage.vue

4
src/common/index.styl

@ -27,8 +27,8 @@
.wrap .bg-top .animation{ .wrap .bg-top .animation{
position: absolute; position: absolute;
top: -1px; top: -1px;
left: 21.5%; left: 14%;
width: 57%; width: 72%;
height: 162px; height: 162px;
} }

41
src/components/Duration/Duration.js

@ -31,12 +31,33 @@ const mixin = {
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], data: [
'呼叫',
'到场',
'评估',
'采血',
'CT',
'谈话',
'签字',
'注射',
'介入',
'手术',
'穿刺',
'DSA',
'溶栓',
'再通',
'支架',
'解脱',
'结束',
],
axisLabel: { axisLabel: {
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
color: '#ccc', //标题颜色 color: '#ccc', //标题颜色
}, },
formatter: function(value) {
return value.split('').join('\n');
},
}, },
}, },
yAxis: { yAxis: {
@ -61,27 +82,45 @@ const mixin = {
{ {
name: '我院记录', name: '我院记录',
type: 'line', type: 'line',
connectNulls: true,
stack: '总量', stack: '总量',
symbolSize: 6, symbolSize: 6,
// symbol: 'star', // symbol: 'star',
data: this.pointTimeHospital, data: this.pointTimeHospital,
color: 'rgb(18, 131, 227)', color: 'rgb(18, 131, 227)',
// lineStyle: {
// shadowColor: '#5cfbff',
// shadowBlur: 8,
// width: 4,
// },
}, },
{ {
name: '国际水准', name: '国际水准',
type: 'line', type: 'line',
connectNulls: true,
stack: '总量', stack: '总量',
symbolSize: 6, symbolSize: 6,
data: this.pointTimeInternation, data: this.pointTimeInternation,
color: 'rgb(30, 231, 231)', color: 'rgb(30, 231, 231)',
// lineStyle: {
// shadowColor: '#5cfbff',
// shadowBlur: 8,
// width: 4,
// },
}, },
{ {
name: '当前数据', name: '当前数据',
type: 'line', type: 'line',
connectNulls: true,
stack: '总量', stack: '总量',
symbolSize: 6, symbolSize: 6,
data: this.pointTimeCurrentList, data: this.pointTimeCurrentList,
color: 'rgb(227, 18, 187)', color: 'rgb(227, 18, 187)',
// lineStyle: {
// shadowColor: '#5cfbff',
// shadowBlur: 8,
// width: 4,
// },
}, },
], ],
}; };

88
src/components/Map/Map.vue

@ -1,6 +1,6 @@
<template> <template>
<div :style="{ width: 'width', height: 'height' }" class="chart-box"> <div :style="{ width: 'width', height: 'height' }" class="chart-box">
<div id="myEchart" ref="myEchart" style="width: 100%;height:100%;"></div> <div id="myEchart" ref="myEchart" style="width: 100%; height: 100%"></div>
</div> </div>
</template> </template>
@ -49,88 +49,4 @@ export default {
}; };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped></style>
/* 懒加载图标动画 */
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
/* 弹窗样式 */
.layer {
position: absolute;
left: 400px;
top: 300px;
z-index: 100;
width: 360px;
height: 280px;
background: rgba(10, 22, 64, 0.9);
border-radius: 5px;
border: 1px solid #122253;
transform: translate(-100%, -100%);
.content {
width: 100%;
height: 100%;
position: relative;
text-align: center;
p {
font-size: 20px;
color: #fff;
line-height: 50px;
}
.col-item {
height: 41px;
margin-top: 20px;
border-right: 1px solid #172353;
.num {
color: #ebf8ff;
font-size: 18px;
}
.text {
color: #507ebc;
font-size: 12px;
}
}
}
.content::after {
content: '';
width: 120px;
height: 2px;
background: #FFCCFF;
position: absolute;
right: -120px;
top: 50%;
transform: translateY(-50%);
}
.content::before {
content: '';
width: 2px;
height: 80px;
background: #FFB800;
position: absolute;
right: -134px;
top: 136px;
transform: rotateZ(-20deg);
}
}
</style>

35
src/components/Panel/Panel.vue

@ -4,21 +4,21 @@
<div class="d-flex panel-box-1"> <div class="d-flex panel-box-1">
<div class="flex-1"> <div class="flex-1">
<span class="panel-tips">患者体重kg</span> <span class="panel-tips">患者体重kg</span>
<span class="panel-con">60.00</span> <span class="panel-con">{{ weightMessage }}</span>
</div> </div>
<div class="flex-1"> <div class="flex-1">
<span class="panel-tips">药物剂量mg</span> <span class="panel-tips">药物剂量mg</span>
<span class="panel-con">55.00</span> <span class="panel-con">{{ thrombolyticDose }}</span>
</div> </div>
</div> </div>
<div class="d-flex panel-box-1"> <div class="d-flex panel-box-1">
<div class="flex-1"> <div class="flex-1">
<span class="panel-tips">团注剂量mg</span> <span class="panel-tips">团注剂量mg</span>
<span class="panel-con">5.40</span> <span class="panel-con">{{ bolusDose }}</span>
</div> </div>
<div class="flex-1"> <div class="flex-1">
<span class="panel-tips">维持剂量mg</span> <span class="panel-tips">维持剂量mg</span>
<span class="panel-con">48.60</span> <span class="panel-con">{{ maintenanceDose }}</span>
</div> </div>
</div> </div>
<div style="width: 95%; padding-left: 5%"> <div style="width: 95%; padding-left: 5%">
@ -29,13 +29,16 @@
</span> </span>
</div> </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>123</div> <div class="flex-1" style="width: 106%; margin-left: -3%">
<div class="flex-1" style="justify-content: center" v-for="(item, index) in lists" :key="index">{{ item }}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex';
export default { export default {
name: 'Panel', name: 'Panel',
data() { data() {
@ -49,8 +52,28 @@ export default {
from: '#1362B8', from: '#1362B8',
to: '#06D0CA', to: '#06D0CA',
}, },
lists: [
'呼叫',
'到场',
'评估',
'采血',
'CT',
'谈话',
'签字',
'注射',
'介入',
'手术',
'穿刺',
'DSA',
'溶栓',
'再通',
'支架',
'解脱',
'结束',
],
}; };
}, },
computed: mapState('messages', ['weightMessage', 'bolusDose', 'maintenanceDose', 'thrombolyticDose']),
mounted() { mounted() {
const that = this; const that = this;
var add = setInterval(function() { var add = setInterval(function() {
@ -58,7 +81,7 @@ export default {
that.percent = 0; that.percent = 0;
that.percentA = 0; that.percentA = 0;
} else { } else {
that.percent++; that.percent += 100 / 16;
that.percentA = (that.percent * 100) / 120 + '%'; that.percentA = (that.percent * 100) / 120 + '%';
} }
}, 1000); }, 1000);

256
src/components/Sensor/Sensor.js

@ -1,107 +1,165 @@
var option = { import { mapState } from 'vuex';
legend: { const mixin = {
x: 'center', data() {
y: 'top', return {
data: ['传感器1', '传感器2'], series1: [10, 20, 30, 10, 20, 30, 10, 20, 30], // 传感器1
textStyle: { series2: [20, 30, 10, 20, 30, 10, 20, 30, 10], // 传感器2
fontWeight: 'normal', series3: [30, 10, 20, 30, 10, 20, 30, 10, 20], // 传感器3
color: '#ccc', //标题颜色 };
},
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLine: {
//y轴
show: false,
},
},
yAxis: {
show: true,
type: 'value',
splitLine: { show: false }, //去除网格线
nameTextStyle: {
color: '#abb8ce',
show: false,
},
axisLabel: {
color: '#abb8ce',
show: false,
},
axisTick: {
//y轴刻度线
show: false,
},
axisLine: {
//y轴
show: false,
},
}, },
series: [ computed: {
{ ...mapState('messages', ['vibrationSensor']),
name: '传感器1', option() {
data: [320, 932, 401, 834, 290, 530, 620], return {
type: 'line', legend: {
smooth: true, x: 'center',
symbol: 'none', y: '8%',
itemStyle: { data: ['传感器1', '传感器2', '传感器3'],
color: { textStyle: {
type: 'linear', fontWeight: 'normal',
x: 0, color: '#ccc', //标题颜色
y: 0, },
x2: 0, },
y2: 1, xAxis: {
colorStops: [ type: 'category',
{ boundaryGap: false,
offset: 0, axisLine: {
color: 'rgba(10,73,130,1)', // 0% 处的颜色 //y轴
show: false,
},
},
yAxis: {
show: true,
type: 'value',
splitLine: { show: false }, //去除网格线
nameTextStyle: {
color: '#abb8ce',
show: false,
},
axisLabel: {
color: '#abb8ce',
show: false,
},
axisTick: {
//y轴刻度线
show: false,
},
axisLine: {
//y轴
show: false,
},
},
series: [
{
name: '传感器1',
data: this.series1,
type: 'line',
smooth: true,
symbol: 'none',
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(10,73,130,1)', // 0% 处的颜色
},
{
offset: 1,
color: 'rgba(10,73,130,0)', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
}, },
{ areaStyle: {},
offset: 1, lineStyle: { normal: { color: 'rgb(39,149,243)', width: 2 } },
color: 'rgba(10,73,130,0)', // 100% 处的颜色 },
{
name: '传感器2',
data: this.series2,
type: 'line',
smooth: true,
symbol: 'none',
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(91,225,251,1)', // 0% 处的颜色
},
{
offset: 1,
color: 'rgba(91,225,251,0)', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
}, },
], areaStyle: {},
global: false, // 缺省为 false lineStyle: {
}, normal: {
}, color: 'rgb(91,225,251)',
areaStyle: {}, width: 2,
lineStyle: { normal: { color: 'rgb(39,149,243)', width: 2 } }, },
},
{
name: '传感器2',
data: [420, 232, 401, 234, 490, 230, 420],
type: 'line',
smooth: true,
symbol: 'none',
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(91,225,251,1)', // 0% 处的颜色
}, },
{ },
offset: 1, {
color: 'rgba(91,225,251,0)', // 100% 处的颜色 name: '传感器3',
data: this.series3,
type: 'line',
smooth: true,
symbol: 'none',
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(241,158,194,1)', // 0% 处的颜色
},
{
offset: 1,
color: 'rgba(241,158,194,0)', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
}, },
], areaStyle: {},
global: false, // 缺省为 false lineStyle: {
}, normal: {
}, color: 'rgb(241,158,194)',
areaStyle: {}, width: 2,
lineStyle: { },
normal: { },
color: 'rgb(91,225,251)', },
width: 2, ],
}, };
}, },
},
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);
}, },
], },
}; };
export default option; export default mixin;

5
src/components/Sensor/Sensor.vue

@ -5,10 +5,11 @@
</div> </div>
</template> </template>
<script> <script>
import option from './Sensor.js'; import mixin from './Sensor.js';
// import option from './Sensor3D.js'; // import option from './Sensor3D.js';
export default { export default {
name: 'Sensor', name: 'Sensor',
mixins: [mixin],
data() { data() {
return { return {
width: '', width: '',
@ -36,7 +37,7 @@ export default {
// domecharts // domecharts
let myChart = this.$echarts.init(document.getElementById('Sensor')); let myChart = this.$echarts.init(document.getElementById('Sensor'));
// //
myChart.setOption(option); myChart.setOption(this.option);
}, },
}, },
}; };

2
src/components/Statistics/Statistics.js

@ -17,7 +17,7 @@ const mixin = {
legend: [ legend: [
{ {
x: 'center', x: 'center',
y: 'top', y: '8%',
data: ['本年', '去年'], data: ['本年', '去年'],
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',

3
src/config/api.js

@ -12,6 +12,9 @@ const statistics = `${wisdomcar}/statistics`; // 盐湖医院相关接口
// websocket基础地址 // websocket基础地址
export const WS_BASE_URL = msgUrl; export const WS_BASE_URL = msgUrl;
// 按钮模拟信息发送
export const record = params => axios.post(`${wisdomcar}/debug/record`, params);
// 急救数量统计图数据 // 急救数量统计图数据
export const selResult = params => axios.post(`${statistics}/get/selResult`, params); export const selResult = params => axios.post(`${statistics}/get/selResult`, params);
// 急救市场分析统计图数据 // 急救市场分析统计图数据

5
src/mixins/socket.js

@ -19,6 +19,7 @@ const mixin = {
...mapMutations('messages', [ ...mapMutations('messages', [
'messagesAdd', 'messagesAdd',
'messagesAddWeight', 'messagesAddWeight',
'setStartMessages',
'messagesAddRfid', 'messagesAddRfid',
'messagesAddWeighSensor1', 'messagesAddWeighSensor1',
'messagesAddWeighSensor2', 'messagesAddWeighSensor2',
@ -60,6 +61,10 @@ const mixin = {
case 'ChannelStatus': // 认证消息 case 'ChannelStatus': // 认证消息
this.handleAuthMessage(data); this.handleAuthMessage(data);
break; break;
case 0: // 开始
// 收到开始消息
this.setStartMessages(true);
break;
case 1: // 体重 case 1: // 体重
// 收到同步消息 // 收到同步消息
// 把消息添加到store 的消息栈中 // 把消息添加到store 的消息栈中

12
src/router/index.js

@ -11,12 +11,12 @@ const routes = [
name: 'Home', name: 'Home',
component: Home, component: Home,
}, },
// 白框框显示内容界面 // 模拟按钮界面
// { {
// path: '/Index', path: '/BtnPage',
// name: 'Index', name: 'BtnPage',
// component: () => import(/* webpackChunkName: "Index" */ 'views/Index/Index.vue'), component: () => import(/* webpackChunkName: "Index" */ 'views/BtnPage/BtnPage.vue'),
// }, },
]; ];
const router = new VueRouter({ const router = new VueRouter({

8
src/store/modules/messages/mutations.js

@ -171,5 +171,13 @@ const mutations = {
messagesAddMaintenanceDose(state, data) { messagesAddMaintenanceDose(state, data) {
state.maintenanceDose = data; state.maintenanceDose = data;
}, },
/**
* 重新开始
* @param {*} state
* @param {*} data
*/
setStartMessages(state, data) {
state.startMessages = data;
},
}; };
export default mutations; export default mutations;

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

@ -1,4 +1,5 @@
const state = { const state = {
startMessages: false, // 是否重新开始 true为开始
syncMessages: [], // 同步消息 syncMessages: [], // 同步消息
weightMessage: 0, // 体重 weightMessage: 0, // 体重
rfidMessage: null, // RFID rfidMessage: null, // RFID
@ -7,9 +8,9 @@ const state = {
weighSensor3: 0, // 称重传感器三 weighSensor3: 0, // 称重传感器三
weighSensor4: 0, // 称重传感器四 weighSensor4: 0, // 称重传感器四
vibrationSensor: null, // 震动传感器 vibrationSensor: null, // 震动传感器
thrombolyticDose: null, // 溶栓剂量(总量) thrombolyticDose: 0, // 溶栓剂量(总量)
bolusDose: null, // 团注剂量 bolusDose: 0, // 团注剂量
maintenanceDose: null, // 维持剂量 maintenanceDose: 0, // 维持剂量
}; };
export default state; export default state;

169
src/views/BtnPage/BtnPage.vue

@ -0,0 +1,169 @@
<template>
<div class="wrap">
<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>
<a-button type="primary" @click="sendData(26)">团注剂量</a-button>
<a-button type="primary" @click="sendData(27)">维持剂量</a-button>
</div>
</template>
<script>
import { record } from 'config/api';
export default {
name: 'BtnPage',
data() {
return {
str: '模拟按钮界面',
nameList: [
{
name: '分诊区',
value: '01',
},
{
name: '急救医生',
value: '0B',
},
{
name: '采血车',
value: '0C',
},
{
name: 'CT室',
value: '03',
},
{
name: '介入室',
value: '05',
},
{
name: '平车停放点',
value: '20',
},
{
name: '卒中中心门口',
value: '21',
},
{
name: '急救大楼门',
value: '22',
},
{
name: '抢救室门',
value: '23',
},
{
name: '走廊',
value: '24',
},
{
name: '心电图室门口',
value: '25',
},
{
name: '专用电梯口(一楼)',
value: '26',
},
{
name: '专用电梯口(四楼)',
value: '27',
},
{
name: 'CCU导管室门口',
value: '28',
},
{
name: '急救护士',
value: '30',
},
{
name: '专科医生',
value: '31',
},
{
name: '专科护士',
value: '32',
},
],
};
},
methods: {
async sendData(index) {
try {
let params = {};
console.log(index);
if (index === 20) {
params = {
param: {
authId: '1',
type: '1',
value: '80000',
time: new Date().getTime(),
},
};
} else if (index === 21) {
params = {
param: {
authId: '1',
type: '7',
value: '10,20,10',
time: new Date().getTime(),
},
};
} else if (index === 25) {
params = {
param: {
authId: '1',
type: '8',
value: '50.2',
time: new Date().getTime(),
},
};
} else if (index === 26) {
params = {
param: {
authId: '1',
type: '9',
value: '6.4',
time: new Date().getTime(),
},
};
} else if (index === 27) {
params = {
param: {
authId: '1',
type: '10',
value: '60.1',
time: new Date().getTime(),
},
};
} else if (index < 20) {
params = {
param: {
authId: '1',
type: '2',
value: this.nameList[index].value,
time: new Date().getTime(),
},
};
}
const res = await record(params);
const { msg, data, code } = res.data;
console.log('data:' + data);
} catch (error) {
console.log(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.wrap {
button {
margin: 10px;
flex: 0 0 8%;
}
}
</style>
Loading…
Cancel
Save