<template>
  <router-view v-slot="{ Component }" v-if="isRouterAlive">
    <keep-alive :include="store.getters.keepLiiveRoute">
      <Watermark :text="content" :color="'rgba(0, 0, 0, .15)'">
        <Component :is="Component"></Component>
      </Watermark>
    </keep-alive>
  </router-view>
</template>
<script setup>
import { ref, nextTick, provide, onMounted } from "vue";
import { useStore } from "vuex";
import { getItem } from "@/utils/storage";
import Watermark from "@/components/Watermark.vue";
import { timeValidate } from '@/utils/tools'
import { qcckPost, qcckGet, qcckPut, qcckDelete } from "@/api/qcckApi.js";
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
const store = useStore();
generateNewStyle(store.getters.mainColor).then((newStyle) => {
  writeNewStyle(newStyle);
});
const isRouterAlive = ref(true);
const reload = () => {
  isRouterAlive.value = false;
  nextTick(() => {
    isRouterAlive.value = true;
  });
};
provide("reload", reload);
onMounted(() => {
  let dept = getItem("deptId");
  frashJs()
  document.title = "保安管理";
});
const content = ref([])
const frashJs = () => {
  const sfzh = getItem("idEntityCard")
  const userName = getItem("USERNAME")
  const time = timeValidate()
  // content.value = [userName, sfzh, time, "平安林芝大数据平台", "禁止泄露公民个人信息和警务工作秘密"]
}
</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:#263445;
}

//只显示一排内容
.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;
}

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

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

@font-face {
  font-family: "DigifaceWide";
  src: url("~@/assets/font/DigifaceWide.ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "HANYILINGXINTIJIAN";
  src: url("~@/assets/font/HANYILINGXINTIJIAN-1.TTF");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "YSBTH";
  src: url("~@/assets/font/YSBTH.ttf");
  font-weight: normal;
  font-style: normal;
}

.makerTitleLine {
  color: #000;
}
</style>
