<template>
  <div class="plate-box" >
    <h2 class="title border"><span class="line"></span><p>{{title}}</p><span class="line"></span> </h2>
    <div class="dm" style="width:100%;overflow:hildden;overflow-x:auto;">
      <table  class="table" style="">
        <tr>
          <th  v-if="isShow('监测时间')" width="124px">时间</th>
          <th v-if="isShow('血压')" width="72px">血压(mmHg)</th>
          <th v-if="isShow('心率')" width="80px">心率(次/分)</th>
          <th v-if="isShow('呼吸')" width="110px">呼吸(次/分)</th>
          <th v-if="isShow('血流量')" width="92px">血流量(ml/min)</th>
          <th  width="76px">静脉压/动脉压(mmHg)</th>
          <th v-if="isShow('跨膜压')" width="76px">跨膜压(mmHg)</th>
          <th v-if="isShow('超滤量')" width="76px">超滤量(L)</th>
          <th v-if="isShow('钠浓度')" width="92px">钠浓度(mmol/L)</th>
          <th v-if="isShow('透析液温度')" width="92px">透析液温度(℃)</th>
          <th v-if="isShow('置换率')" width="92px">置换率(L/h)</th>
          <th v-if="isShow('置换量')"  width="92px">置换量(L)</th>
          <th v-if="isShow('病情变化')" width="92px">病情变化</th>
          <th v-if="isShow('处理')" width="92px">处理</th>
          <th v-if="isShow('结果')" width="92px">结果</th>
        </tr>
        <tr v-for="(item,index) in tableDate" :key="index" :value="item.value">
          <td v-if="isShow('监测时间')">{{parseTime(item.operate_time, "{y}-{m}-{d} {h}:{i}")}}</td>
          <td v-if="isShow('血压')">{{item.systolic_blood_pressure?item.systolic_blood_pressure:''}}/{{item.diastolic_blood_pressure?item.diastolic_blood_pressure:''}}</td>
          <td v-if="isShow('心率')">{{item.pulse_frequency?item.pulse_frequency:''}}</td>
          <td v-if="isShow('呼吸')">{{item.breathing_rate?item.breathing_rate:''}}</td>
          <td v-if="isShow('血流量')">{{item.blood_flow_volume?item.blood_flow_volume:''}}</td>
          <td>{{item.venous_pressure?item.venous_pressure:''}}/{{item.arterial_pressure?item.arterial_pressure:''}}</td>
          <td v-if="isShow('跨膜压')">{{item.transmembrane_pressure?item.transmembrane_pressure:''}}</td>
          <td v-if="isShow('超滤量')">{{item.ultrafiltration_volume?item.ultrafiltration_volume:''}}</td>
          <td v-if="isShow('钠浓度')">{{item.sodium_concentration?item.sodium_concentration:''}}</td>
          <td v-if="isShow('透析液温度')">{{item.dialysate_temperature?item.dialysate_temperature:''}}</td>
          <td v-if="isShow('置换率')">{{item.replacement_rate?item.replacement_rate:''}}</td>
          <td v-if="isShow('置换量')">{{item.displacement_quantity?item.displacement_quantity:''}}</td>
          <td v-if="isShow('病情变化')">{{item.symptom}}</td>
          <td v-if="isShow('处理')">{{item.dispose}}</td>
          <td v-if="isShow('结果')">{{item.result}}</td>
        </tr>
      </table>
      <div class="NoData" v-show="tableDate.length == 0"><img style="margin-top: 50px; margin-bottom: 50px" src="@/assets/login/data.jpg" alt=""></div>

    </div>
  </div>
</template>

<script>
import { parseTime } from "@/utils";

export default {
  name: "statOrder",
  data() {
    return {
      title: "透析监测 ",
      tableDate: []
    };
  },
  methods: {
    isShow(name){
      var filedList = this.$store.getters.user.fileds

      for (let i = 0; i < filedList.length; i++){
        if(filedList[i].module == 4 && filedList[i].filed_name_cn == name&&filedList[i].is_show == 1){
          return true
        }
      }
      return false
    },
    setRecords(records) {
      if (records == null) {
        records = [];
      }
      this.tableDate.splice(0, this.tableDate.length);
      this.tableDate.push(...records);
    },
    parseTime(time, layout) {
      return parseTime(time, layout);
    },
    addRecords(records) {
      this.tableDate.push(...records);
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.dm {
  /* 针对缺省样式 (必须的) */
      &::-webkit-scrollbar {
        width: 3px;
        height: 5px;
      }
      /* 滚动条的滑轨背景颜色 */
      &::-webkit-scrollbar-track {
        background-color: #fff;
        border-radius: 3px;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
      }
      /* 滑块颜色 */
      &::-webkit-scrollbar-thumb {
        background: #d7dce2;
        border-radius: 3px;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
      }
      /*内层轨道的颜色*/
      &::-webkit-scrollbar-track-piece {
        background-color: #fff;
        border-radius: 3px;
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
      }
      /* 滑轨两头的监听按钮颜色 */
      &::-webkit-scrollbar-button {
        background-color: #eee;
        width: 0;
        height: 0;
      }
      /* 横向滚动条和纵向滚动条相交处尖角的颜色 */
      &::-webkit-scrollbar-corner {
        background-color: #eee;
      }

}
</style>



