<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="main3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
    <FanEchrats id="fan-echarts" :chartData="selectData" style="position: absolute; z-index: -1" />
  </div>
  <div
    id="main3DCSS"
    class="threejs-Object-CSS"
    v-show="!loading"
    style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 1; top: 0"
  >
    <div style="position: relative">
      <div class="elementTag" id="inputBox">
        <div class="elementContent elementContent-r" v-if="selectData.dqPa && backMonitorIsShow">
          <p><span class="data-title">风机全压(Pa)：</span>{{ selectData.dqPa ? selectData.dqPa : '-' }}</p>
          <p><span class="data-title">风机静压(Pa)：</span>{{ selectData.yc2 ? selectData.yc2 : '-' }}</p>
          <p><span class="data-title">风机流量(m³/s)：</span>{{ selectData.fanM3 ? selectData.fanM3 : '-' }}</p>
        </div>
      </div>
      <div class="elementTag" id="inputBox1">
        <div class="elementContent elementContent-r" v-if="selectData.dqPa && frontMonitorIsShow">
          <p><span class="data-title">风机全压(Pa)：</span>{{ selectData.dqPa ? selectData.dqPa : '-' }}</p>
          <p><span class="data-title">风机静压(Pa)：</span>{{ selectData.yc2 ? selectData.yc2 : '-' }}</p>
          <p><span class="data-title">风机流量(m³/s)：</span>{{ selectData.fanM3 ? selectData.fanM3 : '-' }}</p>
        </div>
      </div>
    </div>
  </div>
  <div class="scene-box" style="z-index: 999">
    <div class="title-text" style="position: absolute; z-index: 9999; width: 100%; text-align: center">{{ selectData.strname }}</div>
    <div class="top-box control-group">
      <div class="button-box" v-for="(item, index) in modalTypeArr.centerBtnArr" :key="index" @click="showModal(item)">{{ item.value }}</div>
    </div>
    <div class="data-show-box">
      <div class="data-item">
        <div class="item-header">环境监测</div>
        <div class="item-container">
          <div class="tab">
            <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 0 }" @click="selectDevice('dataMonitorRowIndex', 0)"
              >1#风机</div
            >
            <div class="tab-item" :class="{ 'tab-item-active-r': dataMonitorRowIndex == 1 }" @click="selectDevice('dataMonitorRowIndex', 1)"
              >2#风机</div
            >
          </div>
          <div class="container-group container-group-l">
            <div class="container-item" v-for="(data, index) in dataColumns()" :key="index">
              <div class="item-icon">
                <SvgIcon class="icon-style" size="18" name="temperature" />
              </div>
              <div class="item-name">{{ data.name }}</div>

              <div class="item-value" v-if="dataSource[dataMonitorRowIndex]">{{ dataSource[dataMonitorRowIndex][data.id] }}</div>
            </div>
          </div>
        </div>
      </div>
      <div class="data-item">
        <div class="item-header">设备状态</div>
        <div class="item-container">
          <div class="tab">
            <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 0 }" @click="selectDevice('warningMonitorRowIndex', 0)"
              >1#风机</div
            >
            <div class="tab-item" :class="{ 'tab-item-active-r': warningMonitorRowIndex === 1 }" @click="selectDevice('warningMonitorRowIndex', 1)"
              >2#风机</div
            >
          </div>
          <div class="container-group">
            <div class="warning-header">
              <div class="header-item">
                <div class="header-title">报警总数</div>
                <div class="header-value">0</div>
              </div>
              <div class="header-item">
                <div class="header-title"> 未处理数</div>
                <div class="header-value">0</div>
              </div>
            </div>
            <div class="warning-group">
              <div class="warning-item" v-for="(state, index) in stateColumns()" :key="index">
                <div class="item-name"><div class="icon"></div> {{ state.name }}</div>
                <div class="signal-item" v-if="dataSource[warningMonitorRowIndex]">
                  <div
                    class="signal-round"
                    :class="{
                      'signal-round-run': dataSource[warningMonitorRowIndex][state.id],
                      'signal-round-warning':
                        dataSource[warningMonitorRowIndex][state.id] !== undefined && !dataSource[warningMonitorRowIndex][state.id],
                      'signal-round-gry': dataSource[warningMonitorRowIndex][state.id] === undefined,
                    }"
                  ></div>
                  <div>{{
                    dataSource[warningMonitorRowIndex][state.id] === undefined
                      ? '无状态'
                      : dataSource[warningMonitorRowIndex][state.id]
                      ? '正常'
                      : '异常'
                  }}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="bottom-tabs-box">
      <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
        <a-tab-pane key="1" tab="实时监测">
          <GroupMonitorTable :dataSource="dataSource" columnsType="fanmain_monitor" @selectRow="getSelectRow" />
        </a-tab-pane>
        <!-- <a-tab-pane key="2" tab="实时曲线图" force-render>
          <div class="tab-item" v-if="activeKey === '2'">
            <Bar :chartData="dataSource" xAxisPropType="strname" :propTypeArr="propTypeArr" height="40vh" width="100%" />
          </div>
        </a-tab-pane> -->
        <a-tab-pane key="3" tab="历史数据">
          <div class="tab-item">
            <HistoryTable columns-type="fanmain_history" device-type="fanmain" :device-list-api="baseList" designScope="fanmain-history" />
          </div>
        </a-tab-pane>
        <a-tab-pane key="4" tab="报警历史">
          <div class="tab-item">
            <AlarmHistoryTable columns-type="alarm_history" device-type="fanmain" :device-list-api="baseList" designScope="alarm-history" />
          </div>
        </a-tab-pane>
        <a-tab-pane key="5" tab="操作历史">
          <div class="tab-item">
            <HandlerHistoryTable columns-type="alarm_history" device-type="fanlocal" :device-list-api="baseList" designScope="alarm-history" />
          </div>
        </a-tab-pane>
      </a-tabs>
    </div>
  </div>
  <div style="z-index: -1; position: absolute; top: -100px; right: 10px; width: 300px; height: 280px; margin: auto" class="palyer">
    <!-- <LivePlayer id="main-player1" ref="player1" :videoUrl="flvURL1()" muted live loading controls /> -->
    <LivePlayer id="main-player1" ref="player1" :videoUrl="flvURL1()" muted loop loading controls />
  </div>
  <a-modal v-model:visible="modalIsShow" :title="modalTitle" @ok="handleOk" @cancel="handleCancel">
    <div class="modal-container">
      <div class="vent-flex-row">
        <ExclamationCircleFilled style="color: #ffb700; font-size: 30px" />
        <div class="warning-text">您是否要进行{{ modalTitle }}操作？</div>
      </div>
      <!-- 调频 -->
      <div class="vent-flex-row input-box" v-if="modalType == 'frequency'">
        <div class="label">运行频率（单位）：</div>
        <a-input-number v-model:value="frequencyVal" :min="0" :max="50" :step="0.1" />
      </div>
      <!-- 启动或停止 -->
      <div class="" v-if="modalType == 'startSmoke'">
        <div class="startSmoke-select">
          <div class="label">1#风机：</div>
          <a-radio-group v-model:value="mainWindIsShow1" @change="changeMotor" name="mainWind1">
            <a-radio value="open">开启</a-radio>
            <a-radio value="stop">停止</a-radio>
          </a-radio-group>
        </div>
        <div class="startSmoke-select">
          <div class="label">2#风机：</div>
          <a-radio-group v-model:value="mainWindIsShow2" @change="changeMotor" name="mainWind2">
            <a-radio value="open">开启</a-radio>
            <a-radio value="stop">停止</a-radio>
          </a-radio-group>
        </div>
      </div>
      <div class="vent-flex-row input-box">
        <div class="label">操作密码：</div>
        <a-input size="small" type="password" v-model:value="passWord" />
      </div>
    </div>
  </a-modal>
</template>

<script setup lang="ts">
  import '/@/design/vent/modal.less';
  import { ExclamationCircleFilled } from '@ant-design/icons-vue';
  import FanEchrats from '/@/views/vent/monitorManager/mainFanMonitor/fanEchrats.vue';
  import { onBeforeMount, computed, ComputedRef, ref, onMounted, nextTick, onUnmounted, reactive, toRaw, toRef, toRefs } from 'vue';
  import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
  import HistoryTable from '../comment/HistoryTable.vue';
  import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
  import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
  import { dataColumns, stateColumns, getData, getMonitorData } from './main.data';
  import { deviceControlApi } from '/@/api/vent/index';
  import { mountedThree, destroy, addText, play, setModelType, resetEcharts } from './main.threejs';
  import LivePlayer from '@liveqing/liveplayer-v3';
  import { SvgIcon } from '/@/components/Icon';
  import { list, pathList, deviceList, testWind } from './main.api';
  import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
  import { getTableList } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
  import { message } from 'ant-design-vue';
  const modalTypeArr = reactive({
    centerBtnArr: [
      {
        key: 'startSmoke',
        value: '启动/停止',
      },
      {
        key: 'changeSmoke',
        value: '不停风倒机',
      },
      {
        key: 'changeDirection',
        value: '一键反风',
      },
      {
        key: 'frequency',
        value: '一键调频',
      },
    ],
  });
  const player1 = ref(null);
  const activeKey = ref('1');
  const loading = ref(false);
  const modalIsShow = ref<boolean>(false); // 是否显示模态框
  const modalTitle = ref(''); // 模态框标题显示内容，根据设备操作类型决定
  const modalType = ref(''); // 模态框内容显示类型，设备操作类型
  const frequencyVal = ref(40); //频率
  const mainWindIsShow1 = ref('open'); // 1#风机默认启动
  const mainWindIsShow2 = ref('stop'); // 2#风机默认不启动
  const frontMonitorIsShow = ref(true); // 存放1#风机临时状态，保存模态框取消时，还需要返回之前的值
  const backMonitorIsShow = ref(false); // 存放2#风机临时状态，保存模态框取消时，还需要返回之前的值
  const passWord = ref('');
  // 默认初始是第一行 (默认n%2==0时是主机，n%2==1时是备机)
  const selectRowIndex = ref(0);
  // 默认数据左边监测的是1#风机
  const dataMonitorRowIndex = ref(0);
  // 默认数据右边监测的是1#风机
  const warningMonitorRowIndex = ref(0);

  // 监测数据
  const selectData = reactive({
    deviceID: '',
    yc2: '-', // 静压
    dqPa: '-', //全压
    fanM3: '-', //电机流量
  });

  const flvURL1 = () => {
    // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
    return `/video/mainWind.mp4`;
  };

  // const dataSource = computed(() => {
  //   const data = [...getRecordList()] || [];
  //   Object.assign(selectData, toRaw(data[selectRowIndex.value]));
  //   addFmText(selectData);
  //   return data;
  // });

  const dataSource = ref([]);

  const propTypeArr = new Map([
    ['incipientWindSpeed1', 'V1风速'],
    ['incipientWindSpeed2', 'V2风速'],
    ['incipientWindSpeed3', 'V3风速'],
    ['sourcePressure', '气源压力'],
  ]);
  const tabChange = (activeKeyVal) => {
    activeKey.value = activeKeyVal;
  };

  // 设备数据
  const controlType = ref(1);

  const getDataSource = async () => {
    const res = await list({ devicetype: 'fan', pagetype: 'normal' });
    const dataArr = res.msgTxt[0].datalist || [];
    dataSource.value = [];
    dataArr.forEach((data) => {
      if (data.deviceType?.startsWith('fanmain')) {
        const readData = data.readData;
        data = Object.assign(data, readData);
        dataSource.value.push(data);
      }
    });
    const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
    return data;
  };
  // https获取监测数据
  let timer: null | NodeJS.Timeout = null;
  const getMonitor = () => {
    if (Object.prototype.toString.call(timer) === '[object Null]') {
      timer = setTimeout(async () => {
        await getDataSource();
        Object.assign(selectData, deviceBaseList.value, dataSource.value[selectRowIndex.value]);
        addText(selectData);
        // playAnimation(data, selectData.maxarea);
        if (timer) {
          timer = null;
        }
        getMonitor();
      }, 1000);
    }
  };

  // const getMonitor = () => {
  //   if (Object.prototype.toString.call(timer) === '[object Null]') {
  //     timer = setTimeout(() => {
  //       if (timer) {
  //         timer = null;
  //       }
  //       dataSource.value = getData();
  //       // 默认前两行（主、备）是正在监测的主通风机, 实际中需要手动选中
  //       const monitorData = getMonitorData();
  //       Object.assign(dataSource.value[selectRowIndex.value], monitorData);
  //       const data: any = toRaw(dataSource.value[selectRowIndex.value]);
  //       Object.assign(selectData, data);
  //       resetEcharts('mainWindRect');
  //       getMonitor();
  //     }, 1000);
  //   }
  // };

  const deviceBaseList = ref([]);
  const getDeviceBaseList = () => {
    getTableList({ pageSize: 1000 }).then((res) => {
      deviceBaseList.value = res.records;
    });
  };
  // 切换检测数据
  const getSelectRow = (id) => {
    if (!id) return;
    loading.value = true;
    const baseDataIndex: any = dataSource.value.findIndex((baseData: any) => baseData.deviceID === id);
    selectRowIndex.value = baseDataIndex;
    const type = 'mainWindRect';
    // const type = baseDataIndex > 0 ? 'fm' : 'fc';
    setModelType(type).then(() => {
      loading.value = false;
    });
    const data = dataSource.value[baseDataIndex];
    mainWindIsShow1.value = 'open';
    mainWindIsShow2.value = 'stop';
    if (data['fanStart1'] == 1) {
      mainWindIsShow1.value = 'open';
    } else if (data['fanStart2'] == 1) {
      mainWindIsShow2.value = 'open';
    }
    play('initiatePlay', 'front', frequencyVal.value, 'open', 'tubPositivePath');
    return;
  };

  const start = (flag) => {
    const data = {
      deviceid: selectData.deviceID,
      devicetype: selectData.deviceType,
      paramcode: flag == 1 ? 'testStart' : '',
    };
    deviceControlApi(data).then((res) => {
      if (res.success) {
        //
      }
    });
  };

  // 切换左右两边1#、2#风机的监测数据
  const selectDevice = (key, val) => {
    if (key === 'dataMonitorRowIndex') {
      dataMonitorRowIndex.value = val;
    } else {
      warningMonitorRowIndex.value = val;
    }
  };

  // 打开并设置modal的标题
  const showModal = (obj) => {
    modalType.value = obj.key;
    modalTitle.value = obj.value;
    modalIsShow.value = true;
  };
  const changeMotor = (e) => {
    const target = e.target;
    if (target.name === 'mainWind1') {
      if (target.value === 'open') {
        mainWindIsShow2.value = 'stop';
      }
    } else if (target.name === 'mainWind2') {
      if (target.value === 'open') {
        mainWindIsShow1.value = 'stop';
      }
    }
  };
  // 风机操作
  const handleOk = (e: MouseEvent) => {
    if (passWord.value !== '123456') {
      message.warning('密码不正确，请重新输入');
      return;
    }

    if (selectRowIndex.value % 2 == 0) {
      selectRowIndex.value = selectRowIndex.value + 1;
    } else {
      selectRowIndex.value = selectRowIndex.value - 1;
    }
    const frequency = frequencyVal.value;
    if (modalType.value == 'startSmoke') {
      if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
        frontMonitorIsShow.value = true;
        backMonitorIsShow.value = false;
        play('startSmoke', 'front', frequency, 'open', 'tubPositivePath');
        play('startSmoke', 'back', null, 'close', '');
      } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
        frontMonitorIsShow.value = false;
        backMonitorIsShow.value = true;
        play('startSmoke', 'back', frequency, 'open', 'tubPositivePath');
        play('startSmoke', 'front', null, 'close', '');
      } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
        frontMonitorIsShow.value = false;
        backMonitorIsShow.value = false;
        play('startSmoke', 'back', null, 'stop', '');
        play('startSmoke', 'front', null, 'close', '');
      }
    } else if (modalType.value == 'changeDirection') {
      if (mainWindIsShow1.value == 'open') {
        play('changeDirection', 'front', frequency, null, 'tubInversePath');
      } else if (mainWindIsShow2.value == 'open') {
        play('changeDirection', 'back', null, null, 'tubInversePath');
      }
    } else if (modalType.value == 'changeSmoke') {
      debugger;
      // 不停风倒机的同时要切换当前监测数据
      if (mainWindIsShow1.value == 'open') {
        frontMonitorIsShow.value = false;
        backMonitorIsShow.value = true;
        // 切换到后面那台风，并需要设置后面风机的频率
        // play('changeSmoke', 'back', dataSource.value[selectRowIndex.value + 1]['frequency'], null, 'tubInversePath');
        play('changeSmoke', 'back', frequency, null, 'tubPositivePath');
      } else if (mainWindIsShow2.value == 'open') {
        frontMonitorIsShow.value = true;
        backMonitorIsShow.value = false;
        // 切换到前面那台风，并需要设置前面风机的频率
        play('changeSmoke', 'front', frequency, null, 'tubPositivePath');
      }
    } else if (modalType.value == 'frequency') {
      if (mainWindIsShow1.value == 'open') {
        play('frequency', 'front', frequency);
      } else if (mainWindIsShow2.value == 'open') {
        play('frequency', 'back', frequency);
      }
    }
    modalTitle.value = '';
    modalIsShow.value = false;
  };

  // 取消
  const handleCancel = () => {
    if (modalType.value == 'startSmoke') {
      const data = dataSource.value[selectRowIndex.value];
      mainWindIsShow1.value = 'stop';
      mainWindIsShow2.value = 'stop';
      if (data['fanStart1'] == 1) {
        mainWindIsShow1.value = 'open';
      } else if (data['fanStart2'] == 1) {
        mainWindIsShow2.value = 'open';
      }
    }
  };

  onBeforeMount(() => {
    // document.body.addEventListener('mousedown', addPlayVideo, true);
    getDeviceBaseList();
  });

  onMounted(() => {
    loading.value = true;
    mountedThree(player1.value).then(async () => {
      // await setModelType('mainWindRect');
      getMonitor();
      // addText('mainWindRect');
      // play('initiatePlay', 'front', frequencyVal.value, 'open', 'tubPositivePath');
    });
  });

  onUnmounted(() => {
    destroy();
    if (timer) {
      clearTimeout(timer);
      timer = undefined;
    }
  });
</script>
<style scoped lang="less">
  :deep(.ant-tabs-tabpane-active) {
    overflow: auto;
  }
  .head-line {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    .button-box {
      position: relative;
      padding: 5px;
      border: 1px transparent solid;
      border-radius: 5px;
      margin-left: 8px;
      margin-right: 8px;
      width: auto;
      height: 34px;
      border: 1px solid #65dbea;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      padding: 0 15px;
      cursor: pointer;
      &:hover {
        background: linear-gradient(#3eb2ff55, #00c3ff55);
      }
      &::before {
        width: calc(100% - 6px);
        height: 26px;
        content: '';
        position: absolute;
        top: 3px;
        right: 0;
        left: 3px;
        bottom: 0;
        z-index: -1;
        border-radius: inherit; /*important*/
        background: linear-gradient(#014978, #3bf3fc);
      }
    }
  }

  .control-group,
  .top-box {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    width: 915px !important;
    height: 75px !important;
    left: 50% !important;
    top: 32px !important;
    transform: translateX(-50%) !important;
    background: url('/@/assets/images/vent/tab-group-bg.png') no-repeat !important;
    padding: 0 30px !important;
    .button-box {
      height: 35px !important;
      margin-left: 15px !important;
      margin-right: 15px !important;
      padding: 0 30px !important;
      border: 1px transparent solid;
      border: 1px solid #65dbea;
      &:hover {
        background: linear-gradient(#2cd1ff55, #1eb0ff55) !important;
      }
      &::before {
        height: 27px !important;
        background: linear-gradient(#1fa6cb, #127cb5) !important;
      }
      &::after {
        top: 35px !important;
      }
    }
  }
  .data-show-box {
    position: relative;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px;
    color: #ffffff;
    z-index: 999;
    .data-item {
      pointer-events: auto;
      .item-header {
        width: 374px;
        background: url('/@/assets/images/vent/lr-top-bg.png') no-repeat;
        background-size: auto;
        height: 32px;
        text-align: center;
        line-height: 34px;
        font-size: 15px;
        font-weight: 600;
        color: #fafafa;
      }
      .item-container {
        width: 346px;
        margin: 0 14px;
        padding: 10px;
        background: #004aac33;
        backdrop-filter: blur(2px);
        .tab {
          width: 323px;
          background: url('/@/assets/images/vent/lr-tab-bg.png') no-repeat;
          display: flex;
          .tab-item {
            flex: 1;
            text-align: center;
            padding-top: 2px;
            color: #ffffff99;
            cursor: pointer;
            &:hover {
              color: #ffffff;
            }
          }
          .tab-item-active-l {
            color: #ffffff;
            background-image: url('/@/assets/images/vent/l-tab-active.png');
            background-repeat: no-repeat;
            background-size: auto;
            background-position: 6px 3px;
          }
          .tab-item-active-r {
            color: #ffffff;
            background-image: url('/@/assets/images/vent/r-tab-active.png');
            background-repeat: no-repeat;
            background-position: 0 3px;
          }
        }
        .container-group {
          width: 314px;
          margin: 0px 4px;
          padding: 10px 0;
          min-height: 472px;
          background: linear-gradient(to right, #007bff22, #2081ff05);
        }
        .container-group-l {
          .container-item {
            width: 100%;
            height: 63px;
            display: flex;
            padding: 10px 0 0 20px;
            margin-bottom: 5px;
            position: relative;
            background: url('/@/assets/images/vent/plane-bottom.png') no-repeat;
            background-size: auto;
            background-position: bottom;
            &::before {
              content: '';
              display: block;
              width: 100%;
              height: 5px;
              position: absolute;
              top: 62px;
              left: 0;
              background-color: #73f4ff66;
              backdrop-filter: blur(5px);
            }
            .item-icon {
              width: 54px;
              height: 45px;
              background: url('/@/assets/images/vent/plane-icon-bg.png') no-repeat;
              background-size: cover;
              .icon-style {
                margin: 10px 0 0 18px;
              }
            }
            .item-name {
              width: 180px;
              line-height: 60px;
            }
            .item-value {
              position: relative;
              height: 26px;
              line-height: 24px;
              margin: 15px 0;
              text-align: center;
              width: 80px;
              border: 1px solid #00f5fe;
              border-radius: 13px;
              background: linear-gradient(to right, #00f5fe44, #0090ff44);
              &::before {
                width: 6px;
                height: 6px;
                content: '';
                position: absolute;
                left: -3px;
                top: 8px;
                background: #ffa500;
                border-radius: 3px;
              }
            }
          }
        }
        .warning-header {
          display: flex;
          font-size: 14px;
          .header-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            margin: 5px 10px;
            justify-content: center;
            align-items: center;
            .header-title {
              color: #39e7fe;
            }
            .header-value {
              width: 133px;
              height: 56px;
              font-weight: 600;
              font-family: 'douyuFont';
              font-size: 16px;
              color: #ffa500;
              display: flex;
              justify-content: center;
              align-items: center;
              background: url('/@/assets/images/vent/count-header-bg.png') no-repeat;
            }
          }
        }
        .warning-group {
          padding: 0 10px;
          position: relative;
          &::before {
            content: '';
            display: block;
            width: 1px;
            height: 100%;
            position: absolute;
            left: 12px;
            background-color: #00f5fe;
          }
          .warning-item {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            height: 38px;
            .item-name {
              .icon {
                width: 6px;
                height: 6px;
                display: inline-block;
                background-color: #1cd5ff;
                border-radius: 3px;
                position: relative;
                margin-right: 5px;
                &::before {
                  content: '';
                  width: 10px;
                  height: 10px;
                  display: block;
                  border: 1px solid #34edff99;
                  border-radius: 5px;
                  position: absolute;
                  top: -2px;
                  left: -2px;
                }
              }
            }
          }
        }
      }
    }
  }

  .threejs-Object-CSS {
    .elementTag {
      backdrop-filter: blur(2px);
      .elementContent {
        width: 220px;
        background-color: rgba(0, 0, 0, 0.3);
        box-shadow: 0px 0px 40px rgb(0 90 131 / 55%) inset;
        border: 2px solid rgb(153 176 195 / 55%);
        padding: 15px 20px 0px 20px;
        font-size: 15px;
        p {
          color: #f2a500;
        }
        span {
          // color: #74e9fe;
          color: #fff;
        }
      }
      .elementContent-r {
        &::before {
          right: 120px;
        }
        &::after {
          right: 270px;
          border: 4px solid rgb(0, 221, 255); //rgb(0 220 255 / 75%)
          background: #a7a7a766;
        }
      }
    }
  }

  ::v-deep(.ant-table-wrapper) {
    height: 100% !important;
  }
  ::v-deep(.ant-spin-container) {
    height: 100% !important;
    overflow-y: auto;
  }
  .label {
    max-width: 220px;
  }
  .ant-input {
    width: 150px;
  }
</style>
