<template>
  <div class="apphome"  >
    <el-container>
      <el-header>
        <div class="bgk1">
        <div class="d-flex jc-center title_wrap">
          <div class="ve_logo_img">
              <el-image style="height: 100%" :src="logo" fit="contain"></el-image>
            </div>
          <div class="timers">
            {{  headertime.dateYear }} {{  headertime.dateWeek }} {{  headertime.dateDay }}
          </div>
          <div class="titlebtn titleanniu imgtupian" @click="handleSelect('1')">突水推演</div>
            <div class="titlebtn titleanniu imgtupian"  @click="handleSelect('2')">火灾推演</div>
          <div class="d-flex jc-center s-content">
            <div class="title tiletimg">
            <!-- <div class="ve_logo_img">
              <el-image style="height: 100%" :src="logo" fit="contain"></el-image>
            </div> -->
          
              <span class="title-text">矿道灾情软件推演</span>
            </div>
          </div>
          
          <div class="titlebtn titleanniu imgtupian2" style="margin-left: 0px;" @click="handleSelect('3')" >瓦斯爆炸推演</div>
          <div class="titlebtn titleanniu imgtupian2" style="margin-left: 0px;" @click="handleSelect('5')" >一维模型</div>
            <div class="titlebtn titleanniu imgtupian2" @click="handleSelect('4')"  >模型库</div>
        </div>
      </div>
      </el-header>
  
      <el-main>
        <div class="bgk2">
          <div>
            <ul>
              <li class="s1" @click="handleSelect('2')" >
                <el-image :src="s1" fit="contain"></el-image>
                <span class="stext">火灾推演</span>
              </li>
              <li class="s2" @click="handleSelect('1')">
                <el-image :src="s2" fit="contain"></el-image>
                <span class="stext">突水推演</span>
              </li>
              <li class="s3" @click="handleSelect('3')">
                <el-image :src="s3" fit="contain"></el-image>
                <span class="stext">瓦斯爆炸推演</span>
              </li>
              <li  class="s4" @click="handleSelect('4')">   <el-image :src="s4" fit="contain"></el-image>
                <span class="stext">模型库</span>

              </li>
            </ul>
          </div>
        </div>


        <Dialoges
          ref="lliudialog"
          :addselect="addselect"
          @handleSelect="handleSelect"
          :classradio="classradio" 
        ></Dialoges>
   
      </el-main>

    </el-container>
  </div>
</template>

<script setup>
import { ref, onMounted, reactive, nextTick } from "vue";
import { RouterView, RouterLink, useRouter,useRoute} from "vue-router";
import VScaleScreen from 'v-scale-screen'
import '@/utils/flexible'
import Dialoges from "./InfoDialoges.vue";
import logo from "@/assets/logo.png";
import { ElMessage, ElButton, ElDialog, ElSelect, formEmits } from 'element-plus'
import s1 from "@/assets/img/s1.png";
import s2 from "@/assets/img/s2.png";
import s3 from "@/assets/img/s3.png";
import s4 from "@/assets/img/s4.png";
import b from "@/assets/img/Group1317.png";
import { timestampToTime,formatTime } from "@/js/lindex.js";
import mitts from "@/utils/Bus";
import { contains } from "@kitware/vtk.js/Common/DataModel/BoundingBox";

// import { vtkmodel } from "@/control/vtkModel.js";

let lliudialog = ref();
let sourcedis = ref();
let classradio = ref();
let boundary = ref();
let tanimation = ref();
let menumine=ref();
let menusen=ref();
const title = "灾情推演软件";
const activeIndex = ref("1");
const activeIndex2 = ref("1");
let titlefalse = ref(false);
let resultbidui = ref();
let mnindex = ref("");
let resultleft = ref({});
let datares=ref({});
let resultright = ref({});
let headertime=ref({
       timing: null,
      loading: true,
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
})
      
let headerobj = ref({
  time: "",
  name: "",
});
let valzaiqing = ref("");
let router = useRouter();
let route=useRoute();
let sgdata = ref({});
let aid = ref();
onMounted(() => {
  timeFn()
  console.log(route.query )
  if(route.query.classradio!=undefined){
    classradio.value=route.query.classradio;
    handleSelect(route.query.classradio)

  }
});
// 跳转页面,{ aid:aid.value}

// 当前时间
const timeFn=()=> {
  headertime.value.timing = setInterval(() => {
    headertime.value.dateDay = formatTime(new Date(), "HH: mm: ss");
    headertime.value.dateYear = formatTime(new Date(), "yyyy-MM-dd");
    headertime.value.dateWeek =  headertime.value.weekday[new Date().getDay()];
      }, 1000);
    }
const addselect = () => {
  classradio.value = lliudialog.value.classradio;
};




const handleSelect = (key) => {

  activeIndex.value =key;
  switch (key) {
    case "1":
    classradio.value="Water";
     lliudialog.value.classclick( classradio.value);
    
      break;
    case "2":
    classradio.value="Fire";
   lliudialog.value.classclick( classradio.value);
      break;
    case "3":
    classradio.value="Gass";
     lliudialog.value.classclick( classradio.value);
       break;
    case "4":
    classradio.value="Model";
      break;
    case "5":

    default:
      break;
  }
};
</script>

<style lang="scss" scoped>

.title_wrap{
  display: flex;
  justify-content: center;
    color: #fff;
}
.apphome {
  .el-main {
    --el-main-padding: 0 !important;
  }

  .el-container {
    padding: 0;
    margin: 0;
    width: 100%;
    position: absolute;
    z-index: 206;
    top: 0;
  }
}

.ve_menu_logo {
  width: 100%;
  height: 70px;
  background: #0d1639;
  white-space: nowrap;
  text-align: left;
  overflow: hidden;
  display: flex;
  background: #0d1639;
  box-shadow: inset 0px 0px 17px 5px rgba(12, 97, 197, 0.2);
  border-radius: 0px 0px 0px 0px;
  border-bottom: 1px solid;
  box-sizing: border-box;
  border-image: linear-gradient(28deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0)) 1 1;

  .ve_title {
  }

  .ve_logo_img {
    padding-left: 30px;
    padding-right: 30px;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
    padding: 15px;
  }

  .ve_logo_title {
    width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    margin: 0;
    vertical-align: middle;
    color: #68adff;
    font-size: 20px;
  }

  .el-menu-demo {
    width: 60% !important;
    height: 70px;
    border: none !important;
    background: rgba(12, 97, 197, 0);

    .el-menu-item {
      position: relative;
      width: 97px;
      font-family: Microsoft YaHei UI, Microsoft YaHei UI;
      font-weight: bold;
      font-size: 13px;
      color: #68adff;
      line-height: 15px;
      text-align: center;
      font-style: normal;
      text-transform: none;
      width: 110px;
      height: 70px;
      border-radius: 0px 0px 0px 0px;
      border: none;
    }

    .is-active {
      width: 110px;
      height: 70px;
      background: radial-gradient(ellipse at 54px 0px, #3aa0ff -37%, #123066 53%);
      border-radius: 0px 0px 0px 0px;
      border: 1px solid;
      border-left: 1px solid rgba(16, 92, 240, 1);
      border-right: 1px solid rgba(18, 48, 102, 1);
      border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(18, 48, 102, 1)) 1
        1;

      &:after {
        width: 24px;
        height: 1px;
        background-color: #fff;
        -webkit-transition: all ease-out 0.2s;
        transition: all ease-out 0.2s;
        content: "";
        position: absolute;
        left: 50%;
        bottom: 15px;
        webkit-transform: translate(-50%, 0%);
        -moz-transform: translate(-50%, 0%);
        transform: translate(-50%, 0%);
      }
    }
  }

  .ve_right {
    // width: 350px;
    height: 70px;
    overflow: hidden;
    position: absolute;
    right: 0;
    display: flex;

    .ve_time {
      width: 190px;
      height: 55px;
      padding-top: 15px;
      height: 70px;
      overflow: hidden;
      border-radius: 0px 0px 0px 0px;
      border-left: 2px solid rgba(12, 97, 197, 0.2);
      border-right: 2px solid rgba(12, 97, 197, 0.2);
      box-sizing: border-box;
      padding: 15px 5px;
      // border-image: linear-gradient(347deg, rgba(31, 107, 255, 1), rgba(164, 195, 255, 1)) 1 1;
      span {
        display: block;
        font-family: Microsoft YaHei UI, Microsoft YaHei UI;
        color: #ffffff;
        text-align: center;
        font-style: normal;
        text-transform: none;
      }

      .l_huoqing {
        font-size: 13px;
        line-height: 15px;
        font-weight: bold;
        line-height: 2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .l_time {
        font-size: 12px;
        line-height: 14px;
        font-weight: 400;
      }
    }

    .ve_timeioc {
      width: 150px;
      height: 70px;
      // border-radius: 0px 0px 0px 0px;
      // border: 1px solid;
      // border-image: linear-gradient(347deg, rgba(16, 92, 240, 1), rgba(164, 195, 255, 1)) 1 1;
      font-family: Microsoft YaHei UI, Microsoft YaHei UI;
      font-weight: bold;
      font-size: 13px;
      color: #68adff;
      line-height: 15px;
      text-align: center;
      font-style: normal;
      text-transform: none;
      display: flex;
      justify-content: center;
      align-items: center;

      span {
        padding-left: 15px;
      }
    }
  }
}
</style>

<style>
 /* @import '../../src/style/style.css'; */
body {
  width: 100%;
  height: 100vh;
  background: #161a2a;
}

button:focus,
button:focus-visible {
  outline: none;
}

.l_Dialog {
  position: relative;
}
.main-conyeny{
    position: absolute;
    z-index: 206;
  top: 70px;
}
.L_aside {
  margin-top: 10px;
    overflow: hidden;
}
</style>
