修改
This commit is contained in:
parent
7a1212355b
commit
0c0cd9dce0
@ -24,6 +24,17 @@ export function savebp(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//上传血脂
|
||||||
|
export function savebf(data) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/ps/bf/save`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
//上传体温
|
//上传体温
|
||||||
export function savetemp(data) {
|
export function savetemp(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -35,3 +46,39 @@ export function savetemp(data) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//上传BMI
|
||||||
|
export function savebmi(data) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/ps/bmi/save`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传血氧
|
||||||
|
export function savebo(data) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/ps/bo/save`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传心率
|
||||||
|
export function savehr(data) {
|
||||||
|
return request({
|
||||||
|
url: `/fd/ps/hr/save`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
448
components/BMI/BMI.vue
Normal file
448
components/BMI/BMI.vue
Normal file
@ -0,0 +1,448 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app" v-if="current == 3">
|
||||||
|
<view class="titletexts">
|
||||||
|
<view class="title">
|
||||||
|
— 正常范围 —
|
||||||
|
</view>
|
||||||
|
<view class="add" @click="addBMI">
|
||||||
|
+ 添加数据
|
||||||
|
</view>
|
||||||
|
<view class="texts">
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
过轻
|
||||||
|
</view>
|
||||||
|
<view class="ptwo" style="color:#FFA115">
|
||||||
|
18.5
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
正常
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
18.5~23.9
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
肥胖
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
≥28
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bottomlist">
|
||||||
|
<view class="timelist">
|
||||||
|
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||||
|
@tap='taptimeindex(index)'>
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
注:全部视图主要展示全部BMI数值的趋势曲线 单位:kg/m^2
|
||||||
|
</view>
|
||||||
|
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||||
|
</view>
|
||||||
|
<view class="bottomtexts">
|
||||||
|
<view class="lefttext">
|
||||||
|
<view class="pone">
|
||||||
|
平均
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="lefttext">
|
||||||
|
<view class="pone">
|
||||||
|
最大
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.maxVal?echartData.calc.maxVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="righttext">
|
||||||
|
<view class="pone">
|
||||||
|
最小
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.minVal?echartData.calc.minVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="charts-box">
|
||||||
|
<qiun-data-charts type="pie" :opts="pie_opts" :chartData="datalisttwo" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
current: {
|
||||||
|
type: Number,
|
||||||
|
require: true
|
||||||
|
},
|
||||||
|
echartData: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timelist: [{
|
||||||
|
name: '全部',
|
||||||
|
id: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '周',
|
||||||
|
id: 1
|
||||||
|
}, {
|
||||||
|
name: '月',
|
||||||
|
id: 2
|
||||||
|
}, {
|
||||||
|
name: '年',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
],
|
||||||
|
timeindex: 0,
|
||||||
|
socketOpen: false,
|
||||||
|
timer: null,
|
||||||
|
datalist: null,
|
||||||
|
datalisttwo: null,
|
||||||
|
pie_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
padding: [5, 5, 5, 5],
|
||||||
|
enableScroll: false,
|
||||||
|
extra: {
|
||||||
|
pie: {
|
||||||
|
activeOpacity: 0.5,
|
||||||
|
activeRadius: 10,
|
||||||
|
offsetAngle: 0,
|
||||||
|
labelWidth: 15,
|
||||||
|
border: false,
|
||||||
|
borderWidth: 3,
|
||||||
|
borderColor: "#FFFFFF"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
line_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
dataLabel: true,
|
||||||
|
enableScroll: true,
|
||||||
|
touchMoveLimit: 24,
|
||||||
|
padding: [15, 10, 0, 15],
|
||||||
|
xAxis: {
|
||||||
|
lineHeight: 40,
|
||||||
|
disableGrid: true,
|
||||||
|
boundaryGap: "center",
|
||||||
|
fontSize: 10,
|
||||||
|
type: 'grid',
|
||||||
|
gridType: 'dash',
|
||||||
|
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||||
|
scrollShow: true, //新增是否显示滚动条,默认false
|
||||||
|
scrollAlign: 'left', //滚动条初始位置
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
gridType: "dash",
|
||||||
|
dashLength: 2
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
lineHeight: 25
|
||||||
|
},
|
||||||
|
extra: {
|
||||||
|
line: {
|
||||||
|
type: "straight",
|
||||||
|
width: 2,
|
||||||
|
activeType: "hollow"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
// if (this.current ==3) {
|
||||||
|
// this.scoket()
|
||||||
|
// }
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
echartData: {
|
||||||
|
handler() {
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
current(newValue, oldValue) {
|
||||||
|
if (newValue != 3) {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scoket()
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
taptimeindex(index) {
|
||||||
|
this.timeindex = index
|
||||||
|
this.$emit('taptimeindex', index);
|
||||||
|
},
|
||||||
|
addBMI() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pagesC/addBMI/addBMI"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getServerData() {
|
||||||
|
if (this.echartData) {
|
||||||
|
setTimeout(() => {
|
||||||
|
let res = {
|
||||||
|
categories: [],
|
||||||
|
series: [{
|
||||||
|
name: "BMI",
|
||||||
|
data: []
|
||||||
|
}, ]
|
||||||
|
};
|
||||||
|
res.series[0].data = this.echartData.list.map(e => e.bmi)
|
||||||
|
res.categories = this.echartData.list.map(e => e.measureTime)
|
||||||
|
this.datalist = res
|
||||||
|
let restwo = {
|
||||||
|
series: [{
|
||||||
|
data: [{
|
||||||
|
"name": "正常" + this.echartData.calc.normalNum + "次",
|
||||||
|
"value": this.echartData.calc.normalNum
|
||||||
|
}, {
|
||||||
|
"name": "超标" + this.echartData.calc.overNum + "次",
|
||||||
|
"value": this.echartData.calc.overNum
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
this.datalisttwo = restwo
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scoket() {
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
const that = this
|
||||||
|
uni.closeSocket()
|
||||||
|
this.socketOpen = false
|
||||||
|
try {
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
uni.onSocketOpen(res => {
|
||||||
|
console.log('webScoket连接已打开', res);
|
||||||
|
that.socketOpen = true
|
||||||
|
that.reset()
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketError(err => {
|
||||||
|
console.log('webScoket连接打开失败', err);
|
||||||
|
if (err && err.code != 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketClose(err => {
|
||||||
|
console.log('webScoket连接关闭', err);
|
||||||
|
if (err && err.code !== 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.onSocketMessage(res => {
|
||||||
|
console.log("webScoket监听收到的信息", res);
|
||||||
|
// that.newsList.push({
|
||||||
|
// senderName: that.currentItem.senderName,
|
||||||
|
// content: JSON.parse(res.data).message
|
||||||
|
// })
|
||||||
|
this.$emit('websocket-message');
|
||||||
|
this.$forceUpdate()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 心跳响应
|
||||||
|
reset() {
|
||||||
|
let that = this
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
clearInterval(that.timer);
|
||||||
|
that.timer = setInterval(() => {
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: 'ping',
|
||||||
|
success(res) {
|
||||||
|
console.log('正在发送心跳');
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log('心跳发送失败,重新连接...');
|
||||||
|
_socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 60000)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #F7F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
|
||||||
|
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||||
|
.charts-box {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottomtexts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20rpx 0 40rpx;
|
||||||
|
|
||||||
|
.lefttext,
|
||||||
|
.righttext {
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottomlist {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 17rpx;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 90%;
|
||||||
|
margin: 20rpx auto 30rpx;
|
||||||
|
font-size: 18rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #595959;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timelist {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
padding-top: 25rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 25%;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 56rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border: 2rpx solid #26A888;
|
||||||
|
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||||
|
color: #26A888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeitem {
|
||||||
|
background: #26A888;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.titletexts {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||||
|
border-radius: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.texts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: 130rpx;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 33%;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
|
||||||
|
.p {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ptwo {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #26A888;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add {
|
||||||
|
width: 205rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
background: #26A888;
|
||||||
|
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||||
|
line-height: 64rpx;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 0%;
|
||||||
|
color: #fff;
|
||||||
|
top: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #26A888;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 46rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
408
components/BloodFat/BloodFat.vue
Normal file
408
components/BloodFat/BloodFat.vue
Normal file
@ -0,0 +1,408 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app" v-if="current == 2">
|
||||||
|
<view class="titletexts">
|
||||||
|
<view class="title">
|
||||||
|
— 正常范围 —
|
||||||
|
</view>
|
||||||
|
<view class="add" @click="addBloodFat">
|
||||||
|
+ 添加数据
|
||||||
|
</view>
|
||||||
|
<view class="texts">
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
血清总胆固醇
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
3.0-5.7mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
甘油三酯
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
0.5-1.7mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
高密度脂蛋白胆固醇
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
0.9-1.8mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
低密度脂蛋白胆固醇
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
2.1-3.1mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bottomlist">
|
||||||
|
<view class="timelist">
|
||||||
|
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||||
|
@tap='taptimeindex(index)'>
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
注:全部视图主要展示全部血脂数值的趋势曲线 单位:mmol/L
|
||||||
|
</view>
|
||||||
|
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
current: {
|
||||||
|
type: Number,
|
||||||
|
require: true
|
||||||
|
},
|
||||||
|
echartData: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timelist: [{
|
||||||
|
name: '全部',
|
||||||
|
id: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '周',
|
||||||
|
id: 1
|
||||||
|
}, {
|
||||||
|
name: '月',
|
||||||
|
id: 2
|
||||||
|
}, {
|
||||||
|
name: '年',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
],
|
||||||
|
timeindex: 0,
|
||||||
|
socketOpen: false,
|
||||||
|
timer: null,
|
||||||
|
datalist: null,
|
||||||
|
pie_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
padding: [5, 5, 5, 5],
|
||||||
|
enableScroll: false,
|
||||||
|
extra: {
|
||||||
|
pie: {
|
||||||
|
activeOpacity: 0.5,
|
||||||
|
activeRadius: 10,
|
||||||
|
offsetAngle: 0,
|
||||||
|
labelWidth: 15,
|
||||||
|
border: false,
|
||||||
|
borderWidth: 3,
|
||||||
|
borderColor: "#FFFFFF"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
line_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
dataLabel: true,
|
||||||
|
enableScroll: true,
|
||||||
|
touchMoveLimit: 24,
|
||||||
|
padding: [15, 10, 0, 15],
|
||||||
|
xAxis: {
|
||||||
|
lineHeight: 40,
|
||||||
|
disableGrid: true,
|
||||||
|
boundaryGap: "center",
|
||||||
|
fontSize: 10,
|
||||||
|
type: 'grid',
|
||||||
|
gridType: 'dash',
|
||||||
|
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||||
|
scrollShow: true, //新增是否显示滚动条,默认false
|
||||||
|
scrollAlign: 'left', //滚动条初始位置
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
gridType: "dash",
|
||||||
|
dashLength: 2
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: true,
|
||||||
|
position: "top",
|
||||||
|
lineHeight: 25
|
||||||
|
},
|
||||||
|
extra: {
|
||||||
|
line: {
|
||||||
|
type: "straight",
|
||||||
|
width: 2,
|
||||||
|
activeType: "hollow"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
// if (this.current ==2) {
|
||||||
|
// this.scoket()
|
||||||
|
// }
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
echartData: {
|
||||||
|
handler() {
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
current(newValue, oldValue) {
|
||||||
|
if (newValue != 2) {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scoket()
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
taptimeindex(index) {
|
||||||
|
this.timeindex = index
|
||||||
|
this.$emit('taptimeindex', index);
|
||||||
|
},
|
||||||
|
addBloodFat() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pagesC/addBloodFat/addBloodFat"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getServerData() {
|
||||||
|
if (this.echartData) {
|
||||||
|
setTimeout(() => {
|
||||||
|
let res = {
|
||||||
|
categories: [],
|
||||||
|
series: [{
|
||||||
|
name: "血清总胆固醇",
|
||||||
|
data: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "甘油三酯",
|
||||||
|
data: []
|
||||||
|
}, {
|
||||||
|
name: "高密度脂蛋白胆固醇",
|
||||||
|
data: []
|
||||||
|
}, {
|
||||||
|
name: "低密度脂蛋白胆固醇",
|
||||||
|
data: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
res.series[0].data = this.echartData.list.map(e => e.tc)
|
||||||
|
res.series[1].data = this.echartData.list.map(e => e.tg)
|
||||||
|
res.series[2].data = this.echartData.list.map(e => e.hdl)
|
||||||
|
res.series[3].data = this.echartData.list.map(e => e.ldl)
|
||||||
|
res.categories = this.echartData.list.map(e => e.measureTime)
|
||||||
|
this.datalist = res
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scoket() {
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
const that = this
|
||||||
|
uni.closeSocket()
|
||||||
|
this.socketOpen = false
|
||||||
|
try {
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
uni.onSocketOpen(res => {
|
||||||
|
console.log('webScoket连接已打开', res);
|
||||||
|
that.socketOpen = true
|
||||||
|
that.reset()
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketError(err => {
|
||||||
|
console.log('webScoket连接打开失败', err);
|
||||||
|
if (err && err.code != 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketClose(err => {
|
||||||
|
console.log('webScoket连接关闭', err);
|
||||||
|
if (err && err.code !== 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.onSocketMessage(res => {
|
||||||
|
console.log("webScoket监听收到的信息", res);
|
||||||
|
// that.newsList.push({
|
||||||
|
// senderName: that.currentItem.senderName,
|
||||||
|
// content: JSON.parse(res.data).message
|
||||||
|
// })
|
||||||
|
this.$emit('websocket-message');
|
||||||
|
this.$forceUpdate()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 心跳响应
|
||||||
|
reset() {
|
||||||
|
let that = this
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
clearInterval(that.timer);
|
||||||
|
that.timer = setInterval(() => {
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: 'ping',
|
||||||
|
success(res) {
|
||||||
|
console.log('正在发送心跳');
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log('心跳发送失败,重新连接...');
|
||||||
|
_socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 60000)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #F7F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
|
||||||
|
.bottomlist {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 17rpx;
|
||||||
|
padding-bottom: 100rpx;
|
||||||
|
.text {
|
||||||
|
width: 90%;
|
||||||
|
margin: 20rpx auto 30rpx;
|
||||||
|
font-size: 18rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #595959;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timelist {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
padding-top: 25rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 25%;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 56rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border: 2rpx solid #26A888;
|
||||||
|
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||||
|
color: #26A888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeitem {
|
||||||
|
background: #26A888;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.titletexts {
|
||||||
|
width: 100%;
|
||||||
|
height: 400rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||||
|
border-radius: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.texts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: 130rpx;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 50%;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
|
||||||
|
.p {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ptwo {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #26A888;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add {
|
||||||
|
width: 205rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
background: #26A888;
|
||||||
|
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||||
|
line-height: 64rpx;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 0%;
|
||||||
|
color: #fff;
|
||||||
|
top: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #26A888;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 46rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
425
components/BloodOxygen/BloodOxygen.vue
Normal file
425
components/BloodOxygen/BloodOxygen.vue
Normal file
@ -0,0 +1,425 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app" v-if="current == 4">
|
||||||
|
<view class="titletexts">
|
||||||
|
<view class="title">
|
||||||
|
— 正常范围 —
|
||||||
|
</view>
|
||||||
|
<view class="add" @click="addBloodOxygen">
|
||||||
|
+ 添加数据
|
||||||
|
</view>
|
||||||
|
<view class="texts">
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
血氧饱和度(SaO2)
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
≥95%
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bottomlist">
|
||||||
|
<view class="timelist">
|
||||||
|
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||||
|
@tap='taptimeindex(index)'>
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
注:全部视图主要展示全部体温数值的趋势曲线
|
||||||
|
</view>
|
||||||
|
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||||
|
</view>
|
||||||
|
<view class="bottomtexts">
|
||||||
|
<view class="lefttext">
|
||||||
|
<view class="pone">
|
||||||
|
平均
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="lefttext">
|
||||||
|
<view class="pone">
|
||||||
|
最大
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.maxVal?echartData.calc.maxVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="righttext">
|
||||||
|
<view class="pone">
|
||||||
|
最小
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.minVal?echartData.calc.minVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="charts-box">
|
||||||
|
<qiun-data-charts type="pie" :opts="pie_opts" :chartData="datalisttwo" />
|
||||||
|
</view>
|
||||||
|
<!-- <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" /> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
current: {
|
||||||
|
type: Number,
|
||||||
|
require: true
|
||||||
|
},
|
||||||
|
echartData: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timelist: [{
|
||||||
|
name: '全部',
|
||||||
|
id: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '周',
|
||||||
|
id: 1
|
||||||
|
}, {
|
||||||
|
name: '月',
|
||||||
|
id: 2
|
||||||
|
}, {
|
||||||
|
name: '年',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
],
|
||||||
|
timeindex: 0,
|
||||||
|
socketOpen: false,
|
||||||
|
timer: null,
|
||||||
|
datalist: null,
|
||||||
|
datalisttwo: null,
|
||||||
|
pie_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
padding: [5, 5, 5, 5],
|
||||||
|
enableScroll: false,
|
||||||
|
extra: {
|
||||||
|
pie: {
|
||||||
|
activeOpacity: 0.5,
|
||||||
|
activeRadius: 10,
|
||||||
|
offsetAngle: 0,
|
||||||
|
labelWidth: 15,
|
||||||
|
border: false,
|
||||||
|
borderWidth: 3,
|
||||||
|
borderColor: "#FFFFFF"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
line_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
dataLabel: true,
|
||||||
|
enableScroll: true,
|
||||||
|
touchMoveLimit: 24,
|
||||||
|
padding: [15, 10, 0, 15],
|
||||||
|
xAxis: {
|
||||||
|
lineHeight: 40,
|
||||||
|
disableGrid: true,
|
||||||
|
boundaryGap: "center",
|
||||||
|
fontSize: 10,
|
||||||
|
type: 'grid',
|
||||||
|
gridType: 'dash',
|
||||||
|
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||||
|
scrollShow: true, //新增是否显示滚动条,默认false
|
||||||
|
scrollAlign: 'left', //滚动条初始位置
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
gridType: "dash",
|
||||||
|
dashLength: 2
|
||||||
|
},
|
||||||
|
extra: {
|
||||||
|
line: {
|
||||||
|
type: "straight",
|
||||||
|
width: 2,
|
||||||
|
activeType: "hollow"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
// if (this.current == 4) {
|
||||||
|
// this.scoket()
|
||||||
|
// }
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
echartData: {
|
||||||
|
handler() {
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
current(newValue, oldValue) {
|
||||||
|
if (newValue != 4) {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scoket()
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
taptimeindex(index) {
|
||||||
|
this.timeindex = index
|
||||||
|
this.$emit('taptimeindex', index);
|
||||||
|
},
|
||||||
|
addBloodOxygen() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pagesC/addBloodOxygen/addBloodOxygen"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getServerData() {
|
||||||
|
if (this.echartData) {
|
||||||
|
setTimeout(() => {
|
||||||
|
let res = {
|
||||||
|
categories: [],
|
||||||
|
series: [{
|
||||||
|
name: "血氧",
|
||||||
|
data: []
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
res.series[0].data = this.echartData.list.map(e => e.spo2)
|
||||||
|
res.categories = this.echartData.list.map(e => e.measureTime)
|
||||||
|
this.datalist = res
|
||||||
|
let restwo = {
|
||||||
|
series: [{
|
||||||
|
data: [{
|
||||||
|
"name": "正常" + this.echartData.calc.normalNum + "次",
|
||||||
|
"value": this.echartData.calc.normalNum
|
||||||
|
}, {
|
||||||
|
"name": "超标" + this.echartData.calc.overNum + "次",
|
||||||
|
"value": this.echartData.calc.overNum
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
this.datalisttwo = restwo
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scoket() {
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
const that = this
|
||||||
|
uni.closeSocket()
|
||||||
|
this.socketOpen = false
|
||||||
|
try {
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
uni.onSocketOpen(res => {
|
||||||
|
console.log('webScoket连接已打开', res);
|
||||||
|
that.socketOpen = true
|
||||||
|
that.reset()
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketError(err => {
|
||||||
|
console.log('webScoket连接打开失败', err);
|
||||||
|
if (err && err.code != 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketClose(err => {
|
||||||
|
console.log('webScoket连接关闭', err);
|
||||||
|
if (err && err.code !== 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.onSocketMessage(res => {
|
||||||
|
console.log("webScoket监听收到的信息", res);
|
||||||
|
// that.newsList.push({
|
||||||
|
// senderName: that.currentItem.senderName,
|
||||||
|
// content: JSON.parse(res.data).message
|
||||||
|
// })
|
||||||
|
this.$emit('websocket-message');
|
||||||
|
this.$forceUpdate()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 心跳响应
|
||||||
|
reset() {
|
||||||
|
let that = this
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
clearInterval(that.timer);
|
||||||
|
that.timer = setInterval(() => {
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: 'ping',
|
||||||
|
success(res) {
|
||||||
|
console.log('正在发送心跳');
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log('心跳发送失败,重新连接...');
|
||||||
|
_socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 60000)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #F7F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
|
||||||
|
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||||
|
.charts-box {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottomtexts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20rpx 0 40rpx;
|
||||||
|
|
||||||
|
.lefttext,
|
||||||
|
.righttext {
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottomlist {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 17rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 90%;
|
||||||
|
margin: 20rpx auto 30rpx;
|
||||||
|
font-size: 18rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #595959;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timelist {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
padding-top: 25rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 25%;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 56rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border: 2rpx solid #26A888;
|
||||||
|
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||||
|
color: #26A888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeitem {
|
||||||
|
background: #26A888;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.titletexts {
|
||||||
|
width: 100%;
|
||||||
|
height: 250rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||||
|
border-radius: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.texts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: 130rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.p {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ptwo {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #26A888;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add {
|
||||||
|
width: 205rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
background: #26A888;
|
||||||
|
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||||
|
line-height: 64rpx;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 0%;
|
||||||
|
color: #fff;
|
||||||
|
top: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #26A888;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 46rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
<view class="bottomtexts">
|
<view class="bottomtexts">
|
||||||
<view class="lefttext">
|
<view class="lefttext">
|
||||||
<view class="pone">
|
<view class="pone">
|
||||||
平均值
|
平均
|
||||||
</view>
|
</view>
|
||||||
<view class="ptwo">
|
<view class="ptwo">
|
||||||
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||||
@ -134,7 +134,7 @@
|
|||||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
"#ea7ccc"
|
"#ea7ccc"
|
||||||
],
|
],
|
||||||
dataLabel: false,
|
dataLabel: true,
|
||||||
enableScroll: true,
|
enableScroll: true,
|
||||||
touchMoveLimit: 24,
|
touchMoveLimit: 24,
|
||||||
padding: [15, 10, 0, 15],
|
padding: [15, 10, 0, 15],
|
||||||
@ -142,7 +142,7 @@
|
|||||||
lineHeight: 40,
|
lineHeight: 40,
|
||||||
disableGrid: true,
|
disableGrid: true,
|
||||||
boundaryGap: "center",
|
boundaryGap: "center",
|
||||||
fontSize: 12,
|
fontSize: 10,
|
||||||
type: 'grid',
|
type: 'grid',
|
||||||
gridType: 'dash',
|
gridType: 'dash',
|
||||||
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||||
|
|||||||
@ -120,7 +120,7 @@
|
|||||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
"#ea7ccc"
|
"#ea7ccc"
|
||||||
],
|
],
|
||||||
dataLabel: false,
|
dataLabel: true,
|
||||||
enableScroll: true,
|
enableScroll: true,
|
||||||
touchMoveLimit: 24,
|
touchMoveLimit: 24,
|
||||||
padding: [15, 10, 0, 15],
|
padding: [15, 10, 0, 15],
|
||||||
@ -128,10 +128,10 @@
|
|||||||
lineHeight: 40,
|
lineHeight: 40,
|
||||||
disableGrid: true,
|
disableGrid: true,
|
||||||
boundaryGap: "center",
|
boundaryGap: "center",
|
||||||
fontSize: 12,
|
fontSize: 10,
|
||||||
type: 'grid',
|
type: 'grid',
|
||||||
gridType: 'dash',
|
gridType: 'dash',
|
||||||
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
itemCount: 3, //x轴单屏显示数据的数量,默认为5个
|
||||||
scrollShow: true, //新增是否显示滚动条,默认false
|
scrollShow: true, //新增是否显示滚动条,默认false
|
||||||
scrollAlign: 'left', //滚动条初始位置
|
scrollAlign: 'left', //滚动条初始位置
|
||||||
},
|
},
|
||||||
|
|||||||
425
components/HeartRate/HeartRate.vue
Normal file
425
components/HeartRate/HeartRate.vue
Normal file
@ -0,0 +1,425 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app" v-if="current == 5">
|
||||||
|
<view class="titletexts">
|
||||||
|
<view class="title">
|
||||||
|
— 正常范围 —
|
||||||
|
</view>
|
||||||
|
<view class="add" @click="addHeartRate">
|
||||||
|
+ 添加数据
|
||||||
|
</view>
|
||||||
|
<view class="texts">
|
||||||
|
<view class="text">
|
||||||
|
<view class="p">
|
||||||
|
心率
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
60—100次/分钟
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bottomlist">
|
||||||
|
<view class="timelist">
|
||||||
|
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||||
|
@tap='taptimeindex(index)'>
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
注:全部视图主要展示全部体温数值的趋势曲线
|
||||||
|
</view>
|
||||||
|
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||||
|
</view>
|
||||||
|
<view class="bottomtexts">
|
||||||
|
<view class="lefttext">
|
||||||
|
<view class="pone">
|
||||||
|
平均
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="lefttext">
|
||||||
|
<view class="pone">
|
||||||
|
最大
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.maxVal?echartData.calc.maxVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="righttext">
|
||||||
|
<view class="pone">
|
||||||
|
最小
|
||||||
|
</view>
|
||||||
|
<view class="ptwo">
|
||||||
|
{{echartData.calc.minVal?echartData.calc.minVal:'暂无'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="charts-box">
|
||||||
|
<qiun-data-charts type="pie" :opts="pie_opts" :chartData="datalisttwo" />
|
||||||
|
</view>
|
||||||
|
<!-- <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" /> -->
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
current: {
|
||||||
|
type: Number,
|
||||||
|
require: true
|
||||||
|
},
|
||||||
|
echartData: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timelist: [{
|
||||||
|
name: '全部',
|
||||||
|
id: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '周',
|
||||||
|
id: 1
|
||||||
|
}, {
|
||||||
|
name: '月',
|
||||||
|
id: 2
|
||||||
|
}, {
|
||||||
|
name: '年',
|
||||||
|
id: 3
|
||||||
|
},
|
||||||
|
],
|
||||||
|
timeindex: 0,
|
||||||
|
socketOpen: false,
|
||||||
|
timer: null,
|
||||||
|
datalist: null,
|
||||||
|
datalisttwo: null,
|
||||||
|
pie_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
padding: [5, 5, 5, 5],
|
||||||
|
enableScroll: false,
|
||||||
|
extra: {
|
||||||
|
pie: {
|
||||||
|
activeOpacity: 0.5,
|
||||||
|
activeRadius: 10,
|
||||||
|
offsetAngle: 0,
|
||||||
|
labelWidth: 15,
|
||||||
|
border: false,
|
||||||
|
borderWidth: 3,
|
||||||
|
borderColor: "#FFFFFF"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
line_opts: {
|
||||||
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
|
"#ea7ccc"
|
||||||
|
],
|
||||||
|
dataLabel: true,
|
||||||
|
enableScroll: true,
|
||||||
|
touchMoveLimit: 24,
|
||||||
|
padding: [15, 10, 0, 15],
|
||||||
|
xAxis: {
|
||||||
|
lineHeight: 40,
|
||||||
|
disableGrid: true,
|
||||||
|
boundaryGap: "center",
|
||||||
|
fontSize: 10,
|
||||||
|
type: 'grid',
|
||||||
|
gridType: 'dash',
|
||||||
|
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||||
|
scrollShow: true, //新增是否显示滚动条,默认false
|
||||||
|
scrollAlign: 'left', //滚动条初始位置
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
gridType: "dash",
|
||||||
|
dashLength: 2
|
||||||
|
},
|
||||||
|
extra: {
|
||||||
|
line: {
|
||||||
|
type: "straight",
|
||||||
|
width: 2,
|
||||||
|
activeType: "hollow"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
// if (this.current == 5) {
|
||||||
|
// this.scoket()
|
||||||
|
// }
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
echartData: {
|
||||||
|
handler() {
|
||||||
|
this.getServerData()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
current(newValue, oldValue) {
|
||||||
|
if (newValue != 5) {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scoket()
|
||||||
|
}, 800)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
taptimeindex(index) {
|
||||||
|
this.timeindex = index
|
||||||
|
this.$emit('taptimeindex', index);
|
||||||
|
},
|
||||||
|
addHeartRate() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pagesC/addHeartRate/addHeartRate"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getServerData() {
|
||||||
|
if (this.echartData) {
|
||||||
|
setTimeout(() => {
|
||||||
|
let res = {
|
||||||
|
categories: [],
|
||||||
|
series: [{
|
||||||
|
name: "血氧",
|
||||||
|
data: []
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
res.series[0].data = this.echartData.list.map(e => e.hr)
|
||||||
|
res.categories = this.echartData.list.map(e => e.measureTime)
|
||||||
|
this.datalist = res
|
||||||
|
let restwo = {
|
||||||
|
series: [{
|
||||||
|
data: [{
|
||||||
|
"name": "正常" + this.echartData.calc.normalNum + "次",
|
||||||
|
"value": this.echartData.calc.normalNum
|
||||||
|
}, {
|
||||||
|
"name": "超标" + this.echartData.calc.overNum + "次",
|
||||||
|
"value": this.echartData.calc.overNum
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
this.datalisttwo = restwo
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scoket() {
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
const that = this
|
||||||
|
uni.closeSocket()
|
||||||
|
this.socketOpen = false
|
||||||
|
try {
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
uni.onSocketOpen(res => {
|
||||||
|
console.log('webScoket连接已打开', res);
|
||||||
|
that.socketOpen = true
|
||||||
|
that.reset()
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketError(err => {
|
||||||
|
console.log('webScoket连接打开失败', err);
|
||||||
|
if (err && err.code != 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.onSocketClose(err => {
|
||||||
|
console.log('webScoket连接关闭', err);
|
||||||
|
if (err && err.code !== 1000) {
|
||||||
|
setTimeout(() => {
|
||||||
|
that.socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}, 3 * 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.onSocketMessage(res => {
|
||||||
|
console.log("webScoket监听收到的信息", res);
|
||||||
|
// that.newsList.push({
|
||||||
|
// senderName: that.currentItem.senderName,
|
||||||
|
// content: JSON.parse(res.data).message
|
||||||
|
// })
|
||||||
|
this.$emit('websocket-message');
|
||||||
|
this.$forceUpdate()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 心跳响应
|
||||||
|
reset() {
|
||||||
|
let that = this
|
||||||
|
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||||
|
clearInterval(that.timer);
|
||||||
|
that.timer = setInterval(() => {
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: 'ping',
|
||||||
|
success(res) {
|
||||||
|
console.log('正在发送心跳');
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log('心跳发送失败,重新连接...');
|
||||||
|
_socketOpen = true
|
||||||
|
uni.connectSocket({
|
||||||
|
url: SOCKETURL
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 60000)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #F7F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
width: 96%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-bottom: 60rpx;
|
||||||
|
|
||||||
|
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||||
|
.charts-box {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottomtexts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20rpx 0 40rpx;
|
||||||
|
|
||||||
|
.lefttext,
|
||||||
|
.righttext {
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottomlist {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-top: 17rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 90%;
|
||||||
|
margin: 20rpx auto 30rpx;
|
||||||
|
font-size: 18rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #595959;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timelist {
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
padding-top: 25rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 25%;
|
||||||
|
height: 56rpx;
|
||||||
|
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 56rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border: 2rpx solid #26A888;
|
||||||
|
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||||
|
color: #26A888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeitem {
|
||||||
|
background: #26A888;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.titletexts {
|
||||||
|
width: 100%;
|
||||||
|
height: 250rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||||
|
border-radius: 5rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.texts {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: 130rpx;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.p {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ptwo {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #26A888;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.add {
|
||||||
|
width: 205rpx;
|
||||||
|
height: 64rpx;
|
||||||
|
background: #26A888;
|
||||||
|
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||||
|
line-height: 64rpx;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 0%;
|
||||||
|
color: #fff;
|
||||||
|
top: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #26A888;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 46rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<view class="bottomtexts">
|
<view class="bottomtexts">
|
||||||
<view class="lefttext">
|
<view class="lefttext">
|
||||||
<view class="pone">
|
<view class="pone">
|
||||||
平均值
|
平均
|
||||||
</view>
|
</view>
|
||||||
<view class="ptwo">
|
<view class="ptwo">
|
||||||
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||||
@ -120,7 +120,7 @@
|
|||||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||||
"#ea7ccc"
|
"#ea7ccc"
|
||||||
],
|
],
|
||||||
dataLabel: false,
|
dataLabel: true,
|
||||||
enableScroll: true,
|
enableScroll: true,
|
||||||
touchMoveLimit: 24,
|
touchMoveLimit: 24,
|
||||||
padding: [15, 10, 0, 15],
|
padding: [15, 10, 0, 15],
|
||||||
@ -128,7 +128,7 @@
|
|||||||
lineHeight: 40,
|
lineHeight: 40,
|
||||||
disableGrid: true,
|
disableGrid: true,
|
||||||
boundaryGap: "center",
|
boundaryGap: "center",
|
||||||
fontSize: 12,
|
fontSize: 10,
|
||||||
type: 'grid',
|
type: 'grid',
|
||||||
gridType: 'dash',
|
gridType: 'dash',
|
||||||
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||||
53
pages.json
53
pages.json
@ -4,6 +4,12 @@
|
|||||||
},
|
},
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
|
"path": "pages/homepage/homepage",
|
||||||
|
"style": {
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
"path": "pages/myinformation/myinformation",
|
"path": "pages/myinformation/myinformation",
|
||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
@ -17,14 +23,7 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "pages/homepage/homepage",
|
|
||||||
"style": {
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "pages/startup/startup",
|
"path": "pages/startup/startup",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
@ -405,16 +404,13 @@
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "AddMembers/AddMembers",
|
"path": "AddMembers/AddMembers",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
|
||||||
"navigationBarTitleText": "添加成员",
|
"navigationBarTitleText": "添加成员",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}
|
}, {
|
||||||
,{
|
|
||||||
"path": "Serviceevaluation/Serviceevaluation",
|
"path": "Serviceevaluation/Serviceevaluation",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
|
||||||
"navigationBarTitleText": "服务评价",
|
"navigationBarTitleText": "服务评价",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
@ -563,14 +559,31 @@
|
|||||||
"navigationBarTitleText": "记录体温",
|
"navigationBarTitleText": "记录体温",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "addBloodFat/addBloodFat",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "记录血脂",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "addBMI/addBMI",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "记录BMI",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "addBloodOxygen/addBloodOxygen",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "记录血氧",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "addHeartRate/addHeartRate",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "记录心率",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// "path": "contractsigningprotocol/contractsigningprotocol",
|
|
||||||
// "style": {
|
|
||||||
// "navigationBarTitleText": "签约协议",
|
|
||||||
// "enablePullDownRefresh": false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
236
pagesC/addBMI/addBMI.vue
Normal file
236
pagesC/addBMI/addBMI.vue
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app">
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressureg">
|
||||||
|
身高
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="height" fontSize='50rpx' inputAlign='center'
|
||||||
|
type="number"></input>
|
||||||
|
<view class="text">
|
||||||
|
cm
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressureg">
|
||||||
|
体重
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="weight" fontSize='50rpx' inputAlign='center'
|
||||||
|
type="number"></input>
|
||||||
|
<view class="text">
|
||||||
|
KG
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressureg">
|
||||||
|
BMI
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="bmi" fontSize='50rpx' inputAlign='center'
|
||||||
|
disabled></input>
|
||||||
|
<view class="text">
|
||||||
|
kg/m^2
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<view style="display: flex;align-items: center;">
|
||||||
|
<text style="margin-left: 50rpx">记录时间:</text>
|
||||||
|
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||||
|
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||||
|
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="submit" @tap="submit">
|
||||||
|
保存
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
savebmi
|
||||||
|
} from '@/api/examinationapi/add.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
weight: '',
|
||||||
|
height: '',
|
||||||
|
timetext: this.formatDate(Date.now()),
|
||||||
|
measureTime: this.formatDate(Date.now()),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
bmi() {
|
||||||
|
return (this.weight / ((this.height / 100) * (this.height / 100))).toFixed(2);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatDate(timestamp) {
|
||||||
|
const now = new Date(parseInt(timestamp))
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = now.getMonth() + 1;
|
||||||
|
const date = now.getDate();
|
||||||
|
const hour = now.getHours();
|
||||||
|
const minute = now.getMinutes();
|
||||||
|
const second = now.getSeconds();
|
||||||
|
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||||
|
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||||
|
10) ? '0' + second : second);
|
||||||
|
},
|
||||||
|
timeconfirm(time) {
|
||||||
|
this.timetext = time
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if (this.height && this.weight) {
|
||||||
|
this.bmi
|
||||||
|
let data = {
|
||||||
|
bmi: (this.weight / ((this.height / 100) * (this.height / 100))).toFixed(2),
|
||||||
|
height: this.height,
|
||||||
|
weight: this.weight,
|
||||||
|
// identity: uni.getStorageSync('userinfo').cardNo
|
||||||
|
identity: '370882199909092123',
|
||||||
|
measureTime: this.timetext,
|
||||||
|
}
|
||||||
|
savebmi(data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '保存成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '各项格式为正整数,请重新输入',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
.submit {
|
||||||
|
width: 60%;
|
||||||
|
height: 98rpx;
|
||||||
|
margin: 60rpx auto;
|
||||||
|
background-color: #55d0df;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
border: solid 0rpx #0c0c0c;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 98rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 65rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
top: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// text:nth-child(1) {
|
||||||
|
// margin-left: 50rpx;
|
||||||
|
// }
|
||||||
|
|
||||||
|
text:nth-child(2) {
|
||||||
|
float: right;
|
||||||
|
margin-right: 100rpx;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(4) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(3) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(2) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(1) {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
|
||||||
|
.pressured {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #d34141;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pressureg {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #41d36d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.heart {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #00aaff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
position: absolute;
|
||||||
|
top: 75%;
|
||||||
|
width: 20%;
|
||||||
|
text-align: center;
|
||||||
|
left: 40%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ input {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
border-bottom: 2rpx solid #f0f1f6;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 10%;
|
||||||
|
top: 50%;
|
||||||
|
left: 30%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
247
pagesC/addBloodFat/addBloodFat.vue
Normal file
247
pagesC/addBloodFat/addBloodFat.vue
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app">
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressureg">
|
||||||
|
高密度脂蛋白胆固醇
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="hdl" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressured">
|
||||||
|
低密度脂蛋白胆固醇
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="ldl" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="heart">
|
||||||
|
血清总胆固醇
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="tc" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="heart" style="color:yellowgreen;">
|
||||||
|
甘油三酯
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="tg" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
mmol/L
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<view style="display: flex;align-items: center;">
|
||||||
|
<text style="margin-left: 50rpx">记录时间:</text>
|
||||||
|
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||||
|
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||||
|
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="submit" @tap="submit">
|
||||||
|
保存
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
savebf
|
||||||
|
} from '@/api/examinationapi/add.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
hdl: '',
|
||||||
|
ldl: '',
|
||||||
|
tc: '',
|
||||||
|
tg: '',
|
||||||
|
timetext: this.formatDate(Date.now()),
|
||||||
|
measureTime: this.formatDate(Date.now()),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatDate(timestamp) {
|
||||||
|
const now = new Date(parseInt(timestamp))
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = now.getMonth() + 1;
|
||||||
|
const date = now.getDate();
|
||||||
|
const hour = now.getHours();
|
||||||
|
const minute = now.getMinutes();
|
||||||
|
const second = now.getSeconds();
|
||||||
|
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||||
|
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||||
|
10) ? '0' + second : second);
|
||||||
|
},
|
||||||
|
timeconfirm(time) {
|
||||||
|
this.timetext = time
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if (this.hdl && this.ldl && this.tc && this.tg) {
|
||||||
|
let data = {
|
||||||
|
hdl: this.hdl,
|
||||||
|
ldl: this.ldl,
|
||||||
|
tc: this.tc,
|
||||||
|
tg: this.tg,
|
||||||
|
// identity: uni.getStorageSync('userinfo').cardNo
|
||||||
|
identity: '370882199909092123',
|
||||||
|
measureTime: this.timetext,
|
||||||
|
}
|
||||||
|
savebf(data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '保存成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '各项格式为正整数,请重新输入',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ruls(num) {
|
||||||
|
let reg = /^((?!0)\d{1,9})$/;
|
||||||
|
if (!num.match(reg)) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
.submit {
|
||||||
|
width: 60%;
|
||||||
|
height: 98rpx;
|
||||||
|
margin: 60rpx auto;
|
||||||
|
background-color: #55d0df;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
border: solid 0rpx #0c0c0c;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 98rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 65rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
top: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// text:nth-child(1) {
|
||||||
|
// margin-left: 50rpx;
|
||||||
|
// }
|
||||||
|
|
||||||
|
text:nth-child(2) {
|
||||||
|
float: right;
|
||||||
|
margin-right: 100rpx;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(4) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(3) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(2) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(1) {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
|
||||||
|
.pressured {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #d34141;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pressureg {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #41d36d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.heart {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #00aaff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
position: absolute;
|
||||||
|
top: 75%;
|
||||||
|
width: 20%;
|
||||||
|
text-align: center;
|
||||||
|
left: 40%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ input {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
border-bottom: 2rpx solid #f0f1f6;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 10%;
|
||||||
|
top: 50%;
|
||||||
|
left: 30%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
225
pagesC/addBloodOxygen/addBloodOxygen.vue
Normal file
225
pagesC/addBloodOxygen/addBloodOxygen.vue
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app">
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressureg">
|
||||||
|
脉搏
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="pulse" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
次/分
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressured">
|
||||||
|
血氧
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="spo2" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
%
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<view style="display: flex;align-items: center;">
|
||||||
|
<text style="margin-left: 50rpx">记录时间:</text>
|
||||||
|
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||||
|
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||||
|
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="submit" @tap="submit">
|
||||||
|
保存
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
savebo
|
||||||
|
} from '@/api/examinationapi/add.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
spo2: '',
|
||||||
|
pulse: '',
|
||||||
|
timetext: this.formatDate(Date.now()),
|
||||||
|
measureTime: this.formatDate(Date.now()),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatDate(timestamp) {
|
||||||
|
const now = new Date(parseInt(timestamp))
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = now.getMonth() + 1;
|
||||||
|
const date = now.getDate();
|
||||||
|
const hour = now.getHours();
|
||||||
|
const minute = now.getMinutes();
|
||||||
|
const second = now.getSeconds();
|
||||||
|
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||||
|
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||||
|
10) ? '0' + second : second);
|
||||||
|
},
|
||||||
|
timeconfirm(time) {
|
||||||
|
this.timetext = time
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if (this.spo2 && this.pulse) {
|
||||||
|
let data = {
|
||||||
|
pulse: this.pulse,
|
||||||
|
spo2: this.spo2,
|
||||||
|
// identity: uni.getStorageSync('userinfo').cardNo
|
||||||
|
identity: '370882199909092123',
|
||||||
|
measureTime: this.timetext,
|
||||||
|
}
|
||||||
|
savebo(data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '保存成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '各项格式为正整数,请重新输入',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ruls(num) {
|
||||||
|
let reg = /^((?!0)\d{1,9})$/;
|
||||||
|
if (!num.match(reg)) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
.submit {
|
||||||
|
width: 60%;
|
||||||
|
height: 98rpx;
|
||||||
|
margin: 60rpx auto;
|
||||||
|
background-color: #55d0df;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
border: solid 0rpx #0c0c0c;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 98rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 65rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
top: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// text:nth-child(1) {
|
||||||
|
// margin-left: 50rpx;
|
||||||
|
// }
|
||||||
|
|
||||||
|
text:nth-child(2) {
|
||||||
|
float: right;
|
||||||
|
margin-right: 100rpx;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(4) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(3) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(2) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(1) {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
|
||||||
|
.pressured {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #d34141;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pressureg {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #41d36d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.heart {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #00aaff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
position: absolute;
|
||||||
|
top: 75%;
|
||||||
|
width: 20%;
|
||||||
|
text-align: center;
|
||||||
|
left: 40%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ input {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
border-bottom: 2rpx solid #f0f1f6;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 10%;
|
||||||
|
top: 50%;
|
||||||
|
left: 30%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
215
pagesC/addHeartRate/addHeartRate.vue
Normal file
215
pagesC/addHeartRate/addHeartRate.vue
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
<template>
|
||||||
|
<view class="app">
|
||||||
|
<view class="uptext">
|
||||||
|
<view class="pressureg">
|
||||||
|
心率
|
||||||
|
</view>
|
||||||
|
<input placeholder="请输入数值" border="bottom" v-model="hr" fontSize='50rpx' inputAlign='center'></input>
|
||||||
|
<view class="text">
|
||||||
|
次/分
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<view style="display: flex;align-items: center;">
|
||||||
|
<text style="margin-left: 50rpx">记录时间:</text>
|
||||||
|
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||||
|
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||||
|
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</uni-datetime-picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="submit" @tap="submit">
|
||||||
|
保存
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
savehr
|
||||||
|
} from '@/api/examinationapi/add.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
hr: '',
|
||||||
|
timetext: this.formatDate(Date.now()),
|
||||||
|
measureTime: this.formatDate(Date.now()),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
formatDate(timestamp) {
|
||||||
|
const now = new Date(parseInt(timestamp))
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = now.getMonth() + 1;
|
||||||
|
const date = now.getDate();
|
||||||
|
const hour = now.getHours();
|
||||||
|
const minute = now.getMinutes();
|
||||||
|
const second = now.getSeconds();
|
||||||
|
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||||
|
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||||
|
10) ? '0' + second : second);
|
||||||
|
},
|
||||||
|
timeconfirm(time) {
|
||||||
|
this.timetext = time
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
if (this.hr) {
|
||||||
|
let data = {
|
||||||
|
hr: this.hr,
|
||||||
|
uploadType: 1,
|
||||||
|
// identity: uni.getStorageSync('userinfo').cardNo
|
||||||
|
identity: '370882199909092123',
|
||||||
|
measureTime: this.timetext,
|
||||||
|
}
|
||||||
|
savehr(data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '保存成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '各项格式为正整数,请重新输入',
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ruls(num) {
|
||||||
|
let reg = /^((?!0)\d{1,9})$/;
|
||||||
|
if (!num.match(reg)) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
.submit {
|
||||||
|
width: 60%;
|
||||||
|
height: 98rpx;
|
||||||
|
margin: 60rpx auto;
|
||||||
|
background-color: #55d0df;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
border: solid 0rpx #0c0c0c;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 98rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
margin-top: 100rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 65rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
top: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// text:nth-child(1) {
|
||||||
|
// margin-left: 50rpx;
|
||||||
|
// }
|
||||||
|
|
||||||
|
text:nth-child(2) {
|
||||||
|
float: right;
|
||||||
|
margin-right: 100rpx;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(4) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(3) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(2) {
|
||||||
|
margin-top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(1) {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext {
|
||||||
|
width: 100%;
|
||||||
|
height: 300rpx;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1rpx solid #f0f1f6;
|
||||||
|
|
||||||
|
.pressured {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #d34141;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pressureg {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #41d36d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.heart {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 2rpx;
|
||||||
|
color: #00aaff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
position: absolute;
|
||||||
|
top: 75%;
|
||||||
|
width: 20%;
|
||||||
|
text-align: center;
|
||||||
|
left: 40%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
line-height: 34rpx;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ input {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
border-bottom: 2rpx solid #f0f1f6;
|
||||||
|
position: absolute;
|
||||||
|
width: 40%;
|
||||||
|
height: 10%;
|
||||||
|
top: 50%;
|
||||||
|
left: 30%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<view class="heart">
|
<view class="heart">
|
||||||
心率
|
心率
|
||||||
</view>
|
</view>
|
||||||
<input placeholder="请输入心率值" border="bottom" v-model="hr" fontSize='50rpx' inputAlign='center'></input>
|
<input placeholder="请输入数值" border="bottom" v-model="hr" fontSize='50rpx' inputAlign='center'></input>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
次/分钟
|
次/分钟
|
||||||
</view>
|
</view>
|
||||||
@ -161,7 +161,10 @@
|
|||||||
color: #999999;
|
color: #999999;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.uptext:nth-child(3) {
|
||||||
|
margin-top: 80rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uptext:nth-child(2) {
|
.uptext:nth-child(2) {
|
||||||
|
|||||||
@ -11,9 +11,25 @@
|
|||||||
<blood-pressure :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
<blood-pressure :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||||
v-on:websocket-message="handleWebSocketMessage"></blood-pressure>
|
v-on:websocket-message="handleWebSocketMessage"></blood-pressure>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="tabindex == 2">
|
||||||
|
<BloodFat :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||||
|
v-on:websocket-message="handleWebSocketMessage"></BloodFat>
|
||||||
|
</view>
|
||||||
|
<view v-if="tabindex == 3">
|
||||||
|
<BMI :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||||
|
v-on:websocket-message="handleWebSocketMessage"></BMI>
|
||||||
|
</view>
|
||||||
|
<view v-if="tabindex == 4">
|
||||||
|
<Blood-oxygen :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||||
|
v-on:websocket-message="handleWebSocketMessage"></Blood-oxygen>
|
||||||
|
</view>
|
||||||
|
<view v-if="tabindex == 5">
|
||||||
|
<Heart-rate :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||||
|
v-on:websocket-message="handleWebSocketMessage"></Heart-rate>
|
||||||
|
</view>
|
||||||
<view v-if="tabindex == 6">
|
<view v-if="tabindex == 6">
|
||||||
<Bloodtemperature :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
<Temperature :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||||
v-on:websocket-message="handleWebSocketMessage"></Bloodtemperature>
|
v-on:websocket-message="handleWebSocketMessage"></Temperature>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -25,12 +41,20 @@
|
|||||||
} from '@/api/pagesC/healthdata/index.js'
|
} from '@/api/pagesC/healthdata/index.js'
|
||||||
import BloodPressure from '../../components/BloodPressure/BloodPressure.vue'
|
import BloodPressure from '../../components/BloodPressure/BloodPressure.vue'
|
||||||
import BloodSugar from '../../components/BloodSugar/BloodSugar.vue'
|
import BloodSugar from '../../components/BloodSugar/BloodSugar.vue'
|
||||||
import Bloodtemperature from '../../components/Bloodtemperature/Bloodtemperature.vue'
|
import Temperature from '../../components/Temperature/Temperature.vue'
|
||||||
|
import BloodFat from '../../components/BloodFat/BloodFat.vue'
|
||||||
|
import BMI from '../../components/BMI/BMI.vue'
|
||||||
|
import BloodOxygen from '../../components/BloodOxygen/BloodOxygen.vue'
|
||||||
|
import HeartRate from '../../components/HeartRate/HeartRate.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
BloodPressure,
|
BloodPressure,
|
||||||
BloodSugar,
|
BloodSugar,
|
||||||
Bloodtemperature
|
Temperature,
|
||||||
|
BloodFat,
|
||||||
|
BMI,
|
||||||
|
BloodOxygen,
|
||||||
|
HeartRate
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user