<template>
  <div class="bg"
    style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden">
    <a-spin :spinning="loading" />
    <div id="grout3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
    <!-- <div id="damper3DCSS" v-show="!loading" style="width: 100%; height: 100%; top:0; left: 0; position: absolute; overflow: hidden;">
      <div>
        <div ref="elementContent" class="elementContent">
          <p><span class="data-title">压力(Pa)：</span>{{selectData.frontRearDP}}</p>
          <p><span class="data-title">动力源压力(MPa)：</span>{{selectData.sourcePressure}}</p>
          <p><span class="data-title">故障诊断：</span>
            <i
              :class="{'state-icon': true, 'open': selectData.messageBoxStatus, 'close': !selectData.messageBoxStatus}"
            ></i>{{selectData.fault}}</p>
        </div>
      </div>
    </div> -->
  </div>
  <div class="scene-box">
    <customHeader >智能注浆系统</customHeader>
    <div class="center-container">
      <groutHome v-if="activeKey == 'monitor'" :deviceId = 'optionValue' />
      <div v-else class="history-group">
        <div class="history-container">
          <groutHistory v-if="activeKey == 'monitor_history'" ref="historyTable" class="vent-margin-t-20"/>
          <groutHandleHistoryVue v-if="activeKey == 'handler_history'" ref="alarmHistoryTable" class="vent-margin-t-20"  />
          <groutAlarmHistory v-if="activeKey == 'faultRecord'" ref="handlerHistoryTable" class="vent-margin-t-20"/>
        </div> 
      </div>      
    </div>
    <BottomMenu @change="changeActive"/>
  </div>
  
</template>

<script setup lang="ts">
import customHeader from '/@/views/vent/comment/components/customHeader.vue';
import { onBeforeMount, ref, onMounted, onUnmounted, reactive, toRaw } from 'vue';
import { list } from './grout.api';
import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
import groutHome from './components/groutHome.vue';
import groutHistory from './components/groutHistory.vue';
import groutHandleHistoryVue from './components/groutHandleHistory.vue';
import groutAlarmHistory from './components/groutAlarmHistory.vue';

type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
const activeKey = ref('monitor');
const loading = ref(false);

const monitorTable = ref()
const historyTable = ref()
const alarmHistoryTable = ref()
const handlerHistoryTable = ref()

const options = ref()
// 默认初始是第一行
const selectRowIndex = ref(0);
const dataSource = ref([])

const optionValue = ref('')

// 监测数据
const selectData = reactive({});

function changeActive(activeValue) {
  activeKey.value = activeValue
}

onBeforeMount(() => {

});

onMounted(async() => {

});
onUnmounted(() => {
 
});
</script>
<style lang="less" scoped>
@import '/@/design/vent/modal.less';
@ventSpace: zxm;
.scene-box{
  pointer-events: none;
  .history-group{
    padding: 0 20px;
    .history-container{
      position: relative;
      background: #6176AF11;
      width: calc(100% + 10px);
      top: 0px;
      left: -10px;
      border: 1px solid #ffffff22;
      padding: 10px 0;
      pointer-events: auto;
    }
  }
  .device-button-group{
    // margin: 0 20px;
    display: flex;
    pointer-events: auto;
    position: relative;
    margin-top: 90px;
    &::after{
      position:absolute;
      content: '';
      width: calc(100% + 10px);
      height: 2px;
      top: 30px;
      left: -10px;
      border-bottom: 1px solid #0efcff;
    }
    .device-button{
      padding: 4px 15px;
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 14px;
      
      color: #fff;
      cursor: pointer;
      margin: 0 3px;

      &::before{
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        border: 1px solid #6176AF;
        transform: skewX(-38deg);
        background-color: rgba(0, 77, 103,85%);
        z-index: -1;
      }
    }
    .device-active{
      // color: #0efcff;
      &::before{
        border-color: #0efcff;
        box-shadow: 1px 1px 3px 1px #0efcff inset;
      }
    }
  }
}
.center-container{
  width: 100%;
  height: calc(100% - 200px);
}

:deep(.@{ventSpace}-tabs-tabpane-active) {
  overflow: auto;
}

.input-box {
  display: flex;
  align-items: center;
  padding-left: 10px;

  .input-title {
    color: #73e8fe;
    width: auto;
  }

  .@{ventSpace}-input-number {
    border-color: #ffffff88 !important;
  }

  margin-right: 10px;
}
</style>
