zhangyanpeng
2024-05-29 1f227a1cf627526701c652ba84bae3e430bba8d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
<!DOCTYPE html>
<html>
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>各区域医院植入表现</title>
    </head>
 
    <body>
        <script type="text/javascript">
            var pageVue = null;
            function loadJsCss(callback) {
                var jscss_urls = [
                    {id: "js6", type: "js", url: "root/js/echarts.js"},
                    {id: "js7", type: "js", url: "root/js/calendar.js"},
                    {id: "js8", type: "js", url: "root/js/China.js"},
                ];
                window.top.initJsCss(document, jscss_urls, callback);
            }
        
            function initVue() {
                new BasicsVue({
                    el: "#hbody",
                    data: {
                        dataRequest: [
                            {
                                name: "pfo_region",
                                url: "root/chart/regionImplantShowPFO",
                                paramsobj: {year: "2023"},
                                isnotoption: true, //true:不是选项
                            },
                        ],
                        dataRequestObj: {},
 
                        //Hospital-east
                        options_hospital: [],
                        value_hospital: '',
                        hospital: "",
 
                        //Line
                        options_line: [],
                        value_line: '',
                        line: "",
 
                        dataCharts: {
                            north: [
                                ["month", "FY23 Act", "FY23 Aop", "Achi% Act"],
                                ["Jan", 20, 30, 30/20*100],
                                ["Feb", 33, 45, 45/33*100],
                                ["Mar", 13, 22, 22/13*100],
                                ["Apri", 22, 11, 11/22*100],
                                ["May", 78, 22, 22/78*100],
                                ["Jun", 34, 55, 55/34*100],
                                ["Jul", 42, 32, 32/42*100],
                                ["Aug", 53, 33, 33/33*100],
                                ["Sep", 45, 34, 34/45*100],
                                ["Oct", 54, 43, 43/54*100],
                                ["Nov", 0, 29, 0],
                                ["Dec", 0, 35, 0],
                            ],
                            east: [
                                ["month", "FY23 Act", "FY23 Aop", "Achi% Act"],
                                ["Jan", 20, 30, 30/20*100],
                                ["Feb", 33, 45, 45/33*100],
                                ["Mar", 13, 22, 22/13*100],
                                ["Apri", 22, 11, 11/22*100],
                                ["May", 78, 22, 22/78*100],
                                ["Jun", 34, 55, 55/34*100],
                                ["Jul", 42, 32, 32/42*100],
                                ["Aug", 53, 33, 33/33*100],
                                ["Sep", 45, 34, 34/45*100],
                                ["Oct", 54, 43, 43/54*100],
                                ["Nov", 0, 29, 0],
                                ["Dec", 0, 35, 0],
                            ],
                            middle: [
                                ["month", "FY23 Act", "FY23 Aop", "Achi% Act"],
                                ["Jan", 20, 30, 30/20*100],
                                ["Feb", 33, 45, 45/33*100],
                                ["Mar", 13, 22, 22/13*100],
                                ["Apri", 22, 11, 11/22*100],
                                ["May", 78, 22, 22/78*100],
                                ["Jun", 34, 55, 55/34*100],
                                ["Jul", 42, 32, 32/42*100],
                                ["Aug", 53, 33, 33/33*100],
                                ["Sep", 45, 34, 34/45*100],
                                ["Oct", 54, 43, 43/54*100],
                                ["Nov", 0, 29, 0],
                                ["Dec", 0, 35, 0],
                            ],
                            west: [
                                ["month", "FY23 Act", "FY23 Aop", "Achi% Act"],
                                ["Jan", 20, 30, 30/20*100],
                                ["Feb", 33, 45, 45/33*100],
                                ["Mar", 13, 22, 22/13*100],
                                ["Apri", 22, 11, 11/22*100],
                                ["May", 78, 22, 22/78*100],
                                ["Jun", 34, 55, 55/34*100],
                                ["Jul", 42, 32, 32/42*100],
                                ["Aug", 53, 33, 33/33*100],
                                ["Sep", 45, 34, 34/45*100],
                                ["Oct", 54, 43, 43/54*100],
                                ["Nov", 0, 29, 0],
                                ["Dec", 0, 35, 0],
                            ],
                            south: [
                                ["month", "FY23 Act", "FY23 Aop", "Achi% Act"],
                                ["Jan", 20, 30, 30/20*100],
                                ["Feb", 33, 45, 45/33*100],
                                ["Mar", 13, 22, 22/13*100],
                                ["Apri", 22, 11, 11/22*100],
                                ["May", 78, 22, 22/78*100],
                                ["Jun", 34, 55, 55/34*100],
                                ["Jul", 42, 32, 32/42*100],
                                ["Aug", 53, 33, 33/33*100],
                                ["Sep", 45, 34, 34/45*100],
                                ["Oct", 54, 43, 43/54*100],
                                ["Nov", 0, 29, 0],
                                ["Dec", 0, 35, 0],
                            ],
                        },
                    },
 
                    created() {
                        var me = this;
 
                    },
                
                    mounted() {
                        var me = this;
                        //预加载数据
                        if (this.dataRequest && this.dataRequest.length) {
                            var result = {};
                            this.loadRequestData(this.dataRequest, result, function(data) {
                                me.dataRequestObj = data;
                                console.log(me.dataRequestObj);
                                if (me.dataRequestObj.pfo_region) {
                                    if (me.dataRequestObj.pfo_region.data && me.dataRequestObj.pfo_region.data.pforegion) {
                                        me.dataCharts = clone(me.dataRequestObj.pfo_region.data.pforegion);
                                        for (var c in me.dataCharts) {
                                            let title = ["month", "FY23 Act", "FY23 Aop", "Achi% Act"];
                                            me.dataCharts[c].splice(0, 0, title);
                                        }                                    
                                    }
                                    console.log(me.dataCharts);
 
                                    me.$nextTick(() => {
                                        hideLoading();
                                        let clientHeight = document.documentElement.clientHeight;
                                        me.initData();
                                    })
                                }
                            });
                        } else {
                            me.$nextTick(() => {
                                hideLoading();
                                let clientHeight = document.documentElement.clientHeight;
                                me.initData();
                            })
                        }
                    },
 
                    methods: {
                        initData() {
                            var me = this;
 
                            me.chart1();
                            me.chart2();
                            me.chart3();
                            me.chart4();
                            me.chart5();
                        },
 
                        filter() {
                            var me = this;
                            console.log("filter hospital", me.value_hospital);
                        },
 
                        //PFO各区域医院植入表现-北区
                        chart1() {
                            var d1 = document.getElementById("ct1");
                            var c1 = echarts.init(d1);
                            var o1 = {
                                title: {
                                    text: "北区",
                                },
                                tooltip: {
                                    trigger: "axis",
                                    axisPointer: {
                                        type: "cross",
                                        crossStyle: {
                                            color: "#999",
                                        },
                                    },
                                    formatter: function () {
                                        let str = '';
                                        arguments[0].forEach((item, idx) => {
                                            switch (idx){
                                                case 0:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[1]}`;
                                                    break;
                                                case 1:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[2]}`;
                                                    break;
                                                case 2:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[3]}%`;
                                                    break;
                                                default:
                                                    str += 'w(゚Д゚)w'
                                            }
                                            str += idx === arguments[0].length -1? '': '<br/>'
                                        })
                                        return str;
                                    }
                                },
                                dataset: {
                                    source: this.dataCharts.north,
                                },
                                legend: {
                                    bottom: "bottom",
                                },
                                xAxis: [
                                    {
                                        type: "category",
                                        axisPointer: {
                                            type: "shadow",
                                        },
                                    },
                                ],
                                yAxis: [
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                ],
                                series: [
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "line",
                                        yAxisIndex: 1,
                                        itemStyle: { 
                                            normal: { 
                                                label: { 
                                                    show: true,
                                                    formatter:function(params){
                                                        return Math.round(params.value[3]*1) + "%";
                                                    }
                                                } 
                                            } 
                                        },
                                    },
                                ],
                            };
                            c1.setOption(o1);
                        },
 
                        //PFO各区域医院植入表现-东区
                        chart2() {
                            var d2 = document.getElementById("ct2");
                            var c2 = echarts.init(d2);
                            var o2 = {
                                title: {
                                    text: "东区",
                                },
                                tooltip: {
                                    trigger: "axis",
                                    axisPointer: {
                                        type: "cross",
                                        crossStyle: {
                                            color: "#999",
                                        },
                                    },
                                    formatter: function () {
                                        let str = '';
                                        arguments[0].forEach((item, idx) => {
                                            switch (idx){
                                                case 0:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[1]}`;
                                                    break;
                                                case 1:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[2]}`;
                                                    break;
                                                case 2:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[3]}%`;
                                                    break;
                                                default:
                                                    str += 'w(゚Д゚)w'
                                            }
                                            str += idx === arguments[0].length -1? '': '<br/>'
                                        })
                                        return str;
                                    }
                                },
                                dataset: {
                                    source: this.dataCharts.east,
                                },
                                legend: {
                                    bottom: "bottom",
                                },
                                xAxis: [
                                    {
                                        type: "category",
                                        axisPointer: {
                                            type: "shadow",
                                        },
                                    },
                                ],
                                yAxis: [
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                ],
                                series: [
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "line",
                                        yAxisIndex: 1,
                                        itemStyle: { 
                                            normal: { 
                                                label: { 
                                                    show: true,
                                                    formatter:function(params){
                                                        return Math.round(params.value[3]*1) + "%";
                                                    }
                                                } 
                                            } 
                                        },
                                    },
                                ],
                            };
                            c2.setOption(o2);
                        },
 
                        //PFO各区域医院植入表现-中区
                        chart3() {
                            var d3 = document.getElementById("ct3");
                            var c3 = echarts.init(d3);
                            var o3 = {
                                title: {
                                    text: "中区",
                                },
                                tooltip: {
                                    trigger: "axis",
                                    axisPointer: {
                                        type: "cross",
                                        crossStyle: {
                                            color: "#999",
                                        },
                                    },
                                    formatter: function () {
                                        let str = '';
                                        arguments[0].forEach((item, idx) => {
                                            switch (idx){
                                                case 0:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[1]}`;
                                                    break;
                                                case 1:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[2]}`;
                                                    break;
                                                case 2:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[3]}%`;
                                                    break;
                                                default:
                                                    str += 'w(゚Д゚)w'
                                            }
                                            str += idx === arguments[0].length -1? '': '<br/>'
                                        })
                                        return str;
                                    }
                                },
                                dataset: {
                                    source: this.dataCharts.middle,
                                },
                                legend: {
                                    bottom: "bottom",
                                },
                                xAxis: [
                                    {
                                        type: "category",
                                        axisPointer: {
                                            type: "shadow",
                                        },
                                    },
                                ],
                                yAxis: [
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                ],
                                series: [
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "line",
                                        yAxisIndex: 1,
                                        itemStyle: { 
                                            normal: { 
                                                label: { 
                                                    show: true,
                                                    formatter:function(params){
                                                        return Math.round(params.value[3]*1) + "%";
                                                    }
                                                } 
                                            } 
                                        },
                                    },
                                ],
                            };
                            c3.setOption(o3);
                        },
 
                        //PFO各区域医院植入表现-西区
                    chart4() {
                            var d4 = document.getElementById("ct4");
                            var c4 = echarts.init(d4);
                            var o4 = {
                                title: {
                                    text: "西区",
                                },
                                tooltip: {
                                    trigger: "axis",
                                    axisPointer: {
                                        type: "cross",
                                        crossStyle: {
                                        color: "#999",
                                        },
                                    },
                                    formatter: function () {
                                        let str = '';
                                        arguments[0].forEach((item, idx) => {
                                            switch (idx){
                                                case 0:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[1]}`;
                                                    break;
                                                case 1:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[2]}`;
                                                    break;
                                                case 2:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[3]}%`;
                                                    break;
                                                default:
                                                    str += 'w(゚Д゚)w'
                                            }
                                            str += idx === arguments[0].length -1? '': '<br/>'
                                        })
                                        return str;
                                    }
                                },
                                dataset: {
                                    source: this.dataCharts.west,
                                },
                                legend: {
                                    bottom: "bottom",
                                },
                                xAxis: [
                                    {
                                        type: "category",
                                        axisPointer: {
                                            type: "shadow",
                                        },
                                    },
                                ],
                                yAxis: [
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                ],
                                series: [
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "line",
                                        yAxisIndex: 1,
                                        itemStyle: { 
                                            normal: { 
                                                label: { 
                                                    show: true,
                                                    formatter:function(params){
                                                        return Math.round(params.value[3]*1) + "%";
                                                    }
                                                } 
                                            } 
                                        },
                                    },
                                ],
                            };
                            c4.setOption(o4);
                        },
 
                        //PFO各区域医院植入表现-南区
                        chart5() {
                            var d5 = document.getElementById("ct5");
                            var c5 = echarts.init(d5);
                            var o5 = {
                                title: {
                                    text: "南区",
                                },
                                tooltip: {
                                    trigger: "axis",
                                    axisPointer: {
                                        type: "cross",
                                        crossStyle: {
                                        color: "#999",
                                        },
                                    },
                                    formatter: function () {
                                        let str = '';
                                        arguments[0].forEach((item, idx) => {
                                            switch (idx){
                                                case 0:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[1]}`;
                                                    break;
                                                case 1:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[2]}`;
                                                    break;
                                                case 2:
                                                    str += `${item.marker}${item.seriesName} : ${item.data[3]}%`;
                                                    break;
                                                default:
                                                    str += 'w(゚Д゚)w';
                                            }
                                            str += idx === arguments[0].length -1? '': '<br/>'
                                        })
                                        return str;
                                    }
                                },
                                dataset: {
                                    source: this.dataCharts.south,
                                },
                                legend: {
                                    bottom: "bottom",
                                },
                                xAxis: [
                                    {
                                        type: "category",
                                        axisPointer: {
                                            type: "shadow",
                                        },
                                    },
                                ],
                                yAxis: [
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                    {
                                        type: "value",
                                        axisLabel: {
                                            formatter: "{value}",
                                            show: false,
                                        },
                                    },
                                ],
                                series: [
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "bar",
                                    },
                                    {
                                        type: "line",
                                        yAxisIndex: 1,
                                        itemStyle: { 
                                            normal: { 
                                                label: { 
                                                    show: true,
                                                    formatter:function(params){
                                                        return Math.round(params.value[3]*1) + "%";
                                                    }
                                                } 
                                            } 
                                        },
                                    },
                                ],
                            };
                            c5.setOption(o5);
                        },
                    },
                });
            };
 
            loadJsCss(function() {
                initVue();
            });
        </script>
 
        <style>
            [v-cloak] {
                display: none !important;
            }
 
            .v_main {
                background:linear-gradient(rgba(246, 247, 248, 0.878), rgba(170, 207, 243, 0.785));
                background-size: contain;
                background-position: bottom left; 
            }
 
            .charts {
                width: 99%; 
                height: 90%;
                display: flex;
                /* 只要您把这个属性去掉,就不会自动换行了 */
                flex-wrap: wrap;
                justify-content: space-around;
                /* padding-bottom: 10%; */
            }
 
            .chart {
                width: 50%;
                height: 49%;
                /* background: #d7e3e1; */
                margin-top: 1%;
            }
        </style>
 
        <div v-cloak id="hbody" class="h_body" style="margin: 0;padding: 0;">
            <div id="page_root" ref="ref_main" class="v_main" style="padding: 0px 0px 0px 10px">
                <div style="width: 100%; height: 100%; overflow-y: auto;">
                    <div>
                        <h3 style="font-weight: 600;color: #045c24;text-align: center;">各区域医院植入表现</h3>
                    </div>
 
                    <div class="charts">
                        <div class="chart">
                            <!-- <div class="selectors" style = "position: relative;">
                                <el-select 
                                    placeholder="Hospital"
                                    v-model="hospital" 
                                    clearable 
                                    @change="filter"
                                    >
                                    <el-option
                                        v-for="item in options_hospital"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                        >
                                    </el-option>
                                </el-select>
                                <el-select 
                                    placeholder="Line"
                                    v-model="line" 
                                    clearable 
                                    @change="filter"
                                    >
                                    <el-option
                                        v-for="item in options_line"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                        >
                                    </el-option>
                                </el-select>
                            </div> -->
                            <div id = "ct1" style = "width: 100%; height: 100%;"></div>
                        </div>
 
                        <div class="chart">
                            <div id = "ct2" style = "width: 100%; height: 100%;" ></div>
                        </div>
 
                        <div class="chart">
                            <div id = "ct3" style = "width: 100%; height: 100%;" ></div>
                        </div>
 
                        <div class="chart">
                            <div id = "ct4" style = "width: 100%; height: 100%;" ></div>
                        </div>
 
                        <div class="chart">
                            <div id = "ct5" style = "width: 100%; height: 100%;" ></div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
                <div class="spinner">
                  <div class="cube1"></div>
                  <div class="cube2"></div>
                </div>
            </div>
        </div>
    </body>
</html>