chart.vue 22.4 KB
Newer Older
张锡奇's avatar
张锡奇 committed
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
<style lang="less" >
    @import url('../../../styles/common.less');
    #healthCardStatisticsChart{
        background: #f6f5f9;
        height:100%;
        display: flex;
        flex-direction: column;
        .TITLE{
            display:flex;
            align-items: center;
            padding:10px 15px;
            h1{
                font-size:20px;
                font-weight: bold;
            }
            h3{
                width:auto;
                font-size:12px;
                text-align: center;
                border:1px solid #ccc;
                border-radius: 6px;
                padding:2px 4px;
            }
        }
        .CONTENT{
            flex-grow: 1;
            height:1px;
            display: flex;
            flex-direction: column;
            .activeTab1{
                flex-grow: 1;
                height:1px;
                background: white;
                overflow: auto;
                -webkit-overflow-scrolling: touch;
                >div{
                    padding:10px;
                    h3{
                        font-weight: bold;
                    }
                }
            }
            .activeTab2{
                flex-grow: 1;
                height:1px;
                background: white;
                overflow: auto;
                -webkit-overflow-scrolling: touch;
张锡奇's avatar
张锡奇 committed
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
                .SEARCH{
                    height:50px;
                    padding:0 8px;
                    display:flex;
                    align-items: center;
                    position: relative;
                    >input{
                        background: white;
                        height:35px;
                        line-height: 35px;
                        flex:1;
                        border-radius: 5px;
                        font-size: 12px;
                        padding:0 25px 0 8px;
                        border: 1px solid #2d8cf0;
                        box-sizing: border-box;
                    }
                    .iconfont{
                        width: 40px;
                        height:35px;
                        font-size:12px;
                        position: absolute;
                        color:#ed4014;
                        line-height: 35px;
                        text-align: center;
                        right:8px;
                    }
                }
张锡奇's avatar
张锡奇 committed
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
                .items{
                    display: flex;
                    height:60px;
                    align-items: center;
                    margin:10px;
                    .avatar{
                        height:50px;
                        width:50px;
                        border-radius: 50%;
                        background: #3a8af7;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        color:white;
                        font-size:22px;
                        margin-right:10px;
                    }
                    .item{
                        flex:1;
                        height:60px;
                        border-bottom:1px solid #f6f6f6;
                        box-sizing: border-box;
                        display: flex;
                        align-items: center;
                        .name{
                            font-size:14px;
                        }
                        .time{
                            font-size:14px;
                            color:#8a8a8a;
张锡奇's avatar
张锡奇 committed
107 108
                            text-align: right;
                            padding-right:10px;
张锡奇's avatar
张锡奇 committed
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
                        }
                        >div{
                            flex:1;
                        }
                        >i{
                            font-size: 12px;
                        }
                    }
                }
                
            }
        }
        .DESC{
            padding:0 15px;
            font-size:14px;
            color:#8a8a8a;
        }
        .Card{
            margin:10px 15px;
            font-size:12px;
            overflow:hidden;
            background:#fff;
            border-radius:5px;
            box-shadow:0 1px 3px #bababa;
            width:auto;
            display: flex;
            justify-content: center;
            align-items: center;
            padding:10px 0;
            margin-bottom: 30px;
            .left,.center{
                border-right:1px solid #f1f1f1;
            }
            .left,.right,.center{
              display: flex;
              flex-wrap: wrap;
              justify-content: center;
              align-items: center;
              flex:1;
              .n{
                width:100%;
                color:#6a6a6a;
                font-weight: bold;
                font-size:20px;
                text-align: center;
              }
              .t{
                width:100%;
                font-size:14px;
                text-align: center;
                color:#8a8a8a;
              }
            }
        }
张锡奇's avatar
张锡奇 committed
163 164 165 166 167 168 169 170 171
        .img{
            width:100%;
            display: flex;
            justify-content: center;
            img{
                width:100%;
                height:300px;
            }
        }
张锡奇's avatar
张锡奇 committed
172 173 174 175 176 177 178
    }
</style>

<template>
  <div id="healthCardStatisticsChart">
      <div class="HEADER">
          <div class="TITLE">
张锡奇's avatar
张锡奇 committed
179
              <h1>每日健康打卡({{hdr.sMonth}}{{Number(hdr.iDay) >= 10 ? hdr.iDay : '0' + hdr.iDay}}日)</h1>
张锡奇's avatar
张锡奇 committed
180
              <!-- <h3>已结束</h3> -->
张锡奇's avatar
张锡奇 committed
181 182 183
          </div>
          <div class="Card">
            <div class="left">
张锡奇's avatar
张锡奇 committed
184
                <div class="n">{{hdr.iAll}}</div>
张锡奇's avatar
张锡奇 committed
185 186
                <div class="t">应参与人员</div>
            </div>
张锡奇's avatar
张锡奇 committed
187 188
            <div class="center" @click="routerToList(0)">
                <div class="n">{{hdr.iAllJoin}}</div>
张锡奇's avatar
张锡奇 committed
189 190
                <div class="t">已参与人员</div>
            </div>
张锡奇's avatar
张锡奇 committed
191 192
            <div class="right" @click="routerToList(1)">
                <div class="n">{{hdr.iAllNotJoin}}</div>
张锡奇's avatar
张锡奇 committed
193 194 195 196 197 198 199 200 201 202 203 204
                <div class="t">未参与人员</div>
            </div>
          </div>
      </div>
      <div class="CONTENT">
        <tab v-model="activeTab" prevent-default @on-before-index-change="switchTabItem" bar-active-color="#4572d7" active-color="#4572d7" default-color="#8a8a8a">
            <tab-item :selected="activeTab == 0">数据统计</tab-item>
            <tab-item :selected="activeTab == 1">详细数据</tab-item>
        </tab>
        <div v-show="activeTab == 0" class="activeTab1">
            <div>
                <h3>1.目前健康状况</h3>
张锡奇's avatar
张锡奇 committed
205
                <div ref="chart1" v-show="set1.length > 0">
张锡奇's avatar
张锡奇 committed
206 207
                    <canvas id="myChart1" width="400" height="300" style="width:100%;height:300px;"></canvas>
                </div>
张锡奇's avatar
张锡奇 committed
208 209 210
                <div class="img" v-if="set1.length <= 0">
                    <img src="@/assets/noData.jpg" class="_img" alt="">
                </div>
张锡奇's avatar
张锡奇 committed
211 212
            </div>
            <div>
张锡奇's avatar
张锡奇 committed
213 214 215 216 217 218 219 220 221
                <h3>2.体温情况</h3>
                <div ref="chart4" v-show="set4.length > 0">
                    <canvas id="myChart4" width="400" height="300" style="width:100%;height:300px;"></canvas>
                </div>
                <div class="img" v-if="set4.length <= 0">
                    <img src="@/assets/noData.jpg" class="_img" alt="">
                </div>
            </div>
            <div>
张锡奇's avatar
张锡奇 committed
222
                <h3>3.自2020年1月1日起,是否在湖北停留或路过,或接触过来自湖北的人员饼状图</h3>
张锡奇's avatar
张锡奇 committed
223
                <div ref="chart2" v-show="set2.length > 0">
张锡奇's avatar
张锡奇 committed
224 225
                    <canvas id="myChart2" width="400" height="300" style="width:100%;height:300px;"></canvas>
                </div>
张锡奇's avatar
张锡奇 committed
226 227 228
                <div class="img" v-if="set2.length <= 0">
                    <img src="@/assets/noData.jpg" class="_img" alt="">
                </div>
张锡奇's avatar
张锡奇 committed
229 230
            </div>
            <div>
张锡奇's avatar
张锡奇 committed
231
                <h3>4.是否接触过疑似或确诊的新型肺炎患者</h3>
张锡奇's avatar
张锡奇 committed
232
                <div ref="chart3" v-show="set3.length > 0">
张锡奇's avatar
张锡奇 committed
233 234
                    <canvas id="myChart3" width="400" height="300" style="width:100%;height:300px;"></canvas>
                </div>
张锡奇's avatar
张锡奇 committed
235 236 237
                <div class="img" v-if="set3.length <= 0">
                    <img src="@/assets/noData.jpg" class="_img" alt="">
                </div>
张锡奇's avatar
张锡奇 committed
238 239
            </div>
        </div>
张锡奇's avatar
张锡奇 committed
240
        <div v-show="activeTab == 1" class="activeTab2" ref="scrollDom" @scroll="scrollToBottom">
张锡奇's avatar
张锡奇 committed
241 242 243 244
            <div class="SEARCH">
                <input type="text" placeholder="输入姓名进行搜索" v-model="searchvalue" @input="changeInput"/>
                <span class="iconfont icon-chacha" v-if="searchvalue" @click="delSearchValue"></span>
            </div>
张锡奇's avatar
张锡奇 committed
245
            <div class="items" v-for="(item,index) in list" :key="index" @click="routerToPunchClockDetail(item)">
张锡奇's avatar
张锡奇 committed
246 247
                <div class="avatar">
                    <img src="" alt="">
张锡奇's avatar
张锡奇 committed
248
                    <span>{{item.sEmploeeName[0]}}</span>
张锡奇's avatar
张锡奇 committed
249 250
                </div>
                <div class="item">
张锡奇's avatar
张锡奇 committed
251 252
                    <div class="name">{{item.sEmploeeName}}</div>
                    <div class="time">{{item.dCheckDate}}</div>
张锡奇's avatar
张锡奇 committed
253 254 255
                    <i class="iconfont icon-youjiantou"></i>
                </div>
            </div>
张锡奇's avatar
张锡奇 committed
256 257 258
            <div class="img" v-if="list.length <= 0">
                <img src="@/assets/noData.jpg" class="_img" alt="">
            </div>
张锡奇's avatar
张锡奇 committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
        </div>
      </div>
  </div>
</template>

<script>
import Util from '@/libs/util.js';
import {mapState} from 'vuex';
import { Tab, TabItem } from 'vux'
const F2 = require('@antv/f2/lib/index')
const PieLabel = require('@antv/f2/lib/plugin/pie-label'); // 引入 PieLabel 模块
const Legend = require('@antv/f2/lib/plugin/legend');
F2.Chart.plugins.register(Legend); // 方式一:全局注册
F2.Chart.plugins.register(PieLabel);

张锡奇's avatar
张锡奇 committed
274 275 276 277
require('@antv/f2/lib/interaction/pan'); // 引入图表平移交互
const ScrollBar = require('@antv/f2/lib/plugin/scroll-bar');
F2.Chart.plugins.register(ScrollBar); // 这里进行全局注册,也可以给 chart 的实例注册

张锡奇's avatar
张锡奇 committed
278 279 280 281 282 283 284 285
export default {
  name: 'healthCardStatisticsChart',
  data () {
    return {
        activeTab:0,
        myChart1:null,
        myChart2:null,
        myChart3:null,
张锡奇's avatar
张锡奇 committed
286
        myChart4:null,
张锡奇's avatar
张锡奇 committed
287 288 289
        set1:[],
        set2:[],
        set3:[],
张锡奇's avatar
张锡奇 committed
290
        set4:[],
张锡奇's avatar
张锡奇 committed
291 292 293
        list:[],
        page:1,
        per_page:20,
张锡奇's avatar
张锡奇 committed
294 295
        y:0,
        searchvalue:''
张锡奇's avatar
张锡奇 committed
296 297 298 299 300 301 302
    }
  },
  components:{
      Tab, TabItem
  },
  computed:{
    ...mapState({
张锡奇's avatar
张锡奇 committed
303 304
        hdr:state => state.healthStatistics.hdr,
        openId:state => state.healthStatistics.openId
张锡奇's avatar
张锡奇 committed
305 306 307 308 309 310
    })
  },
  async mounted(){
  },
  async activated(){
    window.d = this;
张锡奇's avatar
张锡奇 committed
311 312 313 314 315 316
    
    if(this.activeTab == 0){
        await this.getData();
    }else{
        this.page = 1;
        this.per_page = 20;
张锡奇's avatar
张锡奇 committed
317
        this.list = [];
张锡奇's avatar
张锡奇 committed
318 319
        await this.getList();
    }
张锡奇's avatar
张锡奇 committed
320 321 322 323 324 325 326 327
    window.addEventListener("resize",()=>{
        setTimeout(()=>{
            this.myChart1.changeSize(this.$refs['chart1'].offsetWidth); // 清除
            this.myChart1.destroy();
            this.myChart2.changeSize(this.$refs['chart2'].offsetWidth); // 清除
            this.myChart2.destroy();
            this.myChart3.changeSize(this.$refs['chart3'].offsetWidth); // 清除
            this.myChart3.destroy();
张锡奇's avatar
张锡奇 committed
328 329
            this.myChart4.changeSize(this.$refs['chart4'].offsetWidth); // 清除
            this.myChart4.destroy();
张锡奇's avatar
张锡奇 committed
330 331 332
            this.renderChart1();
            this.renderChart2();
            this.renderChart3();
张锡奇's avatar
张锡奇 committed
333 334
            this.renderChart4();

张锡奇's avatar
张锡奇 committed
335 336 337 338 339 340 341
        })
    });
    
    this.$nextTick(async ()=>{
        await this.renderChart1();
        await this.renderChart2();
        await this.renderChart3();
张锡奇's avatar
张锡奇 committed
342
        await this.renderChart4();
张锡奇's avatar
张锡奇 committed
343 344 345
    })
  },
  methods:{
张锡奇's avatar
张锡奇 committed
346 347 348 349 350 351 352 353 354 355 356 357 358
    async changeInput(){
        this.page = 1;
        this.per_page = 20;
        this.list = [];
        await this.getList(true);
    },
    async delSearchValue(){
        this.searchvalue = '';
        this.page = 1;
        this.per_page = 20;
        this.list = [];
        await this.getList(true);
    },
张锡奇's avatar
张锡奇 committed
359 360
    switchTabItem(index){
        this.activeTab = index;
张锡奇's avatar
张锡奇 committed
361 362 363 364 365
        if(this.activeTab == 0){
            this.getData();
        }else{
            this.getList();
        }
张锡奇's avatar
张锡奇 committed
366 367 368 369 370 371 372
    },
    renderChart1 () {
        this.myChart1 = new F2.Chart({
            id: 'myChart1',
            pixelRatio: window.devicePixelRatio,
            plugins: [PieLabel,Legend]
        });
张锡奇's avatar
张锡奇 committed
373
        this.myChart1.source(this.set1);
张锡奇's avatar
张锡奇 committed
374 375 376 377 378 379
        this.myChart1.coord('polar', {
            transposed: true,
            radius: 0.9,
        });
        this.myChart1.axis(false);
        this.myChart1.tooltip(false);
张锡奇's avatar
张锡奇 committed
380
        this.myChart1.legend('title', {
张锡奇's avatar
张锡奇 committed
381 382 383 384 385 386 387 388 389 390 391 392 393
            position: 'bottom'
        })
        this.myChart1.guide()
        .html({
            position: [ '50%', '50%' ],
            html: '<div style="text-align: center;width:150px;height: 50px;">\n      <p style="font-size: 12px;color: #999;margin: 0" id="title"></p>\n      <p style="font-size: 18px;color: #343434;margin: 0;font-weight: bold;" id="money"></p>\n      </div>'
        });
        
        this.myChart1.pieLabel({
            sidePadding: 30,
            activeShape: true,
            label1: function label1(data) {
                return {
张锡奇's avatar
张锡奇 committed
394
                text: data.value,
张锡奇's avatar
张锡奇 committed
395 396 397 398 399 400
                fill: '#343434',
                fontWeight: 'bold'
                };
            },
            label2: function label2(data) {
                return {
张锡奇's avatar
张锡奇 committed
401
                text: data.title,
张锡奇's avatar
张锡奇 committed
402 403 404 405 406 407 408 409 410 411
                fill: '#999'
                };
            },
            onClick: function onClick(ev) {
                const data = ev.data;
                if (data) {
                }
            }
        });
        this.myChart1.interval()
张锡奇's avatar
张锡奇 committed
412 413
            .position('const*value')
            .color('title', [ '#ff9900', '#19be6b', '#2d8cf0' ])
张锡奇's avatar
张锡奇 committed
414 415 416 417 418 419 420 421 422
            .adjust('stack')
        this.myChart1.render();
    },
    renderChart2 () {
        this.myChart2 = new F2.Chart({
            id: 'myChart2',
            pixelRatio: window.devicePixelRatio,
            plugins: [PieLabel,Legend]
        });
张锡奇's avatar
张锡奇 committed
423
        this.myChart2.source(this.set2);
张锡奇's avatar
张锡奇 committed
424 425 426 427 428 429
        this.myChart2.coord('polar', {
            transposed: true,
            radius: 0.9,
        });
        this.myChart2.axis(false);
        this.myChart2.tooltip(false);
张锡奇's avatar
张锡奇 committed
430
        this.myChart2.legend('title', {
张锡奇's avatar
张锡奇 committed
431 432 433 434 435 436 437 438 439 440 441 442 443
            position: 'bottom'
        })
        this.myChart2.guide()
        .html({
            position: [ '50%', '50%' ],
            html: '<div style="text-align: center;width:150px;height: 50px;">\n      <p style="font-size: 12px;color: #999;margin: 0" id="title"></p>\n      <p style="font-size: 18px;color: #343434;margin: 0;font-weight: bold;" id="money"></p>\n      </div>'
        });
        
        this.myChart2.pieLabel({
            sidePadding: 30,
            activeShape: true,
            label1: function label1(data) {
                return {
张锡奇's avatar
张锡奇 committed
444
                text: data.value,
张锡奇's avatar
张锡奇 committed
445 446 447 448 449 450
                fill: '#343434',
                fontWeight: 'bold'
                };
            },
            label2: function label2(data) {
                return {
张锡奇's avatar
张锡奇 committed
451
                text: data.title,
张锡奇's avatar
张锡奇 committed
452 453 454 455 456 457 458 459 460 461
                fill: '#999'
                };
            },
            onClick: function onClick(ev) {
                const data = ev.data;
                if (data) {
                }
            }
        });
        this.myChart2.interval()
张锡奇's avatar
张锡奇 committed
462 463
            .position('const*value')
            .color('title', [ '#ff9900', '#19be6b' ])
张锡奇's avatar
张锡奇 committed
464 465 466 467 468 469 470 471 472
            .adjust('stack')
        this.myChart2.render();
    },
    renderChart3 () {
        this.myChart3 = new F2.Chart({
            id: 'myChart3',
            pixelRatio: window.devicePixelRatio,
            plugins: [PieLabel,Legend]
        });
张锡奇's avatar
张锡奇 committed
473
        this.myChart3.source(this.set3);
张锡奇's avatar
张锡奇 committed
474 475 476 477 478 479
        this.myChart3.coord('polar', {
            transposed: true,
            radius: 0.9,
        });
        this.myChart3.axis(false);
        this.myChart3.tooltip(false);
张锡奇's avatar
张锡奇 committed
480
        this.myChart3.legend('title', {
张锡奇's avatar
张锡奇 committed
481 482 483 484 485 486 487 488 489 490 491 492 493
            position: 'bottom'
        })
        this.myChart3.guide()
        .html({
            position: [ '50%', '50%' ],
            html: '<div style="text-align: center;width:150px;height: 50px;">\n      <p style="font-size: 12px;color: #999;margin: 0" id="title"></p>\n      <p style="font-size: 18px;color: #343434;margin: 0;font-weight: bold;" id="money"></p>\n      </div>'
        });
        
        this.myChart3.pieLabel({
            sidePadding: 30,
            activeShape: true,
            label1: function label1(data) {
                return {
张锡奇's avatar
张锡奇 committed
494
                text: data.value,
张锡奇's avatar
张锡奇 committed
495 496 497 498 499 500
                fill: '#343434',
                fontWeight: 'bold'
                };
            },
            label2: function label2(data) {
                return {
张锡奇's avatar
张锡奇 committed
501
                text: data.title,
张锡奇's avatar
张锡奇 committed
502 503 504 505 506 507 508 509 510 511
                fill: '#999'
                };
            },
            onClick: function onClick(ev) {
                const data = ev.data;
                if (data) {
                }
            }
        });
        this.myChart3.interval()
张锡奇's avatar
张锡奇 committed
512 513
            .position('const*value')
            .color('title', [ '#ff9900', '#19be6b' ])
张锡奇's avatar
张锡奇 committed
514 515 516
            .adjust('stack')
        this.myChart3.render();
    },
张锡奇's avatar
张锡奇 committed
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
    renderChart4 () {
        this.myChart4 = new F2.Chart({
            id: 'myChart4',
            pixelRatio: window.devicePixelRatio,
            plugins: [PieLabel,Legend]
        });
        this.myChart4.source(this.set4);
        this.myChart4.coord('polar', {
            transposed: true,
            radius: 0.9,
        });
        this.myChart4.axis(false);
        this.myChart4.tooltip(false);
        this.myChart4.legend('title', {
            position: 'bottom'
        })
        this.myChart4.guide()
        .html({
            position: [ '50%', '50%' ],
            html: '<div style="text-align: center;width:150px;height: 50px;">\n      <p style="font-size: 12px;color: #999;margin: 0" id="title"></p>\n      <p style="font-size: 18px;color: #343434;margin: 0;font-weight: bold;" id="money"></p>\n      </div>'
        });
        
        this.myChart4.pieLabel({
            sidePadding: 30,
            activeShape: true,
            label1: function label1(data) {
                return {
                text: data.value,
                fill: '#343434',
                fontWeight: 'bold'
                };
            },
            label2: function label2(data) {
                return {
                text: data.title,
                fill: '#999'
                };
            },
            onClick: function onClick(ev) {
                const data = ev.data;
                if (data) {
                }
            }
        });
        this.myChart4.interval()
            .position('const*value')
            .color('title', [ '#19be6b', '#ff9900','#2d8cf0' ])
            .adjust('stack')
        this.myChart4.render();
    },
张锡奇's avatar
张锡奇 committed
567 568 569 570 571
    async getData(){
        let res = await this.request('getStatisticalDetails',{
            data:[
                {key:'url',value:'statistical_details_data'},
                {key:'dDate',value: this.hdr.dDate},
张锡奇's avatar
张锡奇 committed
572
                {key:'iCompanyId',value: this.hdr.iCompanyId}
张锡奇's avatar
张锡奇 committed
573 574 575 576 577 578 579
            ],
            params:{},
        },'加载中',{});
        if(Util.getType(res) == 'object') {
            this.set1 = [
                {
                    title:'感染',
张锡奇's avatar
张锡奇 committed
580 581
                    value:res.set1[0].iFever,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
582 583 584
                },
                {
                    title:'健康',
张锡奇's avatar
张锡奇 committed
585 586
                    value:res.set1[0].iHealthy,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
587 588 589
                },
                {
                    title:'其他',
张锡奇's avatar
张锡奇 committed
590 591
                    value:res.set1[0].iOther,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
592 593 594 595 596
                }
            ];
            this.set2 = [
                {
                    title:'接触',
张锡奇's avatar
张锡奇 committed
597 598
                    value:res.set2[0].bHaveBeenTrue,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
599 600 601
                },
                {
                    title:'未接触',
张锡奇's avatar
张锡奇 committed
602 603
                    value:res.set2[0].bHaveBeenFalse,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
604 605 606 607 608
                }
            ];
            this.set3 = [
                {
                    title:'停留',
张锡奇's avatar
张锡奇 committed
609 610
                    value:res.set3[0].bTouchTrue,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
611 612 613
                },
                {
                    title:'未停留',
张锡奇's avatar
张锡奇 committed
614 615
                    value:res.set3[0].bTouchFalse,
                    const: 'const'
张锡奇's avatar
张锡奇 committed
616 617
                }
            ];
张锡奇's avatar
张锡奇 committed
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
            this.set4 = [
                {
                    title:'正常体温',
                    value:res.set4[0].iNormalCount,
                    const: 'const'
                },
                {
                    title:'低烧',
                    value:res.set4[0].iLowCount,
                    const: 'const'
                },
                {
                    title:'发烧',
                    value:res.set4[0].iHighCount,
                    const: 'const'
                }
            ];
张锡奇's avatar
张锡奇 committed
635 636 637
            this.set1 = this.set1.filter(x=>x.value > 0);
            this.set2 = this.set2.filter(x=>x.value > 0);
            this.set3 = this.set3.filter(x=>x.value > 0);
张锡奇's avatar
张锡奇 committed
638
            this.set4 = this.set4.filter(x=>x.value > 0);
张锡奇's avatar
张锡奇 committed
639 640
        }
    },
张锡奇's avatar
张锡奇 committed
641
    async getList(flag){
张锡奇's avatar
张锡奇 committed
642 643 644 645
        if(this.per_page < 20){
            this.$vux.toast.text('已加载全部数据!', 'middle')
            return false;
        }
张锡奇's avatar
张锡奇 committed
646 647 648 649 650 651 652 653
        let postData = [
            {key:'url',value:'HealthLog'},
            {key:'dDate',value: this.hdr.dDate},
            {key:'iCompanyId',value: this.hdr.iCompanyId},
            {key:'iType',value:'1'}
        ];
        this.searchvalue && (postData.push({key:'searchvalue',value:this.searchvalue}));

张锡奇's avatar
张锡奇 committed
654
        let res = await this.request('getStatisticalDetails',{
张锡奇's avatar
张锡奇 committed
655
            data:postData,
张锡奇's avatar
张锡奇 committed
656 657 658 659 660 661
            params:{
                page:this.page,
                per_page:this.per_page
            },
        },'加载中',{});
        if(res && res.length > 0){
张锡奇's avatar
张锡奇 committed
662 663 664 665 666
            if(flag){
                this.list = res;
            }else{
                this.list = this.list.concat(res);
            }
张锡奇's avatar
张锡奇 committed
667 668 669 670 671 672 673 674 675 676 677 678
            this.page++;
            this.per_page = res.length;
        }
    },
    scrollToBottom(){
        let scrollDom = this.$refs['scrollDom'];
        if(Util.scrollToBottom(scrollDom)){
            this.getList();
        }
    },
    routerToList(type){
        this.$router.push({name:'healthCardStatisticsList',params:{type:type}});
张锡奇's avatar
张锡奇 committed
679 680
    },
    routerToPunchClockDetail(item){
godwithdh's avatar
godwithdh committed
681
        this.$router.push({name:'punchClockDetail',params:{id:'1',address:'1',openId:item.sCreateAppid},query:{readOnly:'2',dDate:new Date(Util.dateFormat(this.hdr.dDate,'yyyy-MM-dd')).getTime()}})
张锡奇's avatar
张锡奇 committed
682
    }
张锡奇's avatar
张锡奇 committed
683 684 685
  }
}
</script>