部分图表信息调整
This commit is contained in:
parent
c28845807f
commit
33097ae437
|
|
@ -5,21 +5,23 @@ import { baseUrl } from "./api.js";
|
|||
|
||||
const HOST = location && location.origin
|
||||
export default () => {
|
||||
let envRead = process.env
|
||||
let readBaseUrl = process.env.bcUrl
|
||||
console.log(readBaseUrl)
|
||||
// 初始化请求配置
|
||||
uni.$u.http.setConfig((config) => {
|
||||
// if(envRead.NODE_ENV == 'product'){
|
||||
config.baseURL = baseUrl; // 测试地址
|
||||
// }
|
||||
console.log(config,'11111111')
|
||||
if(readBaseUrl ){
|
||||
config.baseURL = readBaseUrl; // 测试地址
|
||||
}
|
||||
return config
|
||||
});
|
||||
|
||||
|
||||
// 请求拦截
|
||||
uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
|
||||
if(!config.baseURL){
|
||||
config.url = '/'+config.url
|
||||
}
|
||||
config.data = config.data || {};
|
||||
console.log(config,'22222222')
|
||||
// config.baseURL = 'http://test.sc2.agrimedia.cn'; // 不使用请求代理 上线记得注释掉 ***********************************************************
|
||||
|
||||
let apiToken = store.getters['api/getApiToken']
|
||||
|
|
|
|||
22
package.json
22
package.json
|
|
@ -2,5 +2,27 @@
|
|||
"dependencies": {
|
||||
"uview-ui": "^2.0.36",
|
||||
"vuex-persistedstate": "^4.1.0"
|
||||
},
|
||||
"uni-app": {
|
||||
"scripts": {
|
||||
"build:test": {
|
||||
"title": "build:test",
|
||||
"env": {
|
||||
"UNI_PLATFORM": "h5",
|
||||
"H_NODE_ENV": "development",
|
||||
"bcUrl": ""
|
||||
}
|
||||
},
|
||||
"build:pro": {
|
||||
"title": "build:pro",
|
||||
"env": {
|
||||
"UNI_PLATFORM": "h5",
|
||||
"H_NODE_ENV": "production",
|
||||
"bcUrl": "https://ai.agirmedia.cn"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,6 +273,29 @@ import { mapGetters } from "vuex";
|
|||
}
|
||||
},
|
||||
option:{
|
||||
// tooltip: {
|
||||
// trigger: 'item',
|
||||
// formatter: function (params) {
|
||||
// // params 是数据的相关信息,可以根据需要进行处理
|
||||
// console.log(params)
|
||||
// if(params.componentType == 'series'){
|
||||
// return `<html><div style="width:10px">
|
||||
// <p>${params.seriesName}</p>
|
||||
// <p>${params.name}: ${params.value[1]}</p>
|
||||
// </div></html>`
|
||||
// }
|
||||
// return '';
|
||||
// },
|
||||
// // renderMode:'html'
|
||||
// // axisPointer: {
|
||||
// // type: 'line',
|
||||
// // label: {
|
||||
// // backgroundColor: '#6a7985'
|
||||
// // }
|
||||
// // },
|
||||
|
||||
|
||||
// },
|
||||
xAxis: {
|
||||
splitLine:{
|
||||
show:false
|
||||
|
|
@ -533,34 +556,34 @@ import { mapGetters } from "vuex";
|
|||
case 'bloodOxygen':
|
||||
data.map((v,i) => {
|
||||
let timeArr = v.hour_minute.split(':');
|
||||
let dataMsg = this.getAverage(v.data_msg);
|
||||
let dataMsg = v.data_msg.filter(item => item > 0);
|
||||
if(timeArr[1] % 10 == 0){
|
||||
let key = v.hour_minute
|
||||
if(dataArr[key] == undefined){
|
||||
dataArr[key] = {
|
||||
val:v.data_msg.filter(item => item > 0),
|
||||
val:dataMsg,
|
||||
from:0
|
||||
}
|
||||
}else{
|
||||
dataArr[key].val = [...dataArr[key].val,...v.data_msg.filter(item => item > 0)];
|
||||
dataArr[key].val = [...dataArr[key].val,...dataMsg];
|
||||
}
|
||||
}else{
|
||||
|
||||
let key = timeArr[0]+':'+((timeArr[1] - 5) == 0?'00':(timeArr[1] - 5))
|
||||
if(dataArr[key] == undefined){
|
||||
dataArr[key] = {
|
||||
val:v.data_msg.filter(item => item > 0),
|
||||
val:dataMsg,
|
||||
from:1
|
||||
}
|
||||
}else{
|
||||
dataArr[key].val = [...dataArr[key].val,...v.data_msg.filter(item => item > 0)];
|
||||
dataArr[key].val = [...dataArr[key].val,...dataMsg];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
sum += dataMsg
|
||||
v.data_msg.map((v2,i2) => {
|
||||
|
||||
dataMsg.map((v2,i2) => {
|
||||
if(v2 > 0){
|
||||
arr.push(v2)
|
||||
}
|
||||
|
|
@ -581,21 +604,25 @@ import { mapGetters } from "vuex";
|
|||
max = Math.max(...arr)
|
||||
}
|
||||
|
||||
avg = sum / data.length
|
||||
avg = parseFloat(avg.toFixed(0))
|
||||
|
||||
this.option.series[0].data = echartsData
|
||||
this.option.series[0].markLine.data[0].yAxis = avg
|
||||
this.option.series[0].markLine.data[0].value = avg
|
||||
this.option.yAxis.axisLabel.formatter = '{value}%';
|
||||
this.option.series[0].markLine.data[0].yAxis = this.getAverage(arr)
|
||||
this.option.series[0].markLine.data[0].value = this.getAverage(arr)
|
||||
this.option.series[0].markLine.symbol = 'none'
|
||||
// this.option.series[0].markLine.data[0].type = 'average'
|
||||
// this.option.series[0].markLine.data[0].name = '平均值'
|
||||
this.option.series[0].markLine.lineStyle.color = this.dataConfig[this.type].color
|
||||
this.option.series[0].markLine.label.color = this.dataConfig[this.type].color
|
||||
this.option.series[0].markLine.label.position ='insideEndTop'
|
||||
this.option.series[0].markLine.label.formatter = function(data){
|
||||
return data.value + '%'
|
||||
// console.log(data,123)
|
||||
};
|
||||
// this.option.series[0].markLine.label.distance =[10,5]
|
||||
this.option.title = {
|
||||
text :min + '-' + max,
|
||||
subtext: '毫摩尔/升',
|
||||
subtext: '%',
|
||||
left: 'center'
|
||||
};
|
||||
this.option.yAxis.splitNumber = 2;
|
||||
|
|
@ -717,11 +744,12 @@ import { mapGetters } from "vuex";
|
|||
}
|
||||
}else{
|
||||
dataArr[key].val = [...dataArr[key].val,v.data_msg.bloodPressureHigh];
|
||||
dataArr[key].val = [...dataArr[key].val,v.data_msg.bloodPressureLow];
|
||||
dataArr[key].val2 = [...dataArr[key].val2,v.data_msg.bloodPressureLow];
|
||||
}
|
||||
// let floatData = this.makeFloatHoursMinutes(timeArr[0],timeArr[1])
|
||||
// echartsData.push({value:[floatData,v.data_msg],itemStyle: {color: this.dataConfig[this.type].color}})
|
||||
sum += v.data_msg.bloodPressureHigh
|
||||
console.log(v.data_msg.bloodPressureHigh)
|
||||
sum2 += v.data_msg.bloodPressureLow
|
||||
|
||||
if(max == 0 || max < v.data_msg.bloodPressureHigh){
|
||||
|
|
@ -737,11 +765,14 @@ import { mapGetters } from "vuex";
|
|||
min2 = v.data_msg.bloodPressureLow
|
||||
}
|
||||
})
|
||||
|
||||
avg = sum / data.length
|
||||
let avg2 = sum2 / data.length
|
||||
avg = parseFloat(avg.toFixed(2))
|
||||
avg2 = parseFloat(avg2.toFixed(2))
|
||||
avg = parseInt(avg)
|
||||
avg2 = parseInt(avg2)
|
||||
// console.log(avg,'ag')
|
||||
// console.log(avg2,'ag2')
|
||||
console.log(dataArr)
|
||||
|
||||
for (let key in dataArr) {
|
||||
if (dataArr.hasOwnProperty(key)) { // 确保key是对象自身的属性
|
||||
let timeArr2 = key.split(':');
|
||||
|
|
@ -770,6 +801,8 @@ import { mapGetters } from "vuex";
|
|||
left: 'center'
|
||||
};
|
||||
this.dataConfig.bloodGlucose.title = min + '-' + max
|
||||
// this.option.yAxis.min = parseInt(min2) - 5;
|
||||
// this.option.yAxis.max = parseInt(max) + 5;
|
||||
break;
|
||||
|
||||
case 'pulseReat':
|
||||
|
|
@ -826,7 +859,7 @@ import { mapGetters } from "vuex";
|
|||
|
||||
})
|
||||
avg = sum / len
|
||||
avg = parseFloat(avg.toFixed(2))
|
||||
avg = parseInt(avg)
|
||||
for (let key in dataArr) {
|
||||
if (dataArr.hasOwnProperty(key)) { // 确保key是对象自身的属性
|
||||
let timeArr2 = key.split(':');
|
||||
|
|
@ -899,12 +932,15 @@ import { mapGetters } from "vuex";
|
|||
}
|
||||
|
||||
this.option.series[0].data = echartsData
|
||||
//top / left / right / bottom / inside / insideLeft / insideRight / insideTop / insideBottom / insideTopLeft / insideBottomLeft / insideTopRight / insideBottomRight
|
||||
this.option.series[0].markLine.label.position ='insideEndTop'
|
||||
this.option.series[0].markLine.data[0].yAxis = avg
|
||||
this.option.series[0].markLine.lineStyle.color = this.dataConfig[this.type].color
|
||||
this.option.series[0].markLine.label.color = this.dataConfig[this.type].color
|
||||
this.option.series[0].type = 'line'
|
||||
this.option.series[0].symbol = 'none',
|
||||
this.option.series[0].smooth = true
|
||||
|
||||
this.option.series[0].itemStyle= {
|
||||
color: 'rgb(255, 70, 131)'
|
||||
}
|
||||
|
|
@ -932,6 +968,7 @@ import { mapGetters } from "vuex";
|
|||
}
|
||||
};
|
||||
this.dataConfig.bloodGlucose.title = min + '-' + max
|
||||
|
||||
this.option.yAxis.axisLabel.formatter = function(v,i){
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>智能终端</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/watchapp/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/watchapp/static/js/chunk-vendors.a54e2e08.js></script><script src=/watchapp/static/js/index.6da062bd.js></script></body></html>
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/watchapp/static/index.2da1efab.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/watchapp/static/js/chunk-vendors.a54e2e08.js></script><script src=/watchapp/static/js/index.9e9c7848.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue