|
@@ -107,13 +107,16 @@
|
107
|
107
|
</div>
|
108
|
108
|
</div>
|
109
|
109
|
</div>
|
110
|
|
- <div class="tableTitle">指标趋势</div>
|
|
110
|
+ <div class="tableTitle">指标趋势
|
|
111
|
+ <span style="font-weight:normal"> (当前患者: {{patient_name}})</span>
|
|
112
|
+ </div>
|
111
|
113
|
<div class="cell clearfix">
|
112
|
114
|
<p class="point"></p>
|
113
|
115
|
<p class="pointTitle">{{itemName}}</p>
|
114
|
116
|
</div>
|
115
|
117
|
<div>
|
116
|
|
- <line-chart :options="chart"></line-chart>
|
|
118
|
+ <line-chart :options="chart" v-if="rangetype == 1"></line-chart>
|
|
119
|
+ <line-chart1 :options="char2" v-if="rangetype == 2"></line-chart1>
|
117
|
120
|
</div>
|
118
|
121
|
</div>
|
119
|
122
|
</el-container>
|
|
@@ -127,16 +130,20 @@ const moment = require('moment')
|
127
|
130
|
import echarts from "echarts";
|
128
|
131
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
129
|
132
|
import LineChart from "../qcd/components/LineChart";
|
|
133
|
+import LineChart1 from '../qcd/components/LineChart1'
|
130
|
134
|
import { uParseTime } from "@/utils/tools";
|
131
|
135
|
import { PostSearch} from '@/api/patient'
|
132
|
136
|
import { getCurrentOrgPatients,GetQualityControl,getNormData,getPatientComplianceDetail } from "@/api/common/common"
|
133
|
137
|
export default {
|
134
|
138
|
components: {
|
135
|
139
|
LineChart,
|
136
|
|
- BreadCrumb
|
|
140
|
+ BreadCrumb,
|
|
141
|
+ LineChart1
|
137
|
142
|
},
|
138
|
143
|
data() {
|
139
|
144
|
return {
|
|
145
|
+ patient_name:"",
|
|
146
|
+ rangetype:1,
|
140
|
147
|
itemName:"",
|
141
|
148
|
isTrue:0,
|
142
|
149
|
crumbs: [
|
|
@@ -174,6 +181,126 @@ export default {
|
174
|
181
|
monthType: 0,
|
175
|
182
|
arr: [],
|
176
|
183
|
quality: 0,
|
|
184
|
+ char2: {
|
|
185
|
+ title: {
|
|
186
|
+ text: 'ECharts 入门示例'
|
|
187
|
+ },
|
|
188
|
+ tooltip: {},
|
|
189
|
+ legend: {
|
|
190
|
+ data: ['次数'],
|
|
191
|
+ left: 0
|
|
192
|
+ },
|
|
193
|
+ xAxis: {
|
|
194
|
+ data: [],
|
|
195
|
+ axisLine: {
|
|
196
|
+ lineStyle: {
|
|
197
|
+ color: '#FF0000',
|
|
198
|
+ width: 8 //这里是为了突出显示加上的
|
|
199
|
+ }
|
|
200
|
+ },
|
|
201
|
+ axisLabel: {
|
|
202
|
+ interval: 0,
|
|
203
|
+ formatter: function(value) {
|
|
204
|
+ var ret = '' //拼接加\n返回的类目项
|
|
205
|
+ var maxLength = 8 //每项显示文字个数
|
|
206
|
+ var valLength = value.length //X轴类目项的文字个数
|
|
207
|
+ var rowN = Math.ceil(valLength / maxLength) //类目项需要换行的行数
|
|
208
|
+ if (rowN > 1) {
|
|
209
|
+ //如果类目项的文字大于3,
|
|
210
|
+ for (var i = 0; i < rowN; i++) {
|
|
211
|
+ var temp = '' //每次截取的字符串
|
|
212
|
+ var start = i * maxLength //开始截取的位置
|
|
213
|
+ var end = start + maxLength //结束截取的位置
|
|
214
|
+ //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
|
|
215
|
+ temp = value.substring(start, end) + '\n'
|
|
216
|
+ ret += temp //凭借最终的字符串
|
|
217
|
+ }
|
|
218
|
+ return ret
|
|
219
|
+ } else {
|
|
220
|
+ return value
|
|
221
|
+ }
|
|
222
|
+ }
|
|
223
|
+ }
|
|
224
|
+ },
|
|
225
|
+ yAxis: {
|
|
226
|
+ axisLabel: {
|
|
227
|
+ formatter: '{value} %'
|
|
228
|
+ },
|
|
229
|
+ show: false,
|
|
230
|
+ axisLine: {
|
|
231
|
+ lineStyle: {
|
|
232
|
+ color: '#00FF00',
|
|
233
|
+ width: 8 //这里是为了突出显示加上的
|
|
234
|
+ }
|
|
235
|
+ }
|
|
236
|
+ },
|
|
237
|
+ series: [
|
|
238
|
+ {
|
|
239
|
+ name: '',
|
|
240
|
+ type: 'line',
|
|
241
|
+ data: [],
|
|
242
|
+ symbol: 'circle',//折线点设置为实心点
|
|
243
|
+ symbolSize: 15, //折线点的大小
|
|
244
|
+ barWidth: 30,
|
|
245
|
+ label: {
|
|
246
|
+ normal: {
|
|
247
|
+ show: true,
|
|
248
|
+ position: "top",
|
|
249
|
+ formatter: (params) => {
|
|
250
|
+ let str = ''
|
|
251
|
+ str = this.otherData[params.dataIndex]
|
|
252
|
+ return str
|
|
253
|
+
|
|
254
|
+ }
|
|
255
|
+ }
|
|
256
|
+ },
|
|
257
|
+ //配置样式
|
|
258
|
+ itemStyle: {
|
|
259
|
+ //通常情况下:
|
|
260
|
+
|
|
261
|
+ //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
|
|
262
|
+ normal: {
|
|
263
|
+ color: (params) => {
|
|
264
|
+ //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
|
|
265
|
+ var colorList = [
|
|
266
|
+ ['#409EFF','#409EFF'],
|
|
267
|
+ ['#f56c6c','#f56c6c']
|
|
268
|
+ ];
|
|
269
|
+ if(params.seriesName == this.otherData[params.dataIndex]){
|
|
270
|
+ var index = 0
|
|
271
|
+ }else {
|
|
272
|
+ var index = 1
|
|
273
|
+ }
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+ // var index = params.dataIndex;
|
|
277
|
+ // if (params.dataIndex >= colorList.length) {
|
|
278
|
+ // index = params.dataIndex % colorList.length;
|
|
279
|
+ // }
|
|
280
|
+
|
|
281
|
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
282
|
+ {offset: 0, color: colorList[index][0]},
|
|
283
|
+ // { offset: 0.5, color: colorList[index][1] },
|
|
284
|
+ {offset: 1, color: colorList[index][1]}
|
|
285
|
+ ]);
|
|
286
|
+ },
|
|
287
|
+ lineStyle: {
|
|
288
|
+ width:2,
|
|
289
|
+ color: "#cccccc"//折线的颜色
|
|
290
|
+ },
|
|
291
|
+ barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
|
|
292
|
+ },
|
|
293
|
+
|
|
294
|
+ //鼠标悬停时:
|
|
295
|
+ emphasis: {
|
|
296
|
+ shadowBlur: 10,
|
|
297
|
+ shadowOffsetX: 0,
|
|
298
|
+ shadowColor: 'rgba(0, 0, 0, 0.2)'
|
|
299
|
+ }
|
|
300
|
+ }
|
|
301
|
+ }
|
|
302
|
+ ]
|
|
303
|
+ },
|
177
|
304
|
chart: {
|
178
|
305
|
title: {
|
179
|
306
|
text: "ECharts 入门示例"
|
|
@@ -255,6 +382,7 @@ export default {
|
255
|
382
|
},
|
256
|
383
|
inspect_date:0,
|
257
|
384
|
monthActive:0,
|
|
385
|
+ otherData:[]
|
258
|
386
|
};
|
259
|
387
|
},
|
260
|
388
|
methods: {
|
|
@@ -383,6 +511,7 @@ export default {
|
383
|
511
|
},
|
384
|
512
|
handleChange(val){
|
385
|
513
|
this.patientid = val.id
|
|
514
|
+ this.patient_name = val.name
|
386
|
515
|
this.getlistDetail()
|
387
|
516
|
},
|
388
|
517
|
getCurrentOrgPatients(){
|
|
@@ -392,6 +521,7 @@ export default {
|
392
|
521
|
for(let i=0;i<patients.length;i++){
|
393
|
522
|
if(this.patientid == patients[i].id){
|
394
|
523
|
this.$refs.singleTable.setCurrentRow(patients[i])
|
|
524
|
+ this.patient_name = patients[i].name
|
395
|
525
|
}
|
396
|
526
|
}
|
397
|
527
|
this.patientsData = patients
|
|
@@ -413,6 +543,8 @@ export default {
|
413
|
543
|
getlist(){
|
414
|
544
|
this.modesData.series = []
|
415
|
545
|
this.modesData.xAxis = []
|
|
546
|
+ this.char2.xAxis.data = []
|
|
547
|
+ this.char2.series[0].data = []
|
416
|
548
|
const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
|
417
|
549
|
const endDate = moment(new Date()).format('YYYY-MM-DD')
|
418
|
550
|
var now = new Date()
|
|
@@ -435,7 +567,7 @@ export default {
|
435
|
567
|
GetQualityControl(params).then(response=>{
|
436
|
568
|
if(response.data.state == 1){
|
437
|
569
|
var list = response.data.data.list
|
438
|
|
- console.log("list",list)
|
|
570
|
+ console.log("list是什么",list)
|
439
|
571
|
for(let i=0;i<list.length;i++){
|
440
|
572
|
if(parseInt(list[i].inspect_value)>= parseInt(list[i].range_min) && parseInt(list[i].inspect_value)<= parseInt(list[i].range_max)){
|
441
|
573
|
this.isTrue = 1
|
|
@@ -443,9 +575,20 @@ export default {
|
443
|
575
|
if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
|
444
|
576
|
this.isTrue =0
|
445
|
577
|
}
|
446
|
|
- this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
|
447
|
|
- this.modesData.series.push(list[i].inspect_value)
|
448
|
|
-
|
|
578
|
+
|
|
579
|
+ if(list[i].range_type == 1){
|
|
580
|
+ this.rangetype = 1
|
|
581
|
+ this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
|
|
582
|
+ this.modesData.series.push(list[i].inspect_value)
|
|
583
|
+ }
|
|
584
|
+
|
|
585
|
+ if(list[i].range_type == 2){
|
|
586
|
+ this.rangetype = 2
|
|
587
|
+ this.otherData.push(list[i].inspect_value)
|
|
588
|
+ this.char2.series[0].data.push("1")
|
|
589
|
+ this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
|
|
590
|
+ this.char2.series[0].name = list[i].range_value
|
|
591
|
+ }
|
449
|
592
|
}
|
450
|
593
|
this.chart.series[0].data = this.modesData.series
|
451
|
594
|
this.chart.xAxis.data = this.modesData.xAxis
|
|
@@ -458,6 +601,8 @@ export default {
|
458
|
601
|
getlistDetail(){
|
459
|
602
|
this.modesData.series = []
|
460
|
603
|
this.modesData.xAxis = []
|
|
604
|
+ this.char2.xAxis.data = []
|
|
605
|
+ this.char2.series[0].data = []
|
461
|
606
|
const startDate = moment().subtract('month', 0).format('YYYY-MM') + '-01'
|
462
|
607
|
const endDate = moment(new Date()).format('YYYY-MM-DD')
|
463
|
608
|
|
|
@@ -490,8 +635,21 @@ export default {
|
490
|
635
|
if(parseInt(list[i].inspect_value)< parseInt(list[i].range_min) || parseInt(list[i].inspect_value) > parseInt(list[i].range_max)){
|
491
|
636
|
this.isTrue =0
|
492
|
637
|
}
|
493
|
|
- this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
|
494
|
|
- this.modesData.series.push(list[i].inspect_value)
|
|
638
|
+
|
|
639
|
+ if(list[i].range_type == 1){
|
|
640
|
+ this.rangetype = 1
|
|
641
|
+ this.modesData.xAxis.push(this.getTime(list[i].inspect_date));
|
|
642
|
+ this.modesData.series.push(list[i].inspect_value)
|
|
643
|
+ }
|
|
644
|
+
|
|
645
|
+ if(list[i].range_type == 2){
|
|
646
|
+ this.rangetype = 2
|
|
647
|
+ this.otherData.push(list[i].inspect_value)
|
|
648
|
+ this.char2.series[0].data.push("1")
|
|
649
|
+ this.char2.xAxis.data.push(this.getTime(list[i].inspect_date))
|
|
650
|
+ this.char2.series[0].name = list[i].range_value
|
|
651
|
+ }
|
|
652
|
+
|
495
|
653
|
|
496
|
654
|
}
|
497
|
655
|
this.chart.series[0].data = this.modesData.series
|
|
@@ -519,6 +677,11 @@ export default {
|
519
|
677
|
console.log("val",val)
|
520
|
678
|
this.listQuery.search = val.name
|
521
|
679
|
this.patientid = val.id
|
|
680
|
+ for(let i=0;i<this.patientsData.length;i++){
|
|
681
|
+ if(val.id == this.patientsData[i].id){
|
|
682
|
+ this.$refs.singleTable.setCurrentRow(this.patientsData[i])
|
|
683
|
+ }
|
|
684
|
+ }
|
522
|
685
|
this.getlistDetail()
|
523
|
686
|
},
|
524
|
687
|
},
|