This commit is contained in:
2024-03-08 09:38:07 +08:00
parent c9bd446b07
commit 68af7c7ffd
2 changed files with 193 additions and 36 deletions

View File

@ -9,67 +9,200 @@
</div>
</div>
<div class="rightheader">
<div class="time">
<el-date-picker v-model="measureTime" type="daterange" range-separator="" start-placeholder="开始日期"
:clearable="false" value-format="yyyy-MM-dd" :picker-options="pickerOptions" end-placeholder="结束日期">
</el-date-picker>
</div>
<div id="main"></div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import {
curveStatistics
} from '@/api/manage/indicatorMonitoring'
export default {
name: "indicatorMonitoring",
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now(); //
},
},
measureTime: [],
//
categoryindex: 0,
//item
categoryItem: {},
categoryindex: undefined,
//list
categorylist: [{
id: 1,
title: '冠状动脉粥样硬化性心脏病',
title: '运动检测',
groupCode: 'sport'
}, {
id: 2,
title: '冠状动脉粥样硬化性心脏病冠状动脉粥样硬化性心脏病',
}]
title: '血压测量',
groupCode: 'bp'
}, {
id: 3,
title: '血糖测量',
groupCode: 'bg'
}],
query: {}
};
},
created() {
this.categoryItem = this.categorylist[0]
},
mounted() {
this.info();
this.categoryindex = 0
this.query.groupCode = this.categorylist[0].groupCode
this.query.patientId = this.$route.query.patientId
this.query.title = '运动检测'
this.getinfo();
},
watch: {
'measureTime': {
handler(newValue, oldValue) {
this.query.measureTimeStart = newValue[0]
this.query.measureTimeEnd = newValue[1]
this.getinfo();
},
deep: true,
},
},
methods: {
clickcategory(item, index) {
this.categoryindex = index
this.categoryItem = item
this.query.groupCode = item.groupCode
this.query.title = item.title
this.query.patientId = this.$route.query.patientId
this.getinfo();
},
info() {
getinfo() {
curveStatistics(this.query).then(res => {
this.info(res.data);
})
},
info(row) {
// domecharts
var myChart = echarts.init(document.getElementById('main'));
//
myChart.setOption({
title: {
text: '运动监测'
},
tooltip: {},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子', '衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20, 5, 20, 36, 10, 10, 20]
}
]
});
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
if (this.query.title == '运动检测') {
option = {
title: {
text: this.query.title
},
tooltip: {
trigger: 'axis'
},
legend: {
},
grid: {
left: '3%',
right: '4%',
bottom: '0%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: row.xlist
},
yAxis: {
type: 'value'
},
series: [
{
name: '运动时长',
type: 'line',
data: row.ylist.运动时长
},
{
name: '平均心率',
type: 'line',
data: row.ylist.平均心率
}
]
};
} else if (this.query.title == '血压测量') {
option = {
title: {
text: this.query.title
},
tooltip: {
trigger: 'axis'
},
legend: {
},
grid: {
left: '3%',
right: '4%',
bottom: '0%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: row.xlist
},
yAxis: {
type: 'value'
},
series: [
{
name: '收缩压',
type: 'line',
data: row.ylist.收缩压
},
{
name: '舒张压',
type: 'line',
data: row.ylist.舒张压
}
]
};
} else if (this.query.title == '血糖测量') {
option = {
title: {
text: this.query.title
},
tooltip: {
trigger: 'axis'
},
legend: {
},
grid: {
left: '3%',
right: '4%',
bottom: '0%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: row.xlist
},
yAxis: {
type: 'value'
},
series: [
{
name: '空腹血糖',
type: 'line',
data: row.ylist.收缩压
}
]
};
}
option && myChart.setOption(option);
},
}
};
</script>
<style lang="scss" scoped>
.header {
background-color: #fff !important;
@ -80,11 +213,18 @@ export default {
width: 75%;
padding-top: 20px;
border-left: 3px solid #DFE4ED;
position: relative;
.time {
position: absolute;
right: 50px;
top: 30px;
}
#main {
width: 1000px;
height: 450px;
margin: 0 auto;
margin: 80px auto;
}
}
@ -115,5 +255,4 @@ export default {
}
}
}
</style>
</style>

View File

@ -40,9 +40,9 @@
<el-table-column label="问卷模板ID" align="center" prop="questionnaireId" />
<el-table-column label="问卷状态" align="center" prop="questionnaireStatus">
<template slot-scope="scope">
<!-- active-text="已发布" inactive-text="未发布" -->
<el-switch v-model="scope.row.questionnaireStatus" active-color="#13ce66" inactive-color="#ff4949"
active-value="PUBLISHED" inactive-value="UNPUBLISHED" active-text="已发布" inactive-text="未发布"
@change="switchstatus($event, scope.row)">
active-value="PUBLISHED" inactive-value="UNPUBLISHED" @change="switchstatus($event, scope.row)">
</el-switch>
</template>
</el-table-column>
@ -181,6 +181,8 @@ export default {
},
cleardepartment() {
this.classificationform.diseaseTypeId = ''
this.classificationform.departmentName = ''
this.classificationform.diseaseTypeName = ''
},
changedepartment(e) {
this.classificationform.departmentName = this.departmentlist.find(el => el.id == e).departmentName
@ -196,7 +198,23 @@ export default {
},
//
switchstatus(e, item) {
if (!item.departmentId && !this.diseaseTypeId) {
this.$message.error('请选择问卷所属的科室以及科室病种后发布!');
this.getList();
return
}
let query = {
id: item.id,
questionnaireStatus: e
}
updateclassification(query).then(res => {
if (e == 'PUBLISHED') {
this.$modal.msgSuccess("修改为已发布");
} else if (e == 'UNPUBLISHED') {
this.$modal.msgSuccess("修改为未发布");
}
})
this.getList();
},
//
handleNodeClick(data) {