Browse Source

称重传感器

master
lucky 5 years ago
parent
commit
0fd4524c6e
  1. 4
      .env.development
  2. 4
      .env.production
  3. 2
      README.md
  4. 2
      package-lock.json
  5. 2
      package.json
  6. BIN
      src/assets/cz-bg.png
  7. BIN
      src/assets/cz-bg1.png
  8. BIN
      src/assets/rfid-bg-active.png
  9. BIN
      src/assets/rfid-bg.png
  10. 21
      src/common/index.styl
  11. 19
      src/common/portrait.styl
  12. 121
      src/components/LoadCells/LoadCells.vue
  13. 98
      src/components/RFID/RFID++.vue
  14. 108
      src/components/RFID/RFID.js
  15. 232
      src/components/RFID/RFID.vue
  16. 53
      src/views/Index/Index.vue

4
.env.development

@ -6,5 +6,5 @@ VUE_APP_API_URL=http://www.sxwikionline.com/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/greenvalley VUE_APP_PUBLIC_PATH=/greenvalley
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws
VUE_APP_TITLE=绿谷在线 VUE_APP_TITLE=盐湖区人民医院数字看板
VUE_APP_DESCRIPTION=绿谷在线管理后台 VUE_APP_DESCRIPTION=盐湖区人民医院数字看板

4
.env.production

@ -6,5 +6,5 @@ VUE_APP_API_URL=http://www.sxwikionline.com/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/greenvalley VUE_APP_PUBLIC_PATH=/greenvalley
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws
VUE_APP_TITLE=绿谷在线 VUE_APP_TITLE=盐湖区人民医院数字看板
VUE_APP_DESCRIPTION=绿谷在线管理后台 VUE_APP_DESCRIPTION=盐湖区人民医院数字看板

2
README.md

@ -1,4 +1,4 @@
# green-valley # 盐湖区人民医院数字看板
## Project setup ## Project setup
``` ```

2
package-lock.json

@ -1,5 +1,5 @@
{ {
"name": "green-valley", "name": "盐湖区人民医院数字看板",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,

2
package.json

@ -1,5 +1,5 @@
{ {
"name": "green-valley", "name": "salt-lake-hospital",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {

BIN
src/assets/cz-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/cz-bg1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/rfid-bg-active.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/assets/rfid-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

21
src/common/index.styl

@ -97,9 +97,30 @@
width:100%; width:100%;
height: 10px; height: 10px;
background: url('assets/box-top.png') repeat fixed center; background: url('assets/box-top.png') repeat fixed center;
text-align: center;
}
.box-top span{
display: inline-block;
position: relative;
top: -11px;
text-shadow: rgb(0, 117, 255) 0px 0px 8px;
font-family: SourceHanSansCN-Bold;
font-size: 20px;
font-weight: bold;
text-align: center;
letter-spacing: 0px;
} }
.box-bottom{ .box-bottom{
width:100%; width:100%;
background: url('assets/box-bottom.png') repeat fixed top; background: url('assets/box-bottom.png') repeat fixed top;
} }
.s-pic{
width:200px;
height: 100px;
position: relative;
top: 10px;
left: 10px
}

19
src/common/portrait.styl

@ -3,6 +3,21 @@
padding: 12px; padding: 12px;
} }
.px-2{
padding-left: 8px;
padding-right: 8px;
}
.px-3{
padding-left: 12px;
padding-right: 12px;
}
.px-10{
padding-left: 30px;
padding-right: 30px;
}
.pb-3 { .pb-3 {
padding-bottom: 12px; padding-bottom: 12px;
} }
@ -174,6 +189,10 @@
justify-content: space-between; justify-content: space-between;
} }
.align-center{
align-items: center;
}
.flex-1{ .flex-1{
display: flex; display: flex;
flex: 1; flex: 1;

121
src/components/LoadCells/LoadCells.vue

@ -0,0 +1,121 @@
<template>
<!-- <div>数据统计组件</div> -->
<div class="flex-1 flex-column">
<div
:key="item.id"
class="flex-1 flex-nowrap mt-2 align-center justify-space-between box"
v-for="item in lists"
>
<div class="title">{{ item.name }}</div>
<div class="number flex-1">
<div class="num_item">
<span>1</span>
</div>
<div class="num_item">
<span>5</span>
</div>
<div class="num_item" style="padding-right:5%">
<span>.</span>
</div>
<div class="num_item">
<span>1</span>
</div>
<div class="num_item">
<span>5</span>
</div>
<div class="num_item">
<span>8</span>
</div>
<div class="num_item">
<span>6</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'LoadCells',
data() {
return {
width: '',
height: '',
lists: [
{
id: 1,
name: '称重传感器1',
number: '15.2346',
},
{
id: 2,
name: '称重传感器2',
number: '15.3456',
},
{
id: 3,
name: '称重传感器3',
number: '14.8946',
},
{
id: 4,
name: '称重传感器4',
number: '15.0167',
},
],
};
},
methods: {},
};
</script>
<style lang="stylus" scoped >
.box {
width: 88%;
left: 6%;
position: relative;
}
.title {
font-size: 17px;
color: #C8CED5;
letter-spacing: 2px;
}
.number {
height: 80%;
position: absolute;
right: 0;
bottom: 0;
}
.number .num_item {
background: url('~assets/cz-bg.png') no-repeat bottom left;
background-size: auto 90%;
}
.number span {
display: inline-block;
position: relative;
top: -10px;
left: 2px;
font-size: 38px;
font-style: oblique;
font-weight: 400;
letter-spacing: 18px;
height: 100%;
}
@media (max-width: 1500px) {
.title {
font-size: 12px;
letter-spacing: 0;
}
.number span {
top: -10px;
font-size: 23px;
letter-spacing: 16px;
}
}
</style>

98
src/components/RFID/RFID++.vue

@ -0,0 +1,98 @@
<template>
<div class="flex-1 flex-column rfid" id="rfid">
<!-- <div class="box" id="box">
<span>专科护士</span>
</div>
<div class="box active">
<span>专科护士</span>
</div>-->
<div :key="index" class="list" v-for="(list,index) in lists">
<span>{{ list.name }}</span>
</div>
</div>
</template>
<script>
export default {
name: 'RFID',
data() {
return {
lists: [
{ top: '10px', left: '10px', name: '专科护士' },
{ top: '50px', left: '50px', name: '专科医生' },
{ top: '70px', left: '70px', name: '采血推车' },
{ top: '90px', left: '90px', name: '心电图推车' },
{ top: '100px', left: '100px', name: '介入室' },
{ top: '80px', left: '80px', name: 'CT室' },
{ top: '60px', left: '60px', name: '急救室' },
{ top: '40px', left: '40px', name: '急诊医生' },
],
};
},
mounted() {
console.log('开始');
//
let wrap = document.getElementById('rfid');
// let box = document.getElementById('box');
let box = document.getElementsByClassName('list');
console.log('box: ', box);
//
//
let a = 1;
let b = 1;
//
let w = wrap.offsetWidth - box.offsetWidth;
let h = wrap.offsetHeight - box.offsetHeight;
setInterval(function() {
// left
let l = box.offsetLeft;
if (l == w || l == 0) {
// a
a *= -1;
}
// 10ms1px
// a
box.style.left = l + a + 'px';
console.log('box.style.left: ', box.style.left);
//
let t = box.offsetTop;
if (t == h || t == 0) {
b *= -1;
}
box.style.top = t + b + 'px';
}, 100);
},
methods: {},
};
</script>
<style lang="stylus" scoped >
.rfid {
position: relative;
}
.list {
width: 69px;
height: 69px;
line-height: 69px;
text-align: center;
font-size: 12px;
color: #C8CED5;
background: url('~assets/rfid-bg.png') no-repeat center;
position: absolute;
top: 100px;
left: 200px;
}
.active {
width: 86px;
height: 86px;
line-height: 86px;
font-size: 12px;
background: url('~assets/rfid-bg-active.png') no-repeat center;
}
</style>

108
src/components/RFID/RFID.js

@ -0,0 +1,108 @@
var option = {
title: {
left: '10%',
textStyle: {
fontWeight: 'normal',
color: '#fff', //标题颜色
},
text: '震动传感器',
},
legend: {
x: 'center',
y: 'top',
data: ['传感器1', '传感器2'],
textStyle: {
fontWeight: 'normal',
color: '#fff', //标题颜色
},
},
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: [
{
name: '传感器1',
data: [120, 932, 401, 534, 290, 530, 320],
type: 'line',
smooth: true,
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: '#0A4982', // 0% 处的颜色
},
{
offset: 1,
color: '#243859', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
},
areaStyle: {},
lineStyle: { normal: { width: 4 } },
},
{
name: '传感器2',
data: [220, 632, 101, 834, 490, 630, 220],
type: 'line',
smooth: true,
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: '#B2F2FC', // 0% 处的颜色
},
{
offset: 1,
color: '#5BE1FB', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
},
areaStyle: {},
lineStyle: { normal: { width: 4 } },
},
],
};
export default option;

232
src/components/RFID/RFID.vue

@ -0,0 +1,232 @@
<template>
<div class="flex-1 flex-column rfid" id="rfid">
<!-- <div :key="index" class="list" v-for="(list,index) in lists">
<span>{{ list.name }}</span>
</div>
<div class="list active">
<span>专科护士</span>
</div>-->
<div id="wrap"></div>
</div>
</template>
<script>
export default {
name: 'RFID',
data() {
return {
lists: [
{ top: '10px', left: '10px', name: '专科护士' },
{ top: '50px', left: '50px', name: '专科医生' },
{ top: '70px', left: '70px', name: '采血推车' },
{ top: '90px', left: '90px', name: '心电图推车' },
{ top: '100px', left: '100px', name: '介入室' },
{ top: '80px', left: '80px', name: 'CT室' },
{ top: '60px', left: '60px', name: '急救室' },
{ top: '40px', left: '40px', name: '急诊医生' },
],
picSrc: '~assets/rfid-bg.png',
};
},
mounted() {
let wrap = document.getElementById('wrap');
let lists = this.lists;
/**
* 生成并返回一个从m到n全区间的随机数
* @param {Object} m
* @param {Object} n
*/
function randomNum(m, n) {
return Math.floor(Math.random() * (n - m + 1) + m);
}
/**
* 生成一个随机颜色并返回rgb字符串值
*/
function randomColor() {
var r = randomNum(0, 255);
var g = randomNum(0, 255);
var b = randomNum(0, 255);
return 'rgb(' + r + ',' + g + ',' + b + ')';
}
//wrapDiv
var wrapDiv = document.getElementById('wrap'); //
var balls = [];
//
function createBalls() {
for (var i = 0; lists.length > i; i++) {
var ball = document.createElement('div'); //XY
ball.x = randomNum(0, 120);
ball.y = randomNum(0, 70); //
ball.speed = randomNum(1, 2); //
if (Math.random() - 0.5 > 0) {
ball.xflag = true;
} else {
ball.xflag = false;
}
if (Math.random() - 0.5 > 0) {
ball.yflag = true;
} else {
ball.yflag = false;
}
ball.innerHTML = lists[i].name; //wrapDiv
wrapDiv.appendChild(ball); //
// ball.classList = 'box';
ball.style.backgroundColor = randomColor();
// ball.style =
// 'width: 69px;height: 69px;line-height: 69px;text-align: center;font-size: 12px; color: #C8CED5; position: absolute;top: 100px; left: 200px;';
balls.push(ball);
}
}
createBalls();
//
function moveBalls(ballObj) {
setInterval(function() {
ballObj.style.top = ballObj.y + 'px';
ballObj.style.left = ballObj.x + 'px'; //
if (ballObj.yflag) {
//
ballObj.y += ballObj.speed;
if (ballObj.y >= wrap.offsetHeight - ballObj.offsetHeight) {
ballObj.y = wrap.offsetHeight - ballObj.offsetHeight;
ballObj.yflag = false;
}
} else {
//
ballObj.y -= ballObj.speed;
if (ballObj.y <= 0) {
ballObj.y = 0;
ballObj.yflag = true;
}
}
if (ballObj.xflag) {
//
ballObj.x += ballObj.speed;
if (ballObj.x >= wrap.offsetWidth - ballObj.offsetWidth) {
ballObj.x = wrap.offsetWidth - ballObj.offsetWidth;
ballObj.xflag = false;
}
} else {
//
ballObj.x -= ballObj.speed;
if (ballObj.x <= 0) {
ballObj.x = 0;
ballObj.xflag = true;
}
}
crash(ballObj);
}, 100);
}
var x1, y1, x2, y2;
//
function crash(ballObj) {
//XY
x1 = ballObj.x;
y1 = ballObj.y;
for (var i = 0; i < balls.length; i++) {
//
if (ballObj != balls[i]) {
x2 = balls[i].x;
y2 = balls[i].y; //
if (Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2) + 800 <= Math.pow(ballObj.offsetWidth + balls[i].offsetWidth, 2)) {
//
if (ballObj.x < balls[i].x) {
if (ballObj.y < balls[i].y) {
//
ballObj.yflag = false;
ballObj.xflag = false;
} else if (ballObj.y > balls[i].y) {
//
ballObj.xflag = false;
ballObj.yflag = true;
} else {
//
ballObj.xflag = false;
}
} else if (ballObj.x > balls[i].x) {
if (ballObj.y < balls[i].y) {
//
ballObj.yflag = false;
ballObj.xflag = true;
} else if (ballObj.y > balls[i].y) {
//
ballObj.xflag = true;
ballObj.yflag = true;
} else {
//
ballObj.xflag = true;
}
} else if (ballObj.y > balls[i].y) {
//
ballObj.yflag = true;
} else if (ballObj.y < balls[i].y) {
//
ballObj.yflag = false;
}
}
}
}
}
for (var i = 0; i < balls.length; i++) {
//,
moveBalls(balls[i]);
}
},
methods: {},
};
</script>
<style lang="stylus" scoped >
#wrap {
height: 100%;
width: 100%;
/* 小球设置相对定位 */
position: relative;
margin: 0 auto;
overflow: hidden;
}
// p.box {
// width: 40px;
// height: 40px;
// border-radius: 50%;
// background-color: red;
// position: absolute;
// top: 0;
// left: 0;
// color: white;
// font-size: 25px;
// text-align: center;
// line-height: 40px;
// }
.rfid {
position: relative;
}
.list {
width: 69px;
height: 69px;
line-height: 69px;
text-align: center;
font-size: 12px;
color: #C8CED5;
background: url('~assets/rfid-bg.png') no-repeat center;
position: absolute;
left: 200px;
top: 100px;
}
.active {
width: 86px;
height: 86px;
line-height: 86px;
font-size: 12px;
background: url('~assets/rfid-bg-active.png') no-repeat center;
}
</style>

53
src/views/Index/Index.vue

@ -15,7 +15,7 @@
style="width: 100%; height: 162px; object-fit: fill; mix-blend-mode: screen; filter: saturate(200%);" style="width: 100%; height: 162px; object-fit: fill; mix-blend-mode: screen; filter: saturate(200%);"
></video> ></video>
</div> </div>
<span class="bg-title">盐湖区人民医院数看板</span> <span class="bg-title">盐湖区人民医院数看板</span>
</div> </div>
<div class="bg-right"> <div class="bg-right">
<img class="pic" src="~assets/bg-right.png" /> <img class="pic" src="~assets/bg-right.png" />
@ -30,59 +30,80 @@
<div class="flex-1 ma-2"> <div class="flex-1 ma-2">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<span>急救数量统计</span>
</div>
<div class="flex-1 fill-width box-bottom"> <div class="flex-1 fill-width box-bottom">
<statistics class="flex-1" /> <statistics class="flex-1" />
</div> </div>
</div> </div>
<div style="width:100%;height:20px"></div> <div style="width:100%;height:10%"></div>
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<span>急救时长分析</span>
</div>
<div class="flex-1 fill-width box-bottom"> <div class="flex-1 fill-width box-bottom">
<duration class="flex-1" /> <duration class="flex-1" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="flex-2 ma-2">第二列</div> <div class="flex-2 ma-2">
<div class="bg s-pic"></div>
</div>
<div class="flex-1 ma-2"> <div class="flex-1 ma-2">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<span>振动传感器</span>
</div>
<div class="flex-1 fill-width box-bottom"> <div class="flex-1 fill-width box-bottom">
<sensor class="flex-1" /> <sensor class="flex-1" />
</div> </div>
</div> </div>
<div style="width:100%;height:20px"></div> <div style="width:100%;height:10%"></div>
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<span>称重传感器</span>
</div>
<div class="flex-1 fill-width box-bottom"> <div class="flex-1 fill-width box-bottom">
<div class="flex-1">第二行</div> <div class="flex-1">
<load-cells />
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 第二行 --> <!-- 第二行 -->
<div style="width:100%;height:4.2%"></div>
<div class="flex-1 flex-row"> <div class="flex-1 flex-row">
<div class="flex-1 ma-2"> <div class="flex-1 ma-2">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<div class="flex-1 fill-width box-bottom">第一列</div> <span>FAST ED结果</span>
</div>
<div class="flex-1 fill-width box-bottom"></div>
</div> </div>
</div> </div>
<!-- 第二列 --> <!-- 第二列 -->
<div class="flex-2 ma-2"> <div class="flex-2 ma-2">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<span>智慧平车面板数据</span>
</div>
<div class="flex-1 fill-width box-bottom">第二列</div> <div class="flex-1 fill-width box-bottom">第二列</div>
</div> </div>
</div> </div>
<!-- 第三列 --> <!-- 第三列 -->
<div class="flex-1 ma-2"> <div class="flex-1 ma-2">
<div class="d-flex flex-column flex-1"> <div class="d-flex flex-column flex-1">
<div class="box-top"></div> <div class="box-top">
<div class="flex-1 fill-width box-bottom">第三列</div> <span>RFID</span>
</div>
<div class="flex-1 fill-width box-bottom">
<r-f-i-d />
</div>
</div> </div>
</div> </div>
</div> </div>
@ -94,9 +115,11 @@
import Statistics from 'components/Statistics/Statistics.vue'; import Statistics from 'components/Statistics/Statistics.vue';
import Duration from 'components/Duration/Duration.vue'; import Duration from 'components/Duration/Duration.vue';
import Sensor from 'components/Sensor/Sensor.vue'; import Sensor from 'components/Sensor/Sensor.vue';
import LoadCells from 'components/LoadCells/LoadCells.vue';
import RFID from 'components/RFID/RFID.vue';
export default { export default {
name: 'Index', name: 'Index',
components: { Statistics, Duration, Sensor }, components: { Statistics, Duration, Sensor, LoadCells, RFID },
data() { data() {
return {}; return {};
}, },

Loading…
Cancel
Save