
<template>
  <audio ref="audioRef">
    <source :src="src" autoplay />
  </audio>
  <router-view v-slot="{ Component }" v-if="isRouterAlive">
    <keep-alive :include="store.getters.keepLiiveRoute">
      <Component :is="Component"></Component>
    </keep-alive>
  </router-view>
</template>

<script setup>
import { ref, nextTick, provide, onMounted, watchEffect } from "vue";
import { useStore } from "vuex";
import { getItem } from "@/utils/storage";
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
import { qcckPost, qcckGet, qcckPut, qcckDelete } from "@/api/qcckApi.js";
const store = useStore();
generateNewStyle(store.getters.mainColor).then((newStyle) => {
  writeNewStyle(newStyle);
});

const src = require("@/assets/sound.wav");
const isRouterAlive = ref(true);
const reload = () => {
  isRouterAlive.value = false;
  nextTick(() => {
    isRouterAlive.value = true;
  });
};
const isAutoplay = window.localStorage.getItem("isAutoplay");
provide("reload", reload);
onMounted(() => {
  let dept = getItem("deptId");
  if (dept) {
    document.title = "群防群治平台";
  } else {
    document.title = "登录";
  }
});




const audioRef = ref();
</script>

<style lang="scss">
@import "./styles/index.scss";

body {
  margin: 0px;
  padding: 0px;
  font-size: 14px;
}

ul {
  margin: 0px;
  padding: 0px;
}

li {
  list-style-type: none;
}

#app {
  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
    Microsoft YaHei, SimSun, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #fff;
  overflow-x: auto;
  background: url("~@/assets/lz/body-bg.png") no-repeat;
  // background-size: 100% 100%;
}

.divOverlay {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
}

.divOverlay .circleBox {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  border: none;
  background-color: rgba(234, 85, 20, 0.4);
  border-radius: 50%;
  animation: animate 2s linear infinite;
  animation-delay: calc(0.5s * var(--i));
}

@keyframes animate {
  0% {
    width: 0;
    height: 0;
  }

  50% {
    opacity: 1;
  }

  0% {
    width: 50px;
    height: 50px;
    opacity: 0;
  }
}

.smallcircle {
  width: 16px;
  height: 16px;
  background-color: red;
  border-radius: 50%;
  position: absolute;
  top: 0;
}

.smallcircle::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-color: red;
  border-radius: 50%;
  opacity: 0.4;
  animation: scale 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
}

@keyframes scale {
  0% {
    transform: scale(1);
  }

  75% {
    transform: scale(3);
  }

  100% {
    opacity: 0;
  }
}

.bigcircle {
  width: 16px;
  height: 16px;
  background-color: red;
  border-radius: 50%;
  animation: scales 1s infinite cubic-bezier(0, 0, 0.49, 1.02);
}

@keyframes scales {
  0% {
    transform: scale(1);
  }

  75% {
    transform: scale(3);
  }

  100% {
    opacity: 0;
  }
}

.poppercz {
  background: #13437b !important;
  border: 1px solid #1693ff !important;
  color: #fff !important;
}

//只显示一排内容
.one_text_detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

//只显示二排内容
.two_text_detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

//只显示三排内容
.text_detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolTips[data-title] {
  position: relative;

  &:after {
    content: attr(data-title);
    background-color: rgba(80, 79, 79);
    color: #fff;
    font-size: 13px;
    position: absolute;
    padding: 4px 10px;
    right: 0px;
    bottom: -10px;
    border-radius: 4px;
    white-space: pre-wrap;
    z-index: 999999;
    display: none;
  }
}

.squreBox {
  padding: 6px 10px;
  border: 1px solid rgb(28, 161, 223);
  border-radius: 4px;
  background: rgba(12, 21, 45, 0.9);
  color: #fff;
}

// 不显示滚动条
.noScollLine::-webkit-scrollbar {
  width: 0 !important;
}

.textCenterPoint {
  padding: 2px 4px;
  border-radius: 4px;
  box-sizing: border-box;
  background: #073c77;
  color: yellow;
  font-size: 12px;
  transform: scale(0.9);
  cursor: pointer;
}

.gapText {
  font-size: 60px;
  color: rgb(180, 180, 180);
  font-weight: 600;
  text-shadow: 0 0 4px #fff;
}

v-deep .el-loading-mask {
  background: rgba(0, 0, 0, 0.5) !important;
}

.textimeFzyc {
  background: linear-gradient(to bottom, #ffffff, #02f131);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 13px;
  font-weight: 600;
}

.makerTitle {
  background-color: #02163b;
  color: #4169e1;
  padding: 2px 6px;
  border: 1px solid #07539a;
}

.makerTitleLine {
  color: #25b5ce;
  background: rgba(27, 53, 82);
}

.makerTitleUnLine {
  color: #000000;
  background: rgba(148, 150, 156);
}

.makerTitlezb {
  color: #ff0000;
  background: yellow;
  padding: 2px 6px;
  box-sizing: border-box;
  border-radius: 2px;
}

.makerTitleGapText {
  font-size: 60px;
  color: rgb(180, 180, 180);
  font-weight: 600;
  text-shadow: 0 0 4px #fff;
}</style>
